diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 51e9993ff..c81f79c7c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,7 +2,7 @@ name: "Publish" on: push: - branches: [ rel-8.1.3 ] + branches: [ rel-8.2.0 ] env: DOTNET_VERSION: "8.0.200" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2f7d84fd3..5aee280e8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,7 +2,7 @@ name: "Tagged Release" on: push: - branches: [ rel-8.1.3 ] + branches: [ rel-8.2.0 ] jobs: tagged-release: @@ -14,4 +14,4 @@ jobs: with: repo_token: "${{ secrets.GITHUB_TOKEN }}" prerelease: false - automatic_release_tag: "8.1.3" + automatic_release_tag: "8.2.0" diff --git a/Directory.Packages.props b/Directory.Packages.props index 75dce48a3..f39241b93 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -2,17 +2,16 @@ 8.1.1 2.14.1 - 8.1.3 - 8.1.3 + 8.2.0 + 8.2.0 8.0.0 8.0.0 8.0.0 true - - + @@ -133,10 +132,9 @@ - - + @@ -152,9 +150,8 @@ - + - @@ -172,7 +169,6 @@ - @@ -181,7 +177,6 @@ - @@ -198,7 +193,6 @@ - @@ -210,13 +204,11 @@ - - @@ -228,7 +220,7 @@ - + @@ -236,6 +228,8 @@ + + diff --git a/apps/vue/src/api/abp/localization/index.ts b/apps/vue/src/api/abp/localization/index.ts index ae2281756..968543ecc 100644 --- a/apps/vue/src/api/abp/localization/index.ts +++ b/apps/vue/src/api/abp/localization/index.ts @@ -5,7 +5,7 @@ export const GetAsyncByInput = (input: { onlyDynamics?: boolean; }) => { return defHttp.get({ - url: 'api/abp/application-localization"', + url: '/api/abp/application-localization"', params: input, }); }; \ No newline at end of file diff --git a/apps/vue/src/api/account/profiles/index.ts b/apps/vue/src/api/account/profiles/index.ts index d75bd4ba1..2b5e5a643 100644 --- a/apps/vue/src/api/account/profiles/index.ts +++ b/apps/vue/src/api/account/profiles/index.ts @@ -12,7 +12,9 @@ import { AuthenticatorDto, VerifyAuthenticatorCodeInput, AuthenticatorRecoveryCodeDto, + GetUserSessionsInput, } from './model'; +import { IdentitySessionDto } from '../../identity/sessions/model'; export const get = () => { return defHttp.get({ @@ -92,4 +94,25 @@ export const resetAuthenticator = () => { return defHttp.post({ url: '/api/account/my-profile/reset-authenticator', }); +} +/** + * 查询当前用户会话列表 + * @param { GetUserSessionsInput } input 查询参数 + * @returns { Promise> } + */ +export const getSessions = (input?: GetUserSessionsInput): Promise> => { + return defHttp.get>({ + url: '/api/account/my-profile/sessions', + params: input, + }); +}; +/** + * 撤销会话 + * @param { string } sessionId 会话id + * @returns { Promise } + */ +export const revokeSession = (sessionId: string): Promise => { + return defHttp.delete({ + url: `/api/account/my-profile/sessions/${sessionId}/revoke`, + }); } \ No newline at end of file diff --git a/apps/vue/src/api/account/profiles/model/index.ts b/apps/vue/src/api/account/profiles/model/index.ts index 8e3cc4985..6c53523a7 100644 --- a/apps/vue/src/api/account/profiles/model/index.ts +++ b/apps/vue/src/api/account/profiles/model/index.ts @@ -60,4 +60,9 @@ interface Profile extends ExtensibleObject, IHasConcurrencyStamp { export interface VerifyAuthenticatorCodeInput { authenticatorCode: string; } + + export interface GetUserSessionsInput extends PagedAndSortedResultRequestDto { + device?: string; + clientId?: string; + } \ No newline at end of file diff --git a/apps/vue/src/api/auditing/security-logs/index.ts b/apps/vue/src/api/auditing/security-logs/index.ts index f96f92756..1a71adced 100644 --- a/apps/vue/src/api/auditing/security-logs/index.ts +++ b/apps/vue/src/api/auditing/security-logs/index.ts @@ -15,7 +15,7 @@ export const getById = (id: string) => { export const getList = (input: GetSecurityLogPagedRequest) => { return defHttp.get>({ - url: 'api/auditing/security-log', + url: '/api/auditing/security-log', params: input, }); }; diff --git a/apps/vue/src/api/identity/claims/index.ts b/apps/vue/src/api/identity/claims/index.ts index bd26bd504..9a1f899ac 100644 --- a/apps/vue/src/api/identity/claims/index.ts +++ b/apps/vue/src/api/identity/claims/index.ts @@ -29,7 +29,7 @@ export const update = (id: string, input: UpdateIdentityClaimType) => { export const getById = (id: string) => { return defHttp.get({ - url: `'/api/identity/claim-types/${id}'`, + url: `/api/identity/claim-types/${id}'`, }); }; diff --git a/apps/vue/src/api/identity/organization-units/index.ts b/apps/vue/src/api/identity/organization-units/index.ts index 091f68b16..f97a875c4 100644 --- a/apps/vue/src/api/identity/organization-units/index.ts +++ b/apps/vue/src/api/identity/organization-units/index.ts @@ -88,7 +88,7 @@ export const getAll = () => { export const move = (id: string, parentId?: string) => { return defHttp.put({ - url: `api/identity/organization-units/${id}/move`, + url: `/api/identity/organization-units/${id}/move`, data: { parentId: parentId, }, diff --git a/apps/vue/src/api/identity/sessions/index.ts b/apps/vue/src/api/identity/sessions/index.ts new file mode 100644 index 000000000..7d3695439 --- /dev/null +++ b/apps/vue/src/api/identity/sessions/index.ts @@ -0,0 +1,27 @@ +import { defHttp } from '/@/utils/http/axios'; +import { + IdentitySessionDto, + GetUserSessionsInput +} from './model'; + +/** + * 查询会话列表 + * @param { GetUserSessionsInput } input 查询参数 + * @returns { Promise> } + */ +export const getSessions = (input?: GetUserSessionsInput): Promise> => { + return defHttp.get>({ + url: '/api/identity/sessions', + params: input, + }); +}; +/** + * 撤销会话 + * @param { string } sessionId 会话id + * @returns { Promise } + */ +export const revokeSession = (sessionId: string): Promise => { + return defHttp.delete({ + url: `/api/identity/sessions/${sessionId}/revoke`, + }); +} diff --git a/apps/vue/src/api/identity/sessions/model/index.ts b/apps/vue/src/api/identity/sessions/model/index.ts new file mode 100644 index 000000000..6e10a4c1d --- /dev/null +++ b/apps/vue/src/api/identity/sessions/model/index.ts @@ -0,0 +1,16 @@ +export interface IdentitySessionDto extends EntityDto { + sessionId: string; + device: string; + deviceInfo: string; + userId: string; + clientId?: string; + ipAddresses?: string; + signedIn: Date; + lastAccessed?: Date; +} + +export interface GetUserSessionsInput extends PagedAndSortedResultRequestDto { + userId?: string; + device?: string; + clientId?: string; +} \ No newline at end of file diff --git a/apps/vue/src/api/localization/languages/index.ts b/apps/vue/src/api/localization/languages/index.ts index ea98dd45d..40e7dbc0c 100644 --- a/apps/vue/src/api/localization/languages/index.ts +++ b/apps/vue/src/api/localization/languages/index.ts @@ -16,7 +16,7 @@ export const getByName = (name: string) => { export const create = (input: LanguageCreate) => { return defHttp.post({ - url: '/api/abp/localization/languages', + url: '/api/localization/languages', data: input, }); }; diff --git a/apps/vue/src/api/messages/friends/index.ts b/apps/vue/src/api/messages/friends/index.ts index b8f28be45..792192c70 100644 --- a/apps/vue/src/api/messages/friends/index.ts +++ b/apps/vue/src/api/messages/friends/index.ts @@ -9,7 +9,7 @@ import { export const create = (input: FriendCreateRequest) => { return defHttp.post({ - url: 'api/im/my-friends', + url: '/api/im/my-friends', data: input, }); }; diff --git a/apps/vue/src/api/messages/groups/index.ts b/apps/vue/src/api/messages/groups/index.ts index 5b682f39a..1fab1264f 100644 --- a/apps/vue/src/api/messages/groups/index.ts +++ b/apps/vue/src/api/messages/groups/index.ts @@ -10,6 +10,6 @@ export const search = (input: GroupSearchRequest) => { export const getById = (groupId: string) => { return defHttp.get({ - url: `'/api/im/groups/${groupId}`, + url: `/api/im/groups/${groupId}`, }); }; diff --git a/apps/vue/src/api/multi-tenancy/tenants/index.ts b/apps/vue/src/api/multi-tenancy/tenants/index.ts index c8f9f99e6..e3bab95b6 100644 --- a/apps/vue/src/api/multi-tenancy/tenants/index.ts +++ b/apps/vue/src/api/multi-tenancy/tenants/index.ts @@ -3,12 +3,12 @@ import { FindTenantResult } from './model'; export const findTenantByName = (name: string) => { return defHttp.get({ - url: `api/abp/multi-tenancy/tenants/by-name/${name}` + url: `/api/abp/multi-tenancy/tenants/by-name/${name}` }); }; export const findTenantById = (id: string) => { return defHttp.get({ - url: `api/abp/multi-tenancy/tenants/by-id/${id}` + url: `/api/abp/multi-tenancy/tenants/by-id/${id}` }); }; diff --git a/apps/vue/src/layouts/default/header/components/notify/NoticeList.vue b/apps/vue/src/layouts/default/header/components/notify/NoticeList.vue index 315e42976..3896e2358 100644 --- a/apps/vue/src/layouts/default/header/components/notify/NoticeList.vue +++ b/apps/vue/src/layouts/default/header/components/notify/NoticeList.vue @@ -1,11 +1,11 @@ - + \ No newline at end of file diff --git a/apps/vue/src/views/identity/user/components/SessionModal.vue b/apps/vue/src/views/identity/user/components/SessionModal.vue new file mode 100644 index 000000000..6fff33c21 --- /dev/null +++ b/apps/vue/src/views/identity/user/components/SessionModal.vue @@ -0,0 +1,150 @@ + + + + + + \ No newline at end of file diff --git a/apps/vue/src/views/identity/user/components/UserTable.vue b/apps/vue/src/views/identity/user/components/UserTable.vue index 4fed8f74d..43f9e250a 100644 --- a/apps/vue/src/views/identity/user/components/UserTable.vue +++ b/apps/vue/src/views/identity/user/components/UserTable.vue @@ -57,6 +57,11 @@ ifShow: !lockEnd(record), onClick: showLockModal.bind(null, record.id), }, + { + auth: 'AbpIdentity.IdentitySessions', + label: L('IdentitySessions'), + onClick: handleShowSessionModal.bind(null, record), + }, { auth: 'AbpIdentity.Users.Update', label: L('UnLock'), @@ -90,6 +95,7 @@ + import('./SessionModal.vue')); const emits = defineEmits(['change']); @@ -146,6 +154,7 @@ const { registerLockModal, showLockModal, handleUnLock } = useLock({ emit: emits }); const { registerPasswordModal, showPasswordModal } = usePassword(nullFormElRef); const [registerClaimModal, { openModal: openClaimModal }] = useModal(); + const [registerSessionModal, { openModal: openSessionModal }] = useModal(); const [registerMenuModal, { openModal: openMenuModal, closeModal: closeMenuModal }] = useModal(); const { registerModel: registerPermissionModal, showPermissionModal } = usePermissionModal(); @@ -188,4 +197,8 @@ function handleShowClaims(record) { openClaimModal(true, { id: record.id }); } + + function handleShowSessionModal(record) { + openSessionModal(true, { userId: record.id }); + } diff --git a/apps/vue/types/abp.d.ts b/apps/vue/types/abp.d.ts index 521a61488..cfc6038d8 100644 --- a/apps/vue/types/abp.d.ts +++ b/apps/vue/types/abp.d.ts @@ -110,6 +110,7 @@ declare interface CurrentUser { phoneNumber?: string; phoneNumberVerified: boolean; roles: string[]; + sessionId?: string; } type SimpleStateCheckerResult> = Recordable< diff --git a/aspnet-core/LINGYUN.MicroService.All.sln b/aspnet-core/LINGYUN.MicroService.All.sln index f755a0998..8e2f552fa 100644 --- a/aspnet-core/LINGYUN.MicroService.All.sln +++ b/aspnet-core/LINGYUN.MicroService.All.sln @@ -742,73 +742,21 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.OpenApi.OpenIdd EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.TextTemplating.Scriban", "modules\text-templating\LINGYUN.Abp.TextTemplating.Scriban\LINGYUN.Abp.TextTemplating.Scriban.csproj", "{15482834-9242-4D20-9736-9DA571A9A83A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Claims.Mapping", "framework\security\LINGYUN.Abp.Claims.Mapping\LINGYUN.Abp.Claims.Mapping.csproj", "{8A255A72-50FC-460E-9897-FA53F455580B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Claims.Mapping", "framework\security\LINGYUN.Abp.Claims.Mapping\LINGYUN.Abp.Claims.Mapping.csproj", "{8A255A72-50FC-460E-9897-FA53F455580B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.WeChat.Work.Common", "framework\wechat\LINGYUN.Abp.WeChat.Work.Common\LINGYUN.Abp.WeChat.Work.Common.csproj", "{46038910-8EDD-4822-8768-097B7D276FED}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.WeChat.Work.Common", "framework\wechat\LINGYUN.Abp.WeChat.Work.Common\LINGYUN.Abp.WeChat.Work.Common.csproj", "{CED33625-A034-475B-A4C0-A4E7D1BADD10}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.TaskManagement.Domain.Shared", "modules\task-management\LINGYUN.Abp.TaskManagement.Domain.Shared\LINGYUN.Abp.TaskManagement.Domain.Shared.csproj", "{332F2031-6B67-4199-8BA4-317679D2FFF8}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Identity.Session", "modules\identity\LINGYUN.Abp.Identity.Session\LINGYUN.Abp.Identity.Session.csproj", "{E3BA2413-5755-4F61-9A7C-5D49AE9E7016}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.BackgroundTasks", "modules\task-management\LINGYUN.Abp.BackgroundTasks\LINGYUN.Abp.BackgroundTasks.csproj", "{C8138D8C-BF2B-41CB-BEA2-3ACC5E70E306}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Identity.Session.AspNetCore", "modules\identity\LINGYUN.Abp.Identity.Session.AspNetCore\LINGYUN.Abp.Identity.Session.AspNetCore.csproj", "{BF85DB7F-70C2-4804-AA57-FACE204981DA}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.BackgroundTasks.Quartz", "modules\task-management\LINGYUN.Abp.BackgroundTasks.Quartz\LINGYUN.Abp.BackgroundTasks.Quartz.csproj", "{FF53669D-560C-4791-BE9A-28231C15FA4E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.IdentityServer.Session", "modules\identityServer\LINGYUN.Abp.IdentityServer.Session\LINGYUN.Abp.IdentityServer.Session.csproj", "{893F7376-0913-43DC-AD3D-40AF5B8F9E3B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.BackgroundTasks.DistributedLocking", "modules\task-management\LINGYUN.Abp.BackgroundTasks.DistributedLocking\LINGYUN.Abp.BackgroundTasks.DistributedLocking.csproj", "{2F8BB49E-92E5-4468-8656-BD4BC03FA505}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Identity.AspNetCore.Session", "modules\identity\LINGYUN.Abp.Identity.AspNetCore.Session\LINGYUN.Abp.Identity.AspNetCore.Session.csproj", "{8826831D-8733-473A-B47B-A30C3732B13D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.BackgroundTasks.ExceptionHandling", "modules\task-management\LINGYUN.Abp.BackgroundTasks.ExceptionHandling\LINGYUN.Abp.BackgroundTasks.ExceptionHandling.csproj", "{5CAC42F1-58A4-4716-B8E5-E28042D1B612}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.OpenIddict.AspNetCore.Session", "modules\openIddict\LINGYUN.Abp.OpenIddict.AspNetCore.Session\LINGYUN.Abp.OpenIddict.AspNetCore.Session.csproj", "{D1484DD3-BB0A-45A4-BED5-FFA132DE2E72}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.TaskManagement.EntityFrameworkCore", "modules\task-management\LINGYUN.Abp.TaskManagement.EntityFrameworkCore\LINGYUN.Abp.TaskManagement.EntityFrameworkCore.csproj", "{7D235CB7-EC8E-418F-978A-D2E6EA5F9E9A}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.BackgroundTasks.Activities", "modules\task-management\LINGYUN.Abp.BackgroundTasks.Activities\LINGYUN.Abp.BackgroundTasks.Activities.csproj", "{F78B0978-4ECF-4EA3-89A7-9492AE33CB30}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.TaskManagement.Domain", "modules\task-management\LINGYUN.Abp.TaskManagement.Domain\LINGYUN.Abp.TaskManagement.Domain.csproj", "{7C1A3331-D3D0-4CF0-A7D4-9E27F507AB02}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.TaskManagement.Application", "modules\task-management\LINGYUN.Abp.TaskManagement.Application\LINGYUN.Abp.TaskManagement.Application.csproj", "{DC4AB835-76CA-4439-9A14-473B3838F856}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.BackgroundTasks.EventBus", "modules\task-management\LINGYUN.Abp.BackgroundTasks.EventBus\LINGYUN.Abp.BackgroundTasks.EventBus.csproj", "{3310571F-1B30-49A4-AD24-0CF5C91C58F7}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.TaskManagement.HttpApi", "modules\task-management\LINGYUN.Abp.TaskManagement.HttpApi\LINGYUN.Abp.TaskManagement.HttpApi.csproj", "{00C8A2BC-361D-4999-AEC3-BA4DD7991A9D}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.WebhooksManagement.Application.Contracts", "modules\webhooks\LINGYUN.Abp.WebhooksManagement.Application.Contracts\LINGYUN.Abp.WebhooksManagement.Application.Contracts.csproj", "{D60CF8FB-45BB-4F95-97EB-E1CE54B3105A}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.WebhooksManagement.Application", "modules\webhooks\LINGYUN.Abp.WebhooksManagement.Application\LINGYUN.Abp.WebhooksManagement.Application.csproj", "{7D83C686-7BF0-4037-B927-A502D55D01F8}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.WebhooksManagement.Domain", "modules\webhooks\LINGYUN.Abp.WebhooksManagement.Domain\LINGYUN.Abp.WebhooksManagement.Domain.csproj", "{C7F7F9E2-F877-4658-BFEC-E47AE27B0139}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.WebhooksManagement.Domain.Shared", "modules\webhooks\LINGYUN.Abp.WebhooksManagement.Domain.Shared\LINGYUN.Abp.WebhooksManagement.Domain.Shared.csproj", "{2BC04B60-6959-47FF-8860-96AB51986584}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore", "modules\webhooks\LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore\LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore.csproj", "{1752BAA2-4305-4655-99B4-6832E2CE6CAF}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.WebhooksManagement.HttpApi", "modules\webhooks\LINGYUN.Abp.WebhooksManagement.HttpApi\LINGYUN.Abp.WebhooksManagement.HttpApi.csproj", "{6F2A09CE-183E-4FBA-BB12-DD6105B90B00}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.WebhooksManagement.HttpApi.Client", "modules\webhooks\LINGYUN.Abp.WebhooksManagement.HttpApi.Client\LINGYUN.Abp.WebhooksManagement.HttpApi.Client.csproj", "{5E3E2B57-4BF1-45A7-9BAE-EDA000F27C80}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LY.MicroService.TaskManagement.HttpApi.Host", "services\LY.MicroService.TaskManagement.HttpApi.Host\LY.MicroService.TaskManagement.HttpApi.Host.csproj", "{7D760508-A5A8-44D9-8958-F5AD5F1B7949}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "task", "task", "{C1EFDD32-5524-4DDD-9925-88B6E3530994}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LY.MicroService.WebhooksManagement.HttpApi.Host", "services\LY.MicroService.WebhooksManagement.HttpApi.Host\LY.MicroService.WebhooksManagement.HttpApi.Host.csproj", "{2D3B6C77-465E-4D39-A83D-47E74F14D6D0}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "webhooks", "webhooks", "{0107020D-22E5-4DDF-8A62-5DE850BA6C79}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LY.MicroService.WorkflowManagement.HttpApi.Host", "services\LY.MicroService.WorkflowManagement.HttpApi.Host\LY.MicroService.WorkflowManagement.HttpApi.Host.csproj", "{E8139252-2F6D-437D-97C7-6FB77C705E58}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflow", "workflow", "{74319001-6F4B-41D9-BE32-128EC12AB10B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.BackgroundTasks.Notifications", "modules\task-management\LINGYUN.Abp.BackgroundTasks.Notifications\LINGYUN.Abp.BackgroundTasks.Notifications.csproj", "{40FEF2F7-BB0E-4192-89EE-BDA98B3E4007}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LY.MicroService.TaskManagement.EntityFrameworkCore", "migrations\LY.MicroService.TaskManagement.EntityFrameworkCore\LY.MicroService.TaskManagement.EntityFrameworkCore.csproj", "{CE309DF2-FB96-4917-9DC6-14DC1DED7EED}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "task", "task", "{A922E0EE-5302-4E2B-9D84-0EC681416DA2}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Webhooks.Identity", "modules\webhooks\LINGYUN.Abp.Webhooks.Identity\LINGYUN.Abp.Webhooks.Identity.csproj", "{27505FC3-2659-40CC-A9C7-0857FBECE099}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Webhooks.Saas", "modules\webhooks\LINGYUN.Abp.Webhooks.Saas\LINGYUN.Abp.Webhooks.Saas.csproj", "{1E6F9CF8-577C-45A7-A2E0-2BB3C40AFB9D}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Webhooks.EventBus", "modules\webhooks\LINGYUN.Abp.Webhooks.EventBus\LINGYUN.Abp.Webhooks.EventBus.csproj", "{65951546-93DB-4415-94C5-2B7B1E232A3E}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LY.MicroService.WebhooksManagement.EntityFrameworkCore", "migrations\LY.MicroService.WebhooksManagement.EntityFrameworkCore\LY.MicroService.WebhooksManagement.EntityFrameworkCore.csproj", "{E41F9F32-7A18-485D-BAAE-D858F7EE72E7}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "webhooks", "webhooks", "{E93F5D2E-14FF-47A0-B899-0E34AFDBCCBD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Identity.Notifications", "modules\identity\LINGYUN.Abp.Identity.Notifications\LINGYUN.Abp.Identity.Notifications.csproj", "{54BBA043-317B-4A4F-B583-513D08BC25A7}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -1964,118 +1912,34 @@ Global {8A255A72-50FC-460E-9897-FA53F455580B}.Debug|Any CPU.Build.0 = Debug|Any CPU {8A255A72-50FC-460E-9897-FA53F455580B}.Release|Any CPU.ActiveCfg = Release|Any CPU {8A255A72-50FC-460E-9897-FA53F455580B}.Release|Any CPU.Build.0 = Release|Any CPU - {46038910-8EDD-4822-8768-097B7D276FED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {46038910-8EDD-4822-8768-097B7D276FED}.Debug|Any CPU.Build.0 = Debug|Any CPU - {46038910-8EDD-4822-8768-097B7D276FED}.Release|Any CPU.ActiveCfg = Release|Any CPU - {46038910-8EDD-4822-8768-097B7D276FED}.Release|Any CPU.Build.0 = Release|Any CPU - {332F2031-6B67-4199-8BA4-317679D2FFF8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {332F2031-6B67-4199-8BA4-317679D2FFF8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {332F2031-6B67-4199-8BA4-317679D2FFF8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {332F2031-6B67-4199-8BA4-317679D2FFF8}.Release|Any CPU.Build.0 = Release|Any CPU - {C8138D8C-BF2B-41CB-BEA2-3ACC5E70E306}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C8138D8C-BF2B-41CB-BEA2-3ACC5E70E306}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C8138D8C-BF2B-41CB-BEA2-3ACC5E70E306}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C8138D8C-BF2B-41CB-BEA2-3ACC5E70E306}.Release|Any CPU.Build.0 = Release|Any CPU - {FF53669D-560C-4791-BE9A-28231C15FA4E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FF53669D-560C-4791-BE9A-28231C15FA4E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FF53669D-560C-4791-BE9A-28231C15FA4E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FF53669D-560C-4791-BE9A-28231C15FA4E}.Release|Any CPU.Build.0 = Release|Any CPU - {2F8BB49E-92E5-4468-8656-BD4BC03FA505}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2F8BB49E-92E5-4468-8656-BD4BC03FA505}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2F8BB49E-92E5-4468-8656-BD4BC03FA505}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2F8BB49E-92E5-4468-8656-BD4BC03FA505}.Release|Any CPU.Build.0 = Release|Any CPU - {5CAC42F1-58A4-4716-B8E5-E28042D1B612}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5CAC42F1-58A4-4716-B8E5-E28042D1B612}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5CAC42F1-58A4-4716-B8E5-E28042D1B612}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5CAC42F1-58A4-4716-B8E5-E28042D1B612}.Release|Any CPU.Build.0 = Release|Any CPU - {7D235CB7-EC8E-418F-978A-D2E6EA5F9E9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7D235CB7-EC8E-418F-978A-D2E6EA5F9E9A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7D235CB7-EC8E-418F-978A-D2E6EA5F9E9A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7D235CB7-EC8E-418F-978A-D2E6EA5F9E9A}.Release|Any CPU.Build.0 = Release|Any CPU - {F78B0978-4ECF-4EA3-89A7-9492AE33CB30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F78B0978-4ECF-4EA3-89A7-9492AE33CB30}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F78B0978-4ECF-4EA3-89A7-9492AE33CB30}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F78B0978-4ECF-4EA3-89A7-9492AE33CB30}.Release|Any CPU.Build.0 = Release|Any CPU - {7C1A3331-D3D0-4CF0-A7D4-9E27F507AB02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7C1A3331-D3D0-4CF0-A7D4-9E27F507AB02}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7C1A3331-D3D0-4CF0-A7D4-9E27F507AB02}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7C1A3331-D3D0-4CF0-A7D4-9E27F507AB02}.Release|Any CPU.Build.0 = Release|Any CPU - {DC4AB835-76CA-4439-9A14-473B3838F856}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DC4AB835-76CA-4439-9A14-473B3838F856}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DC4AB835-76CA-4439-9A14-473B3838F856}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DC4AB835-76CA-4439-9A14-473B3838F856}.Release|Any CPU.Build.0 = Release|Any CPU - {3310571F-1B30-49A4-AD24-0CF5C91C58F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3310571F-1B30-49A4-AD24-0CF5C91C58F7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3310571F-1B30-49A4-AD24-0CF5C91C58F7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3310571F-1B30-49A4-AD24-0CF5C91C58F7}.Release|Any CPU.Build.0 = Release|Any CPU - {00C8A2BC-361D-4999-AEC3-BA4DD7991A9D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {00C8A2BC-361D-4999-AEC3-BA4DD7991A9D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {00C8A2BC-361D-4999-AEC3-BA4DD7991A9D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {00C8A2BC-361D-4999-AEC3-BA4DD7991A9D}.Release|Any CPU.Build.0 = Release|Any CPU - {D60CF8FB-45BB-4F95-97EB-E1CE54B3105A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D60CF8FB-45BB-4F95-97EB-E1CE54B3105A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D60CF8FB-45BB-4F95-97EB-E1CE54B3105A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D60CF8FB-45BB-4F95-97EB-E1CE54B3105A}.Release|Any CPU.Build.0 = Release|Any CPU - {7D83C686-7BF0-4037-B927-A502D55D01F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7D83C686-7BF0-4037-B927-A502D55D01F8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7D83C686-7BF0-4037-B927-A502D55D01F8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7D83C686-7BF0-4037-B927-A502D55D01F8}.Release|Any CPU.Build.0 = Release|Any CPU - {C7F7F9E2-F877-4658-BFEC-E47AE27B0139}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C7F7F9E2-F877-4658-BFEC-E47AE27B0139}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C7F7F9E2-F877-4658-BFEC-E47AE27B0139}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C7F7F9E2-F877-4658-BFEC-E47AE27B0139}.Release|Any CPU.Build.0 = Release|Any CPU - {2BC04B60-6959-47FF-8860-96AB51986584}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2BC04B60-6959-47FF-8860-96AB51986584}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2BC04B60-6959-47FF-8860-96AB51986584}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2BC04B60-6959-47FF-8860-96AB51986584}.Release|Any CPU.Build.0 = Release|Any CPU - {1752BAA2-4305-4655-99B4-6832E2CE6CAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1752BAA2-4305-4655-99B4-6832E2CE6CAF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1752BAA2-4305-4655-99B4-6832E2CE6CAF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1752BAA2-4305-4655-99B4-6832E2CE6CAF}.Release|Any CPU.Build.0 = Release|Any CPU - {6F2A09CE-183E-4FBA-BB12-DD6105B90B00}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6F2A09CE-183E-4FBA-BB12-DD6105B90B00}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6F2A09CE-183E-4FBA-BB12-DD6105B90B00}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6F2A09CE-183E-4FBA-BB12-DD6105B90B00}.Release|Any CPU.Build.0 = Release|Any CPU - {5E3E2B57-4BF1-45A7-9BAE-EDA000F27C80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5E3E2B57-4BF1-45A7-9BAE-EDA000F27C80}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5E3E2B57-4BF1-45A7-9BAE-EDA000F27C80}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5E3E2B57-4BF1-45A7-9BAE-EDA000F27C80}.Release|Any CPU.Build.0 = Release|Any CPU - {7D760508-A5A8-44D9-8958-F5AD5F1B7949}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7D760508-A5A8-44D9-8958-F5AD5F1B7949}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7D760508-A5A8-44D9-8958-F5AD5F1B7949}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7D760508-A5A8-44D9-8958-F5AD5F1B7949}.Release|Any CPU.Build.0 = Release|Any CPU - {2D3B6C77-465E-4D39-A83D-47E74F14D6D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2D3B6C77-465E-4D39-A83D-47E74F14D6D0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2D3B6C77-465E-4D39-A83D-47E74F14D6D0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2D3B6C77-465E-4D39-A83D-47E74F14D6D0}.Release|Any CPU.Build.0 = Release|Any CPU - {E8139252-2F6D-437D-97C7-6FB77C705E58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E8139252-2F6D-437D-97C7-6FB77C705E58}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E8139252-2F6D-437D-97C7-6FB77C705E58}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E8139252-2F6D-437D-97C7-6FB77C705E58}.Release|Any CPU.Build.0 = Release|Any CPU - {40FEF2F7-BB0E-4192-89EE-BDA98B3E4007}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {40FEF2F7-BB0E-4192-89EE-BDA98B3E4007}.Debug|Any CPU.Build.0 = Debug|Any CPU - {40FEF2F7-BB0E-4192-89EE-BDA98B3E4007}.Release|Any CPU.ActiveCfg = Release|Any CPU - {40FEF2F7-BB0E-4192-89EE-BDA98B3E4007}.Release|Any CPU.Build.0 = Release|Any CPU - {CE309DF2-FB96-4917-9DC6-14DC1DED7EED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CE309DF2-FB96-4917-9DC6-14DC1DED7EED}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CE309DF2-FB96-4917-9DC6-14DC1DED7EED}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CE309DF2-FB96-4917-9DC6-14DC1DED7EED}.Release|Any CPU.Build.0 = Release|Any CPU - {27505FC3-2659-40CC-A9C7-0857FBECE099}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {27505FC3-2659-40CC-A9C7-0857FBECE099}.Debug|Any CPU.Build.0 = Debug|Any CPU - {27505FC3-2659-40CC-A9C7-0857FBECE099}.Release|Any CPU.ActiveCfg = Release|Any CPU - {27505FC3-2659-40CC-A9C7-0857FBECE099}.Release|Any CPU.Build.0 = Release|Any CPU - {1E6F9CF8-577C-45A7-A2E0-2BB3C40AFB9D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1E6F9CF8-577C-45A7-A2E0-2BB3C40AFB9D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1E6F9CF8-577C-45A7-A2E0-2BB3C40AFB9D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1E6F9CF8-577C-45A7-A2E0-2BB3C40AFB9D}.Release|Any CPU.Build.0 = Release|Any CPU - {65951546-93DB-4415-94C5-2B7B1E232A3E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {65951546-93DB-4415-94C5-2B7B1E232A3E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {65951546-93DB-4415-94C5-2B7B1E232A3E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {65951546-93DB-4415-94C5-2B7B1E232A3E}.Release|Any CPU.Build.0 = Release|Any CPU - {E41F9F32-7A18-485D-BAAE-D858F7EE72E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E41F9F32-7A18-485D-BAAE-D858F7EE72E7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E41F9F32-7A18-485D-BAAE-D858F7EE72E7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E41F9F32-7A18-485D-BAAE-D858F7EE72E7}.Release|Any CPU.Build.0 = Release|Any CPU + {CED33625-A034-475B-A4C0-A4E7D1BADD10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CED33625-A034-475B-A4C0-A4E7D1BADD10}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CED33625-A034-475B-A4C0-A4E7D1BADD10}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CED33625-A034-475B-A4C0-A4E7D1BADD10}.Release|Any CPU.Build.0 = Release|Any CPU + {E3BA2413-5755-4F61-9A7C-5D49AE9E7016}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E3BA2413-5755-4F61-9A7C-5D49AE9E7016}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E3BA2413-5755-4F61-9A7C-5D49AE9E7016}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E3BA2413-5755-4F61-9A7C-5D49AE9E7016}.Release|Any CPU.Build.0 = Release|Any CPU + {BF85DB7F-70C2-4804-AA57-FACE204981DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BF85DB7F-70C2-4804-AA57-FACE204981DA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BF85DB7F-70C2-4804-AA57-FACE204981DA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BF85DB7F-70C2-4804-AA57-FACE204981DA}.Release|Any CPU.Build.0 = Release|Any CPU + {893F7376-0913-43DC-AD3D-40AF5B8F9E3B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {893F7376-0913-43DC-AD3D-40AF5B8F9E3B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {893F7376-0913-43DC-AD3D-40AF5B8F9E3B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {893F7376-0913-43DC-AD3D-40AF5B8F9E3B}.Release|Any CPU.Build.0 = Release|Any CPU + {8826831D-8733-473A-B47B-A30C3732B13D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8826831D-8733-473A-B47B-A30C3732B13D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8826831D-8733-473A-B47B-A30C3732B13D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8826831D-8733-473A-B47B-A30C3732B13D}.Release|Any CPU.Build.0 = Release|Any CPU + {D1484DD3-BB0A-45A4-BED5-FFA132DE2E72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D1484DD3-BB0A-45A4-BED5-FFA132DE2E72}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D1484DD3-BB0A-45A4-BED5-FFA132DE2E72}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D1484DD3-BB0A-45A4-BED5-FFA132DE2E72}.Release|Any CPU.Build.0 = Release|Any CPU + {54BBA043-317B-4A4F-B583-513D08BC25A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {54BBA043-317B-4A4F-B583-513D08BC25A7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {54BBA043-317B-4A4F-B583-513D08BC25A7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {54BBA043-317B-4A4F-B583-513D08BC25A7}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2435,39 +2299,13 @@ Global {ED3DF100-C5DB-4334-A847-118922B28D95} = {3C7A8246-DE82-4330-8697-24EF1B1C515D} {15482834-9242-4D20-9736-9DA571A9A83A} = {ABD89F39-62D9-439E-8662-BE4F36BFA04F} {8A255A72-50FC-460E-9897-FA53F455580B} = {9D1302BE-3886-49F8-B0CD-35D2AC1E5A37} - {46038910-8EDD-4822-8768-097B7D276FED} = {DD9BE9E7-F6BF-4869-BCD2-82F5072BDA21} - {332F2031-6B67-4199-8BA4-317679D2FFF8} = {77ED7922-BF30-4436-8A85-78F812583913} - {C8138D8C-BF2B-41CB-BEA2-3ACC5E70E306} = {77ED7922-BF30-4436-8A85-78F812583913} - {FF53669D-560C-4791-BE9A-28231C15FA4E} = {77ED7922-BF30-4436-8A85-78F812583913} - {2F8BB49E-92E5-4468-8656-BD4BC03FA505} = {77ED7922-BF30-4436-8A85-78F812583913} - {5CAC42F1-58A4-4716-B8E5-E28042D1B612} = {77ED7922-BF30-4436-8A85-78F812583913} - {7D235CB7-EC8E-418F-978A-D2E6EA5F9E9A} = {77ED7922-BF30-4436-8A85-78F812583913} - {F78B0978-4ECF-4EA3-89A7-9492AE33CB30} = {77ED7922-BF30-4436-8A85-78F812583913} - {7C1A3331-D3D0-4CF0-A7D4-9E27F507AB02} = {77ED7922-BF30-4436-8A85-78F812583913} - {DC4AB835-76CA-4439-9A14-473B3838F856} = {77ED7922-BF30-4436-8A85-78F812583913} - {3310571F-1B30-49A4-AD24-0CF5C91C58F7} = {77ED7922-BF30-4436-8A85-78F812583913} - {00C8A2BC-361D-4999-AEC3-BA4DD7991A9D} = {77ED7922-BF30-4436-8A85-78F812583913} - {D60CF8FB-45BB-4F95-97EB-E1CE54B3105A} = {13ACF670-F109-404E-B252-2FA34A4EA061} - {7D83C686-7BF0-4037-B927-A502D55D01F8} = {13ACF670-F109-404E-B252-2FA34A4EA061} - {C7F7F9E2-F877-4658-BFEC-E47AE27B0139} = {13ACF670-F109-404E-B252-2FA34A4EA061} - {2BC04B60-6959-47FF-8860-96AB51986584} = {13ACF670-F109-404E-B252-2FA34A4EA061} - {1752BAA2-4305-4655-99B4-6832E2CE6CAF} = {13ACF670-F109-404E-B252-2FA34A4EA061} - {6F2A09CE-183E-4FBA-BB12-DD6105B90B00} = {13ACF670-F109-404E-B252-2FA34A4EA061} - {5E3E2B57-4BF1-45A7-9BAE-EDA000F27C80} = {13ACF670-F109-404E-B252-2FA34A4EA061} - {C1EFDD32-5524-4DDD-9925-88B6E3530994} = {672E1170-7B18-474B-85C7-1961BF2A48AE} - {7D760508-A5A8-44D9-8958-F5AD5F1B7949} = {C1EFDD32-5524-4DDD-9925-88B6E3530994} - {0107020D-22E5-4DDF-8A62-5DE850BA6C79} = {672E1170-7B18-474B-85C7-1961BF2A48AE} - {74319001-6F4B-41D9-BE32-128EC12AB10B} = {672E1170-7B18-474B-85C7-1961BF2A48AE} - {2D3B6C77-465E-4D39-A83D-47E74F14D6D0} = {0107020D-22E5-4DDF-8A62-5DE850BA6C79} - {E8139252-2F6D-437D-97C7-6FB77C705E58} = {74319001-6F4B-41D9-BE32-128EC12AB10B} - {40FEF2F7-BB0E-4192-89EE-BDA98B3E4007} = {77ED7922-BF30-4436-8A85-78F812583913} - {A922E0EE-5302-4E2B-9D84-0EC681416DA2} = {C90A505F-000E-4AE4-8CCD-AB5FE5092B5C} - {CE309DF2-FB96-4917-9DC6-14DC1DED7EED} = {A922E0EE-5302-4E2B-9D84-0EC681416DA2} - {27505FC3-2659-40CC-A9C7-0857FBECE099} = {13ACF670-F109-404E-B252-2FA34A4EA061} - {1E6F9CF8-577C-45A7-A2E0-2BB3C40AFB9D} = {13ACF670-F109-404E-B252-2FA34A4EA061} - {65951546-93DB-4415-94C5-2B7B1E232A3E} = {13ACF670-F109-404E-B252-2FA34A4EA061} - {E93F5D2E-14FF-47A0-B899-0E34AFDBCCBD} = {C90A505F-000E-4AE4-8CCD-AB5FE5092B5C} - {E41F9F32-7A18-485D-BAAE-D858F7EE72E7} = {E93F5D2E-14FF-47A0-B899-0E34AFDBCCBD} + {CED33625-A034-475B-A4C0-A4E7D1BADD10} = {DD9BE9E7-F6BF-4869-BCD2-82F5072BDA21} + {E3BA2413-5755-4F61-9A7C-5D49AE9E7016} = {52B5D4F7-237B-4E0A-A167-68442164F70A} + {BF85DB7F-70C2-4804-AA57-FACE204981DA} = {52B5D4F7-237B-4E0A-A167-68442164F70A} + {893F7376-0913-43DC-AD3D-40AF5B8F9E3B} = {0439B173-F41E-4CE0-A44A-CCB70328F272} + {8826831D-8733-473A-B47B-A30C3732B13D} = {52B5D4F7-237B-4E0A-A167-68442164F70A} + {D1484DD3-BB0A-45A4-BED5-FFA132DE2E72} = {83E698F6-F8CD-4604-AB80-01A203389501} + {54BBA043-317B-4A4F-B583-513D08BC25A7} = {52B5D4F7-237B-4E0A-A167-68442164F70A} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {C95FDF91-16F2-4A8B-A4BE-0E62D1B66718} diff --git a/aspnet-core/LINGYUN.MicroService.SingleProject.sln b/aspnet-core/LINGYUN.MicroService.SingleProject.sln index ea8e6b660..0e6fe18c1 100644 --- a/aspnet-core/LINGYUN.MicroService.SingleProject.sln +++ b/aspnet-core/LINGYUN.MicroService.SingleProject.sln @@ -515,6 +515,24 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.BackgroundTasks EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Saas.Jobs", "modules\saas\LINGYUN.Abp.Saas.Jobs\LINGYUN.Abp.Saas.Jobs.csproj", "{8FA3ED81-19AB-4E0C-B36A-DF49131A2AB3}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.IdentityServer.SmsValidator", "modules\identityServer\LINGYUN.Abp.IdentityServer.SmsValidator\LINGYUN.Abp.IdentityServer.SmsValidator.csproj", "{7C1A8FF7-9FD1-41FC-856D-7A2DC6F7CE6F}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.IdentityServer.Portal", "modules\identityServer\LINGYUN.Abp.IdentityServer.Portal\LINGYUN.Abp.IdentityServer.Portal.csproj", "{986B92F6-A758-4D1F-8BC7-BFD13FF38591}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.IdentityServer.WeChat.Work", "modules\identityServer\LINGYUN.Abp.IdentityServer.WeChat.Work\LINGYUN.Abp.IdentityServer.WeChat.Work.csproj", "{62D72C3E-5C57-439D-B7F7-5C55CC384A7A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Identity.Session", "modules\identity\LINGYUN.Abp.Identity.Session\LINGYUN.Abp.Identity.Session.csproj", "{74156CFF-C236-4DED-B810-FAD8948F51CA}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Identity.Session.AspNetCore", "modules\identity\LINGYUN.Abp.Identity.Session.AspNetCore\LINGYUN.Abp.Identity.Session.AspNetCore.csproj", "{63D08153-B43C-4884-8818-4AB42E1FEE75}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Identity.AspNetCore.Session", "modules\identity\LINGYUN.Abp.Identity.AspNetCore.Session\LINGYUN.Abp.Identity.AspNetCore.Session.csproj", "{AF02868C-283E-4CB2-8866-3B0CAD1BB2DE}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.IdentityServer.Session", "modules\identityServer\LINGYUN.Abp.IdentityServer.Session\LINGYUN.Abp.IdentityServer.Session.csproj", "{F7459720-873C-4741-A991-A671CF03A6AF}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.OpenIddict.AspNetCore.Session", "modules\openIddict\LINGYUN.Abp.OpenIddict.AspNetCore.Session\LINGYUN.Abp.OpenIddict.AspNetCore.Session.csproj", "{382CAC43-EE1F-4DA3-B433-E23C3F58F44A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Identity.Notifications", "modules\identity\LINGYUN.Abp.Identity.Notifications\LINGYUN.Abp.Identity.Notifications.csproj", "{4634B421-36E6-4169-AA1A-11050902495F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1349,6 +1367,42 @@ Global {8FA3ED81-19AB-4E0C-B36A-DF49131A2AB3}.Debug|Any CPU.Build.0 = Debug|Any CPU {8FA3ED81-19AB-4E0C-B36A-DF49131A2AB3}.Release|Any CPU.ActiveCfg = Release|Any CPU {8FA3ED81-19AB-4E0C-B36A-DF49131A2AB3}.Release|Any CPU.Build.0 = Release|Any CPU + {7C1A8FF7-9FD1-41FC-856D-7A2DC6F7CE6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7C1A8FF7-9FD1-41FC-856D-7A2DC6F7CE6F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7C1A8FF7-9FD1-41FC-856D-7A2DC6F7CE6F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7C1A8FF7-9FD1-41FC-856D-7A2DC6F7CE6F}.Release|Any CPU.Build.0 = Release|Any CPU + {986B92F6-A758-4D1F-8BC7-BFD13FF38591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {986B92F6-A758-4D1F-8BC7-BFD13FF38591}.Debug|Any CPU.Build.0 = Debug|Any CPU + {986B92F6-A758-4D1F-8BC7-BFD13FF38591}.Release|Any CPU.ActiveCfg = Release|Any CPU + {986B92F6-A758-4D1F-8BC7-BFD13FF38591}.Release|Any CPU.Build.0 = Release|Any CPU + {62D72C3E-5C57-439D-B7F7-5C55CC384A7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {62D72C3E-5C57-439D-B7F7-5C55CC384A7A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {62D72C3E-5C57-439D-B7F7-5C55CC384A7A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {62D72C3E-5C57-439D-B7F7-5C55CC384A7A}.Release|Any CPU.Build.0 = Release|Any CPU + {74156CFF-C236-4DED-B810-FAD8948F51CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {74156CFF-C236-4DED-B810-FAD8948F51CA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {74156CFF-C236-4DED-B810-FAD8948F51CA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {74156CFF-C236-4DED-B810-FAD8948F51CA}.Release|Any CPU.Build.0 = Release|Any CPU + {63D08153-B43C-4884-8818-4AB42E1FEE75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {63D08153-B43C-4884-8818-4AB42E1FEE75}.Debug|Any CPU.Build.0 = Debug|Any CPU + {63D08153-B43C-4884-8818-4AB42E1FEE75}.Release|Any CPU.ActiveCfg = Release|Any CPU + {63D08153-B43C-4884-8818-4AB42E1FEE75}.Release|Any CPU.Build.0 = Release|Any CPU + {AF02868C-283E-4CB2-8866-3B0CAD1BB2DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AF02868C-283E-4CB2-8866-3B0CAD1BB2DE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AF02868C-283E-4CB2-8866-3B0CAD1BB2DE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AF02868C-283E-4CB2-8866-3B0CAD1BB2DE}.Release|Any CPU.Build.0 = Release|Any CPU + {F7459720-873C-4741-A991-A671CF03A6AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F7459720-873C-4741-A991-A671CF03A6AF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F7459720-873C-4741-A991-A671CF03A6AF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F7459720-873C-4741-A991-A671CF03A6AF}.Release|Any CPU.Build.0 = Release|Any CPU + {382CAC43-EE1F-4DA3-B433-E23C3F58F44A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {382CAC43-EE1F-4DA3-B433-E23C3F58F44A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {382CAC43-EE1F-4DA3-B433-E23C3F58F44A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {382CAC43-EE1F-4DA3-B433-E23C3F58F44A}.Release|Any CPU.Build.0 = Release|Any CPU + {4634B421-36E6-4169-AA1A-11050902495F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4634B421-36E6-4169-AA1A-11050902495F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4634B421-36E6-4169-AA1A-11050902495F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4634B421-36E6-4169-AA1A-11050902495F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1600,6 +1654,15 @@ Global {66A6E78D-E547-4DD7-9844-087FAB3D03C2} = {C22741F9-FC56-4AE3-B543-9F15C779D345} {A99F5406-37DC-4677-9166-9BDE90C26CA6} = {D9C65C9D-8591-46DA-A3EE-419393E607AB} {8FA3ED81-19AB-4E0C-B36A-DF49131A2AB3} = {0DF5AD76-AEEA-4052-A6CA-A44C24879F11} + {7C1A8FF7-9FD1-41FC-856D-7A2DC6F7CE6F} = {A3B6DFC3-5D27-496E-9AD6-C1035213F1DC} + {986B92F6-A758-4D1F-8BC7-BFD13FF38591} = {A3B6DFC3-5D27-496E-9AD6-C1035213F1DC} + {62D72C3E-5C57-439D-B7F7-5C55CC384A7A} = {A3B6DFC3-5D27-496E-9AD6-C1035213F1DC} + {74156CFF-C236-4DED-B810-FAD8948F51CA} = {D94D6AFE-20BD-4F21-8708-03F5E34F49FC} + {63D08153-B43C-4884-8818-4AB42E1FEE75} = {D94D6AFE-20BD-4F21-8708-03F5E34F49FC} + {AF02868C-283E-4CB2-8866-3B0CAD1BB2DE} = {D94D6AFE-20BD-4F21-8708-03F5E34F49FC} + {F7459720-873C-4741-A991-A671CF03A6AF} = {A3B6DFC3-5D27-496E-9AD6-C1035213F1DC} + {382CAC43-EE1F-4DA3-B433-E23C3F58F44A} = {7C714185-D3D9-4D94-B5CB-D857A0091F04} + {4634B421-36E6-4169-AA1A-11050902495F} = {D94D6AFE-20BD-4F21-8708-03F5E34F49FC} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {711A43C0-A2F8-4E5C-9B9F-F2551E4B3FF1} diff --git a/aspnet-core/LINGYUN.MicroService.WebhooksManagement.sln b/aspnet-core/LINGYUN.MicroService.WebhooksManagement.sln index a4d2c8475..e29bffbc2 100644 --- a/aspnet-core/LINGYUN.MicroService.WebhooksManagement.sln +++ b/aspnet-core/LINGYUN.MicroService.WebhooksManagement.sln @@ -147,6 +147,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Security", "fra EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Claims.Mapping", "framework\security\LINGYUN.Abp.Claims.Mapping\LINGYUN.Abp.Claims.Mapping.csproj", "{047F892F-F8D2-4952-A1E9-93AA2B030F76}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "identity", "identity", "{23E99204-F7C1-47BA-84CD-3C9D05210F4F}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Identity.Session", "modules\identity\LINGYUN.Abp.Identity.Session\LINGYUN.Abp.Identity.Session.csproj", "{BF298DF5-BC1D-4DDD-A51E-8E9020D2C5F1}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Identity.Session.AspNetCore", "modules\identity\LINGYUN.Abp.Identity.Session.AspNetCore\LINGYUN.Abp.Identity.Session.AspNetCore.csproj", "{BE58649C-EA57-4DFC-8D25-54FDCB1943A1}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -381,6 +387,14 @@ Global {047F892F-F8D2-4952-A1E9-93AA2B030F76}.Debug|Any CPU.Build.0 = Debug|Any CPU {047F892F-F8D2-4952-A1E9-93AA2B030F76}.Release|Any CPU.ActiveCfg = Release|Any CPU {047F892F-F8D2-4952-A1E9-93AA2B030F76}.Release|Any CPU.Build.0 = Release|Any CPU + {BF298DF5-BC1D-4DDD-A51E-8E9020D2C5F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BF298DF5-BC1D-4DDD-A51E-8E9020D2C5F1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BF298DF5-BC1D-4DDD-A51E-8E9020D2C5F1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BF298DF5-BC1D-4DDD-A51E-8E9020D2C5F1}.Release|Any CPU.Build.0 = Release|Any CPU + {BE58649C-EA57-4DFC-8D25-54FDCB1943A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BE58649C-EA57-4DFC-8D25-54FDCB1943A1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BE58649C-EA57-4DFC-8D25-54FDCB1943A1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BE58649C-EA57-4DFC-8D25-54FDCB1943A1}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -454,6 +468,9 @@ Global {0DFDAC71-BCB9-44CF-A44A-E8288E75246F} = {FB7A9794-06D2-42CF-939E-4626497B97BD} {8F11DADB-557A-4ECF-BEBB-19AFA71998A1} = {FB7A9794-06D2-42CF-939E-4626497B97BD} {047F892F-F8D2-4952-A1E9-93AA2B030F76} = {FB7A9794-06D2-42CF-939E-4626497B97BD} + {23E99204-F7C1-47BA-84CD-3C9D05210F4F} = {03B4B0AA-83CE-4E4B-9CE2-47369BF88B97} + {BF298DF5-BC1D-4DDD-A51E-8E9020D2C5F1} = {23E99204-F7C1-47BA-84CD-3C9D05210F4F} + {BE58649C-EA57-4DFC-8D25-54FDCB1943A1} = {23E99204-F7C1-47BA-84CD-3C9D05210F4F} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {80ED12A5-C899-459F-A181-ADCC9D680DE5} diff --git a/aspnet-core/LINGYUN.MicroService.Workflow.sln b/aspnet-core/LINGYUN.MicroService.Workflow.sln index 89c50b929..5259391cd 100644 --- a/aspnet-core/LINGYUN.MicroService.Workflow.sln +++ b/aspnet-core/LINGYUN.MicroService.Workflow.sln @@ -165,6 +165,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Security", "fra EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Claims.Mapping", "framework\security\LINGYUN.Abp.Claims.Mapping\LINGYUN.Abp.Claims.Mapping.csproj", "{1859E205-88DC-4E08-A0BD-55A045DCC495}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "identity", "identity", "{9C73D4E6-4408-4717-B51C-63C20321D4DA}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Identity.Session", "modules\identity\LINGYUN.Abp.Identity.Session\LINGYUN.Abp.Identity.Session.csproj", "{6ECF678D-6F3A-4084-8538-A86C1D67C703}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Identity.Session.AspNetCore", "modules\identity\LINGYUN.Abp.Identity.Session.AspNetCore\LINGYUN.Abp.Identity.Session.AspNetCore.csproj", "{9FB5E943-7F6F-4281-9C00-E76284B4F1F3}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -443,6 +449,14 @@ Global {1859E205-88DC-4E08-A0BD-55A045DCC495}.Debug|Any CPU.Build.0 = Debug|Any CPU {1859E205-88DC-4E08-A0BD-55A045DCC495}.Release|Any CPU.ActiveCfg = Release|Any CPU {1859E205-88DC-4E08-A0BD-55A045DCC495}.Release|Any CPU.Build.0 = Release|Any CPU + {6ECF678D-6F3A-4084-8538-A86C1D67C703}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6ECF678D-6F3A-4084-8538-A86C1D67C703}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6ECF678D-6F3A-4084-8538-A86C1D67C703}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6ECF678D-6F3A-4084-8538-A86C1D67C703}.Release|Any CPU.Build.0 = Release|Any CPU + {9FB5E943-7F6F-4281-9C00-E76284B4F1F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9FB5E943-7F6F-4281-9C00-E76284B4F1F3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9FB5E943-7F6F-4281-9C00-E76284B4F1F3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9FB5E943-7F6F-4281-9C00-E76284B4F1F3}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -518,6 +532,8 @@ Global {4D055853-DE80-4145-BB2F-33EB6B379F5E} = {6DA78E72-BA55-4ECF-97DB-6258174D3E2A} {E4783690-052A-4AB0-837E-BDBC77CC7EEC} = {6DA78E72-BA55-4ECF-97DB-6258174D3E2A} {1859E205-88DC-4E08-A0BD-55A045DCC495} = {6DA78E72-BA55-4ECF-97DB-6258174D3E2A} + {6ECF678D-6F3A-4084-8538-A86C1D67C703} = {9C73D4E6-4408-4717-B51C-63C20321D4DA} + {9FB5E943-7F6F-4281-9C00-E76284B4F1F3} = {9C73D4E6-4408-4717-B51C-63C20321D4DA} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {6BB7A5DE-DA12-44DC-BC9B-0F6CA524346F} diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN.Abp.AuditLogging.Elasticsearch.csproj b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN.Abp.AuditLogging.Elasticsearch.csproj index 8eb7367c1..d55edf077 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN.Abp.AuditLogging.Elasticsearch.csproj +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN.Abp.AuditLogging.Elasticsearch.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.AuditLogging.Elasticsearch + LINGYUN.Abp.AuditLogging.Elasticsearch + false + false + false diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/AbpAuditLoggingElasticsearchModule.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/AbpAuditLoggingElasticsearchModule.cs index 183a1c2f8..d25265666 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/AbpAuditLoggingElasticsearchModule.cs +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/AbpAuditLoggingElasticsearchModule.cs @@ -3,20 +3,19 @@ using Volo.Abp.Json; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.AuditLogging.Elasticsearch +namespace LINGYUN.Abp.AuditLogging.Elasticsearch; + +[DependsOn( + typeof(AbpAuditLoggingModule), + typeof(AbpElasticsearchModule), + typeof(AbpJsonModule))] +public class AbpAuditLoggingElasticsearchModule : AbpModule { - [DependsOn( - typeof(AbpAuditLoggingModule), - typeof(AbpElasticsearchModule), - typeof(AbpJsonModule))] - public class AbpAuditLoggingElasticsearchModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) - { - var configuration = context.Services.GetConfiguration(); - Configure(configuration.GetSection("AuditLogging:Elasticsearch")); + var configuration = context.Services.GetConfiguration(); + Configure(configuration.GetSection("AuditLogging:Elasticsearch")); - context.Services.AddHostedService(); - } + context.Services.AddHostedService(); } } diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/AbpAuditLoggingElasticsearchOptions.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/AbpAuditLoggingElasticsearchOptions.cs index 820499ce7..7773ae201 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/AbpAuditLoggingElasticsearchOptions.cs +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/AbpAuditLoggingElasticsearchOptions.cs @@ -1,17 +1,16 @@ using Nest; -namespace LINGYUN.Abp.AuditLogging.Elasticsearch +namespace LINGYUN.Abp.AuditLogging.Elasticsearch; + +public class AbpAuditLoggingElasticsearchOptions { - public class AbpAuditLoggingElasticsearchOptions - { - public const string DefaultIndexPrefix = "auditlogging"; - public string IndexPrefix { get; set; } - public IIndexSettings IndexSettings { get; set; } + public const string DefaultIndexPrefix = "auditlogging"; + public string IndexPrefix { get; set; } + public IIndexSettings IndexSettings { get; set; } - public AbpAuditLoggingElasticsearchOptions() - { - IndexPrefix = DefaultIndexPrefix; - IndexSettings = new IndexSettings(); - } + public AbpAuditLoggingElasticsearchOptions() + { + IndexPrefix = DefaultIndexPrefix; + IndexSettings = new IndexSettings(); } } diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/AuditLogInfoToAuditLogConverter.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/AuditLogInfoToAuditLogConverter.cs index 0d1688155..f0f331a60 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/AuditLogInfoToAuditLogConverter.cs +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/AuditLogInfoToAuditLogConverter.cs @@ -11,105 +11,104 @@ using Volo.Abp.Http; using Volo.Abp.Json; -namespace LINGYUN.Abp.AuditLogging +namespace LINGYUN.Abp.AuditLogging; + +public class AuditLogInfoToAuditLogConverter : IAuditLogInfoToAuditLogConverter, ITransientDependency { - public class AuditLogInfoToAuditLogConverter : IAuditLogInfoToAuditLogConverter, ITransientDependency + protected IGuidGenerator GuidGenerator { get; } + protected AbpExceptionHandlingOptions ExceptionHandlingOptions { get; } + protected IExceptionToErrorInfoConverter ExceptionToErrorInfoConverter { get; } + protected IJsonSerializer JsonSerializer { get; } + + public AuditLogInfoToAuditLogConverter( + IGuidGenerator guidGenerator, + IOptions exceptionHandlingOptions, + IExceptionToErrorInfoConverter exceptionToErrorInfoConverter, + IJsonSerializer jsonSerializer) { - protected IGuidGenerator GuidGenerator { get; } - protected AbpExceptionHandlingOptions ExceptionHandlingOptions { get; } - protected IExceptionToErrorInfoConverter ExceptionToErrorInfoConverter { get; } - protected IJsonSerializer JsonSerializer { get; } + GuidGenerator = guidGenerator; + ExceptionHandlingOptions = exceptionHandlingOptions.Value; + ExceptionToErrorInfoConverter = exceptionToErrorInfoConverter; + JsonSerializer = jsonSerializer; + } - public AuditLogInfoToAuditLogConverter( - IGuidGenerator guidGenerator, - IOptions exceptionHandlingOptions, - IExceptionToErrorInfoConverter exceptionToErrorInfoConverter, - IJsonSerializer jsonSerializer) - { - GuidGenerator = guidGenerator; - ExceptionHandlingOptions = exceptionHandlingOptions.Value; - ExceptionToErrorInfoConverter = exceptionToErrorInfoConverter; - JsonSerializer = jsonSerializer; - } + public virtual Task ConvertAsync(AuditLogInfo auditLogInfo) + { + var auditLogId = GuidGenerator.Create(); - public virtual Task ConvertAsync(AuditLogInfo auditLogInfo) + var extraProperties = new ExtraPropertyDictionary(); + if (auditLogInfo.ExtraProperties != null) { - var auditLogId = GuidGenerator.Create(); - - var extraProperties = new ExtraPropertyDictionary(); - if (auditLogInfo.ExtraProperties != null) + foreach (var pair in auditLogInfo.ExtraProperties) { - foreach (var pair in auditLogInfo.ExtraProperties) - { - extraProperties.Add(pair.Key, pair.Value); - } + extraProperties.Add(pair.Key, pair.Value); } + } - var entityChanges = auditLogInfo - .EntityChanges? - .Select(entityChangeInfo => new EntityChange( - GuidGenerator, - auditLogId, - entityChangeInfo, - tenantId: auditLogInfo.TenantId, - entityTenantId: entityChangeInfo.EntityTenantId)) - .ToList() - ?? new List(); + var entityChanges = auditLogInfo + .EntityChanges? + .Select(entityChangeInfo => new EntityChange( + GuidGenerator, + auditLogId, + entityChangeInfo, + tenantId: auditLogInfo.TenantId, + entityTenantId: entityChangeInfo.EntityTenantId)) + .ToList() + ?? new List(); - var actions = auditLogInfo - .Actions? - .Select(auditLogActionInfo => new AuditLogAction( - GuidGenerator.Create(), - auditLogId, - auditLogActionInfo, - tenantId: auditLogInfo.TenantId)) - .ToList() - ?? new List(); + var actions = auditLogInfo + .Actions? + .Select(auditLogActionInfo => new AuditLogAction( + GuidGenerator.Create(), + auditLogId, + auditLogActionInfo, + tenantId: auditLogInfo.TenantId)) + .ToList() + ?? new List(); - var remoteServiceErrorInfos = auditLogInfo.Exceptions?.Select(exception => - ExceptionToErrorInfoConverter.Convert(exception, options => - { - options.SendExceptionsDetailsToClients = ExceptionHandlingOptions.SendExceptionsDetailsToClients; - options.SendStackTraceToClients = ExceptionHandlingOptions.SendStackTraceToClients; - })) ?? new List(); + var remoteServiceErrorInfos = auditLogInfo.Exceptions?.Select(exception => + ExceptionToErrorInfoConverter.Convert(exception, options => + { + options.SendExceptionsDetailsToClients = ExceptionHandlingOptions.SendExceptionsDetailsToClients; + options.SendStackTraceToClients = ExceptionHandlingOptions.SendStackTraceToClients; + })) ?? new List(); - var exceptions = remoteServiceErrorInfos.Any() - ? JsonSerializer.Serialize(remoteServiceErrorInfos, indented: true) - : null; + var exceptions = remoteServiceErrorInfos.Any() + ? JsonSerializer.Serialize(remoteServiceErrorInfos, indented: true) + : null; - var comments = auditLogInfo - .Comments? - .JoinAsString(Environment.NewLine); + var comments = auditLogInfo + .Comments? + .JoinAsString(Environment.NewLine); - var auditLog = new AuditLog( - auditLogId, - auditLogInfo.ApplicationName, - auditLogInfo.TenantId, - auditLogInfo.TenantName, - auditLogInfo.UserId, - auditLogInfo.UserName, - auditLogInfo.ExecutionTime, - auditLogInfo.ExecutionDuration, - auditLogInfo.ClientIpAddress, - auditLogInfo.ClientName, - auditLogInfo.ClientId, - auditLogInfo.CorrelationId, - auditLogInfo.BrowserInfo, - auditLogInfo.HttpMethod, - auditLogInfo.Url, - auditLogInfo.HttpStatusCode, - auditLogInfo.ImpersonatorUserId, - auditLogInfo.ImpersonatorUserName, - auditLogInfo.ImpersonatorTenantId, - auditLogInfo.ImpersonatorTenantName, - extraProperties, - entityChanges, - actions, - exceptions, - comments - ); + var auditLog = new AuditLog( + auditLogId, + auditLogInfo.ApplicationName, + auditLogInfo.TenantId, + auditLogInfo.TenantName, + auditLogInfo.UserId, + auditLogInfo.UserName, + auditLogInfo.ExecutionTime, + auditLogInfo.ExecutionDuration, + auditLogInfo.ClientIpAddress, + auditLogInfo.ClientName, + auditLogInfo.ClientId, + auditLogInfo.CorrelationId, + auditLogInfo.BrowserInfo, + auditLogInfo.HttpMethod, + auditLogInfo.Url, + auditLogInfo.HttpStatusCode, + auditLogInfo.ImpersonatorUserId, + auditLogInfo.ImpersonatorUserName, + auditLogInfo.ImpersonatorTenantId, + auditLogInfo.ImpersonatorTenantName, + extraProperties, + entityChanges, + actions, + exceptions, + comments + ); - return Task.FromResult(auditLog); - } + return Task.FromResult(auditLog); } } diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchAuditLogManager.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchAuditLogManager.cs index 711079643..c82208cfe 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchAuditLogManager.cs +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchAuditLogManager.cs @@ -13,361 +13,360 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.Timing; -namespace LINGYUN.Abp.AuditLogging.Elasticsearch +namespace LINGYUN.Abp.AuditLogging.Elasticsearch; + +[Dependency(ReplaceServices = true)] +public class ElasticsearchAuditLogManager : IAuditLogManager, ITransientDependency { - [Dependency(ReplaceServices = true)] - public class ElasticsearchAuditLogManager : IAuditLogManager, ITransientDependency + private readonly AbpAuditingOptions _auditingOptions; + private readonly AbpElasticsearchOptions _elasticsearchOptions; + private readonly IIndexNameNormalizer _indexNameNormalizer; + private readonly IElasticsearchClientFactory _clientFactory; + private readonly IAuditLogInfoToAuditLogConverter _converter; + private readonly IClock _clock; + + public ILogger Logger { protected get; set; } + + public ElasticsearchAuditLogManager( + IClock clock, + IIndexNameNormalizer indexNameNormalizer, + IOptions elasticsearchOptions, + IElasticsearchClientFactory clientFactory, + IOptions auditingOptions, + IAuditLogInfoToAuditLogConverter converter) { - private readonly AbpAuditingOptions _auditingOptions; - private readonly AbpElasticsearchOptions _elasticsearchOptions; - private readonly IIndexNameNormalizer _indexNameNormalizer; - private readonly IElasticsearchClientFactory _clientFactory; - private readonly IAuditLogInfoToAuditLogConverter _converter; - private readonly IClock _clock; - - public ILogger Logger { protected get; set; } - - public ElasticsearchAuditLogManager( - IClock clock, - IIndexNameNormalizer indexNameNormalizer, - IOptions elasticsearchOptions, - IElasticsearchClientFactory clientFactory, - IOptions auditingOptions, - IAuditLogInfoToAuditLogConverter converter) - { - _clock = clock; - _converter = converter; - _clientFactory = clientFactory; - _auditingOptions = auditingOptions.Value; - _elasticsearchOptions = elasticsearchOptions.Value; - _indexNameNormalizer = indexNameNormalizer; - - Logger = NullLogger.Instance; - } + _clock = clock; + _converter = converter; + _clientFactory = clientFactory; + _auditingOptions = auditingOptions.Value; + _elasticsearchOptions = elasticsearchOptions.Value; + _indexNameNormalizer = indexNameNormalizer; + + Logger = NullLogger.Instance; + } - public async virtual Task GetCountAsync( - DateTime? startTime = null, - DateTime? endTime = null, - string httpMethod = null, - string url = null, - Guid? userId = null, - string userName = null, - string applicationName = null, - string correlationId = null, - string clientId = null, - string clientIpAddress = null, - int? maxExecutionDuration = null, - int? minExecutionDuration = null, - bool? hasException = null, - HttpStatusCode? httpStatusCode = null, - CancellationToken cancellationToken = default(CancellationToken)) - { - var client = _clientFactory.Create(); - - var querys = BuildQueryDescriptor( - startTime, - endTime, - httpMethod, - url, - userId, - userName, - applicationName, - correlationId, - clientId, - clientIpAddress, - maxExecutionDuration, - minExecutionDuration, - hasException, - httpStatusCode); - - var response = await client.CountAsync(dsl => - dsl.Index(CreateIndex()) - .Query(log => log.Bool(b => b.Must(querys.ToArray()))), - cancellationToken); - - return response.Count; - } + public async virtual Task GetCountAsync( + DateTime? startTime = null, + DateTime? endTime = null, + string httpMethod = null, + string url = null, + Guid? userId = null, + string userName = null, + string applicationName = null, + string correlationId = null, + string clientId = null, + string clientIpAddress = null, + int? maxExecutionDuration = null, + int? minExecutionDuration = null, + bool? hasException = null, + HttpStatusCode? httpStatusCode = null, + CancellationToken cancellationToken = default) + { + var client = _clientFactory.Create(); + + var querys = BuildQueryDescriptor( + startTime, + endTime, + httpMethod, + url, + userId, + userName, + applicationName, + correlationId, + clientId, + clientIpAddress, + maxExecutionDuration, + minExecutionDuration, + hasException, + httpStatusCode); + + var response = await client.CountAsync(dsl => + dsl.Index(CreateIndex()) + .Query(log => log.Bool(b => b.Must(querys.ToArray()))), + cancellationToken); + + return response.Count; + } - public async virtual Task> GetListAsync( - string sorting = null, - int maxResultCount = 50, - int skipCount = 0, - DateTime? startTime = null, - DateTime? endTime = null, - string httpMethod = null, - string url = null, - Guid? userId = null, - string userName = null, - string applicationName = null, - string correlationId = null, - string clientId = null, - string clientIpAddress = null, - int? maxExecutionDuration = null, - int? minExecutionDuration = null, - bool? hasException = null, - HttpStatusCode? httpStatusCode = null, - bool includeDetails = false, - CancellationToken cancellationToken = default(CancellationToken)) + public async virtual Task> GetListAsync( + string sorting = null, + int maxResultCount = 50, + int skipCount = 0, + DateTime? startTime = null, + DateTime? endTime = null, + string httpMethod = null, + string url = null, + Guid? userId = null, + string userName = null, + string applicationName = null, + string correlationId = null, + string clientId = null, + string clientIpAddress = null, + int? maxExecutionDuration = null, + int? minExecutionDuration = null, + bool? hasException = null, + HttpStatusCode? httpStatusCode = null, + bool includeDetails = false, + CancellationToken cancellationToken = default) + { + var client = _clientFactory.Create(); + + var sortOrder = !sorting.IsNullOrWhiteSpace() && sorting.EndsWith("asc", StringComparison.InvariantCultureIgnoreCase) + ? SortOrder.Ascending : SortOrder.Descending; + sorting = !sorting.IsNullOrWhiteSpace() + ? sorting.Split()[0] + : nameof(AuditLog.ExecutionTime); + + var querys = BuildQueryDescriptor( + startTime, + endTime, + httpMethod, + url, + userId, + userName, + applicationName, + correlationId, + clientId, + clientIpAddress, + maxExecutionDuration, + minExecutionDuration, + hasException, + httpStatusCode); + + SourceFilterDescriptor SourceFilter(SourceFilterDescriptor selector) { - var client = _clientFactory.Create(); - - var sortOrder = !sorting.IsNullOrWhiteSpace() && sorting.EndsWith("asc", StringComparison.InvariantCultureIgnoreCase) - ? SortOrder.Ascending : SortOrder.Descending; - sorting = !sorting.IsNullOrWhiteSpace() - ? sorting.Split()[0] - : nameof(AuditLog.ExecutionTime); - - var querys = BuildQueryDescriptor( - startTime, - endTime, - httpMethod, - url, - userId, - userName, - applicationName, - correlationId, - clientId, - clientIpAddress, - maxExecutionDuration, - minExecutionDuration, - hasException, - httpStatusCode); - - SourceFilterDescriptor SourceFilter(SourceFilterDescriptor selector) + selector.IncludeAll(); + if (!includeDetails) { - selector.IncludeAll(); - if (!includeDetails) - { - selector.Excludes(field => - field.Field(f => f.Actions) - .Field(f => f.Comments) - .Field(f => f.Exceptions) - .Field(f => f.EntityChanges)); - } - - return selector; + selector.Excludes(field => + field.Field(f => f.Actions) + .Field(f => f.Comments) + .Field(f => f.Exceptions) + .Field(f => f.EntityChanges)); } - var response = await client.SearchAsync(dsl => - dsl.Index(CreateIndex()) - .Query(log => log.Bool(b => b.Must(querys.ToArray()))) - .Source(SourceFilter) - .Sort(log => log.Field(GetField(sorting), sortOrder)) - .From(skipCount) - .Size(maxResultCount), - cancellationToken); - - return response.Documents.ToList(); + return selector; } - public async virtual Task GetAsync( - Guid id, - bool includeDetails = false, - CancellationToken cancellationToken = default) - { - var client = _clientFactory.Create(); + var response = await client.SearchAsync(dsl => + dsl.Index(CreateIndex()) + .Query(log => log.Bool(b => b.Must(querys.ToArray()))) + .Source(SourceFilter) + .Sort(log => log.Field(GetField(sorting), sortOrder)) + .From(skipCount) + .Size(maxResultCount), + cancellationToken); - var response = await client.GetAsync( - id, - dsl => - dsl.Index(CreateIndex()), - cancellationToken); + return response.Documents.ToList(); + } - return response.Source; - } + public async virtual Task GetAsync( + Guid id, + bool includeDetails = false, + CancellationToken cancellationToken = default) + { + var client = _clientFactory.Create(); - public async virtual Task DeleteAsync(Guid id, CancellationToken cancellationToken = default) - { - var client = _clientFactory.Create(); + var response = await client.GetAsync( + id, + dsl => + dsl.Index(CreateIndex()), + cancellationToken); - await client.DeleteAsync( - id, - dsl => - dsl.Index(CreateIndex()), - cancellationToken); - } + return response.Source; + } - public async virtual Task SaveAsync( - AuditLogInfo auditInfo, - CancellationToken cancellationToken = default(CancellationToken)) - { - if (!_auditingOptions.HideErrors) - { - return await SaveLogAsync(auditInfo, cancellationToken); - } + public async virtual Task DeleteAsync(Guid id, CancellationToken cancellationToken = default) + { + var client = _clientFactory.Create(); - try - { - return await SaveLogAsync(auditInfo, cancellationToken); - } - catch (Exception ex) - { - Logger.LogWarning("Could not save the audit log object: " + Environment.NewLine + auditInfo.ToString()); - Logger.LogException(ex, Microsoft.Extensions.Logging.LogLevel.Error); - } - return ""; + await client.DeleteAsync( + id, + dsl => + dsl.Index(CreateIndex()), + cancellationToken); + } + + public async virtual Task SaveAsync( + AuditLogInfo auditInfo, + CancellationToken cancellationToken = default) + { + if (!_auditingOptions.HideErrors) + { + return await SaveLogAsync(auditInfo, cancellationToken); } - protected async virtual Task SaveLogAsync( - AuditLogInfo auditLogInfo, - CancellationToken cancellationToken = default(CancellationToken)) + try { - var client = _clientFactory.Create(); + return await SaveLogAsync(auditInfo, cancellationToken); + } + catch (Exception ex) + { + Logger.LogWarning("Could not save the audit log object: " + Environment.NewLine + auditInfo.ToString()); + Logger.LogException(ex, Microsoft.Extensions.Logging.LogLevel.Error); + } + return ""; + } - var auditLog = await _converter.ConvertAsync(auditLogInfo); + protected async virtual Task SaveLogAsync( + AuditLogInfo auditLogInfo, + CancellationToken cancellationToken = default) + { + var client = _clientFactory.Create(); - //var response = await client.IndexAsync( - // auditLog, - // (x) => x.Index(CreateIndex()) - // .Id(auditLog.Id), - // cancellationToken); + var auditLog = await _converter.ConvertAsync(auditLogInfo); - // 使用 Bulk 命令传输可能存在参数庞大的日志结构 - var response = await client.BulkAsync( - dsl => dsl.Index(CreateIndex()) - .Create(ct => - ct.Id(auditLog.Id) - .Document(auditLog))); + //var response = await client.IndexAsync( + // auditLog, + // (x) => x.Index(CreateIndex()) + // .Id(auditLog.Id), + // cancellationToken); - return response.Items?.FirstOrDefault()?.Id; - } + // 使用 Bulk 命令传输可能存在参数庞大的日志结构 + var response = await client.BulkAsync( + dsl => dsl.Index(CreateIndex()) + .Create(ct => + ct.Id(auditLog.Id) + .Document(auditLog))); - protected virtual List, QueryContainer>> BuildQueryDescriptor( - DateTime? startTime = null, - DateTime? endTime = null, - string httpMethod = null, - string url = null, - Guid? userId = null, - string userName = null, - string applicationName = null, - string correlationId = null, - string clientId = null, - string clientIpAddress = null, - int? maxExecutionDuration = null, - int? minExecutionDuration = null, - bool? hasException = null, - HttpStatusCode? httpStatusCode = null) - { - var querys = new List, QueryContainer>>(); + return response.Items?.FirstOrDefault()?.Id; + } - if (startTime.HasValue) - { - querys.Add((log) => log.DateRange((q) => q.Field(GetField(nameof(AuditLog.ExecutionTime))).GreaterThanOrEquals(_clock.Normalize(startTime.Value)))); - } - if (endTime.HasValue) - { - querys.Add((log) => log.DateRange((q) => q.Field(GetField(nameof(AuditLog.ExecutionTime))).LessThanOrEquals(_clock.Normalize(endTime.Value)))); - } - if (!httpMethod.IsNullOrWhiteSpace()) - { - querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(AuditLog.HttpMethod))).Value(httpMethod))); - } - if (!url.IsNullOrWhiteSpace()) - { - querys.Add((log) => log.Wildcard((q) => q.Field(GetField(nameof(AuditLog.Url))).Value($"*{url}*"))); - } - if (userId.HasValue) - { - querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(AuditLog.UserId))).Value(userId))); - } - if (!userName.IsNullOrWhiteSpace()) - { - querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(AuditLog.UserName))).Value(userName))); - } - if (!applicationName.IsNullOrWhiteSpace()) - { - querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(AuditLog.ApplicationName))).Value(applicationName))); - } - if (!correlationId.IsNullOrWhiteSpace()) - { - querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(AuditLog.CorrelationId))).Value(correlationId))); - } - if (!clientId.IsNullOrWhiteSpace()) - { - querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(AuditLog.ClientId))).Value(clientId))); - } - if (!clientIpAddress.IsNullOrWhiteSpace()) - { - querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(AuditLog.ClientIpAddress))).Value(clientIpAddress))); - } - if (maxExecutionDuration.HasValue) - { - querys.Add((log) => log.Range((q) => q.Field(GetField(nameof(AuditLog.ExecutionDuration))).LessThanOrEquals(maxExecutionDuration))); - } - if (minExecutionDuration.HasValue) - { - querys.Add((log) => log.Range((q) => q.Field(GetField(nameof(AuditLog.ExecutionDuration))).GreaterThanOrEquals(minExecutionDuration))); - } + protected virtual List, QueryContainer>> BuildQueryDescriptor( + DateTime? startTime = null, + DateTime? endTime = null, + string httpMethod = null, + string url = null, + Guid? userId = null, + string userName = null, + string applicationName = null, + string correlationId = null, + string clientId = null, + string clientIpAddress = null, + int? maxExecutionDuration = null, + int? minExecutionDuration = null, + bool? hasException = null, + HttpStatusCode? httpStatusCode = null) + { + var querys = new List, QueryContainer>>(); + + if (startTime.HasValue) + { + querys.Add((log) => log.DateRange((q) => q.Field(GetField(nameof(AuditLog.ExecutionTime))).GreaterThanOrEquals(_clock.Normalize(startTime.Value)))); + } + if (endTime.HasValue) + { + querys.Add((log) => log.DateRange((q) => q.Field(GetField(nameof(AuditLog.ExecutionTime))).LessThanOrEquals(_clock.Normalize(endTime.Value)))); + } + if (!httpMethod.IsNullOrWhiteSpace()) + { + querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(AuditLog.HttpMethod))).Value(httpMethod))); + } + if (!url.IsNullOrWhiteSpace()) + { + querys.Add((log) => log.Wildcard((q) => q.Field(GetField(nameof(AuditLog.Url))).Value($"*{url}*"))); + } + if (userId.HasValue) + { + querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(AuditLog.UserId))).Value(userId))); + } + if (!userName.IsNullOrWhiteSpace()) + { + querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(AuditLog.UserName))).Value(userName))); + } + if (!applicationName.IsNullOrWhiteSpace()) + { + querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(AuditLog.ApplicationName))).Value(applicationName))); + } + if (!correlationId.IsNullOrWhiteSpace()) + { + querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(AuditLog.CorrelationId))).Value(correlationId))); + } + if (!clientId.IsNullOrWhiteSpace()) + { + querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(AuditLog.ClientId))).Value(clientId))); + } + if (!clientIpAddress.IsNullOrWhiteSpace()) + { + querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(AuditLog.ClientIpAddress))).Value(clientIpAddress))); + } + if (maxExecutionDuration.HasValue) + { + querys.Add((log) => log.Range((q) => q.Field(GetField(nameof(AuditLog.ExecutionDuration))).LessThanOrEquals(maxExecutionDuration))); + } + if (minExecutionDuration.HasValue) + { + querys.Add((log) => log.Range((q) => q.Field(GetField(nameof(AuditLog.ExecutionDuration))).GreaterThanOrEquals(minExecutionDuration))); + } - if (hasException.HasValue) + if (hasException.HasValue) + { + if (hasException.Value) { - if (hasException.Value) - { - querys.Add( - (q) => q.Bool( - (b) => b.Must( - (m) => m.Exists( - (e) => e.Field((f) => f.Exceptions))) - ) - ); - } - else - { - querys.Add( - (q) => q.Bool( - (b) => b.MustNot( - (mn) => mn.Exists( - (e) => e.Field( - (f) => f.Exceptions))) - ) - ); - } + querys.Add( + (q) => q.Bool( + (b) => b.Must( + (m) => m.Exists( + (e) => e.Field((f) => f.Exceptions))) + ) + ); } - - if (httpStatusCode.HasValue) + else { - querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(AuditLog.HttpStatusCode))).Value(httpStatusCode))); + querys.Add( + (q) => q.Bool( + (b) => b.MustNot( + (mn) => mn.Exists( + (e) => e.Field( + (f) => f.Exceptions))) + ) + ); } - - return querys; } - protected virtual string CreateIndex() + if (httpStatusCode.HasValue) { - return _indexNameNormalizer.NormalizeIndex("audit-log"); + querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(AuditLog.HttpStatusCode))).Value(httpStatusCode))); } - private readonly static IDictionary _fieldMaps = new Dictionary(StringComparer.InvariantCultureIgnoreCase) - { - { "Id", "Id.keyword" }, - { "ApplicationName", "ApplicationName.keyword" }, - { "UserId", "UserId.keyword" }, - { "UserName", "UserName.keyword" }, - { "TenantId", "TenantId.keyword" }, - { "TenantName", "TenantName.keyword" }, - { "ImpersonatorUserId", "ImpersonatorUserId.keyword" }, - { "ImpersonatorTenantId", "ImpersonatorTenantId.keyword" }, - { "ClientName", "ClientName.keyword" }, - { "ClientIpAddress", "ClientIpAddress.keyword" }, - { "ClientId", "ClientId.keyword" }, - { "CorrelationId", "CorrelationId.keyword" }, - { "BrowserInfo", "BrowserInfo.keyword" }, - { "HttpMethod", "HttpMethod.keyword" }, - { "Url", "Url.keyword" }, - { "ExecutionDuration", "ExecutionDuration" }, - { "ExecutionTime", "ExecutionTime" }, - { "HttpStatusCode", "HttpStatusCode" }, - }; - protected virtual string GetField(string field) - { - if (_fieldMaps.TryGetValue(field, out string mapField)) - { - return _elasticsearchOptions.FieldCamelCase ? mapField.ToCamelCase() : mapField.ToPascalCase(); - } + return querys; + } + + protected virtual string CreateIndex() + { + return _indexNameNormalizer.NormalizeIndex("audit-log"); + } - return _elasticsearchOptions.FieldCamelCase ? field.ToCamelCase() : field.ToPascalCase(); + private readonly static IDictionary _fieldMaps = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + { "Id", "Id.keyword" }, + { "ApplicationName", "ApplicationName.keyword" }, + { "UserId", "UserId.keyword" }, + { "UserName", "UserName.keyword" }, + { "TenantId", "TenantId.keyword" }, + { "TenantName", "TenantName.keyword" }, + { "ImpersonatorUserId", "ImpersonatorUserId.keyword" }, + { "ImpersonatorTenantId", "ImpersonatorTenantId.keyword" }, + { "ClientName", "ClientName.keyword" }, + { "ClientIpAddress", "ClientIpAddress.keyword" }, + { "ClientId", "ClientId.keyword" }, + { "CorrelationId", "CorrelationId.keyword" }, + { "BrowserInfo", "BrowserInfo.keyword" }, + { "HttpMethod", "HttpMethod.keyword" }, + { "Url", "Url.keyword" }, + { "ExecutionDuration", "ExecutionDuration" }, + { "ExecutionTime", "ExecutionTime" }, + { "HttpStatusCode", "HttpStatusCode" }, + }; + protected virtual string GetField(string field) + { + if (_fieldMaps.TryGetValue(field, out string mapField)) + { + return _elasticsearchOptions.FieldCamelCase ? mapField.ToCamelCase() : mapField.ToPascalCase(); } + + return _elasticsearchOptions.FieldCamelCase ? field.ToCamelCase() : field.ToPascalCase(); } } diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchSecurityLogManager.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchSecurityLogManager.cs index a6cc31c3d..d2df7b93f 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchSecurityLogManager.cs +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchSecurityLogManager.cs @@ -13,260 +13,259 @@ using Volo.Abp.SecurityLog; using Volo.Abp.Timing; -namespace LINGYUN.Abp.AuditLogging.Elasticsearch +namespace LINGYUN.Abp.AuditLogging.Elasticsearch; + +[Dependency(ReplaceServices = true)] +public class ElasticsearchSecurityLogManager : ISecurityLogManager, ITransientDependency { - [Dependency(ReplaceServices = true)] - public class ElasticsearchSecurityLogManager : ISecurityLogManager, ITransientDependency + private readonly AbpSecurityLogOptions _securityLogOptions; + private readonly AbpElasticsearchOptions _elasticsearchOptions; + private readonly IIndexNameNormalizer _indexNameNormalizer; + private readonly IGuidGenerator _guidGenerator; + private readonly IElasticsearchClientFactory _clientFactory; + private readonly IClock _clock; + + public ILogger Logger { protected get; set; } + + public ElasticsearchSecurityLogManager( + IClock clock, + IGuidGenerator guidGenerator, + IIndexNameNormalizer indexNameNormalizer, + IOptions securityLogOptions, + IOptions elasticsearchOptions, + IElasticsearchClientFactory clientFactory) { - private readonly AbpSecurityLogOptions _securityLogOptions; - private readonly AbpElasticsearchOptions _elasticsearchOptions; - private readonly IIndexNameNormalizer _indexNameNormalizer; - private readonly IGuidGenerator _guidGenerator; - private readonly IElasticsearchClientFactory _clientFactory; - private readonly IClock _clock; + _clock = clock; + _guidGenerator = guidGenerator; + _clientFactory = clientFactory; + _indexNameNormalizer = indexNameNormalizer; + _securityLogOptions = securityLogOptions.Value; + _elasticsearchOptions = elasticsearchOptions.Value; - public ILogger Logger { protected get; set; } + Logger = NullLogger.Instance; + } - public ElasticsearchSecurityLogManager( - IClock clock, - IGuidGenerator guidGenerator, - IIndexNameNormalizer indexNameNormalizer, - IOptions securityLogOptions, - IOptions elasticsearchOptions, - IElasticsearchClientFactory clientFactory) + public async virtual Task SaveAsync( + SecurityLogInfo securityLogInfo, + CancellationToken cancellationToken = default) + { + // TODO: 框架不把这玩意儿放在 ISecurityLogManager? + if (!_securityLogOptions.IsEnabled) { - _clock = clock; - _guidGenerator = guidGenerator; - _clientFactory = clientFactory; - _indexNameNormalizer = indexNameNormalizer; - _securityLogOptions = securityLogOptions.Value; - _elasticsearchOptions = elasticsearchOptions.Value; - - Logger = NullLogger.Instance; + return; } - public async virtual Task SaveAsync( - SecurityLogInfo securityLogInfo, - CancellationToken cancellationToken = default(CancellationToken)) - { - // TODO: 框架不把这玩意儿放在 ISecurityLogManager? - if (!_securityLogOptions.IsEnabled) - { - return; - } + var client = _clientFactory.Create(); - var client = _clientFactory.Create(); + var securityLog = new SecurityLog( + _guidGenerator.Create(), + securityLogInfo); - var securityLog = new SecurityLog( - _guidGenerator.Create(), - securityLogInfo); + await client.IndexAsync( + securityLog, + (x) => x.Index(CreateIndex()) + .Id(securityLog.Id), + cancellationToken); + } - await client.IndexAsync( - securityLog, - (x) => x.Index(CreateIndex()) - .Id(securityLog.Id), - cancellationToken); - } + public async virtual Task GetAsync( + Guid id, + bool includeDetails = false, + CancellationToken cancellationToken = default) + { + var client = _clientFactory.Create(); - public async virtual Task GetAsync( - Guid id, - bool includeDetails = false, - CancellationToken cancellationToken = default) - { - var client = _clientFactory.Create(); + var response = await client.GetAsync( + id, + dsl => + dsl.Index(CreateIndex()), + cancellationToken); - var response = await client.GetAsync( - id, - dsl => - dsl.Index(CreateIndex()), - cancellationToken); + return response.Source; + } - return response.Source; - } + public async virtual Task DeleteAsync(Guid id, CancellationToken cancellationToken = default) + { + var client = _clientFactory.Create(); - public async virtual Task DeleteAsync(Guid id, CancellationToken cancellationToken = default) - { - var client = _clientFactory.Create(); + await client.DeleteAsync( + id, + dsl => + dsl.Index(CreateIndex()), + cancellationToken); + } - await client.DeleteAsync( - id, - dsl => - dsl.Index(CreateIndex()), - cancellationToken); - } + public async virtual Task> GetListAsync( + string sorting = null, + int maxResultCount = 50, + int skipCount = 0, + DateTime? startTime = null, + DateTime? endTime = null, + string applicationName = null, + string identity = null, + string action = null, + Guid? userId = null, + string userName = null, + string clientId = null, + string clientIpAddress = null, + string correlationId = null, + bool includeDetails = false, + CancellationToken cancellationToken = default) + { + var client = _clientFactory.Create(); - public async virtual Task> GetListAsync( - string sorting = null, - int maxResultCount = 50, - int skipCount = 0, - DateTime? startTime = null, - DateTime? endTime = null, - string applicationName = null, - string identity = null, - string action = null, - Guid? userId = null, - string userName = null, - string clientId = null, - string clientIpAddress = null, - string correlationId = null, - bool includeDetails = false, - CancellationToken cancellationToken = default(CancellationToken)) - { - var client = _clientFactory.Create(); + var sortOrder = !sorting.IsNullOrWhiteSpace() && sorting.EndsWith("asc", StringComparison.InvariantCultureIgnoreCase) + ? SortOrder.Ascending : SortOrder.Descending; + sorting = !sorting.IsNullOrWhiteSpace() + ? sorting.Split()[0] + : nameof(SecurityLog.CreationTime); - var sortOrder = !sorting.IsNullOrWhiteSpace() && sorting.EndsWith("asc", StringComparison.InvariantCultureIgnoreCase) - ? SortOrder.Ascending : SortOrder.Descending; - sorting = !sorting.IsNullOrWhiteSpace() - ? sorting.Split()[0] - : nameof(SecurityLog.CreationTime); + var querys = BuildQueryDescriptor( + startTime, + endTime, + applicationName, + identity, + action, + userId, + userName, + clientId, + clientIpAddress, + correlationId); - var querys = BuildQueryDescriptor( - startTime, - endTime, - applicationName, - identity, - action, - userId, - userName, - clientId, - clientIpAddress, - correlationId); + var response = await client.SearchAsync(dsl => + dsl.Index(CreateIndex()) + .Query(log => log.Bool(b => b.Must(querys.ToArray()))) + .Source(log => log.IncludeAll()) + .Sort(log => log.Field(GetField(sorting), sortOrder)) + .From(skipCount) + .Size(maxResultCount), + cancellationToken); - var response = await client.SearchAsync(dsl => - dsl.Index(CreateIndex()) - .Query(log => log.Bool(b => b.Must(querys.ToArray()))) - .Source(log => log.IncludeAll()) - .Sort(log => log.Field(GetField(sorting), sortOrder)) - .From(skipCount) - .Size(maxResultCount), - cancellationToken); + return response.Documents.ToList(); + } - return response.Documents.ToList(); - } + public async virtual Task GetCountAsync( + DateTime? startTime = null, + DateTime? endTime = null, + string applicationName = null, + string identity = null, + string action = null, + Guid? userId = null, + string userName = null, + string clientId = null, + string clientIpAddress = null, + string correlationId = null, + CancellationToken cancellationToken = default) + { + var client = _clientFactory.Create(); - public async virtual Task GetCountAsync( - DateTime? startTime = null, - DateTime? endTime = null, - string applicationName = null, - string identity = null, - string action = null, - Guid? userId = null, - string userName = null, - string clientId = null, - string clientIpAddress = null, - string correlationId = null, - CancellationToken cancellationToken = default(CancellationToken)) - { - var client = _clientFactory.Create(); + var querys = BuildQueryDescriptor( + startTime, + endTime, + applicationName, + identity, + action, + userId, + userName, + clientId, + clientIpAddress, + correlationId); - var querys = BuildQueryDescriptor( - startTime, - endTime, - applicationName, - identity, - action, - userId, - userName, - clientId, - clientIpAddress, - correlationId); + var response = await client.CountAsync(dsl => + dsl.Index(CreateIndex()) + .Query(log => log.Bool(b => b.Must(querys.ToArray()))), + cancellationToken); - var response = await client.CountAsync(dsl => - dsl.Index(CreateIndex()) - .Query(log => log.Bool(b => b.Must(querys.ToArray()))), - cancellationToken); + return response.Count; + } - return response.Count; - } + protected virtual List, QueryContainer>> BuildQueryDescriptor( + DateTime? startTime = null, + DateTime? endTime = null, + string applicationName = null, + string identity = null, + string action = null, + Guid? userId = null, + string userName = null, + string clientId = null, + string clientIpAddress = null, + string correlationId = null) + { + var querys = new List, QueryContainer>>(); - protected virtual List, QueryContainer>> BuildQueryDescriptor( - DateTime? startTime = null, - DateTime? endTime = null, - string applicationName = null, - string identity = null, - string action = null, - Guid? userId = null, - string userName = null, - string clientId = null, - string clientIpAddress = null, - string correlationId = null) + if (startTime.HasValue) { - var querys = new List, QueryContainer>>(); - - if (startTime.HasValue) - { - querys.Add((log) => log.DateRange((q) => q.Field(GetField(nameof(SecurityLog.CreationTime))).GreaterThanOrEquals(_clock.Normalize(startTime.Value)))); - } - if (endTime.HasValue) - { - querys.Add((log) => log.DateRange((q) => q.Field(GetField(nameof(SecurityLog.CreationTime))).LessThanOrEquals(_clock.Normalize(endTime.Value)))); - } - if (!applicationName.IsNullOrWhiteSpace()) - { - querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SecurityLog.ApplicationName))).Value(applicationName))); - } - if (!identity.IsNullOrWhiteSpace()) - { - querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SecurityLog.Identity))).Value(identity))); - } - if (!action.IsNullOrWhiteSpace()) - { - querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SecurityLog.Action))).Value(action))); - } - if (userId.HasValue) - { - querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SecurityLog.UserId))).Value(userId))); - } - if (!userName.IsNullOrWhiteSpace()) - { - querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SecurityLog.UserName))).Value(userName))); - } - if (!clientId.IsNullOrWhiteSpace()) - { - querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SecurityLog.ClientId))).Value(clientId))); - } - if (!clientIpAddress.IsNullOrWhiteSpace()) - { - querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SecurityLog.ClientIpAddress))).Value(clientIpAddress))); - } - if (!correlationId.IsNullOrWhiteSpace()) - { - querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SecurityLog.CorrelationId))).Value(correlationId))); - } - - return querys; + querys.Add((log) => log.DateRange((q) => q.Field(GetField(nameof(SecurityLog.CreationTime))).GreaterThanOrEquals(_clock.Normalize(startTime.Value)))); } - - protected virtual string CreateIndex() + if (endTime.HasValue) { - return _indexNameNormalizer.NormalizeIndex("security-log"); + querys.Add((log) => log.DateRange((q) => q.Field(GetField(nameof(SecurityLog.CreationTime))).LessThanOrEquals(_clock.Normalize(endTime.Value)))); } - - private readonly static IDictionary _fieldMaps = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + if (!applicationName.IsNullOrWhiteSpace()) + { + querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SecurityLog.ApplicationName))).Value(applicationName))); + } + if (!identity.IsNullOrWhiteSpace()) + { + querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SecurityLog.Identity))).Value(identity))); + } + if (!action.IsNullOrWhiteSpace()) + { + querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SecurityLog.Action))).Value(action))); + } + if (userId.HasValue) + { + querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SecurityLog.UserId))).Value(userId))); + } + if (!userName.IsNullOrWhiteSpace()) + { + querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SecurityLog.UserName))).Value(userName))); + } + if (!clientId.IsNullOrWhiteSpace()) { - { "Id", "Id.keyword" }, - { "ApplicationName", "ApplicationName.keyword" }, - { "UserId", "UserId.keyword" }, - { "UserName", "UserName.keyword" }, - { "TenantId", "TenantId.keyword" }, - { "TenantName", "TenantName.keyword" }, - { "Identity", "Identity.keyword" }, - { "Action", "Action.keyword" }, - { "BrowserInfo", "BrowserInfo.keyword" }, - { "ClientIpAddress", "ClientIpAddress.keyword" }, - { "ClientId", "ClientId.keyword" }, - { "CorrelationId", "CorrelationId.keyword" }, - { "CreationTime", "CreationTime" }, - }; - protected virtual string GetField(string field) + querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SecurityLog.ClientId))).Value(clientId))); + } + if (!clientIpAddress.IsNullOrWhiteSpace()) + { + querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SecurityLog.ClientIpAddress))).Value(clientIpAddress))); + } + if (!correlationId.IsNullOrWhiteSpace()) { - if (_fieldMaps.TryGetValue(field, out string mapField)) - { - return _elasticsearchOptions.FieldCamelCase ? mapField.ToCamelCase() : mapField.ToPascalCase(); - } + querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SecurityLog.CorrelationId))).Value(correlationId))); + } - return _elasticsearchOptions.FieldCamelCase ? field.ToCamelCase() : field.ToPascalCase(); + return querys; + } + + protected virtual string CreateIndex() + { + return _indexNameNormalizer.NormalizeIndex("security-log"); + } + + private readonly static IDictionary _fieldMaps = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + { "Id", "Id.keyword" }, + { "ApplicationName", "ApplicationName.keyword" }, + { "UserId", "UserId.keyword" }, + { "UserName", "UserName.keyword" }, + { "TenantId", "TenantId.keyword" }, + { "TenantName", "TenantName.keyword" }, + { "Identity", "Identity.keyword" }, + { "Action", "Action.keyword" }, + { "BrowserInfo", "BrowserInfo.keyword" }, + { "ClientIpAddress", "ClientIpAddress.keyword" }, + { "ClientId", "ClientId.keyword" }, + { "CorrelationId", "CorrelationId.keyword" }, + { "CreationTime", "CreationTime" }, + }; + protected virtual string GetField(string field) + { + if (_fieldMaps.TryGetValue(field, out string mapField)) + { + return _elasticsearchOptions.FieldCamelCase ? mapField.ToCamelCase() : mapField.ToPascalCase(); } + + return _elasticsearchOptions.FieldCamelCase ? field.ToCamelCase() : field.ToPascalCase(); } } diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/IAuditLogInfoToAuditLogConverter.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/IAuditLogInfoToAuditLogConverter.cs index ed9b120e3..2bb652a6b 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/IAuditLogInfoToAuditLogConverter.cs +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/IAuditLogInfoToAuditLogConverter.cs @@ -1,10 +1,9 @@ using System.Threading.Tasks; using Volo.Abp.Auditing; -namespace LINGYUN.Abp.AuditLogging +namespace LINGYUN.Abp.AuditLogging; + +public interface IAuditLogInfoToAuditLogConverter { - public interface IAuditLogInfoToAuditLogConverter - { - Task ConvertAsync(AuditLogInfo auditLogInfo); - } + Task ConvertAsync(AuditLogInfo auditLogInfo); } diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/IIndexInitializer.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/IIndexInitializer.cs index d6eb705e5..9b364543d 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/IIndexInitializer.cs +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/IIndexInitializer.cs @@ -1,9 +1,8 @@ using System.Threading.Tasks; -namespace LINGYUN.Abp.AuditLogging.Elasticsearch +namespace LINGYUN.Abp.AuditLogging.Elasticsearch; + +public interface IIndexInitializer { - public interface IIndexInitializer - { - Task InitializeAsync(); - } + Task InitializeAsync(); } diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/IIndexNameNormalizer.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/IIndexNameNormalizer.cs index e48276cd2..3ae752b63 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/IIndexNameNormalizer.cs +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/IIndexNameNormalizer.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.AuditLogging.Elasticsearch +namespace LINGYUN.Abp.AuditLogging.Elasticsearch; + +public interface IIndexNameNormalizer { - public interface IIndexNameNormalizer - { - string NormalizeIndex(string index); - } + string NormalizeIndex(string index); } diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/IndexInitializer.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/IndexInitializer.cs index 86a677d20..d394c08fd 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/IndexInitializer.cs +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/IndexInitializer.cs @@ -9,98 +9,97 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.Json; -namespace LINGYUN.Abp.AuditLogging.Elasticsearch +namespace LINGYUN.Abp.AuditLogging.Elasticsearch; + +public class IndexInitializer : IIndexInitializer, ISingletonDependency { - public class IndexInitializer : IIndexInitializer, ISingletonDependency - { - private readonly AbpJsonOptions _jsonOptions; - private readonly AbpAuditLoggingElasticsearchOptions _elasticsearchOptions; - private readonly IIndexNameNormalizer _nameNormalizer; - private readonly IElasticsearchClientFactory _clientFactory; + private readonly AbpJsonOptions _jsonOptions; + private readonly AbpAuditLoggingElasticsearchOptions _elasticsearchOptions; + private readonly IIndexNameNormalizer _nameNormalizer; + private readonly IElasticsearchClientFactory _clientFactory; - public ILogger Logger { protected get; set; } + public ILogger Logger { protected get; set; } - public IndexInitializer( - IOptions jsonOptions, - IOptions elasticsearchOptions, - IIndexNameNormalizer nameNormalizer, - IElasticsearchClientFactory clientFactory) - { - _jsonOptions = jsonOptions.Value; - _elasticsearchOptions = elasticsearchOptions.Value; - _nameNormalizer = nameNormalizer; - _clientFactory = clientFactory; + public IndexInitializer( + IOptions jsonOptions, + IOptions elasticsearchOptions, + IIndexNameNormalizer nameNormalizer, + IElasticsearchClientFactory clientFactory) + { + _jsonOptions = jsonOptions.Value; + _elasticsearchOptions = elasticsearchOptions.Value; + _nameNormalizer = nameNormalizer; + _clientFactory = clientFactory; - Logger = NullLogger.Instance; - } + Logger = NullLogger.Instance; + } - public async virtual Task InitializeAsync() + public async virtual Task InitializeAsync() + { + var client = _clientFactory.Create(); + var dateTimeFormat = !_jsonOptions.OutputDateTimeFormat.IsNullOrWhiteSpace() + ? $"{_jsonOptions.OutputDateTimeFormat}||strict_date_optional_time||epoch_millis" + : "strict_date_optional_time||epoch_millis"; + var indexState = new IndexState { - var client = _clientFactory.Create(); - var dateTimeFormat = !_jsonOptions.OutputDateTimeFormat.IsNullOrWhiteSpace() - ? $"{_jsonOptions.OutputDateTimeFormat}||strict_date_optional_time||epoch_millis" - : "strict_date_optional_time||epoch_millis"; - var indexState = new IndexState - { - Settings = _elasticsearchOptions.IndexSettings, - }; - await InitlizeAuditLogIndex(client, indexState, dateTimeFormat); - await InitlizeSecurityLogIndex(client, indexState, dateTimeFormat); - } + Settings = _elasticsearchOptions.IndexSettings, + }; + await InitlizeAuditLogIndex(client, indexState, dateTimeFormat); + await InitlizeSecurityLogIndex(client, indexState, dateTimeFormat); + } - protected async virtual Task InitlizeAuditLogIndex(IElasticClient client, IIndexState indexState, string dateTimeFormat) + protected async virtual Task InitlizeAuditLogIndex(IElasticClient client, IIndexState indexState, string dateTimeFormat) + { + var indexName = _nameNormalizer.NormalizeIndex("audit-log"); + var indexExists = await client.Indices.ExistsAsync(indexName); + if (!indexExists.Exists) { - var indexName = _nameNormalizer.NormalizeIndex("audit-log"); - var indexExists = await client.Indices.ExistsAsync(indexName); - if (!indexExists.Exists) + var indexCreateResponse = await client.Indices.CreateAsync( + indexName, + dsl => dsl.InitializeUsing(indexState) + .Map(map => + map.AutoMap() + .Properties(mp => + mp.Date(p => p.Name(n => n.ExecutionTime).Format(dateTimeFormat)) + .Object(p => p.Name(n => n.ExtraProperties)) + .Nested(n => + n.AutoMap() + .Name(nameof(AuditLog.EntityChanges)) + .Properties(np => + np.Object(p => p.Name(n => n.ExtraProperties)) + .Date(p => p.Name(n => n.ChangeTime).Format(dateTimeFormat)) + .Nested(npn => npn.Name(nameof(EntityChange.PropertyChanges))))) + .Nested(n => n.Name(nameof(AuditLog.Actions)) + .AutoMap() + .Properties((np => + np.Object(p => p.Name(n => n.ExtraProperties)) + .Date(p => p.Name(n => n.ExecutionTime).Format(dateTimeFormat)))))))); + if (!indexCreateResponse.IsValid) { - var indexCreateResponse = await client.Indices.CreateAsync( - indexName, - dsl => dsl.InitializeUsing(indexState) - .Map(map => - map.AutoMap() - .Properties(mp => - mp.Date(p => p.Name(n => n.ExecutionTime).Format(dateTimeFormat)) - .Object(p => p.Name(n => n.ExtraProperties)) - .Nested(n => - n.AutoMap() - .Name(nameof(AuditLog.EntityChanges)) - .Properties(np => - np.Object(p => p.Name(n => n.ExtraProperties)) - .Date(p => p.Name(n => n.ChangeTime).Format(dateTimeFormat)) - .Nested(npn => npn.Name(nameof(EntityChange.PropertyChanges))))) - .Nested(n => n.Name(nameof(AuditLog.Actions)) - .AutoMap() - .Properties((np => - np.Object(p => p.Name(n => n.ExtraProperties)) - .Date(p => p.Name(n => n.ExecutionTime).Format(dateTimeFormat)))))))); - if (!indexCreateResponse.IsValid) - { - Logger.LogWarning("Failed to initialize index and audit log may not be retrieved."); - Logger.LogWarning(indexCreateResponse.OriginalException.ToString()); - } + Logger.LogWarning("Failed to initialize index and audit log may not be retrieved."); + Logger.LogWarning(indexCreateResponse.OriginalException.ToString()); } } + } - protected async virtual Task InitlizeSecurityLogIndex(IElasticClient client, IIndexState indexState, string dateTimeFormat) + protected async virtual Task InitlizeSecurityLogIndex(IElasticClient client, IIndexState indexState, string dateTimeFormat) + { + var indexName = _nameNormalizer.NormalizeIndex("security-log"); + var indexExists = await client.Indices.ExistsAsync(indexName); + if (!indexExists.Exists) { - var indexName = _nameNormalizer.NormalizeIndex("security-log"); - var indexExists = await client.Indices.ExistsAsync(indexName); - if (!indexExists.Exists) + var indexCreateResponse = await client.Indices.CreateAsync( + indexName, + dsl => dsl.InitializeUsing(indexState) + .Map(map => + map.AutoMap() + .Properties(mp => + mp.Object(p => p.Name(n => n.ExtraProperties)) + .Date(p => p.Name(n => n.CreationTime).Format(dateTimeFormat))))); + if (!indexCreateResponse.IsValid) { - var indexCreateResponse = await client.Indices.CreateAsync( - indexName, - dsl => dsl.InitializeUsing(indexState) - .Map(map => - map.AutoMap() - .Properties(mp => - mp.Object(p => p.Name(n => n.ExtraProperties)) - .Date(p => p.Name(n => n.CreationTime).Format(dateTimeFormat))))); - if (!indexCreateResponse.IsValid) - { - Logger.LogWarning("Failed to initialize index and security log may not be retrieved."); - Logger.LogWarning(indexCreateResponse.OriginalException.ToString()); - } + Logger.LogWarning("Failed to initialize index and security log may not be retrieved."); + Logger.LogWarning(indexCreateResponse.OriginalException.ToString()); } } } diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/IndexInitializerService.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/IndexInitializerService.cs index 75ba37210..e75d762c2 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/IndexInitializerService.cs +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/IndexInitializerService.cs @@ -2,20 +2,19 @@ using System.Threading; using System.Threading.Tasks; -namespace LINGYUN.Abp.AuditLogging.Elasticsearch +namespace LINGYUN.Abp.AuditLogging.Elasticsearch; + +public class IndexInitializerService : BackgroundService { - public class IndexInitializerService : BackgroundService - { - private readonly IIndexInitializer _indexInitializer; + private readonly IIndexInitializer _indexInitializer; - public IndexInitializerService(IIndexInitializer indexInitializer) - { - _indexInitializer = indexInitializer; - } + public IndexInitializerService(IIndexInitializer indexInitializer) + { + _indexInitializer = indexInitializer; + } - protected override async Task ExecuteAsync(CancellationToken stoppingToken) - { - await _indexInitializer.InitializeAsync(); - } + protected override async Task ExecuteAsync(CancellationToken stoppingToken) + { + await _indexInitializer.InitializeAsync(); } } diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/IndexNameNormalizer.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/IndexNameNormalizer.cs index e4d143d0c..4245a50bb 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/IndexNameNormalizer.cs +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/IndexNameNormalizer.cs @@ -3,30 +3,29 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.AuditLogging.Elasticsearch +namespace LINGYUN.Abp.AuditLogging.Elasticsearch; + +public class IndexNameNormalizer : IIndexNameNormalizer, ISingletonDependency { - public class IndexNameNormalizer : IIndexNameNormalizer, ISingletonDependency - { - private readonly ICurrentTenant _currentTenant; - private readonly AbpAuditLoggingElasticsearchOptions _options; + private readonly ICurrentTenant _currentTenant; + private readonly AbpAuditLoggingElasticsearchOptions _options; - public IndexNameNormalizer( - ICurrentTenant currentTenant, - IOptions options) - { - _currentTenant = currentTenant; - _options = options.Value; - } + public IndexNameNormalizer( + ICurrentTenant currentTenant, + IOptions options) + { + _currentTenant = currentTenant; + _options = options.Value; + } - public string NormalizeIndex(string index) + public string NormalizeIndex(string index) + { + if (_currentTenant.IsAvailable) { - if (_currentTenant.IsAvailable) - { - return $"{_options.IndexPrefix}-{index}-{_currentTenant.Id:N}"; - } - return _options.IndexPrefix.IsNullOrWhiteSpace() - ? index - : $"{_options.IndexPrefix}-{index}"; + return $"{_options.IndexPrefix}-{index}-{_currentTenant.Id:N}"; } + return _options.IndexPrefix.IsNullOrWhiteSpace() + ? index + : $"{_options.IndexPrefix}-{index}"; } } diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN.Abp.AuditLogging.EntityFrameworkCore.csproj b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN.Abp.AuditLogging.EntityFrameworkCore.csproj index 5fb21ab37..08a753b27 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN.Abp.AuditLogging.EntityFrameworkCore.csproj +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN.Abp.AuditLogging.EntityFrameworkCore.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.AuditLogging.EntityFrameworkCore + LINGYUN.Abp.AuditLogging.EntityFrameworkCore + false + false + false diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingEntityFrameworkCoreModule.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingEntityFrameworkCoreModule.cs index 57f4c4826..2ca98c940 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingEntityFrameworkCoreModule.cs +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingEntityFrameworkCoreModule.cs @@ -2,24 +2,23 @@ using Volo.Abp.AutoMapper; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.AuditLogging.EntityFrameworkCore +namespace LINGYUN.Abp.AuditLogging.EntityFrameworkCore; + +[DependsOn( + typeof(Volo.Abp.Identity.EntityFrameworkCore.AbpIdentityEntityFrameworkCoreModule), + typeof(Volo.Abp.AuditLogging.EntityFrameworkCore.AbpAuditLoggingEntityFrameworkCoreModule))] +[DependsOn( + typeof(AbpAuditLoggingModule), + typeof(AbpAutoMapperModule))] +public class AbpAuditLoggingEntityFrameworkCoreModule : AbpModule { - [DependsOn( - typeof(Volo.Abp.Identity.EntityFrameworkCore.AbpIdentityEntityFrameworkCoreModule), - typeof(Volo.Abp.AuditLogging.EntityFrameworkCore.AbpAuditLoggingEntityFrameworkCoreModule))] - [DependsOn( - typeof(AbpAuditLoggingModule), - typeof(AbpAutoMapperModule))] - public class AbpAuditLoggingEntityFrameworkCoreModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddAutoMapperObjectMapper(); + context.Services.AddAutoMapperObjectMapper(); - Configure(options => - { - options.AddProfile(validate: true); - }); - } + Configure(options => + { + options.AddProfile(validate: true); + }); } } diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/AbpAuditingMapperProfile.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/AbpAuditingMapperProfile.cs index 73609aa23..14ac2d52b 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/AbpAuditingMapperProfile.cs +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/AbpAuditingMapperProfile.cs @@ -1,21 +1,20 @@ using AutoMapper; -namespace LINGYUN.Abp.AuditLogging.EntityFrameworkCore +namespace LINGYUN.Abp.AuditLogging.EntityFrameworkCore; + +public class AbpAuditingMapperProfile : Profile { - public class AbpAuditingMapperProfile : Profile + public AbpAuditingMapperProfile() { - public AbpAuditingMapperProfile() - { - CreateMap() - .MapExtraProperties(); - CreateMap(); - CreateMap() - .MapExtraProperties(); - CreateMap() - .MapExtraProperties(); + CreateMap() + .MapExtraProperties(); + CreateMap(); + CreateMap() + .MapExtraProperties(); + CreateMap() + .MapExtraProperties(); - CreateMap() - .MapExtraProperties(); - } + CreateMap() + .MapExtraProperties(); } } diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/AuditLogManager.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/AuditLogManager.cs index 1e577c879..2d862c69d 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/AuditLogManager.cs +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/AuditLogManager.cs @@ -12,168 +12,169 @@ using Volo.Abp.ObjectMapping; using Volo.Abp.Uow; -namespace LINGYUN.Abp.AuditLogging.EntityFrameworkCore +namespace LINGYUN.Abp.AuditLogging.EntityFrameworkCore; + +[Dependency(ReplaceServices = true)] +public class AuditLogManager : IAuditLogManager, ITransientDependency { - [Dependency(ReplaceServices = true)] - public class AuditLogManager : IAuditLogManager, ITransientDependency + protected IObjectMapper ObjectMapper { get; } + protected IAuditLogRepository AuditLogRepository { get; } + protected IUnitOfWorkManager UnitOfWorkManager { get; } + protected AbpAuditingOptions Options { get; } + protected IAuditLogInfoToAuditLogConverter Converter { get; } + + public ILogger Logger { protected get; set; } + + public AuditLogManager( + IObjectMapper objectMapper, + IAuditLogRepository auditLogRepository, + IUnitOfWorkManager unitOfWorkManager, + IOptions options, + IAuditLogInfoToAuditLogConverter converter) { - protected IObjectMapper ObjectMapper { get; } - protected IAuditLogRepository AuditLogRepository { get; } - protected IUnitOfWorkManager UnitOfWorkManager { get; } - protected AbpAuditingOptions Options { get; } - protected IAuditLogInfoToAuditLogConverter Converter { get; } - - public ILogger Logger { protected get; set; } - - public AuditLogManager( - IObjectMapper objectMapper, - IAuditLogRepository auditLogRepository, - IUnitOfWorkManager unitOfWorkManager, - IOptions options, - IAuditLogInfoToAuditLogConverter converter) - { - ObjectMapper = objectMapper; - AuditLogRepository = auditLogRepository; - UnitOfWorkManager = unitOfWorkManager; - Converter = converter; - Options = options.Value; + ObjectMapper = objectMapper; + AuditLogRepository = auditLogRepository; + UnitOfWorkManager = unitOfWorkManager; + Converter = converter; + Options = options.Value; - Logger = NullLogger.Instance; - } + Logger = NullLogger.Instance; + } - public async virtual Task GetCountAsync( - DateTime? startTime = null, - DateTime? endTime = null, - string httpMethod = null, - string url = null, - Guid? userId = null, - string userName = null, - string applicationName = null, - string correlationId = null, - string clientId = null, - string clientIpAddress = null, - int? maxExecutionDuration = null, - int? minExecutionDuration = null, - bool? hasException = null, - HttpStatusCode? httpStatusCode = null, - CancellationToken cancellationToken = default(CancellationToken)) - { - return await AuditLogRepository.GetCountAsync( - startTime, - endTime, - httpMethod, - url, - userId, - userName, - applicationName, - clientIpAddress, - correlationId, - maxExecutionDuration, - minExecutionDuration, - hasException, - httpStatusCode, - cancellationToken); - } + public async virtual Task GetCountAsync( + DateTime? startTime = null, + DateTime? endTime = null, + string httpMethod = null, + string url = null, + Guid? userId = null, + string userName = null, + string applicationName = null, + string correlationId = null, + string clientId = null, + string clientIpAddress = null, + int? maxExecutionDuration = null, + int? minExecutionDuration = null, + bool? hasException = null, + HttpStatusCode? httpStatusCode = null, + CancellationToken cancellationToken = default) + { + return await AuditLogRepository.GetCountAsync( + startTime, + endTime, + httpMethod, + url, + clientId, + userId, + userName, + applicationName, + clientIpAddress, + correlationId, + maxExecutionDuration, + minExecutionDuration, + hasException, + httpStatusCode, + cancellationToken); + } - public async virtual Task> GetListAsync( - string sorting = null, - int maxResultCount = 50, - int skipCount = 0, - DateTime? startTime = null, - DateTime? endTime = null, - string httpMethod = null, - string url = null, - Guid? userId = null, - string userName = null, - string applicationName = null, - string correlationId = null, - string clientId = null, - string clientIpAddress = null, - int? maxExecutionDuration = null, - int? minExecutionDuration = null, - bool? hasException = null, - HttpStatusCode? httpStatusCode = null, - bool includeDetails = false, - CancellationToken cancellationToken = default(CancellationToken)) - { - var auditLogs = await AuditLogRepository.GetListAsync( - sorting, - maxResultCount, - skipCount, - startTime, - endTime, - httpMethod, - url, - userId, - userName, - applicationName, - clientIpAddress, - correlationId, - maxExecutionDuration, - minExecutionDuration, - hasException, - httpStatusCode, - includeDetails, - cancellationToken); + public async virtual Task> GetListAsync( + string sorting = null, + int maxResultCount = 50, + int skipCount = 0, + DateTime? startTime = null, + DateTime? endTime = null, + string httpMethod = null, + string url = null, + Guid? userId = null, + string userName = null, + string applicationName = null, + string correlationId = null, + string clientId = null, + string clientIpAddress = null, + int? maxExecutionDuration = null, + int? minExecutionDuration = null, + bool? hasException = null, + HttpStatusCode? httpStatusCode = null, + bool includeDetails = false, + CancellationToken cancellationToken = default) + { + var auditLogs = await AuditLogRepository.GetListAsync( + sorting, + maxResultCount, + skipCount, + startTime, + endTime, + httpMethod, + url, + clientId, + userId, + userName, + applicationName, + clientIpAddress, + correlationId, + maxExecutionDuration, + minExecutionDuration, + hasException, + httpStatusCode, + includeDetails, + cancellationToken); - return ObjectMapper.Map, List>(auditLogs); - } + return ObjectMapper.Map, List>(auditLogs); + } - public async virtual Task GetAsync( - Guid id, - bool includeDetails = false, - CancellationToken cancellationToken = default) - { - var auditLog = await AuditLogRepository.GetAsync(id, includeDetails, cancellationToken); + public async virtual Task GetAsync( + Guid id, + bool includeDetails = false, + CancellationToken cancellationToken = default) + { + var auditLog = await AuditLogRepository.GetAsync(id, includeDetails, cancellationToken); + + return ObjectMapper.Map(auditLog); + } - return ObjectMapper.Map(auditLog); + public async virtual Task DeleteAsync(Guid id, CancellationToken cancellationToken = default) + { + using (var uow = UnitOfWorkManager.Begin(true)) + { + await AuditLogRepository.DeleteAsync(id); + await uow.CompleteAsync(); } + } - public async virtual Task DeleteAsync(Guid id, CancellationToken cancellationToken = default) + public async virtual Task SaveAsync( + AuditLogInfo auditInfo, + CancellationToken cancellationToken = default) + { + if (!Options.HideErrors) { - using (var uow = UnitOfWorkManager.Begin(true)) - { - await AuditLogRepository.DeleteAsync(id); - await uow.CompleteAsync(); - } + return await SaveLogAsync(auditInfo, cancellationToken); } - public async virtual Task SaveAsync( - AuditLogInfo auditInfo, - CancellationToken cancellationToken = default(CancellationToken)) + try + { + return await SaveLogAsync(auditInfo, cancellationToken); + } + catch (Exception ex) { - if (!Options.HideErrors) - { - return await SaveLogAsync(auditInfo, cancellationToken); - } - - try - { - return await SaveLogAsync(auditInfo, cancellationToken); - } - catch (Exception ex) - { - Logger.LogWarning("Could not save the audit log object: " + Environment.NewLine + auditInfo.ToString()); - Logger.LogException(ex, LogLevel.Error); - } - return ""; + Logger.LogWarning("Could not save the audit log object: " + Environment.NewLine + auditInfo.ToString()); + Logger.LogException(ex, LogLevel.Error); } + return ""; + } - protected async virtual Task SaveLogAsync( - AuditLogInfo auditInfo, - CancellationToken cancellationToken = default(CancellationToken)) + protected async virtual Task SaveLogAsync( + AuditLogInfo auditInfo, + CancellationToken cancellationToken = default) + { + using (var uow = UnitOfWorkManager.Begin(true)) { - using (var uow = UnitOfWorkManager.Begin(true)) - { - var auditLog = await AuditLogRepository.InsertAsync( - await Converter.ConvertAsync(auditInfo), - false, - cancellationToken); - await uow.CompleteAsync(); - - return auditLog.Id.ToString(); - } + var auditLog = await AuditLogRepository.InsertAsync( + await Converter.ConvertAsync(auditInfo), + false, + cancellationToken); + await uow.CompleteAsync(); + + return auditLog.Id.ToString(); } } } diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/SecurityLogManager.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/SecurityLogManager.cs index 7128df1d9..47e93db3e 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/SecurityLogManager.cs +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.EntityFrameworkCore/LINGYUN/Abp/AuditLogging/EntityFrameworkCore/SecurityLogManager.cs @@ -11,134 +11,133 @@ using Volo.Abp.SecurityLog; using Volo.Abp.Uow; -namespace LINGYUN.Abp.AuditLogging.EntityFrameworkCore +namespace LINGYUN.Abp.AuditLogging.EntityFrameworkCore; + +[Dependency(ReplaceServices = true)] +public class SecurityLogManager : ISecurityLogManager, ITransientDependency { - [Dependency(ReplaceServices = true)] - public class SecurityLogManager : ISecurityLogManager, ITransientDependency - { - public ILogger Logger { get; set; } + public ILogger Logger { get; set; } + + protected IObjectMapper ObjectMapper { get; } + protected AbpSecurityLogOptions SecurityLogOptions { get; } + protected IIdentitySecurityLogRepository IdentitySecurityLogRepository { get; } + protected IGuidGenerator GuidGenerator { get; } + protected IUnitOfWorkManager UnitOfWorkManager { get; } - protected IObjectMapper ObjectMapper { get; } - protected AbpSecurityLogOptions SecurityLogOptions { get; } - protected IIdentitySecurityLogRepository IdentitySecurityLogRepository { get; } - protected IGuidGenerator GuidGenerator { get; } - protected IUnitOfWorkManager UnitOfWorkManager { get; } + public SecurityLogManager( + IObjectMapper objectMapper, + ILogger logger, + IOptions securityLogOptions, + IIdentitySecurityLogRepository identitySecurityLogRepository, + IGuidGenerator guidGenerator, + IUnitOfWorkManager unitOfWorkManager) + { + Logger = logger; + ObjectMapper = objectMapper; + SecurityLogOptions = securityLogOptions.Value; + IdentitySecurityLogRepository = identitySecurityLogRepository; + GuidGenerator = guidGenerator; + UnitOfWorkManager = unitOfWorkManager; + } - public SecurityLogManager( - IObjectMapper objectMapper, - ILogger logger, - IOptions securityLogOptions, - IIdentitySecurityLogRepository identitySecurityLogRepository, - IGuidGenerator guidGenerator, - IUnitOfWorkManager unitOfWorkManager) + public async virtual Task SaveAsync( + SecurityLogInfo securityLogInfo, + CancellationToken cancellationToken = default) + { + if (!SecurityLogOptions.IsEnabled) { - Logger = logger; - ObjectMapper = objectMapper; - SecurityLogOptions = securityLogOptions.Value; - IdentitySecurityLogRepository = identitySecurityLogRepository; - GuidGenerator = guidGenerator; - UnitOfWorkManager = unitOfWorkManager; + return; } - public async virtual Task SaveAsync( - SecurityLogInfo securityLogInfo, - CancellationToken cancellationToken = default(CancellationToken)) + using (var uow = UnitOfWorkManager.Begin(requiresNew: true)) { - if (!SecurityLogOptions.IsEnabled) - { - return; - } - - using (var uow = UnitOfWorkManager.Begin(requiresNew: true)) - { - await IdentitySecurityLogRepository.InsertAsync( - new IdentitySecurityLog(GuidGenerator, securityLogInfo), - false, - cancellationToken); - await uow.CompleteAsync(); - } + await IdentitySecurityLogRepository.InsertAsync( + new IdentitySecurityLog(GuidGenerator, securityLogInfo), + false, + cancellationToken); + await uow.CompleteAsync(); } + } - public async virtual Task GetAsync( - Guid id, - bool includeDetails = false, - CancellationToken cancellationToken = default) - { - var securityLog = await IdentitySecurityLogRepository.GetAsync(id, includeDetails, cancellationToken); + public async virtual Task GetAsync( + Guid id, + bool includeDetails = false, + CancellationToken cancellationToken = default) + { + var securityLog = await IdentitySecurityLogRepository.GetAsync(id, includeDetails, cancellationToken); - return ObjectMapper.Map(securityLog); - } + return ObjectMapper.Map(securityLog); + } - public async virtual Task DeleteAsync(Guid id, CancellationToken cancellationToken = default) + public async virtual Task DeleteAsync(Guid id, CancellationToken cancellationToken = default) + { + using (var uow = UnitOfWorkManager.Begin(true)) { - using (var uow = UnitOfWorkManager.Begin(true)) - { - await IdentitySecurityLogRepository.DeleteAsync(id); - await uow.CompleteAsync(); - } + await IdentitySecurityLogRepository.DeleteAsync(id); + await uow.CompleteAsync(); } + } - public async virtual Task> GetListAsync( - string sorting = null, - int maxResultCount = 50, - int skipCount = 0, - DateTime? startTime = null, - DateTime? endTime = null, - string applicationName = null, - string identity = null, - string action = null, - Guid? userId = null, - string userName = null, - string clientId = null, - string clientIpAddress = null, - string correlationId = null, - bool includeDetails = false, - CancellationToken cancellationToken = default(CancellationToken)) - { - var securityLogs = await IdentitySecurityLogRepository.GetListAsync( - sorting, - maxResultCount, - skipCount, - startTime, - endTime, - applicationName, - identity, - action, - userId, - userName, - clientId, - correlationId, - includeDetails, - cancellationToken); + public async virtual Task> GetListAsync( + string sorting = null, + int maxResultCount = 50, + int skipCount = 0, + DateTime? startTime = null, + DateTime? endTime = null, + string applicationName = null, + string identity = null, + string action = null, + Guid? userId = null, + string userName = null, + string clientId = null, + string clientIpAddress = null, + string correlationId = null, + bool includeDetails = false, + CancellationToken cancellationToken = default) + { + var securityLogs = await IdentitySecurityLogRepository.GetListAsync( + sorting, + maxResultCount, + skipCount, + startTime, + endTime, + applicationName, + identity, + action, + userId, + userName, + clientId, + correlationId, + includeDetails, + cancellationToken); - return ObjectMapper.Map, List>(securityLogs); - } + return ObjectMapper.Map, List>(securityLogs); + } - public async virtual Task GetCountAsync( - DateTime? startTime = null, - DateTime? endTime = null, - string applicationName = null, - string identity = null, - string action = null, - Guid? userId = null, - string userName = null, - string clientId = null, - string clientIpAddress = null, - string correlationId = null, - CancellationToken cancellationToken = default(CancellationToken)) - { - return await IdentitySecurityLogRepository.GetCountAsync( - startTime, - endTime, - applicationName, - identity, - action, - userId, - userName, - clientId, - correlationId, - cancellationToken); - } + public async virtual Task GetCountAsync( + DateTime? startTime = null, + DateTime? endTime = null, + string applicationName = null, + string identity = null, + string action = null, + Guid? userId = null, + string userName = null, + string clientId = null, + string clientIpAddress = null, + string correlationId = null, + CancellationToken cancellationToken = default) + { + return await IdentitySecurityLogRepository.GetCountAsync( + startTime, + endTime, + applicationName, + identity, + action, + userId, + userName, + clientId, + correlationId, + cancellationToken); } } diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN.Abp.AuditLogging.csproj b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN.Abp.AuditLogging.csproj index e5bcce1fa..ea651f63b 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN.Abp.AuditLogging.csproj +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN.Abp.AuditLogging.csproj @@ -4,7 +4,14 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + enable + Nullable + LINGYUN.Abp.AuditLogging + LINGYUN.Abp.AuditLogging + false + false + false diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/AbpAuditLoggingModule.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/AbpAuditLoggingModule.cs index 5bacc66bc..1de4e8c42 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/AbpAuditLoggingModule.cs +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/AbpAuditLoggingModule.cs @@ -5,21 +5,20 @@ using Volo.Abp.Guids; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.AuditLogging +namespace LINGYUN.Abp.AuditLogging; + +[DependsOn( + typeof(AbpAuditingModule), + typeof(AbpGuidsModule), + typeof(AbpExceptionHandlingModule))] +public class AbpAuditLoggingModule : AbpModule { - [DependsOn( - typeof(AbpAuditingModule), - typeof(AbpGuidsModule), - typeof(AbpExceptionHandlingModule))] - public class AbpAuditLoggingModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + Configure(options => { - Configure(options => - { - options.IgnoredTypes.AddIfNotContains(typeof(CancellationToken)); - options.IgnoredTypes.AddIfNotContains(typeof(CancellationTokenSource)); - }); - } + options.IgnoredTypes.AddIfNotContains(typeof(CancellationToken)); + options.IgnoredTypes.AddIfNotContains(typeof(CancellationTokenSource)); + }); } } diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/AuditLog.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/AuditLog.cs index 8c308baec..62fe7456f 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/AuditLog.cs +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/AuditLog.cs @@ -1,122 +1,120 @@ using System; using System.Collections.Generic; -using Volo.Abp.Auditing; using Volo.Abp.Data; -namespace LINGYUN.Abp.AuditLogging +namespace LINGYUN.Abp.AuditLogging; + +public class AuditLog : IHasExtraProperties { - public class AuditLog : IHasExtraProperties - { - public Guid Id { get; set; } + public Guid Id { get; set; } - public string ApplicationName { get; set; } + public string? ApplicationName { get; set; } - public Guid? UserId { get; set; } + public Guid? UserId { get; set; } - public string UserName { get; set; } + public string? UserName { get; set; } - public Guid? TenantId { get; set; } + public Guid? TenantId { get; set; } - public string TenantName { get; set; } + public string? TenantName { get; set; } - public Guid? ImpersonatorUserId { get; set; } + public Guid? ImpersonatorUserId { get; set; } - public string ImpersonatorUserName { get; set; } + public string? ImpersonatorUserName { get; set; } - public Guid? ImpersonatorTenantId { get; set; } + public Guid? ImpersonatorTenantId { get; set; } - public string ImpersonatorTenantName { get; set; } + public string? ImpersonatorTenantName { get; set; } - public DateTime ExecutionTime { get; set; } + public DateTime ExecutionTime { get; set; } - public int ExecutionDuration { get; set; } + public int ExecutionDuration { get; set; } - public string ClientIpAddress { get; set; } + public string? ClientIpAddress { get; set; } - public string ClientName { get; set; } + public string? ClientName { get; set; } - public string ClientId { get; set; } + public string? ClientId { get; set; } - public string CorrelationId { get; set; } + public string? CorrelationId { get; set; } - public string BrowserInfo { get; set; } + public string? BrowserInfo { get; set; } - public string HttpMethod { get; set; } + public string? HttpMethod { get; set; } - public string Url { get; set; } + public string? Url { get; set; } - public string Exceptions { get; set; } + public string? Exceptions { get; set; } - public string Comments { get; set; } + public string? Comments { get; set; } - public int? HttpStatusCode { get; set; } + public int? HttpStatusCode { get; set; } - public List EntityChanges { get; set; } + public List EntityChanges { get; set; } - public List Actions { get; set; } + public List Actions { get; set; } - public ExtraPropertyDictionary ExtraProperties { get; set; } + public ExtraPropertyDictionary ExtraProperties { get; set; } - public AuditLog() - { - Actions = new List(); - EntityChanges = new List(); - ExtraProperties = new ExtraPropertyDictionary(); - } + public AuditLog() + { + Actions = new List(); + EntityChanges = new List(); + ExtraProperties = new ExtraPropertyDictionary(); + } - public AuditLog( - Guid id, - string applicationName, - Guid? tenantId, - string tenantName, - Guid? userId, - string userName, - DateTime executionTime, - int executionDuration, - string clientIpAddress, - string clientName, - string clientId, - string correlationId, - string browserInfo, - string httpMethod, - string url, - int? httpStatusCode, - Guid? impersonatorUserId, - string impersonatorUserName, - Guid? impersonatorTenantId, - string impersonatorTenantName, - ExtraPropertyDictionary extraPropertyDictionary, - List entityChanges, - List actions, - string exceptions, - string comments) - { - Id = id; - ApplicationName = applicationName; - TenantId = tenantId; - TenantName = tenantName; - UserId = userId; - UserName = userName; - ExecutionTime = executionTime; - ExecutionDuration = executionDuration; - ClientIpAddress = clientIpAddress; - ClientName = clientName; - ClientId = clientId; - CorrelationId = correlationId; - BrowserInfo = browserInfo; - HttpMethod = httpMethod; - Url = url; - HttpStatusCode = httpStatusCode; - ImpersonatorUserId = impersonatorUserId; - ImpersonatorUserName = impersonatorUserName; - ImpersonatorTenantId = impersonatorTenantId; - ImpersonatorTenantName = impersonatorTenantName; - - ExtraProperties = extraPropertyDictionary; - EntityChanges = entityChanges; - Actions = actions; - Exceptions = exceptions; - Comments = comments; - } + public AuditLog( + Guid id, + string? applicationName, + Guid? tenantId, + string? tenantName, + Guid? userId, + string? userName, + DateTime executionTime, + int executionDuration, + string? clientIpAddress, + string? clientName, + string? clientId, + string? correlationId, + string? browserInfo, + string? httpMethod, + string? url, + int? httpStatusCode, + Guid? impersonatorUserId, + string? impersonatorUserName, + Guid? impersonatorTenantId, + string? impersonatorTenantName, + ExtraPropertyDictionary extraPropertyDictionary, + List entityChanges, + List actions, + string? exceptions, + string? comments) + { + Id = id; + ApplicationName = applicationName; + TenantId = tenantId; + TenantName = tenantName; + UserId = userId; + UserName = userName; + ExecutionTime = executionTime; + ExecutionDuration = executionDuration; + ClientIpAddress = clientIpAddress; + ClientName = clientName; + ClientId = clientId; + CorrelationId = correlationId; + BrowserInfo = browserInfo; + HttpMethod = httpMethod; + Url = url; + HttpStatusCode = httpStatusCode; + ImpersonatorUserId = impersonatorUserId; + ImpersonatorUserName = impersonatorUserName; + ImpersonatorTenantId = impersonatorTenantId; + ImpersonatorTenantName = impersonatorTenantName; + + ExtraProperties = extraPropertyDictionary; + EntityChanges = entityChanges; + Actions = actions; + Exceptions = exceptions; + Comments = comments; } } diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/AuditLogAction.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/AuditLogAction.cs index 7a44e3960..9e4d402b5 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/AuditLogAction.cs +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/AuditLogAction.cs @@ -2,47 +2,46 @@ using Volo.Abp.Auditing; using Volo.Abp.Data; -namespace LINGYUN.Abp.AuditLogging +namespace LINGYUN.Abp.AuditLogging; + +[DisableAuditing] +public class AuditLogAction : IHasExtraProperties { - [DisableAuditing] - public class AuditLogAction : IHasExtraProperties - { - public Guid Id { get; set; } + public Guid Id { get; set; } - public Guid? TenantId { get; set; } + public Guid? TenantId { get; set; } - public Guid AuditLogId { get; set; } + public Guid AuditLogId { get; set; } - public string ServiceName { get; set; } + public string ServiceName { get; set; } - public string MethodName { get; set; } + public string MethodName { get; set; } - public string Parameters { get; set; } + public string Parameters { get; set; } - public DateTime ExecutionTime { get; set; } + public DateTime ExecutionTime { get; set; } - public int ExecutionDuration { get; set; } + public int ExecutionDuration { get; set; } - public ExtraPropertyDictionary ExtraProperties { get; set; } + public ExtraPropertyDictionary ExtraProperties { get; set; } - public AuditLogAction() - { - ExtraProperties = new ExtraPropertyDictionary(); - } + public AuditLogAction() + { + ExtraProperties = new ExtraPropertyDictionary(); + } - public AuditLogAction(Guid id, Guid auditLogId, AuditLogActionInfo actionInfo, Guid? tenantId = null) - { + public AuditLogAction(Guid id, Guid auditLogId, AuditLogActionInfo actionInfo, Guid? tenantId = null) + { - Id = id; - TenantId = tenantId; - AuditLogId = auditLogId; - ExecutionTime = actionInfo.ExecutionTime; - ExecutionDuration = actionInfo.ExecutionDuration; - ExtraProperties = new ExtraPropertyDictionary(actionInfo.ExtraProperties); - ServiceName = actionInfo.ServiceName; - MethodName = actionInfo.MethodName; - Parameters = actionInfo.Parameters; - // Parameters = actionInfo.Parameters.Length > 2000 ? "" : actionInfo.Parameters; - } + Id = id; + TenantId = tenantId; + AuditLogId = auditLogId; + ExecutionTime = actionInfo.ExecutionTime; + ExecutionDuration = actionInfo.ExecutionDuration; + ExtraProperties = new ExtraPropertyDictionary(actionInfo.ExtraProperties); + ServiceName = actionInfo.ServiceName; + MethodName = actionInfo.MethodName; + Parameters = actionInfo.Parameters; + // Parameters = actionInfo.Parameters.Length > 2000 ? "" : actionInfo.Parameters; } } diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/AuditingStore.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/AuditingStore.cs index 90054e157..660b820f8 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/AuditingStore.cs +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/AuditingStore.cs @@ -2,22 +2,21 @@ using Volo.Abp.Auditing; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.AuditLogging +namespace LINGYUN.Abp.AuditLogging; + +[Dependency(ReplaceServices = true)] +public class AuditingStore : IAuditingStore, ITransientDependency { - [Dependency(ReplaceServices = true)] - public class AuditingStore : IAuditingStore, ITransientDependency - { - private readonly IAuditLogManager _manager; + private readonly IAuditLogManager _manager; - public AuditingStore( - IAuditLogManager manager) - { - _manager = manager; - } + public AuditingStore( + IAuditLogManager manager) + { + _manager = manager; + } - public async virtual Task SaveAsync(AuditLogInfo auditInfo) - { - await _manager.SaveAsync(auditInfo); - } + public async virtual Task SaveAsync(AuditLogInfo auditInfo) + { + await _manager.SaveAsync(auditInfo); } } diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultAuditLogManager.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultAuditLogManager.cs index 2d8df99fe..f926ebe04 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultAuditLogManager.cs +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultAuditLogManager.cs @@ -8,89 +8,88 @@ using Volo.Abp.Auditing; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.AuditLogging +namespace LINGYUN.Abp.AuditLogging; + +[Dependency(TryRegister = true)] +public class DefaultAuditLogManager : IAuditLogManager, ISingletonDependency { - [Dependency(TryRegister = true)] - public class DefaultAuditLogManager : IAuditLogManager, ISingletonDependency - { - public ILogger Logger { protected get; set; } + public ILogger Logger { protected get; set; } - public DefaultAuditLogManager() - { - Logger = NullLogger.Instance; - } + public DefaultAuditLogManager() + { + Logger = NullLogger.Instance; + } - public virtual Task GetCountAsync( - DateTime? startTime = null, - DateTime? endTime = null, - string httpMethod = null, - string url = null, - Guid? userId = null, - string userName = null, - string applicationName = null, - string correlationId = null, - string clientId = null, - string clientIpAddress = null, - int? maxExecutionDuration = null, - int? minExecutionDuration = null, - bool? hasException = null, - HttpStatusCode? httpStatusCode = null, - CancellationToken cancellationToken = default(CancellationToken)) - { - Logger.LogDebug("No audit log manager is available!"); - return Task.FromResult(0L); - } + public virtual Task GetCountAsync( + DateTime? startTime = null, + DateTime? endTime = null, + string? httpMethod = null, + string? url = null, + Guid? userId = null, + string? userName = null, + string? applicationName = null, + string? correlationId = null, + string? clientId = null, + string? clientIpAddress = null, + int? maxExecutionDuration = null, + int? minExecutionDuration = null, + bool? hasException = null, + HttpStatusCode? httpStatusCode = null, + CancellationToken cancellationToken = default) + { + Logger.LogDebug("No audit log manager is available!"); + return Task.FromResult(0L); + } - public virtual Task> GetListAsync( - string sorting = null, - int maxResultCount = 50, - int skipCount = 0, - DateTime? startTime = null, - DateTime? endTime = null, - string httpMethod = null, - string url = null, - Guid? userId = null, - string userName = null, - string applicationName = null, - string correlationId = null, - string clientId = null, - string clientIpAddress = null, - int? maxExecutionDuration = null, - int? minExecutionDuration = null, - bool? hasException = null, - HttpStatusCode? httpStatusCode = null, - bool includeDetails = false, - CancellationToken cancellationToken = default(CancellationToken)) - { - Logger.LogDebug("No audit log manager is available!"); - return Task.FromResult(new List()); - } + public virtual Task> GetListAsync( + string? sorting = null, + int maxResultCount = 50, + int skipCount = 0, + DateTime? startTime = null, + DateTime? endTime = null, + string? httpMethod = null, + string? url = null, + Guid? userId = null, + string? userName = null, + string? applicationName = null, + string? correlationId = null, + string? clientId = null, + string? clientIpAddress = null, + int? maxExecutionDuration = null, + int? minExecutionDuration = null, + bool? hasException = null, + HttpStatusCode? httpStatusCode = null, + bool includeDetails = false, + CancellationToken cancellationToken = default) + { + Logger.LogDebug("No audit log manager is available!"); + return Task.FromResult(new List()); + } - public virtual Task SaveAsync( - AuditLogInfo auditInfo, - CancellationToken cancellationToken = default) - { - Logger.LogDebug("No audit log manager is available and is written to the local log by default"); - Logger.LogInformation(auditInfo.ToString()); + public virtual Task SaveAsync( + AuditLogInfo auditInfo, + CancellationToken cancellationToken = default) + { + Logger.LogDebug("No audit log manager is available and is written to the local log by default"); + Logger.LogInformation(auditInfo.ToString()); - return Task.FromResult(""); - } + return Task.FromResult(""); + } - public virtual Task GetAsync( - Guid id, - bool includeDetails = false, - CancellationToken cancellationToken = default) - { - Logger.LogDebug("No audit log manager is available!"); + public virtual Task GetAsync( + Guid id, + bool includeDetails = false, + CancellationToken cancellationToken = default) + { + Logger.LogDebug("No audit log manager is available!"); - AuditLog auditLog = null; - return Task.FromResult(auditLog); - } + AuditLog? auditLog = null; + return Task.FromResult(auditLog!); + } - public virtual Task DeleteAsync(Guid id, CancellationToken cancellationToken = default) - { - Logger.LogDebug("No audit log manager is available!"); - return Task.CompletedTask; - } + public virtual Task DeleteAsync(Guid id, CancellationToken cancellationToken = default) + { + Logger.LogDebug("No audit log manager is available!"); + return Task.CompletedTask; } } diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultEntityChangeStore.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultEntityChangeStore.cs index 792058963..31c13577d 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultEntityChangeStore.cs +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultEntityChangeStore.cs @@ -5,36 +5,53 @@ using Volo.Abp.Auditing; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.AuditLogging +namespace LINGYUN.Abp.AuditLogging; + +[Dependency(TryRegister = true)] +public class DefaultEntityChangeStore : IEntityChangeStore, ISingletonDependency { - [Dependency(TryRegister = true)] - public class DefaultEntityChangeStore : IEntityChangeStore, ISingletonDependency + public Task GetAsync(Guid entityChangeId, CancellationToken cancellationToken = default) { - public Task GetAsync(Guid entityChangeId, CancellationToken cancellationToken = default) - { - EntityChange entityChange = null; - return Task.FromResult(entityChange); - } + EntityChange? entityChange = null; + return Task.FromResult(entityChange); + } - public Task GetCountAsync(Guid? auditLogId = null, DateTime? startTime = null, DateTime? endTime = null, EntityChangeType? changeType = null, string entityId = null, string entityTypeFullName = null, CancellationToken cancellationToken = default) - { - return Task.FromResult(0L); - } + public Task GetCountAsync( + Guid? auditLogId = null, + DateTime? startTime = null, + DateTime? endTime = null, + EntityChangeType? changeType = null, + string? entityId = null, + string? entityTypeFullName = null, + CancellationToken cancellationToken = default) + { + return Task.FromResult(0L); + } - public Task> GetListAsync(string sorting = null, int maxResultCount = 50, int skipCount = 0, Guid? auditLogId = null, DateTime? startTime = null, DateTime? endTime = null, EntityChangeType? changeType = null, string entityId = null, string entityTypeFullName = null, bool includeDetails = false, CancellationToken cancellationToken = default) - { - return Task.FromResult(new List()); - } + public Task> GetListAsync( + string? sorting = null, + int maxResultCount = 50, + int skipCount = 0, + Guid? auditLogId = null, + DateTime? startTime = null, + DateTime? endTime = null, + EntityChangeType? changeType = null, + string? entityId = null, + string? entityTypeFullName = null, + bool includeDetails = false, + CancellationToken cancellationToken = default) + { + return Task.FromResult(new List()); + } - public Task GetWithUsernameAsync(Guid entityChangeId, CancellationToken cancellationToken = default) - { - EntityChangeWithUsername entityChange = null; - return Task.FromResult(entityChange); - } + public Task GetWithUsernameAsync(Guid entityChangeId, CancellationToken cancellationToken = default) + { + EntityChangeWithUsername? entityChange = null; + return Task.FromResult(entityChange!); + } - public Task> GetWithUsernameAsync(string entityId, string entityTypeFullName, CancellationToken cancellationToken = default) - { - return Task.FromResult(new List()); - } + public Task> GetWithUsernameAsync(string entityId, string entityTypeFullName, CancellationToken cancellationToken = default) + { + return Task.FromResult(new List()); } } diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultSecurityLogManager.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultSecurityLogManager.cs index 62341c4dd..48eee285b 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultSecurityLogManager.cs +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/DefaultSecurityLogManager.cs @@ -7,81 +7,80 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.SecurityLog; -namespace LINGYUN.Abp.AuditLogging +namespace LINGYUN.Abp.AuditLogging; + +[Dependency(TryRegister = true)] +public class DefaultSecurityLogManager : ISecurityLogManager, ISingletonDependency { - [Dependency(TryRegister = true)] - public class DefaultSecurityLogManager : ISecurityLogManager, ISingletonDependency - { - public ILogger Logger { protected get; set; } + public ILogger Logger { protected get; set; } - public DefaultSecurityLogManager() - { - Logger = NullLogger.Instance; - } + public DefaultSecurityLogManager() + { + Logger = NullLogger.Instance; + } - public Task GetCountAsync( - DateTime? startTime = null, - DateTime? endTime = null, - string applicationName = null, - string identity = null, - string action = null, - Guid? userId = null, - string userName = null, - string clientId = null, - string clientIpAddress = null, - string correlationId = null, - CancellationToken cancellationToken = default(CancellationToken)) - { - Logger.LogDebug("No security log manager is available!"); - return Task.FromResult(0L); - } + public Task GetCountAsync( + DateTime? startTime = null, + DateTime? endTime = null, + string? applicationName = null, + string? identity = null, + string? action = null, + Guid? userId = null, + string? userName = null, + string? clientId = null, + string? clientIpAddress = null, + string? correlationId = null, + CancellationToken cancellationToken = default) + { + Logger.LogDebug("No security log manager is available!"); + return Task.FromResult(0L); + } - public Task> GetListAsync( - string sorting = null, - int maxResultCount = 50, - int skipCount = 0, - DateTime? startTime = null, - DateTime? endTime = null, - string applicationName = null, - string identity = null, - string action = null, - Guid? userId = null, - string userName = null, - string clientId = null, - string clientIpAddress = null, - string correlationId = null, - bool includeDetails = false, - CancellationToken cancellationToken = default(CancellationToken)) - { - Logger.LogDebug("No security log manager is available!"); - return Task.FromResult(new List()); - } + public Task> GetListAsync( + string? sorting = null, + int maxResultCount = 50, + int skipCount = 0, + DateTime? startTime = null, + DateTime? endTime = null, + string? applicationName = null, + string? identity = null, + string? action = null, + Guid? userId = null, + string? userName = null, + string? clientId = null, + string? clientIpAddress = null, + string? correlationId = null, + bool includeDetails = false, + CancellationToken cancellationToken = default) + { + Logger.LogDebug("No security log manager is available!"); + return Task.FromResult(new List()); + } - public Task SaveAsync( - SecurityLogInfo securityLogInfo, - CancellationToken cancellationToken = default(CancellationToken)) - { - Logger.LogDebug("No security log manager is available and is written to the local log by default"); - Logger.LogInformation(securityLogInfo.ToString()); + public Task SaveAsync( + SecurityLogInfo securityLogInfo, + CancellationToken cancellationToken = default) + { + Logger.LogDebug("No security log manager is available and is written to the local log by default"); + Logger.LogInformation(securityLogInfo.ToString()); - return Task.CompletedTask; - } + return Task.CompletedTask; + } - public virtual Task GetAsync( - Guid id, - bool includeDetails = false, - CancellationToken cancellationToken = default) - { - Logger.LogDebug("No security log manager is available!"); + public virtual Task GetAsync( + Guid id, + bool includeDetails = false, + CancellationToken cancellationToken = default) + { + Logger.LogDebug("No security log manager is available!"); - SecurityLog securityLog = null; - return Task.FromResult(securityLog); - } + SecurityLog? securityLog = null; + return Task.FromResult(securityLog!); + } - public virtual Task DeleteAsync(Guid id, CancellationToken cancellationToken = default) - { - Logger.LogDebug("No security log manager is available!"); - return Task.CompletedTask; - } + public virtual Task DeleteAsync(Guid id, CancellationToken cancellationToken = default) + { + Logger.LogDebug("No security log manager is available!"); + return Task.CompletedTask; } } diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/EntityChange.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/EntityChange.cs index 990eec9d8..4ab1ed0b3 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/EntityChange.cs +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/EntityChange.cs @@ -5,66 +5,65 @@ using Volo.Abp.Data; using Volo.Abp.Guids; -namespace LINGYUN.Abp.AuditLogging +namespace LINGYUN.Abp.AuditLogging; + +[DisableAuditing] +public class EntityChange : IHasExtraProperties { - [DisableAuditing] - public class EntityChange : IHasExtraProperties - { - public Guid Id { get; set; } + public Guid Id { get; set; } - public Guid AuditLogId { get; set; } + public Guid AuditLogId { get; set; } - public Guid? TenantId { get; set; } + public Guid? TenantId { get; set; } - public DateTime ChangeTime { get; set; } + public DateTime ChangeTime { get; set; } - public EntityChangeType ChangeType { get; set; } + public EntityChangeType ChangeType { get; set; } - public Guid? EntityTenantId { get; set; } + public Guid? EntityTenantId { get; set; } - public string EntityId { get; set; } + public string? EntityId { get; set; } - public string EntityTypeFullName { get; set; } + public string? EntityTypeFullName { get; set; } - public List PropertyChanges { get; set; } + public List PropertyChanges { get; set; } - public ExtraPropertyDictionary ExtraProperties { get; set; } + public ExtraPropertyDictionary ExtraProperties { get; set; } - public EntityChange() - { - PropertyChanges = new List(); - ExtraProperties = new ExtraPropertyDictionary(); - } + public EntityChange() + { + PropertyChanges = new List(); + ExtraProperties = new ExtraPropertyDictionary(); + } - public EntityChange( - IGuidGenerator guidGenerator, - Guid auditLogId, - EntityChangeInfo entityChangeInfo, - Guid? tenantId = null, - Guid? entityTenantId = null) - { - Id = guidGenerator.Create(); - AuditLogId = auditLogId; - TenantId = tenantId; - EntityTenantId = entityTenantId; - ChangeTime = entityChangeInfo.ChangeTime; - ChangeType = entityChangeInfo.ChangeType; - EntityId = entityChangeInfo.EntityId; - EntityTypeFullName = entityChangeInfo.EntityTypeFullName; + public EntityChange( + IGuidGenerator guidGenerator, + Guid auditLogId, + EntityChangeInfo entityChangeInfo, + Guid? tenantId = null, + Guid? entityTenantId = null) + { + Id = guidGenerator.Create(); + AuditLogId = auditLogId; + TenantId = tenantId; + EntityTenantId = entityTenantId; + ChangeTime = entityChangeInfo.ChangeTime; + ChangeType = entityChangeInfo.ChangeType; + EntityId = entityChangeInfo.EntityId; + EntityTypeFullName = entityChangeInfo.EntityTypeFullName; - PropertyChanges = entityChangeInfo - .PropertyChanges? - .Select(p => new EntityPropertyChange(guidGenerator, Id, p, tenantId)) - .ToList() - ?? new List(); + PropertyChanges = entityChangeInfo + .PropertyChanges? + .Select(p => new EntityPropertyChange(guidGenerator, Id, p, tenantId)) + .ToList() + ?? new List(); - ExtraProperties = new ExtraPropertyDictionary(); - if (entityChangeInfo.ExtraProperties != null) + ExtraProperties = new ExtraPropertyDictionary(); + if (entityChangeInfo.ExtraProperties != null) + { + foreach (var pair in entityChangeInfo.ExtraProperties) { - foreach (var pair in entityChangeInfo.ExtraProperties) - { - ExtraProperties.Add(pair.Key, pair.Value); - } + ExtraProperties.Add(pair.Key, pair.Value); } } } diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/EntityChangeWithUsername.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/EntityChangeWithUsername.cs index c3e84c68c..0b16aa28b 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/EntityChangeWithUsername.cs +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/EntityChangeWithUsername.cs @@ -1,9 +1,8 @@ -namespace LINGYUN.Abp.AuditLogging +namespace LINGYUN.Abp.AuditLogging; + +public class EntityChangeWithUsername { - public class EntityChangeWithUsername - { - public EntityChange EntityChange { get; set; } + public EntityChange EntityChange { get; set; } - public string UserName { get; set; } - } + public string UserName { get; set; } } diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/EntityPropertyChange.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/EntityPropertyChange.cs index 84bce0481..47015060a 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/EntityPropertyChange.cs +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/EntityPropertyChange.cs @@ -2,42 +2,41 @@ using Volo.Abp.Auditing; using Volo.Abp.Guids; -namespace LINGYUN.Abp.AuditLogging +namespace LINGYUN.Abp.AuditLogging; + +[DisableAuditing] +public class EntityPropertyChange { - [DisableAuditing] - public class EntityPropertyChange - { - public Guid Id { get; set; } + public Guid Id { get; set; } - public Guid? TenantId { get; set; } + public Guid? TenantId { get; set; } - public Guid EntityChangeId { get; set; } + public Guid EntityChangeId { get; set; } - public string NewValue { get; set; } + public string? NewValue { get; set; } - public string OriginalValue { get; set; } + public string? OriginalValue { get; set; } - public string PropertyName { get; set; } + public string PropertyName { get; set; } - public string PropertyTypeFullName { get; set; } + public string PropertyTypeFullName { get; set; } - public EntityPropertyChange() - { - } + public EntityPropertyChange() + { + } - public EntityPropertyChange( - IGuidGenerator guidGenerator, - Guid entityChangeId, - EntityPropertyChangeInfo entityChangeInfo, - Guid? tenantId = null) - { - Id = guidGenerator.Create(); - TenantId = tenantId; - EntityChangeId = entityChangeId; - NewValue = entityChangeInfo.NewValue; - OriginalValue = entityChangeInfo.OriginalValue; - PropertyName = entityChangeInfo.PropertyName; - PropertyTypeFullName = entityChangeInfo.PropertyTypeFullName; - } + public EntityPropertyChange( + IGuidGenerator guidGenerator, + Guid entityChangeId, + EntityPropertyChangeInfo entityChangeInfo, + Guid? tenantId = null) + { + Id = guidGenerator.Create(); + TenantId = tenantId; + EntityChangeId = entityChangeId; + NewValue = entityChangeInfo.NewValue; + OriginalValue = entityChangeInfo.OriginalValue; + PropertyName = entityChangeInfo.PropertyName; + PropertyTypeFullName = entityChangeInfo.PropertyTypeFullName; } } \ No newline at end of file diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/IAuditLogManager.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/IAuditLogManager.cs index 3b16b1131..918c3bd5b 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/IAuditLogManager.cs +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/IAuditLogManager.cs @@ -5,60 +5,59 @@ using System.Threading.Tasks; using Volo.Abp.Auditing; -namespace LINGYUN.Abp.AuditLogging +namespace LINGYUN.Abp.AuditLogging; + +public interface IAuditLogManager { - public interface IAuditLogManager - { - Task GetAsync( - Guid id, - bool includeDetails = false, - CancellationToken cancellationToken = default(CancellationToken)); + Task GetAsync( + Guid id, + bool includeDetails = false, + CancellationToken cancellationToken = default); - Task DeleteAsync( - Guid id, - CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteAsync( + Guid id, + CancellationToken cancellationToken = default); - Task SaveAsync( - AuditLogInfo auditInfo, - CancellationToken cancellationToken = default(CancellationToken)); + Task SaveAsync( + AuditLogInfo auditInfo, + CancellationToken cancellationToken = default); - Task GetCountAsync( - DateTime? startTime = null, - DateTime? endTime = null, - string httpMethod = null, - string url = null, - Guid? userId = null, - string userName = null, - string applicationName = null, - string correlationId = null, - string clientId = null, - string clientIpAddress = null, - int? maxExecutionDuration = null, - int? minExecutionDuration = null, - bool? hasException = null, - HttpStatusCode? httpStatusCode = null, - CancellationToken cancellationToken = default(CancellationToken)); + Task GetCountAsync( + DateTime? startTime = null, + DateTime? endTime = null, + string? httpMethod = null, + string? url = null, + Guid? userId = null, + string? userName = null, + string? applicationName = null, + string? correlationId = null, + string? clientId = null, + string? clientIpAddress = null, + int? maxExecutionDuration = null, + int? minExecutionDuration = null, + bool? hasException = null, + HttpStatusCode? httpStatusCode = null, + CancellationToken cancellationToken = default); - Task> GetListAsync( - string sorting = null, - int maxResultCount = 50, - int skipCount = 0, - DateTime? startTime = null, - DateTime? endTime = null, - string httpMethod = null, - string url = null, - Guid? userId = null, - string userName = null, - string applicationName = null, - string correlationId = null, - string clientId = null, - string clientIpAddress = null, - int? maxExecutionDuration = null, - int? minExecutionDuration = null, - bool? hasException = null, - HttpStatusCode? httpStatusCode = null, - bool includeDetails = false, - CancellationToken cancellationToken = default(CancellationToken)); + Task> GetListAsync( + string? sorting = null, + int maxResultCount = 50, + int skipCount = 0, + DateTime? startTime = null, + DateTime? endTime = null, + string? httpMethod = null, + string? url = null, + Guid? userId = null, + string? userName = null, + string? applicationName = null, + string? correlationId = null, + string? clientId = null, + string? clientIpAddress = null, + int? maxExecutionDuration = null, + int? minExecutionDuration = null, + bool? hasException = null, + HttpStatusCode? httpStatusCode = null, + bool includeDetails = false, + CancellationToken cancellationToken = default); - } } diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/IEntityChangeStore.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/IEntityChangeStore.cs index fb2fc6d2c..f2fb5d31c 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/IEntityChangeStore.cs +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/IEntityChangeStore.cs @@ -4,43 +4,42 @@ using System.Threading.Tasks; using Volo.Abp.Auditing; -namespace LINGYUN.Abp.AuditLogging +namespace LINGYUN.Abp.AuditLogging; + +public interface IEntityChangeStore { - public interface IEntityChangeStore - { - Task GetAsync( - Guid entityChangeId, - CancellationToken cancellationToken = default); + Task GetAsync( + Guid entityChangeId, + CancellationToken cancellationToken = default); - Task GetCountAsync( - Guid? auditLogId = null, - DateTime? startTime = null, - DateTime? endTime = null, - EntityChangeType? changeType = null, - string entityId = null, - string entityTypeFullName = null, - CancellationToken cancellationToken = default); + Task GetCountAsync( + Guid? auditLogId = null, + DateTime? startTime = null, + DateTime? endTime = null, + EntityChangeType? changeType = null, + string? entityId = null, + string? entityTypeFullName = null, + CancellationToken cancellationToken = default); - Task> GetListAsync( - string sorting = null, - int maxResultCount = 50, - int skipCount = 0, - Guid? auditLogId = null, - DateTime? startTime = null, - DateTime? endTime = null, - EntityChangeType? changeType = null, - string entityId = null, - string entityTypeFullName = null, - bool includeDetails = false, - CancellationToken cancellationToken = default); + Task> GetListAsync( + string? sorting = null, + int maxResultCount = 50, + int skipCount = 0, + Guid? auditLogId = null, + DateTime? startTime = null, + DateTime? endTime = null, + EntityChangeType? changeType = null, + string? entityId = null, + string? entityTypeFullName = null, + bool includeDetails = false, + CancellationToken cancellationToken = default); - Task GetWithUsernameAsync( - Guid entityChangeId, - CancellationToken cancellationToken = default); + Task GetWithUsernameAsync( + Guid entityChangeId, + CancellationToken cancellationToken = default); - Task> GetWithUsernameAsync( - string entityId, - string entityTypeFullName, - CancellationToken cancellationToken = default); - } + Task> GetWithUsernameAsync( + string entityId, + string entityTypeFullName, + CancellationToken cancellationToken = default); } diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/ISecurityLogManager.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/ISecurityLogManager.cs index e0ec2849e..05c104731 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/ISecurityLogManager.cs +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/ISecurityLogManager.cs @@ -4,53 +4,52 @@ using System.Threading.Tasks; using Volo.Abp.SecurityLog; -namespace LINGYUN.Abp.AuditLogging +namespace LINGYUN.Abp.AuditLogging; + +public interface ISecurityLogManager { - public interface ISecurityLogManager - { - Task GetAsync( - Guid id, - bool includeDetails = false, - CancellationToken cancellationToken = default(CancellationToken)); - - Task DeleteAsync( - Guid id, - CancellationToken cancellationToken = default(CancellationToken)); - - Task SaveAsync( - SecurityLogInfo securityLogInfo, - CancellationToken cancellationToken = default(CancellationToken)); - - Task> GetListAsync( - string sorting = null, - int maxResultCount = 50, - int skipCount = 0, - DateTime? startTime = null, - DateTime? endTime = null, - string applicationName = null, - string identity = null, - string action = null, - Guid? userId = null, - string userName = null, - string clientId = null, - string clientIpAddress = null, - string correlationId = null, - bool includeDetails = false, - CancellationToken cancellationToken = default(CancellationToken)); - - - Task GetCountAsync( - DateTime? startTime = null, - DateTime? endTime = null, - string applicationName = null, - string identity = null, - string action = null, - Guid? userId = null, - string userName = null, - string clientId = null, - string clientIpAddress = null, - string correlationId = null, - CancellationToken cancellationToken = default(CancellationToken)); - - } + Task GetAsync( + Guid id, + bool includeDetails = false, + CancellationToken cancellationToken = default); + + Task DeleteAsync( + Guid id, + CancellationToken cancellationToken = default); + + Task SaveAsync( + SecurityLogInfo securityLogInfo, + CancellationToken cancellationToken = default); + + Task> GetListAsync( + string? sorting = null, + int maxResultCount = 50, + int skipCount = 0, + DateTime? startTime = null, + DateTime? endTime = null, + string? applicationName = null, + string? identity = null, + string? action = null, + Guid? userId = null, + string? userName = null, + string? clientId = null, + string? clientIpAddress = null, + string? correlationId = null, + bool includeDetails = false, + CancellationToken cancellationToken = default); + + + Task GetCountAsync( + DateTime? startTime = null, + DateTime? endTime = null, + string? applicationName = null, + string? identity = null, + string? action = null, + Guid? userId = null, + string? userName = null, + string? clientId = null, + string? clientIpAddress = null, + string? correlationId = null, + CancellationToken cancellationToken = default); + } diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/SecurityLog.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/SecurityLog.cs index 4ef94a6d2..535820e7b 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/SecurityLog.cs +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/SecurityLog.cs @@ -2,70 +2,69 @@ using Volo.Abp.Data; using Volo.Abp.SecurityLog; -namespace LINGYUN.Abp.AuditLogging +namespace LINGYUN.Abp.AuditLogging; + +public class SecurityLog : IHasExtraProperties { - public class SecurityLog : IHasExtraProperties - { - public Guid Id { get; set; } + public Guid Id { get; set; } - public Guid? TenantId { get; set; } + public Guid? TenantId { get; set; } - public string ApplicationName { get; set; } + public string? ApplicationName { get; set; } - public string Identity { get; set; } + public string? Identity { get; set; } - public string Action { get; set; } + public string? Action { get; set; } - public Guid? UserId { get; set; } + public Guid? UserId { get; set; } - public string UserName { get; set; } + public string? UserName { get; set; } - public string TenantName { get; set; } + public string? TenantName { get; set; } - public string ClientId { get; set; } + public string? ClientId { get; set; } - public string CorrelationId { get; set; } + public string? CorrelationId { get; set; } - public string ClientIpAddress { get; set; } + public string? ClientIpAddress { get; set; } - public string BrowserInfo { get; set; } + public string? BrowserInfo { get; set; } - public DateTime CreationTime { get; set; } + public DateTime CreationTime { get; set; } - public ExtraPropertyDictionary ExtraProperties { get; set; } + public ExtraPropertyDictionary ExtraProperties { get; set; } - public SecurityLog() - { - ExtraProperties = new ExtraPropertyDictionary(); - } + public SecurityLog() + { + ExtraProperties = new ExtraPropertyDictionary(); + } - public SecurityLog(Guid id, SecurityLogInfo securityLogInfo) - { - Id = id; - TenantId = securityLogInfo.TenantId; - TenantName = securityLogInfo.TenantName; + public SecurityLog(Guid id, SecurityLogInfo securityLogInfo) + { + Id = id; + TenantId = securityLogInfo.TenantId; + TenantName = securityLogInfo.TenantName; - ApplicationName = securityLogInfo.ApplicationName; - Identity = securityLogInfo.Identity; - Action = securityLogInfo.Action; + ApplicationName = securityLogInfo.ApplicationName; + Identity = securityLogInfo.Identity; + Action = securityLogInfo.Action; - UserId = securityLogInfo.UserId; - UserName = securityLogInfo.UserName; + UserId = securityLogInfo.UserId; + UserName = securityLogInfo.UserName; - CreationTime = securityLogInfo.CreationTime; + CreationTime = securityLogInfo.CreationTime; - ClientIpAddress = securityLogInfo.ClientIpAddress; - ClientId = securityLogInfo.ClientId; - CorrelationId = securityLogInfo.CorrelationId; - BrowserInfo = securityLogInfo.BrowserInfo; + ClientIpAddress = securityLogInfo.ClientIpAddress; + ClientId = securityLogInfo.ClientId; + CorrelationId = securityLogInfo.CorrelationId; + BrowserInfo = securityLogInfo.BrowserInfo; - ExtraProperties = new ExtraPropertyDictionary(); - if (securityLogInfo.ExtraProperties != null) + ExtraProperties = new ExtraPropertyDictionary(); + if (securityLogInfo.ExtraProperties != null) + { + foreach (var pair in securityLogInfo.ExtraProperties) { - foreach (var pair in securityLogInfo.ExtraProperties) - { - ExtraProperties.Add(pair.Key, pair.Value); - } + ExtraProperties.Add(pair.Key, pair.Value); } } } diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/SecurityLogStore.cs b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/SecurityLogStore.cs index a14695b8d..1918ccc71 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/SecurityLogStore.cs +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging/LINGYUN/Abp/AuditLogging/SecurityLogStore.cs @@ -2,22 +2,21 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.SecurityLog; -namespace LINGYUN.Abp.AuditLogging +namespace LINGYUN.Abp.AuditLogging; + +[Dependency(ReplaceServices = true)] +public class SecurityLogStore : ISecurityLogStore, ITransientDependency { - [Dependency(ReplaceServices = true)] - public class SecurityLogStore : ISecurityLogStore, ITransientDependency - { - private readonly ISecurityLogManager _manager; + private readonly ISecurityLogManager _manager; - public SecurityLogStore( - ISecurityLogManager manager) - { - _manager = manager; - } + public SecurityLogStore( + ISecurityLogManager manager) + { + _manager = manager; + } - public async virtual Task SaveAsync(SecurityLogInfo securityLogInfo) - { - await _manager.SaveAsync(securityLogInfo); - } + public async virtual Task SaveAsync(SecurityLogInfo securityLogInfo) + { + await _manager.SaveAsync(securityLogInfo); } } diff --git a/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/LINGYUN.Abp.Authentication.QQ.csproj b/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/LINGYUN.Abp.Authentication.QQ.csproj index 45a96fd72..36034d45a 100644 --- a/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/LINGYUN.Abp.Authentication.QQ.csproj +++ b/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/LINGYUN.Abp.Authentication.QQ.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.Authentication.QQ + LINGYUN.Abp.Authentication.QQ + false + false + false diff --git a/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/LINGYUN/Abp/Authentication/QQ/AbpQQClaimTypes.cs b/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/LINGYUN/Abp/Authentication/QQ/AbpQQClaimTypes.cs index cc642ae28..f6683dd55 100644 --- a/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/LINGYUN/Abp/Authentication/QQ/AbpQQClaimTypes.cs +++ b/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/LINGYUN/Abp/Authentication/QQ/AbpQQClaimTypes.cs @@ -1,31 +1,30 @@ -namespace LINGYUN.Abp.Authentication.QQ +namespace LINGYUN.Abp.Authentication.QQ; + +/// +/// QQ互联身份类型,可以像 自行配置 +///
+/// See: +///
+public class AbpQQClaimTypes { /// - /// QQ互联身份类型,可以像 自行配置 - ///
- /// See: + /// 用户的唯一标识 ///
- public class AbpQQClaimTypes - { - /// - /// 用户的唯一标识 - /// - public static string OpenId { get; set; } = "qq-openid"; // 可变更 - /// - /// 用户昵称 - /// - public static string NickName { get; set; } = "nickname"; - /// - /// 性别。 如果获取不到则默认返回"男" - /// - public static string Gender { get; set; } = "gender"; - /// - /// 用户头像, 取自字段: figureurl_qq_1 - /// - /// - /// 根据QQ互联文档, 40x40的头像是一定会存在的, 只取40x40的头像 - /// see: https://wiki.connect.qq.com/get_user_info - /// - public static string AvatarUrl { get; set; } = "avatar"; - } + public static string OpenId { get; set; } = "qq-openid"; // 可变更 + /// + /// 用户昵称 + /// + public static string NickName { get; set; } = "nickname"; + /// + /// 性别。 如果获取不到则默认返回"男" + /// + public static string Gender { get; set; } = "gender"; + /// + /// 用户头像, 取自字段: figureurl_qq_1 + /// + /// + /// 根据QQ互联文档, 40x40的头像是一定会存在的, 只取40x40的头像 + /// see: https://wiki.connect.qq.com/get_user_info + /// + public static string AvatarUrl { get; set; } = "avatar"; } diff --git a/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/Microsoft/AspNetCore/Authentication/QQ/QQConnectOAuthHandler.cs b/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/Microsoft/AspNetCore/Authentication/QQ/QQConnectOAuthHandler.cs index 82379c634..7a806f86a 100644 --- a/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/Microsoft/AspNetCore/Authentication/QQ/QQConnectOAuthHandler.cs +++ b/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/Microsoft/AspNetCore/Authentication/QQ/QQConnectOAuthHandler.cs @@ -12,165 +12,164 @@ using System.Text.Json; using System.Threading.Tasks; -namespace Microsoft.AspNetCore.Authentication.QQ +namespace Microsoft.AspNetCore.Authentication.QQ; + +/// +/// QQ互联实现 +/// +public class QQConnectOAuthHandler : OAuthHandler { + protected AbpTencentQQOptionsFactory TencentQQOptionsFactory { get; } + public QQConnectOAuthHandler( + IOptionsMonitor options, + AbpTencentQQOptionsFactory tencentQQOptionsFactory, + ILoggerFactory logger, + UrlEncoder encoder) + : base(options, logger, encoder) + { + TencentQQOptionsFactory = tencentQQOptionsFactory; + } + + protected override async Task InitializeHandlerAsync() + { + var options = await TencentQQOptionsFactory.CreateAsync(); + + // 用配置项重写 + Options.ClientId = options.AppId; + Options.ClientSecret = options.AppKey; + Options.IsMobile = options.IsMobile; + Options.TimeProvider ??= TimeProvider.System; + + await base.InitializeHandlerAsync(); + } + /// - /// QQ互联实现 - /// - public class QQConnectOAuthHandler : OAuthHandler + /// 构建用户授权地址 + /// + protected override string BuildChallengeUrl(AuthenticationProperties properties, string redirectUri) { - protected AbpTencentQQOptionsFactory TencentQQOptionsFactory { get; } - public QQConnectOAuthHandler( - IOptionsMonitor options, - AbpTencentQQOptionsFactory tencentQQOptionsFactory, - ILoggerFactory logger, - UrlEncoder encoder) - : base(options, logger, encoder) + var challengeUrl = base.BuildChallengeUrl(properties, redirectUri); + if (Options.IsMobile) { - TencentQQOptionsFactory = tencentQQOptionsFactory; + challengeUrl += "&display=mobile"; } + return challengeUrl; - protected override async Task InitializeHandlerAsync() + } + + /// + /// code换取access_token + /// + protected override async Task ExchangeCodeAsync(OAuthCodeExchangeContext context) + { + var address = QueryHelpers.AddQueryString(Options.TokenEndpoint, new Dictionary() { - var options = await TencentQQOptionsFactory.CreateAsync(); + { "client_id", Options.ClientId }, + { "redirect_uri", context.RedirectUri }, + { "client_secret", Options.ClientSecret}, + { "code", context.Code}, + { "grant_type","authorization_code"} + }); + + var response = await Backchannel.GetAsync(address); + if (!response.IsSuccessStatusCode) + { + Logger.LogError("An error occurred while retrieving an access token: the remote server " + + "returned a {Status} response with the following payload: {Headers} {Body}.", + /* Status: */ response.StatusCode, + /* Headers: */ response.Headers.ToString(), + /* Body: */ await response.Content.ReadAsStringAsync()); + + return OAuthTokenResponse.Failed(new Exception("An error occurred while retrieving an access token.")); + } - // 用配置项重写 - Options.ClientId = options.AppId; - Options.ClientSecret = options.AppKey; - Options.IsMobile = options.IsMobile; - Options.TimeProvider ??= TimeProvider.System; + var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync()); + if (!string.IsNullOrEmpty(payload.GetRootString("errcode"))) + { + Logger.LogError("An error occurred while retrieving an access token: the remote server " + + "returned a {Status} response with the following payload: {Headers} {Body}.", + /* Status: */ response.StatusCode, + /* Headers: */ response.Headers.ToString(), + /* Body: */ await response.Content.ReadAsStringAsync()); - await base.InitializeHandlerAsync(); + return OAuthTokenResponse.Failed(new Exception("An error occurred while retrieving an access token.")); } + return OAuthTokenResponse.Success(payload); + } + + protected override async Task CreateTicketAsync(ClaimsIdentity identity, AuthenticationProperties properties, OAuthTokenResponse tokens) + { + var openIdEndpoint = Options.OpenIdEndpoint + "?access_token=" + tokens.AccessToken + "&fmt=json"; + var openIdResponse = await Backchannel.GetAsync(openIdEndpoint, Context.RequestAborted); + openIdResponse.EnsureSuccessStatusCode(); + + var openIdPayload = JsonDocument.Parse(await openIdResponse.Content.ReadAsStringAsync()); + var openId = openIdPayload.GetRootString("openid"); - /// - /// 构建用户授权地址 - /// - protected override string BuildChallengeUrl(AuthenticationProperties properties, string redirectUri) + identity.AddClaim(new Claim(AbpQQClaimTypes.OpenId, openId, ClaimValueTypes.String, Options.ClaimsIssuer)); + + var address = QueryHelpers.AddQueryString(Options.UserInformationEndpoint, new Dictionary + { + {"oauth_consumer_key", Options.ClientId}, + {"access_token", tokens.AccessToken}, + {"openid", openId} + }); + + var response = await Backchannel.GetAsync(address); + if (!response.IsSuccessStatusCode) { - var challengeUrl = base.BuildChallengeUrl(properties, redirectUri); - if (Options.IsMobile) - { - challengeUrl += "&display=mobile"; - } - return challengeUrl; + Logger.LogError("An error occurred while retrieving the user profile: the remote server " + + "returned a {Status} response with the following payload: {Headers} {Body}.", + /* Status: */ response.StatusCode, + /* Headers: */ response.Headers.ToString(), + /* Body: */ await response.Content.ReadAsStringAsync()); + throw new HttpRequestException("An error occurred while retrieving user information."); } - /// - /// code换取access_token - /// - protected override async Task ExchangeCodeAsync(OAuthCodeExchangeContext context) + var userInfoPayload = JsonDocument.Parse(await response.Content.ReadAsStringAsync()); + var errorCode = userInfoPayload.GetRootString("ret"); + if (!"0".Equals(errorCode)) { - var address = QueryHelpers.AddQueryString(Options.TokenEndpoint, new Dictionary() - { - { "client_id", Options.ClientId }, - { "redirect_uri", context.RedirectUri }, - { "client_secret", Options.ClientSecret}, - { "code", context.Code}, - { "grant_type","authorization_code"} - }); - - var response = await Backchannel.GetAsync(address); - if (!response.IsSuccessStatusCode) - { - Logger.LogError("An error occurred while retrieving an access token: the remote server " + - "returned a {Status} response with the following payload: {Headers} {Body}.", - /* Status: */ response.StatusCode, - /* Headers: */ response.Headers.ToString(), - /* Body: */ await response.Content.ReadAsStringAsync()); - - return OAuthTokenResponse.Failed(new Exception("An error occurred while retrieving an access token.")); - } - - var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync()); - if (!string.IsNullOrEmpty(payload.GetRootString("errcode"))) - { - Logger.LogError("An error occurred while retrieving an access token: the remote server " + - "returned a {Status} response with the following payload: {Headers} {Body}.", - /* Status: */ response.StatusCode, - /* Headers: */ response.Headers.ToString(), - /* Body: */ await response.Content.ReadAsStringAsync()); - - return OAuthTokenResponse.Failed(new Exception("An error occurred while retrieving an access token.")); - } - return OAuthTokenResponse.Success(payload); + // See: https://wiki.connect.qq.com/%e5%85%ac%e5%85%b1%e8%bf%94%e5%9b%9e%e7%a0%81%e8%af%b4%e6%98%8e + Logger.LogError("An error occurred while retrieving the user profile: the remote server " + + "returned code {Code} response with message: {Message}.", + errorCode, + userInfoPayload.GetRootString("msg")); + + throw new HttpRequestException("An error occurred while retrieving user information."); } - protected override async Task CreateTicketAsync(ClaimsIdentity identity, AuthenticationProperties properties, OAuthTokenResponse tokens) + var nickName = userInfoPayload.GetRootString("nickname"); + if (!nickName.IsNullOrWhiteSpace()) { - var openIdEndpoint = Options.OpenIdEndpoint + "?access_token=" + tokens.AccessToken + "&fmt=json"; - var openIdResponse = await Backchannel.GetAsync(openIdEndpoint, Context.RequestAborted); - openIdResponse.EnsureSuccessStatusCode(); - - var openIdPayload = JsonDocument.Parse(await openIdResponse.Content.ReadAsStringAsync()); - var openId = openIdPayload.GetRootString("openid"); - - identity.AddClaim(new Claim(AbpQQClaimTypes.OpenId, openId, ClaimValueTypes.String, Options.ClaimsIssuer)); - - var address = QueryHelpers.AddQueryString(Options.UserInformationEndpoint, new Dictionary - { - {"oauth_consumer_key", Options.ClientId}, - {"access_token", tokens.AccessToken}, - {"openid", openId} - }); - - var response = await Backchannel.GetAsync(address); - if (!response.IsSuccessStatusCode) - { - Logger.LogError("An error occurred while retrieving the user profile: the remote server " + - "returned a {Status} response with the following payload: {Headers} {Body}.", - /* Status: */ response.StatusCode, - /* Headers: */ response.Headers.ToString(), - /* Body: */ await response.Content.ReadAsStringAsync()); - - throw new HttpRequestException("An error occurred while retrieving user information."); - } - - var userInfoPayload = JsonDocument.Parse(await response.Content.ReadAsStringAsync()); - var errorCode = userInfoPayload.GetRootString("ret"); - if (!"0".Equals(errorCode)) - { - // See: https://wiki.connect.qq.com/%e5%85%ac%e5%85%b1%e8%bf%94%e5%9b%9e%e7%a0%81%e8%af%b4%e6%98%8e - Logger.LogError("An error occurred while retrieving the user profile: the remote server " + - "returned code {Code} response with message: {Message}.", - errorCode, - userInfoPayload.GetRootString("msg")); - - throw new HttpRequestException("An error occurred while retrieving user information."); - } - - var nickName = userInfoPayload.GetRootString("nickname"); - if (!nickName.IsNullOrWhiteSpace()) - { - identity.AddClaim(new Claim(AbpQQClaimTypes.NickName, nickName, ClaimValueTypes.String, Options.ClaimsIssuer)); - } - var gender = userInfoPayload.GetRootString("gender"); - if (!gender.IsNullOrWhiteSpace()) - { - identity.AddClaim(new Claim(AbpQQClaimTypes.Gender, gender, ClaimValueTypes.String, Options.ClaimsIssuer)); - } - var avatarUrl = userInfoPayload.GetRootString("figureurl_qq_1"); - if (!avatarUrl.IsNullOrWhiteSpace()) - { - identity.AddClaim(new Claim(AbpQQClaimTypes.AvatarUrl, avatarUrl, ClaimValueTypes.String, Options.ClaimsIssuer)); - } - - var context = new OAuthCreatingTicketContext( - new ClaimsPrincipal(identity), - properties, - Context, - Scheme, - Options, - Backchannel, - tokens, - userInfoPayload.RootElement); - - context.RunClaimActions(); - - await Events.CreatingTicket(context); - - return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name); + identity.AddClaim(new Claim(AbpQQClaimTypes.NickName, nickName, ClaimValueTypes.String, Options.ClaimsIssuer)); } + var gender = userInfoPayload.GetRootString("gender"); + if (!gender.IsNullOrWhiteSpace()) + { + identity.AddClaim(new Claim(AbpQQClaimTypes.Gender, gender, ClaimValueTypes.String, Options.ClaimsIssuer)); + } + var avatarUrl = userInfoPayload.GetRootString("figureurl_qq_1"); + if (!avatarUrl.IsNullOrWhiteSpace()) + { + identity.AddClaim(new Claim(AbpQQClaimTypes.AvatarUrl, avatarUrl, ClaimValueTypes.String, Options.ClaimsIssuer)); + } + + var context = new OAuthCreatingTicketContext( + new ClaimsPrincipal(identity), + properties, + Context, + Scheme, + Options, + Backchannel, + tokens, + userInfoPayload.RootElement); + + context.RunClaimActions(); + + await Events.CreatingTicket(context); + + return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name); } } \ No newline at end of file diff --git a/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/Microsoft/AspNetCore/Authentication/QQ/QQConnectOAuthOptions.cs b/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/Microsoft/AspNetCore/Authentication/QQ/QQConnectOAuthOptions.cs index e86f67e9c..975e06e53 100644 --- a/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/Microsoft/AspNetCore/Authentication/QQ/QQConnectOAuthOptions.cs +++ b/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/Microsoft/AspNetCore/Authentication/QQ/QQConnectOAuthOptions.cs @@ -3,44 +3,43 @@ using Microsoft.AspNetCore.Http; using System.Security.Claims; -namespace Microsoft.AspNetCore.Authentication.QQ +namespace Microsoft.AspNetCore.Authentication.QQ; + +public class QQConnectOAuthOptions : OAuthOptions { - public class QQConnectOAuthOptions : OAuthOptions + /// + /// 是否移动端样式 + /// + public bool IsMobile { get; set; } + /// + /// 获取用户OpenID_OAuth2.0 + /// + public string OpenIdEndpoint { get; set; } + + public QQConnectOAuthOptions() { - /// - /// 是否移动端样式 - /// - public bool IsMobile { get; set; } - /// - /// 获取用户OpenID_OAuth2.0 - /// - public string OpenIdEndpoint { get; set; } - - public QQConnectOAuthOptions() - { - // 用于防止初始化错误,会在OAuthHandler.InitializeHandlerAsync中进行重写 - ClientId = "QQConnect"; - ClientSecret = "QQConnect"; - - ClaimsIssuer = "connect.qq.com"; - CallbackPath = new PathString(AbpAuthenticationQQConsts.CallbackPath); - - AuthorizationEndpoint = "https://graph.qq.com/oauth2.0/authorize"; - TokenEndpoint = "https://graph.qq.com/oauth2.0/token"; - OpenIdEndpoint = "https://graph.qq.com/oauth2.0/me"; - UserInformationEndpoint = "https://graph.qq.com/user/get_user_info"; - - Scope.Add("get_user_info"); - - // 这个原始的属性一定要写进去,框架关联判断是否绑定QQ - ClaimActions.MapJsonKey(ClaimTypes.NameIdentifier, "openid"); - ClaimActions.MapJsonKey(ClaimTypes.Name, "nickname"); - - // 把自定义的身份标识写进令牌 - ClaimActions.MapJsonKey(AbpQQClaimTypes.OpenId, "openid"); - ClaimActions.MapJsonKey(AbpQQClaimTypes.NickName, "nickname"); - ClaimActions.MapJsonKey(AbpQQClaimTypes.Gender, "gender"); - ClaimActions.MapJsonKey(AbpQQClaimTypes.AvatarUrl, "figureurl_qq_1"); - } + // 用于防止初始化错误,会在OAuthHandler.InitializeHandlerAsync中进行重写 + ClientId = "QQConnect"; + ClientSecret = "QQConnect"; + + ClaimsIssuer = "connect.qq.com"; + CallbackPath = new PathString(AbpAuthenticationQQConsts.CallbackPath); + + AuthorizationEndpoint = "https://graph.qq.com/oauth2.0/authorize"; + TokenEndpoint = "https://graph.qq.com/oauth2.0/token"; + OpenIdEndpoint = "https://graph.qq.com/oauth2.0/me"; + UserInformationEndpoint = "https://graph.qq.com/user/get_user_info"; + + Scope.Add("get_user_info"); + + // 这个原始的属性一定要写进去,框架关联判断是否绑定QQ + ClaimActions.MapJsonKey(ClaimTypes.NameIdentifier, "openid"); + ClaimActions.MapJsonKey(ClaimTypes.Name, "nickname"); + + // 把自定义的身份标识写进令牌 + ClaimActions.MapJsonKey(AbpQQClaimTypes.OpenId, "openid"); + ClaimActions.MapJsonKey(AbpQQClaimTypes.NickName, "nickname"); + ClaimActions.MapJsonKey(AbpQQClaimTypes.Gender, "gender"); + ClaimActions.MapJsonKey(AbpQQClaimTypes.AvatarUrl, "figureurl_qq_1"); } } diff --git a/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/Microsoft/AspNetCore/Authentication/QQAuthenticationExtensions.cs b/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/Microsoft/AspNetCore/Authentication/QQAuthenticationExtensions.cs index ccfd40c29..081a85d31 100644 --- a/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/Microsoft/AspNetCore/Authentication/QQAuthenticationExtensions.cs +++ b/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/Microsoft/AspNetCore/Authentication/QQAuthenticationExtensions.cs @@ -3,61 +3,60 @@ using Microsoft.Extensions.DependencyInjection; using System; -namespace Microsoft.AspNetCore.Authentication +namespace Microsoft.AspNetCore.Authentication; + +public static class QQAuthenticationExtensions { - public static class QQAuthenticationExtensions + /// + /// + public static AuthenticationBuilder AddQQConnect( + this AuthenticationBuilder builder) { - /// - /// - public static AuthenticationBuilder AddQQConnect( - this AuthenticationBuilder builder) - { - return builder - .AddQQConnect( - AbpAuthenticationQQConsts.AuthenticationScheme, - AbpAuthenticationQQConsts.DisplayName, - options => { }); - } + return builder + .AddQQConnect( + AbpAuthenticationQQConsts.AuthenticationScheme, + AbpAuthenticationQQConsts.DisplayName, + options => { }); + } - /// - /// - public static AuthenticationBuilder AddQQConnect( - this AuthenticationBuilder builder, - Action configureOptions) - { - return builder - .AddQQConnect( - AbpAuthenticationQQConsts.AuthenticationScheme, - configureOptions); - } + /// + /// + public static AuthenticationBuilder AddQQConnect( + this AuthenticationBuilder builder, + Action configureOptions) + { + return builder + .AddQQConnect( + AbpAuthenticationQQConsts.AuthenticationScheme, + configureOptions); + } - /// - /// - public static AuthenticationBuilder AddQQConnect( - this AuthenticationBuilder builder, - string authenticationScheme, - Action configureOptions) - { - return builder - .AddQQConnect( - authenticationScheme, - AbpAuthenticationQQConsts.DisplayName, - configureOptions); - } + /// + /// + public static AuthenticationBuilder AddQQConnect( + this AuthenticationBuilder builder, + string authenticationScheme, + Action configureOptions) + { + return builder + .AddQQConnect( + authenticationScheme, + AbpAuthenticationQQConsts.DisplayName, + configureOptions); + } - /// - /// - public static AuthenticationBuilder AddQQConnect( - this AuthenticationBuilder builder, - string authenticationScheme, - string displayName, - Action configureOptions) - { - return builder - .AddOAuth( - authenticationScheme, - displayName, - configureOptions); - } + /// + /// + public static AuthenticationBuilder AddQQConnect( + this AuthenticationBuilder builder, + string authenticationScheme, + string displayName, + Action configureOptions) + { + return builder + .AddOAuth( + authenticationScheme, + displayName, + configureOptions); } } diff --git a/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/System/BytesExtensions.cs b/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/System/BytesExtensions.cs index d1bad7915..cba8afd53 100644 --- a/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/System/BytesExtensions.cs +++ b/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/System/BytesExtensions.cs @@ -1,16 +1,15 @@ using System.Security.Cryptography; -namespace System +namespace System; + +internal static class BytesExtensions { - internal static class BytesExtensions + public static byte[] Sha1(this byte[] data) { - public static byte[] Sha1(this byte[] data) + using (var sha = SHA1.Create()) { - using (var sha = SHA1.Create()) - { - var hashBytes = sha.ComputeHash(data); - return hashBytes; - } + var hashBytes = sha.ComputeHash(data); + return hashBytes; } } } diff --git a/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/System/StringExtensions.cs b/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/System/StringExtensions.cs index a8eb40c27..27021fad8 100644 --- a/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/System/StringExtensions.cs +++ b/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/System/StringExtensions.cs @@ -1,17 +1,16 @@ using System.Security.Cryptography; using System.Text; -namespace System +namespace System; + +internal static class StringExtensions { - internal static class StringExtensions + public static byte[] Sha1(this string str) { - public static byte[] Sha1(this string str) + using (var sha = SHA1.Create()) { - using (var sha = SHA1.Create()) - { - var hashBytes = sha.ComputeHash(Encoding.ASCII.GetBytes(str)); - return hashBytes; - } + var hashBytes = sha.ComputeHash(Encoding.ASCII.GetBytes(str)); + return hashBytes; } } } diff --git a/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/System/Text/Json/JsonElementExtensions.cs b/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/System/Text/Json/JsonElementExtensions.cs index 653a868ac..615562f2e 100644 --- a/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/System/Text/Json/JsonElementExtensions.cs +++ b/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.QQ/System/Text/Json/JsonElementExtensions.cs @@ -1,63 +1,62 @@ using System.Collections.Generic; -namespace System.Text.Json +namespace System.Text.Json; + +internal static class JsonElementExtensions { - internal static class JsonElementExtensions + public static IEnumerable GetRootStrings(this JsonDocument json, string key) { - public static IEnumerable GetRootStrings(this JsonDocument json, string key) - { - return json.RootElement.GetStrings(key); - } + return json.RootElement.GetStrings(key); + } - public static IEnumerable GetStrings(this JsonElement json, string key) - { - var result = new List(); + public static IEnumerable GetStrings(this JsonElement json, string key) + { + var result = new List(); - if (json.TryGetProperty(key, out JsonElement property) && property.ValueKind == JsonValueKind.Array) + if (json.TryGetProperty(key, out JsonElement property) && property.ValueKind == JsonValueKind.Array) + { + foreach (var jsonProp in property.EnumerateArray()) { - foreach (var jsonProp in property.EnumerateArray()) - { - result.Add(jsonProp.GetString()); - } + result.Add(jsonProp.GetString()); } - - return result; } - public static string GetRootString(this JsonDocument json, string key, string defaultValue = "") + return result; + } + + public static string GetRootString(this JsonDocument json, string key, string defaultValue = "") + { + if (json.RootElement.TryGetProperty(key, out JsonElement property)) { - if (json.RootElement.TryGetProperty(key, out JsonElement property)) - { - return property.GetString(); - } - return defaultValue; + return property.GetString(); } + return defaultValue; + } - public static string GetString(this JsonElement json, string key, string defaultValue = "") + public static string GetString(this JsonElement json, string key, string defaultValue = "") + { + if (json.TryGetProperty(key, out JsonElement property)) { - if (json.TryGetProperty(key, out JsonElement property)) - { - return property.GetString(); - } - return defaultValue; + return property.GetString(); } + return defaultValue; + } - public static int GetRootInt32(this JsonDocument json, string key, int defaultValue = 0) + public static int GetRootInt32(this JsonDocument json, string key, int defaultValue = 0) + { + if (json.RootElement.TryGetProperty(key, out JsonElement property) && property.TryGetInt32(out int value)) { - if (json.RootElement.TryGetProperty(key, out JsonElement property) && property.TryGetInt32(out int value)) - { - return value; - } - return defaultValue; + return value; } + return defaultValue; + } - public static int GetInt32(this JsonElement json, string key, int defaultValue = 0) + public static int GetInt32(this JsonElement json, string key, int defaultValue = 0) + { + if (json.TryGetProperty(key, out JsonElement property) && property.TryGetInt32(out int value)) { - if (json.TryGetProperty(key, out JsonElement property) && property.TryGetInt32(out int value)) - { - return value; - } - return defaultValue; + return value; } + return defaultValue; } } diff --git a/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.WeChat/LINGYUN.Abp.Authentication.WeChat.csproj b/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.WeChat/LINGYUN.Abp.Authentication.WeChat.csproj index 6589cb3cd..c28efde69 100644 --- a/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.WeChat/LINGYUN.Abp.Authentication.WeChat.csproj +++ b/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.WeChat/LINGYUN.Abp.Authentication.WeChat.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.Authentication.WeChat + LINGYUN.Abp.Authentication.WeChat + false + false + false diff --git a/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.WeChat/Microsoft/AspNetCore/Authentication/WeChat/Official/WeChatOfficialOAuthHandler.cs b/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.WeChat/Microsoft/AspNetCore/Authentication/WeChat/Official/WeChatOfficialOAuthHandler.cs index 9b07c6c3b..c03945575 100644 --- a/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.WeChat/Microsoft/AspNetCore/Authentication/WeChat/Official/WeChatOfficialOAuthHandler.cs +++ b/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.WeChat/Microsoft/AspNetCore/Authentication/WeChat/Official/WeChatOfficialOAuthHandler.cs @@ -16,299 +16,298 @@ using System.Text.Json; using System.Threading.Tasks; -namespace Microsoft.AspNetCore.Authentication.WeChat.Official +namespace Microsoft.AspNetCore.Authentication.WeChat.Official; + +/// +/// 网页授权只有公众平台的实现 +/// +public class WeChatOfficialOAuthHandler : OAuthHandler { + protected AbpWeChatOfficialOptionsFactory WeChatOfficialOptionsFactory { get; } + public WeChatOfficialOAuthHandler( + IOptionsMonitor options, + AbpWeChatOfficialOptionsFactory weChatOfficialOptionsFactory, + ILoggerFactory logger, + UrlEncoder encoder) + : base(options, logger, encoder) + { + WeChatOfficialOptionsFactory = weChatOfficialOptionsFactory; + } + + protected override async Task InitializeHandlerAsync() + { + var weChatOfficialOptions = await WeChatOfficialOptionsFactory.CreateAsync(); + + // 用配置项重写 + Options.ClientId = weChatOfficialOptions.AppId; + Options.ClientSecret = weChatOfficialOptions.AppSecret; + Options.TimeProvider ??= TimeProvider.System; + + await base.InitializeHandlerAsync(); + } /// - /// 网页授权只有公众平台的实现 - /// - public class WeChatOfficialOAuthHandler : OAuthHandler + /// 第一步:构建用户授权地址 + /// + protected override string BuildChallengeUrl(AuthenticationProperties properties, string redirectUri) { - protected AbpWeChatOfficialOptionsFactory WeChatOfficialOptionsFactory { get; } - public WeChatOfficialOAuthHandler( - IOptionsMonitor options, - AbpWeChatOfficialOptionsFactory weChatOfficialOptionsFactory, - ILoggerFactory logger, - UrlEncoder encoder) - : base(options, logger, encoder) - { - WeChatOfficialOptionsFactory = weChatOfficialOptionsFactory; - } + var isWeChatBrewserRequest = IsWeChatBrowser(); - protected override async Task InitializeHandlerAsync() - { - var weChatOfficialOptions = await WeChatOfficialOptionsFactory.CreateAsync(); + var scope = isWeChatBrewserRequest + ? AbpAuthenticationWeChatConsts.UserInfoScope + : AbpAuthenticationWeChatConsts.LoginScope; - // 用配置项重写 - Options.ClientId = weChatOfficialOptions.AppId; - Options.ClientSecret = weChatOfficialOptions.AppSecret; - Options.TimeProvider ??= TimeProvider.System; + var endPoint = isWeChatBrewserRequest + ? Options.AuthorizationEndpoint + : AbpAuthenticationWeChatConsts.QrConnectEndpoint; - await base.InitializeHandlerAsync(); - } - /// - /// 第一步:构建用户授权地址 - /// - protected override string BuildChallengeUrl(AuthenticationProperties properties, string redirectUri) + redirectUri += $"?protected={Options.StateDataFormat.Protect(properties)}"; + + var parameters = new Dictionary { - var isWeChatBrewserRequest = IsWeChatBrowser(); + { "appid", Options.ClientId }, + { "redirect_uri", redirectUri }, + { "response_type", "code" }, + { "scope", scope }, + { "state", Guid.NewGuid().ToString("N") }, + }; + + return $"{QueryHelpers.AddQueryString(endPoint, parameters)}#wechat_redirect"; + } - var scope = isWeChatBrewserRequest - ? AbpAuthenticationWeChatConsts.UserInfoScope - : AbpAuthenticationWeChatConsts.LoginScope; + /// + /// 第二步:code换取access_token + /// + protected async override Task ExchangeCodeAsync(OAuthCodeExchangeContext context) + { + var parameters = new Dictionary() + { + { "appid", Options.ClientId }, + { "secret", Options.ClientSecret }, + { "code", context.Code }, + { "grant_type", "authorization_code" }, + }; - var endPoint = isWeChatBrewserRequest - ? Options.AuthorizationEndpoint - : AbpAuthenticationWeChatConsts.QrConnectEndpoint; + var address = QueryHelpers.AddQueryString(Options.TokenEndpoint, parameters); - redirectUri += $"?protected={Options.StateDataFormat.Protect(properties)}"; + var response = await Backchannel.GetAsync(address); + if (!response.IsSuccessStatusCode) + { + Logger.LogError("An error occurred while retrieving an access token: the remote server " + + "returned a {Status} response with the following payload: {Headers} {Body}.", + /* Status: */ response.StatusCode, + /* Headers: */ response.Headers.ToString(), + /* Body: */ await response.Content.ReadAsStringAsync()); - var parameters = new Dictionary - { - { "appid", Options.ClientId }, - { "redirect_uri", redirectUri }, - { "response_type", "code" }, - { "scope", scope }, - { "state", Guid.NewGuid().ToString("N") }, - }; - - return $"{QueryHelpers.AddQueryString(endPoint, parameters)}#wechat_redirect"; + return OAuthTokenResponse.Failed(new Exception("An error occurred while retrieving an access token.")); } - /// - /// 第二步:code换取access_token - /// - protected async override Task ExchangeCodeAsync(OAuthCodeExchangeContext context) + var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync()); + if (!string.IsNullOrEmpty(payload.GetRootString("errcode"))) { - var parameters = new Dictionary() - { - { "appid", Options.ClientId }, - { "secret", Options.ClientSecret }, - { "code", context.Code }, - { "grant_type", "authorization_code" }, - }; + Logger.LogError("An error occurred while retrieving an access token: the remote server " + + "returned a {Status} response with the following payload: {Headers} {Body}.", + /* Status: */ response.StatusCode, + /* Headers: */ response.Headers.ToString(), + /* Body: */ await response.Content.ReadAsStringAsync()); - var address = QueryHelpers.AddQueryString(Options.TokenEndpoint, parameters); - - var response = await Backchannel.GetAsync(address); - if (!response.IsSuccessStatusCode) - { - Logger.LogError("An error occurred while retrieving an access token: the remote server " + - "returned a {Status} response with the following payload: {Headers} {Body}.", - /* Status: */ response.StatusCode, - /* Headers: */ response.Headers.ToString(), - /* Body: */ await response.Content.ReadAsStringAsync()); + return OAuthTokenResponse.Failed(new Exception("An error occurred while retrieving an access token.")); + } + return OAuthTokenResponse.Success(payload); + } - return OAuthTokenResponse.Failed(new Exception("An error occurred while retrieving an access token.")); - } + /// + /// 第三步:构建用户票据 + /// + /// + /// + /// + /// + /// + protected async override Task CreateTicketAsync(ClaimsIdentity identity, AuthenticationProperties properties, OAuthTokenResponse tokens) + { + var address = QueryHelpers.AddQueryString(Options.UserInformationEndpoint, new Dictionary + { + ["access_token"] = tokens.AccessToken, + ["openid"] = tokens.Response.GetRootString("openid") + }); - var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync()); - if (!string.IsNullOrEmpty(payload.GetRootString("errcode"))) - { - Logger.LogError("An error occurred while retrieving an access token: the remote server " + - "returned a {Status} response with the following payload: {Headers} {Body}.", - /* Status: */ response.StatusCode, - /* Headers: */ response.Headers.ToString(), - /* Body: */ await response.Content.ReadAsStringAsync()); + var response = await Backchannel.GetAsync(address); + if (!response.IsSuccessStatusCode) + { + Logger.LogError("An error occurred while retrieving the user profile: the remote server " + + "returned a {Status} response with the following payload: {Headers} {Body}.", + /* Status: */ response.StatusCode, + /* Headers: */ response.Headers.ToString(), + /* Body: */ await response.Content.ReadAsStringAsync()); - return OAuthTokenResponse.Failed(new Exception("An error occurred while retrieving an access token.")); - } - return OAuthTokenResponse.Success(payload); + throw new HttpRequestException("An error occurred while retrieving user information."); } - /// - /// 第三步:构建用户票据 - /// - /// - /// - /// - /// - /// - protected async override Task CreateTicketAsync(ClaimsIdentity identity, AuthenticationProperties properties, OAuthTokenResponse tokens) + var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync()); + if (!string.IsNullOrEmpty(payload.GetRootString("errcode"))) { - var address = QueryHelpers.AddQueryString(Options.UserInformationEndpoint, new Dictionary - { - ["access_token"] = tokens.AccessToken, - ["openid"] = tokens.Response.GetRootString("openid") - }); + Logger.LogError("An error occurred while retrieving the user profile: the remote server " + + "returned a {Status} response with the following payload: {Headers} {Body}.", + /* Status: */ response.StatusCode, + /* Headers: */ response.Headers.ToString(), + /* Body: */ await response.Content.ReadAsStringAsync()); - var response = await Backchannel.GetAsync(address); - if (!response.IsSuccessStatusCode) - { - Logger.LogError("An error occurred while retrieving the user profile: the remote server " + - "returned a {Status} response with the following payload: {Headers} {Body}.", - /* Status: */ response.StatusCode, - /* Headers: */ response.Headers.ToString(), - /* Body: */ await response.Content.ReadAsStringAsync()); + throw new HttpRequestException("An error occurred while retrieving user information."); + } - throw new HttpRequestException("An error occurred while retrieving user information."); - } + var context = new OAuthCreatingTicketContext(new ClaimsPrincipal(identity), properties, Context, Scheme, Options, Backchannel, tokens, payload.RootElement); + context.RunClaimActions(); - var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync()); - if (!string.IsNullOrEmpty(payload.GetRootString("errcode"))) - { - Logger.LogError("An error occurred while retrieving the user profile: the remote server " + - "returned a {Status} response with the following payload: {Headers} {Body}.", - /* Status: */ response.StatusCode, - /* Headers: */ response.Headers.ToString(), - /* Body: */ await response.Content.ReadAsStringAsync()); + await Events.CreatingTicket(context); - throw new HttpRequestException("An error occurred while retrieving user information."); - } + return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name); + } + + public override Task HandleRequestAsync() + { + return base.HandleRequestAsync(); + } - var context = new OAuthCreatingTicketContext(new ClaimsPrincipal(identity), properties, Context, Scheme, Options, Backchannel, tokens, payload.RootElement); - context.RunClaimActions(); + protected async override Task HandleRemoteAuthenticateAsync() + { + var query = Request.Query; - await Events.CreatingTicket(context); + // TODO: 此处借用唯一的 CorrelationId, 将 properties生成的State缓存取出,进行解密 + var state = query["protected"]; - return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name); - } + var properties = Options.StateDataFormat.Unprotect(state); - public override Task HandleRequestAsync() + if (properties == null) { - return base.HandleRequestAsync(); + return HandleRequestResult.Fail("The oauth state was missing or invalid."); } - protected async override Task HandleRemoteAuthenticateAsync() + // OAuth2 10.12 CSRF + if (!ValidateCorrelationId(properties)) { - var query = Request.Query; + return HandleRequestResult.Fail("Correlation failed.", properties); + } - // TODO: 此处借用唯一的 CorrelationId, 将 properties生成的State缓存取出,进行解密 - var state = query["protected"]; + var error = query["error"]; + if (!StringValues.IsNullOrEmpty(error)) + { + // Note: access_denied errors are special protocol errors indicating the user didn't + // approve the authorization demand requested by the remote authorization server. + // Since it's a frequent scenario (that is not caused by incorrect configuration), + // denied errors are handled differently using HandleAccessDeniedErrorAsync(). + // Visit https://tools.ietf.org/html/rfc6749#section-4.1.2.1 for more information. + var errorDescription = query["error_description"]; + var errorUri = query["error_uri"]; + if (StringValues.Equals(error, "access_denied")) + { + var result = await HandleAccessDeniedErrorAsync(properties); + if (!result.None) + { + return result; + } + var deniedEx = new Exception("Access was denied by the resource owner or by the remote server."); + deniedEx.Data["error"] = error.ToString(); + deniedEx.Data["error_description"] = errorDescription.ToString(); + deniedEx.Data["error_uri"] = errorUri.ToString(); - var properties = Options.StateDataFormat.Unprotect(state); + return HandleRequestResult.Fail(deniedEx, properties); + } - if (properties == null) + var failureMessage = new StringBuilder(); + failureMessage.Append(error); + if (!StringValues.IsNullOrEmpty(errorDescription)) { - return HandleRequestResult.Fail("The oauth state was missing or invalid."); + failureMessage.Append(";Description=").Append(errorDescription); } - - // OAuth2 10.12 CSRF - if (!ValidateCorrelationId(properties)) + if (!StringValues.IsNullOrEmpty(errorUri)) { - return HandleRequestResult.Fail("Correlation failed.", properties); + failureMessage.Append(";Uri=").Append(errorUri); } - var error = query["error"]; - if (!StringValues.IsNullOrEmpty(error)) - { - // Note: access_denied errors are special protocol errors indicating the user didn't - // approve the authorization demand requested by the remote authorization server. - // Since it's a frequent scenario (that is not caused by incorrect configuration), - // denied errors are handled differently using HandleAccessDeniedErrorAsync(). - // Visit https://tools.ietf.org/html/rfc6749#section-4.1.2.1 for more information. - var errorDescription = query["error_description"]; - var errorUri = query["error_uri"]; - if (StringValues.Equals(error, "access_denied")) - { - var result = await HandleAccessDeniedErrorAsync(properties); - if (!result.None) - { - return result; - } - var deniedEx = new Exception("Access was denied by the resource owner or by the remote server."); - deniedEx.Data["error"] = error.ToString(); - deniedEx.Data["error_description"] = errorDescription.ToString(); - deniedEx.Data["error_uri"] = errorUri.ToString(); - - return HandleRequestResult.Fail(deniedEx, properties); - } + var ex = new Exception(failureMessage.ToString()); + ex.Data["error"] = error.ToString(); + ex.Data["error_description"] = errorDescription.ToString(); + ex.Data["error_uri"] = errorUri.ToString(); - var failureMessage = new StringBuilder(); - failureMessage.Append(error); - if (!StringValues.IsNullOrEmpty(errorDescription)) - { - failureMessage.Append(";Description=").Append(errorDescription); - } - if (!StringValues.IsNullOrEmpty(errorUri)) - { - failureMessage.Append(";Uri=").Append(errorUri); - } + return HandleRequestResult.Fail(ex, properties); + } - var ex = new Exception(failureMessage.ToString()); - ex.Data["error"] = error.ToString(); - ex.Data["error_description"] = errorDescription.ToString(); - ex.Data["error_uri"] = errorUri.ToString(); + var code = query["code"]; - return HandleRequestResult.Fail(ex, properties); - } + if (StringValues.IsNullOrEmpty(code)) + { + return HandleRequestResult.Fail("Code was not found.", properties); + } - var code = query["code"]; + var codeExchangeContext = new OAuthCodeExchangeContext(properties, code, BuildRedirectUri(Options.CallbackPath)); + using var tokens = await ExchangeCodeAsync(codeExchangeContext); - if (StringValues.IsNullOrEmpty(code)) - { - return HandleRequestResult.Fail("Code was not found.", properties); - } + if (tokens.Error != null) + { + return HandleRequestResult.Fail(tokens.Error, properties); + } + + if (string.IsNullOrEmpty(tokens.AccessToken)) + { + return HandleRequestResult.Fail("Failed to retrieve access token.", properties); + } - var codeExchangeContext = new OAuthCodeExchangeContext(properties, code, BuildRedirectUri(Options.CallbackPath)); - using var tokens = await ExchangeCodeAsync(codeExchangeContext); + var identity = new ClaimsIdentity(ClaimsIssuer); - if (tokens.Error != null) + if (Options.SaveTokens) + { + var authTokens = new List(); + + authTokens.Add(new AuthenticationToken { Name = "access_token", Value = tokens.AccessToken }); + if (!string.IsNullOrEmpty(tokens.RefreshToken)) { - return HandleRequestResult.Fail(tokens.Error, properties); + authTokens.Add(new AuthenticationToken { Name = "refresh_token", Value = tokens.RefreshToken }); } - if (string.IsNullOrEmpty(tokens.AccessToken)) + if (!string.IsNullOrEmpty(tokens.TokenType)) { - return HandleRequestResult.Fail("Failed to retrieve access token.", properties); + authTokens.Add(new AuthenticationToken { Name = "token_type", Value = tokens.TokenType }); } - var identity = new ClaimsIdentity(ClaimsIssuer); - - if (Options.SaveTokens) + if (!string.IsNullOrEmpty(tokens.ExpiresIn)) { - var authTokens = new List(); - - authTokens.Add(new AuthenticationToken { Name = "access_token", Value = tokens.AccessToken }); - if (!string.IsNullOrEmpty(tokens.RefreshToken)) - { - authTokens.Add(new AuthenticationToken { Name = "refresh_token", Value = tokens.RefreshToken }); - } - - if (!string.IsNullOrEmpty(tokens.TokenType)) + int value; + if (int.TryParse(tokens.ExpiresIn, NumberStyles.Integer, CultureInfo.InvariantCulture, out value)) { - authTokens.Add(new AuthenticationToken { Name = "token_type", Value = tokens.TokenType }); - } - - if (!string.IsNullOrEmpty(tokens.ExpiresIn)) - { - int value; - if (int.TryParse(tokens.ExpiresIn, NumberStyles.Integer, CultureInfo.InvariantCulture, out value)) + // https://www.w3.org/TR/xmlschema-2/#dateTime + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx + var expiresAt = Options.TimeProvider.GetUtcNow() + TimeSpan.FromSeconds(value); + authTokens.Add(new AuthenticationToken { - // https://www.w3.org/TR/xmlschema-2/#dateTime - // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx - var expiresAt = Options.TimeProvider.GetUtcNow() + TimeSpan.FromSeconds(value); - authTokens.Add(new AuthenticationToken - { - Name = "expires_at", - Value = expiresAt.ToString("o", CultureInfo.InvariantCulture) - }); - } + Name = "expires_at", + Value = expiresAt.ToString("o", CultureInfo.InvariantCulture) + }); } - - properties.StoreTokens(authTokens); } - var ticket = await CreateTicketAsync(identity, properties, tokens); - if (ticket != null) - { - return HandleRequestResult.Success(ticket); - } - else - { - return HandleRequestResult.Fail("Failed to retrieve user information from remote server.", properties); - } + properties.StoreTokens(authTokens); } - protected override string FormatScope() + var ticket = await CreateTicketAsync(identity, properties, tokens); + if (ticket != null) { - return string.Join(",", Options.Scope); + return HandleRequestResult.Success(ticket); } - - protected virtual bool IsWeChatBrowser() + else { - var userAgent = Request.Headers[HeaderNames.UserAgent].ToString(); - - return userAgent.Contains("micromessenger", StringComparison.InvariantCultureIgnoreCase); + return HandleRequestResult.Fail("Failed to retrieve user information from remote server.", properties); } } + + protected override string FormatScope() + { + return string.Join(",", Options.Scope); + } + + protected virtual bool IsWeChatBrowser() + { + var userAgent = Request.Headers[HeaderNames.UserAgent].ToString(); + + return userAgent.Contains("micromessenger", StringComparison.InvariantCultureIgnoreCase); + } } \ No newline at end of file diff --git a/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.WeChat/Microsoft/AspNetCore/Authentication/WeChat/Official/WeChatOfficialOAuthOptions.cs b/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.WeChat/Microsoft/AspNetCore/Authentication/WeChat/Official/WeChatOfficialOAuthOptions.cs index c06f278ba..81528dcfd 100644 --- a/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.WeChat/Microsoft/AspNetCore/Authentication/WeChat/Official/WeChatOfficialOAuthOptions.cs +++ b/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.WeChat/Microsoft/AspNetCore/Authentication/WeChat/Official/WeChatOfficialOAuthOptions.cs @@ -5,43 +5,42 @@ using System.Security.Claims; using System.Text.Json; -namespace Microsoft.AspNetCore.Authentication.WeChat.Official +namespace Microsoft.AspNetCore.Authentication.WeChat.Official; + +public class WeChatOfficialOAuthOptions : OAuthOptions { - public class WeChatOfficialOAuthOptions : OAuthOptions + public WeChatOfficialOAuthOptions() { - public WeChatOfficialOAuthOptions() - { - // 用于防止初始化错误,会在OAuthHandler.InitializeHandlerAsync中进行重写 - ClientId = "WeChatOfficial"; - ClientSecret = "WeChatOfficial"; + // 用于防止初始化错误,会在OAuthHandler.InitializeHandlerAsync中进行重写 + ClientId = "WeChatOfficial"; + ClientSecret = "WeChatOfficial"; - ClaimsIssuer = AbpAuthenticationWeChatConsts.ProviderKey; - CallbackPath = new PathString(AbpAuthenticationWeChatConsts.CallbackPath); + ClaimsIssuer = AbpAuthenticationWeChatConsts.ProviderKey; + CallbackPath = new PathString(AbpAuthenticationWeChatConsts.CallbackPath); - AuthorizationEndpoint = AbpAuthenticationWeChatConsts.AuthorizationEndpoint; - TokenEndpoint = AbpAuthenticationWeChatConsts.TokenEndpoint; - UserInformationEndpoint = AbpAuthenticationWeChatConsts.UserInformationEndpoint; + AuthorizationEndpoint = AbpAuthenticationWeChatConsts.AuthorizationEndpoint; + TokenEndpoint = AbpAuthenticationWeChatConsts.TokenEndpoint; + UserInformationEndpoint = AbpAuthenticationWeChatConsts.UserInformationEndpoint; - Scope.Add(AbpAuthenticationWeChatConsts.LoginScope); - Scope.Add(AbpAuthenticationWeChatConsts.UserInfoScope); + Scope.Add(AbpAuthenticationWeChatConsts.LoginScope); + Scope.Add(AbpAuthenticationWeChatConsts.UserInfoScope); - // 这个原始的属性一定要写进去,框架与UserLogin.ProviderKey进行关联判断是否绑定微信 - ClaimActions.MapJsonKey(ClaimTypes.NameIdentifier, "openid"); - ClaimActions.MapJsonKey(ClaimTypes.Name, "nickname"); + // 这个原始的属性一定要写进去,框架与UserLogin.ProviderKey进行关联判断是否绑定微信 + ClaimActions.MapJsonKey(ClaimTypes.NameIdentifier, "openid"); + ClaimActions.MapJsonKey(ClaimTypes.Name, "nickname"); - // 把自定义的身份标识写进令牌 - ClaimActions.MapJsonKey(AbpWeChatClaimTypes.OpenId, "openid"); - ClaimActions.MapJsonKey(AbpWeChatClaimTypes.UnionId, "unionid");// 公众号如果与小程序关联,这个可以用上 - ClaimActions.MapJsonKey(AbpWeChatClaimTypes.NickName, "nickname"); - ClaimActions.MapJsonKey(AbpWeChatClaimTypes.Sex, "sex", ClaimValueTypes.Integer); - ClaimActions.MapJsonKey(AbpWeChatClaimTypes.Country, "country"); - ClaimActions.MapJsonKey(AbpWeChatClaimTypes.Province, "province"); - ClaimActions.MapJsonKey(AbpWeChatClaimTypes.City, "city"); - ClaimActions.MapJsonKey(AbpWeChatClaimTypes.AvatarUrl, "headimgurl"); - ClaimActions.MapCustomJson(AbpWeChatClaimTypes.Privilege, user => - { - return string.Join(",", user.GetStrings("privilege")); - }); - } + // 把自定义的身份标识写进令牌 + ClaimActions.MapJsonKey(AbpWeChatClaimTypes.OpenId, "openid"); + ClaimActions.MapJsonKey(AbpWeChatClaimTypes.UnionId, "unionid");// 公众号如果与小程序关联,这个可以用上 + ClaimActions.MapJsonKey(AbpWeChatClaimTypes.NickName, "nickname"); + ClaimActions.MapJsonKey(AbpWeChatClaimTypes.Sex, "sex", ClaimValueTypes.Integer); + ClaimActions.MapJsonKey(AbpWeChatClaimTypes.Country, "country"); + ClaimActions.MapJsonKey(AbpWeChatClaimTypes.Province, "province"); + ClaimActions.MapJsonKey(AbpWeChatClaimTypes.City, "city"); + ClaimActions.MapJsonKey(AbpWeChatClaimTypes.AvatarUrl, "headimgurl"); + ClaimActions.MapCustomJson(AbpWeChatClaimTypes.Privilege, user => + { + return string.Join(",", user.GetStrings("privilege")); + }); } } diff --git a/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.WeChat/Microsoft/AspNetCore/Authentication/WeChat/Official/WeChatOfficialStateCacheItem.cs b/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.WeChat/Microsoft/AspNetCore/Authentication/WeChat/Official/WeChatOfficialStateCacheItem.cs index e8c5eb5e8..3b169ff82 100644 --- a/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.WeChat/Microsoft/AspNetCore/Authentication/WeChat/Official/WeChatOfficialStateCacheItem.cs +++ b/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.WeChat/Microsoft/AspNetCore/Authentication/WeChat/Official/WeChatOfficialStateCacheItem.cs @@ -1,18 +1,17 @@ -namespace Microsoft.AspNetCore.Authentication.WeChat.Official +namespace Microsoft.AspNetCore.Authentication.WeChat.Official; + +public class WeChatOfficialStateCacheItem { - public class WeChatOfficialStateCacheItem - { - public string State { get; set; } + public string State { get; set; } - public WeChatOfficialStateCacheItem() { } - public WeChatOfficialStateCacheItem(string state) - { - State = state; - } + public WeChatOfficialStateCacheItem() { } + public WeChatOfficialStateCacheItem(string state) + { + State = state; + } - public static string CalculateCacheKey(string correlationId, string purpose) - { - return $"ci:{correlationId};p:{purpose ?? "null"}"; - } + public static string CalculateCacheKey(string correlationId, string purpose) + { + return $"ci:{correlationId};p:{purpose ?? "null"}"; } } diff --git a/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.WeChat/Microsoft/AspNetCore/Authentication/WeChatAuthenticationExtensions.cs b/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.WeChat/Microsoft/AspNetCore/Authentication/WeChatAuthenticationExtensions.cs index aa38ff2e4..44c7fa1d0 100644 --- a/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.WeChat/Microsoft/AspNetCore/Authentication/WeChatAuthenticationExtensions.cs +++ b/aspnet-core/framework/authentication/LINGYUN.Abp.Authentication.WeChat/Microsoft/AspNetCore/Authentication/WeChatAuthenticationExtensions.cs @@ -4,62 +4,61 @@ using Microsoft.Extensions.DependencyInjection; using System; -namespace Microsoft.AspNetCore.Authentication +namespace Microsoft.AspNetCore.Authentication; + +public static class WeChatAuthenticationExtensions { - public static class WeChatAuthenticationExtensions + /// + /// + public static AuthenticationBuilder AddWeChat( + this AuthenticationBuilder builder) { - /// - /// - public static AuthenticationBuilder AddWeChat( - this AuthenticationBuilder builder) - { - return builder - .AddWeChat( - AbpWeChatGlobalConsts.AuthenticationScheme, - AbpWeChatGlobalConsts.DisplayName, - options => { }); - } + return builder + .AddWeChat( + AbpWeChatGlobalConsts.AuthenticationScheme, + AbpWeChatGlobalConsts.DisplayName, + options => { }); + } - /// - /// - public static AuthenticationBuilder AddWeChat( - this AuthenticationBuilder builder, - Action configureOptions) - { - return builder - .AddWeChat( - AbpWeChatGlobalConsts.AuthenticationScheme, - AbpWeChatGlobalConsts.DisplayName, - configureOptions); - } + /// + /// + public static AuthenticationBuilder AddWeChat( + this AuthenticationBuilder builder, + Action configureOptions) + { + return builder + .AddWeChat( + AbpWeChatGlobalConsts.AuthenticationScheme, + AbpWeChatGlobalConsts.DisplayName, + configureOptions); + } - /// - /// - public static AuthenticationBuilder AddWeChat( - this AuthenticationBuilder builder, - string authenticationScheme, - Action configureOptions) - { - return builder - .AddWeChat( - authenticationScheme, - AbpAuthenticationWeChatConsts.DisplayName, - configureOptions); - } + /// + /// + public static AuthenticationBuilder AddWeChat( + this AuthenticationBuilder builder, + string authenticationScheme, + Action configureOptions) + { + return builder + .AddWeChat( + authenticationScheme, + AbpAuthenticationWeChatConsts.DisplayName, + configureOptions); + } - /// - /// - public static AuthenticationBuilder AddWeChat( - this AuthenticationBuilder builder, - string authenticationScheme, - string displayName, - Action configureOptions) - { - return builder - .AddOAuth( - authenticationScheme, - displayName, - configureOptions); - } + /// + /// + public static AuthenticationBuilder AddWeChat( + this AuthenticationBuilder builder, + string authenticationScheme, + string displayName, + Action configureOptions) + { + return builder + .AddOAuth( + authenticationScheme, + displayName, + configureOptions); } } diff --git a/aspnet-core/framework/authorization/LINGYUN.Abp.Authorization.OrganizationUnits/LINGYUN.Abp.Authorization.OrganizationUnits.csproj b/aspnet-core/framework/authorization/LINGYUN.Abp.Authorization.OrganizationUnits/LINGYUN.Abp.Authorization.OrganizationUnits.csproj index 4945248cf..eaff3600a 100644 --- a/aspnet-core/framework/authorization/LINGYUN.Abp.Authorization.OrganizationUnits/LINGYUN.Abp.Authorization.OrganizationUnits.csproj +++ b/aspnet-core/framework/authorization/LINGYUN.Abp.Authorization.OrganizationUnits/LINGYUN.Abp.Authorization.OrganizationUnits.csproj @@ -4,7 +4,14 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + enable + Nullable + LINGYUN.Abp.Authorization.OrganizationUnits + LINGYUN.Abp.Authorization.OrganizationUnits + false + false + false diff --git a/aspnet-core/framework/cli/LINGYUN.Abp.Cli/LINGYUN.Abp.Cli.csproj b/aspnet-core/framework/cli/LINGYUN.Abp.Cli/LINGYUN.Abp.Cli.csproj index b27f3a6f5..f0649589e 100644 --- a/aspnet-core/framework/cli/LINGYUN.Abp.Cli/LINGYUN.Abp.Cli.csproj +++ b/aspnet-core/framework/cli/LINGYUN.Abp.Cli/LINGYUN.Abp.Cli.csproj @@ -5,7 +5,7 @@ Exe net8.0 - 8.1.1 + 8.2.0 colin Use LINGYUN.MicroService.Templates command line true diff --git a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.SettingManagement/LINGYUN.Abp.Aliyun.SettingManagement.csproj b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.SettingManagement/LINGYUN.Abp.Aliyun.SettingManagement.csproj index 3a0994868..d3f169c21 100644 --- a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.SettingManagement/LINGYUN.Abp.Aliyun.SettingManagement.csproj +++ b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.SettingManagement/LINGYUN.Abp.Aliyun.SettingManagement.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.Aliyun.SettingManagement + LINGYUN.Abp.Aliyun.SettingManagement + false + false + false diff --git a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.SettingManagement/LINGYUN/Abp/Aliyun/SettingManagement/AbpAliyunSettingManagementModule.cs b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.SettingManagement/LINGYUN/Abp/Aliyun/SettingManagement/AbpAliyunSettingManagementModule.cs index 4bfd73992..184b40aea 100644 --- a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.SettingManagement/LINGYUN/Abp/Aliyun/SettingManagement/AbpAliyunSettingManagementModule.cs +++ b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.SettingManagement/LINGYUN/Abp/Aliyun/SettingManagement/AbpAliyunSettingManagementModule.cs @@ -7,36 +7,35 @@ using Volo.Abp.Modularity; using Volo.Abp.VirtualFileSystem; -namespace LINGYUN.Abp.Aliyun.SettingManagement +namespace LINGYUN.Abp.Aliyun.SettingManagement; + +[DependsOn( + typeof(AbpAliyunModule), + typeof(AbpAliyunSmsModule), + typeof(AbpAspNetCoreMvcModule))] +public class AbpAliyunSettingManagementModule : AbpModule { - [DependsOn( - typeof(AbpAliyunModule), - typeof(AbpAliyunSmsModule), - typeof(AbpAspNetCoreMvcModule))] - public class AbpAliyunSettingManagementModule : AbpModule + public override void PreConfigureServices(ServiceConfigurationContext context) { - public override void PreConfigureServices(ServiceConfigurationContext context) + PreConfigure(mvcBuilder => { - PreConfigure(mvcBuilder => - { - mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpAliyunSettingManagementModule).Assembly); - }); - } + mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpAliyunSettingManagementModule).Assembly); + }); + } - public override void ConfigureServices(ServiceConfigurationContext context) + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => { - Configure(options => - { - options.FileSets.AddEmbedded(); - }); + options.FileSets.AddEmbedded(); + }); - Configure(options => - { - options.Resources - .Get() - .AddBaseTypes(typeof(AbpUiResource)) - .AddVirtualJson("/LINGYUN/Abp/Aliyun/SettingManagement/Localization/Resources"); - }); - } + Configure(options => + { + options.Resources + .Get() + .AddBaseTypes(typeof(AbpUiResource)) + .AddVirtualJson("/LINGYUN/Abp/Aliyun/SettingManagement/Localization/Resources"); + }); } } diff --git a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.SettingManagement/LINGYUN/Abp/Aliyun/SettingManagement/AliyunSettingAppService.cs b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.SettingManagement/LINGYUN/Abp/Aliyun/SettingManagement/AliyunSettingAppService.cs index 9bf7ff4ac..1d9bcc629 100644 --- a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.SettingManagement/LINGYUN/Abp/Aliyun/SettingManagement/AliyunSettingAppService.cs +++ b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.SettingManagement/LINGYUN/Abp/Aliyun/SettingManagement/AliyunSettingAppService.cs @@ -11,192 +11,191 @@ using Volo.Abp.Settings; using ValueType = LINGYUN.Abp.SettingManagement.ValueType; -namespace LINGYUN.Abp.Aliyun.SettingManagement +namespace LINGYUN.Abp.Aliyun.SettingManagement; + +public class AliyunSettingAppService : ApplicationService, IAliyunSettingAppService { - public class AliyunSettingAppService : ApplicationService, IAliyunSettingAppService + protected ISettingManager SettingManager { get; } + protected IPermissionChecker PermissionChecker { get; } + protected ISettingDefinitionManager SettingDefinitionManager { get; } + + public AliyunSettingAppService( + ISettingManager settingManager, + IPermissionChecker permissionChecker, + ISettingDefinitionManager settingDefinitionManager) { - protected ISettingManager SettingManager { get; } - protected IPermissionChecker PermissionChecker { get; } - protected ISettingDefinitionManager SettingDefinitionManager { get; } - - public AliyunSettingAppService( - ISettingManager settingManager, - IPermissionChecker permissionChecker, - ISettingDefinitionManager settingDefinitionManager) - { - SettingManager = settingManager; - PermissionChecker = permissionChecker; - SettingDefinitionManager = settingDefinitionManager; - LocalizationResource = typeof(AliyunResource); - } + SettingManager = settingManager; + PermissionChecker = permissionChecker; + SettingDefinitionManager = settingDefinitionManager; + LocalizationResource = typeof(AliyunResource); + } - public async virtual Task GetAllForCurrentTenantAsync() - { - return await GetAllForProviderAsync(TenantSettingValueProvider.ProviderName, CurrentTenant.GetId().ToString()); - } + public async virtual Task GetAllForCurrentTenantAsync() + { + return await GetAllForProviderAsync(TenantSettingValueProvider.ProviderName, CurrentTenant.GetId().ToString()); + } - public async virtual Task GetAllForGlobalAsync() - { - return await GetAllForProviderAsync(GlobalSettingValueProvider.ProviderName, null); - } + public async virtual Task GetAllForGlobalAsync() + { + return await GetAllForProviderAsync(GlobalSettingValueProvider.ProviderName, null); + } - protected async virtual Task GetAllForProviderAsync(string providerName, string providerKey) + protected async virtual Task GetAllForProviderAsync(string providerName, string providerKey) + { + var settingGroups = new SettingGroupResult(); + + // 无权限返回空结果,直接报错的话,网关聚合会抛出异常 + if (await FeatureChecker.IsEnabledAsync(AliyunFeatureNames.Enable) && + await PermissionChecker.IsGrantedAsync(AliyunSettingPermissionNames.Settings)) { - var settingGroups = new SettingGroupResult(); + var aliyunSettingGroup = new SettingGroupDto(L["DisplayName:Aliyun"], L["Description:Aliyun"]); + #region 访问控制 + + var ramSetting = aliyunSettingGroup.AddSetting(L["DisplayName:Aliyun.RAM"], L["Description:Aliyun.RAM"]); + + ramSetting.AddDetail( + await SettingDefinitionManager.GetAsync(AliyunSettingNames.Authorization.RegionId), + StringLocalizerFactory, + await SettingManager.GetOrNullAsync(AliyunSettingNames.Authorization.RegionId, providerName, providerKey), + ValueType.Option, + providerName) + .AddOptions(GetAvailableRegionOptions()); + ramSetting.AddDetail( + await SettingDefinitionManager.GetAsync(AliyunSettingNames.Authorization.AccessKeyId), + StringLocalizerFactory, + await SettingManager.GetOrNullAsync(AliyunSettingNames.Authorization.AccessKeyId, providerName, providerKey), + ValueType.String, + providerName); + ramSetting.AddDetail( + await SettingDefinitionManager.GetAsync(AliyunSettingNames.Authorization.AccessKeySecret), + StringLocalizerFactory, + await SettingManager.GetOrNullAsync(AliyunSettingNames.Authorization.AccessKeySecret, providerName, providerKey), + ValueType.String, + providerName); + ramSetting.AddDetail( + await SettingDefinitionManager.GetAsync(AliyunSettingNames.Authorization.RamRoleArn), + StringLocalizerFactory, + await SettingManager.GetOrNullAsync(AliyunSettingNames.Authorization.RamRoleArn, providerName, providerKey), + ValueType.String, + providerName); + ramSetting.AddDetail( + await SettingDefinitionManager.GetAsync(AliyunSettingNames.Authorization.RoleSessionName), + StringLocalizerFactory, + await SettingManager.GetOrNullAsync(AliyunSettingNames.Authorization.RoleSessionName, providerName, providerKey), + ValueType.String, + providerName); + ramSetting.AddDetail( + await SettingDefinitionManager.GetAsync(AliyunSettingNames.Authorization.Policy), + StringLocalizerFactory, + await SettingManager.GetOrNullAsync(AliyunSettingNames.Authorization.Policy, providerName, providerKey), + ValueType.String, + providerName); + ramSetting.AddDetail( + await SettingDefinitionManager.GetAsync(AliyunSettingNames.Authorization.UseSecurityTokenService), + StringLocalizerFactory, + await SettingManager.GetOrNullAsync(AliyunSettingNames.Authorization.UseSecurityTokenService, providerName, providerKey), + ValueType.Boolean, + providerName); + ramSetting.AddDetail( + await SettingDefinitionManager.GetAsync(AliyunSettingNames.Authorization.DurationSeconds), + StringLocalizerFactory, + await SettingManager.GetOrNullAsync(AliyunSettingNames.Authorization.DurationSeconds, providerName, providerKey), + ValueType.Number, + providerName); - // 无权限返回空结果,直接报错的话,网关聚合会抛出异常 - if (await FeatureChecker.IsEnabledAsync(AliyunFeatureNames.Enable) && - await PermissionChecker.IsGrantedAsync(AliyunSettingPermissionNames.Settings)) + #endregion + + #region 短信 + + if (await FeatureChecker.IsEnabledAsync(AliyunFeatureNames.Sms.Enable)) { - var aliyunSettingGroup = new SettingGroupDto(L["DisplayName:Aliyun"], L["Description:Aliyun"]); - #region 访问控制 - - var ramSetting = aliyunSettingGroup.AddSetting(L["DisplayName:Aliyun.RAM"], L["Description:Aliyun.RAM"]); - - ramSetting.AddDetail( - await SettingDefinitionManager.GetAsync(AliyunSettingNames.Authorization.RegionId), - StringLocalizerFactory, - await SettingManager.GetOrNullAsync(AliyunSettingNames.Authorization.RegionId, providerName, providerKey), - ValueType.Option, - providerName) - .AddOptions(GetAvailableRegionOptions()); - ramSetting.AddDetail( - await SettingDefinitionManager.GetAsync(AliyunSettingNames.Authorization.AccessKeyId), - StringLocalizerFactory, - await SettingManager.GetOrNullAsync(AliyunSettingNames.Authorization.AccessKeyId, providerName, providerKey), - ValueType.String, + var smsSetting = aliyunSettingGroup.AddSetting(L["DisplayName:Aliyun.Sms"], L["Description:Aliyun.Sms"]); + smsSetting.AddDetail( + await SettingDefinitionManager.GetAsync(AliyunSettingNames.Sms.Domain), + StringLocalizerFactory, + await SettingManager.GetOrNullAsync(AliyunSettingNames.Sms.Domain, providerName, providerKey), + ValueType.String, providerName); - ramSetting.AddDetail( - await SettingDefinitionManager.GetAsync(AliyunSettingNames.Authorization.AccessKeySecret), - StringLocalizerFactory, - await SettingManager.GetOrNullAsync(AliyunSettingNames.Authorization.AccessKeySecret, providerName, providerKey), - ValueType.String, + smsSetting.AddDetail( + await SettingDefinitionManager.GetAsync(AliyunSettingNames.Sms.Version), + StringLocalizerFactory, + await SettingManager.GetOrNullAsync(AliyunSettingNames.Sms.Version, providerName, providerKey), + ValueType.String, providerName); - ramSetting.AddDetail( - await SettingDefinitionManager.GetAsync(AliyunSettingNames.Authorization.RamRoleArn), - StringLocalizerFactory, - await SettingManager.GetOrNullAsync(AliyunSettingNames.Authorization.RamRoleArn, providerName, providerKey), - ValueType.String, + smsSetting.AddDetail( + await SettingDefinitionManager.GetAsync(AliyunSettingNames.Sms.ActionName), + StringLocalizerFactory, + await SettingManager.GetOrNullAsync(AliyunSettingNames.Sms.ActionName, providerName, providerKey), + ValueType.String, providerName); - ramSetting.AddDetail( - await SettingDefinitionManager.GetAsync(AliyunSettingNames.Authorization.RoleSessionName), - StringLocalizerFactory, - await SettingManager.GetOrNullAsync(AliyunSettingNames.Authorization.RoleSessionName, providerName, providerKey), - ValueType.String, + smsSetting.AddDetail( + await SettingDefinitionManager.GetAsync(AliyunSettingNames.Sms.DefaultPhoneNumber), + StringLocalizerFactory, + await SettingManager.GetOrNullAsync(AliyunSettingNames.Sms.DefaultPhoneNumber, providerName, providerKey), + ValueType.String, providerName); - ramSetting.AddDetail( - await SettingDefinitionManager.GetAsync(AliyunSettingNames.Authorization.Policy), - StringLocalizerFactory, - await SettingManager.GetOrNullAsync(AliyunSettingNames.Authorization.Policy, providerName, providerKey), - ValueType.String, + smsSetting.AddDetail( + await SettingDefinitionManager.GetAsync(AliyunSettingNames.Sms.DefaultSignName), + StringLocalizerFactory, + await SettingManager.GetOrNullAsync(AliyunSettingNames.Sms.DefaultSignName, providerName, providerKey), + ValueType.String, providerName); - ramSetting.AddDetail( - await SettingDefinitionManager.GetAsync(AliyunSettingNames.Authorization.UseSecurityTokenService), - StringLocalizerFactory, - await SettingManager.GetOrNullAsync(AliyunSettingNames.Authorization.UseSecurityTokenService, providerName, providerKey), - ValueType.Boolean, + smsSetting.AddDetail( + await SettingDefinitionManager.GetAsync(AliyunSettingNames.Sms.DefaultTemplateCode), + StringLocalizerFactory, + await SettingManager.GetOrNullAsync(AliyunSettingNames.Sms.DefaultTemplateCode, providerName, providerKey), + ValueType.String, providerName); - ramSetting.AddDetail( - await SettingDefinitionManager.GetAsync(AliyunSettingNames.Authorization.DurationSeconds), - StringLocalizerFactory, - await SettingManager.GetOrNullAsync(AliyunSettingNames.Authorization.DurationSeconds, providerName, providerKey), - ValueType.Number, + smsSetting.AddDetail( + await SettingDefinitionManager.GetAsync(AliyunSettingNames.Sms.VisableErrorToClient), + StringLocalizerFactory, + await SettingManager.GetOrNullAsync(AliyunSettingNames.Sms.VisableErrorToClient, providerName, providerKey), + ValueType.Boolean, providerName); - - #endregion - - #region 短信 - - if (await FeatureChecker.IsEnabledAsync(AliyunFeatureNames.Sms.Enable)) - { - var smsSetting = aliyunSettingGroup.AddSetting(L["DisplayName:Aliyun.Sms"], L["Description:Aliyun.Sms"]); - smsSetting.AddDetail( - await SettingDefinitionManager.GetAsync(AliyunSettingNames.Sms.Domain), - StringLocalizerFactory, - await SettingManager.GetOrNullAsync(AliyunSettingNames.Sms.Domain, providerName, providerKey), - ValueType.String, - providerName); - smsSetting.AddDetail( - await SettingDefinitionManager.GetAsync(AliyunSettingNames.Sms.Version), - StringLocalizerFactory, - await SettingManager.GetOrNullAsync(AliyunSettingNames.Sms.Version, providerName, providerKey), - ValueType.String, - providerName); - smsSetting.AddDetail( - await SettingDefinitionManager.GetAsync(AliyunSettingNames.Sms.ActionName), - StringLocalizerFactory, - await SettingManager.GetOrNullAsync(AliyunSettingNames.Sms.ActionName, providerName, providerKey), - ValueType.String, - providerName); - smsSetting.AddDetail( - await SettingDefinitionManager.GetAsync(AliyunSettingNames.Sms.DefaultPhoneNumber), - StringLocalizerFactory, - await SettingManager.GetOrNullAsync(AliyunSettingNames.Sms.DefaultPhoneNumber, providerName, providerKey), - ValueType.String, - providerName); - smsSetting.AddDetail( - await SettingDefinitionManager.GetAsync(AliyunSettingNames.Sms.DefaultSignName), - StringLocalizerFactory, - await SettingManager.GetOrNullAsync(AliyunSettingNames.Sms.DefaultSignName, providerName, providerKey), - ValueType.String, - providerName); - smsSetting.AddDetail( - await SettingDefinitionManager.GetAsync(AliyunSettingNames.Sms.DefaultTemplateCode), - StringLocalizerFactory, - await SettingManager.GetOrNullAsync(AliyunSettingNames.Sms.DefaultTemplateCode, providerName, providerKey), - ValueType.String, - providerName); - smsSetting.AddDetail( - await SettingDefinitionManager.GetAsync(AliyunSettingNames.Sms.VisableErrorToClient), - StringLocalizerFactory, - await SettingManager.GetOrNullAsync(AliyunSettingNames.Sms.VisableErrorToClient, providerName, providerKey), - ValueType.Boolean, - providerName); - } - - #endregion - - settingGroups.AddGroup(aliyunSettingGroup); } - return settingGroups; + #endregion + + settingGroups.AddGroup(aliyunSettingGroup); } - protected virtual IEnumerable GetAvailableRegionOptions() + return settingGroups; + } + + protected virtual IEnumerable GetAvailableRegionOptions() + { + return new OptionDto[] { - return new OptionDto[] - { - new OptionDto(L["Region:HangZhou"], "oss-cn-hangzhou"), - new OptionDto(L["Region:ShangHai"], "oss-cn-shanghai"), - new OptionDto(L["Region:NanJing"], "oss-cn-nanjing"), - new OptionDto(L["Region:FuZhou"], "oss-cn-fuzhou"), - new OptionDto(L["Region:WuHan"], "oss-cn-wuhan"), - new OptionDto(L["Region:QingDao"], "oss-cn-qingdao"), - new OptionDto(L["Region:BeiJing"], "oss-cn-beijing"), - new OptionDto(L["Region:ZhangJiaKou"], "oss-cn-zhangjiakou"), - new OptionDto(L["Region:HuHeHaoTe"], "oss-cn-huhehaote"), - new OptionDto(L["Region:WuLanChaBu"], "oss-cn-wulanchabu"), - new OptionDto(L["Region:ShenZhen"], "oss-cn-shenzhen"), - new OptionDto(L["Region:HeYuan"], "oss-cn-heyuan"), - new OptionDto(L["Region:GuangZhou"], "oss-cn-guangzhou"), - new OptionDto(L["Region:ChengDu"], "oss-cn-chengdu"), - new OptionDto(L["Region:HongKong"], "oss-cn-hongkong"), - new OptionDto(L["Region:SiliconValley"], "oss-us-west-1"), - new OptionDto(L["Region:Virginia"], "oss-us-east-1"), - new OptionDto(L["Region:Tokoyo"], "oss-ap-northeast-1"), - new OptionDto(L["Region:Seoul"], "oss-ap-northeast-2"), - new OptionDto(L["Region:Singapore"], "oss-ap-southeast-1"), - new OptionDto(L["Region:Sydney"], "oss-ap-southeast-2"), - new OptionDto(L["Region:KualaLumpur"], "oss-ap-southeast-3"), - new OptionDto(L["Region:Jakarta"], "oss-ap-southeast-5"), - new OptionDto(L["Region:Manila"], "oss-ap-southeast-6"), - new OptionDto(L["Region:Bangkok"], "oss-ap-southeast-7"), - new OptionDto(L["Region:Bombay"], "oss-ap-south-1"), - new OptionDto(L["Region:Frankfurt"], "oss-eu-central-1"), - new OptionDto(L["Region:London"], "oss-eu-west-1"), - new OptionDto(L["Region:Dubai"], "oss-me-east-1"), - new OptionDto(L["Region:MainLand"], "oss-rg-china-mainland"), - }; - } + new OptionDto(L["Region:HangZhou"], "oss-cn-hangzhou"), + new OptionDto(L["Region:ShangHai"], "oss-cn-shanghai"), + new OptionDto(L["Region:NanJing"], "oss-cn-nanjing"), + new OptionDto(L["Region:FuZhou"], "oss-cn-fuzhou"), + new OptionDto(L["Region:WuHan"], "oss-cn-wuhan"), + new OptionDto(L["Region:QingDao"], "oss-cn-qingdao"), + new OptionDto(L["Region:BeiJing"], "oss-cn-beijing"), + new OptionDto(L["Region:ZhangJiaKou"], "oss-cn-zhangjiakou"), + new OptionDto(L["Region:HuHeHaoTe"], "oss-cn-huhehaote"), + new OptionDto(L["Region:WuLanChaBu"], "oss-cn-wulanchabu"), + new OptionDto(L["Region:ShenZhen"], "oss-cn-shenzhen"), + new OptionDto(L["Region:HeYuan"], "oss-cn-heyuan"), + new OptionDto(L["Region:GuangZhou"], "oss-cn-guangzhou"), + new OptionDto(L["Region:ChengDu"], "oss-cn-chengdu"), + new OptionDto(L["Region:HongKong"], "oss-cn-hongkong"), + new OptionDto(L["Region:SiliconValley"], "oss-us-west-1"), + new OptionDto(L["Region:Virginia"], "oss-us-east-1"), + new OptionDto(L["Region:Tokoyo"], "oss-ap-northeast-1"), + new OptionDto(L["Region:Seoul"], "oss-ap-northeast-2"), + new OptionDto(L["Region:Singapore"], "oss-ap-southeast-1"), + new OptionDto(L["Region:Sydney"], "oss-ap-southeast-2"), + new OptionDto(L["Region:KualaLumpur"], "oss-ap-southeast-3"), + new OptionDto(L["Region:Jakarta"], "oss-ap-southeast-5"), + new OptionDto(L["Region:Manila"], "oss-ap-southeast-6"), + new OptionDto(L["Region:Bangkok"], "oss-ap-southeast-7"), + new OptionDto(L["Region:Bombay"], "oss-ap-south-1"), + new OptionDto(L["Region:Frankfurt"], "oss-eu-central-1"), + new OptionDto(L["Region:London"], "oss-eu-west-1"), + new OptionDto(L["Region:Dubai"], "oss-me-east-1"), + new OptionDto(L["Region:MainLand"], "oss-rg-china-mainland"), + }; } } diff --git a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.SettingManagement/LINGYUN/Abp/Aliyun/SettingManagement/AliyunSettingController.cs b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.SettingManagement/LINGYUN/Abp/Aliyun/SettingManagement/AliyunSettingController.cs index 014d9986d..de2352c9d 100644 --- a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.SettingManagement/LINGYUN/Abp/Aliyun/SettingManagement/AliyunSettingController.cs +++ b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.SettingManagement/LINGYUN/Abp/Aliyun/SettingManagement/AliyunSettingController.cs @@ -4,33 +4,32 @@ using Volo.Abp; using Volo.Abp.AspNetCore.Mvc; -namespace LINGYUN.Abp.Aliyun.SettingManagement +namespace LINGYUN.Abp.Aliyun.SettingManagement; + +[RemoteService(Name = AbpSettingManagementRemoteServiceConsts.RemoteServiceName)] +[Area("settingManagement")] +[Route("api/setting-management/aliyun")] +public class AliyunSettingController : AbpControllerBase, IAliyunSettingAppService { - [RemoteService(Name = AbpSettingManagementRemoteServiceConsts.RemoteServiceName)] - [Area("settingManagement")] - [Route("api/setting-management/aliyun")] - public class AliyunSettingController : AbpControllerBase, IAliyunSettingAppService - { - protected IAliyunSettingAppService AppService { get; } + protected IAliyunSettingAppService AppService { get; } - public AliyunSettingController( - IAliyunSettingAppService appService) - { - AppService = appService; - } + public AliyunSettingController( + IAliyunSettingAppService appService) + { + AppService = appService; + } - [HttpGet] - [Route("by-current-tenant")] - public async virtual Task GetAllForCurrentTenantAsync() - { - return await AppService.GetAllForCurrentTenantAsync(); - } + [HttpGet] + [Route("by-current-tenant")] + public async virtual Task GetAllForCurrentTenantAsync() + { + return await AppService.GetAllForCurrentTenantAsync(); + } - [HttpGet] - [Route("by-global")] - public async virtual Task GetAllForGlobalAsync() - { - return await AppService.GetAllForGlobalAsync(); - } + [HttpGet] + [Route("by-global")] + public async virtual Task GetAllForGlobalAsync() + { + return await AppService.GetAllForGlobalAsync(); } } diff --git a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.SettingManagement/LINGYUN/Abp/Aliyun/SettingManagement/AliyunSettingPermissionDefinitionProvider.cs b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.SettingManagement/LINGYUN/Abp/Aliyun/SettingManagement/AliyunSettingPermissionDefinitionProvider.cs index 8ac602476..b90e9c3a6 100644 --- a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.SettingManagement/LINGYUN/Abp/Aliyun/SettingManagement/AliyunSettingPermissionDefinitionProvider.cs +++ b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.SettingManagement/LINGYUN/Abp/Aliyun/SettingManagement/AliyunSettingPermissionDefinitionProvider.cs @@ -2,23 +2,22 @@ using Volo.Abp.Authorization.Permissions; using Volo.Abp.Localization; -namespace LINGYUN.Abp.Aliyun.SettingManagement +namespace LINGYUN.Abp.Aliyun.SettingManagement; + +public class AliyunSettingPermissionDefinitionProvider : PermissionDefinitionProvider { - public class AliyunSettingPermissionDefinitionProvider : PermissionDefinitionProvider + public override void Define(IPermissionDefinitionContext context) { - public override void Define(IPermissionDefinitionContext context) - { - var wechatGroup = context.AddGroup( - AliyunSettingPermissionNames.GroupName, - L("Permission:Aliyun")); + var wechatGroup = context.AddGroup( + AliyunSettingPermissionNames.GroupName, + L("Permission:Aliyun")); - wechatGroup.AddPermission( - AliyunSettingPermissionNames.Settings, L("Permission:Aliyun.Settings")); - } + wechatGroup.AddPermission( + AliyunSettingPermissionNames.Settings, L("Permission:Aliyun.Settings")); + } - protected LocalizableString L(string name) - { - return LocalizableString.Create(name); - } + protected LocalizableString L(string name) + { + return LocalizableString.Create(name); } } diff --git a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.SettingManagement/LINGYUN/Abp/Aliyun/SettingManagement/AliyunSettingPermissionNames.cs b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.SettingManagement/LINGYUN/Abp/Aliyun/SettingManagement/AliyunSettingPermissionNames.cs index 4a277157a..e56557c92 100644 --- a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.SettingManagement/LINGYUN/Abp/Aliyun/SettingManagement/AliyunSettingPermissionNames.cs +++ b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.SettingManagement/LINGYUN/Abp/Aliyun/SettingManagement/AliyunSettingPermissionNames.cs @@ -1,9 +1,8 @@ -namespace LINGYUN.Abp.Aliyun.SettingManagement +namespace LINGYUN.Abp.Aliyun.SettingManagement; + +public class AliyunSettingPermissionNames { - public class AliyunSettingPermissionNames - { - public const string GroupName = "Abp.Aliyun"; + public const string GroupName = "Abp.Aliyun"; - public const string Settings = GroupName + ".Settings"; - } + public const string Settings = GroupName + ".Settings"; } diff --git a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.SettingManagement/LINGYUN/Abp/Aliyun/SettingManagement/IAliyunSettingAppService.cs b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.SettingManagement/LINGYUN/Abp/Aliyun/SettingManagement/IAliyunSettingAppService.cs index 1a2756a42..a29674d38 100644 --- a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.SettingManagement/LINGYUN/Abp/Aliyun/SettingManagement/IAliyunSettingAppService.cs +++ b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun.SettingManagement/LINGYUN/Abp/Aliyun/SettingManagement/IAliyunSettingAppService.cs @@ -1,8 +1,7 @@ using LINGYUN.Abp.SettingManagement; -namespace LINGYUN.Abp.Aliyun.SettingManagement +namespace LINGYUN.Abp.Aliyun.SettingManagement; + +public interface IAliyunSettingAppService : IReadonlySettingAppService { - public interface IAliyunSettingAppService : IReadonlySettingAppService - { - } } diff --git a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN.Abp.Aliyun.csproj b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN.Abp.Aliyun.csproj index eefdbc878..7ec8c755a 100644 --- a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN.Abp.Aliyun.csproj +++ b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN.Abp.Aliyun.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Aliyun + LINGYUN.Abp.Aliyun + false + false + false 阿里云SDK基础框架 diff --git a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/AbpAliyunException.cs b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/AbpAliyunException.cs index 0ea3920d0..1ab9d4eb7 100644 --- a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/AbpAliyunException.cs +++ b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/AbpAliyunException.cs @@ -3,19 +3,18 @@ using Volo.Abp.ExceptionHandling; using Volo.Abp.Logging; -namespace LINGYUN.Abp.Aliyun +namespace LINGYUN.Abp.Aliyun; + +public class AbpAliyunException : AbpException, IHasErrorCode, IHasLogLevel { - public class AbpAliyunException : AbpException, IHasErrorCode, IHasLogLevel - { - public LogLevel LogLevel { get; set; } + public LogLevel LogLevel { get; set; } - public string Code { get; } + public string Code { get; } - public AbpAliyunException(string code, string message) - : base(message) - { - Code = code; - LogLevel = LogLevel.Warning; - } + public AbpAliyunException(string code, string message) + : base(message) + { + Code = code; + LogLevel = LogLevel.Warning; } } diff --git a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/AbpAliyunModule.cs b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/AbpAliyunModule.cs index 0b0ffd5d0..fde951a85 100644 --- a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/AbpAliyunModule.cs +++ b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/AbpAliyunModule.cs @@ -7,29 +7,28 @@ using Volo.Abp.Settings; using Volo.Abp.VirtualFileSystem; -namespace LINGYUN.Abp.Aliyun +namespace LINGYUN.Abp.Aliyun; + +[DependsOn( + typeof(AbpCachingModule), + typeof(AbpSettingsModule), + typeof(AbpJsonModule), + typeof(AbpLocalizationModule), + typeof(AbpFeaturesLimitValidationModule))] +public class AbpAliyunModule : AbpModule { - [DependsOn( - typeof(AbpCachingModule), - typeof(AbpSettingsModule), - typeof(AbpJsonModule), - typeof(AbpLocalizationModule), - typeof(AbpFeaturesLimitValidationModule))] - public class AbpAliyunModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + Configure(options => { - Configure(options => - { - options.FileSets.AddEmbedded(); - }); + options.FileSets.AddEmbedded(); + }); - Configure(options => - { - options.Resources - .Add("zh-Hans") // 中国区云服务,默认使用简体中文 - .AddVirtualJson("/LINGYUN/Abp/Aliyun/Localization/Resources"); - }); - } + Configure(options => + { + options.Resources + .Add("zh-Hans") // 中国区云服务,默认使用简体中文 + .AddVirtualJson("/LINGYUN/Abp/Aliyun/Localization/Resources"); + }); } } diff --git a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/AcsClientFactory.cs b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/AcsClientFactory.cs index da868a1db..4401aee25 100644 --- a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/AcsClientFactory.cs +++ b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/AcsClientFactory.cs @@ -7,29 +7,28 @@ using Volo.Abp.Features; using Volo.Abp.Settings; -namespace LINGYUN.Abp.Aliyun +namespace LINGYUN.Abp.Aliyun; + +[RequiresFeature(AliyunFeatureNames.Enable)] +public class AcsClientFactory : AliyunClientFactory, IAcsClientFactory, ITransientDependency { - [RequiresFeature(AliyunFeatureNames.Enable)] - public class AcsClientFactory : AliyunClientFactory, IAcsClientFactory, ITransientDependency + public AcsClientFactory( + ISettingProvider settingProvider, + IDistributedCache cache) + : base(settingProvider, cache) { - public AcsClientFactory( - ISettingProvider settingProvider, - IDistributedCache cache) - : base(settingProvider, cache) - { - } + } - protected override IAcsClient GetClient(string regionId, string accessKeyId, string accessKeySecret) - { - return new DefaultAcsClient( - DefaultProfile.GetProfile(regionId, accessKeyId, accessKeySecret)); - } + protected override IAcsClient GetClient(string regionId, string accessKeyId, string accessKeySecret) + { + return new DefaultAcsClient( + DefaultProfile.GetProfile(regionId, accessKeyId, accessKeySecret)); + } - protected override IAcsClient GetSecurityTokenClient(string regionId, string accessKeyId, string accessKeySecret, string securityToken) - { - var profile = DefaultProfile.GetProfile(regionId); - var credentials = new BasicSessionCredentials(accessKeyId, accessKeySecret, securityToken); - return new DefaultAcsClient(profile, credentials); - } + protected override IAcsClient GetSecurityTokenClient(string regionId, string accessKeyId, string accessKeySecret, string securityToken) + { + var profile = DefaultProfile.GetProfile(regionId); + var credentials = new BasicSessionCredentials(accessKeyId, accessKeySecret, securityToken); + return new DefaultAcsClient(profile, credentials); } } diff --git a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/AliyunBasicSessionCredentialsCacheItem.cs b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/AliyunBasicSessionCredentialsCacheItem.cs index bcb58b284..41630d221 100644 --- a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/AliyunBasicSessionCredentialsCacheItem.cs +++ b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/AliyunBasicSessionCredentialsCacheItem.cs @@ -1,31 +1,30 @@ using System; -namespace LINGYUN.Abp.Aliyun +namespace LINGYUN.Abp.Aliyun; + +[Serializable] +public class AliyunBasicSessionCredentialsCacheItem { - [Serializable] - public class AliyunBasicSessionCredentialsCacheItem - { - private readonly static string _cacheKey; - public static string CacheKey => _cacheKey; - public string AccessKeyId { get; set; } - public string AccessKeySecret { get; set; } - public string SecurityToken { get; set; } + private readonly static string _cacheKey; + public static string CacheKey => _cacheKey; + public string AccessKeyId { get; set; } + public string AccessKeySecret { get; set; } + public string SecurityToken { get; set; } - static AliyunBasicSessionCredentialsCacheItem() - { - _cacheKey = Guid.NewGuid().ToString("N"); - } + static AliyunBasicSessionCredentialsCacheItem() + { + _cacheKey = Guid.NewGuid().ToString("N"); + } - public AliyunBasicSessionCredentialsCacheItem() - { + public AliyunBasicSessionCredentialsCacheItem() + { - } + } - public AliyunBasicSessionCredentialsCacheItem(string accessKeyId, string accessKeySecret, string securityToken) - { - AccessKeyId = accessKeyId; - AccessKeySecret = accessKeySecret; - SecurityToken = securityToken; - } + public AliyunBasicSessionCredentialsCacheItem(string accessKeyId, string accessKeySecret, string securityToken) + { + AccessKeyId = accessKeyId; + AccessKeySecret = accessKeySecret; + SecurityToken = securityToken; } } diff --git a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/AliyunClientFactory.cs b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/AliyunClientFactory.cs index 674db8854..b271a583c 100644 --- a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/AliyunClientFactory.cs +++ b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/AliyunClientFactory.cs @@ -10,171 +10,170 @@ using Volo.Abp.Caching; using Volo.Abp.Settings; -namespace LINGYUN.Abp.Aliyun +namespace LINGYUN.Abp.Aliyun; + +/// +/// 阿里云通用客户端构建工厂 +/// +/// +public abstract class AliyunClientFactory { - /// - /// 阿里云通用客户端构建工厂 - /// - /// - public abstract class AliyunClientFactory + protected ISettingProvider SettingProvider { get; } + protected IDistributedCache Cache { get; } + public AliyunClientFactory( + ISettingProvider settingProvider, + IDistributedCache cache) { - protected ISettingProvider SettingProvider { get; } - protected IDistributedCache Cache { get; } - public AliyunClientFactory( - ISettingProvider settingProvider, - IDistributedCache cache) - { - Cache = cache; - SettingProvider = settingProvider; - } - - public async virtual Task CreateAsync() - { - var regionId = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.RegionId); - var accessKey = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.AccessKeyId); - var accessKeySecret = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.AccessKeySecret); + Cache = cache; + SettingProvider = settingProvider; + } - Check.NotNullOrWhiteSpace(regionId, AliyunSettingNames.Authorization.RegionId); - Check.NotNullOrWhiteSpace(accessKey, AliyunSettingNames.Authorization.AccessKeyId); - Check.NotNullOrWhiteSpace(accessKeySecret, AliyunSettingNames.Authorization.AccessKeySecret); + public async virtual Task CreateAsync() + { + var regionId = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.RegionId); + var accessKey = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.AccessKeyId); + var accessKeySecret = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.AccessKeySecret); - if (await SettingProvider.IsTrueAsync(AliyunSettingNames.Authorization.UseSecurityTokenService)) - { - var cacheItem = await GetCacheItemAsync(accessKey, accessKeySecret, regionId); + Check.NotNullOrWhiteSpace(regionId, AliyunSettingNames.Authorization.RegionId); + Check.NotNullOrWhiteSpace(accessKey, AliyunSettingNames.Authorization.AccessKeyId); + Check.NotNullOrWhiteSpace(accessKeySecret, AliyunSettingNames.Authorization.AccessKeySecret); - return GetSecurityTokenClient(regionId, cacheItem.AccessKeyId, cacheItem.AccessKeySecret, cacheItem.SecurityToken); - } + if (await SettingProvider.IsTrueAsync(AliyunSettingNames.Authorization.UseSecurityTokenService)) + { + var cacheItem = await GetCacheItemAsync(accessKey, accessKeySecret, regionId); - return GetClient(regionId, accessKey, accessKeySecret); + return GetSecurityTokenClient(regionId, cacheItem.AccessKeyId, cacheItem.AccessKeySecret, cacheItem.SecurityToken); } - protected abstract TClient GetClient(string regionId, string accessKeyId, string accessKeySecret); + return GetClient(regionId, accessKey, accessKeySecret); + } + + protected abstract TClient GetClient(string regionId, string accessKeyId, string accessKeySecret); - protected abstract TClient GetSecurityTokenClient(string regionId, string accessKeyId, string accessKeySecret, string securityToken); + protected abstract TClient GetSecurityTokenClient(string regionId, string accessKeyId, string accessKeySecret, string securityToken); - protected async virtual Task GetCacheItemAsync(string accessKeyId, string accessKeySecret, string regionId) + protected async virtual Task GetCacheItemAsync(string accessKeyId, string accessKeySecret, string regionId) + { + var cacheItem = await Cache.GetAsync(AliyunBasicSessionCredentialsCacheItem.CacheKey); + if (cacheItem == null) { - var cacheItem = await Cache.GetAsync(AliyunBasicSessionCredentialsCacheItem.CacheKey); - if (cacheItem == null) - { - var roleArn = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.RamRoleArn); - var roleSession = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.RoleSessionName); - Check.NotNullOrWhiteSpace(roleArn, AliyunSettingNames.Authorization.RamRoleArn); + var roleArn = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.RamRoleArn); + var roleSession = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.RoleSessionName); + Check.NotNullOrWhiteSpace(roleArn, AliyunSettingNames.Authorization.RamRoleArn); - var policy = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.Policy); - var durationSeconds = await SettingProvider.GetAsync(AliyunSettingNames.Authorization.DurationSeconds, 3000); + var policy = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.Policy); + var durationSeconds = await SettingProvider.GetAsync(AliyunSettingNames.Authorization.DurationSeconds, 3000); - var profile = DefaultProfile.GetProfile(regionId, accessKeyId, accessKeySecret); - var request = new AssumeRoleRequest + var profile = DefaultProfile.GetProfile(regionId, accessKeyId, accessKeySecret); + var request = new AssumeRoleRequest + { + AcceptFormat = FormatType.JSON, + RoleArn = roleArn, + RoleSessionName = roleSession, + DurationSeconds = durationSeconds, + Policy = policy.IsNullOrWhiteSpace() ? null : policy + }; + + var client = new DefaultAcsClient(profile); + var response = client.GetAcsResponse(request); + + cacheItem = new AliyunBasicSessionCredentialsCacheItem( + response.Credentials.AccessKeyId, + response.Credentials.AccessKeySecret, + response.Credentials.SecurityToken); + + await Cache.SetAsync( + AliyunBasicSessionCredentialsCacheItem.CacheKey, + cacheItem, + new DistributedCacheEntryOptions { - AcceptFormat = FormatType.JSON, - RoleArn = roleArn, - RoleSessionName = roleSession, - DurationSeconds = durationSeconds, - Policy = policy.IsNullOrWhiteSpace() ? null : policy - }; - - var client = new DefaultAcsClient(profile); - var response = client.GetAcsResponse(request); - - cacheItem = new AliyunBasicSessionCredentialsCacheItem( - response.Credentials.AccessKeyId, - response.Credentials.AccessKeySecret, - response.Credentials.SecurityToken); - - await Cache.SetAsync( - AliyunBasicSessionCredentialsCacheItem.CacheKey, - cacheItem, - new DistributedCacheEntryOptions - { - AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(durationSeconds - 10) - }); - } - - return cacheItem; + AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(durationSeconds - 10) + }); } + + return cacheItem; } - /// - /// 阿里云通用客户端构建工厂 - /// - /// 客户端类型 - /// 客户端参数类型 - public abstract class AliyunClientFactory +} +/// +/// 阿里云通用客户端构建工厂 +/// +/// 客户端类型 +/// 客户端参数类型 +public abstract class AliyunClientFactory +{ + protected ISettingProvider SettingProvider { get; } + protected IDistributedCache Cache { get; } + public AliyunClientFactory( + ISettingProvider settingProvider, + IDistributedCache cache) { - protected ISettingProvider SettingProvider { get; } - protected IDistributedCache Cache { get; } - public AliyunClientFactory( - ISettingProvider settingProvider, - IDistributedCache cache) - { - Cache = cache; - SettingProvider = settingProvider; - } - - public async virtual Task CreateAsync(TConfiguration configuration) - { - var regionId = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.RegionId); - var accessKey = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.AccessKeyId); - var accessKeySecret = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.AccessKeySecret); + Cache = cache; + SettingProvider = settingProvider; + } - Check.NotNullOrWhiteSpace(regionId, AliyunSettingNames.Authorization.RegionId); - Check.NotNullOrWhiteSpace(accessKey, AliyunSettingNames.Authorization.AccessKeyId); - Check.NotNullOrWhiteSpace(accessKeySecret, AliyunSettingNames.Authorization.AccessKeySecret); + public async virtual Task CreateAsync(TConfiguration configuration) + { + var regionId = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.RegionId); + var accessKey = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.AccessKeyId); + var accessKeySecret = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.AccessKeySecret); - if (await SettingProvider.IsTrueAsync(AliyunSettingNames.Authorization.UseSecurityTokenService)) - { - var cacheItem = await GetCacheItemAsync(accessKey, accessKeySecret, regionId); + Check.NotNullOrWhiteSpace(regionId, AliyunSettingNames.Authorization.RegionId); + Check.NotNullOrWhiteSpace(accessKey, AliyunSettingNames.Authorization.AccessKeyId); + Check.NotNullOrWhiteSpace(accessKeySecret, AliyunSettingNames.Authorization.AccessKeySecret); - return GetSecurityTokenClient(configuration, regionId, cacheItem.AccessKeyId, cacheItem.AccessKeySecret, cacheItem.SecurityToken); - } + if (await SettingProvider.IsTrueAsync(AliyunSettingNames.Authorization.UseSecurityTokenService)) + { + var cacheItem = await GetCacheItemAsync(accessKey, accessKeySecret, regionId); - return GetClient(configuration, regionId, accessKey, accessKeySecret); + return GetSecurityTokenClient(configuration, regionId, cacheItem.AccessKeyId, cacheItem.AccessKeySecret, cacheItem.SecurityToken); } - protected abstract TClient GetClient(TConfiguration configuration, string regionId, string accessKeyId, string accessKeySecret); + return GetClient(configuration, regionId, accessKey, accessKeySecret); + } + + protected abstract TClient GetClient(TConfiguration configuration, string regionId, string accessKeyId, string accessKeySecret); - protected abstract TClient GetSecurityTokenClient(TConfiguration configuration, string regionId, string accessKeyId, string accessKeySecret, string securityToken); + protected abstract TClient GetSecurityTokenClient(TConfiguration configuration, string regionId, string accessKeyId, string accessKeySecret, string securityToken); - protected async virtual Task GetCacheItemAsync(string accessKeyId, string accessKeySecret, string regionId) + protected async virtual Task GetCacheItemAsync(string accessKeyId, string accessKeySecret, string regionId) + { + var cacheItem = await Cache.GetAsync(AliyunBasicSessionCredentialsCacheItem.CacheKey); + if (cacheItem == null) { - var cacheItem = await Cache.GetAsync(AliyunBasicSessionCredentialsCacheItem.CacheKey); - if (cacheItem == null) - { - var roleArn = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.RamRoleArn); - var roleSession = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.RoleSessionName); - Check.NotNullOrWhiteSpace(roleArn, AliyunSettingNames.Authorization.RamRoleArn); + var roleArn = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.RamRoleArn); + var roleSession = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.RoleSessionName); + Check.NotNullOrWhiteSpace(roleArn, AliyunSettingNames.Authorization.RamRoleArn); - var policy = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.Policy); - var durationSeconds = await SettingProvider.GetAsync(AliyunSettingNames.Authorization.DurationSeconds, 3000); + var policy = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Authorization.Policy); + var durationSeconds = await SettingProvider.GetAsync(AliyunSettingNames.Authorization.DurationSeconds, 3000); - var profile = DefaultProfile.GetProfile(regionId, accessKeyId, accessKeySecret); - var request = new AssumeRoleRequest + var profile = DefaultProfile.GetProfile(regionId, accessKeyId, accessKeySecret); + var request = new AssumeRoleRequest + { + AcceptFormat = FormatType.JSON, + RoleArn = roleArn, + RoleSessionName = roleSession, + DurationSeconds = durationSeconds, + Policy = policy.IsNullOrWhiteSpace() ? null : policy + }; + + var client = new DefaultAcsClient(profile); + var response = client.GetAcsResponse(request); + + cacheItem = new AliyunBasicSessionCredentialsCacheItem( + response.Credentials.AccessKeyId, + response.Credentials.AccessKeySecret, + response.Credentials.SecurityToken); + + await Cache.SetAsync( + AliyunBasicSessionCredentialsCacheItem.CacheKey, + cacheItem, + new DistributedCacheEntryOptions { - AcceptFormat = FormatType.JSON, - RoleArn = roleArn, - RoleSessionName = roleSession, - DurationSeconds = durationSeconds, - Policy = policy.IsNullOrWhiteSpace() ? null : policy - }; - - var client = new DefaultAcsClient(profile); - var response = client.GetAcsResponse(request); - - cacheItem = new AliyunBasicSessionCredentialsCacheItem( - response.Credentials.AccessKeyId, - response.Credentials.AccessKeySecret, - response.Credentials.SecurityToken); - - await Cache.SetAsync( - AliyunBasicSessionCredentialsCacheItem.CacheKey, - cacheItem, - new DistributedCacheEntryOptions - { - AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(durationSeconds - 10) - }); - } - - return cacheItem; + AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(durationSeconds - 10) + }); } + + return cacheItem; } } diff --git a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/IAcsClientFactory.cs b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/IAcsClientFactory.cs index 4b552d879..bf81b77c1 100644 --- a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/IAcsClientFactory.cs +++ b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/IAcsClientFactory.cs @@ -1,15 +1,14 @@ using Aliyun.Acs.Core; using System.Threading.Tasks; -namespace LINGYUN.Abp.Aliyun +namespace LINGYUN.Abp.Aliyun; + +public interface IAcsClientFactory { - public interface IAcsClientFactory - { - /// - /// 构造一个通用的Acs客户端调用 - /// 通过CommonRequest调用可以不需要集成其他SDK包 - /// - /// - Task CreateAsync(); - } + /// + /// 构造一个通用的Acs客户端调用 + /// 通过CommonRequest调用可以不需要集成其他SDK包 + /// + /// + Task CreateAsync(); } diff --git a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/Localization/AliyunResource.cs b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/Localization/AliyunResource.cs index c340d2e4a..afc1c2445 100644 --- a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/Localization/AliyunResource.cs +++ b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/Localization/AliyunResource.cs @@ -1,9 +1,8 @@ using Volo.Abp.Localization; -namespace LINGYUN.Abp.Aliyun.Localization +namespace LINGYUN.Abp.Aliyun.Localization; + +[LocalizationResourceName("Aliyun")] +public class AliyunResource { - [LocalizationResourceName("Aliyun")] - public class AliyunResource - { - } } diff --git a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/Settings/AliyunSettingNames.cs b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/Settings/AliyunSettingNames.cs index fef2a1af2..0220a6ae2 100644 --- a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/Settings/AliyunSettingNames.cs +++ b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/Settings/AliyunSettingNames.cs @@ -1,83 +1,82 @@ -namespace LINGYUN.Abp.Aliyun.Settings +namespace LINGYUN.Abp.Aliyun.Settings; + +public static class AliyunSettingNames { - public static class AliyunSettingNames - { - public const string Prefix = "Abp.Aliyun"; + public const string Prefix = "Abp.Aliyun"; + /// + /// 认证方式 + /// + public class Authorization + { + public const string Prefix = AliyunSettingNames.Prefix + ".Authorization"; + /// + /// 地域ID + /// + public const string RegionId = Prefix + ".RegionId"; + /// + /// RAM账号的AccessKey ID + /// + public const string AccessKeyId = Prefix + ".AccessKeyId"; + /// + /// RAM账号的AccessKey Secret + /// + public const string AccessKeySecret = Prefix + ".AccessKeySecret"; + /// + /// 使用STS Token访问 + /// + public const string UseSecurityTokenService = Prefix + ".UseSecurityTokenService"; + /// + /// 使用RAM子账号的AssumeRole方式访问 + /// + public const string RamRoleArn = Prefix + ".RamRoleArn"; + /// + /// 用户自定义参数。此参数用来区分不同的令牌,可用于用户级别的访问审计 + /// + public const string RoleSessionName = Prefix + ".RoleSessionName"; /// - /// 认证方式 + /// 过期时间,单位为秒。 /// - public class Authorization - { - public const string Prefix = AliyunSettingNames.Prefix + ".Authorization"; - /// - /// 地域ID - /// - public const string RegionId = Prefix + ".RegionId"; - /// - /// RAM账号的AccessKey ID - /// - public const string AccessKeyId = Prefix + ".AccessKeyId"; - /// - /// RAM账号的AccessKey Secret - /// - public const string AccessKeySecret = Prefix + ".AccessKeySecret"; - /// - /// 使用STS Token访问 - /// - public const string UseSecurityTokenService = Prefix + ".UseSecurityTokenService"; - /// - /// 使用RAM子账号的AssumeRole方式访问 - /// - public const string RamRoleArn = Prefix + ".RamRoleArn"; - /// - /// 用户自定义参数。此参数用来区分不同的令牌,可用于用户级别的访问审计 - /// - public const string RoleSessionName = Prefix + ".RoleSessionName"; - /// - /// 过期时间,单位为秒。 - /// - public const string DurationSeconds = Prefix + ".DurationSeconds"; - /// - /// 权限策略。 - /// - public const string Policy = Prefix + ".Policy"; - } + public const string DurationSeconds = Prefix + ".DurationSeconds"; + /// + /// 权限策略。 + /// + public const string Policy = Prefix + ".Policy"; + } + /// + /// 短信服务 + /// + public class Sms + { + public const string Prefix = AliyunSettingNames.Prefix + ".Sms"; + /// + /// 阿里云sms服务域名 + /// + public const string Domain = Prefix + ".Domain"; + /// + /// 调用方法名称 + /// + public const string ActionName = Prefix + ".ActionName"; + /// + /// 默认版本号 + /// + public const string Version = Prefix + ".Version"; + /// + /// 默认签名 + /// + public const string DefaultSignName = Prefix + ".DefaultSignName"; + /// + /// 默认短信模板号 + /// + public const string DefaultTemplateCode = Prefix + ".DefaultTemplateCode"; + /// + /// 默认号码 + /// + public const string DefaultPhoneNumber = Prefix + ".DefaultPhoneNumber"; /// - /// 短信服务 + /// 展示错误给客户端 /// - public class Sms - { - public const string Prefix = AliyunSettingNames.Prefix + ".Sms"; - /// - /// 阿里云sms服务域名 - /// - public const string Domain = Prefix + ".Domain"; - /// - /// 调用方法名称 - /// - public const string ActionName = Prefix + ".ActionName"; - /// - /// 默认版本号 - /// - public const string Version = Prefix + ".Version"; - /// - /// 默认签名 - /// - public const string DefaultSignName = Prefix + ".DefaultSignName"; - /// - /// 默认短信模板号 - /// - public const string DefaultTemplateCode = Prefix + ".DefaultTemplateCode"; - /// - /// 默认号码 - /// - public const string DefaultPhoneNumber = Prefix + ".DefaultPhoneNumber"; - /// - /// 展示错误给客户端 - /// - public const string VisableErrorToClient = Prefix + ".VisableErrorToClient"; - } + public const string VisableErrorToClient = Prefix + ".VisableErrorToClient"; } } diff --git a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/Settings/AliyunSettingProvider.cs b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/Settings/AliyunSettingProvider.cs index a5d519b79..55713d7af 100644 --- a/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/Settings/AliyunSettingProvider.cs +++ b/aspnet-core/framework/cloud-aliyun/LINGYUN.Abp.Aliyun/LINGYUN/Abp/Aliyun/Settings/AliyunSettingProvider.cs @@ -2,211 +2,210 @@ using Volo.Abp.Localization; using Volo.Abp.Settings; -namespace LINGYUN.Abp.Aliyun.Settings +namespace LINGYUN.Abp.Aliyun.Settings; + +public class AliyunSettingProvider : SettingDefinitionProvider { - public class AliyunSettingProvider : SettingDefinitionProvider + public override void Define(ISettingDefinitionContext context) { - public override void Define(ISettingDefinitionContext context) - { - context.Add(GetAuthorizationSettings()); - context.Add(GetSmsSettings()); - } + context.Add(GetAuthorizationSettings()); + context.Add(GetSmsSettings()); + } - private SettingDefinition[] GetAuthorizationSettings() + private SettingDefinition[] GetAuthorizationSettings() + { + return new SettingDefinition[] { - return new SettingDefinition[] - { - new SettingDefinition( - AliyunSettingNames.Authorization.AccessKeyId, - displayName: L("DisplayName:AccessKeyId"), - description: L("Description:AccessKeyId"), - isVisibleToClients: false, - isEncrypted: true - ) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName), - new SettingDefinition( - AliyunSettingNames.Authorization.AccessKeySecret, - displayName: L("DisplayName:AccessKeySecret"), - description: L("Description:AccessKeySecret"), - isVisibleToClients: false, - isEncrypted: true - ) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName), - new SettingDefinition( - AliyunSettingNames.Authorization.DurationSeconds, - defaultValue: "3600", - displayName: L("DisplayName:DurationSeconds"), - description: L("Description:DurationSeconds"), - isVisibleToClients: false - ) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName), - new SettingDefinition( - AliyunSettingNames.Authorization.Policy, - displayName: L("DisplayName:Policy"), - description: L("Description:Policy"), - isVisibleToClients: false, - isEncrypted: true - ) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName), - new SettingDefinition( - AliyunSettingNames.Authorization.RamRoleArn, - displayName: L("DisplayName:RamRoleArn"), - description: L("Description:RamRoleArn"), - isVisibleToClients: false, - isEncrypted: true - ) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName), - new SettingDefinition( - AliyunSettingNames.Authorization.RegionId, - defaultValue: "oss-cn-hangzhou", - displayName: L("DisplayName:RegionId"), - description: L("Description:RegionId"), - isVisibleToClients: false - ) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName), - new SettingDefinition( - AliyunSettingNames.Authorization.RoleSessionName, - displayName: L("DisplayName:RoleSessionName"), - description: L("Description:RoleSessionName"), - isVisibleToClients: false, - isEncrypted: true - ) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName), - new SettingDefinition( - AliyunSettingNames.Authorization.UseSecurityTokenService, - defaultValue: true.ToString(), - displayName: L("DisplayName:UseSecurityTokenService"), - description: L("Description:UseSecurityTokenService"), - isVisibleToClients: false - ) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName), - }; - } + new SettingDefinition( + AliyunSettingNames.Authorization.AccessKeyId, + displayName: L("DisplayName:AccessKeyId"), + description: L("Description:AccessKeyId"), + isVisibleToClients: false, + isEncrypted: true + ) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName), + new SettingDefinition( + AliyunSettingNames.Authorization.AccessKeySecret, + displayName: L("DisplayName:AccessKeySecret"), + description: L("Description:AccessKeySecret"), + isVisibleToClients: false, + isEncrypted: true + ) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName), + new SettingDefinition( + AliyunSettingNames.Authorization.DurationSeconds, + defaultValue: "3600", + displayName: L("DisplayName:DurationSeconds"), + description: L("Description:DurationSeconds"), + isVisibleToClients: false + ) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName), + new SettingDefinition( + AliyunSettingNames.Authorization.Policy, + displayName: L("DisplayName:Policy"), + description: L("Description:Policy"), + isVisibleToClients: false, + isEncrypted: true + ) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName), + new SettingDefinition( + AliyunSettingNames.Authorization.RamRoleArn, + displayName: L("DisplayName:RamRoleArn"), + description: L("Description:RamRoleArn"), + isVisibleToClients: false, + isEncrypted: true + ) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName), + new SettingDefinition( + AliyunSettingNames.Authorization.RegionId, + defaultValue: "oss-cn-hangzhou", + displayName: L("DisplayName:RegionId"), + description: L("Description:RegionId"), + isVisibleToClients: false + ) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName), + new SettingDefinition( + AliyunSettingNames.Authorization.RoleSessionName, + displayName: L("DisplayName:RoleSessionName"), + description: L("Description:RoleSessionName"), + isVisibleToClients: false, + isEncrypted: true + ) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName), + new SettingDefinition( + AliyunSettingNames.Authorization.UseSecurityTokenService, + defaultValue: true.ToString(), + displayName: L("DisplayName:UseSecurityTokenService"), + description: L("Description:UseSecurityTokenService"), + isVisibleToClients: false + ) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName), + }; + } - private SettingDefinition[] GetSmsSettings() - { - return new SettingDefinition[] - { - new SettingDefinition( - AliyunSettingNames.Sms.ActionName, - defaultValue: "SendSms", - displayName: L("DisplayName:ActionName"), - description: L("Description:ActionName"), - isVisibleToClients: false - ) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName), - new SettingDefinition( - AliyunSettingNames.Sms.DefaultSignName, - displayName: L("DisplayName:DefaultSignName"), - description: L("Description:DefaultSignName"), - isVisibleToClients: false, - isEncrypted: true - ) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName), - new SettingDefinition( - AliyunSettingNames.Sms.DefaultTemplateCode, - displayName: L("DisplayName:DefaultTemplateCode"), - description: L("Description:DefaultTemplateCode"), - isVisibleToClients: false, - isEncrypted: true - ) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName), - new SettingDefinition( - AliyunSettingNames.Sms.DefaultPhoneNumber, - displayName: L("DisplayName:DefaultPhoneNumber"), - description: L("Description:DefaultPhoneNumber"), - isVisibleToClients: false - ) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName), - new SettingDefinition( - AliyunSettingNames.Sms.Domain, - defaultValue: "dysmsapi.aliyuncs.com", - displayName: L("DisplayName:Domain"), - description: L("Description:Domain"), - isVisibleToClients: false - ) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName), - new SettingDefinition( - AliyunSettingNames.Sms.Version, - defaultValue: "2017-05-25", - displayName: L("DisplayName:Version"), - description: L("Description:Version"), - isVisibleToClients: false - ) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName), - new SettingDefinition( - AliyunSettingNames.Sms.VisableErrorToClient, - defaultValue: false.ToString(), - displayName: L("DisplayName:VisableErrorToClient"), - description: L("Description:VisableErrorToClient"), - isVisibleToClients: false - ) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName) - }; - } - private ILocalizableString L(string name) + private SettingDefinition[] GetSmsSettings() + { + return new SettingDefinition[] { - return LocalizableString.Create(name); - } + new SettingDefinition( + AliyunSettingNames.Sms.ActionName, + defaultValue: "SendSms", + displayName: L("DisplayName:ActionName"), + description: L("Description:ActionName"), + isVisibleToClients: false + ) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName), + new SettingDefinition( + AliyunSettingNames.Sms.DefaultSignName, + displayName: L("DisplayName:DefaultSignName"), + description: L("Description:DefaultSignName"), + isVisibleToClients: false, + isEncrypted: true + ) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName), + new SettingDefinition( + AliyunSettingNames.Sms.DefaultTemplateCode, + displayName: L("DisplayName:DefaultTemplateCode"), + description: L("Description:DefaultTemplateCode"), + isVisibleToClients: false, + isEncrypted: true + ) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName), + new SettingDefinition( + AliyunSettingNames.Sms.DefaultPhoneNumber, + displayName: L("DisplayName:DefaultPhoneNumber"), + description: L("Description:DefaultPhoneNumber"), + isVisibleToClients: false + ) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName), + new SettingDefinition( + AliyunSettingNames.Sms.Domain, + defaultValue: "dysmsapi.aliyuncs.com", + displayName: L("DisplayName:Domain"), + description: L("Description:Domain"), + isVisibleToClients: false + ) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName), + new SettingDefinition( + AliyunSettingNames.Sms.Version, + defaultValue: "2017-05-25", + displayName: L("DisplayName:Version"), + description: L("Description:Version"), + isVisibleToClients: false + ) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName), + new SettingDefinition( + AliyunSettingNames.Sms.VisableErrorToClient, + defaultValue: false.ToString(), + displayName: L("DisplayName:VisableErrorToClient"), + description: L("Description:VisableErrorToClient"), + isVisibleToClients: false + ) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName) + }; + } + private ILocalizableString L(string name) + { + return LocalizableString.Create(name); } } diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN.Abp.BlobStoring.Tencent.csproj b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN.Abp.BlobStoring.Tencent.csproj index 6dde853cf..7150c0bfb 100644 --- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN.Abp.BlobStoring.Tencent.csproj +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN.Abp.BlobStoring.Tencent.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.BlobStoring.Tencent + LINGYUN.Abp.BlobStoring.Tencent + false + false + false 腾讯云Oss对象存储Abp集成 diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/DefaultTencentBlobNameCalculator.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/DefaultTencentBlobNameCalculator.cs index a4ae97625..9b7853242 100644 --- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/DefaultTencentBlobNameCalculator.cs +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/DefaultTencentBlobNameCalculator.cs @@ -2,23 +2,22 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.BlobStoring.Tencent +namespace LINGYUN.Abp.BlobStoring.Tencent; + +public class DefaultTencentBlobNameCalculator : ITencentBlobNameCalculator, ITransientDependency { - public class DefaultTencentBlobNameCalculator : ITencentBlobNameCalculator, ITransientDependency - { - protected ICurrentTenant CurrentTenant { get; } + protected ICurrentTenant CurrentTenant { get; } - public DefaultTencentBlobNameCalculator( - ICurrentTenant currentTenant) - { - CurrentTenant = currentTenant; - } + public DefaultTencentBlobNameCalculator( + ICurrentTenant currentTenant) + { + CurrentTenant = currentTenant; + } - public string Calculate(BlobProviderArgs args) - { - return CurrentTenant.Id == null - ? $"host/{args.BlobName}" - : $"tenants/{CurrentTenant.Id.Value:D}/{args.BlobName}"; - } + public string Calculate(BlobProviderArgs args) + { + return CurrentTenant.Id == null + ? $"host/{args.BlobName}" + : $"tenants/{CurrentTenant.Id.Value:D}/{args.BlobName}"; } } diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/ITencentBlobNameCalculator.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/ITencentBlobNameCalculator.cs index 4ab662c4f..411b0e9e4 100644 --- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/ITencentBlobNameCalculator.cs +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/ITencentBlobNameCalculator.cs @@ -1,9 +1,8 @@ using Volo.Abp.BlobStoring; -namespace LINGYUN.Abp.BlobStoring.Tencent +namespace LINGYUN.Abp.BlobStoring.Tencent; + +public interface ITencentBlobNameCalculator { - public interface ITencentBlobNameCalculator - { - string Calculate(BlobProviderArgs args); - } + string Calculate(BlobProviderArgs args); } diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/TencentBlobContainerConfigurationExtensions.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/TencentBlobContainerConfigurationExtensions.cs index f86663dfb..2edcc1844 100644 --- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/TencentBlobContainerConfigurationExtensions.cs +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/TencentBlobContainerConfigurationExtensions.cs @@ -1,25 +1,24 @@ using System; using Volo.Abp.BlobStoring; -namespace LINGYUN.Abp.BlobStoring.Tencent +namespace LINGYUN.Abp.BlobStoring.Tencent; + +public static class TencentBlobContainerConfigurationExtensions { - public static class TencentBlobContainerConfigurationExtensions + public static TencentBlobProviderConfiguration GetTencentConfiguration( + this BlobContainerConfiguration containerConfiguration) { - public static TencentBlobProviderConfiguration GetTencentConfiguration( - this BlobContainerConfiguration containerConfiguration) - { - return new TencentBlobProviderConfiguration(containerConfiguration); - } + return new TencentBlobProviderConfiguration(containerConfiguration); + } - public static BlobContainerConfiguration UseTencentCloud( - this BlobContainerConfiguration containerConfiguration, - Action aliyunConfigureAction) - { - containerConfiguration.ProviderType = typeof(TencentCloudBlobProvider); + public static BlobContainerConfiguration UseTencentCloud( + this BlobContainerConfiguration containerConfiguration, + Action aliyunConfigureAction) + { + containerConfiguration.ProviderType = typeof(TencentCloudBlobProvider); - aliyunConfigureAction(new TencentBlobProviderConfiguration(containerConfiguration)); + aliyunConfigureAction(new TencentBlobProviderConfiguration(containerConfiguration)); - return containerConfiguration; - } + return containerConfiguration; } } diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/TencentBlobNamingNormalizer.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/TencentBlobNamingNormalizer.cs index e5a16e83f..b6d8c768c 100644 --- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/TencentBlobNamingNormalizer.cs +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/TencentBlobNamingNormalizer.cs @@ -2,60 +2,59 @@ using Volo.Abp.BlobStoring; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.BlobStoring.Tencent +namespace LINGYUN.Abp.BlobStoring.Tencent; + +public class TencentBlobNamingNormalizer : IBlobNamingNormalizer, ITransientDependency { - public class TencentBlobNamingNormalizer : IBlobNamingNormalizer, ITransientDependency + /// + /// 腾讯云对象命名规范 + /// https://cloud.tencent.com/document/product/436/13324 + /// + /// + /// + public virtual string NormalizeBlobName(string blobName) { - /// - /// 腾讯云对象命名规范 - /// https://cloud.tencent.com/document/product/436/13324 - /// - /// - /// - public virtual string NormalizeBlobName(string blobName) - { - // 不允许以正斜线/或者反斜线\开头。 - blobName = Regex.Replace(blobName, "^/", string.Empty); - blobName = blobName.StartsWith("\\") ? blobName.Substring(1) : blobName; - - // 对象键中不支持 ASCII 控制字符中的 - // 字符上(↑),字符下(↓),字符右(→),字符左(←), - // 分别对应 CAN(24),EM(25),SUB(26),ESC(27)。 - blobName = blobName.Replace("↑", ""); - blobName = blobName.Replace("↓", ""); - blobName = blobName.Replace("←", ""); - blobName = blobName.Replace("→", ""); - - // TODO: 要求还真多...其他暂时不写了 - - return blobName; - } + // 不允许以正斜线/或者反斜线\开头。 + blobName = Regex.Replace(blobName, "^/", string.Empty); + blobName = blobName.StartsWith("\\") ? blobName.Substring(1) : blobName; + + // 对象键中不支持 ASCII 控制字符中的 + // 字符上(↑),字符下(↓),字符右(→),字符左(←), + // 分别对应 CAN(24),EM(25),SUB(26),ESC(27)。 + blobName = blobName.Replace("↑", ""); + blobName = blobName.Replace("↓", ""); + blobName = blobName.Replace("←", ""); + blobName = blobName.Replace("→", ""); + + // TODO: 要求还真多...其他暂时不写了 + + return blobName; + } + + /// + /// 腾讯云BucketName命名规范 + /// https://cloud.tencent.com/document/product/436/13312 + /// + /// + /// + public virtual string NormalizeContainerName(string containerName) + { + // 仅支持小写英文字母和数字,即[a-z,0-9]、中划线“-”及其组合。 + containerName = containerName.ToLower(); + containerName = Regex.Replace(containerName, "[^a-z0-9-]", string.Empty); - /// - /// 腾讯云BucketName命名规范 - /// https://cloud.tencent.com/document/product/436/13312 - /// - /// - /// - public virtual string NormalizeContainerName(string containerName) + // 不能以短划线(-)开头 + containerName = Regex.Replace(containerName, "^-", string.Empty); + // 不能以短划线(-)结尾 + containerName = Regex.Replace(containerName, "-$", string.Empty); + + // 存储桶名称的最大允许字符受到 地域简称 和 APPID 的字符数影响,组成的完整请求域名字符数总计最多60个字符。 + // 例如请求域名123456789012345678901-1250000000.cos.ap-beijing.myqcloud.com总和为60个字符。 + if (containerName.Length > 60) { - // 仅支持小写英文字母和数字,即[a-z,0-9]、中划线“-”及其组合。 - containerName = containerName.ToLower(); - containerName = Regex.Replace(containerName, "[^a-z0-9-]", string.Empty); - - // 不能以短划线(-)开头 - containerName = Regex.Replace(containerName, "^-", string.Empty); - // 不能以短划线(-)结尾 - containerName = Regex.Replace(containerName, "-$", string.Empty); - - // 存储桶名称的最大允许字符受到 地域简称 和 APPID 的字符数影响,组成的完整请求域名字符数总计最多60个字符。 - // 例如请求域名123456789012345678901-1250000000.cos.ap-beijing.myqcloud.com总和为60个字符。 - if (containerName.Length > 60) - { - containerName = containerName.Substring(0, 60); - } - - return containerName; + containerName = containerName.Substring(0, 60); } + + return containerName; } } diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/TencentBlobProviderConfiguration.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/TencentBlobProviderConfiguration.cs index 46de0f687..b9ec97936 100644 --- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/TencentBlobProviderConfiguration.cs +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/TencentBlobProviderConfiguration.cs @@ -2,62 +2,61 @@ using Volo.Abp; using Volo.Abp.BlobStoring; -namespace LINGYUN.Abp.BlobStoring.Tencent +namespace LINGYUN.Abp.BlobStoring.Tencent; + +public class TencentBlobProviderConfiguration { - public class TencentBlobProviderConfiguration + /// + /// AppId + /// + public string AppId { + get => _containerConfiguration.GetConfiguration(TencentBlobProviderConfigurationNames.AppId); + set => _containerConfiguration.SetConfiguration(TencentBlobProviderConfigurationNames.AppId, Check.NotNullOrWhiteSpace(value, nameof(value))); + } + /// + /// 区域 + /// + public string Region { + get => _containerConfiguration.GetConfiguration(TencentBlobProviderConfigurationNames.Region); + set => _containerConfiguration.SetConfiguration(TencentBlobProviderConfigurationNames.Region, value); + } + /// + /// 命名空间 + /// + public string BucketName { - /// - /// AppId - /// - public string AppId { - get => _containerConfiguration.GetConfiguration(TencentBlobProviderConfigurationNames.AppId); - set => _containerConfiguration.SetConfiguration(TencentBlobProviderConfigurationNames.AppId, Check.NotNullOrWhiteSpace(value, nameof(value))); - } - /// - /// 区域 - /// - public string Region { - get => _containerConfiguration.GetConfiguration(TencentBlobProviderConfigurationNames.Region); - set => _containerConfiguration.SetConfiguration(TencentBlobProviderConfigurationNames.Region, value); - } - /// - /// 命名空间 - /// - public string BucketName - { - get => _containerConfiguration.GetConfiguration(TencentBlobProviderConfigurationNames.BucketName); - set => _containerConfiguration.SetConfiguration(TencentBlobProviderConfigurationNames.BucketName, Check.NotNullOrWhiteSpace(value, nameof(value))); - } - /// - /// 命名空间不存在是否创建 - /// - public bool CreateBucketIfNotExists - { - get => _containerConfiguration.GetConfigurationOrDefault(TencentBlobProviderConfigurationNames.CreateBucketIfNotExists, false); - set => _containerConfiguration.SetConfiguration(TencentBlobProviderConfigurationNames.CreateBucketIfNotExists, value); - } - /// - /// 创建命名空间时防盗链列表 - /// - public List CreateBucketReferer { - get => _containerConfiguration.GetConfiguration>(TencentBlobProviderConfigurationNames.CreateBucketReferer); - set { - if (value == null) - { - _containerConfiguration.SetConfiguration(TencentBlobProviderConfigurationNames.CreateBucketReferer, new List()); - } - else - { - _containerConfiguration.SetConfiguration(TencentBlobProviderConfigurationNames.CreateBucketReferer, value); - } + get => _containerConfiguration.GetConfiguration(TencentBlobProviderConfigurationNames.BucketName); + set => _containerConfiguration.SetConfiguration(TencentBlobProviderConfigurationNames.BucketName, Check.NotNullOrWhiteSpace(value, nameof(value))); + } + /// + /// 命名空间不存在是否创建 + /// + public bool CreateBucketIfNotExists + { + get => _containerConfiguration.GetConfigurationOrDefault(TencentBlobProviderConfigurationNames.CreateBucketIfNotExists, false); + set => _containerConfiguration.SetConfiguration(TencentBlobProviderConfigurationNames.CreateBucketIfNotExists, value); + } + /// + /// 创建命名空间时防盗链列表 + /// + public List CreateBucketReferer { + get => _containerConfiguration.GetConfiguration>(TencentBlobProviderConfigurationNames.CreateBucketReferer); + set { + if (value == null) + { + _containerConfiguration.SetConfiguration(TencentBlobProviderConfigurationNames.CreateBucketReferer, new List()); + } + else + { + _containerConfiguration.SetConfiguration(TencentBlobProviderConfigurationNames.CreateBucketReferer, value); } } + } - private readonly BlobContainerConfiguration _containerConfiguration; + private readonly BlobContainerConfiguration _containerConfiguration; - public TencentBlobProviderConfiguration(BlobContainerConfiguration containerConfiguration) - { - _containerConfiguration = containerConfiguration; - } + public TencentBlobProviderConfiguration(BlobContainerConfiguration containerConfiguration) + { + _containerConfiguration = containerConfiguration; } } diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/TencentBlobProviderConfigurationNames.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/TencentBlobProviderConfigurationNames.cs index dbe79e467..50b15be12 100644 --- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/TencentBlobProviderConfigurationNames.cs +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.BlobStoring.Tencent/LINGYUN/Abp/BlobStoring/Tencent/TencentBlobProviderConfigurationNames.cs @@ -1,26 +1,25 @@ -namespace LINGYUN.Abp.BlobStoring.Tencent +namespace LINGYUN.Abp.BlobStoring.Tencent; + +public static class TencentBlobProviderConfigurationNames { - public static class TencentBlobProviderConfigurationNames - { - /// - /// AppId - /// - public const string AppId = "Tencent:OSS:AppId"; - /// - /// 区域 - /// - public const string Region = "Tencent:OSS:Region"; - /// - /// 命名空间 - /// - public const string BucketName = "Tencent:OSS:BucketName"; - /// - /// 命名空间不存在是否创建 - /// - public const string CreateBucketIfNotExists = "Tencent:OSS:CreateBucketIfNotExists"; - /// - /// 创建命名空间时防盗链列表 - /// - public const string CreateBucketReferer = "Tencent:OSS:CreateBucketReferer"; - } + /// + /// AppId + /// + public const string AppId = "Tencent:OSS:AppId"; + /// + /// 区域 + /// + public const string Region = "Tencent:OSS:Region"; + /// + /// 命名空间 + /// + public const string BucketName = "Tencent:OSS:BucketName"; + /// + /// 命名空间不存在是否创建 + /// + public const string CreateBucketIfNotExists = "Tencent:OSS:CreateBucketIfNotExists"; + /// + /// 创建命名空间时防盗链列表 + /// + public const string CreateBucketReferer = "Tencent:OSS:CreateBucketReferer"; } diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Sms.Tencent/LINGYUN.Abp.Sms.Tencent.csproj b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Sms.Tencent/LINGYUN.Abp.Sms.Tencent.csproj index c90d4a4e5..5438b0c6a 100644 --- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Sms.Tencent/LINGYUN.Abp.Sms.Tencent.csproj +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Sms.Tencent/LINGYUN.Abp.Sms.Tencent.csproj @@ -4,7 +4,13 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Sms.Tencent + LINGYUN.Abp.Sms.Tencent + false + false + false + diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Sms.Tencent/LINGYUN/Abp/Sms/Tencent/AbpSmsTencentModule.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Sms.Tencent/LINGYUN/Abp/Sms/Tencent/AbpSmsTencentModule.cs index b1d6a2d2c..2b027da03 100644 --- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Sms.Tencent/LINGYUN/Abp/Sms/Tencent/AbpSmsTencentModule.cs +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Sms.Tencent/LINGYUN/Abp/Sms/Tencent/AbpSmsTencentModule.cs @@ -5,26 +5,25 @@ using Volo.Abp.Sms; using Volo.Abp.VirtualFileSystem; -namespace LINGYUN.Abp.Sms.Tencent +namespace LINGYUN.Abp.Sms.Tencent; + +[DependsOn( + typeof(AbpSmsModule), + typeof(AbpTencentCloudModule))] +public class AbpSmsTencentModule : AbpModule { - [DependsOn( - typeof(AbpSmsModule), - typeof(AbpTencentCloudModule))] - public class AbpSmsTencentModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + Configure(options => { - Configure(options => - { - options.FileSets.AddEmbedded(); - }); + options.FileSets.AddEmbedded(); + }); - Configure(options => - { - options.Resources - .Get() - .AddVirtualJson("/LINGYUN/Abp/Sms/Tencent/Localization/Resources"); - }); - } + Configure(options => + { + options.Resources + .Get() + .AddVirtualJson("/LINGYUN/Abp/Sms/Tencent/Localization/Resources"); + }); } } diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Sms.Tencent/LINGYUN/Abp/Sms/Tencent/TencentCloudSmsSender.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Sms.Tencent/LINGYUN/Abp/Sms/Tencent/TencentCloudSmsSender.cs index 83ff24cda..501283863 100644 --- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Sms.Tencent/LINGYUN/Abp/Sms/Tencent/TencentCloudSmsSender.cs +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Sms.Tencent/LINGYUN/Abp/Sms/Tencent/TencentCloudSmsSender.cs @@ -16,84 +16,83 @@ using Volo.Abp.Settings; using Volo.Abp.Sms; -namespace LINGYUN.Abp.Sms.Tencent +namespace LINGYUN.Abp.Sms.Tencent; + +[Dependency(ReplaceServices = true)] +public class TencentCloudSmsSender : ISmsSender, ITransientDependency { - [Dependency(ReplaceServices = true)] - public class TencentCloudSmsSender : ISmsSender, ITransientDependency - { - public ILogger Logger { protected get; set; } + public ILogger Logger { protected get; set; } - protected IJsonSerializer JsonSerializer { get; } - protected ISettingProvider SettingProvider { get; } - protected IServiceProvider ServiceProvider { get; } - protected TencentCloudClientFactory TencentCloudClientFactory { get; } - public TencentCloudSmsSender( - IJsonSerializer jsonSerializer, - ISettingProvider settingProvider, - IServiceProvider serviceProvider, - TencentCloudClientFactory tencentCloudClientFactory) - { - JsonSerializer = jsonSerializer; - SettingProvider = settingProvider; - ServiceProvider = serviceProvider; - TencentCloudClientFactory = tencentCloudClientFactory; + protected IJsonSerializer JsonSerializer { get; } + protected ISettingProvider SettingProvider { get; } + protected IServiceProvider ServiceProvider { get; } + protected TencentCloudClientFactory TencentCloudClientFactory { get; } + public TencentCloudSmsSender( + IJsonSerializer jsonSerializer, + ISettingProvider settingProvider, + IServiceProvider serviceProvider, + TencentCloudClientFactory tencentCloudClientFactory) + { + JsonSerializer = jsonSerializer; + SettingProvider = settingProvider; + ServiceProvider = serviceProvider; + TencentCloudClientFactory = tencentCloudClientFactory; - Logger = NullLogger.Instance; - } + Logger = NullLogger.Instance; + } - [RequiresFeature(TencentCloudFeatures.Sms.Enable)] - public async virtual Task SendAsync(SmsMessage smsMessage) - { - var appId = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.Sms.AppId); + [RequiresFeature(TencentCloudFeatures.Sms.Enable)] + public async virtual Task SendAsync(SmsMessage smsMessage) + { + var appId = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.Sms.AppId); - Check.NotNullOrWhiteSpace(appId, TencentCloudSettingNames.Sms.AppId); + Check.NotNullOrWhiteSpace(appId, TencentCloudSettingNames.Sms.AppId); - // 统一使用 TemplateCode作为模板参数, 解决不一样的sms提供商参数差异 - if (!smsMessage.Properties.TryGetValue("TemplateCode", out var templateId)) - { - templateId = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.Sms.DefaultTemplateId); - } + // 统一使用 TemplateCode作为模板参数, 解决不一样的sms提供商参数差异 + if (!smsMessage.Properties.TryGetValue("TemplateCode", out var templateId)) + { + templateId = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.Sms.DefaultTemplateId); + } - if (!smsMessage.Properties.TryGetValue("SignName", out var signName)) - { - signName = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.Sms.DefaultSignName); - } + if (!smsMessage.Properties.TryGetValue("SignName", out var signName)) + { + signName = await SettingProvider.GetOrNullAsync(TencentCloudSettingNames.Sms.DefaultSignName); + } - var request = new SendSmsRequest - { - SmsSdkAppId = appId, - SignName = signName?.ToString(), - TemplateId = templateId?.ToString(), - PhoneNumberSet = smsMessage.PhoneNumber.Split(';'), - }; + var request = new SendSmsRequest + { + SmsSdkAppId = appId, + SignName = signName?.ToString(), + TemplateId = templateId?.ToString(), + PhoneNumberSet = smsMessage.PhoneNumber.Split(';'), + }; - if (smsMessage.Properties.Any()) - { - request.TemplateParamSet = smsMessage.Properties.Select(x => x.Value.ToString()).ToArray(); - } + if (smsMessage.Properties.Any()) + { + request.TemplateParamSet = smsMessage.Properties.Select(x => x.Value.ToString()).ToArray(); + } - var smsClient = await TencentCloudClientFactory.CreateAsync(); + var smsClient = await TencentCloudClientFactory.CreateAsync(); - var response = await smsClient.SendSms(request); + var response = await smsClient.SendSms(request); - var warningMessage = response.SendStatusSet - .Where(x => !"ok".Equals(x.Code, StringComparison.InvariantCultureIgnoreCase)) - // 记录流水号, 手机号, 错误代码, 错误信息 - .Select(x => $"SerialNo: {x.SerialNo}, PhoneNumber: {x.PhoneNumber}, Status: {x.Code}, Error: {x.Message}"); - // 所有短信发送失败, 抛出错误 - // 只要一条发送成功,即视为成功 - if (!response.SendStatusSet.Any(x => "ok".Equals(x.Code, StringComparison.InvariantCultureIgnoreCase))) - { - var errorMessage = warningMessage.JoinAsString(Environment.NewLine); + var warningMessage = response.SendStatusSet + .Where(x => !"ok".Equals(x.Code, StringComparison.InvariantCultureIgnoreCase)) + // 记录流水号, 手机号, 错误代码, 错误信息 + .Select(x => $"SerialNo: {x.SerialNo}, PhoneNumber: {x.PhoneNumber}, Status: {x.Code}, Error: {x.Message}"); + // 所有短信发送失败, 抛出错误 + // 只要一条发送成功,即视为成功 + if (!response.SendStatusSet.Any(x => "ok".Equals(x.Code, StringComparison.InvariantCultureIgnoreCase))) + { + var errorMessage = warningMessage.JoinAsString(Environment.NewLine); - throw new AbpException($"Send tencent cloud sms error: {errorMessage}"); - } + throw new AbpException($"Send tencent cloud sms error: {errorMessage}"); + } - if (warningMessage.Any()) - { - Logger.LogWarning("Some failed send sms messages, error info:"); - Logger.LogWarning(warningMessage.JoinAsString(Environment.NewLine)); - } + if (warningMessage.Any()) + { + Logger.LogWarning("Some failed send sms messages, error info:"); + Logger.LogWarning(warningMessage.JoinAsString(Environment.NewLine)); } } } diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Sms.Tencent/Volo/Abp/Sms/TencentSmsSenderExtensions.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Sms.Tencent/Volo/Abp/Sms/TencentSmsSenderExtensions.cs index 799a2e6a3..c7c8ecf47 100644 --- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Sms.Tencent/Volo/Abp/Sms/TencentSmsSenderExtensions.cs +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Sms.Tencent/Volo/Abp/Sms/TencentSmsSenderExtensions.cs @@ -2,57 +2,56 @@ using System.Collections.Generic; using System.Threading.Tasks; -namespace Volo.Abp.Sms +namespace Volo.Abp.Sms; + +public static class TencentSmsSenderExtensions { - public static class TencentSmsSenderExtensions + /// + /// 扩展短信接口 + /// + /// + /// 短信模板号 + /// 发送手机号 + /// 短信模板参数 + /// + public static async Task SendAsync( + this ISmsSender smsSender, + string templateCode, + string phoneNumber, + IDictionary templateParams = null) { - /// - /// 扩展短信接口 - /// - /// - /// 短信模板号 - /// 发送手机号 - /// 短信模板参数 - /// - public static async Task SendAsync( - this ISmsSender smsSender, - string templateCode, - string phoneNumber, - IDictionary templateParams = null) + var smsMessage = new SmsMessage(phoneNumber, nameof(TencentCloudSmsSender)); + smsMessage.Properties.Add("TemplateCode", templateCode); + if(templateParams != null) { - var smsMessage = new SmsMessage(phoneNumber, nameof(TencentCloudSmsSender)); - smsMessage.Properties.Add("TemplateCode", templateCode); - if(templateParams != null) - { - smsMessage.Properties.Add("TemplateParam", templateParams); - } - await smsSender.SendAsync(smsMessage); + smsMessage.Properties.Add("TemplateParam", templateParams); } + await smsSender.SendAsync(smsMessage); + } - /// - /// 扩展短信接口 - /// - /// - /// 短信签名 - /// 短信模板号 - /// 发送手机号 - /// 短信模板参数 - /// - public static async Task SendAsync( - this ISmsSender smsSender, - string signName, - string templateCode, - string phoneNumber, - IDictionary templateParams = null) + /// + /// 扩展短信接口 + /// + /// + /// 短信签名 + /// 短信模板号 + /// 发送手机号 + /// 短信模板参数 + /// + public static async Task SendAsync( + this ISmsSender smsSender, + string signName, + string templateCode, + string phoneNumber, + IDictionary templateParams = null) + { + var smsMessage = new SmsMessage(phoneNumber, nameof(TencentCloudSmsSender)); + smsMessage.Properties.Add("SignName", signName); + smsMessage.Properties.Add("TemplateCode", templateCode); + if (templateParams != null) { - var smsMessage = new SmsMessage(phoneNumber, nameof(TencentCloudSmsSender)); - smsMessage.Properties.Add("SignName", signName); - smsMessage.Properties.Add("TemplateCode", templateCode); - if (templateParams != null) - { - smsMessage.Properties.Add("TemplateParam", templateParams); - } - await smsSender.SendAsync(smsMessage); + smsMessage.Properties.Add("TemplateParam", templateParams); } + await smsSender.SendAsync(smsMessage); } } diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN.Abp.Tencent.QQ.csproj b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN.Abp.Tencent.QQ.csproj index 6034b8c69..2cf49adbc 100644 --- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN.Abp.Tencent.QQ.csproj +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN.Abp.Tencent.QQ.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Tencent.QQ + LINGYUN.Abp.Tencent.QQ + false + false + false diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/AbpTencentQQOptionsFactory.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/AbpTencentQQOptionsFactory.cs index 95b699df4..1b6bc3d6f 100644 --- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/AbpTencentQQOptionsFactory.cs +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/AbpTencentQQOptionsFactory.cs @@ -2,23 +2,22 @@ using System.Threading.Tasks; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.Tencent.QQ +namespace LINGYUN.Abp.Tencent.QQ; + +public class AbpTencentQQOptionsFactory : ITransientDependency { - public class AbpTencentQQOptionsFactory : ITransientDependency - { - protected IOptions Options { get; } + protected IOptions Options { get; } - public AbpTencentQQOptionsFactory( - IOptions options) - { - Options = options; - } + public AbpTencentQQOptionsFactory( + IOptions options) + { + Options = options; + } - public async virtual Task CreateAsync() - { - await Options.SetAsync(); + public async virtual Task CreateAsync() + { + await Options.SetAsync(); - return Options.Value; - } + return Options.Value; } } diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/Settings/TencentQQSettingDefinitionProvider.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/Settings/TencentQQSettingDefinitionProvider.cs index 5c9d0fc38..d838d843f 100644 --- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/Settings/TencentQQSettingDefinitionProvider.cs +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/Settings/TencentQQSettingDefinitionProvider.cs @@ -2,59 +2,58 @@ using Volo.Abp.Localization; using Volo.Abp.Settings; -namespace LINGYUN.Abp.Tencent.QQ.Settings +namespace LINGYUN.Abp.Tencent.QQ.Settings; + +public class TencentQQSettingDefinitionProvider : SettingDefinitionProvider { - public class TencentQQSettingDefinitionProvider : SettingDefinitionProvider + public override void Define(ISettingDefinitionContext context) { - public override void Define(ISettingDefinitionContext context) - { - context.Add(GetQQConnectSettings()); - } + context.Add(GetQQConnectSettings()); + } - private SettingDefinition[] GetQQConnectSettings() + private SettingDefinition[] GetQQConnectSettings() + { + return new SettingDefinition[] { - return new SettingDefinition[] - { - new SettingDefinition( - TencentQQSettingNames.QQConnect.AppId, "", - L("DisplayName:QQConnect.AppId"), - L("Description:QQConnect.AppId"), - isVisibleToClients: false, - isEncrypted: true) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName), - new SettingDefinition( - TencentQQSettingNames.QQConnect.AppKey, "", - L("DisplayName:QQConnect.AppKey"), - L("Description:QQConnect.AppKey"), - isVisibleToClients: false, - isEncrypted: true) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName), - new SettingDefinition( - TencentQQSettingNames.QQConnect.IsMobile, - "false", - L("DisplayName:QQConnect.IsMobile"), - L("Description:QQConnect.IsMobile"), - isVisibleToClients: false, - isEncrypted: false) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName) - }; - } + new SettingDefinition( + TencentQQSettingNames.QQConnect.AppId, "", + L("DisplayName:QQConnect.AppId"), + L("Description:QQConnect.AppId"), + isVisibleToClients: false, + isEncrypted: true) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName), + new SettingDefinition( + TencentQQSettingNames.QQConnect.AppKey, "", + L("DisplayName:QQConnect.AppKey"), + L("Description:QQConnect.AppKey"), + isVisibleToClients: false, + isEncrypted: true) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName), + new SettingDefinition( + TencentQQSettingNames.QQConnect.IsMobile, + "false", + L("DisplayName:QQConnect.IsMobile"), + L("Description:QQConnect.IsMobile"), + isVisibleToClients: false, + isEncrypted: false) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName) + }; + } - protected ILocalizableString L(string name) - { - return LocalizableString.Create(name); - } + protected ILocalizableString L(string name) + { + return LocalizableString.Create(name); } } diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/Settings/TencentQQSettingNames.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/Settings/TencentQQSettingNames.cs index 63b8c10d5..c12998cbf 100644 --- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/Settings/TencentQQSettingNames.cs +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.QQ/LINGYUN/Abp/Tencent/QQ/Settings/TencentQQSettingNames.cs @@ -1,16 +1,15 @@ using LINGYUN.Abp.Tencent.Settings; -namespace LINGYUN.Abp.Tencent.QQ.Settings +namespace LINGYUN.Abp.Tencent.QQ.Settings; + +public class TencentQQSettingNames { - public class TencentQQSettingNames + public static class QQConnect { - public static class QQConnect - { - private const string Prefix = TencentCloudSettingNames.Prefix + ".QQConnect"; + private const string Prefix = TencentCloudSettingNames.Prefix + ".QQConnect"; - public const string AppId = Prefix + ".AppId"; - public const string AppKey = Prefix + ".AppKey"; - public const string IsMobile = Prefix + ".IsMobile"; - } + public const string AppId = Prefix + ".AppId"; + public const string AppKey = Prefix + ".AppKey"; + public const string IsMobile = Prefix + ".IsMobile"; } } diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.SettingManagement/LINGYUN.Abp.Tencent.SettingManagement.csproj b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.SettingManagement/LINGYUN.Abp.Tencent.SettingManagement.csproj index 8dea7a964..816eacbfa 100644 --- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.SettingManagement/LINGYUN.Abp.Tencent.SettingManagement.csproj +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.SettingManagement/LINGYUN.Abp.Tencent.SettingManagement.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.Tencent.SettingManagement + LINGYUN.Abp.Tencent.SettingManagement + false + false + false diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.SettingManagement/LINGYUN/Abp/Tencent/SettingManagement/TencentCloudSettingPermissionNames.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.SettingManagement/LINGYUN/Abp/Tencent/SettingManagement/TencentCloudSettingPermissionNames.cs index 5964c7326..88830f60d 100644 --- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.SettingManagement/LINGYUN/Abp/Tencent/SettingManagement/TencentCloudSettingPermissionNames.cs +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.SettingManagement/LINGYUN/Abp/Tencent/SettingManagement/TencentCloudSettingPermissionNames.cs @@ -1,9 +1,8 @@ -namespace LINGYUN.Abp.Tencent.SettingManagement +namespace LINGYUN.Abp.Tencent.SettingManagement; + +public class TencentCloudSettingPermissionNames { - public class TencentCloudSettingPermissionNames - { - public const string GroupName = "Abp.Tencent"; + public const string GroupName = "Abp.Tencent"; - public const string Settings = GroupName + ".Settings"; - } + public const string Settings = GroupName + ".Settings"; } diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.TTS/LINGYUN.Abp.Tencent.TTS.csproj b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.TTS/LINGYUN.Abp.Tencent.TTS.csproj index 75783d708..b373caba4 100644 --- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.TTS/LINGYUN.Abp.Tencent.TTS.csproj +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent.TTS/LINGYUN.Abp.Tencent.TTS.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Tencent.TTS + LINGYUN.Abp.Tencent.TTS + false + false + false 腾讯云语音合成 diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN.Abp.Tencent.csproj b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN.Abp.Tencent.csproj index 85e329491..9416ba2a0 100644 --- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN.Abp.Tencent.csproj +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN.Abp.Tencent.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Tencent + LINGYUN.Abp.Tencent + false + false + false 腾讯云SDK基础框架 diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/AbpTencentCloudModule.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/AbpTencentCloudModule.cs index 2e71768f9..57251d25b 100644 --- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/AbpTencentCloudModule.cs +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/AbpTencentCloudModule.cs @@ -6,36 +6,35 @@ using Volo.Abp.VirtualFileSystem; using Microsoft.Extensions.DependencyInjection; -namespace LINGYUN.Abp.Tencent +namespace LINGYUN.Abp.Tencent; + +[DependsOn( + typeof(AbpCachingModule), + typeof(AbpJsonModule), + typeof(AbpLocalizationModule))] +public class AbpTencentCloudModule : AbpModule { - [DependsOn( - typeof(AbpCachingModule), - typeof(AbpJsonModule), - typeof(AbpLocalizationModule))] - public class AbpTencentCloudModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + Configure(options => { - Configure(options => - { - options.FileSets.AddEmbedded(); - }); + options.FileSets.AddEmbedded(); + }); - Configure(options => - { - options.Resources - .Add() - .AddVirtualJson("/LINGYUN/Abp/Tencent/Localization/Resources"); - }); + Configure(options => + { + options.Resources + .Add() + .AddVirtualJson("/LINGYUN/Abp/Tencent/Localization/Resources"); + }); - context.Services.AddTransient(typeof(TencentCloudClientFactory<>)); - //Configure(options => - //{ - // 按照腾讯SDK, 所有客户端都有三个参数组成, 暂时设计为通过反射构造函数来创建客户端 - // options.ClientProxies.Add(typeof(AaClient), (cred, endpoint, profile) => new AaClient(cred, endpoint, profile)); - // options.ClientProxies.Add(typeof(AaiClient), (cred, endpoint, profile) => new AaiClient(cred, endpoint, profile)); - // options.ClientProxies.Add(typeof(AdvisorClient), (cred, endpoint, profile) => new AdvisorClient(cred, endpoint, profile)); - //}); - } + context.Services.AddTransient(typeof(TencentCloudClientFactory<>)); + //Configure(options => + //{ + // 按照腾讯SDK, 所有客户端都有三个参数组成, 暂时设计为通过反射构造函数来创建客户端 + // options.ClientProxies.Add(typeof(AaClient), (cred, endpoint, profile) => new AaClient(cred, endpoint, profile)); + // options.ClientProxies.Add(typeof(AaiClient), (cred, endpoint, profile) => new AaiClient(cred, endpoint, profile)); + // options.ClientProxies.Add(typeof(AdvisorClient), (cred, endpoint, profile) => new AdvisorClient(cred, endpoint, profile)); + //}); } } diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/Features/TencentCloudFeatureDefinitionProvider.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/Features/TencentCloudFeatureDefinitionProvider.cs index 9728e791a..d2bbf6c35 100644 --- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/Features/TencentCloudFeatureDefinitionProvider.cs +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/Features/TencentCloudFeatureDefinitionProvider.cs @@ -3,38 +3,37 @@ using Volo.Abp.Localization; using Volo.Abp.Validation.StringValues; -namespace LINGYUN.Abp.Tencent.Features +namespace LINGYUN.Abp.Tencent.Features; + +public class TencentCloudFeatureDefinitionProvider : FeatureDefinitionProvider { - public class TencentCloudFeatureDefinitionProvider : FeatureDefinitionProvider + public override void Define(IFeatureDefinitionContext context) { - public override void Define(IFeatureDefinitionContext context) - { - var group = context.AddGroup(TencentCloudFeatures.GroupName, L("Features:TencentCloud")); + var group = context.AddGroup(TencentCloudFeatures.GroupName, L("Features:TencentCloud")); - var smsEnableFeature = group.AddFeature( - name: TencentCloudFeatures.Sms.Enable, - defaultValue: true.ToString(), - displayName: L("Features:TencentSmsEnable"), - description: L("Features:TencentSmsEnable.Desc"), - valueType: new ToggleStringValueType(new BooleanValueValidator())); + var smsEnableFeature = group.AddFeature( + name: TencentCloudFeatures.Sms.Enable, + defaultValue: true.ToString(), + displayName: L("Features:TencentSmsEnable"), + description: L("Features:TencentSmsEnable.Desc"), + valueType: new ToggleStringValueType(new BooleanValueValidator())); - var blobStoringEnableFeature = group.AddFeature( - name: TencentCloudFeatures.BlobStoring.Enable, - defaultValue: true.ToString(), - displayName: L("Features:TencentBlobStoringEnable"), - description: L("Features:TencentBlobStoringEnable.Desc"), - valueType: new ToggleStringValueType(new BooleanValueValidator())); - blobStoringEnableFeature.CreateChild( - name: TencentCloudFeatures.BlobStoring.MaximumStreamSize, - defaultValue: "0", - displayName: L("Features:TencentBlobStoringMaximumStreamSize"), - description: L("Features:TencentBlobStoringMaximumStreamSize.Desc"), - valueType: new FreeTextStringValueType(new NumericValueValidator(0))); - } + var blobStoringEnableFeature = group.AddFeature( + name: TencentCloudFeatures.BlobStoring.Enable, + defaultValue: true.ToString(), + displayName: L("Features:TencentBlobStoringEnable"), + description: L("Features:TencentBlobStoringEnable.Desc"), + valueType: new ToggleStringValueType(new BooleanValueValidator())); + blobStoringEnableFeature.CreateChild( + name: TencentCloudFeatures.BlobStoring.MaximumStreamSize, + defaultValue: "0", + displayName: L("Features:TencentBlobStoringMaximumStreamSize"), + description: L("Features:TencentBlobStoringMaximumStreamSize.Desc"), + valueType: new FreeTextStringValueType(new NumericValueValidator(0))); + } - protected LocalizableString L(string name) - { - return LocalizableString.Create(name); - } + protected LocalizableString L(string name) + { + return LocalizableString.Create(name); } } diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/Features/TencentCloudFeatures.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/Features/TencentCloudFeatures.cs index 0acce293d..7f9afab83 100644 --- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/Features/TencentCloudFeatures.cs +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/Features/TencentCloudFeatures.cs @@ -1,30 +1,29 @@ -namespace LINGYUN.Abp.Tencent.Features +namespace LINGYUN.Abp.Tencent.Features; + +public static class TencentCloudFeatures { - public static class TencentCloudFeatures - { - public const string GroupName = "Abp.TencentCloud"; + public const string GroupName = "Abp.TencentCloud"; - public static class Sms - { - public const string GroupName = TencentCloudFeatures.GroupName + ".Sms"; - /// - /// 启用短信 - /// - public const string Enable = GroupName + ".Enable"; - } + public static class Sms + { + public const string GroupName = TencentCloudFeatures.GroupName + ".Sms"; + /// + /// 启用短信 + /// + public const string Enable = GroupName + ".Enable"; + } - public static class BlobStoring - { - public const string GroupName = TencentCloudFeatures.GroupName + ".BlobStoring"; - /// - /// 启用对象存储 - /// - public const string Enable = GroupName + ".Enable"; - /// - /// 最大流大小限制, 小于等于0无效, 单位(MB) - /// 默认: 0 - /// - public const string MaximumStreamSize = GroupName + ".MaximumStreamSize"; - } + public static class BlobStoring + { + public const string GroupName = TencentCloudFeatures.GroupName + ".BlobStoring"; + /// + /// 启用对象存储 + /// + public const string Enable = GroupName + ".Enable"; + /// + /// 最大流大小限制, 小于等于0无效, 单位(MB) + /// 默认: 0 + /// + public const string MaximumStreamSize = GroupName + ".MaximumStreamSize"; } } diff --git a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/Localization/TencentCloudResource.cs b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/Localization/TencentCloudResource.cs index 160fcbc6f..43d9653e9 100644 --- a/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/Localization/TencentCloudResource.cs +++ b/aspnet-core/framework/cloud-tencent/LINGYUN.Abp.Tencent/LINGYUN/Abp/Tencent/Localization/TencentCloudResource.cs @@ -1,9 +1,8 @@ using Volo.Abp.Localization; -namespace LINGYUN.Abp.Tencent.Localization +namespace LINGYUN.Abp.Tencent.Localization; + +[LocalizationResourceName("TencentCloud")] +public class TencentCloudResource { - [LocalizationResourceName("TencentCloud")] - public class TencentCloudResource - { - } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.HttpOverrides/LINGYUN.Abp.AspNetCore.HttpOverrides.csproj b/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.HttpOverrides/LINGYUN.Abp.AspNetCore.HttpOverrides.csproj index 2298ea3fd..3fc101e82 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.HttpOverrides/LINGYUN.Abp.AspNetCore.HttpOverrides.csproj +++ b/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.HttpOverrides/LINGYUN.Abp.AspNetCore.HttpOverrides.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.AspNetCore.HttpOverrides + LINGYUN.Abp.AspNetCore.HttpOverrides + false + false + false diff --git a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Mvc.Client/LINGYUN.Abp.AspNetCore.Mvc.Client.csproj b/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Mvc.Client/LINGYUN.Abp.AspNetCore.Mvc.Client.csproj index 0d78d75bd..332e677fd 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Mvc.Client/LINGYUN.Abp.AspNetCore.Mvc.Client.csproj +++ b/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Mvc.Client/LINGYUN.Abp.AspNetCore.Mvc.Client.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.AspNetCore.Mvc.Client + LINGYUN.Abp.AspNetCore.Mvc.Client + false + false + false Library false diff --git a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Mvc.Client/LINGYUN/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientCacheOptions.cs b/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Mvc.Client/LINGYUN/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientCacheOptions.cs index 7172ebec8..4a1d5c9d7 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Mvc.Client/LINGYUN/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientCacheOptions.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Mvc.Client/LINGYUN/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientCacheOptions.cs @@ -1,16 +1,15 @@ -namespace LINGYUN.Abp.AspNetCore.Mvc.Client +namespace LINGYUN.Abp.AspNetCore.Mvc.Client; + +public class AbpAspNetCoreMvcClientCacheOptions { - public class AbpAspNetCoreMvcClientCacheOptions - { - /// - /// 用户缓存过期时间, 单位: 秒 - /// 默认: 300 - /// - public int UserCacheExpirationSeconds { get; set; } = 300; - /// - /// 匿名用户缓存过期时间, 单位: 秒 - /// 默认: 300 - /// - public int AnonymousCacheExpirationSeconds { get; set; } = 300; - } + /// + /// 用户缓存过期时间, 单位: 秒 + /// 默认: 300 + /// + public int UserCacheExpirationSeconds { get; set; } = 300; + /// + /// 匿名用户缓存过期时间, 单位: 秒 + /// 默认: 300 + /// + public int AnonymousCacheExpirationSeconds { get; set; } = 300; } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Mvc.Client/LINGYUN/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientModule.cs b/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Mvc.Client/LINGYUN/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientModule.cs index 3fec75b56..3b21c3f2a 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Mvc.Client/LINGYUN/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientModule.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Mvc.Client/LINGYUN/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientModule.cs @@ -4,18 +4,17 @@ using Volo.Abp.EventBus; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.AspNetCore.Mvc.Client +namespace LINGYUN.Abp.AspNetCore.Mvc.Client; + +[DependsOn( + typeof(AbpAspNetCoreMvcClientCommonModule), + typeof(AbpEventBusModule) + )] +public class AbpAspNetCoreMvcClientModule : AbpModule { - [DependsOn( - typeof(AbpAspNetCoreMvcClientCommonModule), - typeof(AbpEventBusModule) - )] - public class AbpAspNetCoreMvcClientModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) - { - var configuration = context.Services.GetConfiguration(); - Configure(configuration.GetSection("AbpMvcClient:Cache")); - } + var configuration = context.Services.GetConfiguration(); + Configure(configuration.GetSection("AbpMvcClient:Cache")); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Mvc.Client/LINGYUN/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClient.cs b/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Mvc.Client/LINGYUN/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClient.cs index e89dd6060..a1ed81a40 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Mvc.Client/LINGYUN/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClient.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Mvc.Client/LINGYUN/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClient.cs @@ -12,79 +12,78 @@ using Volo.Abp.Threading; using Volo.Abp.Users; -namespace LINGYUN.Abp.AspNetCore.Mvc.Client +namespace LINGYUN.Abp.AspNetCore.Mvc.Client; + +[ExposeServices( + typeof(MvcCachedApplicationConfigurationClient), + typeof(ICachedApplicationConfigurationClient) + )] +public class MvcCachedApplicationConfigurationClient : ICachedApplicationConfigurationClient, ITransientDependency { - [ExposeServices( - typeof(MvcCachedApplicationConfigurationClient), - typeof(ICachedApplicationConfigurationClient) - )] - public class MvcCachedApplicationConfigurationClient : ICachedApplicationConfigurationClient, ITransientDependency + protected IHttpContextAccessor HttpContextAccessor { get; } + protected IHttpClientProxy Proxy { get; } + protected ICurrentUser CurrentUser { get; } + protected IDistributedCache Cache { get; } + protected AbpAspNetCoreMvcClientCacheOptions MvcClientCacheOptions { get; } + + public MvcCachedApplicationConfigurationClient( + IDistributedCache cache, + IHttpClientProxy proxy, + ICurrentUser currentUser, + IHttpContextAccessor httpContextAccessor, + IOptions mvcClientCacheOptions) { - protected IHttpContextAccessor HttpContextAccessor { get; } - protected IHttpClientProxy Proxy { get; } - protected ICurrentUser CurrentUser { get; } - protected IDistributedCache Cache { get; } - protected AbpAspNetCoreMvcClientCacheOptions MvcClientCacheOptions { get; } + Proxy = proxy; + CurrentUser = currentUser; + HttpContextAccessor = httpContextAccessor; + Cache = cache; + MvcClientCacheOptions = mvcClientCacheOptions.Value; + } - public MvcCachedApplicationConfigurationClient( - IDistributedCache cache, - IHttpClientProxy proxy, - ICurrentUser currentUser, - IHttpContextAccessor httpContextAccessor, - IOptions mvcClientCacheOptions) - { - Proxy = proxy; - CurrentUser = currentUser; - HttpContextAccessor = httpContextAccessor; - Cache = cache; - MvcClientCacheOptions = mvcClientCacheOptions.Value; - } + public async Task GetAsync() + { + var cacheKey = CreateCacheKey(); + var httpContext = HttpContextAccessor?.HttpContext; - public async Task GetAsync() + if (httpContext != null && httpContext.Items[cacheKey] is ApplicationConfigurationDto configuration) { - var cacheKey = CreateCacheKey(); - var httpContext = HttpContextAccessor?.HttpContext; - - if (httpContext != null && httpContext.Items[cacheKey] is ApplicationConfigurationDto configuration) - { - return configuration; - } - - configuration = await Cache.GetOrAddAsync( - cacheKey, - async () => await Proxy.Service.GetAsync(new ApplicationConfigurationRequestOptions()), - () => new DistributedCacheEntryOptions - { - AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(CurrentUser.IsAuthenticated - ? MvcClientCacheOptions.UserCacheExpirationSeconds - : MvcClientCacheOptions.AnonymousCacheExpirationSeconds) - } - ); - - if (httpContext != null) - { - httpContext.Items[cacheKey] = configuration; - } - return configuration; } - public ApplicationConfigurationDto Get() - { - var cacheKey = CreateCacheKey(); - var httpContext = HttpContextAccessor?.HttpContext; - - if (httpContext != null && httpContext.Items[cacheKey] is ApplicationConfigurationDto configuration) + configuration = await Cache.GetOrAddAsync( + cacheKey, + async () => await Proxy.Service.GetAsync(new ApplicationConfigurationRequestOptions()), + () => new DistributedCacheEntryOptions { - return configuration; + AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(CurrentUser.IsAuthenticated + ? MvcClientCacheOptions.UserCacheExpirationSeconds + : MvcClientCacheOptions.AnonymousCacheExpirationSeconds) } + ); - return AsyncHelper.RunSync(GetAsync); + if (httpContext != null) + { + httpContext.Items[cacheKey] = configuration; } - protected virtual string CreateCacheKey() + return configuration; + } + + public ApplicationConfigurationDto Get() + { + var cacheKey = CreateCacheKey(); + var httpContext = HttpContextAccessor?.HttpContext; + + if (httpContext != null && httpContext.Items[cacheKey] is ApplicationConfigurationDto configuration) { - return MvcCachedApplicationConfigurationClientHelper.CreateCacheKey(CurrentUser); + return configuration; } + + return AsyncHelper.RunSync(GetAsync); + } + + protected virtual string CreateCacheKey() + { + return MvcCachedApplicationConfigurationClientHelper.CreateCacheKey(CurrentUser); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Mvc.Client/LINGYUN/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClientHelper.cs b/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Mvc.Client/LINGYUN/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClientHelper.cs index 1f0761f66..b83009e12 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Mvc.Client/LINGYUN/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClientHelper.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Mvc.Client/LINGYUN/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClientHelper.cs @@ -1,14 +1,13 @@ using System.Globalization; using Volo.Abp.Users; -namespace LINGYUN.Abp.AspNetCore.Mvc.Client +namespace LINGYUN.Abp.AspNetCore.Mvc.Client; + +internal static class MvcCachedApplicationConfigurationClientHelper { - internal static class MvcCachedApplicationConfigurationClientHelper + public static string CreateCacheKey(ICurrentUser currentUser) { - public static string CreateCacheKey(ICurrentUser currentUser) - { - var userKey = currentUser.Id?.ToString("N") ?? "Anonymous"; - return $"ApplicationConfiguration_{userKey}_{CultureInfo.CurrentUICulture.Name}"; - } + var userKey = currentUser.Id?.ToString("N") ?? "Anonymous"; + return $"ApplicationConfiguration_{userKey}_{CultureInfo.CurrentUICulture.Name}"; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Mvc.Client/LINGYUN/Abp/AspNetCore/Mvc/Client/MvcCurrentApplicationConfigurationCacheResetEventHandler.cs b/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Mvc.Client/LINGYUN/Abp/AspNetCore/Mvc/Client/MvcCurrentApplicationConfigurationCacheResetEventHandler.cs index fa2e7ef65..0a70f0956 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Mvc.Client/LINGYUN/Abp/AspNetCore/Mvc/Client/MvcCurrentApplicationConfigurationCacheResetEventHandler.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Mvc.Client/LINGYUN/Abp/AspNetCore/Mvc/Client/MvcCurrentApplicationConfigurationCacheResetEventHandler.cs @@ -5,30 +5,29 @@ using Volo.Abp.EventBus.Distributed; using Volo.Abp.Users; -namespace LINGYUN.Abp.AspNetCore.Mvc.Client +namespace LINGYUN.Abp.AspNetCore.Mvc.Client; + +public class MvcCurrentApplicationConfigurationCacheResetEventHandler : + IDistributedEventHandler, + ITransientDependency { - public class MvcCurrentApplicationConfigurationCacheResetEventHandler : - IDistributedEventHandler, - ITransientDependency - { - protected ICurrentUser CurrentUser { get; } - protected IDistributedCache Cache { get; } + protected ICurrentUser CurrentUser { get; } + protected IDistributedCache Cache { get; } - public MvcCurrentApplicationConfigurationCacheResetEventHandler(ICurrentUser currentUser, - IDistributedCache cache) - { - CurrentUser = currentUser; - Cache = cache; - } + public MvcCurrentApplicationConfigurationCacheResetEventHandler(ICurrentUser currentUser, + IDistributedCache cache) + { + CurrentUser = currentUser; + Cache = cache; + } - public async virtual Task HandleEventAsync(CurrentApplicationConfigurationCacheResetEventData eventData) - { - await Cache.RemoveAsync(CreateCacheKey()); - } + public async virtual Task HandleEventAsync(CurrentApplicationConfigurationCacheResetEventData eventData) + { + await Cache.RemoveAsync(CreateCacheKey()); + } - protected virtual string CreateCacheKey() - { - return MvcCachedApplicationConfigurationClientHelper.CreateCacheKey(CurrentUser); - } + protected virtual string CreateCacheKey() + { + return MvcCachedApplicationConfigurationClientHelper.CreateCacheKey(CurrentUser); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json.csproj b/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json.csproj index 182624c7e..917ef0741 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json.csproj +++ b/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json + LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json + false + false + false diff --git a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.SignalR/LINGYUN.Abp.AspNetCore.SignalR.JwtToken.csproj b/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.SignalR/LINGYUN.Abp.AspNetCore.SignalR.JwtToken.csproj index f24dee4b4..cdf40b9b0 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.SignalR/LINGYUN.Abp.AspNetCore.SignalR.JwtToken.csproj +++ b/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.SignalR/LINGYUN.Abp.AspNetCore.SignalR.JwtToken.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.AspNetCore.SignalR.JwtToken + LINGYUN.Abp.AspNetCore.SignalR.JwtToken + false + false + false diff --git a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Wrapper/LINGYUN.Abp.AspNetCore.Wrapper.csproj b/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Wrapper/LINGYUN.Abp.AspNetCore.Wrapper.csproj index cc471bca2..0480e541d 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Wrapper/LINGYUN.Abp.AspNetCore.Wrapper.csproj +++ b/aspnet-core/framework/common/LINGYUN.Abp.AspNetCore.Wrapper/LINGYUN.Abp.AspNetCore.Wrapper.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.AspNetCore.Wrapper + LINGYUN.Abp.AspNetCore.Wrapper + false + false + false diff --git a/aspnet-core/framework/common/LINGYUN.Abp.BackgroundJobs.Hangfire/LINGYUN.Abp.BackgroundJobs.Hangfire.csproj b/aspnet-core/framework/common/LINGYUN.Abp.BackgroundJobs.Hangfire/LINGYUN.Abp.BackgroundJobs.Hangfire.csproj index 7787ce63d..5051d3637 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.BackgroundJobs.Hangfire/LINGYUN.Abp.BackgroundJobs.Hangfire.csproj +++ b/aspnet-core/framework/common/LINGYUN.Abp.BackgroundJobs.Hangfire/LINGYUN.Abp.BackgroundJobs.Hangfire.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.BackgroundJobs.Hangfire + LINGYUN.Abp.BackgroundJobs.Hangfire + false + false + false diff --git a/aspnet-core/framework/common/LINGYUN.Abp.BackgroundJobs.Hangfire/LINGYUN/Abp/BackgroundJobs/Hangfire/AbpBackgroundJobsHangfireModule.cs b/aspnet-core/framework/common/LINGYUN.Abp.BackgroundJobs.Hangfire/LINGYUN/Abp/BackgroundJobs/Hangfire/AbpBackgroundJobsHangfireModule.cs index 436b606b8..551bef62b 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.BackgroundJobs.Hangfire/LINGYUN/Abp/BackgroundJobs/Hangfire/AbpBackgroundJobsHangfireModule.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.BackgroundJobs.Hangfire/LINGYUN/Abp/BackgroundJobs/Hangfire/AbpBackgroundJobsHangfireModule.cs @@ -10,53 +10,52 @@ using Volo.Abp.Hangfire; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.BackgroundJobs.Hangfire +namespace LINGYUN.Abp.BackgroundJobs.Hangfire; + +[DependsOn( + typeof(AbpBackgroundJobsAbstractionsModule), + typeof(AbpHangfireModule), + typeof(AbpHangfireDashboardModule) +)] +public class AbpBackgroundJobsHangfireModule : AbpModule { - [DependsOn( - typeof(AbpBackgroundJobsAbstractionsModule), - typeof(AbpHangfireModule), - typeof(AbpHangfireDashboardModule) - )] - public class AbpBackgroundJobsHangfireModule : AbpModule + public override void PreConfigureServices(ServiceConfigurationContext context) { - public override void PreConfigureServices(ServiceConfigurationContext context) + PreConfigure(options => { - PreConfigure(options => + options.DisplayNameFunc = (dashboardContext, job) => { - options.DisplayNameFunc = (dashboardContext, job) => + if (job.Args.Count == 0) { - if (job.Args.Count == 0) - { - return job.Type.FullName; + return job.Type.FullName; - //if (job.Type.GenericTypeArguments.Length == 0) - //{ - // return job.Type.FullName; - //} - //// TODO: 把特性作为任务名称? - //return BackgroundJobNameAttribute.GetName(job.Type.GenericTypeArguments[0]); - } - var context = dashboardContext.GetHttpContext(); - var options = context.RequestServices.GetRequiredService>().Value; - return options.GetJob(job.Args.First().GetType()).JobName; - }; - }); - } + //if (job.Type.GenericTypeArguments.Length == 0) + //{ + // return job.Type.FullName; + //} + //// TODO: 把特性作为任务名称? + //return BackgroundJobNameAttribute.GetName(job.Type.GenericTypeArguments[0]); + } + var context = dashboardContext.GetHttpContext(); + var options = context.RequestServices.GetRequiredService>().Value; + return options.GetJob(job.Args.First().GetType()).JobName; + }; + }); + } - public override void OnPreApplicationInitialization(ApplicationInitializationContext context) + public override void OnPreApplicationInitialization(ApplicationInitializationContext context) + { + var jobOptions = context.ServiceProvider.GetRequiredService>().Value; + if (!jobOptions.IsJobExecutionEnabled) { - var jobOptions = context.ServiceProvider.GetRequiredService>().Value; - if (!jobOptions.IsJobExecutionEnabled) - { - var hangfireOptions = context.ServiceProvider.GetRequiredService>().Value; - hangfireOptions.BackgroundJobServerFactory = CreateOnlyEnqueueJobServer; - } + var hangfireOptions = context.ServiceProvider.GetRequiredService>().Value; + hangfireOptions.BackgroundJobServerFactory = CreateOnlyEnqueueJobServer; } + } - private BackgroundJobServer CreateOnlyEnqueueJobServer(IServiceProvider serviceProvider) - { - serviceProvider.GetRequiredService(); - return null; - } + private BackgroundJobServer CreateOnlyEnqueueJobServer(IServiceProvider serviceProvider) + { + serviceProvider.GetRequiredService(); + return null; } } \ No newline at end of file diff --git a/aspnet-core/framework/common/LINGYUN.Abp.BackgroundJobs.Hangfire/LINGYUN/Abp/BackgroundJobs/Hangfire/HangfireBackgroundJobManager.cs b/aspnet-core/framework/common/LINGYUN.Abp.BackgroundJobs.Hangfire/LINGYUN/Abp/BackgroundJobs/Hangfire/HangfireBackgroundJobManager.cs index 6012742e1..fd3bfc781 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.BackgroundJobs.Hangfire/LINGYUN/Abp/BackgroundJobs/Hangfire/HangfireBackgroundJobManager.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.BackgroundJobs.Hangfire/LINGYUN/Abp/BackgroundJobs/Hangfire/HangfireBackgroundJobManager.cs @@ -4,31 +4,30 @@ using Volo.Abp.BackgroundJobs; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.BackgroundJobs.Hangfire +namespace LINGYUN.Abp.BackgroundJobs.Hangfire; + +[Dependency(ReplaceServices = true)] +public class HangfireBackgroundJobManager : IBackgroundJobManager, ITransientDependency { - [Dependency(ReplaceServices = true)] - public class HangfireBackgroundJobManager : IBackgroundJobManager, ITransientDependency + public virtual Task EnqueueAsync(TArgs args, BackgroundJobPriority priority = BackgroundJobPriority.Normal, + TimeSpan? delay = null) { - public virtual Task EnqueueAsync(TArgs args, BackgroundJobPriority priority = BackgroundJobPriority.Normal, - TimeSpan? delay = null) + if (!delay.HasValue) + { + return Task.FromResult( + BackgroundJob.Enqueue>( + adapter => adapter.ExecuteAsync(args) + ) + ); + } + else { - if (!delay.HasValue) - { - return Task.FromResult( - BackgroundJob.Enqueue>( - adapter => adapter.ExecuteAsync(args) - ) - ); - } - else - { - return Task.FromResult( - BackgroundJob.Schedule>( - adapter => adapter.ExecuteAsync(args), - delay.Value - ) - ); - } + return Task.FromResult( + BackgroundJob.Schedule>( + adapter => adapter.ExecuteAsync(args), + delay.Value + ) + ); } } } \ No newline at end of file diff --git a/aspnet-core/framework/common/LINGYUN.Abp.BackgroundJobs.Hangfire/LINGYUN/Abp/BackgroundJobs/Hangfire/HangfireJobExecutionAdapter.cs b/aspnet-core/framework/common/LINGYUN.Abp.BackgroundJobs.Hangfire/LINGYUN/Abp/BackgroundJobs/Hangfire/HangfireJobExecutionAdapter.cs index 588c4cff0..bd88a9fdf 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.BackgroundJobs.Hangfire/LINGYUN/Abp/BackgroundJobs/Hangfire/HangfireJobExecutionAdapter.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.BackgroundJobs.Hangfire/LINGYUN/Abp/BackgroundJobs/Hangfire/HangfireJobExecutionAdapter.cs @@ -4,43 +4,42 @@ using Volo.Abp; using Volo.Abp.BackgroundJobs; -namespace LINGYUN.Abp.BackgroundJobs.Hangfire +namespace LINGYUN.Abp.BackgroundJobs.Hangfire; + +public class HangfireJobExecutionAdapter { - public class HangfireJobExecutionAdapter + protected AbpBackgroundJobOptions Options { get; } + protected IServiceScopeFactory ServiceScopeFactory { get; } + protected IBackgroundJobExecuter JobExecuter { get; } + + public HangfireJobExecutionAdapter( + IOptions options, + IBackgroundJobExecuter jobExecuter, + IServiceScopeFactory serviceScopeFactory) { - protected AbpBackgroundJobOptions Options { get; } - protected IServiceScopeFactory ServiceScopeFactory { get; } - protected IBackgroundJobExecuter JobExecuter { get; } + JobExecuter = jobExecuter; + ServiceScopeFactory = serviceScopeFactory; + Options = options.Value; + } - public HangfireJobExecutionAdapter( - IOptions options, - IBackgroundJobExecuter jobExecuter, - IServiceScopeFactory serviceScopeFactory) + public async Task ExecuteAsync(TArgs args) + { + if (!Options.IsJobExecutionEnabled) { - JobExecuter = jobExecuter; - ServiceScopeFactory = serviceScopeFactory; - Options = options.Value; + throw new AbpException( + "Background job execution is disabled. " + + "This method should not be called! " + + "If you want to enable the background job execution, " + + $"set {nameof(AbpBackgroundJobOptions)}.{nameof(AbpBackgroundJobOptions.IsJobExecutionEnabled)} to true! " + + "If you've intentionally disabled job execution and this seems a bug, please report it." + ); } - public async Task ExecuteAsync(TArgs args) + using (var scope = ServiceScopeFactory.CreateScope()) { - if (!Options.IsJobExecutionEnabled) - { - throw new AbpException( - "Background job execution is disabled. " + - "This method should not be called! " + - "If you want to enable the background job execution, " + - $"set {nameof(AbpBackgroundJobOptions)}.{nameof(AbpBackgroundJobOptions.IsJobExecutionEnabled)} to true! " + - "If you've intentionally disabled job execution and this seems a bug, please report it." - ); - } - - using (var scope = ServiceScopeFactory.CreateScope()) - { - var jobType = Options.GetJob(typeof(TArgs)).JobType; - var context = new JobExecutionContext(scope.ServiceProvider, jobType, args); - await JobExecuter.ExecuteAsync(context); - } + var jobType = Options.GetJob(typeof(TArgs)).JobType; + var context = new JobExecutionContext(scope.ServiceProvider, jobType, args); + await JobExecuter.ExecuteAsync(context); } } } \ No newline at end of file diff --git a/aspnet-core/framework/common/LINGYUN.Abp.BackgroundJobs.Hangfire/Volo/Abp/BackgroundJobs/CronGenerator.cs b/aspnet-core/framework/common/LINGYUN.Abp.BackgroundJobs.Hangfire/Volo/Abp/BackgroundJobs/CronGenerator.cs index fae4a57b1..215c11219 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.BackgroundJobs.Hangfire/Volo/Abp/BackgroundJobs/CronGenerator.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.BackgroundJobs.Hangfire/Volo/Abp/BackgroundJobs/CronGenerator.cs @@ -1,78 +1,77 @@ using Hangfire; using System; -namespace Volo.Abp.BackgroundJobs +namespace Volo.Abp.BackgroundJobs; + +public class CronGenerator { - public class CronGenerator + /// + /// 周期性为分钟的任务 + /// + /// 执行周期的间隔,默认为每分钟一次 + /// + public static string Minute(int interval = 1) { - /// - /// 周期性为分钟的任务 - /// - /// 执行周期的间隔,默认为每分钟一次 - /// - public static string Minute(int interval = 1) - { - return $"1 0/{interval} * * * ? "; - } + return $"1 0/{interval} * * * ? "; + } - /// - /// 周期性为小时的任务 - /// - /// 第几分钟开始,默认为第一分钟 - /// 执行周期的间隔,默认为每小时一次 - /// - public static string Hour(int minute = 1, int interval = 1) - { - return $"1 {minute} 0/ {interval} * * ? "; - } + /// + /// 周期性为小时的任务 + /// + /// 第几分钟开始,默认为第一分钟 + /// 执行周期的间隔,默认为每小时一次 + /// + public static string Hour(int minute = 1, int interval = 1) + { + return $"1 {minute} 0/ {interval} * * ? "; + } - /// - /// 周期性为天的任务 - /// - /// 第几小时开始,默认从1点开始 - /// 第几分钟开始,默认从第1分钟开始 - /// 执行周期的间隔,默认为每天一次 - /// - public static string Day(int hour = 1, int minute = 1, int interval = 1) - { - return $"1 {minute} {hour} 1/ {interval} * ? "; - } + /// + /// 周期性为天的任务 + /// + /// 第几小时开始,默认从1点开始 + /// 第几分钟开始,默认从第1分钟开始 + /// 执行周期的间隔,默认为每天一次 + /// + public static string Day(int hour = 1, int minute = 1, int interval = 1) + { + return $"1 {minute} {hour} 1/ {interval} * ? "; + } - /// - /// 周期性为周的任务 - /// - /// 星期几开始,默认从星期一点开始 - /// 第几小时开始,默认从1点开始 - /// 第几分钟开始,默认从第1分钟开始 - /// - public static string Week(DayOfWeek dayOfWeek = DayOfWeek.Monday, int hour = 1, int minute = 1) - { - return Cron.Weekly(dayOfWeek, hour, minute); - } + /// + /// 周期性为周的任务 + /// + /// 星期几开始,默认从星期一点开始 + /// 第几小时开始,默认从1点开始 + /// 第几分钟开始,默认从第1分钟开始 + /// + public static string Week(DayOfWeek dayOfWeek = DayOfWeek.Monday, int hour = 1, int minute = 1) + { + return Cron.Weekly(dayOfWeek, hour, minute); + } - /// - /// 周期性为月的任务 - /// - /// 几号开始,默认从一号开始 - /// 第几小时开始,默认从1点开始 - /// 第几分钟开始,默认从第1分钟开始 - /// - public static string Month(int day = 1, int hour = 1, int minute = 1) - { - return Cron.Monthly(day, hour, minute); - } + /// + /// 周期性为月的任务 + /// + /// 几号开始,默认从一号开始 + /// 第几小时开始,默认从1点开始 + /// 第几分钟开始,默认从第1分钟开始 + /// + public static string Month(int day = 1, int hour = 1, int minute = 1) + { + return Cron.Monthly(day, hour, minute); + } - /// - /// 周期性为年的任务 - /// - /// 几月开始,默认从一月开始 - /// 几号开始,默认从一号开始 - /// 第几小时开始,默认从1点开始 - /// 第几分钟开始,默认从第1分钟开始 - /// - public static string Year(int month = 1, int day = 1, int hour = 1, int minute = 1) - { - return Cron.Yearly(month, day, hour, minute); - } + /// + /// 周期性为年的任务 + /// + /// 几月开始,默认从一月开始 + /// 几号开始,默认从一号开始 + /// 第几小时开始,默认从1点开始 + /// 第几分钟开始,默认从第1分钟开始 + /// + public static string Year(int month = 1, int day = 1, int hour = 1, int minute = 1) + { + return Cron.Yearly(month, day, hour, minute); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.BackgroundJobs.Hangfire/Volo/Abp/BackgroundJobs/IBackgroundJobManagerExtensions.cs b/aspnet-core/framework/common/LINGYUN.Abp.BackgroundJobs.Hangfire/Volo/Abp/BackgroundJobs/IBackgroundJobManagerExtensions.cs index 3615e3053..7faded953 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.BackgroundJobs.Hangfire/Volo/Abp/BackgroundJobs/IBackgroundJobManagerExtensions.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.BackgroundJobs.Hangfire/Volo/Abp/BackgroundJobs/IBackgroundJobManagerExtensions.cs @@ -3,32 +3,31 @@ using LINGYUN.Abp.BackgroundJobs.Hangfire; using System.Threading.Tasks; -namespace Volo.Abp.BackgroundJobs +namespace Volo.Abp.BackgroundJobs; + +public static class IBackgroundJobManagerExtensions { - public static class IBackgroundJobManagerExtensions + /// + /// 后台作业进入周期性队列 + /// + /// 作业参数类型 + /// 后台作业管理器 + /// Cron表达式 + /// 作业参数 + /// + public static Task EnqueueAsync( + this IBackgroundJobManager backgroundJobManager, + [NotNull] string cron, + TArgs args + ) { - /// - /// 后台作业进入周期性队列 - /// - /// 作业参数类型 - /// 后台作业管理器 - /// Cron表达式 - /// 作业参数 - /// - public static Task EnqueueAsync( - this IBackgroundJobManager backgroundJobManager, - [NotNull] string cron, - TArgs args - ) - { - Check.NotNullOrWhiteSpace(cron, nameof(cron)); - Check.NotNull(args, nameof(args)); + Check.NotNullOrWhiteSpace(cron, nameof(cron)); + Check.NotNull(args, nameof(args)); - var jobName = BackgroundJobNameAttribute.GetName(); + var jobName = BackgroundJobNameAttribute.GetName(); - RecurringJob.AddOrUpdate>(jobName, adapter => adapter.ExecuteAsync(args), cron); + RecurringJob.AddOrUpdate>(jobName, adapter => adapter.ExecuteAsync(args), cron); - return Task.CompletedTask; - } + return Task.CompletedTask; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.BackgroundWorkers.Hangfire/LINGYUN.Abp.BackgroundWorkers.Hangfire.csproj b/aspnet-core/framework/common/LINGYUN.Abp.BackgroundWorkers.Hangfire/LINGYUN.Abp.BackgroundWorkers.Hangfire.csproj index 34d901703..0af056b31 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.BackgroundWorkers.Hangfire/LINGYUN.Abp.BackgroundWorkers.Hangfire.csproj +++ b/aspnet-core/framework/common/LINGYUN.Abp.BackgroundWorkers.Hangfire/LINGYUN.Abp.BackgroundWorkers.Hangfire.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.BackgroundWorkers.Hangfire + LINGYUN.Abp.BackgroundWorkers.Hangfire + false + false + false diff --git a/aspnet-core/framework/common/LINGYUN.Abp.BackgroundWorkers.Hangfire/LINGYUN/Abp/BackgroundWorkers/Hangfire/AbpBackgroundWorkersHangfireModule.cs b/aspnet-core/framework/common/LINGYUN.Abp.BackgroundWorkers.Hangfire/LINGYUN/Abp/BackgroundWorkers/Hangfire/AbpBackgroundWorkersHangfireModule.cs index b1014c313..ced5e0c6b 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.BackgroundWorkers.Hangfire/LINGYUN/Abp/BackgroundWorkers/Hangfire/AbpBackgroundWorkersHangfireModule.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.BackgroundWorkers.Hangfire/LINGYUN/Abp/BackgroundWorkers/Hangfire/AbpBackgroundWorkersHangfireModule.cs @@ -3,17 +3,16 @@ using Volo.Abp.Hangfire; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.BackgroundWorkers.Hangfire +namespace LINGYUN.Abp.BackgroundWorkers.Hangfire; + +[DependsOn( + typeof(AbpBackgroundWorkersModule), + typeof(AbpHangfireModule) +)] +public class AbpBackgroundWorkersHangfireModule : AbpModule { - [DependsOn( - typeof(AbpBackgroundWorkersModule), - typeof(AbpHangfireModule) - )] - public class AbpBackgroundWorkersHangfireModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddSingleton(typeof(HangfireBackgroundWorkerAdapter<>)); - } + context.Services.AddSingleton(typeof(HangfireBackgroundWorkerAdapter<>)); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.BackgroundWorkers.Hangfire/LINGYUN/Abp/BackgroundWorkers/Hangfire/Check.cs b/aspnet-core/framework/common/LINGYUN.Abp.BackgroundWorkers.Hangfire/LINGYUN/Abp/BackgroundWorkers/Hangfire/Check.cs index bf5fc8955..23fab3f03 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.BackgroundWorkers.Hangfire/LINGYUN/Abp/BackgroundWorkers/Hangfire/Check.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.BackgroundWorkers.Hangfire/LINGYUN/Abp/BackgroundWorkers/Hangfire/Check.cs @@ -1,25 +1,24 @@ using JetBrains.Annotations; using System; -namespace LINGYUN.Abp.BackgroundWorkers.Hangfire +namespace LINGYUN.Abp.BackgroundWorkers.Hangfire; + +internal static class Check { - internal static class Check + public static int Range( + int value, + [InvokerParameterName][NotNull] string parameterName, + int minimum = int.MinValue, + int maximum = int.MaxValue) { - public static int Range( - int value, - [InvokerParameterName][NotNull] string parameterName, - int minimum = int.MinValue, - int maximum = int.MaxValue) + if (value < minimum) + { + throw new ArgumentException($"{parameterName} must be equal to or lower than {minimum}!", parameterName); + } + if (value > maximum) { - if (value < minimum) - { - throw new ArgumentException($"{parameterName} must be equal to or lower than {minimum}!", parameterName); - } - if (value > maximum) - { - throw new ArgumentException($"{parameterName} must be equal to or greater than {maximum}!", parameterName); - } - return value; + throw new ArgumentException($"{parameterName} must be equal to or greater than {maximum}!", parameterName); } + return value; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.BackgroundWorkers.Hangfire/LINGYUN/Abp/BackgroundWorkers/Hangfire/CronGenerator.cs b/aspnet-core/framework/common/LINGYUN.Abp.BackgroundWorkers.Hangfire/LINGYUN/Abp/BackgroundWorkers/Hangfire/CronGenerator.cs index 5d811a383..8608a2868 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.BackgroundWorkers.Hangfire/LINGYUN/Abp/BackgroundWorkers/Hangfire/CronGenerator.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.BackgroundWorkers.Hangfire/LINGYUN/Abp/BackgroundWorkers/Hangfire/CronGenerator.cs @@ -1,171 +1,170 @@ using System; -namespace LINGYUN.Abp.BackgroundWorkers.Hangfire +namespace LINGYUN.Abp.BackgroundWorkers.Hangfire; + +public class CronGenerator { - public class CronGenerator + public const long MilliSecondsOfYear = 315_3600_0000L; + public const long MilliSecondsOfMonth = 26_7840_0000L; + public const int MilliSecondsOfWeek = 6_0480_0000; + public const int MilliSecondsOfDays = 8640_0000; + public const int MilliSecondsOfHours = 360_0000; + public const int MilliSecondsOfMinutes = 60000; + + /// + /// 从毫秒计算Cron表达式 + /// + /// + /// + public static string FormMilliseconds(long milliseconds = 1000) { - public const long MilliSecondsOfYear = 315_3600_0000L; - public const long MilliSecondsOfMonth = 26_7840_0000L; - public const int MilliSecondsOfWeek = 6_0480_0000; - public const int MilliSecondsOfDays = 8640_0000; - public const int MilliSecondsOfHours = 360_0000; - public const int MilliSecondsOfMinutes = 60000; - - /// - /// 从毫秒计算Cron表达式 - /// - /// - /// - public static string FormMilliseconds(long milliseconds = 1000) + if (milliseconds <= 1000) { - if (milliseconds <= 1000) - { - return Seconds(0, 1); - } - - if (milliseconds >= MilliSecondsOfYear) - { - return Year(1, 1, 0, 0, 2001, (int)(milliseconds / MilliSecondsOfYear)); - } - - if (milliseconds >= MilliSecondsOfMonth) - { - return Month(1, 0, 0, 1, (int)(milliseconds / MilliSecondsOfMonth)); - } - - // TODO: 以周为单位的任务Cron - if (milliseconds >= MilliSecondsOfWeek) - { - return Day(0, 0, 1, (int)(milliseconds / MilliSecondsOfWeek)); - } - - if (milliseconds >= MilliSecondsOfDays) - { - return Day(0, 0, 1, (int)(milliseconds / MilliSecondsOfDays)); - } - - if (milliseconds >= MilliSecondsOfHours) - { - return Hour(0, 0, (int)(milliseconds / MilliSecondsOfHours)); - } - - if (milliseconds >= MilliSecondsOfMinutes) - { - return Minute(0, 0, (int)(milliseconds / MilliSecondsOfMinutes)); - } - - return Seconds(0, (int)(milliseconds / 1000)); + return Seconds(0, 1); } - /// - /// 周期性为秒钟的任务 - /// - /// 第几秒开始,默认为第0秒 - /// 执行周期的间隔,默认为每5秒一次 - /// - public static string Seconds(int second = 0, int interval = 5) - { - Check.Range(second, nameof(second), 0, 59); - return $"{second}/{interval} * * * * ? "; + if (milliseconds >= MilliSecondsOfYear) + { + return Year(1, 1, 0, 0, 2001, (int)(milliseconds / MilliSecondsOfYear)); } - /// - /// 周期性为分钟的任务 - /// - /// 第几秒开始,默认为第0秒 - /// 第几分钟开始,默认为第0分钟 - /// 执行周期的间隔,默认为每分钟一次 - /// - public static string Minute(int second = 0, int minute = 0, int interval = 1) + if (milliseconds >= MilliSecondsOfMonth) { - Check.Range(second, nameof(second), 0, 59); - Check.Range(minute, nameof(minute), 0, 59); - - return $"{second} {minute}/{interval} * * * ? "; + return Month(1, 0, 0, 1, (int)(milliseconds / MilliSecondsOfMonth)); } - /// - /// 周期性为小时的任务 - /// - /// 第几分钟开始,默认为第0分钟 - /// 第几小时开始,默认为0点 - /// 执行周期的间隔,默认为每小时一次 - /// - public static string Hour(int minute = 0, int hour = 0, int interval = 1) + // TODO: 以周为单位的任务Cron + if (milliseconds >= MilliSecondsOfWeek) { - Check.Range(hour, nameof(hour), 0, 23); - Check.Range(minute, nameof(minute), 0, 59); - - return $"0 {minute} {hour}/{interval} * * ? "; + return Day(0, 0, 1, (int)(milliseconds / MilliSecondsOfWeek)); } - /// - /// 周期性为天的任务 - /// - /// 第几小时开始,默认从0点开始 - /// 第几分钟开始,默认从第0分钟开始 - /// 第几天开始,默认从第1天开始 - /// 执行周期的间隔,默认为每天一次 - /// - public static string Day(int hour = 0, int minute = 0, int day = 1, int interval = 1) + if (milliseconds >= MilliSecondsOfDays) { - Check.Range(hour, nameof(hour), 0, 23); - Check.Range(minute, nameof(minute), 0, 59); - Check.Range(day, nameof(day), 1, 31); - - return $"0 {minute} {hour} {day}/{interval} * ? "; + return Day(0, 0, 1, (int)(milliseconds / MilliSecondsOfDays)); } - /// - /// 周期性为周的任务 - /// - /// 星期几开始,默认从星期一点开始 - /// 第几小时开始,默认从0点开始 - /// 第几分钟开始,默认从第0分钟开始 - /// - public static string Week(DayOfWeek dayOfWeek = DayOfWeek.Monday, int hour = 0, int minute = 0) + if (milliseconds >= MilliSecondsOfHours) { - Check.Range(hour, nameof(hour), 0, 23); - Check.Range(minute, nameof(minute), 0, 59); - - return $"{minute} {hour} * * {dayOfWeek.ToString().Substring(0, 3)}"; + return Hour(0, 0, (int)(milliseconds / MilliSecondsOfHours)); } - /// - /// 周期性为月的任务 - /// - /// 几号开始,默认从一号开始 - /// 第几小时开始,默认从0点开始 - /// 第几分钟开始,默认从第0分钟开始 - /// 第几月开始,默认从第1月开始 - /// 月份间隔 - /// - public static string Month(int day = 1, int hour = 0, int minute = 0, int month = 1, int interval = 1) + if (milliseconds >= MilliSecondsOfMinutes) { - Check.Range(hour, nameof(hour), 0, 23); - Check.Range(minute, nameof(minute), 0, 59); - Check.Range(day, nameof(day), 1, 31); - - return $"0 {minute} {hour} {day} {month}/{interval} ?"; + return Minute(0, 0, (int)(milliseconds / MilliSecondsOfMinutes)); } - /// - /// 周期性为年的任务 - /// - /// 几月开始,默认从一月开始 - /// 几号开始,默认从一号开始 - /// 第几小时开始,默认从0点开始 - /// 第几年开始,默认从2001年开始 - /// 第几分钟开始,默认从第0分钟开始 - /// - public static string Year(int month = 1, int day = 1, int hour = 0, int minute = 0, int year = 2001, int interval = 1) - { - Check.Range(hour, nameof(hour), 0, 23); - Check.Range(minute, nameof(minute), 0, 59); - Check.Range(day, nameof(day), 1, 31); - Check.Range(month, nameof(month), 1, 12); + return Seconds(0, (int)(milliseconds / 1000)); + } + /// + /// 周期性为秒钟的任务 + /// + /// 第几秒开始,默认为第0秒 + /// 执行周期的间隔,默认为每5秒一次 + /// + public static string Seconds(int second = 0, int interval = 5) + { + Check.Range(second, nameof(second), 0, 59); - return $"0 {minute} {hour} {day} {month} ? {year}/{interval}"; - } + return $"{second}/{interval} * * * * ? "; + } + + /// + /// 周期性为分钟的任务 + /// + /// 第几秒开始,默认为第0秒 + /// 第几分钟开始,默认为第0分钟 + /// 执行周期的间隔,默认为每分钟一次 + /// + public static string Minute(int second = 0, int minute = 0, int interval = 1) + { + Check.Range(second, nameof(second), 0, 59); + Check.Range(minute, nameof(minute), 0, 59); + + return $"{second} {minute}/{interval} * * * ? "; + } + + /// + /// 周期性为小时的任务 + /// + /// 第几分钟开始,默认为第0分钟 + /// 第几小时开始,默认为0点 + /// 执行周期的间隔,默认为每小时一次 + /// + public static string Hour(int minute = 0, int hour = 0, int interval = 1) + { + Check.Range(hour, nameof(hour), 0, 23); + Check.Range(minute, nameof(minute), 0, 59); + + return $"0 {minute} {hour}/{interval} * * ? "; + } + + /// + /// 周期性为天的任务 + /// + /// 第几小时开始,默认从0点开始 + /// 第几分钟开始,默认从第0分钟开始 + /// 第几天开始,默认从第1天开始 + /// 执行周期的间隔,默认为每天一次 + /// + public static string Day(int hour = 0, int minute = 0, int day = 1, int interval = 1) + { + Check.Range(hour, nameof(hour), 0, 23); + Check.Range(minute, nameof(minute), 0, 59); + Check.Range(day, nameof(day), 1, 31); + + return $"0 {minute} {hour} {day}/{interval} * ? "; + } + + /// + /// 周期性为周的任务 + /// + /// 星期几开始,默认从星期一点开始 + /// 第几小时开始,默认从0点开始 + /// 第几分钟开始,默认从第0分钟开始 + /// + public static string Week(DayOfWeek dayOfWeek = DayOfWeek.Monday, int hour = 0, int minute = 0) + { + Check.Range(hour, nameof(hour), 0, 23); + Check.Range(minute, nameof(minute), 0, 59); + + return $"{minute} {hour} * * {dayOfWeek.ToString().Substring(0, 3)}"; + } + + /// + /// 周期性为月的任务 + /// + /// 几号开始,默认从一号开始 + /// 第几小时开始,默认从0点开始 + /// 第几分钟开始,默认从第0分钟开始 + /// 第几月开始,默认从第1月开始 + /// 月份间隔 + /// + public static string Month(int day = 1, int hour = 0, int minute = 0, int month = 1, int interval = 1) + { + Check.Range(hour, nameof(hour), 0, 23); + Check.Range(minute, nameof(minute), 0, 59); + Check.Range(day, nameof(day), 1, 31); + + return $"0 {minute} {hour} {day} {month}/{interval} ?"; + } + + /// + /// 周期性为年的任务 + /// + /// 几月开始,默认从一月开始 + /// 几号开始,默认从一号开始 + /// 第几小时开始,默认从0点开始 + /// 第几年开始,默认从2001年开始 + /// 第几分钟开始,默认从第0分钟开始 + /// + public static string Year(int month = 1, int day = 1, int hour = 0, int minute = 0, int year = 2001, int interval = 1) + { + Check.Range(hour, nameof(hour), 0, 23); + Check.Range(minute, nameof(minute), 0, 59); + Check.Range(day, nameof(day), 1, 31); + Check.Range(month, nameof(month), 1, 12); + + return $"0 {minute} {hour} {day} {month} ? {year}/{interval}"; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.BackgroundWorkers.Hangfire/LINGYUN/Abp/BackgroundWorkers/Hangfire/HangfireBackgroundWorkerAdapter.cs b/aspnet-core/framework/common/LINGYUN.Abp.BackgroundWorkers.Hangfire/LINGYUN/Abp/BackgroundWorkers/Hangfire/HangfireBackgroundWorkerAdapter.cs index f81116bf9..212036dee 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.BackgroundWorkers.Hangfire/LINGYUN/Abp/BackgroundWorkers/Hangfire/HangfireBackgroundWorkerAdapter.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.BackgroundWorkers.Hangfire/LINGYUN/Abp/BackgroundWorkers/Hangfire/HangfireBackgroundWorkerAdapter.cs @@ -3,46 +3,45 @@ using System.Threading.Tasks; using Volo.Abp.BackgroundWorkers; -namespace LINGYUN.Abp.BackgroundWorkers.Hangfire +namespace LINGYUN.Abp.BackgroundWorkers.Hangfire; + +public class HangfireBackgroundWorkerAdapter : BackgroundWorkerBase, IHangfireBackgroundWorkerAdapter + where TWorker : IBackgroundWorker { - public class HangfireBackgroundWorkerAdapter : BackgroundWorkerBase, IHangfireBackgroundWorkerAdapter - where TWorker : IBackgroundWorker + private readonly MethodInfo _doWorkAsyncMethod; + private readonly MethodInfo _doWorkMethod; + + public HangfireBackgroundWorkerAdapter() { - private readonly MethodInfo _doWorkAsyncMethod; - private readonly MethodInfo _doWorkMethod; + _doWorkAsyncMethod = typeof(TWorker).GetMethod("DoWorkAsync", BindingFlags.Instance | BindingFlags.NonPublic); + _doWorkMethod = typeof(TWorker).GetMethod("DoWork", BindingFlags.Instance | BindingFlags.NonPublic); + } - public HangfireBackgroundWorkerAdapter() - { - _doWorkAsyncMethod = typeof(TWorker).GetMethod("DoWorkAsync", BindingFlags.Instance | BindingFlags.NonPublic); - _doWorkMethod = typeof(TWorker).GetMethod("DoWork", BindingFlags.Instance | BindingFlags.NonPublic); - } + public async virtual Task ExecuteAsync(CancellationToken cancellationToken = default) + { + var worker = (IBackgroundWorker)ServiceProvider.GetService(typeof(TWorker)); + var workerContext = new PeriodicBackgroundWorkerContext(ServiceProvider, cancellationToken); - public async virtual Task ExecuteAsync(CancellationToken cancellationToken = default) + switch (worker) { - var worker = (IBackgroundWorker)ServiceProvider.GetService(typeof(TWorker)); - var workerContext = new PeriodicBackgroundWorkerContext(ServiceProvider, cancellationToken); - - switch (worker) - { - case AsyncPeriodicBackgroundWorkerBase asyncWorker: + case AsyncPeriodicBackgroundWorkerBase asyncWorker: + { + if (_doWorkAsyncMethod != null) { - if (_doWorkAsyncMethod != null) - { - await (Task)_doWorkAsyncMethod.Invoke(asyncWorker, new object[] { workerContext }); - } - - break; + await (Task)_doWorkAsyncMethod.Invoke(asyncWorker, new object[] { workerContext }); } - case PeriodicBackgroundWorkerBase syncWorker: - { - if (_doWorkMethod != null) - { - _doWorkMethod.Invoke(syncWorker, new object[] { workerContext }); - } - break; + break; + } + case PeriodicBackgroundWorkerBase syncWorker: + { + if (_doWorkMethod != null) + { + _doWorkMethod.Invoke(syncWorker, new object[] { workerContext }); } - } + + break; + } } } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.BackgroundWorkers.Hangfire/LINGYUN/Abp/BackgroundWorkers/Hangfire/HangfireBackgroundWorkerManager.cs b/aspnet-core/framework/common/LINGYUN.Abp.BackgroundWorkers.Hangfire/LINGYUN/Abp/BackgroundWorkers/Hangfire/HangfireBackgroundWorkerManager.cs index ad86d89d5..85a835334 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.BackgroundWorkers.Hangfire/LINGYUN/Abp/BackgroundWorkers/Hangfire/HangfireBackgroundWorkerManager.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.BackgroundWorkers.Hangfire/LINGYUN/Abp/BackgroundWorkers/Hangfire/HangfireBackgroundWorkerManager.cs @@ -7,59 +7,58 @@ using Volo.Abp.BackgroundWorkers; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.BackgroundWorkers.Hangfire +namespace LINGYUN.Abp.BackgroundWorkers.Hangfire; + +[Dependency(ReplaceServices = true)] +public class HangfireBackgroundWorkerManager : IBackgroundWorkerManager, ISingletonDependency { - [Dependency(ReplaceServices = true)] - public class HangfireBackgroundWorkerManager : IBackgroundWorkerManager, ISingletonDependency + protected IServiceProvider ServiceProvider { get; } + + public HangfireBackgroundWorkerManager( + IServiceProvider serviceProvider) { - protected IServiceProvider ServiceProvider { get; } + ServiceProvider = serviceProvider; + } - public HangfireBackgroundWorkerManager( - IServiceProvider serviceProvider) - { - ServiceProvider = serviceProvider; - } + public Task AddAsync(IBackgroundWorker worker, CancellationToken cancellationToken = default) + { + var timer = worker.GetType() + .GetProperty("Timer", BindingFlags.NonPublic | BindingFlags.Instance)? + .GetValue(worker); - public Task AddAsync(IBackgroundWorker worker, CancellationToken cancellationToken = default) + if (timer == null) { - var timer = worker.GetType() - .GetProperty("Timer", BindingFlags.NonPublic | BindingFlags.Instance)? - .GetValue(worker); - - if (timer == null) - { - return Task.CompletedTask; - } - - var period = timer.GetType() - .GetProperty("Period", BindingFlags.Public | BindingFlags.Instance)? - .GetValue(timer)? - .To(); - - if (!period.HasValue) - { - return Task.CompletedTask; - } - - var adapterType = typeof(HangfireBackgroundWorkerAdapter<>).MakeGenericType(worker.GetType()); - var workerAdapter = ServiceProvider.GetRequiredService(adapterType) as IHangfireBackgroundWorkerAdapter; - - RecurringJob.AddOrUpdate( - recurringJobId: worker.GetType().FullName, - methodCall: () => workerAdapter.ExecuteAsync(cancellationToken), - cronExpression: CronGenerator.FormMilliseconds(period.Value)); - return Task.CompletedTask; } - public Task StartAsync(CancellationToken cancellationToken = default) - { - return Task.CompletedTask; - } + var period = timer.GetType() + .GetProperty("Period", BindingFlags.Public | BindingFlags.Instance)? + .GetValue(timer)? + .To(); - public Task StopAsync(CancellationToken cancellationToken = default) + if (!period.HasValue) { return Task.CompletedTask; } + + var adapterType = typeof(HangfireBackgroundWorkerAdapter<>).MakeGenericType(worker.GetType()); + var workerAdapter = ServiceProvider.GetRequiredService(adapterType) as IHangfireBackgroundWorkerAdapter; + + RecurringJob.AddOrUpdate( + recurringJobId: worker.GetType().FullName, + methodCall: () => workerAdapter.ExecuteAsync(cancellationToken), + cronExpression: CronGenerator.FormMilliseconds(period.Value)); + + return Task.CompletedTask; + } + + public Task StartAsync(CancellationToken cancellationToken = default) + { + return Task.CompletedTask; + } + + public Task StopAsync(CancellationToken cancellationToken = default) + { + return Task.CompletedTask; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.BackgroundWorkers.Hangfire/LINGYUN/Abp/BackgroundWorkers/Hangfire/IHangfireBackgroundWorkerAdapter.cs b/aspnet-core/framework/common/LINGYUN.Abp.BackgroundWorkers.Hangfire/LINGYUN/Abp/BackgroundWorkers/Hangfire/IHangfireBackgroundWorkerAdapter.cs index bed95ae14..325a5ecfc 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.BackgroundWorkers.Hangfire/LINGYUN/Abp/BackgroundWorkers/Hangfire/IHangfireBackgroundWorkerAdapter.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.BackgroundWorkers.Hangfire/LINGYUN/Abp/BackgroundWorkers/Hangfire/IHangfireBackgroundWorkerAdapter.cs @@ -2,10 +2,9 @@ using System.Threading.Tasks; using Volo.Abp.BackgroundWorkers; -namespace LINGYUN.Abp.BackgroundWorkers.Hangfire +namespace LINGYUN.Abp.BackgroundWorkers.Hangfire; + +public interface IHangfireBackgroundWorkerAdapter : IBackgroundWorker { - public interface IHangfireBackgroundWorkerAdapter : IBackgroundWorker - { - Task ExecuteAsync(CancellationToken cancellationToken = default); - } + Task ExecuteAsync(CancellationToken cancellationToken = default); } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN.Abp.BlobStoring.Aliyun.csproj b/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN.Abp.BlobStoring.Aliyun.csproj index b2815fb00..8c117e512 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN.Abp.BlobStoring.Aliyun.csproj +++ b/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN.Abp.BlobStoring.Aliyun.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.BlobStoring.Aliyun + LINGYUN.Abp.BlobStoring.Aliyun + false + false + false 阿里云Oss对象存储Abp集成 diff --git a/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AbpBlobStoringAliyunModule.cs b/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AbpBlobStoringAliyunModule.cs index a8d591496..5a52f79a1 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AbpBlobStoringAliyunModule.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AbpBlobStoringAliyunModule.cs @@ -2,32 +2,31 @@ using Volo.Abp.BlobStoring; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.BlobStoring.Aliyun +namespace LINGYUN.Abp.BlobStoring.Aliyun; + +[DependsOn( + typeof(AbpBlobStoringModule), + typeof(AbpAliyunModule))] +public class AbpBlobStoringAliyunModule : AbpModule { - [DependsOn( - typeof(AbpBlobStoringModule), - typeof(AbpAliyunModule))] - public class AbpBlobStoringAliyunModule : AbpModule - { - // 需要时引用配置 - //public override void ConfigureServices(ServiceConfigurationContext context) - //{ - // var configuration = context.Services.GetConfiguration(); + // 需要时引用配置 + //public override void ConfigureServices(ServiceConfigurationContext context) + //{ + // var configuration = context.Services.GetConfiguration(); - // Configure(options => - // { - // context.Services.ExecutePreConfiguredActions(options); - // options.Containers.ConfigureAll((containerName, containerConfiguration) => - // { - // containerConfiguration.UseAliyun(aliyun => - // { - // aliyun.BucketName = configuration[AliyunBlobProviderConfigurationNames.BucketName] ?? ""; - // aliyun.CreateBucketIfNotExists = configuration.GetSection(AliyunBlobProviderConfigurationNames.CreateBucketIfNotExists).Get(); - // aliyun.CreateBucketReferer = configuration.GetSection(AliyunBlobProviderConfigurationNames.CreateBucketReferer).Get>(); - // aliyun.Endpoint = configuration[AliyunBlobProviderConfigurationNames.Endpoint]; - // }); - // }); - // }); - //} - } + // Configure(options => + // { + // context.Services.ExecutePreConfiguredActions(options); + // options.Containers.ConfigureAll((containerName, containerConfiguration) => + // { + // containerConfiguration.UseAliyun(aliyun => + // { + // aliyun.BucketName = configuration[AliyunBlobProviderConfigurationNames.BucketName] ?? ""; + // aliyun.CreateBucketIfNotExists = configuration.GetSection(AliyunBlobProviderConfigurationNames.CreateBucketIfNotExists).Get(); + // aliyun.CreateBucketReferer = configuration.GetSection(AliyunBlobProviderConfigurationNames.CreateBucketReferer).Get>(); + // aliyun.Endpoint = configuration[AliyunBlobProviderConfigurationNames.Endpoint]; + // }); + // }); + // }); + //} } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobContainerConfigurationExtensions.cs b/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobContainerConfigurationExtensions.cs index 6a73a482a..337d59b72 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobContainerConfigurationExtensions.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobContainerConfigurationExtensions.cs @@ -1,25 +1,24 @@ using System; using Volo.Abp.BlobStoring; -namespace LINGYUN.Abp.BlobStoring.Aliyun +namespace LINGYUN.Abp.BlobStoring.Aliyun; + +public static class AliyunBlobContainerConfigurationExtensions { - public static class AliyunBlobContainerConfigurationExtensions + public static AliyunBlobProviderConfiguration GetAliyunConfiguration( + this BlobContainerConfiguration containerConfiguration) { - public static AliyunBlobProviderConfiguration GetAliyunConfiguration( - this BlobContainerConfiguration containerConfiguration) - { - return new AliyunBlobProviderConfiguration(containerConfiguration); - } + return new AliyunBlobProviderConfiguration(containerConfiguration); + } - public static BlobContainerConfiguration UseAliyun( - this BlobContainerConfiguration containerConfiguration, - Action aliyunConfigureAction) - { - containerConfiguration.ProviderType = typeof(AliyunBlobProvider); + public static BlobContainerConfiguration UseAliyun( + this BlobContainerConfiguration containerConfiguration, + Action aliyunConfigureAction) + { + containerConfiguration.ProviderType = typeof(AliyunBlobProvider); - aliyunConfigureAction(new AliyunBlobProviderConfiguration(containerConfiguration)); + aliyunConfigureAction(new AliyunBlobProviderConfiguration(containerConfiguration)); - return containerConfiguration; - } + return containerConfiguration; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobNamingNormalizer.cs b/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobNamingNormalizer.cs index eac41eff1..555810724 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobNamingNormalizer.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobNamingNormalizer.cs @@ -2,54 +2,53 @@ using Volo.Abp.BlobStoring; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.BlobStoring.Aliyun +namespace LINGYUN.Abp.BlobStoring.Aliyun; + +public class AliyunBlobNamingNormalizer : IBlobNamingNormalizer, ITransientDependency { - public class AliyunBlobNamingNormalizer : IBlobNamingNormalizer, ITransientDependency + /// + /// 阿里云对象命名规范 + /// https://help.aliyun.com/document_detail/31827.html?spm=a2c4g.11186623.6.607.37b332eaM3NKzY + /// + /// + /// + public virtual string NormalizeBlobName(string blobName) { - /// - /// 阿里云对象命名规范 - /// https://help.aliyun.com/document_detail/31827.html?spm=a2c4g.11186623.6.607.37b332eaM3NKzY - /// - /// - /// - public virtual string NormalizeBlobName(string blobName) - { - return blobName; - } + return blobName; + } - /// - /// 阿里云BucketName命名规范 - /// https://help.aliyun.com/document_detail/31885.html?spm=a2c4g.11186623.6.583.56081c62w6meOR - /// - /// - /// - public virtual string NormalizeContainerName(string containerName) - { - // 小写字母、数字和短划线(-) - containerName = containerName.ToLower(); - containerName = Regex.Replace(containerName, "[^a-z0-9-]", string.Empty); + /// + /// 阿里云BucketName命名规范 + /// https://help.aliyun.com/document_detail/31885.html?spm=a2c4g.11186623.6.583.56081c62w6meOR + /// + /// + /// + public virtual string NormalizeContainerName(string containerName) + { + // 小写字母、数字和短划线(-) + containerName = containerName.ToLower(); + containerName = Regex.Replace(containerName, "[^a-z0-9-]", string.Empty); - // 不能以短划线(-)开头 - containerName = Regex.Replace(containerName, "^-", string.Empty); - // 不能以短划线(-)结尾 - containerName = Regex.Replace(containerName, "-$", string.Empty); + // 不能以短划线(-)开头 + containerName = Regex.Replace(containerName, "^-", string.Empty); + // 不能以短划线(-)结尾 + containerName = Regex.Replace(containerName, "-$", string.Empty); - // 长度必须在3-63之间 - if (containerName.Length < 3) - { - var length = containerName.Length; - for (var i = 0; i < 3 - length; i++) - { - containerName += "0"; - } - } - - if (containerName.Length > 63) + // 长度必须在3-63之间 + if (containerName.Length < 3) + { + var length = containerName.Length; + for (var i = 0; i < 3 - length; i++) { - containerName = containerName.Substring(0, 63); + containerName += "0"; } + } - return containerName; + if (containerName.Length > 63) + { + containerName = containerName.Substring(0, 63); } + + return containerName; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobProvider.cs b/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobProvider.cs index 499d6102a..4fb3ce253 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobProvider.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobProvider.cs @@ -8,146 +8,145 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.Features; -namespace LINGYUN.Abp.BlobStoring.Aliyun +namespace LINGYUN.Abp.BlobStoring.Aliyun; + +[RequiresFeature(AliyunFeatureNames.BlobStoring.Enable)] +public class AliyunBlobProvider : BlobProviderBase, ITransientDependency { - [RequiresFeature(AliyunFeatureNames.BlobStoring.Enable)] - public class AliyunBlobProvider : BlobProviderBase, ITransientDependency + protected IOssClientFactory OssClientFactory { get; } + protected IAliyunBlobNameCalculator AliyunBlobNameCalculator { get; } + + public AliyunBlobProvider( + IOssClientFactory ossClientFactory, + IAliyunBlobNameCalculator aliyunBlobNameCalculator) { - protected IOssClientFactory OssClientFactory { get; } - protected IAliyunBlobNameCalculator AliyunBlobNameCalculator { get; } + OssClientFactory = ossClientFactory; + AliyunBlobNameCalculator = aliyunBlobNameCalculator; + } - public AliyunBlobProvider( - IOssClientFactory ossClientFactory, - IAliyunBlobNameCalculator aliyunBlobNameCalculator) + public override async Task DeleteAsync(BlobProviderDeleteArgs args) + { + var ossClient = await GetOssClientAsync(args); + var blobName = AliyunBlobNameCalculator.Calculate(args); + + if (await BlobExistsAsync(ossClient, args, blobName)) { - OssClientFactory = ossClientFactory; - AliyunBlobNameCalculator = aliyunBlobNameCalculator; + return ossClient.DeleteObject(GetBucketName(args), blobName).DeleteMarker; } - public override async Task DeleteAsync(BlobProviderDeleteArgs args) - { - var ossClient = await GetOssClientAsync(args); - var blobName = AliyunBlobNameCalculator.Calculate(args); + return false; + } - if (await BlobExistsAsync(ossClient, args, blobName)) - { - return ossClient.DeleteObject(GetBucketName(args), blobName).DeleteMarker; - } + public override async Task ExistsAsync(BlobProviderExistsArgs args) + { + var ossClient = await GetOssClientAsync(args); + var blobName = AliyunBlobNameCalculator.Calculate(args); - return false; - } + return await BlobExistsAsync(ossClient, args, blobName); + } - public override async Task ExistsAsync(BlobProviderExistsArgs args) - { - var ossClient = await GetOssClientAsync(args); - var blobName = AliyunBlobNameCalculator.Calculate(args); + public override async Task GetOrNullAsync(BlobProviderGetArgs args) + { + var ossClient = await GetOssClientAsync(args); + var blobName = AliyunBlobNameCalculator.Calculate(args); - return await BlobExistsAsync(ossClient, args, blobName); + if (!await BlobExistsAsync(ossClient, args, blobName)) + { + return null; } - public override async Task GetOrNullAsync(BlobProviderGetArgs args) - { - var ossClient = await GetOssClientAsync(args); - var blobName = AliyunBlobNameCalculator.Calculate(args); + var ossObject = ossClient.GetObject(GetBucketName(args), blobName); + var memoryStream = new MemoryStream(); + await ossObject.Content.CopyToAsync(memoryStream); + return memoryStream; + } - if (!await BlobExistsAsync(ossClient, args, blobName)) - { - return null; - } + public override async Task SaveAsync(BlobProviderSaveArgs args) + { + var ossClient = await GetOssClientAsync(args); + var blobName = AliyunBlobNameCalculator.Calculate(args); + var configuration = args.Configuration.GetAliyunConfiguration(); - var ossObject = ossClient.GetObject(GetBucketName(args), blobName); - var memoryStream = new MemoryStream(); - await ossObject.Content.CopyToAsync(memoryStream); - return memoryStream; + // 先检查Bucket + if (configuration.CreateBucketIfNotExists) + { + await CreateBucketIfNotExists(ossClient, args, configuration.CreateBucketReferer); } - public override async Task SaveAsync(BlobProviderSaveArgs args) - { - var ossClient = await GetOssClientAsync(args); - var blobName = AliyunBlobNameCalculator.Calculate(args); - var configuration = args.Configuration.GetAliyunConfiguration(); + var bucketName = GetBucketName(args); - // 先检查Bucket - if (configuration.CreateBucketIfNotExists) + // 是否已存在 + if (await BlobExistsAsync(ossClient, args, blobName)) + { + // 是否覆盖 + if (!args.OverrideExisting) { - await CreateBucketIfNotExists(ossClient, args, configuration.CreateBucketReferer); + throw new BlobAlreadyExistsException($"Saving BLOB '{args.BlobName}' does already exists in the bucketName '{GetBucketName(args)}'! Set {nameof(args.OverrideExisting)} if it should be overwritten."); } - - var bucketName = GetBucketName(args); - - // 是否已存在 - if (await BlobExistsAsync(ossClient, args, blobName)) + else { - // 是否覆盖 - if (!args.OverrideExisting) - { - throw new BlobAlreadyExistsException($"Saving BLOB '{args.BlobName}' does already exists in the bucketName '{GetBucketName(args)}'! Set {nameof(args.OverrideExisting)} if it should be overwritten."); - } - else - { - // 删除原文件 - ossClient.DeleteObject(bucketName, blobName); - } + // 删除原文件 + ossClient.DeleteObject(bucketName, blobName); } - // 保存 - ossClient.PutObject(bucketName, blobName, args.BlobStream); } + // 保存 + ossClient.PutObject(bucketName, blobName, args.BlobStream); + } - protected async virtual Task GetOssClientAsync(BlobProviderArgs args) - { - var ossClient = await OssClientFactory.CreateAsync(); - return ossClient; - } + protected async virtual Task GetOssClientAsync(BlobProviderArgs args) + { + var ossClient = await OssClientFactory.CreateAsync(); + return ossClient; + } - protected async virtual Task CreateBucketIfNotExists(IOss ossClient, BlobProviderArgs args, IList refererList = null) + protected async virtual Task CreateBucketIfNotExists(IOss ossClient, BlobProviderArgs args, IList refererList = null) + { + if (! await BucketExistsAsync(ossClient, args)) { - if (! await BucketExistsAsync(ossClient, args)) - { - var bucketName = GetBucketName(args); - - var request = new CreateBucketRequest(bucketName) - { - //设置存储空间访问权限ACL。 - ACL = CannedAccessControlList.PublicReadWrite, - //设置数据容灾类型。 - DataRedundancyType = DataRedundancyType.ZRS - }; - - ossClient.CreateBucket(request); - - if (refererList != null && refererList.Count > 0) - { - var srq = new SetBucketRefererRequest(bucketName, refererList); - ossClient.SetBucketReferer(srq); - } - } - } + var bucketName = GetBucketName(args); - private async Task BlobExistsAsync(IOss ossClient, BlobProviderArgs args, string blobName) - { - var bucketExists = await BucketExistsAsync(ossClient, args); - if (bucketExists) + var request = new CreateBucketRequest(bucketName) { - var objectExists = ossClient.DoesObjectExist(GetBucketName(args), blobName); + //设置存储空间访问权限ACL。 + ACL = CannedAccessControlList.PublicReadWrite, + //设置数据容灾类型。 + DataRedundancyType = DataRedundancyType.ZRS + }; - return objectExists; + ossClient.CreateBucket(request); + + if (refererList != null && refererList.Count > 0) + { + var srq = new SetBucketRefererRequest(bucketName, refererList); + ossClient.SetBucketReferer(srq); } - return false; } + } - private Task BucketExistsAsync(IOss ossClient, BlobProviderArgs args) + private async Task BlobExistsAsync(IOss ossClient, BlobProviderArgs args, string blobName) + { + var bucketExists = await BucketExistsAsync(ossClient, args); + if (bucketExists) { - var bucketExists = ossClient.DoesBucketExist(GetBucketName(args)); + var objectExists = ossClient.DoesObjectExist(GetBucketName(args), blobName); - return Task.FromResult(bucketExists); + return objectExists; } + return false; + } - private static string GetBucketName(BlobProviderArgs args) - { - var configuration = args.Configuration.GetAliyunConfiguration(); - return configuration.BucketName.IsNullOrWhiteSpace() - ? args.ContainerName - : configuration.BucketName; - } + private Task BucketExistsAsync(IOss ossClient, BlobProviderArgs args) + { + var bucketExists = ossClient.DoesBucketExist(GetBucketName(args)); + + return Task.FromResult(bucketExists); + } + + private static string GetBucketName(BlobProviderArgs args) + { + var configuration = args.Configuration.GetAliyunConfiguration(); + return configuration.BucketName.IsNullOrWhiteSpace() + ? args.ContainerName + : configuration.BucketName; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobProviderConfiguration.cs b/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobProviderConfiguration.cs index c13ba5c9c..7778511a8 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobProviderConfiguration.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobProviderConfiguration.cs @@ -2,50 +2,49 @@ using Volo.Abp; using Volo.Abp.BlobStoring; -namespace LINGYUN.Abp.BlobStoring.Aliyun +namespace LINGYUN.Abp.BlobStoring.Aliyun; + +public class AliyunBlobProviderConfiguration { - public class AliyunBlobProviderConfiguration + /// + /// 命名空间 + /// + public string BucketName { - /// - /// 命名空间 - /// - public string BucketName - { - get => _containerConfiguration.GetConfiguration(AliyunBlobProviderConfigurationNames.BucketName); - set => _containerConfiguration.SetConfiguration(AliyunBlobProviderConfigurationNames.BucketName, Check.NotNullOrWhiteSpace(value, nameof(value))); - } - /// - /// 命名空间不存在是否创建 - /// - public bool CreateBucketIfNotExists - { - get => _containerConfiguration.GetConfigurationOrDefault(AliyunBlobProviderConfigurationNames.CreateBucketIfNotExists, false); - set => _containerConfiguration.SetConfiguration(AliyunBlobProviderConfigurationNames.CreateBucketIfNotExists, value); - } - /// - /// 创建命名空间时防盗链列表 - /// - public List CreateBucketReferer + get => _containerConfiguration.GetConfiguration(AliyunBlobProviderConfigurationNames.BucketName); + set => _containerConfiguration.SetConfiguration(AliyunBlobProviderConfigurationNames.BucketName, Check.NotNullOrWhiteSpace(value, nameof(value))); + } + /// + /// 命名空间不存在是否创建 + /// + public bool CreateBucketIfNotExists + { + get => _containerConfiguration.GetConfigurationOrDefault(AliyunBlobProviderConfigurationNames.CreateBucketIfNotExists, false); + set => _containerConfiguration.SetConfiguration(AliyunBlobProviderConfigurationNames.CreateBucketIfNotExists, value); + } + /// + /// 创建命名空间时防盗链列表 + /// + public List CreateBucketReferer + { + get => _containerConfiguration.GetConfiguration>(AliyunBlobProviderConfigurationNames.CreateBucketReferer); + set { - get => _containerConfiguration.GetConfiguration>(AliyunBlobProviderConfigurationNames.CreateBucketReferer); - set + if (value == null) + { + _containerConfiguration.SetConfiguration(AliyunBlobProviderConfigurationNames.CreateBucketReferer, new List()); + } + else { - if (value == null) - { - _containerConfiguration.SetConfiguration(AliyunBlobProviderConfigurationNames.CreateBucketReferer, new List()); - } - else - { - _containerConfiguration.SetConfiguration(AliyunBlobProviderConfigurationNames.CreateBucketReferer, value); - } + _containerConfiguration.SetConfiguration(AliyunBlobProviderConfigurationNames.CreateBucketReferer, value); } } + } - private readonly BlobContainerConfiguration _containerConfiguration; + private readonly BlobContainerConfiguration _containerConfiguration; - public AliyunBlobProviderConfiguration(BlobContainerConfiguration containerConfiguration) - { - _containerConfiguration = containerConfiguration; - } + public AliyunBlobProviderConfiguration(BlobContainerConfiguration containerConfiguration) + { + _containerConfiguration = containerConfiguration; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobProviderConfigurationNames.cs b/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobProviderConfigurationNames.cs index 66b0c17ef..13e0c3c9c 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobProviderConfigurationNames.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/AliyunBlobProviderConfigurationNames.cs @@ -1,22 +1,21 @@ -namespace LINGYUN.Abp.BlobStoring.Aliyun +namespace LINGYUN.Abp.BlobStoring.Aliyun; + +public static class AliyunBlobProviderConfigurationNames { - public static class AliyunBlobProviderConfigurationNames - { - /// - /// 数据中心 - /// - public const string Endpoint = "Aliyun:OSS:Endpoint"; - /// - /// 命名空间 - /// - public const string BucketName = "Aliyun:OSS:BucketName"; - /// - /// 命名空间不存在是否创建 - /// - public const string CreateBucketIfNotExists = "Aliyun:OSS:CreateBucketIfNotExists"; - /// - /// 创建命名空间时防盗链列表 - /// - public const string CreateBucketReferer = "Aliyun:OSS:CreateBucketReferer"; - } + /// + /// 数据中心 + /// + public const string Endpoint = "Aliyun:OSS:Endpoint"; + /// + /// 命名空间 + /// + public const string BucketName = "Aliyun:OSS:BucketName"; + /// + /// 命名空间不存在是否创建 + /// + public const string CreateBucketIfNotExists = "Aliyun:OSS:CreateBucketIfNotExists"; + /// + /// 创建命名空间时防盗链列表 + /// + public const string CreateBucketReferer = "Aliyun:OSS:CreateBucketReferer"; } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/DefaultAliyunBlobNameCalculator.cs b/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/DefaultAliyunBlobNameCalculator.cs index 220a13c56..f77450466 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/DefaultAliyunBlobNameCalculator.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/DefaultAliyunBlobNameCalculator.cs @@ -2,23 +2,22 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.BlobStoring.Aliyun +namespace LINGYUN.Abp.BlobStoring.Aliyun; + +public class DefaultAliyunBlobNameCalculator : IAliyunBlobNameCalculator, ITransientDependency { - public class DefaultAliyunBlobNameCalculator : IAliyunBlobNameCalculator, ITransientDependency - { - protected ICurrentTenant CurrentTenant { get; } + protected ICurrentTenant CurrentTenant { get; } - public DefaultAliyunBlobNameCalculator( - ICurrentTenant currentTenant) - { - CurrentTenant = currentTenant; - } + public DefaultAliyunBlobNameCalculator( + ICurrentTenant currentTenant) + { + CurrentTenant = currentTenant; + } - public string Calculate(BlobProviderArgs args) - { - return CurrentTenant.Id == null - ? $"host/{args.BlobName}" - : $"tenants/{CurrentTenant.Id.Value:D}/{args.BlobName}"; - } + public string Calculate(BlobProviderArgs args) + { + return CurrentTenant.Id == null + ? $"host/{args.BlobName}" + : $"tenants/{CurrentTenant.Id.Value:D}/{args.BlobName}"; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/IAliyunBlobNameCalculator.cs b/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/IAliyunBlobNameCalculator.cs index b8dbe6a60..0000d7b11 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/IAliyunBlobNameCalculator.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/IAliyunBlobNameCalculator.cs @@ -1,9 +1,8 @@ using Volo.Abp.BlobStoring; -namespace LINGYUN.Abp.BlobStoring.Aliyun +namespace LINGYUN.Abp.BlobStoring.Aliyun; + +public interface IAliyunBlobNameCalculator { - public interface IAliyunBlobNameCalculator - { - string Calculate(BlobProviderArgs args); - } + string Calculate(BlobProviderArgs args); } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/IOssClientFactory.cs b/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/IOssClientFactory.cs index ae7e77d1b..1b8d3ef54 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/IOssClientFactory.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/IOssClientFactory.cs @@ -1,14 +1,13 @@ using Aliyun.OSS; using System.Threading.Tasks; -namespace LINGYUN.Abp.BlobStoring.Aliyun +namespace LINGYUN.Abp.BlobStoring.Aliyun; + +public interface IOssClientFactory { - public interface IOssClientFactory - { - /// - /// 构建Oss客户端 - /// - /// - Task CreateAsync(); - } + /// + /// 构建Oss客户端 + /// + /// + Task CreateAsync(); } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/OssClientFactory.cs b/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/OssClientFactory.cs index a6a627b86..5e505d999 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/OssClientFactory.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.BlobStoring.Aliyun/LINGYUN/Abp/BlobStoring/Aliyun/OssClientFactory.cs @@ -4,46 +4,45 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.Settings; -namespace LINGYUN.Abp.BlobStoring.Aliyun +namespace LINGYUN.Abp.BlobStoring.Aliyun; + +public class OssClientFactory : AliyunClientFactory, IOssClientFactory, ITransientDependency { - public class OssClientFactory : AliyunClientFactory, IOssClientFactory, ITransientDependency + public OssClientFactory( + ISettingProvider settingProvider, + IDistributedCache cache) + : base(settingProvider, cache) + { + } + /// + /// 普通方式构建Oss客户端 + /// + /// + /// + /// + /// + protected override IOss GetClient(string regionId, string accessKeyId, string accessKeySecret) { - public OssClientFactory( - ISettingProvider settingProvider, - IDistributedCache cache) - : base(settingProvider, cache) - { - } - /// - /// 普通方式构建Oss客户端 - /// - /// - /// - /// - /// - protected override IOss GetClient(string regionId, string accessKeyId, string accessKeySecret) - { - return new OssClient( - regionId, - accessKeyId, - accessKeySecret); - } + return new OssClient( + regionId, + accessKeyId, + accessKeySecret); + } - /// - /// 通过用户安全令牌构建Oss客户端 - /// - /// - /// - /// - /// - /// - protected override IOss GetSecurityTokenClient(string regionId, string accessKeyId, string accessKeySecret, string securityToken) - { - return new OssClient( - regionId, - accessKeyId, - accessKeySecret, - securityToken); - } + /// + /// 通过用户安全令牌构建Oss客户端 + /// + /// + /// + /// + /// + /// + protected override IOss GetSecurityTokenClient(string regionId, string accessKeyId, string accessKeySecret, string securityToken) + { + return new OssClient( + regionId, + accessKeyId, + accessKeySecret, + securityToken); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Core/AbpCommonModule.cs b/aspnet-core/framework/common/LINGYUN.Abp.Core/AbpCommonModule.cs index ffe9a4fbb..1a9e1da7d 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Core/AbpCommonModule.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Core/AbpCommonModule.cs @@ -1,8 +1,7 @@ using Volo.Abp.Modularity; -namespace LINGYUN.Abp +namespace LINGYUN.Abp; + +public class AbpCommonModule : AbpModule { - public class AbpCommonModule : AbpModule - { - } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Core/DynamicOptionsProvider.cs b/aspnet-core/framework/common/LINGYUN.Abp.Core/DynamicOptionsProvider.cs index bcb74c6de..ba0f722da 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Core/DynamicOptionsProvider.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Core/DynamicOptionsProvider.cs @@ -3,28 +3,27 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.Threading; -namespace LINGYUN.Abp +namespace LINGYUN.Abp; + +public class DynamicOptionsProvider : IOptionsProvider, ITransientDependency + where TValue : class, new() { - public class DynamicOptionsProvider : IOptionsProvider, ITransientDependency - where TValue : class, new() - { - public TValue Value => _lazyValueFactory.Value; + public TValue Value => _lazyValueFactory.Value; - private readonly Lazy _lazyValueFactory; - private readonly OneTimeRunner _oneTimeRunner; + private readonly Lazy _lazyValueFactory; + private readonly OneTimeRunner _oneTimeRunner; - public DynamicOptionsProvider(IOptions options) - { - _oneTimeRunner = new OneTimeRunner(); - _lazyValueFactory = new Lazy(() => CreateOptions(options)); - } + public DynamicOptionsProvider(IOptions options) + { + _oneTimeRunner = new OneTimeRunner(); + _lazyValueFactory = new Lazy(() => CreateOptions(options)); + } - protected virtual TValue CreateOptions(IOptions options) - { - // 用于简化需要在使用配置前自行调用此接口的繁复步骤 - // await options.SetAsync(); - // _onTimeRunner.Run(async () => await options.SetAsync()); - return options.Value; - } + protected virtual TValue CreateOptions(IOptions options) + { + // 用于简化需要在使用配置前自行调用此接口的繁复步骤 + // await options.SetAsync(); + // _onTimeRunner.Run(async () => await options.SetAsync()); + return options.Value; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Core/IOptionsProvider.cs b/aspnet-core/framework/common/LINGYUN.Abp.Core/IOptionsProvider.cs index cb6827060..f6a736afa 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Core/IOptionsProvider.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Core/IOptionsProvider.cs @@ -1,8 +1,7 @@ -namespace LINGYUN.Abp +namespace LINGYUN.Abp; + +public interface IOptionsProvider + where TValue: class, new() { - public interface IOptionsProvider - where TValue: class, new() - { - TValue Value { get; } - } + TValue Value { get; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Core/LINGYUN.Abp.Core.csproj b/aspnet-core/framework/common/LINGYUN.Abp.Core/LINGYUN.Abp.Core.csproj index df2ed0ce9..4f2ade748 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Core/LINGYUN.Abp.Core.csproj +++ b/aspnet-core/framework/common/LINGYUN.Abp.Core/LINGYUN.Abp.Core.csproj @@ -5,6 +5,11 @@ netstandard2.0 + LINGYUN.Abp.Core + LINGYUN.Abp.Core + false + false + false LINGYUN.Abp Abp扩展基础库 diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Data.DbMigrator/LINGYUN.Abp.Data.DbMigrator.csproj b/aspnet-core/framework/common/LINGYUN.Abp.Data.DbMigrator/LINGYUN.Abp.Data.DbMigrator.csproj index 9f4a03c21..fb4cabda8 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Data.DbMigrator/LINGYUN.Abp.Data.DbMigrator.csproj +++ b/aspnet-core/framework/common/LINGYUN.Abp.Data.DbMigrator/LINGYUN.Abp.Data.DbMigrator.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.Data.DbMigrator + LINGYUN.Abp.Data.DbMigrator + false + false + false diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Data.DbMigrator/LINGYUN/Abp/Data/DbMigrator/AbpDataDbMigratorModule.cs b/aspnet-core/framework/common/LINGYUN.Abp.Data.DbMigrator/LINGYUN/Abp/Data/DbMigrator/AbpDataDbMigratorModule.cs index c5eafd52b..9fb96e9eb 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Data.DbMigrator/LINGYUN/Abp/Data/DbMigrator/AbpDataDbMigratorModule.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Data.DbMigrator/LINGYUN/Abp/Data/DbMigrator/AbpDataDbMigratorModule.cs @@ -1,12 +1,11 @@ using Volo.Abp.EntityFrameworkCore; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.Data.DbMigrator +namespace LINGYUN.Abp.Data.DbMigrator; + +[DependsOn( + typeof(AbpEntityFrameworkCoreModule))] +public class AbpDataDbMigratorModule : AbpModule { - [DependsOn( - typeof(AbpEntityFrameworkCoreModule))] - public class AbpDataDbMigratorModule : AbpModule - { - } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Data.DbMigrator/LINGYUN/Abp/Data/DbMigrator/DefaultDbSchemaMigrator.cs b/aspnet-core/framework/common/LINGYUN.Abp.Data.DbMigrator/LINGYUN/Abp/Data/DbMigrator/DefaultDbSchemaMigrator.cs index f29d58946..3924bc4de 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Data.DbMigrator/LINGYUN/Abp/Data/DbMigrator/DefaultDbSchemaMigrator.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Data.DbMigrator/LINGYUN/Abp/Data/DbMigrator/DefaultDbSchemaMigrator.cs @@ -9,60 +9,59 @@ using Volo.Abp.EntityFrameworkCore; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.Data.DbMigrator +namespace LINGYUN.Abp.Data.DbMigrator; + +public class DefaultDbSchemaMigrator : IDbSchemaMigrator, ITransientDependency { - public class DefaultDbSchemaMigrator : IDbSchemaMigrator, ITransientDependency + private readonly IServiceProvider _serviceProvider; + private readonly ICurrentTenant _currentTenant; + private readonly AbpDbConnectionOptions _dbConnectionOptions; + + public DefaultDbSchemaMigrator( + ICurrentTenant currentTenant, + IServiceProvider serviceProvider, + IOptions dbConnectionOptions) + { + _currentTenant = currentTenant; + _serviceProvider = serviceProvider; + _dbConnectionOptions = dbConnectionOptions.Value; + } + + public async virtual Task MigrateAsync( + [NotNull] Func, TDbContext> configureDbContext) + where TDbContext : AbpDbContext { - private readonly IServiceProvider _serviceProvider; - private readonly ICurrentTenant _currentTenant; - private readonly AbpDbConnectionOptions _dbConnectionOptions; + var connectionStringName = ConnectionStringNameAttribute.GetConnStringName(); - public DefaultDbSchemaMigrator( - ICurrentTenant currentTenant, - IServiceProvider serviceProvider, - IOptions dbConnectionOptions) + string connectionString = null; + if (_currentTenant.IsAvailable) { - _currentTenant = currentTenant; - _serviceProvider = serviceProvider; - _dbConnectionOptions = dbConnectionOptions.Value; + var connectionStringResolver = _serviceProvider.GetRequiredService(); + connectionString = await connectionStringResolver.ResolveAsync(connectionStringName); } - - public async virtual Task MigrateAsync( - [NotNull] Func, TDbContext> configureDbContext) - where TDbContext : AbpDbContext + else { - var connectionStringName = ConnectionStringNameAttribute.GetConnStringName(); - - string connectionString = null; - if (_currentTenant.IsAvailable) - { - var connectionStringResolver = _serviceProvider.GetRequiredService(); - connectionString = await connectionStringResolver.ResolveAsync(connectionStringName); - } - else - { - connectionString = _dbConnectionOptions.GetConnectionStringOrNull( - connectionStringName, - fallbackToDatabaseMappings: false, - fallbackToDefault: false); - } + connectionString = _dbConnectionOptions.GetConnectionStringOrNull( + connectionStringName, + fallbackToDatabaseMappings: false, + fallbackToDefault: false); + } - var defaultConnectionString = _dbConnectionOptions.GetConnectionStringOrNull(connectionStringName); - // 租户连接字符串与默认连接字符串相同,则不执行迁移脚本 - if (string.Equals( - connectionString, - defaultConnectionString, - StringComparison.InvariantCultureIgnoreCase)) - { - return; - } + var defaultConnectionString = _dbConnectionOptions.GetConnectionStringOrNull(connectionStringName); + // 租户连接字符串与默认连接字符串相同,则不执行迁移脚本 + if (string.Equals( + connectionString, + defaultConnectionString, + StringComparison.InvariantCultureIgnoreCase)) + { + return; + } - connectionString??= defaultConnectionString; + connectionString??= defaultConnectionString; - var dbContextBuilder = new DbContextOptionsBuilder(); - using var dbContext = configureDbContext(connectionString, dbContextBuilder); + var dbContextBuilder = new DbContextOptionsBuilder(); + using var dbContext = configureDbContext(connectionString, dbContextBuilder); - await dbContext.Database.MigrateAsync(); - } + await dbContext.Database.MigrateAsync(); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Data.DbMigrator/LINGYUN/Abp/Data/DbMigrator/IDbSchemaMigrator.cs b/aspnet-core/framework/common/LINGYUN.Abp.Data.DbMigrator/LINGYUN/Abp/Data/DbMigrator/IDbSchemaMigrator.cs index 94ea13433..414ad79d1 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Data.DbMigrator/LINGYUN/Abp/Data/DbMigrator/IDbSchemaMigrator.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Data.DbMigrator/LINGYUN/Abp/Data/DbMigrator/IDbSchemaMigrator.cs @@ -4,12 +4,11 @@ using System.Threading.Tasks; using Volo.Abp.EntityFrameworkCore; -namespace LINGYUN.Abp.Data.DbMigrator +namespace LINGYUN.Abp.Data.DbMigrator; + +public interface IDbSchemaMigrator { - public interface IDbSchemaMigrator - { - Task MigrateAsync( - [NotNull] Func, TDbContext> configureDbContext) - where TDbContext : AbpDbContext; - } + Task MigrateAsync( + [NotNull] Func, TDbContext> configureDbContext) + where TDbContext : AbpDbContext; } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN.Abp.EventBus.CAP.csproj b/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN.Abp.EventBus.CAP.csproj index f38ad88bb..5a19d99e9 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN.Abp.EventBus.CAP.csproj +++ b/aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN.Abp.EventBus.CAP.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.EventBus.CAP + LINGYUN.Abp.EventBus.CAP + false + false + false Cap分布式事件总线 true diff --git a/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN.Abp.ExceptionHandling.Emailing.csproj b/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN.Abp.ExceptionHandling.Emailing.csproj index 61d06fecd..250f85e59 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN.Abp.ExceptionHandling.Emailing.csproj +++ b/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN.Abp.ExceptionHandling.Emailing.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.ExceptionHandling.Emailing + LINGYUN.Abp.ExceptionHandling.Emailing + false + false + false diff --git a/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN/Abp/ExceptionHandling/Emailing/AbpEmailExceptionHandlingOptions.cs b/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN/Abp/ExceptionHandling/Emailing/AbpEmailExceptionHandlingOptions.cs index b2194a077..cd5aab91e 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN/Abp/ExceptionHandling/Emailing/AbpEmailExceptionHandlingOptions.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN/Abp/ExceptionHandling/Emailing/AbpEmailExceptionHandlingOptions.cs @@ -1,72 +1,71 @@ using System; using System.Collections.Generic; -namespace LINGYUN.Abp.ExceptionHandling.Emailing +namespace LINGYUN.Abp.ExceptionHandling.Emailing; + +public class AbpEmailExceptionHandlingOptions { - public class AbpEmailExceptionHandlingOptions + /// + /// 发送堆栈信息 + /// + public bool SendStackTrace { get; set; } = false; + /// + /// 默认邮件标题 + /// + public string DefaultTitle { get; set; } + /// + /// 默认邮件内容头 + /// + public string DefaultContentHeader { get; set; } + /// + /// 默认邮件内容底 + /// + public string DefaultContentFooter { get; set; } + /// + /// 默认异常收件人 + /// + public string DefaultReceiveEmail { get; set; } + /// + /// 异常类型指定收件人处理映射列表 + /// + public IDictionary Handlers { get; set; } + public AbpEmailExceptionHandlingOptions() { - /// - /// 发送堆栈信息 - /// - public bool SendStackTrace { get; set; } = false; - /// - /// 默认邮件标题 - /// - public string DefaultTitle { get; set; } - /// - /// 默认邮件内容头 - /// - public string DefaultContentHeader { get; set; } - /// - /// 默认邮件内容底 - /// - public string DefaultContentFooter { get; set; } - /// - /// 默认异常收件人 - /// - public string DefaultReceiveEmail { get; set; } - /// - /// 异常类型指定收件人处理映射列表 - /// - public IDictionary Handlers { get; set; } - public AbpEmailExceptionHandlingOptions() - { - Handlers = new Dictionary(); - } + Handlers = new Dictionary(); + } - /// - /// 把需要接受异常通知的用户加进处理列表 - /// - /// 处理的异常类型 - /// 接收邮件的用户类别,群发用,符号分隔 - public void HandReceivedException(string receivedEmails) where TException : Exception + /// + /// 把需要接受异常通知的用户加进处理列表 + /// + /// 处理的异常类型 + /// 接收邮件的用户类别,群发用,符号分隔 + public void HandReceivedException(string receivedEmails) where TException : Exception + { + HandReceivedException(typeof(TException), receivedEmails); + } + /// + /// 把需要接受异常通知的用户加进处理列表 + /// + /// 处理的异常类型 + /// 接收邮件的用户类别,群发用,符号分隔 + public void HandReceivedException(Type exceptionType, string receivedEmails) + { + if (Handlers.ContainsKey(exceptionType)) { - HandReceivedException(typeof(TException), receivedEmails); + Handlers[exceptionType] += receivedEmails; } - /// - /// 把需要接受异常通知的用户加进处理列表 - /// - /// 处理的异常类型 - /// 接收邮件的用户类别,群发用,符号分隔 - public void HandReceivedException(Type exceptionType, string receivedEmails) + else { - if (Handlers.ContainsKey(exceptionType)) - { - Handlers[exceptionType] += receivedEmails; - } - else - { - Handlers.Add(exceptionType, receivedEmails); - } + Handlers.Add(exceptionType, receivedEmails); } + } - public string GetReceivedEmailOrDefault(Type exceptionType) + public string GetReceivedEmailOrDefault(Type exceptionType) + { + if (Handlers.TryGetValue(exceptionType, out string receivedUsers)) { - if (Handlers.TryGetValue(exceptionType, out string receivedUsers)) - { - return receivedUsers; - } - return DefaultReceiveEmail; + return receivedUsers; } + return DefaultReceiveEmail; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN/Abp/ExceptionHandling/Emailing/AbpEmailingExceptionHandlingModule.cs b/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN/Abp/ExceptionHandling/Emailing/AbpEmailingExceptionHandlingModule.cs index dc2640e11..d589e584d 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN/Abp/ExceptionHandling/Emailing/AbpEmailingExceptionHandlingModule.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN/Abp/ExceptionHandling/Emailing/AbpEmailingExceptionHandlingModule.cs @@ -5,30 +5,29 @@ using Volo.Abp.Modularity; using Volo.Abp.VirtualFileSystem; -namespace LINGYUN.Abp.ExceptionHandling.Emailing +namespace LINGYUN.Abp.ExceptionHandling.Emailing; + +[DependsOn( + typeof(AbpExceptionHandlingModule), + typeof(AbpEmailingModule))] +public class AbpEmailingExceptionHandlingModule : AbpModule { - [DependsOn( - typeof(AbpExceptionHandlingModule), - typeof(AbpEmailingModule))] - public class AbpEmailingExceptionHandlingModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) - { - var configuration = context.Services.GetConfiguration(); - Configure( - configuration.GetSection("ExceptionHandling:Emailing")); + var configuration = context.Services.GetConfiguration(); + Configure( + configuration.GetSection("ExceptionHandling:Emailing")); - Configure(options => - { - options.FileSets.AddEmbedded(); - }); + Configure(options => + { + options.FileSets.AddEmbedded(); + }); - Configure(options => - { - options.Resources - .Get() - .AddVirtualJson("/LINGYUN/Abp/ExceptionHandling/Emailing/Localization/Resources"); - }); - } + Configure(options => + { + options.Resources + .Get() + .AddVirtualJson("/LINGYUN/Abp/ExceptionHandling/Emailing/Localization/Resources"); + }); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN/Abp/ExceptionHandling/Emailing/AbpEmailingExceptionSubscriber.cs b/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN/Abp/ExceptionHandling/Emailing/AbpEmailingExceptionSubscriber.cs index 869958be5..37695b74d 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN/Abp/ExceptionHandling/Emailing/AbpEmailingExceptionSubscriber.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN/Abp/ExceptionHandling/Emailing/AbpEmailingExceptionSubscriber.cs @@ -8,61 +8,60 @@ using Volo.Abp.ExceptionHandling.Localization; using Volo.Abp.TextTemplating; -namespace LINGYUN.Abp.ExceptionHandling.Emailing +namespace LINGYUN.Abp.ExceptionHandling.Emailing; + +public class AbpEmailingExceptionSubscriber : AbpExceptionSubscriberBase { - public class AbpEmailingExceptionSubscriber : AbpExceptionSubscriberBase + protected IEmailSender EmailSender { get; } + protected IStringLocalizer StringLocalizer { get; } + protected ITemplateRenderer TemplateRenderer { get; } + protected AbpEmailExceptionHandlingOptions EmailOptions { get; } + public AbpEmailingExceptionSubscriber( + IEmailSender emailSender, + ITemplateRenderer templateRenderer, + IServiceScopeFactory serviceScopeFactory, + IOptions options, + IOptions emailOptions, + IStringLocalizer stringLocalizer) + : base(serviceScopeFactory, options) { - protected IEmailSender EmailSender { get; } - protected IStringLocalizer StringLocalizer { get; } - protected ITemplateRenderer TemplateRenderer { get; } - protected AbpEmailExceptionHandlingOptions EmailOptions { get; } - public AbpEmailingExceptionSubscriber( - IEmailSender emailSender, - ITemplateRenderer templateRenderer, - IServiceScopeFactory serviceScopeFactory, - IOptions options, - IOptions emailOptions, - IStringLocalizer stringLocalizer) - : base(serviceScopeFactory, options) - { - EmailSender = emailSender; - EmailOptions = emailOptions.Value; - StringLocalizer = stringLocalizer; - TemplateRenderer = templateRenderer; - } + EmailSender = emailSender; + EmailOptions = emailOptions.Value; + StringLocalizer = stringLocalizer; + TemplateRenderer = templateRenderer; + } - protected override async Task SendErrorNotifierAsync(ExceptionSendNotifierContext context) - { - // 需不需要用 SettingProvider 来获取? - var receivedUsers = EmailOptions.GetReceivedEmailOrDefault(context.Exception.GetType()); + protected override async Task SendErrorNotifierAsync(ExceptionSendNotifierContext context) + { + // 需不需要用 SettingProvider 来获取? + var receivedUsers = EmailOptions.GetReceivedEmailOrDefault(context.Exception.GetType()); - if (!receivedUsers.IsNullOrWhiteSpace()) - { - var emailTitle = EmailOptions.DefaultTitle ?? L("SendEmailTitle"); - var templateContent = await TemplateRenderer - .RenderAsync(ExceptionHandlingTemplates.SendEmail, - new - { - title = emailTitle, - header = EmailOptions.DefaultContentHeader ?? L("SendEmailHeader"), - type = context.Exception.GetType().FullName, - message = context.Exception.Message, - loglevel = context.LogLevel.ToString(), - triggertime = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"), - sendstacktrace = EmailOptions.SendStackTrace, - stacktrace = context.Exception.ToString(), - footer = EmailOptions.DefaultContentFooter ?? $"Copyright to LY Colin © {DateTime.Now.Year}" - }); + if (!receivedUsers.IsNullOrWhiteSpace()) + { + var emailTitle = EmailOptions.DefaultTitle ?? L("SendEmailTitle"); + var templateContent = await TemplateRenderer + .RenderAsync(ExceptionHandlingTemplates.SendEmail, + new + { + title = emailTitle, + header = EmailOptions.DefaultContentHeader ?? L("SendEmailHeader"), + type = context.Exception.GetType().FullName, + message = context.Exception.Message, + loglevel = context.LogLevel.ToString(), + triggertime = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"), + sendstacktrace = EmailOptions.SendStackTrace, + stacktrace = context.Exception.ToString(), + footer = EmailOptions.DefaultContentFooter ?? $"Copyright to LY Colin © {DateTime.Now.Year}" + }); - await EmailSender.SendAsync(receivedUsers, - emailTitle, - templateContent); - } + await EmailSender.SendAsync(receivedUsers, + emailTitle, + templateContent); } + } - protected string L(string name, params object[] args) - { - return StringLocalizer[name, args].Value; - } + protected string L(string name, params object[] args) + { + return StringLocalizer[name, args].Value; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN/Abp/ExceptionHandling/Emailing/Templates/ExceptionHandlingTemplateDefinitionProvider.cs b/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN/Abp/ExceptionHandling/Emailing/Templates/ExceptionHandlingTemplateDefinitionProvider.cs index de3da7f54..c3e5eaf57 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN/Abp/ExceptionHandling/Emailing/Templates/ExceptionHandlingTemplateDefinitionProvider.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN/Abp/ExceptionHandling/Emailing/Templates/ExceptionHandlingTemplateDefinitionProvider.cs @@ -2,19 +2,18 @@ using Volo.Abp.Localization; using Volo.Abp.TextTemplating; -namespace LINGYUN.Abp.ExceptionHandling.Emailing.Templates +namespace LINGYUN.Abp.ExceptionHandling.Emailing.Templates; + +public class ExceptionHandlingTemplateDefinitionProvider : TemplateDefinitionProvider { - public class ExceptionHandlingTemplateDefinitionProvider : TemplateDefinitionProvider + public override void Define(ITemplateDefinitionContext context) { - public override void Define(ITemplateDefinitionContext context) - { - context.Add( - new TemplateDefinition( - ExceptionHandlingTemplates.SendEmail, - displayName: LocalizableString.Create("TextTemplate:ExceptionHandlingTemplates.SendEmail"), - defaultCultureName: "en" - ).WithVirtualFilePath("/LINGYUN/Abp/ExceptionHandling/Emailing/Templates/SendEmail", false) - ); - } + context.Add( + new TemplateDefinition( + ExceptionHandlingTemplates.SendEmail, + displayName: LocalizableString.Create("TextTemplate:ExceptionHandlingTemplates.SendEmail"), + defaultCultureName: "en" + ).WithVirtualFilePath("/LINGYUN/Abp/ExceptionHandling/Emailing/Templates/SendEmail", false) + ); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN/Abp/ExceptionHandling/Emailing/Templates/ExceptionHandlingTemplates.cs b/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN/Abp/ExceptionHandling/Emailing/Templates/ExceptionHandlingTemplates.cs index 594199d33..59faceb89 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN/Abp/ExceptionHandling/Emailing/Templates/ExceptionHandlingTemplates.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling.Emailing/LINGYUN/Abp/ExceptionHandling/Emailing/Templates/ExceptionHandlingTemplates.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.ExceptionHandling.Emailing.Templates +namespace LINGYUN.Abp.ExceptionHandling.Emailing.Templates; + +public class ExceptionHandlingTemplates { - public class ExceptionHandlingTemplates - { - public const string SendEmail = "Abp.ExceptionHandling.SendEmail"; - } + public const string SendEmail = "Abp.ExceptionHandling.SendEmail"; } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/LINGYUN.Abp.ExceptionHandling.csproj b/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/LINGYUN.Abp.ExceptionHandling.csproj index 8781b6fca..5791447d1 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/LINGYUN.Abp.ExceptionHandling.csproj +++ b/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/LINGYUN.Abp.ExceptionHandling.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.ExceptionHandling + LINGYUN.Abp.ExceptionHandling + false + false + false diff --git a/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/LINGYUN/Abp/ExceptionHandling/AbpExceptionHandlingModule.cs b/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/LINGYUN/Abp/ExceptionHandling/AbpExceptionHandlingModule.cs index 5d1157168..d013b03da 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/LINGYUN/Abp/ExceptionHandling/AbpExceptionHandlingModule.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/LINGYUN/Abp/ExceptionHandling/AbpExceptionHandlingModule.cs @@ -2,10 +2,9 @@ using VoloAbpExceptionHandlingModule = Volo.Abp.ExceptionHandling.AbpExceptionHandlingModule ; -namespace LINGYUN.Abp.ExceptionHandling +namespace LINGYUN.Abp.ExceptionHandling; + +[DependsOn(typeof(VoloAbpExceptionHandlingModule))] +public class AbpExceptionHandlingModule : AbpModule { - [DependsOn(typeof(VoloAbpExceptionHandlingModule))] - public class AbpExceptionHandlingModule : AbpModule - { - } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/LINGYUN/Abp/ExceptionHandling/AbpExceptionHandlingOptions.cs b/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/LINGYUN/Abp/ExceptionHandling/AbpExceptionHandlingOptions.cs index 106cb89d9..a5fd55704 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/LINGYUN/Abp/ExceptionHandling/AbpExceptionHandlingOptions.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/LINGYUN/Abp/ExceptionHandling/AbpExceptionHandlingOptions.cs @@ -2,23 +2,22 @@ using System.Linq; using Volo.Abp.Collections; -namespace LINGYUN.Abp.ExceptionHandling +namespace LINGYUN.Abp.ExceptionHandling; + +public class AbpExceptionHandlingOptions { - public class AbpExceptionHandlingOptions + public ITypeList Handlers { get; } + public AbpExceptionHandlingOptions() { - public ITypeList Handlers { get; } - public AbpExceptionHandlingOptions() - { - Handlers = new TypeList(); - } + Handlers = new TypeList(); + } - public bool HasNotifierError(Exception ex) + public bool HasNotifierError(Exception ex) + { + if (typeof(IHasNotifierErrorMessage).IsAssignableFrom(ex.GetType())) { - if (typeof(IHasNotifierErrorMessage).IsAssignableFrom(ex.GetType())) - { - return true; - } - return Handlers.Any(x => x.IsAssignableFrom(ex.GetType())); + return true; } + return Handlers.Any(x => x.IsAssignableFrom(ex.GetType())); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/LINGYUN/Abp/ExceptionHandling/AbpExceptionSubscriberBase.cs b/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/LINGYUN/Abp/ExceptionHandling/AbpExceptionSubscriberBase.cs index 02e80fbd8..436de36b9 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/LINGYUN/Abp/ExceptionHandling/AbpExceptionSubscriberBase.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/LINGYUN/Abp/ExceptionHandling/AbpExceptionSubscriberBase.cs @@ -7,42 +7,41 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.ExceptionHandling; -namespace LINGYUN.Abp.ExceptionHandling +namespace LINGYUN.Abp.ExceptionHandling; + +public abstract class AbpExceptionSubscriberBase : ExceptionSubscriber { - public abstract class AbpExceptionSubscriberBase : ExceptionSubscriber - { - protected IServiceScopeFactory ServiceScopeFactory { get; } - protected AbpExceptionHandlingOptions Options { get; } + protected IServiceScopeFactory ServiceScopeFactory { get; } + protected AbpExceptionHandlingOptions Options { get; } - public IAbpLazyServiceProvider ServiceProvider { get; set; } + public IAbpLazyServiceProvider ServiceProvider { get; set; } - protected ILoggerFactory LoggerFactory => ServiceProvider.LazyGetService(); + protected ILoggerFactory LoggerFactory => ServiceProvider.LazyGetService(); - protected ILogger Logger => _lazyLogger.Value; - private Lazy _lazyLogger => new Lazy(() => LoggerFactory?.CreateLogger(GetType().FullName) ?? NullLogger.Instance, true); + protected ILogger Logger => _lazyLogger.Value; + private Lazy _lazyLogger => new Lazy(() => LoggerFactory?.CreateLogger(GetType().FullName) ?? NullLogger.Instance, true); - protected AbpExceptionSubscriberBase( - IServiceScopeFactory serviceScopeFactory, - IOptions options) - { - Options = options.Value; - ServiceScopeFactory = serviceScopeFactory; - } + protected AbpExceptionSubscriberBase( + IServiceScopeFactory serviceScopeFactory, + IOptions options) + { + Options = options.Value; + ServiceScopeFactory = serviceScopeFactory; + } - public override async Task HandleAsync(ExceptionNotificationContext context) + public override async Task HandleAsync(ExceptionNotificationContext context) + { + if (context.Handled && + Options.HasNotifierError(context.Exception)) { - if (context.Handled && - Options.HasNotifierError(context.Exception)) + using (var scope = ServiceScopeFactory.CreateScope()) { - using (var scope = ServiceScopeFactory.CreateScope()) - { - await SendErrorNotifierAsync( - new ExceptionSendNotifierContext(scope.ServiceProvider, context.Exception, context.LogLevel)); - } + await SendErrorNotifierAsync( + new ExceptionSendNotifierContext(scope.ServiceProvider, context.Exception, context.LogLevel)); } } - - protected abstract Task SendErrorNotifierAsync(ExceptionSendNotifierContext context); } + + protected abstract Task SendErrorNotifierAsync(ExceptionSendNotifierContext context); } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/LINGYUN/Abp/ExceptionHandling/ExceptionSendNotifierContext.cs b/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/LINGYUN/Abp/ExceptionHandling/ExceptionSendNotifierContext.cs index e681b3f83..ea9a68035 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/LINGYUN/Abp/ExceptionHandling/ExceptionSendNotifierContext.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/LINGYUN/Abp/ExceptionHandling/ExceptionSendNotifierContext.cs @@ -3,25 +3,24 @@ using System; using Volo.Abp; -namespace LINGYUN.Abp.ExceptionHandling +namespace LINGYUN.Abp.ExceptionHandling; + +public class ExceptionSendNotifierContext { - public class ExceptionSendNotifierContext - { - [NotNull] - public Exception Exception { get; } + [NotNull] + public Exception Exception { get; } - [NotNull] - public IServiceProvider ServiceProvider { get; } + [NotNull] + public IServiceProvider ServiceProvider { get; } - public LogLevel LogLevel { get; } - internal ExceptionSendNotifierContext( - [NotNull] IServiceProvider serviceProvider, - [NotNull] Exception exception, - LogLevel? logLevel = null) - { - ServiceProvider = Check.NotNull(serviceProvider, nameof(serviceProvider)); - Exception = Check.NotNull(exception, nameof(exception)); - LogLevel = logLevel ?? exception.GetLogLevel(); - } + public LogLevel LogLevel { get; } + internal ExceptionSendNotifierContext( + [NotNull] IServiceProvider serviceProvider, + [NotNull] Exception exception, + LogLevel? logLevel = null) + { + ServiceProvider = Check.NotNull(serviceProvider, nameof(serviceProvider)); + Exception = Check.NotNull(exception, nameof(exception)); + LogLevel = logLevel ?? exception.GetLogLevel(); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/LINGYUN/Abp/ExceptionHandling/IHasNotifierErrorMessage.cs b/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/LINGYUN/Abp/ExceptionHandling/IHasNotifierErrorMessage.cs index 19391e445..244d9526e 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/LINGYUN/Abp/ExceptionHandling/IHasNotifierErrorMessage.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.ExceptionHandling/LINGYUN/Abp/ExceptionHandling/IHasNotifierErrorMessage.cs @@ -1,9 +1,8 @@ -namespace LINGYUN.Abp.ExceptionHandling +namespace LINGYUN.Abp.ExceptionHandling; + +/// +/// 需要发送异常通知的自定义异常需要实现此接口 +/// +public interface IHasNotifierErrorMessage { - /// - /// 需要发送异常通知的自定义异常需要实现此接口 - /// - public interface IHasNotifierErrorMessage - { - } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis.Client/LINGYUN.Abp.Features.LimitValidation.Redis.Client.csproj b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis.Client/LINGYUN.Abp.Features.LimitValidation.Redis.Client.csproj index 0e8ed365a..a69d52181 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis.Client/LINGYUN.Abp.Features.LimitValidation.Redis.Client.csproj +++ b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis.Client/LINGYUN.Abp.Features.LimitValidation.Redis.Client.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Features.Client.Redis.Client + LINGYUN.Abp.Features.Client.Redis.Client + false + false + false 功能限制验证组件Redis客户端格式实现 diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis.Client/LINGYUN/Abp/Features/LimitValidation/Redis/Client/AbpFeaturesValidationRedisClientModule.cs b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis.Client/LINGYUN/Abp/Features/LimitValidation/Redis/Client/AbpFeaturesValidationRedisClientModule.cs index 2606d3789..5917bd0f2 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis.Client/LINGYUN/Abp/Features/LimitValidation/Redis/Client/AbpFeaturesValidationRedisClientModule.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis.Client/LINGYUN/Abp/Features/LimitValidation/Redis/Client/AbpFeaturesValidationRedisClientModule.cs @@ -1,9 +1,8 @@ using Volo.Abp.Modularity; -namespace LINGYUN.Abp.Features.LimitValidation.Redis.Client +namespace LINGYUN.Abp.Features.LimitValidation.Redis.Client; + +[DependsOn(typeof(AbpFeaturesValidationRedisModule))] +public class AbpFeaturesValidationRedisClientModule : AbpModule { - [DependsOn(typeof(AbpFeaturesValidationRedisModule))] - public class AbpFeaturesValidationRedisClientModule : AbpModule - { - } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis.Client/LINGYUN/Abp/Features/LimitValidation/Redis/Client/RedisClientLimitFeatureNamingNormalizer.cs b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis.Client/LINGYUN/Abp/Features/LimitValidation/Redis/Client/RedisClientLimitFeatureNamingNormalizer.cs index 8269af29f..6b4891d56 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis.Client/LINGYUN/Abp/Features/LimitValidation/Redis/Client/RedisClientLimitFeatureNamingNormalizer.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis.Client/LINGYUN/Abp/Features/LimitValidation/Redis/Client/RedisClientLimitFeatureNamingNormalizer.cs @@ -3,31 +3,30 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.Features.LimitValidation.Redis.Client +namespace LINGYUN.Abp.Features.LimitValidation.Redis.Client; + +[Dependency(ServiceLifetime.Singleton, ReplaceServices = true)] +[ExposeServices( + typeof(IRedisLimitFeatureNamingNormalizer), + typeof(RedisLimitFeatureNamingNormalizer))] +public class RedisClientLimitFeatureNamingNormalizer : RedisLimitFeatureNamingNormalizer { - [Dependency(ServiceLifetime.Singleton, ReplaceServices = true)] - [ExposeServices( - typeof(IRedisLimitFeatureNamingNormalizer), - typeof(RedisLimitFeatureNamingNormalizer))] - public class RedisClientLimitFeatureNamingNormalizer : RedisLimitFeatureNamingNormalizer + protected ICurrentClient CurrentClient { get; } + public RedisClientLimitFeatureNamingNormalizer( + ICurrentClient currentClient, + ICurrentTenant currentTenant) : base(currentTenant) { - protected ICurrentClient CurrentClient { get; } - public RedisClientLimitFeatureNamingNormalizer( - ICurrentClient currentClient, - ICurrentTenant currentTenant) : base(currentTenant) - { - CurrentClient = currentClient; - } + CurrentClient = currentClient; + } - public override string NormalizeFeatureName(string instance, RequiresLimitFeatureContext context) + public override string NormalizeFeatureName(string instance, RequiresLimitFeatureContext context) + { + if (CurrentClient.IsAuthenticated) { - if (CurrentClient.IsAuthenticated) - { - return CurrentTenant.IsAvailable - ? $"{instance}t:RequiresLimitFeature;t:{CurrentTenant.Id};c:{CurrentClient.Id};f:{context.LimitFeature}" - : $"{instance}tc:RequiresLimitFeature;c:{CurrentClient.Id};f:{context.LimitFeature}"; - } - return base.NormalizeFeatureName(instance, context); + return CurrentTenant.IsAvailable + ? $"{instance}t:RequiresLimitFeature;t:{CurrentTenant.Id};c:{CurrentClient.Id};f:{context.LimitFeature}" + : $"{instance}tc:RequiresLimitFeature;c:{CurrentClient.Id};f:{context.LimitFeature}"; } + return base.NormalizeFeatureName(instance, context); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN.Abp.Features.LimitValidation.Redis.csproj b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN.Abp.Features.LimitValidation.Redis.csproj index 341ddac82..fed460003 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN.Abp.Features.LimitValidation.Redis.csproj +++ b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN.Abp.Features.LimitValidation.Redis.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Features.Client.Redis + LINGYUN.Abp.Features.Client.Redis + false + false + false 功能限制验证组件Redis实现 diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN/Abp/Features/LimitValidation/Redis/AbpFeaturesValidationRedisModule.cs b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN/Abp/Features/LimitValidation/Redis/AbpFeaturesValidationRedisModule.cs index c328bb60e..510e5ce2e 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN/Abp/Features/LimitValidation/Redis/AbpFeaturesValidationRedisModule.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN/Abp/Features/LimitValidation/Redis/AbpFeaturesValidationRedisModule.cs @@ -3,23 +3,22 @@ using Volo.Abp.Modularity; using Volo.Abp.VirtualFileSystem; -namespace LINGYUN.Abp.Features.LimitValidation.Redis +namespace LINGYUN.Abp.Features.LimitValidation.Redis; + +[DependsOn( + typeof(AbpFeaturesLimitValidationModule))] +public class AbpFeaturesValidationRedisModule : AbpModule { - [DependsOn( - typeof(AbpFeaturesLimitValidationModule))] - public class AbpFeaturesValidationRedisModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) - { - var configuration = context.Services.GetConfiguration(); - Configure(configuration.GetSection("Features:Validation:Redis")); + var configuration = context.Services.GetConfiguration(); + Configure(configuration.GetSection("Features:Validation:Redis")); - Configure(options => - { - options.FileSets.AddEmbedded(); - }); + Configure(options => + { + options.FileSets.AddEmbedded(); + }); - context.Services.Replace(ServiceDescriptor.Singleton()); - } + context.Services.Replace(ServiceDescriptor.Singleton()); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN/Abp/Features/LimitValidation/Redis/AbpRedisRequiresLimitFeatureOptions.cs b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN/Abp/Features/LimitValidation/Redis/AbpRedisRequiresLimitFeatureOptions.cs index cd11120d2..2a068ff32 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN/Abp/Features/LimitValidation/Redis/AbpRedisRequiresLimitFeatureOptions.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN/Abp/Features/LimitValidation/Redis/AbpRedisRequiresLimitFeatureOptions.cs @@ -1,16 +1,15 @@ using Microsoft.Extensions.Options; using StackExchange.Redis; -namespace LINGYUN.Abp.Features.LimitValidation.Redis +namespace LINGYUN.Abp.Features.LimitValidation.Redis; + +public class AbpRedisRequiresLimitFeatureOptions : IOptions { - public class AbpRedisRequiresLimitFeatureOptions : IOptions + public string Configuration { get; set; } + public string InstanceName { get; set; } + public ConfigurationOptions ConfigurationOptions { get; set; } + AbpRedisRequiresLimitFeatureOptions IOptions.Value { - public string Configuration { get; set; } - public string InstanceName { get; set; } - public ConfigurationOptions ConfigurationOptions { get; set; } - AbpRedisRequiresLimitFeatureOptions IOptions.Value - { - get { return this; } - } + get { return this; } } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN/Abp/Features/LimitValidation/Redis/IRedisLimitFeatureNamingNormalizer.cs b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN/Abp/Features/LimitValidation/Redis/IRedisLimitFeatureNamingNormalizer.cs index 6b380782f..e8644eece 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN/Abp/Features/LimitValidation/Redis/IRedisLimitFeatureNamingNormalizer.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN/Abp/Features/LimitValidation/Redis/IRedisLimitFeatureNamingNormalizer.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.Features.LimitValidation.Redis +namespace LINGYUN.Abp.Features.LimitValidation.Redis; + +public interface IRedisLimitFeatureNamingNormalizer { - public interface IRedisLimitFeatureNamingNormalizer - { - string NormalizeFeatureName(string instance, RequiresLimitFeatureContext context); - } + string NormalizeFeatureName(string instance, RequiresLimitFeatureContext context); } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN/Abp/Features/LimitValidation/Redis/RedisLimitFeatureNamingNormalizer.cs b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN/Abp/Features/LimitValidation/Redis/RedisLimitFeatureNamingNormalizer.cs index 6766cee2c..a1a6def4f 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN/Abp/Features/LimitValidation/Redis/RedisLimitFeatureNamingNormalizer.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN/Abp/Features/LimitValidation/Redis/RedisLimitFeatureNamingNormalizer.cs @@ -1,25 +1,24 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.Features.LimitValidation.Redis +namespace LINGYUN.Abp.Features.LimitValidation.Redis; + +public class RedisLimitFeatureNamingNormalizer : IRedisLimitFeatureNamingNormalizer, ISingletonDependency { - public class RedisLimitFeatureNamingNormalizer : IRedisLimitFeatureNamingNormalizer, ISingletonDependency - { - protected ICurrentTenant CurrentTenant { get; } + protected ICurrentTenant CurrentTenant { get; } - public RedisLimitFeatureNamingNormalizer( - ICurrentTenant currentTenant) - { - CurrentTenant = currentTenant; - } + public RedisLimitFeatureNamingNormalizer( + ICurrentTenant currentTenant) + { + CurrentTenant = currentTenant; + } - public virtual string NormalizeFeatureName(string instance, RequiresLimitFeatureContext context) + public virtual string NormalizeFeatureName(string instance, RequiresLimitFeatureContext context) + { + if (CurrentTenant.IsAvailable) { - if (CurrentTenant.IsAvailable) - { - return $"{instance}t:RequiresLimitFeature;t:{CurrentTenant.Id};f:{context.LimitFeature}"; - } - return $"{instance}c:RequiresLimitFeature;f:{context.LimitFeature}"; + return $"{instance}t:RequiresLimitFeature;t:{CurrentTenant.Id};f:{context.LimitFeature}"; } + return $"{instance}c:RequiresLimitFeature;f:{context.LimitFeature}"; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN/Abp/Features/LimitValidation/Redis/RedisRequiresLimitFeatureChecker.cs b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN/Abp/Features/LimitValidation/Redis/RedisRequiresLimitFeatureChecker.cs index 03ccead83..ab439cead 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN/Abp/Features/LimitValidation/Redis/RedisRequiresLimitFeatureChecker.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/LINGYUN/Abp/Features/LimitValidation/Redis/RedisRequiresLimitFeatureChecker.cs @@ -12,127 +12,126 @@ using Volo.Abp.Timing; using Volo.Abp.VirtualFileSystem; -namespace LINGYUN.Abp.Features.LimitValidation.Redis +namespace LINGYUN.Abp.Features.LimitValidation.Redis; + +[DisableConventionalRegistration] +public class RedisRequiresLimitFeatureChecker : IRequiresLimitFeatureChecker { - [DisableConventionalRegistration] - public class RedisRequiresLimitFeatureChecker : IRequiresLimitFeatureChecker - { - private const string CHECK_LUA_SCRIPT = "/LINGYUN/Abp/Features/LimitValidation/Redis/Lua/check.lua"; - private const string PROCESS_LUA_SCRIPT = "/LINGYUN/Abp/Features/LimitValidation/Redis/Lua/process.lua"; + private const string CHECK_LUA_SCRIPT = "/LINGYUN/Abp/Features/LimitValidation/Redis/Lua/check.lua"; + private const string PROCESS_LUA_SCRIPT = "/LINGYUN/Abp/Features/LimitValidation/Redis/Lua/process.lua"; - public ILogger Logger { protected get; set; } + public ILogger Logger { protected get; set; } - private volatile ConnectionMultiplexer _connection; - private volatile ConfigurationOptions _redisConfig; - private IDatabaseAsync _redis; - private IServer _server; + private volatile ConnectionMultiplexer _connection; + private volatile ConfigurationOptions _redisConfig; + private IDatabaseAsync _redis; + private IServer _server; - private readonly IClock _clock; - private readonly IVirtualFileProvider _virtualFileProvider; - private readonly IRedisLimitFeatureNamingNormalizer _featureNamingNormalizer; - private readonly AbpRedisRequiresLimitFeatureOptions _options; - private readonly string _instance; + private readonly IClock _clock; + private readonly IVirtualFileProvider _virtualFileProvider; + private readonly IRedisLimitFeatureNamingNormalizer _featureNamingNormalizer; + private readonly AbpRedisRequiresLimitFeatureOptions _options; + private readonly string _instance; - private readonly SemaphoreSlim _connectionLock = new SemaphoreSlim(initialCount: 1, maxCount: 1); + private readonly SemaphoreSlim _connectionLock = new SemaphoreSlim(initialCount: 1, maxCount: 1); - public RedisRequiresLimitFeatureChecker( - IClock clock, - IVirtualFileProvider virtualFileProvider, - IRedisLimitFeatureNamingNormalizer featureNamingNormalizer, - IOptions optionsAccessor) + public RedisRequiresLimitFeatureChecker( + IClock clock, + IVirtualFileProvider virtualFileProvider, + IRedisLimitFeatureNamingNormalizer featureNamingNormalizer, + IOptions optionsAccessor) + { + if (optionsAccessor == null) { - if (optionsAccessor == null) - { - throw new ArgumentNullException(nameof(optionsAccessor)); - } + throw new ArgumentNullException(nameof(optionsAccessor)); + } - _options = optionsAccessor.Value; - _clock = clock ?? throw new ArgumentNullException(nameof(clock)); - _virtualFileProvider = virtualFileProvider ?? throw new ArgumentNullException(nameof(virtualFileProvider)); - _featureNamingNormalizer = featureNamingNormalizer ?? throw new ArgumentNullException(nameof(featureNamingNormalizer)); + _options = optionsAccessor.Value; + _clock = clock ?? throw new ArgumentNullException(nameof(clock)); + _virtualFileProvider = virtualFileProvider ?? throw new ArgumentNullException(nameof(virtualFileProvider)); + _featureNamingNormalizer = featureNamingNormalizer ?? throw new ArgumentNullException(nameof(featureNamingNormalizer)); - _instance = _options.InstanceName ?? string.Empty; + _instance = _options.InstanceName ?? string.Empty; - Logger = NullLogger.Instance; - } + Logger = NullLogger.Instance; + } - public async virtual Task CheckAsync(RequiresLimitFeatureContext context, CancellationToken cancellation = default) - { - await ConnectAsync(cancellation); + public async virtual Task CheckAsync(RequiresLimitFeatureContext context, CancellationToken cancellation = default) + { + await ConnectAsync(cancellation); - var result = await EvaluateAsync(CHECK_LUA_SCRIPT, context, cancellation); - return result + 1 <= context.Limit; - } + var result = await EvaluateAsync(CHECK_LUA_SCRIPT, context, cancellation); + return result + 1 <= context.Limit; + } + + public async virtual Task ProcessAsync(RequiresLimitFeatureContext context, CancellationToken cancellation = default) + { + await ConnectAsync(cancellation); + + await EvaluateAsync(PROCESS_LUA_SCRIPT, context, cancellation); + } - public async virtual Task ProcessAsync(RequiresLimitFeatureContext context, CancellationToken cancellation = default) + private async Task EvaluateAsync(string luaScriptFilePath, RequiresLimitFeatureContext context, CancellationToken cancellation = default) + { + var luaScriptFile = _virtualFileProvider.GetFileInfo(luaScriptFilePath); + using var luaScriptFileStream = luaScriptFile.CreateReadStream(); + var fileBytes = await luaScriptFileStream.GetAllBytesAsync(cancellation); + + var luaSha1 = fileBytes.Sha1(); + if (!await _server.ScriptExistsAsync(luaSha1)) { - await ConnectAsync(cancellation); - - await EvaluateAsync(PROCESS_LUA_SCRIPT, context, cancellation); + var luaScript = Encoding.UTF8.GetString(fileBytes); + luaSha1 = await _server.ScriptLoadAsync(luaScript); } - private async Task EvaluateAsync(string luaScriptFilePath, RequiresLimitFeatureContext context, CancellationToken cancellation = default) + var keys = new RedisKey[1] { NormalizeKey(context) }; + var values = new RedisValue[] { context.GetEffectTicks(_clock.Now) }; + var result = await _redis.ScriptEvaluateAsync(luaSha1, keys, values); + if (result.Resp2Type == ResultType.Error) { - var luaScriptFile = _virtualFileProvider.GetFileInfo(luaScriptFilePath); - using var luaScriptFileStream = luaScriptFile.CreateReadStream(); - var fileBytes = await luaScriptFileStream.GetAllBytesAsync(cancellation); + throw new AbpException($"Script evaluate error: {result}"); + } + return (int)result; + } - var luaSha1 = fileBytes.Sha1(); - if (!await _server.ScriptExistsAsync(luaSha1)) - { - var luaScript = Encoding.UTF8.GetString(fileBytes); - luaSha1 = await _server.ScriptLoadAsync(luaScript); - } + private string NormalizeKey(RequiresLimitFeatureContext context) + { + return _featureNamingNormalizer.NormalizeFeatureName(_instance, context); + } - var keys = new RedisKey[1] { NormalizeKey(context) }; - var values = new RedisValue[] { context.GetEffectTicks(_clock.Now) }; - var result = await _redis.ScriptEvaluateAsync(luaSha1, keys, values); - if (result.Resp2Type == ResultType.Error) - { - throw new AbpException($"Script evaluate error: {result}"); - } - return (int)result; - } + private async Task ConnectAsync(CancellationToken token = default) + { + token.ThrowIfCancellationRequested(); - private string NormalizeKey(RequiresLimitFeatureContext context) + if (_redis != null) { - return _featureNamingNormalizer.NormalizeFeatureName(_instance, context); + return; } - private async Task ConnectAsync(CancellationToken token = default(CancellationToken)) + await _connectionLock.WaitAsync(token); + try { - token.ThrowIfCancellationRequested(); - - if (_redis != null) + if (_redis == null) { - return; - } - - await _connectionLock.WaitAsync(token); - try - { - if (_redis == null) + if (_options.ConfigurationOptions != null) { - if (_options.ConfigurationOptions != null) - { - _redisConfig = _options.ConfigurationOptions; - } - else - { - _redisConfig = ConfigurationOptions.Parse(_options.Configuration); - } - _redisConfig.AllowAdmin = true; - _redisConfig.SetDefaultPorts(); - _connection = await ConnectionMultiplexer.ConnectAsync(_redisConfig); - // fix: 无需关注redis连接事件 - _redis = _connection.GetDatabase(); - _server = _connection.GetServer(_redisConfig.EndPoints[0]); + _redisConfig = _options.ConfigurationOptions; } + else + { + _redisConfig = ConfigurationOptions.Parse(_options.Configuration); + } + _redisConfig.AllowAdmin = true; + _redisConfig.SetDefaultPorts(); + _connection = await ConnectionMultiplexer.ConnectAsync(_redisConfig); + // fix: 无需关注redis连接事件 + _redis = _connection.GetDatabase(); + _server = _connection.GetServer(_redisConfig.EndPoints[0]); } - finally - { - _connectionLock.Release(); - } + } + finally + { + _connectionLock.Release(); } } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/System/BytesExtensions.cs b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/System/BytesExtensions.cs index d1bad7915..cba8afd53 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/System/BytesExtensions.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/System/BytesExtensions.cs @@ -1,16 +1,15 @@ using System.Security.Cryptography; -namespace System +namespace System; + +internal static class BytesExtensions { - internal static class BytesExtensions + public static byte[] Sha1(this byte[] data) { - public static byte[] Sha1(this byte[] data) + using (var sha = SHA1.Create()) { - using (var sha = SHA1.Create()) - { - var hashBytes = sha.ComputeHash(data); - return hashBytes; - } + var hashBytes = sha.ComputeHash(data); + return hashBytes; } } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/System/StringExtensions.cs b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/System/StringExtensions.cs index 3571cef99..afe83cbd9 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/System/StringExtensions.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation.Redis/System/StringExtensions.cs @@ -1,17 +1,16 @@ using System.Security.Cryptography; using System.Text; -namespace System +namespace System; + +internal static class StringExtensions { - internal static class StringExtensions + public static byte[] Sha1(this string str) { - public static byte[] Sha1(this string str) + using (var sha = SHA1.Create()) { - using (var sha = SHA1.Create()) - { - var hashBytes = sha.ComputeHash(Encoding.UTF8.GetBytes(str)); - return hashBytes; - } + var hashBytes = sha.ComputeHash(Encoding.UTF8.GetBytes(str)); + return hashBytes; } } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN.Abp.Features.LimitValidation.csproj b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN.Abp.Features.LimitValidation.csproj index f1509ae2f..c38744b11 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN.Abp.Features.LimitValidation.csproj +++ b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN.Abp.Features.LimitValidation.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Features.Client.LimitValidation + LINGYUN.Abp.Features.Client.LimitValidation + false + false + false diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/AbpFeatureLimitException.cs b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/AbpFeatureLimitException.cs index 6e13b5006..38b00a22d 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/AbpFeatureLimitException.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/AbpFeatureLimitException.cs @@ -4,30 +4,29 @@ using Volo.Abp.ExceptionHandling; using Volo.Abp.Localization; -namespace LINGYUN.Abp.Features.LimitValidation +namespace LINGYUN.Abp.Features.LimitValidation; + +public class AbpFeatureLimitException : AbpException, ILocalizeErrorMessage, IBusinessException { - public class AbpFeatureLimitException : AbpException, ILocalizeErrorMessage, IBusinessException - { - /// - /// 功能名称名称 - /// - public string Feature { get; } - /// - /// 上限 - /// - public int Limit { get; } + /// + /// 功能名称名称 + /// + public string Feature { get; } + /// + /// 上限 + /// + public int Limit { get; } - public AbpFeatureLimitException(string feature, int limit) - : base($"Features {feature} has exceeded the maximum number of calls {limit}, please apply for the appropriate permission") - { - Feature = feature; - Limit = limit; - } - public string LocalizeMessage(LocalizationContext context) - { - var localizer = context.LocalizerFactory.Create(); + public AbpFeatureLimitException(string feature, int limit) + : base($"Features {feature} has exceeded the maximum number of calls {limit}, please apply for the appropriate permission") + { + Feature = feature; + Limit = limit; + } + public string LocalizeMessage(LocalizationContext context) + { + var localizer = context.LocalizerFactory.Create(); - return localizer["FeaturesLimitException", Limit]; - } + return localizer["FeaturesLimitException", Limit]; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/AbpFeaturesLimitValidationModule.cs b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/AbpFeaturesLimitValidationModule.cs index 0da3c531b..629eef000 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/AbpFeaturesLimitValidationModule.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/AbpFeaturesLimitValidationModule.cs @@ -6,33 +6,32 @@ using Volo.Abp.Timing; using Volo.Abp.VirtualFileSystem; -namespace LINGYUN.Abp.Features.LimitValidation +namespace LINGYUN.Abp.Features.LimitValidation; + +[DependsOn( + typeof(AbpTimingModule), + typeof(AbpFeaturesModule))] +public class AbpFeaturesLimitValidationModule : AbpModule { - [DependsOn( - typeof(AbpTimingModule), - typeof(AbpFeaturesModule))] - public class AbpFeaturesLimitValidationModule : AbpModule + public override void PreConfigureServices(ServiceConfigurationContext context) { - public override void PreConfigureServices(ServiceConfigurationContext context) - { - context.Services.OnRegistered(FeaturesLimitValidationInterceptorRegistrar.RegisterIfNeeded); + context.Services.OnRegistered(FeaturesLimitValidationInterceptorRegistrar.RegisterIfNeeded); - Configure(options => - { - options.MapDefaultEffectPolicys(); - }); + Configure(options => + { + options.MapDefaultEffectPolicys(); + }); - Configure(options => - { - options.FileSets.AddEmbedded(); - }); + Configure(options => + { + options.FileSets.AddEmbedded(); + }); - Configure(options => - { - options.Resources - .Add("en") - .AddVirtualJson("/LINGYUN/Abp/Features/LimitValidation/Localization/Resources"); - }); - } + Configure(options => + { + options.Resources + .Add("en") + .AddVirtualJson("/LINGYUN/Abp/Features/LimitValidation/Localization/Resources"); + }); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/AbpFeaturesLimitValidationOptions.cs b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/AbpFeaturesLimitValidationOptions.cs index f7d158b50..605e068f6 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/AbpFeaturesLimitValidationOptions.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/AbpFeaturesLimitValidationOptions.cs @@ -3,85 +3,84 @@ using System.Collections.Generic; using Volo.Abp; -namespace LINGYUN.Abp.Features.LimitValidation +namespace LINGYUN.Abp.Features.LimitValidation; + +public class AbpFeaturesLimitValidationOptions { - public class AbpFeaturesLimitValidationOptions + public IDictionary> EffectPolicys { get; } + + public AbpFeaturesLimitValidationOptions() + { + EffectPolicys = new Dictionary>(); + } + /// + /// 变更功能限制策略时长计算方法 + /// + /// 限制策略 + /// 自定义的计算方法 + /// + /// 返回值一定要是秒钟刻度 + /// + public void MapEffectPolicy(LimitPolicy policy,[NotNull] Func func) { - public IDictionary> EffectPolicys { get; } + Check.NotNull(func, nameof(func)); - public AbpFeaturesLimitValidationOptions() + if (EffectPolicys.ContainsKey(policy)) { - EffectPolicys = new Dictionary>(); + EffectPolicys[policy] = func; } - /// - /// 变更功能限制策略时长计算方法 - /// - /// 限制策略 - /// 自定义的计算方法 - /// - /// 返回值一定要是秒钟刻度 - /// - public void MapEffectPolicy(LimitPolicy policy,[NotNull] Func func) + else { - Check.NotNull(func, nameof(func)); - - if (EffectPolicys.ContainsKey(policy)) - { - EffectPolicys[policy] = func; - } - else - { - EffectPolicys.Add(policy, func); - } + EffectPolicys.Add(policy, func); } + } - internal void MapDefaultEffectPolicys() + internal void MapDefaultEffectPolicys() + { + MapEffectPolicy(LimitPolicy.Minute, (now, tick) => { - MapEffectPolicy(LimitPolicy.Minute, (now, tick) => - { - return (long)(now.AddMinutes(tick) - now).TotalSeconds; - }); + return (long)(now.AddMinutes(tick) - now).TotalSeconds; + }); - MapEffectPolicy(LimitPolicy.Hours, (now, tick) => - { - return (long)(now.AddHours(tick) - now).TotalSeconds; - }); + MapEffectPolicy(LimitPolicy.Hours, (now, tick) => + { + return (long)(now.AddHours(tick) - now).TotalSeconds; + }); - MapEffectPolicy(LimitPolicy.Days, (now, tick) => - { - // 按天计算应取当天 - return (long)(now.Date.AddDays(tick) - now).TotalSeconds; - }); + MapEffectPolicy(LimitPolicy.Days, (now, tick) => + { + // 按天计算应取当天 + return (long)(now.Date.AddDays(tick) - now).TotalSeconds; + }); - MapEffectPolicy(LimitPolicy.Weeks,(now, tick) => + MapEffectPolicy(LimitPolicy.Weeks,(now, tick) => + { + // 按周计算应取当周 + var nowDate = now.Date; + var dayOfWeek = (int)nowDate.DayOfWeek - 1; + if (nowDate.DayOfWeek == DayOfWeek.Sunday) { - // 按周计算应取当周 - var nowDate = now.Date; - var dayOfWeek = (int)nowDate.DayOfWeek - 1; - if (nowDate.DayOfWeek == DayOfWeek.Sunday) - { - dayOfWeek = 6; - } - var utcOnceDayOfWeek = nowDate.AddDays(-dayOfWeek); + dayOfWeek = 6; + } + var utcOnceDayOfWeek = nowDate.AddDays(-dayOfWeek); - return (long)(utcOnceDayOfWeek.AddDays(tick * 7) - now).TotalSeconds; - }); + return (long)(utcOnceDayOfWeek.AddDays(tick * 7) - now).TotalSeconds; + }); - MapEffectPolicy(LimitPolicy.Month, (now, tick) => - { - // 按月计算应取当月 - var utcOnceDayOfMonth = new DateTime(now.Year, now.Month, 1, 0, 0, 0, 0); + MapEffectPolicy(LimitPolicy.Month, (now, tick) => + { + // 按月计算应取当月 + var utcOnceDayOfMonth = new DateTime(now.Year, now.Month, 1, 0, 0, 0, 0); - return (long)(utcOnceDayOfMonth.AddMonths(tick) - now).TotalSeconds; - }); + return (long)(utcOnceDayOfMonth.AddMonths(tick) - now).TotalSeconds; + }); - MapEffectPolicy(LimitPolicy.Years, (now, tick) => - { - // 按年计算应取当年 - var utcOnceDayOfYear = new DateTime(now.Year, 1, 1, 0, 0, 0, 0); + MapEffectPolicy(LimitPolicy.Years, (now, tick) => + { + // 按年计算应取当年 + var utcOnceDayOfYear = new DateTime(now.Year, 1, 1, 0, 0, 0, 0); - return (long)(utcOnceDayOfYear.AddYears(tick) - now).TotalSeconds; - }); - } + return (long)(utcOnceDayOfYear.AddYears(tick) - now).TotalSeconds; + }); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/FeaturesLimitValidationInterceptor.cs b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/FeaturesLimitValidationInterceptor.cs index d041e561d..1466632f2 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/FeaturesLimitValidationInterceptor.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/FeaturesLimitValidationInterceptor.cs @@ -7,94 +7,93 @@ using Volo.Abp.Features; using Volo.Abp.Validation.StringValues; -namespace LINGYUN.Abp.Features.LimitValidation +namespace LINGYUN.Abp.Features.LimitValidation; + +public class FeaturesLimitValidationInterceptor : AbpInterceptor, ITransientDependency { - public class FeaturesLimitValidationInterceptor : AbpInterceptor, ITransientDependency - { - private readonly IFeatureChecker _featureChecker; - private readonly AbpFeaturesLimitValidationOptions _options; - private readonly IRequiresLimitFeatureChecker _limitFeatureChecker; - private readonly IFeatureDefinitionManager _featureDefinitionManager; + private readonly IFeatureChecker _featureChecker; + private readonly AbpFeaturesLimitValidationOptions _options; + private readonly IRequiresLimitFeatureChecker _limitFeatureChecker; + private readonly IFeatureDefinitionManager _featureDefinitionManager; - public FeaturesLimitValidationInterceptor( - IFeatureChecker featureChecker, - IRequiresLimitFeatureChecker limitFeatureChecker, - IFeatureDefinitionManager featureDefinitionManager, - IOptions options) - { - _options = options.Value; - _featureChecker = featureChecker; - _limitFeatureChecker = limitFeatureChecker; - _featureDefinitionManager = featureDefinitionManager; + public FeaturesLimitValidationInterceptor( + IFeatureChecker featureChecker, + IRequiresLimitFeatureChecker limitFeatureChecker, + IFeatureDefinitionManager featureDefinitionManager, + IOptions options) + { + _options = options.Value; + _featureChecker = featureChecker; + _limitFeatureChecker = limitFeatureChecker; + _featureDefinitionManager = featureDefinitionManager; - } + } - public override async Task InterceptAsync(IAbpMethodInvocation invocation) + public override async Task InterceptAsync(IAbpMethodInvocation invocation) + { + if (AbpCrossCuttingConcerns.IsApplied(invocation.TargetObject, AbpCrossCuttingConcerns.FeatureChecking)) { - if (AbpCrossCuttingConcerns.IsApplied(invocation.TargetObject, AbpCrossCuttingConcerns.FeatureChecking)) - { - await invocation.ProceedAsync(); - return; - } - - var limitFeature = await GetRequiresLimitFeature(invocation.Method); - - if (limitFeature == null) - { - await invocation.ProceedAsync(); - return; - } - - // 获取功能限制上限 - var limit = await _featureChecker.GetAsync(limitFeature.LimitFeature, limitFeature.DefaultLimit); - // 获取功能限制时长 - var interval = await _featureChecker.GetAsync(limitFeature.IntervalFeature, limitFeature.DefaultInterval); - // 必要的上下文参数 - var limitFeatureContext = new RequiresLimitFeatureContext(limitFeature.LimitFeature, _options, limitFeature.Policy, interval, limit); - // 检查次数限制 - await PreCheckFeatureAsync(limitFeatureContext); - // 执行代理方法 await invocation.ProceedAsync(); - // 调用次数递增 - // TODO: 使用Redis结合Lua脚本? - await PostCheckFeatureAsync(limitFeatureContext); + return; } - protected async virtual Task PreCheckFeatureAsync(RequiresLimitFeatureContext context) + var limitFeature = await GetRequiresLimitFeature(invocation.Method); + + if (limitFeature == null) { - var allowed = await _limitFeatureChecker.CheckAsync(context); - if (!allowed) - { - throw new AbpFeatureLimitException(context.LimitFeature, context.Limit); - } + await invocation.ProceedAsync(); + return; } - protected async virtual Task PostCheckFeatureAsync(RequiresLimitFeatureContext context) + // 获取功能限制上限 + var limit = await _featureChecker.GetAsync(limitFeature.LimitFeature, limitFeature.DefaultLimit); + // 获取功能限制时长 + var interval = await _featureChecker.GetAsync(limitFeature.IntervalFeature, limitFeature.DefaultInterval); + // 必要的上下文参数 + var limitFeatureContext = new RequiresLimitFeatureContext(limitFeature.LimitFeature, _options, limitFeature.Policy, interval, limit); + // 检查次数限制 + await PreCheckFeatureAsync(limitFeatureContext); + // 执行代理方法 + await invocation.ProceedAsync(); + // 调用次数递增 + // TODO: 使用Redis结合Lua脚本? + await PostCheckFeatureAsync(limitFeatureContext); + } + + protected async virtual Task PreCheckFeatureAsync(RequiresLimitFeatureContext context) + { + var allowed = await _limitFeatureChecker.CheckAsync(context); + if (!allowed) { - await _limitFeatureChecker.ProcessAsync(context); + throw new AbpFeatureLimitException(context.LimitFeature, context.Limit); } + } + + protected async virtual Task PostCheckFeatureAsync(RequiresLimitFeatureContext context) + { + await _limitFeatureChecker.ProcessAsync(context); + } - protected async virtual Task GetRequiresLimitFeature(MethodInfo methodInfo) + protected async virtual Task GetRequiresLimitFeature(MethodInfo methodInfo) + { + var limitFeature = methodInfo.GetCustomAttribute(false); + if (limitFeature != null) { - var limitFeature = methodInfo.GetCustomAttribute(false); - if (limitFeature != null) + // 限制次数定义的不是范围参数,则不参与限制功能 + var featureLimitDefinition = await _featureDefinitionManager.GetOrNullAsync(limitFeature.LimitFeature); + if (featureLimitDefinition == null || + !typeof(NumericValueValidator).IsAssignableFrom(featureLimitDefinition.ValueType.Validator.GetType())) + { + return null; + } + // 时长刻度定义的不是范围参数,则不参与限制功能 + var featureIntervalDefinition = await _featureDefinitionManager.GetOrNullAsync(limitFeature.IntervalFeature); + if (featureIntervalDefinition == null || + !typeof(NumericValueValidator).IsAssignableFrom(featureIntervalDefinition.ValueType.Validator.GetType())) { - // 限制次数定义的不是范围参数,则不参与限制功能 - var featureLimitDefinition = await _featureDefinitionManager.GetOrNullAsync(limitFeature.LimitFeature); - if (featureLimitDefinition == null || - !typeof(NumericValueValidator).IsAssignableFrom(featureLimitDefinition.ValueType.Validator.GetType())) - { - return null; - } - // 时长刻度定义的不是范围参数,则不参与限制功能 - var featureIntervalDefinition = await _featureDefinitionManager.GetOrNullAsync(limitFeature.IntervalFeature); - if (featureIntervalDefinition == null || - !typeof(NumericValueValidator).IsAssignableFrom(featureIntervalDefinition.ValueType.Validator.GetType())) - { - return null; - } + return null; } - return limitFeature; } + return limitFeature; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/FeaturesLimitValidationInterceptorRegistrar.cs b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/FeaturesLimitValidationInterceptorRegistrar.cs index baf7ad4c2..3b6148766 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/FeaturesLimitValidationInterceptorRegistrar.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/FeaturesLimitValidationInterceptorRegistrar.cs @@ -4,35 +4,34 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.DynamicProxy; -namespace LINGYUN.Abp.Features.LimitValidation +namespace LINGYUN.Abp.Features.LimitValidation; + +public static class FeaturesLimitValidationInterceptorRegistrar { - public static class FeaturesLimitValidationInterceptorRegistrar + public static void RegisterIfNeeded(IOnServiceRegistredContext context) { - public static void RegisterIfNeeded(IOnServiceRegistredContext context) + if (ShouldIntercept(context.ImplementationType)) { - if (ShouldIntercept(context.ImplementationType)) - { - context.Interceptors.TryAdd(); - } + context.Interceptors.TryAdd(); } + } - private static bool ShouldIntercept(Type type) - { - return !DynamicProxyIgnoreTypes.Contains(type) && - (type.IsDefined(typeof(RequiresLimitFeatureAttribute), true) || - AnyMethodHasRequiresLimitFeatureAttribute(type)); - } + private static bool ShouldIntercept(Type type) + { + return !DynamicProxyIgnoreTypes.Contains(type) && + (type.IsDefined(typeof(RequiresLimitFeatureAttribute), true) || + AnyMethodHasRequiresLimitFeatureAttribute(type)); + } - private static bool AnyMethodHasRequiresLimitFeatureAttribute(Type implementationType) - { - return implementationType - .GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) - .Any(HasRequiresLimitFeatureAttribute); - } + private static bool AnyMethodHasRequiresLimitFeatureAttribute(Type implementationType) + { + return implementationType + .GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) + .Any(HasRequiresLimitFeatureAttribute); + } - private static bool HasRequiresLimitFeatureAttribute(MemberInfo methodInfo) - { - return methodInfo.IsDefined(typeof(RequiresLimitFeatureAttribute), true); - } + private static bool HasRequiresLimitFeatureAttribute(MemberInfo methodInfo) + { + return methodInfo.IsDefined(typeof(RequiresLimitFeatureAttribute), true); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/IRequiresLimitFeatureChecker.cs b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/IRequiresLimitFeatureChecker.cs index 73c2349aa..456ca7e64 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/IRequiresLimitFeatureChecker.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/IRequiresLimitFeatureChecker.cs @@ -1,12 +1,11 @@ using System.Threading; using System.Threading.Tasks; -namespace LINGYUN.Abp.Features.LimitValidation +namespace LINGYUN.Abp.Features.LimitValidation; + +public interface IRequiresLimitFeatureChecker { - public interface IRequiresLimitFeatureChecker - { - Task CheckAsync(RequiresLimitFeatureContext context, CancellationToken cancellation = default); + Task CheckAsync(RequiresLimitFeatureContext context, CancellationToken cancellation = default); - Task ProcessAsync(RequiresLimitFeatureContext context, CancellationToken cancellation = default); - } + Task ProcessAsync(RequiresLimitFeatureContext context, CancellationToken cancellation = default); } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/LimitPolicy.cs b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/LimitPolicy.cs index 1983239ce..0d1c3bf90 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/LimitPolicy.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/LimitPolicy.cs @@ -1,30 +1,29 @@ -namespace LINGYUN.Abp.Features.LimitValidation +namespace LINGYUN.Abp.Features.LimitValidation; + +public enum LimitPolicy : byte { - public enum LimitPolicy : byte - { - /// - /// 按分钟限制 - /// - Minute = 0, - /// - /// 按小时限制 - /// - Hours = 10, - /// - /// 按天限制 - /// - Days = 20, - /// - /// 按周限制 - /// - Weeks = 30, - /// - /// 按月限制 - /// - Month = 40, - /// - /// 按年限制 - /// - Years = 50 - } + /// + /// 按分钟限制 + /// + Minute = 0, + /// + /// 按小时限制 + /// + Hours = 10, + /// + /// 按天限制 + /// + Days = 20, + /// + /// 按周限制 + /// + Weeks = 30, + /// + /// 按月限制 + /// + Month = 40, + /// + /// 按年限制 + /// + Years = 50 } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/Localization/FeaturesLimitValidationResource.cs b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/Localization/FeaturesLimitValidationResource.cs index 6773048d3..62242a8f3 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/Localization/FeaturesLimitValidationResource.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/Localization/FeaturesLimitValidationResource.cs @@ -1,9 +1,8 @@ using Volo.Abp.Localization; -namespace LINGYUN.Abp.Features.LimitValidation.Localization +namespace LINGYUN.Abp.Features.LimitValidation.Localization; + +[LocalizationResourceName("AbpFeaturesLimitValidation")] +public class FeaturesLimitValidationResource { - [LocalizationResourceName("AbpFeaturesLimitValidation")] - public class FeaturesLimitValidationResource - { - } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/NullRequiresLimitFeatureChecker.cs b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/NullRequiresLimitFeatureChecker.cs index 0c94ec787..bac475068 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/NullRequiresLimitFeatureChecker.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/NullRequiresLimitFeatureChecker.cs @@ -2,18 +2,17 @@ using System.Threading.Tasks; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.Features.LimitValidation +namespace LINGYUN.Abp.Features.LimitValidation; + +public class NullRequiresLimitFeatureChecker : IRequiresLimitFeatureChecker, ISingletonDependency { - public class NullRequiresLimitFeatureChecker : IRequiresLimitFeatureChecker, ISingletonDependency + public Task CheckAsync(RequiresLimitFeatureContext context, CancellationToken cancellation = default) { - public Task CheckAsync(RequiresLimitFeatureContext context, CancellationToken cancellation = default) - { - return Task.FromResult(true); - } + return Task.FromResult(true); + } - public Task ProcessAsync(RequiresLimitFeatureContext context, CancellationToken cancellation = default) - { - return Task.CompletedTask; - } + public Task ProcessAsync(RequiresLimitFeatureContext context, CancellationToken cancellation = default) + { + return Task.CompletedTask; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/RequiresLimitFeatureAttribute.cs b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/RequiresLimitFeatureAttribute.cs index 8ed810a22..19f1e7fec 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/RequiresLimitFeatureAttribute.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/RequiresLimitFeatureAttribute.cs @@ -2,53 +2,52 @@ using System; using Volo.Abp; -namespace LINGYUN.Abp.Features.LimitValidation +namespace LINGYUN.Abp.Features.LimitValidation; + +/// +/// 单个功能的调用量限制 +/// +/// +/// 需要对于限制时长和限制上限功能区分,以便于更细粒度的限制 +/// +[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false)] +public class RequiresLimitFeatureAttribute : Attribute { /// - /// 单个功能的调用量限制 + /// 功能限制策略 /// - /// - /// 需要对于限制时长和限制上限功能区分,以便于更细粒度的限制 - /// - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false)] - public class RequiresLimitFeatureAttribute : Attribute - { - /// - /// 功能限制策略 - /// - public LimitPolicy Policy { get; } - /// - /// 默认限制时长 - /// - public int DefaultLimit { get; } - /// - /// 限制上限名称 - /// - public string LimitFeature { get; } - /// - /// 默认限制时长 - /// - public int DefaultInterval { get; } - /// - /// 限制时长名称 - /// - public string IntervalFeature { get; } + public LimitPolicy Policy { get; } + /// + /// 默认限制时长 + /// + public int DefaultLimit { get; } + /// + /// 限制上限名称 + /// + public string LimitFeature { get; } + /// + /// 默认限制时长 + /// + public int DefaultInterval { get; } + /// + /// 限制时长名称 + /// + public string IntervalFeature { get; } - public RequiresLimitFeatureAttribute( - [NotNull] string limitFeature, - [NotNull] string intervalFeature, - LimitPolicy policy = LimitPolicy.Month, - int defaultLimit = 1, - int defaultInterval = 1) - { - Check.NotNullOrWhiteSpace(limitFeature, nameof(limitFeature)); - Check.NotNullOrWhiteSpace(intervalFeature, nameof(intervalFeature)); + public RequiresLimitFeatureAttribute( + [NotNull] string limitFeature, + [NotNull] string intervalFeature, + LimitPolicy policy = LimitPolicy.Month, + int defaultLimit = 1, + int defaultInterval = 1) + { + Check.NotNullOrWhiteSpace(limitFeature, nameof(limitFeature)); + Check.NotNullOrWhiteSpace(intervalFeature, nameof(intervalFeature)); - Policy = policy; - LimitFeature = limitFeature; - DefaultLimit = defaultLimit; - IntervalFeature = intervalFeature; - DefaultInterval = defaultInterval; - } + Policy = policy; + LimitFeature = limitFeature; + DefaultLimit = defaultLimit; + IntervalFeature = intervalFeature; + DefaultInterval = defaultInterval; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/RequiresLimitFeatureContext.cs b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/RequiresLimitFeatureContext.cs index bef6ea518..f10f163fe 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/RequiresLimitFeatureContext.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Features.LimitValidation/LINGYUN/Abp/Features/LimitValidation/RequiresLimitFeatureContext.cs @@ -1,49 +1,48 @@ using System; using Volo.Abp; -namespace LINGYUN.Abp.Features.LimitValidation +namespace LINGYUN.Abp.Features.LimitValidation; + +public class RequiresLimitFeatureContext { - public class RequiresLimitFeatureContext - { - /// - /// 功能限制策略 - /// - public LimitPolicy Policy { get; } - /// - /// 限制时长 - /// - public int Interval { get; } - /// - /// 功能限制次数 - /// - public int Limit { get; } - /// - /// 功能限制次数名称 - /// - public string LimitFeature { get; } + /// + /// 功能限制策略 + /// + public LimitPolicy Policy { get; } + /// + /// 限制时长 + /// + public int Interval { get; } + /// + /// 功能限制次数 + /// + public int Limit { get; } + /// + /// 功能限制次数名称 + /// + public string LimitFeature { get; } - public AbpFeaturesLimitValidationOptions Options { get; } - public RequiresLimitFeatureContext( - string limitFeature, - AbpFeaturesLimitValidationOptions options, - LimitPolicy policy = LimitPolicy.Month, - int interval = 1, - int limit = 1) - { - Policy = policy; - Options = options; - LimitFeature = limitFeature; - Limit = Check.Positive(limit, nameof(limit)); - Interval = Check.Positive(interval, nameof(interval)); - } + public AbpFeaturesLimitValidationOptions Options { get; } + public RequiresLimitFeatureContext( + string limitFeature, + AbpFeaturesLimitValidationOptions options, + LimitPolicy policy = LimitPolicy.Month, + int interval = 1, + int limit = 1) + { + Policy = policy; + Options = options; + LimitFeature = limitFeature; + Limit = Check.Positive(limit, nameof(limit)); + Interval = Check.Positive(interval, nameof(interval)); + } - /// - /// 获取生效时间跨度,单位:s - /// - /// - public long GetEffectTicks(DateTime now) - { - return Options.EffectPolicys[Policy](now, Interval); - } + /// + /// 获取生效时间跨度,单位:s + /// + /// + public long GetEffectTicks(DateTime now) + { + return Options.EffectPolicys[Policy](now, Interval); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/LINGYUN.Abp.Hangfire.Dashboard.csproj b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/LINGYUN.Abp.Hangfire.Dashboard.csproj index 48715dcfa..be5b420bd 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/LINGYUN.Abp.Hangfire.Dashboard.csproj +++ b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/LINGYUN.Abp.Hangfire.Dashboard.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Hangfire.Dashboard + LINGYUN.Abp.Hangfire.Dashboard + false + false + false diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/LINGYUN/Abp/Hangfire/Dashboard/AbpHangfireDashboardModule.cs b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/LINGYUN/Abp/Hangfire/Dashboard/AbpHangfireDashboardModule.cs index 697846c4a..84417dac0 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/LINGYUN/Abp/Hangfire/Dashboard/AbpHangfireDashboardModule.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/LINGYUN/Abp/Hangfire/Dashboard/AbpHangfireDashboardModule.cs @@ -4,23 +4,22 @@ using Volo.Abp.Hangfire; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.Hangfire.Dashboard +namespace LINGYUN.Abp.Hangfire.Dashboard; + +[DependsOn( + typeof(AbpAuthorizationModule), + typeof(AbpHangfireModule))] +public class AbpHangfireDashboardModule : AbpModule { - [DependsOn( - typeof(AbpAuthorizationModule), - typeof(AbpHangfireModule))] - public class AbpHangfireDashboardModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + var preActions = context.Services.GetPreConfigureActions(); + context.Services.AddTransient(serviceProvider => { - var preActions = context.Services.GetPreConfigureActions(); - context.Services.AddTransient(serviceProvider => - { - var options = serviceProvider.GetRequiredService().Get(); - preActions.Configure(options); + var options = serviceProvider.GetRequiredService().Get(); + preActions.Configure(options); - return options; - }); - } + return options; + }); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/LINGYUN/Abp/Hangfire/Dashboard/AbpHangfireDashboardOptionsProvider.cs b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/LINGYUN/Abp/Hangfire/Dashboard/AbpHangfireDashboardOptionsProvider.cs index b21f90ae2..bb1a1aaed 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/LINGYUN/Abp/Hangfire/Dashboard/AbpHangfireDashboardOptionsProvider.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/LINGYUN/Abp/Hangfire/Dashboard/AbpHangfireDashboardOptionsProvider.cs @@ -1,13 +1,12 @@ using Hangfire; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.Hangfire.Dashboard +namespace LINGYUN.Abp.Hangfire.Dashboard; + +public class AbpHangfireDashboardOptionsProvider : ITransientDependency { - public class AbpHangfireDashboardOptionsProvider : ITransientDependency + public virtual DashboardOptions Get() { - public virtual DashboardOptions Get() - { - return new DashboardOptions(); - } + return new DashboardOptions(); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/LINGYUN/Abp/Hangfire/Dashboard/Authorization/DashboardAuthorizationFilter.cs b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/LINGYUN/Abp/Hangfire/Dashboard/Authorization/DashboardAuthorizationFilter.cs index 82ca20ee2..32e22f548 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/LINGYUN/Abp/Hangfire/Dashboard/Authorization/DashboardAuthorizationFilter.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/LINGYUN/Abp/Hangfire/Dashboard/Authorization/DashboardAuthorizationFilter.cs @@ -5,42 +5,41 @@ using System.Threading.Tasks; using Volo.Abp.Users; -namespace LINGYUN.Abp.Hangfire.Dashboard.Authorization +namespace LINGYUN.Abp.Hangfire.Dashboard.Authorization; + +public class DashboardAuthorizationFilter : IDashboardAsyncAuthorizationFilter { - public class DashboardAuthorizationFilter : IDashboardAsyncAuthorizationFilter + private readonly string[] _requiredPermissionNames; + + public DashboardAuthorizationFilter(params string[] requiredPermissionNames) { - private readonly string[] _requiredPermissionNames; + _requiredPermissionNames = requiredPermissionNames; + } - public DashboardAuthorizationFilter(params string[] requiredPermissionNames) + public async Task AuthorizeAsync(DashboardContext context) + { + if (!IsLoggedIn(context)) { - _requiredPermissionNames = requiredPermissionNames; + return false; } - public async Task AuthorizeAsync(DashboardContext context) + if (_requiredPermissionNames.IsNullOrEmpty()) { - if (!IsLoggedIn(context)) - { - return false; - } - - if (_requiredPermissionNames.IsNullOrEmpty()) - { - return true; - } - - return await IsPermissionGrantedAsync(context, _requiredPermissionNames); + return true; } - private static bool IsLoggedIn(DashboardContext context) - { - var currentUser = context.GetHttpContext().RequestServices.GetRequiredService(); - return currentUser.IsAuthenticated; - } + return await IsPermissionGrantedAsync(context, _requiredPermissionNames); + } - private static async Task IsPermissionGrantedAsync(DashboardContext context, string[] requiredPermissionNames) - { - var permissionChecker = context.GetHttpContext().RequestServices.GetRequiredService(); - return await permissionChecker.IsGrantedAsync(context, requiredPermissionNames); - } + private static bool IsLoggedIn(DashboardContext context) + { + var currentUser = context.GetHttpContext().RequestServices.GetRequiredService(); + return currentUser.IsAuthenticated; + } + + private static async Task IsPermissionGrantedAsync(DashboardContext context, string[] requiredPermissionNames) + { + var permissionChecker = context.GetHttpContext().RequestServices.GetRequiredService(); + return await permissionChecker.IsGrantedAsync(context, requiredPermissionNames); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/LINGYUN/Abp/Hangfire/Dashboard/Authorization/DashboardPermissionChecker.cs b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/LINGYUN/Abp/Hangfire/Dashboard/Authorization/DashboardPermissionChecker.cs index d17d8fe25..290225054 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/LINGYUN/Abp/Hangfire/Dashboard/Authorization/DashboardPermissionChecker.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/LINGYUN/Abp/Hangfire/Dashboard/Authorization/DashboardPermissionChecker.cs @@ -6,43 +6,42 @@ using Volo.Abp.Authorization.Permissions; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.Hangfire.Dashboard.Authorization +namespace LINGYUN.Abp.Hangfire.Dashboard.Authorization; + +public class DashboardPermissionChecker : IDashboardPermissionChecker, ITransientDependency { - public class DashboardPermissionChecker : IDashboardPermissionChecker, ITransientDependency + // 仪表板属于高频访问, 设定有效期的二级权限缓存 + private readonly IMemoryCache _memoryCache; + private readonly IPermissionChecker _permissionChecker; + + public DashboardPermissionChecker( + IMemoryCache memoryCache, + IPermissionChecker permissionChecker) + { + _memoryCache = memoryCache; + _permissionChecker = permissionChecker; + } + + public async virtual Task IsGrantedAsync(DashboardContext context, string[] requiredPermissionNames) { - // 仪表板属于高频访问, 设定有效期的二级权限缓存 - private readonly IMemoryCache _memoryCache; - private readonly IPermissionChecker _permissionChecker; + var localPermissionKey = $"_HDPS:{requiredPermissionNames.JoinAsString(";")}"; - public DashboardPermissionChecker( - IMemoryCache memoryCache, - IPermissionChecker permissionChecker) + if (_memoryCache.TryGetValue(localPermissionKey, out MultiplePermissionGrantResult cacheItem)) { - _memoryCache = memoryCache; - _permissionChecker = permissionChecker; + return cacheItem.AllGranted; } - public async virtual Task IsGrantedAsync(DashboardContext context, string[] requiredPermissionNames) - { - var localPermissionKey = $"_HDPS:{requiredPermissionNames.JoinAsString(";")}"; + cacheItem = await _permissionChecker.IsGrantedAsync(requiredPermissionNames); - if (_memoryCache.TryGetValue(localPermissionKey, out MultiplePermissionGrantResult cacheItem)) + _memoryCache.Set( + localPermissionKey, + cacheItem, + new MemoryCacheEntryOptions { - return cacheItem.AllGranted; - } - - cacheItem = await _permissionChecker.IsGrantedAsync(requiredPermissionNames); - - _memoryCache.Set( - localPermissionKey, - cacheItem, - new MemoryCacheEntryOptions - { - // 5分钟过期 - AbsoluteExpiration = DateTimeOffset.Now.AddMinutes(5d), - }); + // 5分钟过期 + AbsoluteExpiration = DateTimeOffset.Now.AddMinutes(5d), + }); - return cacheItem.AllGranted; - } + return cacheItem.AllGranted; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/LINGYUN/Abp/Hangfire/Dashboard/Authorization/IDashboardPermissionChecker.cs b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/LINGYUN/Abp/Hangfire/Dashboard/Authorization/IDashboardPermissionChecker.cs index be3830d45..7397d411e 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/LINGYUN/Abp/Hangfire/Dashboard/Authorization/IDashboardPermissionChecker.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/LINGYUN/Abp/Hangfire/Dashboard/Authorization/IDashboardPermissionChecker.cs @@ -1,10 +1,9 @@ using Hangfire.Dashboard; using System.Threading.Tasks; -namespace LINGYUN.Abp.Hangfire.Dashboard.Authorization +namespace LINGYUN.Abp.Hangfire.Dashboard.Authorization; + +public interface IDashboardPermissionChecker { - public interface IDashboardPermissionChecker - { - Task IsGrantedAsync(DashboardContext context, string[] requiredPermissionNames); - } + Task IsGrantedAsync(DashboardContext context, string[] requiredPermissionNames); } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/Microsoft/AspNetCore/Builder/ApplicationBuilderAbpHangfireAuthoricationMiddlewareExtension.cs b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/Microsoft/AspNetCore/Builder/ApplicationBuilderAbpHangfireAuthoricationMiddlewareExtension.cs index 885017397..8bf615389 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/Microsoft/AspNetCore/Builder/ApplicationBuilderAbpHangfireAuthoricationMiddlewareExtension.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/Microsoft/AspNetCore/Builder/ApplicationBuilderAbpHangfireAuthoricationMiddlewareExtension.cs @@ -1,12 +1,11 @@ using Microsoft.AspNetCore.Http; -namespace Microsoft.AspNetCore.Builder +namespace Microsoft.AspNetCore.Builder; + +public static class ApplicationBuilderAbpHangfireAuthoricationMiddlewareExtension { - public static class ApplicationBuilderAbpHangfireAuthoricationMiddlewareExtension + public static IApplicationBuilder UseHangfireAuthorication(this IApplicationBuilder app) { - public static IApplicationBuilder UseHangfireAuthorication(this IApplicationBuilder app) - { - return app.UseMiddleware(); - } + return app.UseMiddleware(); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/Microsoft/AspNetCore/Http/HangfireAuthoricationMiddleware.cs b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/Microsoft/AspNetCore/Http/HangfireAuthoricationMiddleware.cs index 11b5f9b92..7d6a8b510 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/Microsoft/AspNetCore/Http/HangfireAuthoricationMiddleware.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Dashboard/Microsoft/AspNetCore/Http/HangfireAuthoricationMiddleware.cs @@ -1,27 +1,26 @@ using System.Threading.Tasks; using Volo.Abp.DependencyInjection; -namespace Microsoft.AspNetCore.Http +namespace Microsoft.AspNetCore.Http; + +public class HangfireAuthoricationMiddleware : IMiddleware, ITransientDependency { - public class HangfireAuthoricationMiddleware : IMiddleware, ITransientDependency + public async Task InvokeAsync(HttpContext context, RequestDelegate next) { - public async Task InvokeAsync(HttpContext context, RequestDelegate next) + // 通过 iframe 加载页面的话,初次传递 access_token 到 QueryString + if (context.Request.Path.StartsWithSegments("/hangfire") && + context.User.Identity?.IsAuthenticated != true) { - // 通过 iframe 加载页面的话,初次传递 access_token 到 QueryString - if (context.Request.Path.StartsWithSegments("/hangfire") && - context.User.Identity?.IsAuthenticated != true) + if (context.Request.Query.TryGetValue("access_token", out var accessTokens)) + { + context.Request.Headers.Add("Authorization", accessTokens); + context.Response.Cookies.Append("access_token", accessTokens); + } + else if (context.Request.Cookies.TryGetValue("access_token", out string tokens)) { - if (context.Request.Query.TryGetValue("access_token", out var accessTokens)) - { - context.Request.Headers.Add("Authorization", accessTokens); - context.Response.Cookies.Append("access_token", accessTokens); - } - else if (context.Request.Cookies.TryGetValue("access_token", out string tokens)) - { - context.Request.Headers.Add("Authorization", tokens); - } + context.Request.Headers.Add("Authorization", tokens); } - await next(context); } + await next(context); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.MySqlStorage/LINGYUN.Abp.Hangfire.Storage.MySql.csproj b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.MySqlStorage/LINGYUN.Abp.Hangfire.Storage.MySql.csproj index a9f1408cb..de7717fbf 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.MySqlStorage/LINGYUN.Abp.Hangfire.Storage.MySql.csproj +++ b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.MySqlStorage/LINGYUN.Abp.Hangfire.Storage.MySql.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Hangfire.Storage.MySql + LINGYUN.Abp.Hangfire.Storage.MySql + false + false + false diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.MySqlStorage/LINGYUN/Abp/Hangfire/Storage/MySql/AbpHangfireMySqlStorageModule.cs b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.MySqlStorage/LINGYUN/Abp/Hangfire/Storage/MySql/AbpHangfireMySqlStorageModule.cs index 5249708bf..f56606484 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.MySqlStorage/LINGYUN/Abp/Hangfire/Storage/MySql/AbpHangfireMySqlStorageModule.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.MySqlStorage/LINGYUN/Abp/Hangfire/Storage/MySql/AbpHangfireMySqlStorageModule.cs @@ -6,39 +6,38 @@ using Volo.Abp.Hangfire; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.Hangfire.Storage.MySql -{ - [DependsOn(typeof(AbpHangfireModule))] - public class AbpHangfireMySqlStorageModule : AbpModule - { - private MySqlStorage _jobStorage; +namespace LINGYUN.Abp.Hangfire.Storage.MySql; - public override void PreConfigureServices(ServiceConfigurationContext context) - { - var configuration = context.Services.GetConfiguration(); +[DependsOn(typeof(AbpHangfireModule))] +public class AbpHangfireMySqlStorageModule : AbpModule +{ + private MySqlStorage _jobStorage; - var mysqlStorageOptions = new MySqlStorageOptions(); - configuration.GetSection("Hangfire:MySql").Bind(mysqlStorageOptions); + public override void PreConfigureServices(ServiceConfigurationContext context) + { + var configuration = context.Services.GetConfiguration(); - var hangfireMySqlConfiguration = configuration.GetSection("Hangfire:MySql:Connection"); - var hangfireMySqlCon = hangfireMySqlConfiguration.Exists() - ? hangfireMySqlConfiguration.Value : configuration.GetConnectionString("Default"); + var mysqlStorageOptions = new MySqlStorageOptions(); + configuration.GetSection("Hangfire:MySql").Bind(mysqlStorageOptions); - _jobStorage = new MySqlStorage(hangfireMySqlCon, mysqlStorageOptions); - context.Services.AddSingleton(fac => - { - return _jobStorage; - }); + var hangfireMySqlConfiguration = configuration.GetSection("Hangfire:MySql:Connection"); + var hangfireMySqlCon = hangfireMySqlConfiguration.Exists() + ? hangfireMySqlConfiguration.Value : configuration.GetConnectionString("Default"); - PreConfigure(config => - { - config.UseStorage(_jobStorage); - }); - } + _jobStorage = new MySqlStorage(hangfireMySqlCon, mysqlStorageOptions); + context.Services.AddSingleton(fac => + { + return _jobStorage; + }); - public override void OnApplicationShutdown(ApplicationShutdownContext context) + PreConfigure(config => { - _jobStorage?.Dispose(); - } + config.UseStorage(_jobStorage); + }); + } + + public override void OnApplicationShutdown(ApplicationShutdownContext context) + { + _jobStorage?.Dispose(); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Storage.SqlServer/LINGYUN.Abp.Hangfire.Storage.SqlServer.csproj b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Storage.SqlServer/LINGYUN.Abp.Hangfire.Storage.SqlServer.csproj index 47d2f4756..aeb192ca8 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Storage.SqlServer/LINGYUN.Abp.Hangfire.Storage.SqlServer.csproj +++ b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Storage.SqlServer/LINGYUN.Abp.Hangfire.Storage.SqlServer.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Hangfire.Storage.SqlServer + LINGYUN.Abp.Hangfire.Storage.SqlServer + false + false + false diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Storage.SqlServer/LINGYUN/Abp/Hangfire/Storage/SqlServer/AbpHangfireSqlServerStorageModule.cs b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Storage.SqlServer/LINGYUN/Abp/Hangfire/Storage/SqlServer/AbpHangfireSqlServerStorageModule.cs index 4152078ab..ce622afd3 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Storage.SqlServer/LINGYUN/Abp/Hangfire/Storage/SqlServer/AbpHangfireSqlServerStorageModule.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Hangfire.Storage.SqlServer/LINGYUN/Abp/Hangfire/Storage/SqlServer/AbpHangfireSqlServerStorageModule.cs @@ -5,34 +5,33 @@ using Volo.Abp.Hangfire; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.Hangfire.Storage.SqlServer +namespace LINGYUN.Abp.Hangfire.Storage.SqlServer; + +[DependsOn(typeof(AbpHangfireModule))] +public class AbpHangfireSqlServerStorageModule : AbpModule { - [DependsOn(typeof(AbpHangfireModule))] - public class AbpHangfireSqlServerStorageModule : AbpModule - { - private SqlServerStorage _jobStorage; + private SqlServerStorage _jobStorage; - public override void PreConfigureServices(ServiceConfigurationContext context) - { - var configuration = context.Services.GetConfiguration(); + public override void PreConfigureServices(ServiceConfigurationContext context) + { + var configuration = context.Services.GetConfiguration(); - var sqlserverStorageOptions = new SqlServerStorageOptions(); - configuration.GetSection("Hangfire:SqlServer").Bind(sqlserverStorageOptions); + var sqlserverStorageOptions = new SqlServerStorageOptions(); + configuration.GetSection("Hangfire:SqlServer").Bind(sqlserverStorageOptions); - var hangfireSqlServerConfiguration = configuration.GetSection("Hangfire:SqlServer:Connection"); - var hangfireSqlServerCon = hangfireSqlServerConfiguration.Exists() - ? hangfireSqlServerConfiguration.Value : configuration.GetConnectionString("Default"); + var hangfireSqlServerConfiguration = configuration.GetSection("Hangfire:SqlServer:Connection"); + var hangfireSqlServerCon = hangfireSqlServerConfiguration.Exists() + ? hangfireSqlServerConfiguration.Value : configuration.GetConnectionString("Default"); - _jobStorage = new SqlServerStorage(hangfireSqlServerCon, sqlserverStorageOptions); - context.Services.AddSingleton(fac => - { - return _jobStorage; - }); + _jobStorage = new SqlServerStorage(hangfireSqlServerCon, sqlserverStorageOptions); + context.Services.AddSingleton(fac => + { + return _jobStorage; + }); - PreConfigure(config => - { - config.UseStorage(_jobStorage); - }); - } + PreConfigure(config => + { + config.UseStorage(_jobStorage); + }); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Http.Client.Wrapper/LINGYUN.Abp.Http.Client.Wrapper.csproj b/aspnet-core/framework/common/LINGYUN.Abp.Http.Client.Wrapper/LINGYUN.Abp.Http.Client.Wrapper.csproj index a1335411b..cc7b27248 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Http.Client.Wrapper/LINGYUN.Abp.Http.Client.Wrapper.csproj +++ b/aspnet-core/framework/common/LINGYUN.Abp.Http.Client.Wrapper/LINGYUN.Abp.Http.Client.Wrapper.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Http.Client.Wrapper + LINGYUN.Abp.Http.Client.Wrapper + false + false + false diff --git a/aspnet-core/framework/common/LINGYUN.Abp.IdGenerator/LINGYUN.Abp.IdGenerator.csproj b/aspnet-core/framework/common/LINGYUN.Abp.IdGenerator/LINGYUN.Abp.IdGenerator.csproj index 020f81c7f..5456b674c 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.IdGenerator/LINGYUN.Abp.IdGenerator.csproj +++ b/aspnet-core/framework/common/LINGYUN.Abp.IdGenerator/LINGYUN.Abp.IdGenerator.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.IdGenerator + LINGYUN.Abp.IdGenerator + false + false + false diff --git a/aspnet-core/framework/common/LINGYUN.Abp.IdGenerator/LINGYUN/Abp/IdGenerator/Snowflake/SnowflakeIdGenerator.cs b/aspnet-core/framework/common/LINGYUN.Abp.IdGenerator/LINGYUN/Abp/IdGenerator/Snowflake/SnowflakeIdGenerator.cs index cf05b8787..7cd630954 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.IdGenerator/LINGYUN/Abp/IdGenerator/Snowflake/SnowflakeIdGenerator.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.IdGenerator/LINGYUN/Abp/IdGenerator/Snowflake/SnowflakeIdGenerator.cs @@ -1,134 +1,133 @@ using System; using Volo.Abp; -namespace LINGYUN.Abp.IdGenerator.Snowflake +namespace LINGYUN.Abp.IdGenerator.Snowflake; + +// reference: https://github.com/dotnetcore/CAP +// reference: https://blog.csdn.net/lq18050010830/article/details/89845790 +public class SnowflakeIdGenerator : IDistributedIdGenerator { - // reference: https://github.com/dotnetcore/CAP - // reference: https://blog.csdn.net/lq18050010830/article/details/89845790 - public class SnowflakeIdGenerator : IDistributedIdGenerator - { - public const long Twepoch = 1288834974657L; + public const long Twepoch = 1288834974657L; - private static readonly object _lock = new object(); - private long _lastTimestamp = -1L; + private static readonly object _lock = new object(); + private long _lastTimestamp = -1L; - protected long MaxWorkerId { get; set; } - protected long MaxDatacenterId { get; set; } + protected long MaxWorkerId { get; set; } + protected long MaxDatacenterId { get; set; } - protected int WorkerIdShift { get; } - protected int DatacenterIdShift { get; } - protected int TimestampLeftShift { get; } - protected long SequenceMask { get; } + protected int WorkerIdShift { get; } + protected int DatacenterIdShift { get; } + protected int TimestampLeftShift { get; } + protected long SequenceMask { get; } - protected SnowflakeIdOptions Options { get; } + protected SnowflakeIdOptions Options { get; } - private SnowflakeIdGenerator(SnowflakeIdOptions options) - { - Options = options; - WorkerIdShift = options.SequenceBits; - DatacenterIdShift = options.SequenceBits + options.WorkerIdBits; - TimestampLeftShift = options.SequenceBits + options.WorkerIdBits + options.DatacenterIdBits; - SequenceMask = -1L ^ (-1L << options.SequenceBits); - } + private SnowflakeIdGenerator(SnowflakeIdOptions options) + { + Options = options; + WorkerIdShift = options.SequenceBits; + DatacenterIdShift = options.SequenceBits + options.WorkerIdBits; + TimestampLeftShift = options.SequenceBits + options.WorkerIdBits + options.DatacenterIdBits; + SequenceMask = -1L ^ (-1L << options.SequenceBits); + } - public static SnowflakeIdGenerator Create(SnowflakeIdOptions options) + public static SnowflakeIdGenerator Create(SnowflakeIdOptions options) + { + var idGenerator = new SnowflakeIdGenerator(options) + { + WorkerId = options.WorkerId, + DatacenterId = options.DatacenterId, + Sequence = options.Sequence, + MaxWorkerId = -1L ^ (-1L << options.WorkerIdBits), + MaxDatacenterId = -1L ^ (-1L << options.DatacenterIdBits) + }; + + if (idGenerator.WorkerId <= 0 || options.WorkerId > idGenerator.MaxWorkerId) { - var idGenerator = new SnowflakeIdGenerator(options) + if (!int.TryParse(Environment.GetEnvironmentVariable("WORKERID", EnvironmentVariableTarget.Machine), out var workerId)) { - WorkerId = options.WorkerId, - DatacenterId = options.DatacenterId, - Sequence = options.Sequence, - MaxWorkerId = -1L ^ (-1L << options.WorkerIdBits), - MaxDatacenterId = -1L ^ (-1L << options.DatacenterIdBits) - }; - - if (idGenerator.WorkerId <= 0 || options.WorkerId > idGenerator.MaxWorkerId) + workerId = RandomHelper.GetRandom((int)idGenerator.MaxWorkerId); + } + + if (workerId > idGenerator.MaxWorkerId || workerId < 0) { - if (!int.TryParse(Environment.GetEnvironmentVariable("WORKERID", EnvironmentVariableTarget.Machine), out var workerId)) - { - workerId = RandomHelper.GetRandom((int)idGenerator.MaxWorkerId); - } + throw new ArgumentException($"worker Id can't be greater than {idGenerator.MaxWorkerId} or less than 0"); + } - if (workerId > idGenerator.MaxWorkerId || workerId < 0) - { - throw new ArgumentException($"worker Id can't be greater than {idGenerator.MaxWorkerId} or less than 0"); - } + idGenerator.WorkerId = workerId; + } - idGenerator.WorkerId = workerId; + if (idGenerator.DatacenterId <= 0 || options.DatacenterId > idGenerator.MaxDatacenterId) + { + if (!int.TryParse(Environment.GetEnvironmentVariable("DATACENTERID", EnvironmentVariableTarget.Machine), out var datacenterId)) + { + datacenterId = RandomHelper.GetRandom((int)idGenerator.MaxDatacenterId); } - if (idGenerator.DatacenterId <= 0 || options.DatacenterId > idGenerator.MaxDatacenterId) + if (datacenterId > idGenerator.MaxDatacenterId || datacenterId < 0) { - if (!int.TryParse(Environment.GetEnvironmentVariable("DATACENTERID", EnvironmentVariableTarget.Machine), out var datacenterId)) - { - datacenterId = RandomHelper.GetRandom((int)idGenerator.MaxDatacenterId); - } - - if (datacenterId > idGenerator.MaxDatacenterId || datacenterId < 0) - { - throw new ArgumentException($"datacenter Id can't be greater than {idGenerator.MaxDatacenterId} or less than 0"); - } - - idGenerator.DatacenterId = datacenterId; + throw new ArgumentException($"datacenter Id can't be greater than {idGenerator.MaxDatacenterId} or less than 0"); } - return idGenerator; + idGenerator.DatacenterId = datacenterId; } - public long WorkerId { get; internal set; } - public long DatacenterId { get; internal set; } - public long Sequence { get; internal set; } + return idGenerator; + } + + public long WorkerId { get; internal set; } + public long DatacenterId { get; internal set; } + public long Sequence { get; internal set; } - public virtual long Create() + public virtual long Create() + { + lock (_lock) { - lock (_lock) - { - var timestamp = TimeGen(); + var timestamp = TimeGen(); - if (timestamp < _lastTimestamp) + if (timestamp < _lastTimestamp) + { + // 如果启用此选项, 发生时间回退时使用上一个时间戳 + if (!Options.UsePreviousInTimeRollback) { - // 如果启用此选项, 发生时间回退时使用上一个时间戳 - if (!Options.UsePreviousInTimeRollback) - { - throw new Exception( - $"InvalidSystemClock: Clock moved backwards, Refusing to generate id for {_lastTimestamp - timestamp} milliseconds"); - } - timestamp = _lastTimestamp; + throw new Exception( + $"InvalidSystemClock: Clock moved backwards, Refusing to generate id for {_lastTimestamp - timestamp} milliseconds"); } + timestamp = _lastTimestamp; + } - if (_lastTimestamp == timestamp) - { - Sequence = (Sequence + 1) & SequenceMask; - if (Sequence == 0L) - { - timestamp = TilNextMillis(_lastTimestamp); - } - } - else + if (_lastTimestamp == timestamp) + { + Sequence = (Sequence + 1) & SequenceMask; + if (Sequence == 0L) { - Sequence = 0; + timestamp = TilNextMillis(_lastTimestamp); } + } + else + { + Sequence = 0; + } - _lastTimestamp = timestamp; - var id = ((timestamp - Twepoch) << TimestampLeftShift) | - (DatacenterId << DatacenterIdShift) | - (WorkerId << WorkerIdShift) | - Sequence; + _lastTimestamp = timestamp; + var id = ((timestamp - Twepoch) << TimestampLeftShift) | + (DatacenterId << DatacenterIdShift) | + (WorkerId << WorkerIdShift) | + Sequence; - return id; - } + return id; } + } - protected virtual long TilNextMillis(long lastTimestamp) - { - var timestamp = TimeGen(); - while (timestamp <= lastTimestamp) timestamp = TimeGen(); - return timestamp; - } + protected virtual long TilNextMillis(long lastTimestamp) + { + var timestamp = TimeGen(); + while (timestamp <= lastTimestamp) timestamp = TimeGen(); + return timestamp; + } - protected virtual long TimeGen() - { - return DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(); - } + protected virtual long TimeGen() + { + return DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Idempotent/LINGYUN.Abp.Idempotent.csproj b/aspnet-core/framework/common/LINGYUN.Abp.Idempotent/LINGYUN.Abp.Idempotent.csproj index 8abb65412..f86ece8c9 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Idempotent/LINGYUN.Abp.Idempotent.csproj +++ b/aspnet-core/framework/common/LINGYUN.Abp.Idempotent/LINGYUN.Abp.Idempotent.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Idempotent + LINGYUN.Abp.Idempotent + false + false + false enable diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN.Abp.Location.Baidu.csproj b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN.Abp.Location.Baidu.csproj index 1fae7882d..b38c0bc42 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN.Abp.Location.Baidu.csproj +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN.Abp.Location.Baidu.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Location.Baidu + LINGYUN.Abp.Location.Baidu + false + false + false 百度位置服务 diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/AbpBaiduLocationModule.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/AbpBaiduLocationModule.cs index c59fe4eaf..0fe3bd526 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/AbpBaiduLocationModule.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/AbpBaiduLocationModule.cs @@ -7,33 +7,32 @@ using Volo.Abp.Threading; using Volo.Abp.VirtualFileSystem; -namespace LINGYUN.Abp.Location.Baidu +namespace LINGYUN.Abp.Location.Baidu; + +[DependsOn( + typeof(AbpLocationModule), + typeof(AbpThreadingModule))] +public class AbpBaiduLocationModule : AbpModule { - [DependsOn( - typeof(AbpLocationModule), - typeof(AbpThreadingModule))] - public class AbpBaiduLocationModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) - { - var configuration = context.Services.GetConfiguration(); - Configure(configuration.GetSection("Location:Baidu")); + var configuration = context.Services.GetConfiguration(); + Configure(configuration.GetSection("Location:Baidu")); - context.Services.AddHttpClient(BaiduLocationHttpConsts.HttpClientName) - .AddTransientHttpErrorPolicy(builder => - builder.WaitAndRetryAsync(3, i => TimeSpan.FromSeconds(Math.Pow(2, i)))); + context.Services.AddHttpClient(BaiduLocationHttpConsts.HttpClientName) + .AddTransientHttpErrorPolicy(builder => + builder.WaitAndRetryAsync(3, i => TimeSpan.FromSeconds(Math.Pow(2, i)))); - Configure(options => - { - options.FileSets.AddEmbedded(); - }); + Configure(options => + { + options.FileSets.AddEmbedded(); + }); - Configure(options => - { - options.Resources - .Add("en") - .AddVirtualJson("/LINGYUN/Abp/Location/Baidu/Localization/Resources"); - }); - } + Configure(options => + { + options.Resources + .Add("en") + .AddVirtualJson("/LINGYUN/Abp/Location/Baidu/Localization/Resources"); + }); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/BaiduLocationHttpClient.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/BaiduLocationHttpClient.cs index 8c72dba1b..b18b4fe41 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/BaiduLocationHttpClient.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/BaiduLocationHttpClient.cs @@ -16,238 +16,237 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.Threading; -namespace LINGYUN.Abp.Location.Baidu +namespace LINGYUN.Abp.Location.Baidu; + +public class BaiduLocationHttpClient : ITransientDependency { - public class BaiduLocationHttpClient : ITransientDependency + protected BaiduLocationOptions Options { get; } + protected IServiceProvider ServiceProvider { get; } + protected IHttpClientFactory HttpClientFactory { get; } + protected ICancellationTokenProvider CancellationTokenProvider { get; } + + public BaiduLocationHttpClient( + IOptions options, + IServiceProvider serviceProvider, + IHttpClientFactory httpClientFactory, + ICancellationTokenProvider cancellationTokenProvider) { - protected BaiduLocationOptions Options { get; } - protected IServiceProvider ServiceProvider { get; } - protected IHttpClientFactory HttpClientFactory { get; } - protected ICancellationTokenProvider CancellationTokenProvider { get; } - - public BaiduLocationHttpClient( - IOptions options, - IServiceProvider serviceProvider, - IHttpClientFactory httpClientFactory, - ICancellationTokenProvider cancellationTokenProvider) - { - Options = options.Value; - ServiceProvider = serviceProvider; - HttpClientFactory = httpClientFactory; - CancellationTokenProvider = cancellationTokenProvider; - } + Options = options.Value; + ServiceProvider = serviceProvider; + HttpClientFactory = httpClientFactory; + CancellationTokenProvider = cancellationTokenProvider; + } - public async virtual Task IPGeocodeAsync(string ipAddress) + public async virtual Task IPGeocodeAsync(string ipAddress) + { + var requestParamters = new Dictionary { - var requestParamters = new Dictionary - { - { "ip", ipAddress }, - { "ak", Options.AccessKey }, - { "coor", Options.CoordType } - }; - var baiduMapUrl = "http://api.map.baidu.com"; - var baiduMapPath = "/location/ip"; - if (Options.CaculateAKSN) - { - var sn = BaiduAKSNCaculater.CaculateAKSN(Options.AccessSecret, baiduMapPath, requestParamters); - requestParamters.Add("sn", sn); - } - var requestUrl = BuildRequestUrl(baiduMapUrl, baiduMapPath, requestParamters); - var responseContent = await MakeRequestAndGetResultAsync(requestUrl); - var baiduLocationResponse = JsonConvert.DeserializeObject(responseContent); - if (!baiduLocationResponse.IsSuccess()) - { - var localizerFactory = ServiceProvider.GetRequiredService(); - var localizerErrorMessage = baiduLocationResponse.GetErrorMessage(Options.VisableErrorToClient).Localize(localizerFactory); - var localizerErrorDescription = baiduLocationResponse.GetErrorMessage(Options.VisableErrorToClient).Localize(localizerFactory); - var localizer = ServiceProvider.GetRequiredService>(); - localizerErrorMessage = localizer["ResolveLocationFailed", localizerErrorMessage, localizerErrorDescription]; - if (Options.VisableErrorToClient) - { - throw new UserFriendlyException(localizerErrorMessage); - } - throw new AbpException($"Resolution address failed:{localizerErrorMessage}!"); + { "ip", ipAddress }, + { "ak", Options.AccessKey }, + { "coor", Options.CoordType } + }; + var baiduMapUrl = "http://api.map.baidu.com"; + var baiduMapPath = "/location/ip"; + if (Options.CaculateAKSN) + { + var sn = BaiduAKSNCaculater.CaculateAKSN(Options.AccessSecret, baiduMapPath, requestParamters); + requestParamters.Add("sn", sn); + } + var requestUrl = BuildRequestUrl(baiduMapUrl, baiduMapPath, requestParamters); + var responseContent = await MakeRequestAndGetResultAsync(requestUrl); + var baiduLocationResponse = JsonConvert.DeserializeObject(responseContent); + if (!baiduLocationResponse.IsSuccess()) + { + var localizerFactory = ServiceProvider.GetRequiredService(); + var localizerErrorMessage = baiduLocationResponse.GetErrorMessage(Options.VisableErrorToClient).Localize(localizerFactory); + var localizerErrorDescription = baiduLocationResponse.GetErrorMessage(Options.VisableErrorToClient).Localize(localizerFactory); + var localizer = ServiceProvider.GetRequiredService>(); + localizerErrorMessage = localizer["ResolveLocationFailed", localizerErrorMessage, localizerErrorDescription]; + if (Options.VisableErrorToClient) + { + throw new UserFriendlyException(localizerErrorMessage); } - var location = new IPGecodeLocation - { - Province = baiduLocationResponse.Content.AddressDetail?.Province, - City = baiduLocationResponse.Content.AddressDetail?.City, - AdCode = baiduLocationResponse.Content.AddressDetail?.CityCode.ToString(), - }; - var point = baiduLocationResponse.Content.Point.ToPoint(); - location.Location.Latitude = point.Y; - location.Location.Longitude = point.X; - - location.AddAdditional("Address", baiduLocationResponse.Address); - location.AddAdditional("Content", baiduLocationResponse.Content); - - return location; + throw new AbpException($"Resolution address failed:{localizerErrorMessage}!"); } + var location = new IPGecodeLocation + { + Province = baiduLocationResponse.Content.AddressDetail?.Province, + City = baiduLocationResponse.Content.AddressDetail?.City, + AdCode = baiduLocationResponse.Content.AddressDetail?.CityCode.ToString(), + }; + var point = baiduLocationResponse.Content.Point.ToPoint(); + location.Location.Latitude = point.Y; + location.Location.Longitude = point.X; + + location.AddAdditional("Address", baiduLocationResponse.Address); + location.AddAdditional("Content", baiduLocationResponse.Content); + + return location; + } - public async virtual Task GeocodeAsync(string address, string city = null) + public async virtual Task GeocodeAsync(string address, string city = null) + { + var requestParamters = new Dictionary { - var requestParamters = new Dictionary - { - { "address", address }, - { "ak", Options.AccessKey }, - { "output", Options.Output }, - { "ret_coordtype", Options.ReturnCoordType } - }; - if (!city.IsNullOrWhiteSpace()) - { - requestParamters.Add("city", city); - } - var baiduMapUrl = "http://api.map.baidu.com"; - var baiduMapPath = "/geocoding/v3"; - if (Options.CaculateAKSN) - { - var sn = BaiduAKSNCaculater.CaculateAKSN(Options.AccessSecret, baiduMapPath, requestParamters); - requestParamters.Add("sn", sn); - } - var requestUrl = BuildRequestUrl(baiduMapUrl, baiduMapPath, requestParamters); - var responseContent = await MakeRequestAndGetResultAsync(requestUrl); - var baiduLocationResponse = JsonConvert.DeserializeObject(responseContent); - if (!baiduLocationResponse.IsSuccess()) - { - var localizerFactory = ServiceProvider.GetRequiredService(); - var localizerErrorMessage = baiduLocationResponse.GetErrorMessage(Options.VisableErrorToClient).Localize(localizerFactory); - var localizerErrorDescription = baiduLocationResponse.GetErrorMessage(Options.VisableErrorToClient).Localize(localizerFactory); - var localizer = ServiceProvider.GetRequiredService>(); - localizerErrorMessage = localizer["ResolveLocationFailed", localizerErrorMessage, localizerErrorDescription]; - if (Options.VisableErrorToClient) - { - throw new UserFriendlyException(localizerErrorMessage); - } - throw new AbpException($"Resolution address failed:{localizerErrorMessage}!"); + { "address", address }, + { "ak", Options.AccessKey }, + { "output", Options.Output }, + { "ret_coordtype", Options.ReturnCoordType } + }; + if (!city.IsNullOrWhiteSpace()) + { + requestParamters.Add("city", city); + } + var baiduMapUrl = "http://api.map.baidu.com"; + var baiduMapPath = "/geocoding/v3"; + if (Options.CaculateAKSN) + { + var sn = BaiduAKSNCaculater.CaculateAKSN(Options.AccessSecret, baiduMapPath, requestParamters); + requestParamters.Add("sn", sn); + } + var requestUrl = BuildRequestUrl(baiduMapUrl, baiduMapPath, requestParamters); + var responseContent = await MakeRequestAndGetResultAsync(requestUrl); + var baiduLocationResponse = JsonConvert.DeserializeObject(responseContent); + if (!baiduLocationResponse.IsSuccess()) + { + var localizerFactory = ServiceProvider.GetRequiredService(); + var localizerErrorMessage = baiduLocationResponse.GetErrorMessage(Options.VisableErrorToClient).Localize(localizerFactory); + var localizerErrorDescription = baiduLocationResponse.GetErrorMessage(Options.VisableErrorToClient).Localize(localizerFactory); + var localizer = ServiceProvider.GetRequiredService>(); + localizerErrorMessage = localizer["ResolveLocationFailed", localizerErrorMessage, localizerErrorDescription]; + if (Options.VisableErrorToClient) + { + throw new UserFriendlyException(localizerErrorMessage); } - var location = new GecodeLocation - { - Confidence = baiduLocationResponse.Result.Confidence, - Latitude = baiduLocationResponse.Result.Location.Lat, - Longitude = baiduLocationResponse.Result.Location.Lng, - Level = baiduLocationResponse.Result.Level - }; - location.AddAdditional("BaiduLocation", baiduLocationResponse.Result); - - return location; + throw new AbpException($"Resolution address failed:{localizerErrorMessage}!"); } + var location = new GecodeLocation + { + Confidence = baiduLocationResponse.Result.Confidence, + Latitude = baiduLocationResponse.Result.Location.Lat, + Longitude = baiduLocationResponse.Result.Location.Lng, + Level = baiduLocationResponse.Result.Level + }; + location.AddAdditional("BaiduLocation", baiduLocationResponse.Result); + + return location; + } - public async virtual Task ReGeocodeAsync(double lat, double lng, int radius = 1000) + public async virtual Task ReGeocodeAsync(double lat, double lng, int radius = 1000) + { + var requestParamters = new Dictionary { - var requestParamters = new Dictionary - { - { "ak", Options.AccessKey }, - { "output", Options.Output }, - { "radius", radius.ToString() }, - { "language", Options.Language }, - { "coordtype", Options.CoordType }, - { "extensions_poi", Options.ExtensionsPoi }, - { "ret_coordtype", Options.ReturnCoordType }, - { "location", string.Format("{0},{1}", lat, lng) }, - { "extensions_road", Options.ExtensionsRoad ? "true" : "false" }, - { "extensions_town", Options.ExtensionsTown ? "true" : "false" }, - }; - var baiduMapUrl = "http://api.map.baidu.com"; - var baiduMapPath = "/reverse_geocoding/v3"; - if (Options.CaculateAKSN) - { - var sn = BaiduAKSNCaculater.CaculateAKSN(Options.AccessSecret, baiduMapPath, requestParamters); - requestParamters.Add("sn", sn); - } + { "ak", Options.AccessKey }, + { "output", Options.Output }, + { "radius", radius.ToString() }, + { "language", Options.Language }, + { "coordtype", Options.CoordType }, + { "extensions_poi", Options.ExtensionsPoi }, + { "ret_coordtype", Options.ReturnCoordType }, + { "location", string.Format("{0},{1}", lat, lng) }, + { "extensions_road", Options.ExtensionsRoad ? "true" : "false" }, + { "extensions_town", Options.ExtensionsTown ? "true" : "false" }, + }; + var baiduMapUrl = "http://api.map.baidu.com"; + var baiduMapPath = "/reverse_geocoding/v3"; + if (Options.CaculateAKSN) + { + var sn = BaiduAKSNCaculater.CaculateAKSN(Options.AccessSecret, baiduMapPath, requestParamters); + requestParamters.Add("sn", sn); + } - var requestUrl = BuildRequestUrl(baiduMapUrl, baiduMapPath, requestParamters); - var responseContent = await MakeRequestAndGetResultAsync(requestUrl); - var baiduLocationResponse = JsonConvert.DeserializeObject(responseContent); - if (!baiduLocationResponse.IsSuccess()) - { - var localizerFactory = ServiceProvider.GetRequiredService(); - var localizerErrorMessage = baiduLocationResponse.GetErrorMessage().Localize(localizerFactory); - var localizerErrorDescription = baiduLocationResponse.GetErrorDescription().Localize(localizerFactory); - var localizer = ServiceProvider.GetRequiredService>(); - localizerErrorMessage = localizer["ResolveLocationFailed", localizerErrorMessage, localizerErrorDescription]; - if (Options.VisableErrorToClient) - { - throw new UserFriendlyException(localizerErrorMessage); - } - throw new AbpException($"Resolution address failed:{localizerErrorMessage}!"); + var requestUrl = BuildRequestUrl(baiduMapUrl, baiduMapPath, requestParamters); + var responseContent = await MakeRequestAndGetResultAsync(requestUrl); + var baiduLocationResponse = JsonConvert.DeserializeObject(responseContent); + if (!baiduLocationResponse.IsSuccess()) + { + var localizerFactory = ServiceProvider.GetRequiredService(); + var localizerErrorMessage = baiduLocationResponse.GetErrorMessage().Localize(localizerFactory); + var localizerErrorDescription = baiduLocationResponse.GetErrorDescription().Localize(localizerFactory); + var localizer = ServiceProvider.GetRequiredService>(); + localizerErrorMessage = localizer["ResolveLocationFailed", localizerErrorMessage, localizerErrorDescription]; + if (Options.VisableErrorToClient) + { + throw new UserFriendlyException(localizerErrorMessage); } - var location = new ReGeocodeLocation - { - Street = baiduLocationResponse.Result.AddressComponent.Street, - AdCode = baiduLocationResponse.Result.AddressComponent.AdCode.ToString(), - Address = baiduLocationResponse.Result.FormattedAddress, - FormattedAddress = baiduLocationResponse.Result.SematicDescription, - City = baiduLocationResponse.Result.AddressComponent.City, - Country = baiduLocationResponse.Result.AddressComponent.Country, - District = baiduLocationResponse.Result.AddressComponent.District, - Number = baiduLocationResponse.Result.AddressComponent.StreetNumber, - Province = baiduLocationResponse.Result.AddressComponent.Province, - Town = baiduLocationResponse.Result.AddressComponent.Town, - Pois = baiduLocationResponse.Result.Pois.Select(p => + throw new AbpException($"Resolution address failed:{localizerErrorMessage}!"); + } + var location = new ReGeocodeLocation + { + Street = baiduLocationResponse.Result.AddressComponent.Street, + AdCode = baiduLocationResponse.Result.AddressComponent.AdCode.ToString(), + Address = baiduLocationResponse.Result.FormattedAddress, + FormattedAddress = baiduLocationResponse.Result.SematicDescription, + City = baiduLocationResponse.Result.AddressComponent.City, + Country = baiduLocationResponse.Result.AddressComponent.Country, + District = baiduLocationResponse.Result.AddressComponent.District, + Number = baiduLocationResponse.Result.AddressComponent.StreetNumber, + Province = baiduLocationResponse.Result.AddressComponent.Province, + Town = baiduLocationResponse.Result.AddressComponent.Town, + Pois = baiduLocationResponse.Result.Pois.Select(p => + { + var poi = new Poi { - var poi = new Poi - { - Address = p.Address, - Name = p.Name, - Tag = p.Tag, - Type = p.PoiType - }; - if (int.TryParse(p.Distance, out int distance)) - { - poi.Distance = distance; - } - - return poi; - }).ToList(), - Roads = baiduLocationResponse.Result.Roads.Select(r => new Road + Address = p.Address, + Name = p.Name, + Tag = p.Tag, + Type = p.PoiType + }; + if (int.TryParse(p.Distance, out int distance)) { - Name = r.Name - }).ToList() - }; - // 如果存在Poi组,取最近的一个poi作为实际地址 - if (location.Pois.Any()) - { - var nearPoi = location.Pois.OrderBy(x => x.Distance).FirstOrDefault(); - location.Address = nearPoi.Address; - location.FormattedAddress = nearPoi.Name; - } - location.AddAdditional("BaiduLocation", baiduLocationResponse.Result); - - return location; - } + poi.Distance = distance; + } - protected async virtual Task MakeRequestAndGetResultAsync(string url) + return poi; + }).ToList(), + Roads = baiduLocationResponse.Result.Roads.Select(r => new Road + { + Name = r.Name + }).ToList() + }; + // 如果存在Poi组,取最近的一个poi作为实际地址 + if (location.Pois.Any()) { - var client = HttpClientFactory.CreateClient(BaiduLocationHttpConsts.HttpClientName); - var requestMessage = new HttpRequestMessage(HttpMethod.Get, url); + var nearPoi = location.Pois.OrderBy(x => x.Distance).FirstOrDefault(); + location.Address = nearPoi.Address; + location.FormattedAddress = nearPoi.Name; + } + location.AddAdditional("BaiduLocation", baiduLocationResponse.Result); - var response = await client.SendAsync(requestMessage, GetCancellationToken()); - if (!response.IsSuccessStatusCode) - { - throw new AbpException($"Baidu http request service returns error! HttpStatusCode: {response.StatusCode}, ReasonPhrase: {response.ReasonPhrase}"); - } - var resultContent = await response.Content.ReadAsStringAsync(); + return location; + } - return resultContent; - } + protected async virtual Task MakeRequestAndGetResultAsync(string url) + { + var client = HttpClientFactory.CreateClient(BaiduLocationHttpConsts.HttpClientName); + var requestMessage = new HttpRequestMessage(HttpMethod.Get, url); - protected virtual CancellationToken GetCancellationToken() + var response = await client.SendAsync(requestMessage, GetCancellationToken()); + if (!response.IsSuccessStatusCode) { - return CancellationTokenProvider.Token; + throw new AbpException($"Baidu http request service returns error! HttpStatusCode: {response.StatusCode}, ReasonPhrase: {response.ReasonPhrase}"); } + var resultContent = await response.Content.ReadAsStringAsync(); - protected virtual string BuildRequestUrl(string uri, string path, IDictionary paramters) + return resultContent; + } + + protected virtual CancellationToken GetCancellationToken() + { + return CancellationTokenProvider.Token; + } + + protected virtual string BuildRequestUrl(string uri, string path, IDictionary paramters) + { + var requestUrlBuilder = new StringBuilder(128); + requestUrlBuilder.Append(uri); + requestUrlBuilder.Append(path).Append("?"); + foreach (var paramter in paramters) { - var requestUrlBuilder = new StringBuilder(128); - requestUrlBuilder.Append(uri); - requestUrlBuilder.Append(path).Append("?"); - foreach (var paramter in paramters) - { - requestUrlBuilder.AppendFormat("{0}={1}", Uri.EscapeDataString(paramter.Key), Uri.EscapeDataString(paramter.Value)); - requestUrlBuilder.Append("&"); - } - requestUrlBuilder.Remove(requestUrlBuilder.Length - 1, 1); - return requestUrlBuilder.ToString(); + requestUrlBuilder.AppendFormat("{0}={1}", Uri.EscapeDataString(paramter.Key), Uri.EscapeDataString(paramter.Value)); + requestUrlBuilder.Append("&"); } + requestUrlBuilder.Remove(requestUrlBuilder.Length - 1, 1); + return requestUrlBuilder.ToString(); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/BaiduLocationHttpConsts.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/BaiduLocationHttpConsts.cs index 16d44b66b..471cc90e5 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/BaiduLocationHttpConsts.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/BaiduLocationHttpConsts.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.Location.Baidu +namespace LINGYUN.Abp.Location.Baidu; + +public class BaiduLocationHttpConsts { - public class BaiduLocationHttpConsts - { - public const string HttpClientName = "BaiduLocation"; - } + public const string HttpClientName = "BaiduLocation"; } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/BaiduLocationOptions.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/BaiduLocationOptions.cs index 7140a297b..ff409dc19 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/BaiduLocationOptions.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/BaiduLocationOptions.cs @@ -1,65 +1,64 @@ using System; -namespace LINGYUN.Abp.Location.Baidu +namespace LINGYUN.Abp.Location.Baidu; + +public class BaiduLocationOptions { - public class BaiduLocationOptions - { - /// - /// 用户申请注册的key - /// - public string AccessKey { get; set; } - /// - /// 用户申请注册的AccessSecret - /// - public string AccessSecret { get; set; } - /// - /// 坐标的类型,目前支持的坐标类型包括: - /// bd09ll(百度经纬度坐标) - /// bd09mc(百度米制坐标) - /// gcj02ll(国测局经纬度坐标,仅限中国) - /// wgs84ll( GPS经纬度) - /// - public string CoordType { get; set; } = "bd09ll"; - /// - /// 可选参数,添加后返回国测局经纬度坐标或百度米制 - /// gcj02ll(国测局坐标) - /// bd09mc(百度墨卡托坐标) - /// - public string ReturnCoordType { get; set; } = "bd09ll"; - /// - /// 计算sn - /// - public bool CaculateAKSN => !AccessSecret.IsNullOrWhiteSpace(); - /// - /// extensions_poi=0,不召回pois数据。 - /// extensions_poi=1,返回pois数据, - /// 默认显示周边1000米内的poi。 - /// - public string ExtensionsPoi { get; set; } = "1"; - /// - /// 当取值为true时,召回坐标周围最近的3条道路数据。 - /// 区别于行政区划中的street参数(street参数为行政区划中的街道,和普通道路不对应) - /// - public bool ExtensionsRoad { get; set; } = false; - /// - /// 当取值为true时,行政区划返回乡镇级数据(仅国内召回乡镇数据)。 - /// 默认不访问。 - /// - public bool ExtensionsTown { get; set; } = false; - /// - /// 指定召回的新政区划语言类型。 - /// el gu en vi ca it iw sv eu ar cs gl id es en-GB ru sr nl pt tr tl lv en-AU lt th ro - /// fil ta fr bg hr bn de hu fa hi pt-BR fi da ja te pt-PT ml ko kn sk zh-CN pl uk sl mr - /// local - /// - public string Language { get; set; } = "zh-CN"; - /// - /// 输出格式为json或者xml - /// - public string Output { get; set; } = "json"; - /// - /// 展示错误给客户端 - /// - public bool VisableErrorToClient { get; set; } = false; - } + /// + /// 用户申请注册的key + /// + public string AccessKey { get; set; } + /// + /// 用户申请注册的AccessSecret + /// + public string AccessSecret { get; set; } + /// + /// 坐标的类型,目前支持的坐标类型包括: + /// bd09ll(百度经纬度坐标) + /// bd09mc(百度米制坐标) + /// gcj02ll(国测局经纬度坐标,仅限中国) + /// wgs84ll( GPS经纬度) + /// + public string CoordType { get; set; } = "bd09ll"; + /// + /// 可选参数,添加后返回国测局经纬度坐标或百度米制 + /// gcj02ll(国测局坐标) + /// bd09mc(百度墨卡托坐标) + /// + public string ReturnCoordType { get; set; } = "bd09ll"; + /// + /// 计算sn + /// + public bool CaculateAKSN => !AccessSecret.IsNullOrWhiteSpace(); + /// + /// extensions_poi=0,不召回pois数据。 + /// extensions_poi=1,返回pois数据, + /// 默认显示周边1000米内的poi。 + /// + public string ExtensionsPoi { get; set; } = "1"; + /// + /// 当取值为true时,召回坐标周围最近的3条道路数据。 + /// 区别于行政区划中的street参数(street参数为行政区划中的街道,和普通道路不对应) + /// + public bool ExtensionsRoad { get; set; } = false; + /// + /// 当取值为true时,行政区划返回乡镇级数据(仅国内召回乡镇数据)。 + /// 默认不访问。 + /// + public bool ExtensionsTown { get; set; } = false; + /// + /// 指定召回的新政区划语言类型。 + /// el gu en vi ca it iw sv eu ar cs gl id es en-GB ru sr nl pt tr tl lv en-AU lt th ro + /// fil ta fr bg hr bn de hu fa hi pt-BR fi da ja te pt-PT ml ko kn sk zh-CN pl uk sl mr + /// local + /// + public string Language { get; set; } = "zh-CN"; + /// + /// 输出格式为json或者xml + /// + public string Output { get; set; } = "json"; + /// + /// 展示错误给客户端 + /// + public bool VisableErrorToClient { get; set; } = false; } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/BaiduLocationResolveProvider.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/BaiduLocationResolveProvider.cs index 52f4aa371..cd9eaaa84 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/BaiduLocationResolveProvider.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/BaiduLocationResolveProvider.cs @@ -2,32 +2,31 @@ using System.Threading.Tasks; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.Location.Baidu +namespace LINGYUN.Abp.Location.Baidu; + +[Dependency(ServiceLifetime.Transient)] +[ExposeServices(typeof(ILocationResolveProvider))] +public class BaiduLocationResolveProvider : ILocationResolveProvider { - [Dependency(ServiceLifetime.Transient)] - [ExposeServices(typeof(ILocationResolveProvider))] - public class BaiduLocationResolveProvider : ILocationResolveProvider - { - protected BaiduLocationHttpClient BaiduLocationHttpClient { get; } + protected BaiduLocationHttpClient BaiduLocationHttpClient { get; } - public BaiduLocationResolveProvider(BaiduLocationHttpClient baiduHttpRequestClient) - { - BaiduLocationHttpClient = baiduHttpRequestClient; - } + public BaiduLocationResolveProvider(BaiduLocationHttpClient baiduHttpRequestClient) + { + BaiduLocationHttpClient = baiduHttpRequestClient; + } - public async virtual Task IPGeocodeAsync(string ipAddress) - { - return await BaiduLocationHttpClient.IPGeocodeAsync(ipAddress); - } + public async virtual Task IPGeocodeAsync(string ipAddress) + { + return await BaiduLocationHttpClient.IPGeocodeAsync(ipAddress); + } - public async virtual Task ReGeocodeAsync(double lat, double lng, int radius = 50) - { - return await BaiduLocationHttpClient.ReGeocodeAsync(lat, lng, radius); - } + public async virtual Task ReGeocodeAsync(double lat, double lng, int radius = 50) + { + return await BaiduLocationHttpClient.ReGeocodeAsync(lat, lng, radius); + } - public async virtual Task GeocodeAsync(string address, string city = null) - { - return await BaiduLocationHttpClient.GeocodeAsync(address, city); - } + public async virtual Task GeocodeAsync(string address, string city = null) + { + return await BaiduLocationHttpClient.GeocodeAsync(address, city); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Localization/BaiduLocationResource.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Localization/BaiduLocationResource.cs index 22a76c969..612cb7e1f 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Localization/BaiduLocationResource.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Localization/BaiduLocationResource.cs @@ -1,9 +1,8 @@ using Volo.Abp.Localization; -namespace LINGYUN.Abp.Location.Baidu.Localization +namespace LINGYUN.Abp.Location.Baidu.Localization; + +[LocalizationResourceName("BaiduLocation")] +public class BaiduLocationResource { - [LocalizationResourceName("BaiduLocation")] - public class BaiduLocationResource - { - } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/AddressComponent.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/AddressComponent.cs index 5018da4f4..07af4a383 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/AddressComponent.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/AddressComponent.cs @@ -4,83 +4,82 @@ using System.Text; using System.Text.Json.Serialization; -namespace LINGYUN.Abp.Location.Baidu.Model +namespace LINGYUN.Abp.Location.Baidu.Model; + +public class AddressComponent { - public class AddressComponent - { - /// - /// 国家 - /// - public string Country { get; set; } - /// - /// 国家国家编码 - /// - [JsonProperty("country_code")] - [JsonPropertyName("country_code")] - public int CountryCode { get; set; } - /// - /// 国家英文缩写(三位) - /// - [JsonProperty("country_code_iso")] - [JsonPropertyName("country_code_iso")] - public string CountryCodeIso { get; set; } - /// - /// 国家英文缩写(两位) - /// - [JsonProperty("country_code_iso2")] - [JsonPropertyName("country_code_iso2")] - public string CountryCodeIso2 { get; set; } - /// - /// 省名 - /// - public string Province { get; set; } - /// - /// 城市名 - /// - public string City { get; set; } - /// - /// 城市所在级别(仅国外有参考意义。 - /// 国外行政区划与中国有差异,城市对应的层级不一定为『city』。 - /// country、province、city、district、town分别对应0-4级,若city_level=3,则district层级为该国家的city层级) - /// - [JsonProperty("city_level")] - [JsonPropertyName("city_level")] - public int CityLevel { get; set; } - /// - /// 区县名 - /// - public string District { get; set; } - /// - /// 乡镇名 - /// - public string Town { get; set; } - /// - /// 乡镇id - /// - [JsonProperty("town_code")] - [JsonPropertyName("town_code")] - public string TownCode { get; set; } - /// - /// 街道名(行政区划中的街道层级) - /// - public string Street { get; set; } - /// - /// 街道门牌号 - /// - [JsonProperty("street_number")] - [JsonPropertyName("street_number")] - public string StreetNumber { get; set; } - /// - /// 行政区划代码 - /// - public string AdCode { get; set; } - /// - /// 相对当前坐标点的方向,当有门牌号的时候返回数据 - /// - public string Direction { get; set; } - /// - /// 相对当前坐标点的距离,当有门牌号的时候返回数据 - /// - public string Distance { get; set; } - } + /// + /// 国家 + /// + public string Country { get; set; } + /// + /// 国家国家编码 + /// + [JsonProperty("country_code")] + [JsonPropertyName("country_code")] + public int CountryCode { get; set; } + /// + /// 国家英文缩写(三位) + /// + [JsonProperty("country_code_iso")] + [JsonPropertyName("country_code_iso")] + public string CountryCodeIso { get; set; } + /// + /// 国家英文缩写(两位) + /// + [JsonProperty("country_code_iso2")] + [JsonPropertyName("country_code_iso2")] + public string CountryCodeIso2 { get; set; } + /// + /// 省名 + /// + public string Province { get; set; } + /// + /// 城市名 + /// + public string City { get; set; } + /// + /// 城市所在级别(仅国外有参考意义。 + /// 国外行政区划与中国有差异,城市对应的层级不一定为『city』。 + /// country、province、city、district、town分别对应0-4级,若city_level=3,则district层级为该国家的city层级) + /// + [JsonProperty("city_level")] + [JsonPropertyName("city_level")] + public int CityLevel { get; set; } + /// + /// 区县名 + /// + public string District { get; set; } + /// + /// 乡镇名 + /// + public string Town { get; set; } + /// + /// 乡镇id + /// + [JsonProperty("town_code")] + [JsonPropertyName("town_code")] + public string TownCode { get; set; } + /// + /// 街道名(行政区划中的街道层级) + /// + public string Street { get; set; } + /// + /// 街道门牌号 + /// + [JsonProperty("street_number")] + [JsonPropertyName("street_number")] + public string StreetNumber { get; set; } + /// + /// 行政区划代码 + /// + public string AdCode { get; set; } + /// + /// 相对当前坐标点的方向,当有门牌号的时候返回数据 + /// + public string Direction { get; set; } + /// + /// 相对当前坐标点的距离,当有门牌号的时候返回数据 + /// + public string Distance { get; set; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/AddressDetail.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/AddressDetail.cs index e8c3ea16f..dddf20a51 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/AddressDetail.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/AddressDetail.cs @@ -1,20 +1,19 @@ using Newtonsoft.Json; using System.Text.Json.Serialization; -namespace LINGYUN.Abp.Location.Baidu.Model +namespace LINGYUN.Abp.Location.Baidu.Model; + +public class AddressDetail { - public class AddressDetail - { - [JsonProperty("city")] - [JsonPropertyName("city")] - public string City { get; set; } + [JsonProperty("city")] + [JsonPropertyName("city")] + public string City { get; set; } - [JsonProperty("city_code")] - [JsonPropertyName("city_code")] - public int CityCode { get; set; } + [JsonProperty("city_code")] + [JsonPropertyName("city_code")] + public int CityCode { get; set; } - [JsonProperty("province")] - [JsonPropertyName("province")] - public string Province { get; set; } - } + [JsonProperty("province")] + [JsonPropertyName("province")] + public string Province { get; set; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduGeocode.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduGeocode.cs index f72ef4569..90bff8157 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduGeocode.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduGeocode.cs @@ -1,11 +1,10 @@ -namespace LINGYUN.Abp.Location.Baidu.Model +namespace LINGYUN.Abp.Location.Baidu.Model; + +public class BaiduGeocode { - public class BaiduGeocode - { - public BaiduLocation Location { get; set; } = new BaiduLocation(); - public int Precise { get; set; } - public int Confidence { get; set; } - public int Comprehension { get; set; } - public string Level { get; set; } - } + public BaiduLocation Location { get; set; } = new BaiduLocation(); + public int Precise { get; set; } + public int Confidence { get; set; } + public int Comprehension { get; set; } + public string Level { get; set; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduLocation.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduLocation.cs index 9916dc99d..accc2b5be 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduLocation.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduLocation.cs @@ -1,8 +1,7 @@ -namespace LINGYUN.Abp.Location.Baidu.Model +namespace LINGYUN.Abp.Location.Baidu.Model; + +public class BaiduLocation { - public class BaiduLocation - { - public double Lat { get; set; } - public double Lng { get; set; } - } + public double Lat { get; set; } + public double Lng { get; set; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduPoi.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduPoi.cs index a52800469..52ea4df4b 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduPoi.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduPoi.cs @@ -1,63 +1,62 @@ using Newtonsoft.Json; using System.Text.Json.Serialization; -namespace LINGYUN.Abp.Location.Baidu.Model +namespace LINGYUN.Abp.Location.Baidu.Model; + +public class BaiduPoi { - public class BaiduPoi - { - /// - /// 地址信息 - /// - [JsonProperty("addr")] - [JsonPropertyName("addr")] - public string Address { get; set; } - /// - /// 名称 - /// - public string Name { get; set; } - /// - /// 标记 - /// - public string Tag { get; set; } - /// - /// 和当前坐标点的方向 - /// - public string Direction { get; set; } - /// - /// 离坐标点距离 - /// - public string Distance { get; set; } - /// - /// poi坐标{x,y} - /// - public Point Point { get; set; } = new Point(); + /// + /// 地址信息 + /// + [JsonProperty("addr")] + [JsonPropertyName("addr")] + public string Address { get; set; } + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 标记 + /// + public string Tag { get; set; } + /// + /// 和当前坐标点的方向 + /// + public string Direction { get; set; } + /// + /// 离坐标点距离 + /// + public string Distance { get; set; } + /// + /// poi坐标{x,y} + /// + public Point Point { get; set; } = new Point(); - /// - /// 坐标类型 - /// - public string PoiType { get; set; } - /// - /// 电话 - /// - [JsonProperty("tel")] - [JsonPropertyName("tel")] - public string TelPhone { get; set; } - /// - /// poi唯一标识 - /// - public string Uid { get; set; } - /// - /// 邮编 - /// - [JsonProperty("zip")] - [JsonPropertyName("zip")] - public string Post { get; set; } - /// - /// poi对应的主点poi(如,海底捞的主点为上地华联,该字段则为上地华联的poi信息。 - /// 如无,该字段为空),包含子字段和pois基础召回字段相同。 - /// - [JsonProperty("parent_poi")] - [JsonPropertyName("parent_poi")] - public BaiduPoi ParentPoi { get; set; } - } + /// + /// 坐标类型 + /// + public string PoiType { get; set; } + /// + /// 电话 + /// + [JsonProperty("tel")] + [JsonPropertyName("tel")] + public string TelPhone { get; set; } + /// + /// poi唯一标识 + /// + public string Uid { get; set; } + /// + /// 邮编 + /// + [JsonProperty("zip")] + [JsonPropertyName("zip")] + public string Post { get; set; } + /// + /// poi对应的主点poi(如,海底捞的主点为上地华联,该字段则为上地华联的poi信息。 + /// 如无,该字段为空),包含子字段和pois基础召回字段相同。 + /// + [JsonProperty("parent_poi")] + [JsonPropertyName("parent_poi")] + public BaiduPoi ParentPoi { get; set; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduReGeocode.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduReGeocode.cs index b8385a0ba..5b168328d 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduReGeocode.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduReGeocode.cs @@ -2,55 +2,54 @@ using System.Collections.Generic; using System.Text.Json.Serialization; -namespace LINGYUN.Abp.Location.Baidu.Model +namespace LINGYUN.Abp.Location.Baidu.Model; + +public class BaiduReGeocode { - public class BaiduReGeocode + /// + /// 经纬度坐标 + /// + [JsonProperty("location")] + [JsonPropertyName("location")] + public BaiduLocation Location { get; set; } + /// + /// 结构化地址信息 + /// + [JsonProperty("formatted_address")] + [JsonPropertyName("formatted_address")] + public string FormattedAddress { get; set; } + /// + /// 坐标所在商圈信息,如 "人民大学,中关村,苏州街"。 + /// 最多返回3个。 + /// + public string Business { get; set; } + /// + /// 地址元素列表 + /// + public AddressComponent AddressComponent { get; set; } + /// + /// 周边poi数组 + /// + public List Pois { get; set; } + /// + /// 周边道路数组 + /// + public List Roads { get; set; } + /// + /// 周边区域面数组 + /// + public List PoiRegions { get; set; } + /// + /// 当前位置结合POI的语义化结果描述 + /// + [JsonProperty("sematic_description")] + [JsonPropertyName("sematic_description")] + public string SematicDescription { get; set; } + public BaiduReGeocode() { - /// - /// 经纬度坐标 - /// - [JsonProperty("location")] - [JsonPropertyName("location")] - public BaiduLocation Location { get; set; } - /// - /// 结构化地址信息 - /// - [JsonProperty("formatted_address")] - [JsonPropertyName("formatted_address")] - public string FormattedAddress { get; set; } - /// - /// 坐标所在商圈信息,如 "人民大学,中关村,苏州街"。 - /// 最多返回3个。 - /// - public string Business { get; set; } - /// - /// 地址元素列表 - /// - public AddressComponent AddressComponent { get; set; } - /// - /// 周边poi数组 - /// - public List Pois { get; set; } - /// - /// 周边道路数组 - /// - public List Roads { get; set; } - /// - /// 周边区域面数组 - /// - public List PoiRegions { get; set; } - /// - /// 当前位置结合POI的语义化结果描述 - /// - [JsonProperty("sematic_description")] - [JsonPropertyName("sematic_description")] - public string SematicDescription { get; set; } - public BaiduReGeocode() - { - AddressComponent = new AddressComponent(); - Pois = new List(); - Roads = new List(); - PoiRegions = new List(); - } + AddressComponent = new AddressComponent(); + Pois = new List(); + Roads = new List(); + PoiRegions = new List(); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduRoad.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduRoad.cs index 4351a95d0..f760c0d68 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduRoad.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/BaiduRoad.cs @@ -1,14 +1,13 @@ -namespace LINGYUN.Abp.Location.Baidu.Model +namespace LINGYUN.Abp.Location.Baidu.Model; + +/// +/// 道路 +/// +public class BaiduRoad { + public string Name { get; set; } /// - /// 道路 + /// 传入的坐标点距离道路的大概距离 /// - public class BaiduRoad - { - public string Name { get; set; } - /// - /// 传入的坐标点距离道路的大概距离 - /// - public string Distance { get; set; } - } + public string Distance { get; set; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/Content.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/Content.cs index 1efd2b74b..57cce12e7 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/Content.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/Content.cs @@ -1,16 +1,15 @@ using Newtonsoft.Json; using System.Text.Json.Serialization; -namespace LINGYUN.Abp.Location.Baidu.Model +namespace LINGYUN.Abp.Location.Baidu.Model; + +public class Content { - public class Content - { - public string Address { get; set; } + public string Address { get; set; } - [JsonProperty("address_detail")] - [JsonPropertyName("address_detail")] - public AddressDetail AddressDetail { get; set; } = new AddressDetail(); + [JsonProperty("address_detail")] + [JsonPropertyName("address_detail")] + public AddressDetail AddressDetail { get; set; } = new AddressDetail(); - public IpPoint Point { get; set; } = new IpPoint(); - } + public IpPoint Point { get; set; } = new IpPoint(); } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/IpPoint.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/IpPoint.cs index 0fff0e04c..6bc9e3458 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/IpPoint.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/IpPoint.cs @@ -1,29 +1,28 @@ using System; -namespace LINGYUN.Abp.Location.Baidu.Model +namespace LINGYUN.Abp.Location.Baidu.Model; + +public class IpPoint { - public class IpPoint - { - public string X { get; set; } - public string Y { get; set; } + public string X { get; set; } + public string Y { get; set; } - public Point ToPoint() + public Point ToPoint() + { + if (!X.IsNullOrWhiteSpace() && + !Y.IsNullOrWhiteSpace()) { - if (!X.IsNullOrWhiteSpace() && - !Y.IsNullOrWhiteSpace()) + if (float.TryParse(X, out float x) && + float.TryParse(Y, out float y)) { - if (float.TryParse(X, out float x) && - float.TryParse(Y, out float y)) + return new Point { - return new Point - { - X = x, - Y = y - }; - } + X = x, + Y = y + }; } - - return new Point(); } + + return new Point(); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/PoiRegion.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/PoiRegion.cs index 0bd757462..e83c8078b 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/PoiRegion.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/PoiRegion.cs @@ -1,34 +1,33 @@ using Newtonsoft.Json; using System.Text.Json.Serialization; -namespace LINGYUN.Abp.Location.Baidu.Model +namespace LINGYUN.Abp.Location.Baidu.Model; + +/// +/// 区域面 +/// +public class PoiRegion { /// - /// 区域面 + /// 归属区域面名称 + /// + public string Name { get; set; } + /// + /// 归属区域面类型 + /// + public string Tag { get; set; } + /// + /// 请求中的坐标与所归属区域面的相对位置关系 + /// + [JsonProperty("direction_desc")] + [JsonPropertyName("direction_desc")] + public string DirectionDesc { get; set; } + /// + /// poi唯一标识 + /// + public string Uid { get; set; } + /// + /// 离坐标点距离 /// - public class PoiRegion - { - /// - /// 归属区域面名称 - /// - public string Name { get; set; } - /// - /// 归属区域面类型 - /// - public string Tag { get; set; } - /// - /// 请求中的坐标与所归属区域面的相对位置关系 - /// - [JsonProperty("direction_desc")] - [JsonPropertyName("direction_desc")] - public string DirectionDesc { get; set; } - /// - /// poi唯一标识 - /// - public string Uid { get; set; } - /// - /// 离坐标点距离 - /// - public string Distance { get; set; } - } + public string Distance { get; set; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/Point.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/Point.cs index 9589a29c2..694b9b601 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/Point.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Model/Point.cs @@ -1,8 +1,7 @@ -namespace LINGYUN.Abp.Location.Baidu.Model +namespace LINGYUN.Abp.Location.Baidu.Model; + +public class Point { - public class Point - { - public float X { get; set; } - public float Y { get; set; } - } + public float X { get; set; } + public float Y { get; set; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Response/BaiduGeocodeResponse.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Response/BaiduGeocodeResponse.cs index ec995541a..8de7ad163 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Response/BaiduGeocodeResponse.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Response/BaiduGeocodeResponse.cs @@ -1,9 +1,8 @@ using LINGYUN.Abp.Location.Baidu.Model; -namespace LINGYUN.Abp.Location.Baidu.Response +namespace LINGYUN.Abp.Location.Baidu.Response; + +public class BaiduGeocodeResponse : BaiduLocationResponse { - public class BaiduGeocodeResponse : BaiduLocationResponse - { - public BaiduGeocode Result { get; set; } = new BaiduGeocode(); - } + public BaiduGeocode Result { get; set; } = new BaiduGeocode(); } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Response/BaiduIpGeocodeResponse.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Response/BaiduIpGeocodeResponse.cs index ef3d4cab7..f0bc247f1 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Response/BaiduIpGeocodeResponse.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Response/BaiduIpGeocodeResponse.cs @@ -1,11 +1,10 @@ using LINGYUN.Abp.Location.Baidu.Model; -namespace LINGYUN.Abp.Location.Baidu.Response +namespace LINGYUN.Abp.Location.Baidu.Response; + +public class BaiduIpGeocodeResponse : BaiduLocationResponse { - public class BaiduIpGeocodeResponse : BaiduLocationResponse - { - public string Address { get; set; } + public string Address { get; set; } - public Content Content { get; set; } = new Content(); - } + public Content Content { get; set; } = new Content(); } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Response/BaiduLocationResponse.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Response/BaiduLocationResponse.cs index 75fb189a2..fb43675c3 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Response/BaiduLocationResponse.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Response/BaiduLocationResponse.cs @@ -2,133 +2,132 @@ using Volo.Abp; using Volo.Abp.Localization; -namespace LINGYUN.Abp.Location.Baidu.Response +namespace LINGYUN.Abp.Location.Baidu.Response; + +public abstract class BaiduLocationResponse { - public abstract class BaiduLocationResponse - { - public int Status { get; set; } + public int Status { get; set; } - public bool IsSuccess() - { - return Status == 0; - } + public bool IsSuccess() + { + return Status == 0; + } - public ILocalizableString GetErrorMessage(bool throwToClient = false) + public ILocalizableString GetErrorMessage(bool throwToClient = false) + { + switch (Status) { - switch (Status) - { - case 0: - return LocalizableString.Create("Message:RETURN_0"); - case 1: - return LocalizableString.Create("Message:RETURN_1"); - case 10: - return LocalizableString.Create("Message:RETURN_10"); - case 101: - return LocalizableString.Create("Message:RETURN_101"); - case 102: - return LocalizableString.Create("Message:RETURN_102"); - case 200: - return LocalizableString.Create("Message:RETURN_200"); - case 201: - return LocalizableString.Create("Message:RETURN_201"); - case 202: - return LocalizableString.Create("Message:RETURN_202"); - case 203: - return LocalizableString.Create("Message:RETURN_203"); - case 210: - return LocalizableString.Create("Message:RETURN_210"); - case 211: - return LocalizableString.Create("Message:RETURN_211"); - case 220: - return LocalizableString.Create("Message:RETURN_220"); - case 230: - return LocalizableString.Create("Message:RETURN_230"); - case 240: - return LocalizableString.Create("Message:RETURN_240"); - case 250: - return LocalizableString.Create("Message:RETURN_250"); - case 251: - return LocalizableString.Create("Message:RETURN_251"); - case 252: - return LocalizableString.Create("Message:RETURN_252"); - case 260: - return LocalizableString.Create("Message:RETURN_260"); - case 261: - return LocalizableString.Create("Message:RETURN_261"); - case 301: - return LocalizableString.Create("Message:RETURN_301"); - case 302: - return LocalizableString.Create("Message:RETURN_302"); - case 401: - return LocalizableString.Create("Message:RETURN_401"); - case 402: - return LocalizableString.Create("Message:RETURN_402"); - default: - if (throwToClient) - { - throw new LocationResolveException($"{Status} - no error code define!"); - } - throw new AbpException($"{Status} - no error code define!"); - } + case 0: + return LocalizableString.Create("Message:RETURN_0"); + case 1: + return LocalizableString.Create("Message:RETURN_1"); + case 10: + return LocalizableString.Create("Message:RETURN_10"); + case 101: + return LocalizableString.Create("Message:RETURN_101"); + case 102: + return LocalizableString.Create("Message:RETURN_102"); + case 200: + return LocalizableString.Create("Message:RETURN_200"); + case 201: + return LocalizableString.Create("Message:RETURN_201"); + case 202: + return LocalizableString.Create("Message:RETURN_202"); + case 203: + return LocalizableString.Create("Message:RETURN_203"); + case 210: + return LocalizableString.Create("Message:RETURN_210"); + case 211: + return LocalizableString.Create("Message:RETURN_211"); + case 220: + return LocalizableString.Create("Message:RETURN_220"); + case 230: + return LocalizableString.Create("Message:RETURN_230"); + case 240: + return LocalizableString.Create("Message:RETURN_240"); + case 250: + return LocalizableString.Create("Message:RETURN_250"); + case 251: + return LocalizableString.Create("Message:RETURN_251"); + case 252: + return LocalizableString.Create("Message:RETURN_252"); + case 260: + return LocalizableString.Create("Message:RETURN_260"); + case 261: + return LocalizableString.Create("Message:RETURN_261"); + case 301: + return LocalizableString.Create("Message:RETURN_301"); + case 302: + return LocalizableString.Create("Message:RETURN_302"); + case 401: + return LocalizableString.Create("Message:RETURN_401"); + case 402: + return LocalizableString.Create("Message:RETURN_402"); + default: + if (throwToClient) + { + throw new LocationResolveException($"{Status} - no error code define!"); + } + throw new AbpException($"{Status} - no error code define!"); } + } - public ILocalizableString GetErrorDescription(bool throwToClient = false) + public ILocalizableString GetErrorDescription(bool throwToClient = false) + { + switch (Status) { - switch (Status) - { - case 0: - return LocalizableString.Create("Description:RETURN_0"); - case 1: - return LocalizableString.Create("Description:RETURN_1"); - case 10: - return LocalizableString.Create("Description:RETURN_10"); - case 101: - return LocalizableString.Create("Description:RETURN_101"); - case 102: - return LocalizableString.Create("Description:RETURN_102"); - case 200: - return LocalizableString.Create("Description:RETURN_200"); - case 201: - return LocalizableString.Create("Description:RETURN_201"); - case 202: - return LocalizableString.Create("Description:RETURN_202"); - case 203: - return LocalizableString.Create("Description:RETURN_203"); - case 210: - return LocalizableString.Create("Description:RETURN_210"); - case 211: - return LocalizableString.Create("Description:RETURN_211"); - case 220: - return LocalizableString.Create("Description:RETURN_220"); - case 230: - return LocalizableString.Create("Description:RETURN_230"); - case 240: - return LocalizableString.Create("Description:RETURN_240"); - case 250: - return LocalizableString.Create("Description:RETURN_250"); - case 251: - return LocalizableString.Create("Description:RETURN_251"); - case 252: - return LocalizableString.Create("Description:RETURN_252"); - case 260: - return LocalizableString.Create("Description:RETURN_260"); - case 261: - return LocalizableString.Create("Description:RETURN_261"); - case 301: - return LocalizableString.Create("Description:RETURN_301"); - case 302: - return LocalizableString.Create("Description:RETURN_302"); - case 401: - return LocalizableString.Create("Description:RETURN_401"); - case 402: - return LocalizableString.Create("Description:RETURN_402"); - default: - if (throwToClient) - { - throw new LocationResolveException($"{Status} - no error code define!"); - } - throw new AbpException($"{Status} - no error code define!"); - } + case 0: + return LocalizableString.Create("Description:RETURN_0"); + case 1: + return LocalizableString.Create("Description:RETURN_1"); + case 10: + return LocalizableString.Create("Description:RETURN_10"); + case 101: + return LocalizableString.Create("Description:RETURN_101"); + case 102: + return LocalizableString.Create("Description:RETURN_102"); + case 200: + return LocalizableString.Create("Description:RETURN_200"); + case 201: + return LocalizableString.Create("Description:RETURN_201"); + case 202: + return LocalizableString.Create("Description:RETURN_202"); + case 203: + return LocalizableString.Create("Description:RETURN_203"); + case 210: + return LocalizableString.Create("Description:RETURN_210"); + case 211: + return LocalizableString.Create("Description:RETURN_211"); + case 220: + return LocalizableString.Create("Description:RETURN_220"); + case 230: + return LocalizableString.Create("Description:RETURN_230"); + case 240: + return LocalizableString.Create("Description:RETURN_240"); + case 250: + return LocalizableString.Create("Description:RETURN_250"); + case 251: + return LocalizableString.Create("Description:RETURN_251"); + case 252: + return LocalizableString.Create("Description:RETURN_252"); + case 260: + return LocalizableString.Create("Description:RETURN_260"); + case 261: + return LocalizableString.Create("Description:RETURN_261"); + case 301: + return LocalizableString.Create("Description:RETURN_301"); + case 302: + return LocalizableString.Create("Description:RETURN_302"); + case 401: + return LocalizableString.Create("Description:RETURN_401"); + case 402: + return LocalizableString.Create("Description:RETURN_402"); + default: + if (throwToClient) + { + throw new LocationResolveException($"{Status} - no error code define!"); + } + throw new AbpException($"{Status} - no error code define!"); } } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Response/BaiduReGeocodeResponse.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Response/BaiduReGeocodeResponse.cs index 3565e3950..388737bc0 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Response/BaiduReGeocodeResponse.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Response/BaiduReGeocodeResponse.cs @@ -1,9 +1,8 @@ using LINGYUN.Abp.Location.Baidu.Model; -namespace LINGYUN.Abp.Location.Baidu.Response +namespace LINGYUN.Abp.Location.Baidu.Response; + +public class BaiduReGeocodeResponse : BaiduLocationResponse { - public class BaiduReGeocodeResponse : BaiduLocationResponse - { - public BaiduReGeocode Result { get; set; } = new BaiduReGeocode(); - } + public BaiduReGeocode Result { get; set; } = new BaiduReGeocode(); } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Utils/BaiduAKSNCaculater.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Utils/BaiduAKSNCaculater.cs index f6effb69f..7a1b6532f 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Utils/BaiduAKSNCaculater.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Baidu/LINGYUN/Abp/Location/Baidu/Utils/BaiduAKSNCaculater.cs @@ -2,44 +2,43 @@ using System.Collections.Generic; using System.Text; -namespace LINGYUN.Abp.Location.Baidu.Utils +namespace LINGYUN.Abp.Location.Baidu.Utils; + +public class BaiduAKSNCaculater { - public class BaiduAKSNCaculater + private static string MD5(string password) { - private static string MD5(string password) + try { - try - { - System.Security.Cryptography.HashAlgorithm hash = System.Security.Cryptography.MD5.Create(); - byte[] hash_out = hash.ComputeHash(Encoding.UTF8.GetBytes(password)); - - var md5_str = BitConverter.ToString(hash_out).Replace("-", ""); - return md5_str.ToLower(); - } - catch - { - throw; - } - } + System.Security.Cryptography.HashAlgorithm hash = System.Security.Cryptography.MD5.Create(); + byte[] hash_out = hash.ComputeHash(Encoding.UTF8.GetBytes(password)); - private static string HttpBuildQuery(IDictionary querystring_arrays) + var md5_str = BitConverter.ToString(hash_out).Replace("-", ""); + return md5_str.ToLower(); + } + catch { - List list = new List(querystring_arrays.Count); - foreach (var item in querystring_arrays) - { - list.Add($"{Uri.EscapeDataString(item.Key)}={Uri.EscapeDataString(item.Value)}"); - } - - return string.Join("&", list); + throw; } + } - public static string CaculateAKSN(string sk, string url, IDictionary querystring_arrays) + private static string HttpBuildQuery(IDictionary querystring_arrays) + { + List list = new List(querystring_arrays.Count); + foreach (var item in querystring_arrays) { - var queryString = HttpBuildQuery(querystring_arrays); + list.Add($"{Uri.EscapeDataString(item.Key)}={Uri.EscapeDataString(item.Value)}"); + } - var str = Uri.EscapeDataString(url + "?" + queryString + sk); + return string.Join("&", list); + } - return MD5(str); - } + public static string CaculateAKSN(string sk, string url, IDictionary querystring_arrays) + { + var queryString = HttpBuildQuery(querystring_arrays); + + var str = Uri.EscapeDataString(url + "?" + queryString + sk); + + return MD5(str); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN.Abp.Location.Tencent.csproj b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN.Abp.Location.Tencent.csproj index aee407408..9671d96bc 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN.Abp.Location.Tencent.csproj +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN.Abp.Location.Tencent.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Location.Tencent + LINGYUN.Abp.Location.Tencent + false + false + false 腾讯位置服务 diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/AbpTencentLocationModule.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/AbpTencentLocationModule.cs index 73a6d7aa6..0a7dc035b 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/AbpTencentLocationModule.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/AbpTencentLocationModule.cs @@ -7,33 +7,32 @@ using Volo.Abp.Threading; using Volo.Abp.VirtualFileSystem; -namespace LINGYUN.Abp.Location.Tencent +namespace LINGYUN.Abp.Location.Tencent; + +[DependsOn( + typeof(AbpLocationModule), + typeof(AbpThreadingModule))] +public class AbpTencentLocationModule : AbpModule { - [DependsOn( - typeof(AbpLocationModule), - typeof(AbpThreadingModule))] - public class AbpTencentLocationModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) - { - var configuration = context.Services.GetConfiguration(); - Configure(configuration.GetSection("Location:Tencent")); + var configuration = context.Services.GetConfiguration(); + Configure(configuration.GetSection("Location:Tencent")); - context.Services.AddHttpClient(TencentLocationHttpConsts.HttpClientName) - .AddTransientHttpErrorPolicy(builder => - builder.WaitAndRetryAsync(3, i => TimeSpan.FromSeconds(Math.Pow(2, i)))); - - Configure(options => - { - options.FileSets.AddEmbedded(); - }); + context.Services.AddHttpClient(TencentLocationHttpConsts.HttpClientName) + .AddTransientHttpErrorPolicy(builder => + builder.WaitAndRetryAsync(3, i => TimeSpan.FromSeconds(Math.Pow(2, i)))); + + Configure(options => + { + options.FileSets.AddEmbedded(); + }); - Configure(options => - { - options.Resources - .Add("en") - .AddVirtualJson("/LINGYUN/Abp/Location/Tencent/Localization/Resources"); - }); - } + Configure(options => + { + options.Resources + .Add("en") + .AddVirtualJson("/LINGYUN/Abp/Location/Tencent/Localization/Resources"); + }); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Localization/TencentLocationResource.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Localization/TencentLocationResource.cs index a27b0cefe..18e0c6f00 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Localization/TencentLocationResource.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Localization/TencentLocationResource.cs @@ -1,9 +1,8 @@ using Volo.Abp.Localization; -namespace LINGYUN.Abp.Location.Tencent.Localization +namespace LINGYUN.Abp.Location.Tencent.Localization; + +[LocalizationResourceName("TencentLocation")] +public class TencentLocationResource { - [LocalizationResourceName("TencentLocation")] - public class TencentLocationResource - { - } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/AddressComponent.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/AddressComponent.cs index b76780573..fbf9994bb 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/AddressComponent.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/AddressComponent.cs @@ -1,41 +1,40 @@ using Newtonsoft.Json; -namespace LINGYUN.Abp.Location.Tencent.Model +namespace LINGYUN.Abp.Location.Tencent.Model; + +/// +/// 地址部件,address不满足需求时可自行拼接 +/// +public class AddressComponent { /// - /// 地址部件,address不满足需求时可自行拼接 + /// 国家 + /// + [JsonProperty("nation")] + public string Nation { get; set; } + /// + /// 省 + /// + [JsonProperty("province")] + public string Province { get; set; } + /// + /// 市 + /// + [JsonProperty("city")] + public string City { get; set; } + /// + /// 区,可能为空字串 + /// + [JsonProperty("district")] + public string District { get; set; } + /// + /// 街道,可能为空字串 + /// + [JsonProperty("street")] + public string Street { get; set; } + /// + /// 门牌,可能为空字串 /// - public class AddressComponent - { - /// - /// 国家 - /// - [JsonProperty("nation")] - public string Nation { get; set; } - /// - /// 省 - /// - [JsonProperty("province")] - public string Province { get; set; } - /// - /// 市 - /// - [JsonProperty("city")] - public string City { get; set; } - /// - /// 区,可能为空字串 - /// - [JsonProperty("district")] - public string District { get; set; } - /// - /// 街道,可能为空字串 - /// - [JsonProperty("street")] - public string Street { get; set; } - /// - /// 门牌,可能为空字串 - /// - [JsonProperty("street_number")] - public string StreetNumber { get; set; } - } + [JsonProperty("street_number")] + public string StreetNumber { get; set; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/AddressInfo.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/AddressInfo.cs index 5aac6ff4b..5d148e77d 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/AddressInfo.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/AddressInfo.cs @@ -1,53 +1,52 @@ using Newtonsoft.Json; -namespace LINGYUN.Abp.Location.Tencent.Model +namespace LINGYUN.Abp.Location.Tencent.Model; + +/// +/// 行政区划信息 +/// +public class AddressInfo { + [JsonProperty("adcode")] + public string AdCode { get; set; } + /// + /// 城市代码 + /// + [JsonProperty("city_code")] + public string CityCode { get; set; } + /// + /// 行政区划代码 + /// + [JsonProperty("nation_code")] + public string NationCode { get; set; } + /// + /// 行政区划名称 + /// + [JsonProperty("name")] + public string Name { get; set; } + /// + /// 国家 + /// + [JsonProperty("nation")] + public string Nation { get; set; } + /// + /// 省/直辖市 + /// + [JsonProperty("province")] + public string Province { get; set; } + /// + /// 市/地级区 及同级行政区划 + /// + [JsonProperty("city")] + public string City { get; set; } + /// + /// 区/县级市 及同级行政区划 + /// + [JsonProperty("district")] + public string District { get; set; } /// - /// 行政区划信息 - /// - public class AddressInfo - { - [JsonProperty("adcode")] - public string AdCode { get; set; } - /// - /// 城市代码 - /// - [JsonProperty("city_code")] - public string CityCode { get; set; } - /// - /// 行政区划代码 - /// - [JsonProperty("nation_code")] - public string NationCode { get; set; } - /// - /// 行政区划名称 - /// - [JsonProperty("name")] - public string Name { get; set; } - /// - /// 国家 - /// - [JsonProperty("nation")] - public string Nation { get; set; } - /// - /// 省/直辖市 - /// - [JsonProperty("province")] - public string Province { get; set; } - /// - /// 市/地级区 及同级行政区划 - /// - [JsonProperty("city")] - public string City { get; set; } - /// - /// 区/县级市 及同级行政区划 - /// - [JsonProperty("district")] - public string District { get; set; } - /// - /// 行政区划中心点坐标 - /// - [JsonProperty("location")] - public Location Location { get; set; } = new Location(); - } + /// 行政区划中心点坐标 + /// + [JsonProperty("location")] + public Location Location { get; set; } = new Location(); } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/AddressReference.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/AddressReference.cs index 82a1023f4..60ce464d4 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/AddressReference.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/AddressReference.cs @@ -1,56 +1,55 @@ using Newtonsoft.Json; -namespace LINGYUN.Abp.Location.Tencent.Model +namespace LINGYUN.Abp.Location.Tencent.Model; + +/// +/// 坐标相对位置参考 +/// +public class AddressReference { /// - /// 坐标相对位置参考 - /// - public class AddressReference - { - /// - /// 商圈 - /// - [JsonProperty("business_area")] - public Area BusinessArea { get; set; } = new Area(); - /// - /// 知名区域,如商圈或人们普遍认为有较高知名度的区域 - /// - [JsonProperty("famous_area")] - public Area FamousArea { get; set; } = new Area(); - /// - /// 乡镇街道 - /// - [JsonProperty("town")] - public Area Town { get; set; } = new Area(); - /// - /// 一级地标,可识别性较强、规模较大的地点、小区等 - /// - [JsonProperty("landmark_l1")] - public Area Landmark1 { get; set; } = new Area(); - /// - /// 二级地标,较一级地标更为精确,规模更小 - /// - [JsonProperty("landmark_l2")] - public Area Landmark2 { get; set; } = new Area(); - /// - /// 街道 - /// - [JsonProperty("street")] - public Area Street { get; set; } = new Area(); - /// - /// 门牌 - /// - [JsonProperty("street_number")] - public Area StreetNumber { get; set; } = new Area(); - /// - /// 交叉路口 - /// - [JsonProperty("crossroad")] - public Area CrossRoad { get; set; } = new Area(); - /// - /// 水系 - /// - [JsonProperty("water")] - public Area Water { get; set; } = new Area(); - } + /// 商圈 + /// + [JsonProperty("business_area")] + public Area BusinessArea { get; set; } = new Area(); + /// + /// 知名区域,如商圈或人们普遍认为有较高知名度的区域 + /// + [JsonProperty("famous_area")] + public Area FamousArea { get; set; } = new Area(); + /// + /// 乡镇街道 + /// + [JsonProperty("town")] + public Area Town { get; set; } = new Area(); + /// + /// 一级地标,可识别性较强、规模较大的地点、小区等 + /// + [JsonProperty("landmark_l1")] + public Area Landmark1 { get; set; } = new Area(); + /// + /// 二级地标,较一级地标更为精确,规模更小 + /// + [JsonProperty("landmark_l2")] + public Area Landmark2 { get; set; } = new Area(); + /// + /// 街道 + /// + [JsonProperty("street")] + public Area Street { get; set; } = new Area(); + /// + /// 门牌 + /// + [JsonProperty("street_number")] + public Area StreetNumber { get; set; } = new Area(); + /// + /// 交叉路口 + /// + [JsonProperty("crossroad")] + public Area CrossRoad { get; set; } = new Area(); + /// + /// 水系 + /// + [JsonProperty("water")] + public Area Water { get; set; } = new Area(); } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/Area.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/Area.cs index 0c9b70082..61efdf0d1 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/Area.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/Area.cs @@ -1,37 +1,36 @@ using Newtonsoft.Json; -namespace LINGYUN.Abp.Location.Tencent.Model +namespace LINGYUN.Abp.Location.Tencent.Model; + +/// +/// 区域信息 +/// +public class Area { /// - /// 区域信息 + /// 地点唯一标识 + /// + [JsonProperty("id")] + public string Id { get; set; } + /// + /// 名称/标题 + /// + [JsonProperty("title")] + public string Title { get; set; } + /// + /// 坐标 + /// + [JsonProperty("location")] + public Location Location { get; set; } = new Location(); + /// + /// 此参考位置到输入坐标的直线距离 + /// + [JsonProperty("_distance")] + public string Distance { get; set; } + /// + /// 此参考位置到输入坐标的方位关系, + /// 如:北、南、内 /// - public class Area - { - /// - /// 地点唯一标识 - /// - [JsonProperty("id")] - public string Id { get; set; } - /// - /// 名称/标题 - /// - [JsonProperty("title")] - public string Title { get; set; } - /// - /// 坐标 - /// - [JsonProperty("location")] - public Location Location { get; set; } = new Location(); - /// - /// 此参考位置到输入坐标的直线距离 - /// - [JsonProperty("_distance")] - public string Distance { get; set; } - /// - /// 此参考位置到输入坐标的方位关系, - /// 如:北、南、内 - /// - [JsonProperty("_dir_desc")] - public string DirDescription { get; set; } - } + [JsonProperty("_dir_desc")] + public string DirDescription { get; set; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/FormattedAddress.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/FormattedAddress.cs index 21905fff6..e1967f86c 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/FormattedAddress.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/FormattedAddress.cs @@ -1,21 +1,20 @@ using Newtonsoft.Json; -namespace LINGYUN.Abp.Location.Tencent.Model +namespace LINGYUN.Abp.Location.Tencent.Model; + +/// +/// 位置描述 +/// +public class FormattedAddress { /// - /// 位置描述 + /// 经过腾讯地图优化过的描述方式,更具人性化特点 + /// + [JsonProperty("recommend")] + public string ReCommend { get; set; } + /// + /// 大致位置,可用于对位置的粗略描述 /// - public class FormattedAddress - { - /// - /// 经过腾讯地图优化过的描述方式,更具人性化特点 - /// - [JsonProperty("recommend")] - public string ReCommend { get; set; } - /// - /// 大致位置,可用于对位置的粗略描述 - /// - [JsonProperty("rough")] - public string Rough { get; set; } - } + [JsonProperty("rough")] + public string Rough { get; set; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/Location.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/Location.cs index d8b9bcf6b..1bf61b1da 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/Location.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/Location.cs @@ -1,21 +1,20 @@ using Newtonsoft.Json; -namespace LINGYUN.Abp.Location.Tencent.Model +namespace LINGYUN.Abp.Location.Tencent.Model; + +/// +/// 行政区划中心点坐标 +/// +public class Location { /// - /// 行政区划中心点坐标 + /// 纬度 + /// + [JsonProperty("lat")] + public double Lat { get; set; } + /// + /// 经度 /// - public class Location - { - /// - /// 纬度 - /// - [JsonProperty("lat")] - public double Lat { get; set; } - /// - /// 经度 - /// - [JsonProperty("lng")] - public double Lng { get; set; } - } + [JsonProperty("lng")] + public double Lng { get; set; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/Poi.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/Poi.cs index 9849ab8ae..8c2dc429c 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/Poi.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/Poi.cs @@ -1,46 +1,45 @@ using Newtonsoft.Json; -namespace LINGYUN.Abp.Location.Tencent.Model +namespace LINGYUN.Abp.Location.Tencent.Model; + +/// +/// POI对象 +/// +public class Poi { /// - /// POI对象 + /// 地点唯一标识 + /// + [JsonProperty("id")] + public string Id { get; set; } + /// + /// 名称/标题 + /// + [JsonProperty("title")] + public string Title { get; set; } + /// + /// 地址 + /// + [JsonProperty("address")] + public string Address { get; set; } + /// + /// POI分类 + /// + [JsonProperty("category")] + public string CateGory { get; set; } + /// + /// 坐标 + /// + [JsonProperty("location")] + public Location Location { get; set; } = new Location(); + /// + /// 该POI到逆地址解析传入的坐标的直线距离 + /// + [JsonProperty("_distance")] + public double Distance { get; set; } + /// + /// 行政区划信息 /// - public class Poi - { - /// - /// 地点唯一标识 - /// - [JsonProperty("id")] - public string Id { get; set; } - /// - /// 名称/标题 - /// - [JsonProperty("title")] - public string Title { get; set; } - /// - /// 地址 - /// - [JsonProperty("address")] - public string Address { get; set; } - /// - /// POI分类 - /// - [JsonProperty("category")] - public string CateGory { get; set; } - /// - /// 坐标 - /// - [JsonProperty("location")] - public Location Location { get; set; } = new Location(); - /// - /// 该POI到逆地址解析传入的坐标的直线距离 - /// - [JsonProperty("_distance")] - public double Distance { get; set; } - /// - /// 行政区划信息 - /// - [JsonProperty("ad_info")] - public AddressInfo AddressInfo { get; set; } = new AddressInfo(); - } + [JsonProperty("ad_info")] + public AddressInfo AddressInfo { get; set; } = new AddressInfo(); } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/TencentGeocode.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/TencentGeocode.cs index ec6605859..81cf958f2 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/TencentGeocode.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/TencentGeocode.cs @@ -1,44 +1,43 @@ using Newtonsoft.Json; -namespace LINGYUN.Abp.Location.Tencent.Model +namespace LINGYUN.Abp.Location.Tencent.Model; + +public class TencentGeocode { - public class TencentGeocode - { - /// - /// 解析到的坐标 - /// - [JsonProperty("location")] - public Location Location { get; set; } = new Location(); - /// - /// 解析后的地址部件 - /// - [JsonProperty("address_components")] - public AddressComponent AddressComponent { get; set; } = new AddressComponent(); - /// - /// 行政区划信息 - /// - [JsonProperty("ad_info")] - public GeocodeAddressInfo AddressInfo { get; set; } = new GeocodeAddressInfo(); - /// - /// 可信度参考:值范围 1 <低可信> - 10 <高可信> - /// - [JsonProperty("reliability")] - public int Reliability { get; set; } - /// - /// 解析精度级别,分为11个级别,一般>=9即可采用(定位到点,精度较高) 也可根据实际业务需求自行调整 - /// - [JsonProperty("level")] - public int Level { get; set; } - } + /// + /// 解析到的坐标 + /// + [JsonProperty("location")] + public Location Location { get; set; } = new Location(); + /// + /// 解析后的地址部件 + /// + [JsonProperty("address_components")] + public AddressComponent AddressComponent { get; set; } = new AddressComponent(); /// /// 行政区划信息 /// - public class GeocodeAddressInfo - { - /// - /// 行政区划代码 - /// - [JsonProperty("adcode")] - public string AdCode { get; set; } - } + [JsonProperty("ad_info")] + public GeocodeAddressInfo AddressInfo { get; set; } = new GeocodeAddressInfo(); + /// + /// 可信度参考:值范围 1 <低可信> - 10 <高可信> + /// + [JsonProperty("reliability")] + public int Reliability { get; set; } + /// + /// 解析精度级别,分为11个级别,一般>=9即可采用(定位到点,精度较高) 也可根据实际业务需求自行调整 + /// + [JsonProperty("level")] + public int Level { get; set; } +} +/// +/// 行政区划信息 +/// +public class GeocodeAddressInfo +{ + /// + /// 行政区划代码 + /// + [JsonProperty("adcode")] + public string AdCode { get; set; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/TencentIPGeocode.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/TencentIPGeocode.cs index dddcf3ad1..3a522602b 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/TencentIPGeocode.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/TencentIPGeocode.cs @@ -1,26 +1,25 @@ using Newtonsoft.Json; -namespace LINGYUN.Abp.Location.Tencent.Model +namespace LINGYUN.Abp.Location.Tencent.Model; + +/// +/// IP定位结果 +/// +public class TencentIPGeocode { /// - /// IP定位结果 + /// 用于定位的IP地址 + /// + [JsonProperty("ip")] + public string IpAddress { get; set; } + /// + /// 定位坐标 + /// + [JsonProperty("location")] + public Location Location { get; set; } = new Location(); + /// + /// 定位行政区划信息 /// - public class TencentIPGeocode - { - /// - /// 用于定位的IP地址 - /// - [JsonProperty("ip")] - public string IpAddress { get; set; } - /// - /// 定位坐标 - /// - [JsonProperty("location")] - public Location Location { get; set; } = new Location(); - /// - /// 定位行政区划信息 - /// - [JsonProperty("ad_info")] - public AddressInfo AddressInfo { get; set; } = new AddressInfo(); - } + [JsonProperty("ad_info")] + public AddressInfo AddressInfo { get; set; } = new AddressInfo(); } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/TencentReGeocode.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/TencentReGeocode.cs index ed66877aa..935daad99 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/TencentReGeocode.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Model/TencentReGeocode.cs @@ -1,46 +1,45 @@ using Newtonsoft.Json; -namespace LINGYUN.Abp.Location.Tencent.Model +namespace LINGYUN.Abp.Location.Tencent.Model; + +/// +/// 逆地址解析结果 +/// +public class TencentReGeocode { /// - /// 逆地址解析结果 + /// 地址描述 + /// + [JsonProperty("address")] + public string Address { get; set; } + /// + /// 位置描述 + /// + [JsonProperty("formatted_addresses")] + public FormattedAddress FormattedAddress { get; set; } = new FormattedAddress(); + /// + /// 地址部件,address不满足需求时可自行拼接 + /// + [JsonProperty("address_component")] + public AddressComponent AddressComponent { get; set; } = new AddressComponent(); + /// + /// 行政区划信息 + /// + [JsonProperty("ad_info")] + public AddressInfo AddressInfo { get; set; } = new AddressInfo(); + /// + /// 坐标相对位置参考 + /// + [JsonProperty("address_reference")] + public AddressReference AddressReference { get; set; } = new AddressReference(); + /// + /// 查询的周边poi的总数 + /// + [JsonProperty("poi_count")] + public int PoiCount { get; set; } + /// + /// POI数组,对象中每个子项为一个POI对象 /// - public class TencentReGeocode - { - /// - /// 地址描述 - /// - [JsonProperty("address")] - public string Address { get; set; } - /// - /// 位置描述 - /// - [JsonProperty("formatted_addresses")] - public FormattedAddress FormattedAddress { get; set; } = new FormattedAddress(); - /// - /// 地址部件,address不满足需求时可自行拼接 - /// - [JsonProperty("address_component")] - public AddressComponent AddressComponent { get; set; } = new AddressComponent(); - /// - /// 行政区划信息 - /// - [JsonProperty("ad_info")] - public AddressInfo AddressInfo { get; set; } = new AddressInfo(); - /// - /// 坐标相对位置参考 - /// - [JsonProperty("address_reference")] - public AddressReference AddressReference { get; set; } = new AddressReference(); - /// - /// 查询的周边poi的总数 - /// - [JsonProperty("poi_count")] - public int PoiCount { get; set; } - /// - /// POI数组,对象中每个子项为一个POI对象 - /// - [JsonProperty("pois")] - public Poi[] Pois { get; set; } = new Poi[0]; - } + [JsonProperty("pois")] + public Poi[] Pois { get; set; } = new Poi[0]; } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Response/TencentGeocodeResponse.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Response/TencentGeocodeResponse.cs index ab52161b5..baad6adb4 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Response/TencentGeocodeResponse.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Response/TencentGeocodeResponse.cs @@ -1,14 +1,13 @@ using LINGYUN.Abp.Location.Tencent.Model; using Newtonsoft.Json; -namespace LINGYUN.Abp.Location.Tencent.Response +namespace LINGYUN.Abp.Location.Tencent.Response; + +public class TencentGeocodeResponse : TencentLocationResponse { - public class TencentGeocodeResponse : TencentLocationResponse - { - /// - /// 地址解析结果 - /// - [JsonProperty("result")] - public TencentGeocode Result { get; set; } = new TencentGeocode(); - } + /// + /// 地址解析结果 + /// + [JsonProperty("result")] + public TencentGeocode Result { get; set; } = new TencentGeocode(); } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Response/TencentIPGeocodeResponse.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Response/TencentIPGeocodeResponse.cs index 927f41f50..b3f3889d6 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Response/TencentIPGeocodeResponse.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Response/TencentIPGeocodeResponse.cs @@ -1,14 +1,13 @@ using LINGYUN.Abp.Location.Tencent.Model; using Newtonsoft.Json; -namespace LINGYUN.Abp.Location.Tencent.Response +namespace LINGYUN.Abp.Location.Tencent.Response; + +public class TencentIPGeocodeResponse : TencentLocationResponse { - public class TencentIPGeocodeResponse : TencentLocationResponse - { - /// - /// IP定位结果 - /// - [JsonProperty("result")] - public TencentIPGeocode Result { get; set; } = new TencentIPGeocode(); - } + /// + /// IP定位结果 + /// + [JsonProperty("result")] + public TencentIPGeocode Result { get; set; } = new TencentIPGeocode(); } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Response/TencentLocationResponse.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Response/TencentLocationResponse.cs index 7885acf40..818307449 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Response/TencentLocationResponse.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Response/TencentLocationResponse.cs @@ -3,55 +3,54 @@ using Volo.Abp; using Volo.Abp.Localization; -namespace LINGYUN.Abp.Location.Tencent.Response +namespace LINGYUN.Abp.Location.Tencent.Response; + +public abstract class TencentLocationResponse { - public abstract class TencentLocationResponse - { - /// - /// 状态码,0为正常, - /// 310请求参数信息有误, - /// 311Key格式错误, - /// 306请求有护持信息请检查字符串, - /// 110请求来源未被授权 - /// - [JsonProperty("status")] - public int Status { get; set; } - /// - /// 状态说明 - /// - [JsonProperty("message")] - public string Message { get; set; } - /// - /// 本次请求的唯一标识 - /// - [JsonProperty("request_id")] - public string RequestId { get; set; } - /// - /// 是否请求成功 - /// - public bool IsSuccessed => Status.Equals(0); + /// + /// 状态码,0为正常, + /// 310请求参数信息有误, + /// 311Key格式错误, + /// 306请求有护持信息请检查字符串, + /// 110请求来源未被授权 + /// + [JsonProperty("status")] + public int Status { get; set; } + /// + /// 状态说明 + /// + [JsonProperty("message")] + public string Message { get; set; } + /// + /// 本次请求的唯一标识 + /// + [JsonProperty("request_id")] + public string RequestId { get; set; } + /// + /// 是否请求成功 + /// + public bool IsSuccessed => Status.Equals(0); - public ILocalizableString GetErrorMessage(bool throwToClient = false) + public ILocalizableString GetErrorMessage(bool throwToClient = false) + { + switch (Status) { - switch (Status) - { - case 0: - return LocalizableString.Create("Message:RETURN_0"); - case 110: - return LocalizableString.Create("Message:RETURN_110"); - case 306: - return LocalizableString.Create("Message:RETURN_306"); - case 310: - return LocalizableString.Create("Message:RETURN_310"); - case 311: - return LocalizableString.Create("Message:RETURN_311"); - default: - if (throwToClient) - { - throw new LocationResolveException(Message); - } - throw new AbpException(Message); - } + case 0: + return LocalizableString.Create("Message:RETURN_0"); + case 110: + return LocalizableString.Create("Message:RETURN_110"); + case 306: + return LocalizableString.Create("Message:RETURN_306"); + case 310: + return LocalizableString.Create("Message:RETURN_310"); + case 311: + return LocalizableString.Create("Message:RETURN_311"); + default: + if (throwToClient) + { + throw new LocationResolveException(Message); + } + throw new AbpException(Message); } } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Response/TencentReGeocodeResponse.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Response/TencentReGeocodeResponse.cs index 7d6651e9c..20105d9db 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Response/TencentReGeocodeResponse.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Response/TencentReGeocodeResponse.cs @@ -1,14 +1,13 @@ using LINGYUN.Abp.Location.Tencent.Model; using Newtonsoft.Json; -namespace LINGYUN.Abp.Location.Tencent.Response +namespace LINGYUN.Abp.Location.Tencent.Response; + +public class TencentReGeocodeResponse : TencentLocationResponse { - public class TencentReGeocodeResponse : TencentLocationResponse - { - /// - /// 逆地址解析结果 - /// - [JsonProperty("result")] - public TencentReGeocode Result { get; set; } = new TencentReGeocode(); - } + /// + /// 逆地址解析结果 + /// + [JsonProperty("result")] + public TencentReGeocode Result { get; set; } = new TencentReGeocode(); } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/TencentLocationHttpClient.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/TencentLocationHttpClient.cs index de760519a..a0cc76b51 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/TencentLocationHttpClient.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/TencentLocationHttpClient.cs @@ -16,208 +16,207 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.Threading; -namespace LINGYUN.Abp.Location.Tencent +namespace LINGYUN.Abp.Location.Tencent; + +public class TencentLocationHttpClient : ITransientDependency { - public class TencentLocationHttpClient : ITransientDependency + protected TencentLocationOptions Options { get; } + protected IServiceProvider ServiceProvider { get; } + protected IHttpClientFactory HttpClientFactory { get; } + protected ICancellationTokenProvider CancellationTokenProvider { get; } + + public TencentLocationHttpClient( + IOptions options, + IServiceProvider serviceProvider, + IHttpClientFactory httpClientFactory, + ICancellationTokenProvider cancellationTokenProvider) { - protected TencentLocationOptions Options { get; } - protected IServiceProvider ServiceProvider { get; } - protected IHttpClientFactory HttpClientFactory { get; } - protected ICancellationTokenProvider CancellationTokenProvider { get; } - - public TencentLocationHttpClient( - IOptions options, - IServiceProvider serviceProvider, - IHttpClientFactory httpClientFactory, - ICancellationTokenProvider cancellationTokenProvider) - { - Options = options.Value; - ServiceProvider = serviceProvider; - HttpClientFactory = httpClientFactory; - CancellationTokenProvider = cancellationTokenProvider; - } + Options = options.Value; + ServiceProvider = serviceProvider; + HttpClientFactory = httpClientFactory; + CancellationTokenProvider = cancellationTokenProvider; + } - public async virtual Task IPGeocodeAsync(string ipAddress) + public async virtual Task IPGeocodeAsync(string ipAddress) + { + var requestParamters = new Dictionary { - var requestParamters = new Dictionary - { - { "callback", Options.Callback }, - { "ip", ipAddress }, - { "key", Options.AccessKey }, - { "output", Options.Output } - }; - var tencentMapUrl = "https://apis.map.qq.com"; - var tencentMapPath = "/ws/location/v1/ip"; - if (!Options.SecretKey.IsNullOrWhiteSpace()) - { - var sig = TencentSecretKeyCaculater.CalcSecretKey(tencentMapPath, Options.SecretKey, requestParamters); - requestParamters.Add("sig", sig); - } - var tencentLocationResponse = await GetTencentMapResponseAsync(tencentMapUrl, tencentMapPath, requestParamters); - - var location = new IPGecodeLocation - { - IpAddress = tencentLocationResponse.Result.IpAddress, - AdCode = tencentLocationResponse.Result.AddressInfo.AdCode, - City = tencentLocationResponse.Result.AddressInfo.City, - Country = tencentLocationResponse.Result.AddressInfo.Nation, - District = tencentLocationResponse.Result.AddressInfo.District, - Location = new Location - { - Latitude = tencentLocationResponse.Result.Location.Lat, - Longitude = tencentLocationResponse.Result.Location.Lng - }, - Province = tencentLocationResponse.Result.AddressInfo.Province - }; - location.AddAdditional("TencentLocation", tencentLocationResponse.Result); - - return location; + { "callback", Options.Callback }, + { "ip", ipAddress }, + { "key", Options.AccessKey }, + { "output", Options.Output } + }; + var tencentMapUrl = "https://apis.map.qq.com"; + var tencentMapPath = "/ws/location/v1/ip"; + if (!Options.SecretKey.IsNullOrWhiteSpace()) + { + var sig = TencentSecretKeyCaculater.CalcSecretKey(tencentMapPath, Options.SecretKey, requestParamters); + requestParamters.Add("sig", sig); } + var tencentLocationResponse = await GetTencentMapResponseAsync(tencentMapUrl, tencentMapPath, requestParamters); - public async virtual Task GeocodeAsync(string address, string city = null) + var location = new IPGecodeLocation { - var requestParamters = new Dictionary - { - { "address", address }, - { "callback", Options.Callback }, - { "key", Options.AccessKey }, - { "output", Options.Output } - }; - if (!city.IsNullOrWhiteSpace()) - { - requestParamters.Add("region", city); - } - var tencentMapUrl = "https://apis.map.qq.com"; - var tencentMapPath = "/ws/geocoder/v1"; - if (!Options.SecretKey.IsNullOrWhiteSpace()) - { - var sig = TencentSecretKeyCaculater.CalcSecretKey(tencentMapPath, Options.SecretKey, requestParamters); - requestParamters.Add("sig", sig); - } - var tencentLocationResponse = await GetTencentMapResponseAsync(tencentMapUrl, tencentMapPath, requestParamters); - var location = new GecodeLocation + IpAddress = tencentLocationResponse.Result.IpAddress, + AdCode = tencentLocationResponse.Result.AddressInfo.AdCode, + City = tencentLocationResponse.Result.AddressInfo.City, + Country = tencentLocationResponse.Result.AddressInfo.Nation, + District = tencentLocationResponse.Result.AddressInfo.District, + Location = new Location { - Confidence = tencentLocationResponse.Result.Reliability, Latitude = tencentLocationResponse.Result.Location.Lat, - Longitude = tencentLocationResponse.Result.Location.Lng, - Level = tencentLocationResponse.Result.Level.ToString() - }; - location.AddAdditional("TencentLocation", tencentLocationResponse.Result); + Longitude = tencentLocationResponse.Result.Location.Lng + }, + Province = tencentLocationResponse.Result.AddressInfo.Province + }; + location.AddAdditional("TencentLocation", tencentLocationResponse.Result); - return location; + return location; + } + + public async virtual Task GeocodeAsync(string address, string city = null) + { + var requestParamters = new Dictionary + { + { "address", address }, + { "callback", Options.Callback }, + { "key", Options.AccessKey }, + { "output", Options.Output } + }; + if (!city.IsNullOrWhiteSpace()) + { + requestParamters.Add("region", city); + } + var tencentMapUrl = "https://apis.map.qq.com"; + var tencentMapPath = "/ws/geocoder/v1"; + if (!Options.SecretKey.IsNullOrWhiteSpace()) + { + var sig = TencentSecretKeyCaculater.CalcSecretKey(tencentMapPath, Options.SecretKey, requestParamters); + requestParamters.Add("sig", sig); } + var tencentLocationResponse = await GetTencentMapResponseAsync(tencentMapUrl, tencentMapPath, requestParamters); + var location = new GecodeLocation + { + Confidence = tencentLocationResponse.Result.Reliability, + Latitude = tencentLocationResponse.Result.Location.Lat, + Longitude = tencentLocationResponse.Result.Location.Lng, + Level = tencentLocationResponse.Result.Level.ToString() + }; + location.AddAdditional("TencentLocation", tencentLocationResponse.Result); + + return location; + } - public async virtual Task ReGeocodeAsync(double lat, double lng, int radius = 1000) + public async virtual Task ReGeocodeAsync(double lat, double lng, int radius = 1000) + { + var requestParamters = new Dictionary { - var requestParamters = new Dictionary - { - { "callback", Options.Callback }, - { "get_poi", Options.GetPoi }, - { "key", Options.AccessKey }, - { "location", $"{lat},{lng}" }, - { "output", Options.Output }, - { "poi_options", "radius=" + radius.ToString() } - }; - var tencentMapUrl = "https://apis.map.qq.com"; - var tencentMapPath = "/ws/geocoder/v1"; - if (!Options.SecretKey.IsNullOrWhiteSpace()) - { - var sig = TencentSecretKeyCaculater.CalcSecretKey(tencentMapPath, Options.SecretKey, requestParamters); - requestParamters.Add("sig", sig); - } - var tencentLocationResponse = await GetTencentMapResponseAsync(tencentMapUrl, tencentMapPath, requestParamters); - var location = new ReGeocodeLocation + { "callback", Options.Callback }, + { "get_poi", Options.GetPoi }, + { "key", Options.AccessKey }, + { "location", $"{lat},{lng}" }, + { "output", Options.Output }, + { "poi_options", "radius=" + radius.ToString() } + }; + var tencentMapUrl = "https://apis.map.qq.com"; + var tencentMapPath = "/ws/geocoder/v1"; + if (!Options.SecretKey.IsNullOrWhiteSpace()) + { + var sig = TencentSecretKeyCaculater.CalcSecretKey(tencentMapPath, Options.SecretKey, requestParamters); + requestParamters.Add("sig", sig); + } + var tencentLocationResponse = await GetTencentMapResponseAsync(tencentMapUrl, tencentMapPath, requestParamters); + var location = new ReGeocodeLocation + { + Street = tencentLocationResponse.Result.AddressComponent.Street, + AdCode = tencentLocationResponse.Result.AddressInfo?.NationCode, + Address = tencentLocationResponse.Result.Address, + FormattedAddress = tencentLocationResponse.Result.FormattedAddress?.ReCommend, + City = tencentLocationResponse.Result.AddressComponent.City, + Country = tencentLocationResponse.Result.AddressComponent.Nation, + District = tencentLocationResponse.Result.AddressComponent.District, + Number = tencentLocationResponse.Result.AddressComponent.StreetNumber, + Province = tencentLocationResponse.Result.AddressComponent.Province, + Town = tencentLocationResponse.Result.AddressReference.Town.Title, + Pois = tencentLocationResponse.Result.Pois.Select(p => { - Street = tencentLocationResponse.Result.AddressComponent.Street, - AdCode = tencentLocationResponse.Result.AddressInfo?.NationCode, - Address = tencentLocationResponse.Result.Address, - FormattedAddress = tencentLocationResponse.Result.FormattedAddress?.ReCommend, - City = tencentLocationResponse.Result.AddressComponent.City, - Country = tencentLocationResponse.Result.AddressComponent.Nation, - District = tencentLocationResponse.Result.AddressComponent.District, - Number = tencentLocationResponse.Result.AddressComponent.StreetNumber, - Province = tencentLocationResponse.Result.AddressComponent.Province, - Town = tencentLocationResponse.Result.AddressReference.Town.Title, - Pois = tencentLocationResponse.Result.Pois.Select(p => + var poi = new Poi { - var poi = new Poi - { - Address = p.Address, - Name = p.Title, - Tag = p.Id, - Type = p.CateGory, - Distance = Convert.ToInt32(p.Distance) - }; - - return poi; - }).ToList() - }; - if ((location.Address.IsNullOrWhiteSpace() || - location.FormattedAddress.IsNullOrWhiteSpace()) && - location.Pois.Any()) - { - var nearPoi = location.Pois.OrderBy(x => x.Distance).FirstOrDefault(); - location.Address = nearPoi.Address; - location.FormattedAddress = nearPoi.Name; - } - location.AddAdditional("TencentLocation", tencentLocationResponse.Result); - - return location; - } - - protected async virtual Task MakeRequestAndGetResultAsync(string url) + Address = p.Address, + Name = p.Title, + Tag = p.Id, + Type = p.CateGory, + Distance = Convert.ToInt32(p.Distance) + }; + + return poi; + }).ToList() + }; + if ((location.Address.IsNullOrWhiteSpace() || + location.FormattedAddress.IsNullOrWhiteSpace()) && + location.Pois.Any()) { - var client = HttpClientFactory.CreateClient(TencentLocationHttpConsts.HttpClientName); - var requestMessage = new HttpRequestMessage(HttpMethod.Get, url); + var nearPoi = location.Pois.OrderBy(x => x.Distance).FirstOrDefault(); + location.Address = nearPoi.Address; + location.FormattedAddress = nearPoi.Name; + } + location.AddAdditional("TencentLocation", tencentLocationResponse.Result); - var response = await client.SendAsync(requestMessage, GetCancellationToken()); - if (!response.IsSuccessStatusCode) - { - throw new AbpException($"Tencent http request service returns error! HttpStatusCode: {response.StatusCode}, ReasonPhrase: {response.ReasonPhrase}"); - } - var resultContent = await response.Content.ReadAsStringAsync(); + return location; + } - return resultContent; - } + protected async virtual Task MakeRequestAndGetResultAsync(string url) + { + var client = HttpClientFactory.CreateClient(TencentLocationHttpConsts.HttpClientName); + var requestMessage = new HttpRequestMessage(HttpMethod.Get, url); - protected virtual CancellationToken GetCancellationToken() + var response = await client.SendAsync(requestMessage, GetCancellationToken()); + if (!response.IsSuccessStatusCode) { - return CancellationTokenProvider.Token; + throw new AbpException($"Tencent http request service returns error! HttpStatusCode: {response.StatusCode}, ReasonPhrase: {response.ReasonPhrase}"); } + var resultContent = await response.Content.ReadAsStringAsync(); + + return resultContent; + } + + protected virtual CancellationToken GetCancellationToken() + { + return CancellationTokenProvider.Token; + } - protected async virtual Task GetTencentMapResponseAsync(string url, string path, IDictionary paramters) - where TResponse : TencentLocationResponse + protected async virtual Task GetTencentMapResponseAsync(string url, string path, IDictionary paramters) + where TResponse : TencentLocationResponse + { + var requestUrl = BuildRequestUrl(url, path, paramters); + var responseContent = await MakeRequestAndGetResultAsync(requestUrl); + var tencentLocationResponse = JsonConvert.DeserializeObject(responseContent); + if (!tencentLocationResponse.IsSuccessed) { - var requestUrl = BuildRequestUrl(url, path, paramters); - var responseContent = await MakeRequestAndGetResultAsync(requestUrl); - var tencentLocationResponse = JsonConvert.DeserializeObject(responseContent); - if (!tencentLocationResponse.IsSuccessed) + if (Options.VisableErrorToClient) { - if (Options.VisableErrorToClient) - { - var localizerFactory = ServiceProvider.GetRequiredService(); - var localizerErrorMessage = tencentLocationResponse.GetErrorMessage(Options.VisableErrorToClient).Localize(localizerFactory); - var localizer = ServiceProvider.GetRequiredService>(); - localizerErrorMessage = localizer["ResolveLocationFailed", localizerErrorMessage]; - throw new UserFriendlyException(localizerErrorMessage); - } - throw new AbpException($"Resolution address failed:{tencentLocationResponse.Message}!"); + var localizerFactory = ServiceProvider.GetRequiredService(); + var localizerErrorMessage = tencentLocationResponse.GetErrorMessage(Options.VisableErrorToClient).Localize(localizerFactory); + var localizer = ServiceProvider.GetRequiredService>(); + localizerErrorMessage = localizer["ResolveLocationFailed", localizerErrorMessage]; + throw new UserFriendlyException(localizerErrorMessage); } - return tencentLocationResponse; + throw new AbpException($"Resolution address failed:{tencentLocationResponse.Message}!"); } + return tencentLocationResponse; + } - protected virtual string BuildRequestUrl(string uri, string path, IDictionary paramters) + protected virtual string BuildRequestUrl(string uri, string path, IDictionary paramters) + { + var requestUrlBuilder = new StringBuilder(128); + requestUrlBuilder.Append(uri); + requestUrlBuilder.Append(path).Append("?"); + foreach (var paramter in paramters) { - var requestUrlBuilder = new StringBuilder(128); - requestUrlBuilder.Append(uri); - requestUrlBuilder.Append(path).Append("?"); - foreach (var paramter in paramters) - { - requestUrlBuilder.AppendFormat("{0}={1}", paramter.Key, paramter.Value); - requestUrlBuilder.Append("&"); - } - requestUrlBuilder.Remove(requestUrlBuilder.Length - 1, 1); - return requestUrlBuilder.ToString(); + requestUrlBuilder.AppendFormat("{0}={1}", paramter.Key, paramter.Value); + requestUrlBuilder.Append("&"); } + requestUrlBuilder.Remove(requestUrlBuilder.Length - 1, 1); + return requestUrlBuilder.ToString(); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/TencentLocationHttpConsts.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/TencentLocationHttpConsts.cs index e555aef71..d6bc72fa0 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/TencentLocationHttpConsts.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/TencentLocationHttpConsts.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.Location.Tencent +namespace LINGYUN.Abp.Location.Tencent; + +public class TencentLocationHttpConsts { - public class TencentLocationHttpConsts - { - public const string HttpClientName = "TencentLocation"; - } + public const string HttpClientName = "TencentLocation"; } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/TencentLocationOptions.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/TencentLocationOptions.cs index 9783f65a7..adb0a012b 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/TencentLocationOptions.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/TencentLocationOptions.cs @@ -1,12 +1,11 @@ -namespace LINGYUN.Abp.Location.Tencent +namespace LINGYUN.Abp.Location.Tencent; + +public class TencentLocationOptions { - public class TencentLocationOptions - { - public string AccessKey { get; set; } - public string SecretKey { get; set; } - public string GetPoi { get; set; } = "1"; - public string Output { get; set; } = "JSON"; - public string Callback { get; set; } - public bool VisableErrorToClient { get; set; } = false; - } + public string AccessKey { get; set; } + public string SecretKey { get; set; } + public string GetPoi { get; set; } = "1"; + public string Output { get; set; } = "JSON"; + public string Callback { get; set; } + public bool VisableErrorToClient { get; set; } = false; } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/TencentLocationResolveProvider.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/TencentLocationResolveProvider.cs index 7bcadd476..66e9ddfa7 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/TencentLocationResolveProvider.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/TencentLocationResolveProvider.cs @@ -2,32 +2,31 @@ using System.Threading.Tasks; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.Location.Tencent +namespace LINGYUN.Abp.Location.Tencent; + +[Dependency(ServiceLifetime.Transient)] +[ExposeServices(typeof(ILocationResolveProvider))] +public class TencentLocationResolveProvider : ILocationResolveProvider { - [Dependency(ServiceLifetime.Transient)] - [ExposeServices(typeof(ILocationResolveProvider))] - public class TencentLocationResolveProvider : ILocationResolveProvider - { - protected TencentLocationHttpClient TencentLocationHttpClient { get; } + protected TencentLocationHttpClient TencentLocationHttpClient { get; } - public TencentLocationResolveProvider(TencentLocationHttpClient tencentLocationHttpClient) - { - TencentLocationHttpClient = tencentLocationHttpClient; - } + public TencentLocationResolveProvider(TencentLocationHttpClient tencentLocationHttpClient) + { + TencentLocationHttpClient = tencentLocationHttpClient; + } - public async virtual Task IPGeocodeAsync(string ipAddress) - { - return await TencentLocationHttpClient.IPGeocodeAsync(ipAddress); - } + public async virtual Task IPGeocodeAsync(string ipAddress) + { + return await TencentLocationHttpClient.IPGeocodeAsync(ipAddress); + } - public async virtual Task ReGeocodeAsync(double lat, double lng, int radius = 50) - { - return await TencentLocationHttpClient.ReGeocodeAsync(lat, lng, radius); - } + public async virtual Task ReGeocodeAsync(double lat, double lng, int radius = 50) + { + return await TencentLocationHttpClient.ReGeocodeAsync(lat, lng, radius); + } - public async virtual Task GeocodeAsync(string address, string city = null) - { - return await TencentLocationHttpClient.GeocodeAsync(address, city); - } + public async virtual Task GeocodeAsync(string address, string city = null) + { + return await TencentLocationHttpClient.GeocodeAsync(address, city); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Utils/TencentSecretKeyCaculater.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Utils/TencentSecretKeyCaculater.cs index 3634e4cf2..eda711878 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Utils/TencentSecretKeyCaculater.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location.Tencent/LINGYUN/Abp/Location/Tencent/Utils/TencentSecretKeyCaculater.cs @@ -2,46 +2,45 @@ using System.Collections.Generic; using System.Text; -namespace LINGYUN.Abp.Location.Tencent.Utils +namespace LINGYUN.Abp.Location.Tencent.Utils; + +public class TencentSecretKeyCaculater { - public class TencentSecretKeyCaculater + private static string MD5(string password) { - private static string MD5(string password) + try { - try - { - System.Security.Cryptography.HashAlgorithm hash = System.Security.Cryptography.MD5.Create(); - byte[] hash_out = hash.ComputeHash(Encoding.UTF8.GetBytes(password)); + System.Security.Cryptography.HashAlgorithm hash = System.Security.Cryptography.MD5.Create(); + byte[] hash_out = hash.ComputeHash(Encoding.UTF8.GetBytes(password)); - var md5_str = BitConverter.ToString(hash_out).Replace("-", ""); - return md5_str.ToLower(); - } - catch - { - throw; - } + var md5_str = BitConverter.ToString(hash_out).Replace("-", ""); + return md5_str.ToLower(); } - - private static string HttpBuildQuery(IDictionary querystring_arrays) + catch { - - StringBuilder sb = new StringBuilder(); - foreach (var item in querystring_arrays) - { - sb.Append(item.Key); - sb.Append("="); - sb.Append(item.Value); - sb.Append("&"); - } - sb.Remove(sb.Length - 1, 1); - return sb.ToString(); + throw; } + } - public static string CalcSecretKey(string url, string secretKey, IDictionary querystring_arrays) - { - var queryString = HttpBuildQuery(querystring_arrays); + private static string HttpBuildQuery(IDictionary querystring_arrays) + { - return MD5(url + "?" + queryString + secretKey); + StringBuilder sb = new StringBuilder(); + foreach (var item in querystring_arrays) + { + sb.Append(item.Key); + sb.Append("="); + sb.Append(item.Value); + sb.Append("&"); } + sb.Remove(sb.Length - 1, 1); + return sb.ToString(); + } + + public static string CalcSecretKey(string url, string secretKey, IDictionary querystring_arrays) + { + var queryString = HttpBuildQuery(querystring_arrays); + + return MD5(url + "?" + queryString + secretKey); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN.Abp.Location.csproj b/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN.Abp.Location.csproj index e611b4a59..85236b659 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN.Abp.Location.csproj +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN.Abp.Location.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Location + LINGYUN.Abp.Location + false + false + false 位置服务 diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/AbpLocationModule.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/AbpLocationModule.cs index bc677f26b..d7605bd0f 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/AbpLocationModule.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/AbpLocationModule.cs @@ -1,8 +1,7 @@ using Volo.Abp.Modularity; -namespace LINGYUN.Abp.Location +namespace LINGYUN.Abp.Location; + +public class AbpLocationModule : AbpModule { - public class AbpLocationModule : AbpModule - { - } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/GecodeLocation.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/GecodeLocation.cs index 1faf0c922..3c1007638 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/GecodeLocation.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/GecodeLocation.cs @@ -1,39 +1,38 @@ using System.Collections.Generic; -namespace LINGYUN.Abp.Location +namespace LINGYUN.Abp.Location; + +/// +/// 正地址 +/// +public class GecodeLocation : Location { /// - /// 正地址 + /// 绝对精度 /// - public class GecodeLocation : Location - { - /// - /// 绝对精度 - /// - public int Confidence { get; set; } - /// - /// 理解程度 - /// 分值范围0-100 - /// 分值越大,服务对地址理解程度越高 - /// - public int Pomprehension { get; set; } - /// - /// 能精确理解的地址类型 - /// - public string Level { get; set; } - /// - /// 附加信息 - /// - public IDictionary Additionals { get; } + public int Confidence { get; set; } + /// + /// 理解程度 + /// 分值范围0-100 + /// 分值越大,服务对地址理解程度越高 + /// + public int Pomprehension { get; set; } + /// + /// 能精确理解的地址类型 + /// + public string Level { get; set; } + /// + /// 附加信息 + /// + public IDictionary Additionals { get; } - public GecodeLocation() - { - Additionals = new Dictionary(); - } + public GecodeLocation() + { + Additionals = new Dictionary(); + } - public void AddAdditional(string key, object value) - { - Additionals.Add(key, value); - } + public void AddAdditional(string key, object value) + { + Additionals.Add(key, value); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/ILocationResolveProvider.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/ILocationResolveProvider.cs index 7ab1d7ea0..ce32988ed 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/ILocationResolveProvider.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/ILocationResolveProvider.cs @@ -1,13 +1,12 @@ using System.Threading.Tasks; -namespace LINGYUN.Abp.Location +namespace LINGYUN.Abp.Location; + +public interface ILocationResolveProvider { - public interface ILocationResolveProvider - { - Task IPGeocodeAsync(string ipAddress); + Task IPGeocodeAsync(string ipAddress); - Task GeocodeAsync(string address, string city = null); + Task GeocodeAsync(string address, string city = null); - Task ReGeocodeAsync(double lat, double lng, int radius = 50); - } + Task ReGeocodeAsync(double lat, double lng, int radius = 50); } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/IPGecodeLocation.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/IPGecodeLocation.cs index e8f874a70..fae5eeacf 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/IPGecodeLocation.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/IPGecodeLocation.cs @@ -1,43 +1,42 @@ using System.Collections.Generic; -namespace LINGYUN.Abp.Location +namespace LINGYUN.Abp.Location; + +public class IPGecodeLocation { - public class IPGecodeLocation - { - /// - /// IP地址 - /// - public string IpAddress { get; set; } - /// - /// 定位坐标 - /// - public Location Location { get; set; } = new Location(); - /// - /// 国家 - /// - public string Country { get; set; } - /// - /// 城市 - /// - public string City { get; set; } - /// - /// 省份 - /// - public string Province { get; set; } - /// - /// 区县 - /// - public string District { get; set; } - /// - /// adcode - /// - public string AdCode { get; set; } + /// + /// IP地址 + /// + public string IpAddress { get; set; } + /// + /// 定位坐标 + /// + public Location Location { get; set; } = new Location(); + /// + /// 国家 + /// + public string Country { get; set; } + /// + /// 城市 + /// + public string City { get; set; } + /// + /// 省份 + /// + public string Province { get; set; } + /// + /// 区县 + /// + public string District { get; set; } + /// + /// adcode + /// + public string AdCode { get; set; } - public IDictionary Additionals { get; } = new Dictionary(); + public IDictionary Additionals { get; } = new Dictionary(); - public void AddAdditional(string key, object value) - { - Additionals.Add(key, value); - } + public void AddAdditional(string key, object value) + { + Additionals.Add(key, value); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/Location.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/Location.cs index ceda98c22..dfac70ae2 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/Location.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/Location.cs @@ -1,97 +1,96 @@ using System; -namespace LINGYUN.Abp.Location +namespace LINGYUN.Abp.Location; + +public class Location { - public class Location - { - /// - /// 地球半径(米) - /// - public const double EARTH_RADIUS = 6378137; - /// - /// 纬度 - /// - public double Latitude { get; set; } - /// - /// 经度 - /// - public double Longitude { get; set; } + /// + /// 地球半径(米) + /// + public const double EARTH_RADIUS = 6378137; + /// + /// 纬度 + /// + public double Latitude { get; set; } + /// + /// 经度 + /// + public double Longitude { get; set; } - /// - /// 计算两个位置的距离,返回两点的距离,单位 米 - /// 该公式为GOOGLE提供,误差小于0.2米 - /// - /// 参与计算的位置信息 - /// 返回两个位置的距离 - public double CalcDistance(Location location) - { - return CalcDistance(this, location); - } - /// - /// 计算两个位置的距离,返回两点的距离,单位 米 - /// 该公式为GOOGLE提供,误差小于0.2米 - /// - /// 参与计算的位置信息 - /// 参与计算的位置信息 - /// 返回两个位置的距离 - public static double CalcDistance(Location location1, Location location2) - { - double radLat1 = Rad(location1.Latitude); - double radLng1 = Rad(location1.Longitude); - double radLat2 = Rad(location2.Latitude); - double radLng2 = Rad(location2.Longitude); - double a = radLat1 - radLat2; - double b = radLng1 - radLng2; - double result = 2 * Math.Asin(Math.Sqrt(Math.Pow(Math.Sin(a / 2), 2) + Math.Cos(radLat1) * Math.Cos(radLat2) * Math.Pow(Math.Sin(b / 2), 2))); - result *= EARTH_RADIUS; - return result; - } - /// - /// 计算位置的偏移距离 - /// - /// 参与计算的位置 - /// 位置偏移量,单位 米 - /// - public static Position CalcOffsetDistance(Location location, double distance) - { - double dlng = 2 * Math.Asin(Math.Sin(distance / (2 * EARTH_RADIUS)) / Math.Cos(Rad(location.Latitude))); - dlng = Deg(dlng); - double dlat = distance / EARTH_RADIUS; - dlat = Deg(dlat); - double leftTopLat = location.Latitude + dlat; - double leftTopLng = location.Longitude - dlng; + /// + /// 计算两个位置的距离,返回两点的距离,单位 米 + /// 该公式为GOOGLE提供,误差小于0.2米 + /// + /// 参与计算的位置信息 + /// 返回两个位置的距离 + public double CalcDistance(Location location) + { + return CalcDistance(this, location); + } + /// + /// 计算两个位置的距离,返回两点的距离,单位 米 + /// 该公式为GOOGLE提供,误差小于0.2米 + /// + /// 参与计算的位置信息 + /// 参与计算的位置信息 + /// 返回两个位置的距离 + public static double CalcDistance(Location location1, Location location2) + { + double radLat1 = Rad(location1.Latitude); + double radLng1 = Rad(location1.Longitude); + double radLat2 = Rad(location2.Latitude); + double radLng2 = Rad(location2.Longitude); + double a = radLat1 - radLat2; + double b = radLng1 - radLng2; + double result = 2 * Math.Asin(Math.Sqrt(Math.Pow(Math.Sin(a / 2), 2) + Math.Cos(radLat1) * Math.Cos(radLat2) * Math.Pow(Math.Sin(b / 2), 2))); + result *= EARTH_RADIUS; + return result; + } + /// + /// 计算位置的偏移距离 + /// + /// 参与计算的位置 + /// 位置偏移量,单位 米 + /// + public static Position CalcOffsetDistance(Location location, double distance) + { + double dlng = 2 * Math.Asin(Math.Sin(distance / (2 * EARTH_RADIUS)) / Math.Cos(Rad(location.Latitude))); + dlng = Deg(dlng); + double dlat = distance / EARTH_RADIUS; + dlat = Deg(dlat); + double leftTopLat = location.Latitude + dlat; + double leftTopLng = location.Longitude - dlng; - double leftBottomLat = location.Latitude - dlat; - double leftBottomLng = location.Longitude - dlng; + double leftBottomLat = location.Latitude - dlat; + double leftBottomLng = location.Longitude - dlng; - double rightTopLat = location.Latitude + dlat; - double rightTopLng = location.Longitude + dlng; + double rightTopLat = location.Latitude + dlat; + double rightTopLng = location.Longitude + dlng; - double rightBottomLat = location.Latitude - dlat; - double rightBottomLng = location.Longitude + dlng; + double rightBottomLat = location.Latitude - dlat; + double rightBottomLng = location.Longitude + dlng; - return new Position(leftTopLat, leftBottomLat, leftTopLng, leftBottomLng, - rightTopLat, rightBottomLat, rightTopLng, rightBottomLng); - } + return new Position(leftTopLat, leftBottomLat, leftTopLng, leftBottomLng, + rightTopLat, rightBottomLat, rightTopLng, rightBottomLng); + } - /// - /// 角度转换为弧度 - /// - /// - /// - public static double Rad(double d) - { - return d * Math.PI / 180d; - } + /// + /// 角度转换为弧度 + /// + /// + /// + public static double Rad(double d) + { + return d * Math.PI / 180d; + } - /// - /// 弧度转换为角度 - /// - /// - /// - public static double Deg(double d) - { - return d * (180 / Math.PI); - } + /// + /// 弧度转换为角度 + /// + /// + /// + public static double Deg(double d) + { + return d * (180 / Math.PI); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/LocationResolveException.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/LocationResolveException.cs index 83c84ccc2..56b999110 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/LocationResolveException.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/LocationResolveException.cs @@ -1,28 +1,21 @@ using System; -using System.Runtime.Serialization; using Volo.Abp; -namespace LINGYUN.Abp.Location +namespace LINGYUN.Abp.Location; + +public class LocationResolveException : AbpException, IBusinessException { - public class LocationResolveException : AbpException, IBusinessException + public LocationResolveException() { - public LocationResolveException() - { - } - - public LocationResolveException(string message) - : base(message) - { - } + } - public LocationResolveException(string message, Exception innerException) - : base(message, innerException) - { - } + public LocationResolveException(string message) + : base(message) + { + } - public LocationResolveException(SerializationInfo serializationInfo, StreamingContext context) - : base(serializationInfo, context) - { - } + public LocationResolveException(string message, Exception innerException) + : base(message, innerException) + { } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/Poi.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/Poi.cs index d110a0744..eb22e82ec 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/Poi.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/Poi.cs @@ -1,11 +1,10 @@ -namespace LINGYUN.Abp.Location +namespace LINGYUN.Abp.Location; + +public class Poi { - public class Poi - { - public string Tag { get; set; } - public string Name { get; set; } - public string Type { get; set; } - public string Address { get; set; } - public int? Distance { get; set; } - } + public string Tag { get; set; } + public string Name { get; set; } + public string Type { get; set; } + public string Address { get; set; } + public int? Distance { get; set; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/Position.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/Position.cs index d466846fd..9850aae56 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/Position.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/Position.cs @@ -1,55 +1,54 @@ -namespace LINGYUN.Abp.Location +namespace LINGYUN.Abp.Location; + +/// +/// 位置量 +/// +public class Position { /// - /// 位置量 + /// 左上纬度 /// - public class Position - { - /// - /// 左上纬度 - /// - public double LeftTopLatitude { get; } - /// - /// 左上经度 - /// - public double LeftTopLongitude { get; } - /// - /// 左下纬度 - /// - public double LeftBottomLatitude { get; } - /// - /// 左下经度 - /// - public double LeftBottomLongitude { get; } + public double LeftTopLatitude { get; } + /// + /// 左上经度 + /// + public double LeftTopLongitude { get; } + /// + /// 左下纬度 + /// + public double LeftBottomLatitude { get; } + /// + /// 左下经度 + /// + public double LeftBottomLongitude { get; } - /// - /// 右上纬度 - /// - public double RightTopLatitude { get; } - /// - /// 右上经度 - /// - public double RightTopLongitude { get; } - /// - /// 右下纬度 - /// - public double RightBottomLatitude { get; } - /// - /// 右下经度 - /// - public double RightBottomLongitude { get; } + /// + /// 右上纬度 + /// + public double RightTopLatitude { get; } + /// + /// 右上经度 + /// + public double RightTopLongitude { get; } + /// + /// 右下纬度 + /// + public double RightBottomLatitude { get; } + /// + /// 右下经度 + /// + public double RightBottomLongitude { get; } - internal Position(double leftTopLat, double leftBottomLat, double leftTopLng, double leftBottomLng, - double rightTopLat, double rightBottomLat, double rightTopLng, double rightBottomLng) - { - LeftTopLatitude = leftTopLat; - LeftBottomLatitude = leftBottomLat; - LeftTopLongitude = leftTopLng; - LeftBottomLongitude = leftBottomLng; - RightTopLatitude = rightTopLat; - RightTopLongitude = rightTopLng; - RightBottomLatitude = rightBottomLat; - RightBottomLongitude = rightBottomLng; - } + internal Position(double leftTopLat, double leftBottomLat, double leftTopLng, double leftBottomLng, + double rightTopLat, double rightBottomLat, double rightTopLng, double rightBottomLng) + { + LeftTopLatitude = leftTopLat; + LeftBottomLatitude = leftBottomLat; + LeftTopLongitude = leftTopLng; + LeftBottomLongitude = leftBottomLng; + RightTopLatitude = rightTopLat; + RightTopLongitude = rightTopLng; + RightBottomLatitude = rightBottomLat; + RightBottomLongitude = rightBottomLng; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/ReGeocodeLocation.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/ReGeocodeLocation.cs index 45908ceef..ba2776cde 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/ReGeocodeLocation.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/ReGeocodeLocation.cs @@ -1,75 +1,74 @@ using System.Collections.Generic; -namespace LINGYUN.Abp.Location +namespace LINGYUN.Abp.Location; + +/// +/// 逆地址 +/// +public class ReGeocodeLocation { /// - /// 逆地址 + /// 详细地址 /// - public class ReGeocodeLocation - { - /// - /// 详细地址 - /// - public string Address { get; set; } - /// - /// 格式化的地址描述 - /// - public string FormattedAddress { get; set; } - /// - /// 国家 - /// - public string Country { get; set; } - /// - /// 省份 - /// - public string Province { get; set; } - /// - /// 城市 - /// - public string City { get; set; } - /// - /// 区县 - /// - public string District { get; set; } - /// - /// 街道 - /// - public string Street { get; set; } - /// - /// adcode - /// - public string AdCode { get; set; } - /// - /// 乡镇 - /// - public string Town { get; set; } - /// - /// 门牌号 - /// - public string Number { get; set; } - /// - /// Poi信息列表 - /// - public IEnumerable Pois { get; set; } - /// - /// 道路信息列表 - /// - public IEnumerable Roads { get; set; } - /// - /// 附加信息 - /// - public IDictionary Additionals { get; } + public string Address { get; set; } + /// + /// 格式化的地址描述 + /// + public string FormattedAddress { get; set; } + /// + /// 国家 + /// + public string Country { get; set; } + /// + /// 省份 + /// + public string Province { get; set; } + /// + /// 城市 + /// + public string City { get; set; } + /// + /// 区县 + /// + public string District { get; set; } + /// + /// 街道 + /// + public string Street { get; set; } + /// + /// adcode + /// + public string AdCode { get; set; } + /// + /// 乡镇 + /// + public string Town { get; set; } + /// + /// 门牌号 + /// + public string Number { get; set; } + /// + /// Poi信息列表 + /// + public IEnumerable Pois { get; set; } + /// + /// 道路信息列表 + /// + public IEnumerable Roads { get; set; } + /// + /// 附加信息 + /// + public IDictionary Additionals { get; } - public ReGeocodeLocation() - { - Pois = new Poi[0]; - Roads = new Road[0]; - Additionals = new Dictionary(); - } + public ReGeocodeLocation() + { + Pois = new Poi[0]; + Roads = new Road[0]; + Additionals = new Dictionary(); + } - public void AddAdditional(string key, object value) - { - Additionals.Add(key, value); - } + public void AddAdditional(string key, object value) + { + Additionals.Add(key, value); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/Road.cs b/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/Road.cs index fe56832ad..349fed9ed 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/Road.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Location/LINGYUN/Abp/Location/Road.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.Location +namespace LINGYUN.Abp.Location; + +public class Road { - public class Road - { - public string Name { get; set; } - } + public string Name { get; set; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.RealTime/LINGYUN.Abp.RealTime.csproj b/aspnet-core/framework/common/LINGYUN.Abp.RealTime/LINGYUN.Abp.RealTime.csproj index 80d9ff26c..2f6a56619 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.RealTime/LINGYUN.Abp.RealTime.csproj +++ b/aspnet-core/framework/common/LINGYUN.Abp.RealTime/LINGYUN.Abp.RealTime.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.RealTime + LINGYUN.Abp.RealTime + false + false + false diff --git a/aspnet-core/framework/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/AbpRealTimeModule.cs b/aspnet-core/framework/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/AbpRealTimeModule.cs index 7407dc6a3..4e7a877dd 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/AbpRealTimeModule.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/AbpRealTimeModule.cs @@ -1,10 +1,9 @@ using Volo.Abp.EventBus.Abstractions; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.RealTime +namespace LINGYUN.Abp.RealTime; + +[DependsOn(typeof(AbpEventBusAbstractionsModule))] +public class AbpRealTimeModule : AbpModule { - [DependsOn(typeof(AbpEventBusAbstractionsModule))] - public class AbpRealTimeModule : AbpModule - { - } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Localization/LocalizableStringInfo.cs b/aspnet-core/framework/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Localization/LocalizableStringInfo.cs index 712b0be15..10e29e245 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Localization/LocalizableStringInfo.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Localization/LocalizableStringInfo.cs @@ -1,38 +1,43 @@ using System.Collections.Generic; -namespace LINGYUN.Abp.RealTime.Localization +namespace LINGYUN.Abp.RealTime.Localization; + +/// +/// The notification that needs to be localized +/// +public class LocalizableStringInfo { /// - /// The notification that needs to be localized + /// Resource name + /// + public string ResourceName { get; set; } + /// + /// Properties + /// + public string Name { get; set; } + /// + /// Formatted data + /// + public Dictionary Values { get; set; } + /// + /// Instantiate + /// + public LocalizableStringInfo() + { + } + /// + /// Instantiate /// - public class LocalizableStringInfo + /// Resource name + /// Properties + /// Formatted data + public LocalizableStringInfo( + string resourceName, + string name, + Dictionary values = null) { - /// - /// Resource name - /// - public string ResourceName { get; } - /// - /// Properties - /// - public string Name { get; } - /// - /// Formatted data - /// - public Dictionary Values { get; } - /// - /// Instantiate - /// - /// Resource name - /// Properties - /// Formatted data - public LocalizableStringInfo( - string resourceName, - string name, - Dictionary values = null) - { - ResourceName = resourceName; - Name = name; - Values = values; - } + ResourceName = resourceName; + Name = name; + Values = values; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/RealTimeEto.cs b/aspnet-core/framework/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/RealTimeEto.cs index e713b8f19..eba868c3a 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/RealTimeEto.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/RealTimeEto.cs @@ -2,20 +2,19 @@ using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.EventBus; -namespace LINGYUN.Abp.RealTime +namespace LINGYUN.Abp.RealTime; + +[Serializable] +[GenericEventName(Prefix = "abp.realtime.")] +public class RealTimeEto : EtoBase { - [Serializable] - [GenericEventName(Prefix = "abp.realtime.")] - public class RealTimeEto : EtoBase + public T Data { get; set; } + public RealTimeEto() : base() { - public T Data { get; set; } - public RealTimeEto() : base() - { - } + } - public RealTimeEto(T data) : base() - { - Data = data; - } + public RealTimeEto(T data) : base() + { + Data = data; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN.Abp.Sms.Aliyun.csproj b/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN.Abp.Sms.Aliyun.csproj index 1f9f993c9..fe74f0158 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN.Abp.Sms.Aliyun.csproj +++ b/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN.Abp.Sms.Aliyun.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Sms.Aliyun + LINGYUN.Abp.Sms.Aliyun + false + false + false 阿里云短信服务 diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AbpAliyunSmsModule.cs b/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AbpAliyunSmsModule.cs index 87daa4203..ec1b7238e 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AbpAliyunSmsModule.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AbpAliyunSmsModule.cs @@ -5,26 +5,25 @@ using Volo.Abp.Sms; using Volo.Abp.VirtualFileSystem; -namespace LINGYUN.Abp.Sms.Aliyun +namespace LINGYUN.Abp.Sms.Aliyun; + +[DependsOn( + typeof(AbpSmsModule), + typeof(AbpAliyunModule))] +public class AbpAliyunSmsModule : AbpModule { - [DependsOn( - typeof(AbpSmsModule), - typeof(AbpAliyunModule))] - public class AbpAliyunSmsModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + Configure(options => { - Configure(options => - { - options.FileSets.AddEmbedded(); - }); + options.FileSets.AddEmbedded(); + }); - Configure(options => - { - options.Resources - .Get() - .AddVirtualJson("/LINGYUN/Abp/Sms/Aliyun/Localization/Resources"); - }); - } + Configure(options => + { + options.Resources + .Get() + .AddVirtualJson("/LINGYUN/Abp/Sms/Aliyun/Localization/Resources"); + }); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AliyunSmsException.cs b/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AliyunSmsException.cs index 1ffb34058..713098a7e 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AliyunSmsException.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AliyunSmsException.cs @@ -1,12 +1,11 @@ using LINGYUN.Abp.Aliyun; -namespace LINGYUN.Abp.Sms.Aliyun +namespace LINGYUN.Abp.Sms.Aliyun; + +public class AliyunSmsException : AbpAliyunException { - public class AliyunSmsException : AbpAliyunException + public AliyunSmsException(string code, string message) + :base(code, message) { - public AliyunSmsException(string code, string message) - :base(code, message) - { - } } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AliyunSmsResponse.cs b/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AliyunSmsResponse.cs index 40e92d186..e1783065f 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AliyunSmsResponse.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AliyunSmsResponse.cs @@ -3,123 +3,122 @@ using Volo.Abp; using Volo.Abp.Localization; -namespace LINGYUN.Abp.Sms.Aliyun +namespace LINGYUN.Abp.Sms.Aliyun; + +public class AliyunSmsResponse { - public class AliyunSmsResponse - { - public string Code { get; set; } - public string Message { get; set; } - public string RequestId { get; set; } + public string Code { get; set; } + public string Message { get; set; } + public string RequestId { get; set; } - public bool IsSuccess() - { - return "ok".Equals(Code, StringComparison.CurrentCultureIgnoreCase); - } + public bool IsSuccess() + { + return "ok".Equals(Code, StringComparison.CurrentCultureIgnoreCase); + } - public static ILocalizableString GetErrorMessage(string code, string message) + public static ILocalizableString GetErrorMessage(string code, string message) + { + // TODO: 把前缀写入本地化文档里面? + Check.NotNullOrWhiteSpace(code, nameof(code)); + switch (code) { - // TODO: 把前缀写入本地化文档里面? - Check.NotNullOrWhiteSpace(code, nameof(code)); - switch (code) - { - case "isv.SMS_SIGNATURE_SCENE_ILLEGAL": - return LocalizableString.Create("SMS_SIGNATURE_SCENE_ILLEGAL"); - case "isv.DENY_IP_RANGE": - return LocalizableString.Create("DENY_IP_RANGE"); - case "isv.MOBILE_COUNT_OVER_LIMIT": - return LocalizableString.Create("MOBILE_COUNT_OVER_LIMIT"); - case "isv.BUSINESS_LIMIT_CONTROL": - return LocalizableString.Create("BUSINESS_LIMIT_CONTROL"); - case "SignatureDoesNotMatch": - return LocalizableString.Create("SignatureDoesNotMatch"); - case "InvalidTimeStamp.Expired": - return LocalizableString.Create("InvalidTimeStampExpired"); - case "SignatureNonceUsed": - return LocalizableString.Create("SignatureNonceUsed"); - case "InvalidVersion": - return LocalizableString.Create("InvalidVersion"); - case "InvalidAction.NotFound": - return LocalizableString.Create("InvalidActionNotFound"); - case "isv.SIGN_COUNT_OVER_LIMIT": - return LocalizableString.Create("SIGN_COUNT_OVER_LIMIT"); - case "isv.TEMPLATE_COUNT_OVER_LIMIT": - return LocalizableString.Create("TEMPLATE_COUNT_OVER_LIMIT"); - case "isv.SIGN_NAME_ILLEGAL": - return LocalizableString.Create("SIGN_NAME_ILLEGAL"); - case "isv.SIGN_FILE_LIMIT": - return LocalizableString.Create("SIGN_FILE_LIMIT"); - case "isv.SIGN_OVER_LIMIT": - return LocalizableString.Create("SIGN_OVER_LIMIT"); - case "isv.TEMPLATE_OVER_LIMIT": - return LocalizableString.Create("TEMPLATE_OVER_LIMIT"); - case "SIGNATURE_BLACKLIST": - return LocalizableString.Create("SIGNATURE_BLACKLIST"); - case "isv.SHORTURL_OVER_LIMIT": - return LocalizableString.Create("SHORTURL_OVER_LIMIT"); - case "isv.NO_AVAILABLE_SHORT_URL": - return LocalizableString.Create("NO_AVAILABLE_SHORT_URL"); - case "isv.SHORTURL_NAME_ILLEGAL": - return LocalizableString.Create("SHORTURL_NAME_ILLEGAL"); - case "isv.SOURCEURL_OVER_LIMIT": - return LocalizableString.Create("SOURCEURL_OVER_LIMIT"); - case "isv.SHORTURL_TIME_ILLEGAL": - return LocalizableString.Create("SHORTURL_TIME_ILLEGAL"); - case "isv.PHONENUMBERS_OVER_LIMIT": - return LocalizableString.Create("PHONENUMBERS_OVER_LIMIT"); - case "isv.SHORTURL_STILL_AVAILABLE": - return LocalizableString.Create("SHORTURL_STILL_AVAILABLE"); - case "isv.SHORTURL_NOT_FOUND": - return LocalizableString.Create("SHORTURL_NOT_FOUND"); - case "isv.SMS_TEMPLATE_ILLEGAL": - return LocalizableString.Create("SMS_TEMPLATE_ILLEGAL"); - case "isv.SMS_SIGNATURE_ILLEGAL": - return LocalizableString.Create("SMS_SIGNATURE_ILLEGAL"); - case "isv.MOBILE_NUMBER_ILLEGAL": - return LocalizableString.Create("MOBILE_NUMBER_ILLEGAL"); - case "isv.TEMPLATE_MISSING_PARAMETERS": - return LocalizableString.Create("TEMPLATE_MISSING_PARAMETERS"); - case "isv.EXTEND_CODE_ERROR": - return LocalizableString.Create("EXTEND_CODE_ERROR"); - case "isv.DOMESTIC_NUMBER_NOT_SUPPORTED": - return LocalizableString.Create("DOMESTIC_NUMBER_NOT_SUPPORTED"); - case "isv.DAY_LIMIT_CONTROL": - return LocalizableString.Create("DAY_LIMIT_CONTROL"); - case "isv.SMS_CONTENT_ILLEGAL": - return LocalizableString.Create("SMS_CONTENT_ILLEGAL"); - case "isv.SMS_SIGN_ILLEGAL": - return LocalizableString.Create("SMS_SIGN_ILLEGAL"); - case "isp.RAM_PERMISSION_DENY": - return LocalizableString.Create("RAM_PERMISSION_DENY"); - case "isp.OUT_OF_SERVICE": - return LocalizableString.Create("OUT_OF_SERVICE"); - case "isv.PRODUCT_UN_SUBSCRIPT": - return LocalizableString.Create("PRODUCT_UN_SUBSCRIPT"); - case "isv.PRODUCT_UNSUBSCRIBE": - return LocalizableString.Create("PRODUCT_UNSUBSCRIBE"); - case "isv.ACCOUNT_NOT_EXISTS": - return LocalizableString.Create("ACCOUNT_NOT_EXISTS"); - case "isv.ACCOUNT_ABNORMAL": - return LocalizableString.Create("ACCOUNT_ABNORMAL"); - case "isv.INVALID_PARAMETERS": - return LocalizableString.Create("INVALID_PARAMETERS"); - case "isv.SYSTEM_ERROR": - return LocalizableString.Create("SYSTEM_ERROR"); - case "isv.INVALID_JSON_PARAM": - return LocalizableString.Create("INVALID_JSON_PARAM"); - case "isv.BLACK_KEY_CONTROL_LIMIT": - return LocalizableString.Create("BLACK_KEY_CONTROL_LIMIT"); - case "isv.PARAM_LENGTH_LIMIT": - return LocalizableString.Create("PARAM_LENGTH_LIMIT"); - case "isv.PARAM_NOT_SUPPORT_URL": - return LocalizableString.Create("PARAM_NOT_SUPPORT_URL"); - case "isv.AMOUNT_NOT_ENOUGH": - return LocalizableString.Create("AMOUNT_NOT_ENOUGH"); - case "isv.TEMPLATE_PARAMS_ILLEGAL": - return LocalizableString.Create("TEMPLATE_PARAMS_ILLEGAL"); - default: - throw new AbpException($"no error code: {code} define, message: {message}"); + case "isv.SMS_SIGNATURE_SCENE_ILLEGAL": + return LocalizableString.Create("SMS_SIGNATURE_SCENE_ILLEGAL"); + case "isv.DENY_IP_RANGE": + return LocalizableString.Create("DENY_IP_RANGE"); + case "isv.MOBILE_COUNT_OVER_LIMIT": + return LocalizableString.Create("MOBILE_COUNT_OVER_LIMIT"); + case "isv.BUSINESS_LIMIT_CONTROL": + return LocalizableString.Create("BUSINESS_LIMIT_CONTROL"); + case "SignatureDoesNotMatch": + return LocalizableString.Create("SignatureDoesNotMatch"); + case "InvalidTimeStamp.Expired": + return LocalizableString.Create("InvalidTimeStampExpired"); + case "SignatureNonceUsed": + return LocalizableString.Create("SignatureNonceUsed"); + case "InvalidVersion": + return LocalizableString.Create("InvalidVersion"); + case "InvalidAction.NotFound": + return LocalizableString.Create("InvalidActionNotFound"); + case "isv.SIGN_COUNT_OVER_LIMIT": + return LocalizableString.Create("SIGN_COUNT_OVER_LIMIT"); + case "isv.TEMPLATE_COUNT_OVER_LIMIT": + return LocalizableString.Create("TEMPLATE_COUNT_OVER_LIMIT"); + case "isv.SIGN_NAME_ILLEGAL": + return LocalizableString.Create("SIGN_NAME_ILLEGAL"); + case "isv.SIGN_FILE_LIMIT": + return LocalizableString.Create("SIGN_FILE_LIMIT"); + case "isv.SIGN_OVER_LIMIT": + return LocalizableString.Create("SIGN_OVER_LIMIT"); + case "isv.TEMPLATE_OVER_LIMIT": + return LocalizableString.Create("TEMPLATE_OVER_LIMIT"); + case "SIGNATURE_BLACKLIST": + return LocalizableString.Create("SIGNATURE_BLACKLIST"); + case "isv.SHORTURL_OVER_LIMIT": + return LocalizableString.Create("SHORTURL_OVER_LIMIT"); + case "isv.NO_AVAILABLE_SHORT_URL": + return LocalizableString.Create("NO_AVAILABLE_SHORT_URL"); + case "isv.SHORTURL_NAME_ILLEGAL": + return LocalizableString.Create("SHORTURL_NAME_ILLEGAL"); + case "isv.SOURCEURL_OVER_LIMIT": + return LocalizableString.Create("SOURCEURL_OVER_LIMIT"); + case "isv.SHORTURL_TIME_ILLEGAL": + return LocalizableString.Create("SHORTURL_TIME_ILLEGAL"); + case "isv.PHONENUMBERS_OVER_LIMIT": + return LocalizableString.Create("PHONENUMBERS_OVER_LIMIT"); + case "isv.SHORTURL_STILL_AVAILABLE": + return LocalizableString.Create("SHORTURL_STILL_AVAILABLE"); + case "isv.SHORTURL_NOT_FOUND": + return LocalizableString.Create("SHORTURL_NOT_FOUND"); + case "isv.SMS_TEMPLATE_ILLEGAL": + return LocalizableString.Create("SMS_TEMPLATE_ILLEGAL"); + case "isv.SMS_SIGNATURE_ILLEGAL": + return LocalizableString.Create("SMS_SIGNATURE_ILLEGAL"); + case "isv.MOBILE_NUMBER_ILLEGAL": + return LocalizableString.Create("MOBILE_NUMBER_ILLEGAL"); + case "isv.TEMPLATE_MISSING_PARAMETERS": + return LocalizableString.Create("TEMPLATE_MISSING_PARAMETERS"); + case "isv.EXTEND_CODE_ERROR": + return LocalizableString.Create("EXTEND_CODE_ERROR"); + case "isv.DOMESTIC_NUMBER_NOT_SUPPORTED": + return LocalizableString.Create("DOMESTIC_NUMBER_NOT_SUPPORTED"); + case "isv.DAY_LIMIT_CONTROL": + return LocalizableString.Create("DAY_LIMIT_CONTROL"); + case "isv.SMS_CONTENT_ILLEGAL": + return LocalizableString.Create("SMS_CONTENT_ILLEGAL"); + case "isv.SMS_SIGN_ILLEGAL": + return LocalizableString.Create("SMS_SIGN_ILLEGAL"); + case "isp.RAM_PERMISSION_DENY": + return LocalizableString.Create("RAM_PERMISSION_DENY"); + case "isp.OUT_OF_SERVICE": + return LocalizableString.Create("OUT_OF_SERVICE"); + case "isv.PRODUCT_UN_SUBSCRIPT": + return LocalizableString.Create("PRODUCT_UN_SUBSCRIPT"); + case "isv.PRODUCT_UNSUBSCRIBE": + return LocalizableString.Create("PRODUCT_UNSUBSCRIBE"); + case "isv.ACCOUNT_NOT_EXISTS": + return LocalizableString.Create("ACCOUNT_NOT_EXISTS"); + case "isv.ACCOUNT_ABNORMAL": + return LocalizableString.Create("ACCOUNT_ABNORMAL"); + case "isv.INVALID_PARAMETERS": + return LocalizableString.Create("INVALID_PARAMETERS"); + case "isv.SYSTEM_ERROR": + return LocalizableString.Create("SYSTEM_ERROR"); + case "isv.INVALID_JSON_PARAM": + return LocalizableString.Create("INVALID_JSON_PARAM"); + case "isv.BLACK_KEY_CONTROL_LIMIT": + return LocalizableString.Create("BLACK_KEY_CONTROL_LIMIT"); + case "isv.PARAM_LENGTH_LIMIT": + return LocalizableString.Create("PARAM_LENGTH_LIMIT"); + case "isv.PARAM_NOT_SUPPORT_URL": + return LocalizableString.Create("PARAM_NOT_SUPPORT_URL"); + case "isv.AMOUNT_NOT_ENOUGH": + return LocalizableString.Create("AMOUNT_NOT_ENOUGH"); + case "isv.TEMPLATE_PARAMS_ILLEGAL": + return LocalizableString.Create("TEMPLATE_PARAMS_ILLEGAL"); + default: + throw new AbpException($"no error code: {code} define, message: {message}"); - } } } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AliyunSmsSender.cs b/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AliyunSmsSender.cs index 1ee917994..31326203b 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AliyunSmsSender.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AliyunSmsSender.cs @@ -17,138 +17,137 @@ using Volo.Abp.Settings; using Volo.Abp.Sms; -namespace LINGYUN.Abp.Sms.Aliyun +namespace LINGYUN.Abp.Sms.Aliyun; + +[Dependency(ServiceLifetime.Singleton)] +[ExposeServices(typeof(ISmsSender), typeof(AliyunSmsSender))] +[RequiresFeature(AliyunFeatureNames.Sms.Enable)] +public class AliyunSmsSender : ISmsSender { - [Dependency(ServiceLifetime.Singleton)] - [ExposeServices(typeof(ISmsSender), typeof(AliyunSmsSender))] - [RequiresFeature(AliyunFeatureNames.Sms.Enable)] - public class AliyunSmsSender : ISmsSender + protected IJsonSerializer JsonSerializer { get; } + protected ISettingProvider SettingProvider { get; } + protected IServiceProvider ServiceProvider { get; } + protected IAcsClientFactory AcsClientFactory { get; } + public AliyunSmsSender( + IJsonSerializer jsonSerializer, + ISettingProvider settingProvider, + IServiceProvider serviceProvider, + IAcsClientFactory acsClientFactory) { - protected IJsonSerializer JsonSerializer { get; } - protected ISettingProvider SettingProvider { get; } - protected IServiceProvider ServiceProvider { get; } - protected IAcsClientFactory AcsClientFactory { get; } - public AliyunSmsSender( - IJsonSerializer jsonSerializer, - ISettingProvider settingProvider, - IServiceProvider serviceProvider, - IAcsClientFactory acsClientFactory) - { - JsonSerializer = jsonSerializer; - SettingProvider = settingProvider; - ServiceProvider = serviceProvider; - AcsClientFactory = acsClientFactory; - } + JsonSerializer = jsonSerializer; + SettingProvider = settingProvider; + ServiceProvider = serviceProvider; + AcsClientFactory = acsClientFactory; + } - [RequiresLimitFeature( - AliyunFeatureNames.Sms.SendLimit, - AliyunFeatureNames.Sms.SendLimitInterval, - LimitPolicy.Month, - AliyunFeatureNames.Sms.DefaultSendLimit, - AliyunFeatureNames.Sms.DefaultSendLimitInterval)] - public async virtual Task SendAsync(SmsMessage smsMessage) - { - var domain = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Sms.Domain); - var action = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Sms.ActionName); - var version = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Sms.Version); + [RequiresLimitFeature( + AliyunFeatureNames.Sms.SendLimit, + AliyunFeatureNames.Sms.SendLimitInterval, + LimitPolicy.Month, + AliyunFeatureNames.Sms.DefaultSendLimit, + AliyunFeatureNames.Sms.DefaultSendLimitInterval)] + public async virtual Task SendAsync(SmsMessage smsMessage) + { + var domain = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Sms.Domain); + var action = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Sms.ActionName); + var version = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Sms.Version); - Check.NotNullOrWhiteSpace(domain, AliyunSettingNames.Sms.Domain); - Check.NotNullOrWhiteSpace(action, AliyunSettingNames.Sms.ActionName); - Check.NotNullOrWhiteSpace(version, AliyunSettingNames.Sms.Version); + Check.NotNullOrWhiteSpace(domain, AliyunSettingNames.Sms.Domain); + Check.NotNullOrWhiteSpace(action, AliyunSettingNames.Sms.ActionName); + Check.NotNullOrWhiteSpace(version, AliyunSettingNames.Sms.Version); - CommonRequest request = new CommonRequest - { - Method = MethodType.POST, - Domain = domain, - Action = action, - Version = version - }; - await TryAddTemplateCodeAsync(request, smsMessage); - await TryAddSignNameAsync(request, smsMessage); - await TryAddSendPhoneAsync(request, smsMessage); + CommonRequest request = new CommonRequest + { + Method = MethodType.POST, + Domain = domain, + Action = action, + Version = version + }; + await TryAddTemplateCodeAsync(request, smsMessage); + await TryAddSignNameAsync(request, smsMessage); + await TryAddSendPhoneAsync(request, smsMessage); - TryAddTemplateParam(request, smsMessage); + TryAddTemplateParam(request, smsMessage); - try + try + { + var client = await AcsClientFactory.CreateAsync(); + CommonResponse response = client.GetCommonResponse(request); + var responseContent = Encoding.Default.GetString(response.HttpResponse.Content); + var aliyunResponse = JsonSerializer.Deserialize(responseContent); + if (!aliyunResponse.IsSuccess()) { - var client = await AcsClientFactory.CreateAsync(); - CommonResponse response = client.GetCommonResponse(request); - var responseContent = Encoding.Default.GetString(response.HttpResponse.Content); - var aliyunResponse = JsonSerializer.Deserialize(responseContent); - if (!aliyunResponse.IsSuccess()) + if (await SettingProvider.IsTrueAsync(AliyunSettingNames.Sms.VisableErrorToClient)) { - if (await SettingProvider.IsTrueAsync(AliyunSettingNames.Sms.VisableErrorToClient)) - { - throw new UserFriendlyException(aliyunResponse.Code, aliyunResponse.Message); - } - throw new AliyunSmsException(aliyunResponse.Code, $"Text message sending failed, code:{aliyunResponse.Code}, message:{aliyunResponse.Message}!"); + throw new UserFriendlyException(aliyunResponse.Code, aliyunResponse.Message); } + throw new AliyunSmsException(aliyunResponse.Code, $"Text message sending failed, code:{aliyunResponse.Code}, message:{aliyunResponse.Message}!"); } - catch(ServerException se) - { - throw new AliyunSmsException(se.ErrorCode, $"Sending text messages to aliyun server is abnormal,type: {se.ErrorType}, error: {se.ErrorMessage}"); - } - catch(ClientException ce) - { - throw new AliyunSmsException(ce.ErrorCode, $"A client exception occurred in sending SMS messages,type: {ce.ErrorType}, error: {ce.ErrorMessage}"); - } } + catch(ServerException se) + { + throw new AliyunSmsException(se.ErrorCode, $"Sending text messages to aliyun server is abnormal,type: {se.ErrorType}, error: {se.ErrorMessage}"); + } + catch(ClientException ce) + { + throw new AliyunSmsException(ce.ErrorCode, $"A client exception occurred in sending SMS messages,type: {ce.ErrorType}, error: {ce.ErrorMessage}"); + } + } - private async Task TryAddTemplateCodeAsync(CommonRequest request, SmsMessage smsMessage) + private async Task TryAddTemplateCodeAsync(CommonRequest request, SmsMessage smsMessage) + { + if (smsMessage.Properties.TryGetValue("TemplateCode", out object template) && template != null) { - if (smsMessage.Properties.TryGetValue("TemplateCode", out object template) && template != null) - { - request.AddQueryParameters("TemplateCode", template.ToString()); - smsMessage.Properties.Remove("TemplateCode"); - } - else - { - var defaultTemplateCode = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Sms.DefaultTemplateCode); - Check.NotNullOrWhiteSpace(defaultTemplateCode, "TemplateCode"); - request.AddQueryParameters("TemplateCode", defaultTemplateCode); - } + request.AddQueryParameters("TemplateCode", template.ToString()); + smsMessage.Properties.Remove("TemplateCode"); } + else + { + var defaultTemplateCode = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Sms.DefaultTemplateCode); + Check.NotNullOrWhiteSpace(defaultTemplateCode, "TemplateCode"); + request.AddQueryParameters("TemplateCode", defaultTemplateCode); + } + } - private async Task TryAddSignNameAsync(CommonRequest request, SmsMessage smsMessage) + private async Task TryAddSignNameAsync(CommonRequest request, SmsMessage smsMessage) + { + if (smsMessage.Properties.TryGetValue("SignName", out object signName) && signName != null) { - if (smsMessage.Properties.TryGetValue("SignName", out object signName) && signName != null) - { - request.AddQueryParameters("SignName", signName.ToString()); - smsMessage.Properties.Remove("SignName"); - } - else - { - var defaultSignName = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Sms.DefaultSignName); - Check.NotNullOrWhiteSpace(defaultSignName, "SignName"); - request.AddQueryParameters("SignName", defaultSignName); - } + request.AddQueryParameters("SignName", signName.ToString()); + smsMessage.Properties.Remove("SignName"); } + else + { + var defaultSignName = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Sms.DefaultSignName); + Check.NotNullOrWhiteSpace(defaultSignName, "SignName"); + request.AddQueryParameters("SignName", defaultSignName); + } + } - private async Task TryAddSendPhoneAsync(CommonRequest request, SmsMessage smsMessage) + private async Task TryAddSendPhoneAsync(CommonRequest request, SmsMessage smsMessage) + { + if (smsMessage.PhoneNumber.IsNullOrWhiteSpace()) { - if (smsMessage.PhoneNumber.IsNullOrWhiteSpace()) - { - var defaultPhoneNumber = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Sms.DefaultPhoneNumber); - // check phone number length... - Check.NotNullOrWhiteSpace( - defaultPhoneNumber, - AliyunSettingNames.Sms.DefaultPhoneNumber, - maxLength: 11, minLength: 11); - request.AddQueryParameters("PhoneNumbers", defaultPhoneNumber); - } - else - { - request.AddQueryParameters("PhoneNumbers", smsMessage.PhoneNumber); - } + var defaultPhoneNumber = await SettingProvider.GetOrNullAsync(AliyunSettingNames.Sms.DefaultPhoneNumber); + // check phone number length... + Check.NotNullOrWhiteSpace( + defaultPhoneNumber, + AliyunSettingNames.Sms.DefaultPhoneNumber, + maxLength: 11, minLength: 11); + request.AddQueryParameters("PhoneNumbers", defaultPhoneNumber); } + else + { + request.AddQueryParameters("PhoneNumbers", smsMessage.PhoneNumber); + } + } - private void TryAddTemplateParam(CommonRequest request, SmsMessage smsMessage) + private void TryAddTemplateParam(CommonRequest request, SmsMessage smsMessage) + { + if (smsMessage.Properties.Any()) { - if (smsMessage.Properties.Any()) - { - var queryParamJson = JsonSerializer.Serialize(smsMessage.Properties); - request.AddQueryParameters("TemplateParam", queryParamJson); - } + var queryParamJson = JsonSerializer.Serialize(smsMessage.Properties); + request.AddQueryParameters("TemplateParam", queryParamJson); } } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AliyunSmsSuccessResponse.cs b/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AliyunSmsSuccessResponse.cs index 57a20e4f2..0aa051a3d 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AliyunSmsSuccessResponse.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/LINGYUN/Abp/Sms/Aliyun/AliyunSmsSuccessResponse.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.Sms.Aliyun +namespace LINGYUN.Abp.Sms.Aliyun; + +public class AliyunSmsSuccessResponse : AliyunSmsResponse { - public class AliyunSmsSuccessResponse : AliyunSmsResponse - { - public string BizId { get; set; } - } + public string BizId { get; set; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/Volo/Abp/Sms/AliyunSmsSenderExtensions.cs b/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/Volo/Abp/Sms/AliyunSmsSenderExtensions.cs index 1319e7d79..2d7998ff8 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/Volo/Abp/Sms/AliyunSmsSenderExtensions.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Sms.Aliyun/Volo/Abp/Sms/AliyunSmsSenderExtensions.cs @@ -2,48 +2,47 @@ using System.Collections.Generic; using System.Threading.Tasks; -namespace Volo.Abp.Sms +namespace Volo.Abp.Sms; + +public static class AliyunSmsSenderExtensions { - public static class AliyunSmsSenderExtensions + /// + /// 扩展短信接口 + /// + /// + /// 短信模板号 + /// 发送手机号 + /// 短信模板参数 + /// + public static async Task SendAsync(this ISmsSender smsSender, string templateCode, string phoneNumber, IDictionary templateParams = null) { - /// - /// 扩展短信接口 - /// - /// - /// 短信模板号 - /// 发送手机号 - /// 短信模板参数 - /// - public static async Task SendAsync(this ISmsSender smsSender, string templateCode, string phoneNumber, IDictionary templateParams = null) + var smsMessage = new SmsMessage(phoneNumber, nameof(AliyunSmsSender)); + smsMessage.Properties.Add("TemplateCode", templateCode); + if(templateParams != null) { - var smsMessage = new SmsMessage(phoneNumber, nameof(AliyunSmsSender)); - smsMessage.Properties.Add("TemplateCode", templateCode); - if(templateParams != null) - { - smsMessage.Properties.AddIfNotContains(templateParams); - } - await smsSender.SendAsync(smsMessage); + smsMessage.Properties.AddIfNotContains(templateParams); } + await smsSender.SendAsync(smsMessage); + } - /// - /// 扩展短信接口 - /// - /// - /// 短信签名 - /// 短信模板号 - /// 发送手机号 - /// 短信模板参数 - /// - public static async Task SendAsync(this ISmsSender smsSender, string signName, string templateCode, string phoneNumber, IDictionary templateParams = null) + /// + /// 扩展短信接口 + /// + /// + /// 短信签名 + /// 短信模板号 + /// 发送手机号 + /// 短信模板参数 + /// + public static async Task SendAsync(this ISmsSender smsSender, string signName, string templateCode, string phoneNumber, IDictionary templateParams = null) + { + var smsMessage = new SmsMessage(phoneNumber, nameof(AliyunSmsSender)); + smsMessage.Properties.Add("SignName", signName); + smsMessage.Properties.Add("TemplateCode", templateCode); + if (templateParams != null) { - var smsMessage = new SmsMessage(phoneNumber, nameof(AliyunSmsSender)); - smsMessage.Properties.Add("SignName", signName); - smsMessage.Properties.Add("TemplateCode", templateCode); - if (templateParams != null) - { - smsMessage.Properties.AddIfNotContains(templateParams); - } - await smsSender.SendAsync(smsMessage); + smsMessage.Properties.AddIfNotContains(templateParams); } + await smsSender.SendAsync(smsMessage); } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN.Abp.Wrapper.csproj b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN.Abp.Wrapper.csproj index 8f0936c07..92bcc4125 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN.Abp.Wrapper.csproj +++ b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN.Abp.Wrapper.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Wrapper + LINGYUN.Abp.Wrapper + false + false + false diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/AbpHttpWrapConsts.cs b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/AbpHttpWrapConsts.cs index 3a062e17b..cc26db3e3 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/AbpHttpWrapConsts.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/AbpHttpWrapConsts.cs @@ -1,9 +1,8 @@ -namespace LINGYUN.Abp.Wrapper +namespace LINGYUN.Abp.Wrapper; + +public static class AbpHttpWrapConsts { - public static class AbpHttpWrapConsts - { - public const string AbpWrapResult = "_AbpWrapResult"; + public const string AbpWrapResult = "_AbpWrapResult"; - public const string AbpDontWrapResult = "_AbpDontWrapResult"; - } + public const string AbpDontWrapResult = "_AbpDontWrapResult"; } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/AbpWrapperModule.cs b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/AbpWrapperModule.cs index 75f8ae1ef..c356c029f 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/AbpWrapperModule.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/AbpWrapperModule.cs @@ -1,11 +1,10 @@ using Volo.Abp.ExceptionHandling; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.Wrapper +namespace LINGYUN.Abp.Wrapper; + +[DependsOn(typeof(AbpExceptionHandlingModule))] +public class AbpWrapperModule: AbpModule { - [DependsOn(typeof(AbpExceptionHandlingModule))] - public class AbpWrapperModule: AbpModule - { - } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/AbpWrapperOptions.cs b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/AbpWrapperOptions.cs index ea715c9d1..eb8c240c2 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/AbpWrapperOptions.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/AbpWrapperOptions.cs @@ -3,110 +3,115 @@ using System.Net; using Volo.Abp.Collections; -namespace LINGYUN.Abp.Wrapper +namespace LINGYUN.Abp.Wrapper; + +public class AbpWrapperOptions { - public class AbpWrapperOptions - { - /// - /// 未处理异常代码 - /// 默认: 500 - /// - public string CodeWithUnhandled { get; set; } - /// - /// 是否启用包装器 - /// - public bool IsEnabled { get; set; } - /// - /// 成功时返回代码 - /// 默认:0 - /// - public string CodeWithSuccess { get; set; } - /// - /// 资源为空时是否提示错误 - /// 默认: false - /// - public bool ErrorWithEmptyResult { get; set; } - /// - /// 资源为空时返回代码 - /// 默认:404 - /// - public Func CodeWithEmptyResult { get; set; } - /// - /// 资源为空时返回错误消息 - /// - public Func MessageWithEmptyResult { get; set; } - /// - /// 包装后的返回状态码 - /// 默认:200 HttpStatusCode.OK - /// - public HttpStatusCode HttpStatusCode { get; set; } - /// - /// 忽略Url开头类型 - /// - public IList IgnorePrefixUrls { get; } - /// - /// 忽略指定命名空间 - /// - public IList IgnoreNamespaces { get; } - /// - /// 忽略控制器 - /// - public ITypeList IgnoreControllers { get; } - /// - /// 忽略返回值 - /// - public ITypeList IgnoreReturnTypes { get; } - /// - /// 忽略异常 - /// - public ITypeList IgnoreExceptions { get; } - /// - /// 忽略接口类型 - /// - public ITypeList IgnoredInterfaces { get; } + /// + /// 未处理异常代码 + /// 默认: 500 + /// + public string CodeWithUnhandled { get; set; } + /// + /// 是否启用包装器 + /// 默认: false + /// + public bool IsEnabled { get; set; } + /// + /// 成功时返回代码 + /// 默认:0 + /// + public string CodeWithSuccess { get; set; } + /// + /// 资源为空时是否提示错误 + /// 默认: false + /// + public bool ErrorWithEmptyResult { get; set; } + /// + /// 是否启用401错误包装 + /// 默认: false + /// + public bool IsWrapUnauthorizedEnabled { get; set; } + /// + /// 资源为空时返回代码 + /// 默认:404 + /// + public Func CodeWithEmptyResult { get; set; } + /// + /// 资源为空时返回错误消息 + /// + public Func MessageWithEmptyResult { get; set; } + /// + /// 包装后的返回状态码 + /// 默认:200 HttpStatusCode.OK + /// + public HttpStatusCode HttpStatusCode { get; set; } + /// + /// 忽略Url开头类型 + /// + public IList IgnorePrefixUrls { get; } + /// + /// 忽略指定命名空间 + /// + public IList IgnoreNamespaces { get; } + /// + /// 忽略控制器 + /// + public ITypeList IgnoreControllers { get; } + /// + /// 忽略返回值 + /// + public ITypeList IgnoreReturnTypes { get; } + /// + /// 忽略异常 + /// + public ITypeList IgnoreExceptions { get; } + /// + /// 忽略接口类型 + /// + public ITypeList IgnoredInterfaces { get; } - internal IDictionary ExceptionHandles { get; } + internal IDictionary ExceptionHandles { get; } - public AbpWrapperOptions() - { - CodeWithUnhandled = "500"; - CodeWithSuccess = "0"; - HttpStatusCode = HttpStatusCode.OK; - ErrorWithEmptyResult = false; + public AbpWrapperOptions() + { + CodeWithUnhandled = "500"; + CodeWithSuccess = "0"; + HttpStatusCode = HttpStatusCode.OK; + ErrorWithEmptyResult = false; - IgnorePrefixUrls = new List(); - IgnoreNamespaces = new List(); + IgnorePrefixUrls = new List(); + IgnoreNamespaces = new List(); - IgnoreControllers = new TypeList(); - IgnoreReturnTypes = new TypeList(); - IgnoredInterfaces = new TypeList() - { - typeof(IWrapDisabled) - }; - IgnoreExceptions = new TypeList(); + IgnoreControllers = new TypeList(); + IgnoreReturnTypes = new TypeList(); + IgnoredInterfaces = new TypeList() + { + typeof(IWrapDisabled) + }; + IgnoreExceptions = new TypeList(); - CodeWithEmptyResult = (_) => "404"; - MessageWithEmptyResult = (_) => "Not Found"; + CodeWithEmptyResult = (_) => "404"; + MessageWithEmptyResult = (_) => "Not Found"; - ExceptionHandles = new Dictionary(); - } + ExceptionHandles = new Dictionary(); + } - public void AddHandler(IExceptionWrapHandler handler) - where TException : Exception - { - AddHandler(typeof(TException), handler); - } + public void AddHandler(IExceptionWrapHandler handler) + where TException : Exception + { + AddHandler(typeof(TException), handler); + } - public void AddHandler(Type exceptionType, IExceptionWrapHandler handler) - { - ExceptionHandles[exceptionType] = handler; - } + public void AddHandler(Type exceptionType, IExceptionWrapHandler handler) + { + ExceptionHandles[exceptionType] = handler; + } - public IExceptionWrapHandler GetHandler(Type exceptionType) - { - ExceptionHandles.TryGetValue(exceptionType, out IExceptionWrapHandler handler); + public IExceptionWrapHandler GetHandler(Type exceptionType) + { + ExceptionHandles.TryGetValue(exceptionType, out IExceptionWrapHandler handler); - return handler; - } + return handler; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/DefaultExceptionWrapHandler.cs b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/DefaultExceptionWrapHandler.cs index 6b2dca5ba..68bac8ab8 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/DefaultExceptionWrapHandler.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/DefaultExceptionWrapHandler.cs @@ -3,39 +3,38 @@ using System; using Volo.Abp.ExceptionHandling; -namespace LINGYUN.Abp.Wrapper +namespace LINGYUN.Abp.Wrapper; + +public class DefaultExceptionWrapHandler : IExceptionWrapHandler { - public class DefaultExceptionWrapHandler : IExceptionWrapHandler + public void Wrap(ExceptionWrapContext context) { - public void Wrap(ExceptionWrapContext context) + if (context.Exception is IHasErrorCode exceptionWithErrorCode) { - if (context.Exception is IHasErrorCode exceptionWithErrorCode) + string errorCode; + if (!exceptionWithErrorCode.Code.IsNullOrWhiteSpace() && + exceptionWithErrorCode.Code.Contains(":")) { - string errorCode; - if (!exceptionWithErrorCode.Code.IsNullOrWhiteSpace() && - exceptionWithErrorCode.Code.Contains(":")) - { - errorCode = exceptionWithErrorCode.Code.Split(':')[1]; - } - else - { - errorCode = exceptionWithErrorCode.Code; - } - - context.WithCode(errorCode); + errorCode = exceptionWithErrorCode.Code.Split(':')[1]; + } + else + { + errorCode = exceptionWithErrorCode.Code; } - // 没有处理的异常代码统一用配置代码处理 - if (context.ErrorInfo.Code.IsNullOrWhiteSpace()) + context.WithCode(errorCode); + } + + // 没有处理的异常代码统一用配置代码处理 + if (context.ErrorInfo.Code.IsNullOrWhiteSpace()) + { + if (context.StatusCode.HasValue) { - if (context.StatusCode.HasValue) - { - context.WithCode(((int)context.StatusCode).ToString()); - return; - } - var wrapperOptions = context.ServiceProvider.GetRequiredService>().Value; - context.WithCode(wrapperOptions.CodeWithUnhandled); + context.WithCode(((int)context.StatusCode).ToString()); + return; } + var wrapperOptions = context.ServiceProvider.GetRequiredService>().Value; + context.WithCode(wrapperOptions.CodeWithUnhandled); } } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/ExceptionWrapHandlerFactory.cs b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/ExceptionWrapHandlerFactory.cs index 7e88cf362..7f7bbc5f6 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/ExceptionWrapHandlerFactory.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/ExceptionWrapHandlerFactory.cs @@ -1,30 +1,29 @@ using Microsoft.Extensions.Options; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.Wrapper +namespace LINGYUN.Abp.Wrapper; + +public class ExceptionWrapHandlerFactory : IExceptionWrapHandlerFactory, ITransientDependency { - public class ExceptionWrapHandlerFactory : IExceptionWrapHandlerFactory, ITransientDependency - { - private readonly AbpWrapperOptions _options; + private readonly AbpWrapperOptions _options; - public ExceptionWrapHandlerFactory( - IOptions options) - { - _options = options.Value; - } + public ExceptionWrapHandlerFactory( + IOptions options) + { + _options = options.Value; + } - public IExceptionWrapHandler CreateFor(ExceptionWrapContext context) + public IExceptionWrapHandler CreateFor(ExceptionWrapContext context) + { + var exceptionType = context.Exception.GetType(); + var handler = _options.GetHandler(exceptionType); + if (handler == null) { - var exceptionType = context.Exception.GetType(); - var handler = _options.GetHandler(exceptionType); - if (handler == null) - { - handler = new DefaultExceptionWrapHandler(); - _options.AddHandler(exceptionType, handler); - return handler; - } - + handler = new DefaultExceptionWrapHandler(); + _options.AddHandler(exceptionType, handler); return handler; } + + return handler; } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/IExceptionWrapHandler.cs b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/IExceptionWrapHandler.cs index 3a2fcccc3..219f58a72 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/IExceptionWrapHandler.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/IExceptionWrapHandler.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.Wrapper +namespace LINGYUN.Abp.Wrapper; + +public interface IExceptionWrapHandler { - public interface IExceptionWrapHandler - { - void Wrap(ExceptionWrapContext context); - } + void Wrap(ExceptionWrapContext context); } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/IExceptionWrapHandlerFactory.cs b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/IExceptionWrapHandlerFactory.cs index c8cd3fd1b..7507bc352 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/IExceptionWrapHandlerFactory.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/IExceptionWrapHandlerFactory.cs @@ -1,9 +1,8 @@ using System; -namespace LINGYUN.Abp.Wrapper +namespace LINGYUN.Abp.Wrapper; + +public interface IExceptionWrapHandlerFactory { - public interface IExceptionWrapHandlerFactory - { - IExceptionWrapHandler CreateFor(ExceptionWrapContext context); - } + IExceptionWrapHandler CreateFor(ExceptionWrapContext context); } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/IWrapDisabled.cs b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/IWrapDisabled.cs index fbc3a7297..c6d2bbd87 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/IWrapDisabled.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/IWrapDisabled.cs @@ -1,6 +1,5 @@ -namespace LINGYUN.Abp.Wrapper +namespace LINGYUN.Abp.Wrapper; + +public interface IWrapDisabled { - public interface IWrapDisabled - { - } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/IgnoreWrapResultAttribute.cs b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/IgnoreWrapResultAttribute.cs index 963edad3e..5a3b8941f 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/IgnoreWrapResultAttribute.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/IgnoreWrapResultAttribute.cs @@ -1,13 +1,12 @@ using System; -namespace LINGYUN.Abp.Wrapper +namespace LINGYUN.Abp.Wrapper; + +[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = false)] +public class IgnoreWrapResultAttribute : Attribute { - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = false)] - public class IgnoreWrapResultAttribute : Attribute + public IgnoreWrapResultAttribute() { - public IgnoreWrapResultAttribute() - { - } } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/WrapResult.cs b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/WrapResult.cs index 1631915d1..19b0cb537 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/WrapResult.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/WrapResult.cs @@ -1,25 +1,24 @@ using System; -namespace LINGYUN.Abp.Wrapper +namespace LINGYUN.Abp.Wrapper; + +[Serializable] +public class WrapResult: WrapResult { - [Serializable] - public class WrapResult: WrapResult + public WrapResult() { } + public WrapResult( + string code, + string message, + string details = null) + : base(code, message, details) { - public WrapResult() { } - public WrapResult( - string code, - string message, - string details = null) - : base(code, message, details) - { - } + } - public WrapResult( - string code, - object result, - string message = "OK") - : base(code, result, message) - { - } + public WrapResult( + string code, + object result, + string message = "OK") + : base(code, result, message) + { } } diff --git a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/WrapResult`T.cs b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/WrapResult`T.cs index c3a8c9106..867c6c239 100644 --- a/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/WrapResult`T.cs +++ b/aspnet-core/framework/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/WrapResult`T.cs @@ -1,49 +1,48 @@ using System; -namespace LINGYUN.Abp.Wrapper +namespace LINGYUN.Abp.Wrapper; + +/// +/// 返回值包装结构 +/// +/// +[Serializable] +public class WrapResult { /// - /// 返回值包装结构 + /// 错误代码 + /// + public string Code { get; set; } + /// + /// 错误提示消息 + /// + public string Message { get; set; } + /// + /// 补充消息 /// - /// - [Serializable] - public class WrapResult + public string Details { get; set; } + /// + /// 返回值 + /// + public TResult Result { get; set; } + public WrapResult() { } + public WrapResult( + string code, + string message, + string details = null) { - /// - /// 错误代码 - /// - public string Code { get; set; } - /// - /// 错误提示消息 - /// - public string Message { get; set; } - /// - /// 补充消息 - /// - public string Details { get; set; } - /// - /// 返回值 - /// - public TResult Result { get; set; } - public WrapResult() { } - public WrapResult( - string code, - string message, - string details = null) - { - Code = code; - Message = message; - Details = details; - } + Code = code; + Message = message; + Details = details; + } - public WrapResult( - string code, - TResult result, - string message = "OK") - { - Code = code; - Result = result; - Message = message; - } + public WrapResult( + string code, + TResult result, + string message = "OK") + { + Code = code; + Result = result; + Message = message; } } diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore.Wrapper/LINGYUN.Abp.Dapr.Actors.AspNetCore.Wrapper.csproj b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore.Wrapper/LINGYUN.Abp.Dapr.Actors.AspNetCore.Wrapper.csproj index e090a48a9..54513ca31 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore.Wrapper/LINGYUN.Abp.Dapr.Actors.AspNetCore.Wrapper.csproj +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore.Wrapper/LINGYUN.Abp.Dapr.Actors.AspNetCore.Wrapper.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.Dapr.Actors.AspNetCore.Wrapper + LINGYUN.Abp.Dapr.Actors.AspNetCore.Wrapper + false + false + false diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore.Wrapper/LINGYUN/Abp/Dapr/Actors/AspNetCore/Wrapper/AbpDaprActorsAspNetCoreWrapperModule.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore.Wrapper/LINGYUN/Abp/Dapr/Actors/AspNetCore/Wrapper/AbpDaprActorsAspNetCoreWrapperModule.cs index 47a4931f4..27e993c5a 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore.Wrapper/LINGYUN/Abp/Dapr/Actors/AspNetCore/Wrapper/AbpDaprActorsAspNetCoreWrapperModule.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore.Wrapper/LINGYUN/Abp/Dapr/Actors/AspNetCore/Wrapper/AbpDaprActorsAspNetCoreWrapperModule.cs @@ -2,19 +2,18 @@ using LINGYUN.Abp.Wrapper; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.Dapr.Actors.AspNetCore.Wrapper +namespace LINGYUN.Abp.Dapr.Actors.AspNetCore.Wrapper; + +[DependsOn( + typeof(AbpDaprActorsAspNetCoreModule), + typeof(AbpWrapperModule))] +public class AbpDaprActorsAspNetCoreWrapperModule : AbpModule { - [DependsOn( - typeof(AbpDaprActorsAspNetCoreModule), - typeof(AbpWrapperModule))] - public class AbpDaprActorsAspNetCoreWrapperModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + Configure(options => { - Configure(options => - { - options.IgnoredInterfaces.TryAdd(); - }); - } + options.IgnoredInterfaces.TryAdd(); + }); } } \ No newline at end of file diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore/Dapr/Actors/Runtime/ActorRegistrationExtensions.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore/Dapr/Actors/Runtime/ActorRegistrationExtensions.cs index e7f481faa..78952ac7c 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore/Dapr/Actors/Runtime/ActorRegistrationExtensions.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore/Dapr/Actors/Runtime/ActorRegistrationExtensions.cs @@ -2,15 +2,14 @@ using System.Collections.Generic; using System.Linq; -namespace Dapr.Actors.Runtime +namespace Dapr.Actors.Runtime; + +public static class ActorRegistrationExtensions { - public static class ActorRegistrationExtensions + public static bool Contains( + this ICollection registrations, + Type implementationType) { - public static bool Contains( - this ICollection registrations, - Type implementationType) - { - return registrations.Any(x => x.Type.ImplementationType == implementationType); - } + return registrations.Any(x => x.Type.ImplementationType == implementationType); } } diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore/LINGYUN.Abp.Dapr.Actors.AspNetCore.csproj b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore/LINGYUN.Abp.Dapr.Actors.AspNetCore.csproj index 7cab47c8d..1b753bf4c 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore/LINGYUN.Abp.Dapr.Actors.AspNetCore.csproj +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore/LINGYUN.Abp.Dapr.Actors.AspNetCore.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.Dapr.Actors.AspNetCore + LINGYUN.Abp.Dapr.Actors.AspNetCore + false + false + false diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore/LINGYUN/Abp/Dapr/Actors/AspNetCore/AbpDaprActorsAspNetCoreModule.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore/LINGYUN/Abp/Dapr/Actors/AspNetCore/AbpDaprActorsAspNetCoreModule.cs index 58d284134..6763e18fd 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore/LINGYUN/Abp/Dapr/Actors/AspNetCore/AbpDaprActorsAspNetCoreModule.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore/LINGYUN/Abp/Dapr/Actors/AspNetCore/AbpDaprActorsAspNetCoreModule.cs @@ -8,49 +8,48 @@ using Volo.Abp.AspNetCore; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.Dapr.Actors.AspNetCore +namespace LINGYUN.Abp.Dapr.Actors.AspNetCore; + +[DependsOn( + typeof(AbpAspNetCoreModule))] +public class AbpDaprActorsAspNetCoreModule : AbpModule { - [DependsOn( - typeof(AbpAspNetCoreModule))] - public class AbpDaprActorsAspNetCoreModule : AbpModule + public override void PreConfigureServices(ServiceConfigurationContext context) { - public override void PreConfigureServices(ServiceConfigurationContext context) - { - AddDefinitionActor(context.Services); - } + AddDefinitionActor(context.Services); + } - public override void ConfigureServices(ServiceConfigurationContext context) + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => { - Configure(options => + options.EndpointConfigureActions.Add(endpointContext => { - options.EndpointConfigureActions.Add(endpointContext => - { - endpointContext.Endpoints.MapActorsHandlers(); - }); + endpointContext.Endpoints.MapActorsHandlers(); }); - } + }); + } - private static void AddDefinitionActor(IServiceCollection services) - { - var actorRegistrations = new List(); + private static void AddDefinitionActor(IServiceCollection services) + { + var actorRegistrations = new List(); - services.OnRegistered(context => + services.OnRegistered(context => + { + if (typeof(IActor).IsAssignableFrom(context.ImplementationType) && + !actorRegistrations.Contains(context.ImplementationType)) { - if (typeof(IActor).IsAssignableFrom(context.ImplementationType) && - !actorRegistrations.Contains(context.ImplementationType)) - { - var actorRegistration = new ActorRegistration(context.ImplementationType.GetActorTypeInfo()); + var actorRegistration = new ActorRegistration(context.ImplementationType.GetActorTypeInfo()); - actorRegistrations.Add(actorRegistration); - } - }); - // 使Actor Runtime可配置 - var preActions = services.GetPreConfigureActions(); - services.AddActors(options => - { - preActions.Configure(options); - options.Actors.AddIfNotContains(actorRegistrations); - }); - } + actorRegistrations.Add(actorRegistration); + } + }); + // 使Actor Runtime可配置 + var preActions = services.GetPreConfigureActions(); + services.AddActors(options => + { + preActions.Configure(options); + options.Actors.AddIfNotContains(actorRegistrations); + }); } } diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore/System/TypeExtensions.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore/System/TypeExtensions.cs index 32533e1b6..a1a6d25a0 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore/System/TypeExtensions.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors.AspNetCore/System/TypeExtensions.cs @@ -5,96 +5,95 @@ using System.Reflection; using Volo.Abp; -namespace System +namespace System; + +internal static class TypeExtensions { - internal static class TypeExtensions + public static bool IsActor(this Type actorType) { - public static bool IsActor(this Type actorType) + Type baseType = actorType.GetTypeInfo().BaseType; + while (baseType != null) { - Type baseType = actorType.GetTypeInfo().BaseType; - while (baseType != null) + if (baseType == typeof(Actor)) { - if (baseType == typeof(Actor)) - { - return true; - } - - actorType = baseType; - baseType = actorType.GetTypeInfo().BaseType; + return true; } - return false; + actorType = baseType; + baseType = actorType.GetTypeInfo().BaseType; } - public static Type[] GetActorInterfaces(this Type type) - { - List list = new List(from t in type.GetInterfaces() - where typeof(IActor).IsAssignableFrom(t) - select t); - list.RemoveAll((Type t) => t.GetNonActorParentType() != null); - return list.ToArray(); - } + return false; + } + + public static Type[] GetActorInterfaces(this Type type) + { + List list = new List(from t in type.GetInterfaces() + where typeof(IActor).IsAssignableFrom(t) + select t); + list.RemoveAll((Type t) => t.GetNonActorParentType() != null); + return list.ToArray(); + } - public static RemoteServiceAttribute GetRemoteServiceAttribute(this Type type) + public static RemoteServiceAttribute GetRemoteServiceAttribute(this Type type) + { + return type.GetInterfaces() + .Where(t => t.IsDefined(typeof(RemoteServiceAttribute), false)) + .Select(t => t.GetCustomAttribute()) + .FirstOrDefault(); + } + + public static Type GetNonActorParentType(this Type type) + { + List list = new List(type.GetInterfaces()); + if (list.RemoveAll((Type t) => t == typeof(IActor)) == 0) { - return type.GetInterfaces() - .Where(t => t.IsDefined(typeof(RemoteServiceAttribute), false)) - .Select(t => t.GetCustomAttribute()) - .FirstOrDefault(); + return type; } - public static Type GetNonActorParentType(this Type type) + foreach (Type item in list) { - List list = new List(type.GetInterfaces()); - if (list.RemoveAll((Type t) => t == typeof(IActor)) == 0) + Type nonActorParentType = item.GetNonActorParentType(); + if (nonActorParentType != null) { - return type; + return nonActorParentType; } + } - foreach (Type item in list) - { - Type nonActorParentType = item.GetNonActorParentType(); - if (nonActorParentType != null) - { - return nonActorParentType; - } - } + return null; + } - return null; + public static ActorTypeInformation GetActorTypeInfo( + this Type actorType) + { + if (!actorType.IsActor()) + { + throw new ArgumentException( + string.Format("The type '{0}' is not an Actor. An actor type must derive from '{1}'.", actorType.FullName, typeof(Actor).FullName), + nameof(actorType)); } - public static ActorTypeInformation GetActorTypeInfo( - this Type actorType) + Type[] actorInterfaces = actorType.GetActorInterfaces(); + if (actorInterfaces.Length == 0 && !actorType.GetTypeInfo().IsAbstract) { - if (!actorType.IsActor()) - { - throw new ArgumentException( - string.Format("The type '{0}' is not an Actor. An actor type must derive from '{1}'.", actorType.FullName, typeof(Actor).FullName), - nameof(actorType)); - } - - Type[] actorInterfaces = actorType.GetActorInterfaces(); - if (actorInterfaces.Length == 0 && !actorType.GetTypeInfo().IsAbstract) - { - throw new ArgumentException( - string.Format("The actor type '{0}' does not implement any actor interfaces or one of the interfaces implemented is not an actor interface." + - " All interfaces(including its parent interface) implemented by actor type must be actor interface. " + - "An actor interface is the one that ultimately derives from '{1}' type.", actorType.FullName, typeof(IActor).FullName), - nameof(actorType)); - } + throw new ArgumentException( + string.Format("The actor type '{0}' does not implement any actor interfaces or one of the interfaces implemented is not an actor interface." + + " All interfaces(including its parent interface) implemented by actor type must be actor interface. " + + "An actor interface is the one that ultimately derives from '{1}' type.", actorType.FullName, typeof(IActor).FullName), + nameof(actorType)); + } - var actorTypeInfo = ActorTypeInformation.Get(actorType, null); + var actorTypeInfo = ActorTypeInformation.Get(actorType, null); - var remoteServiceAttr = actorType.GetRemoteServiceAttribute(); - if (remoteServiceAttr != null && - !string.Equals(actorTypeInfo.ActorTypeName, remoteServiceAttr.Name)) - { - typeof(ActorTypeInformation) - .GetProperty(nameof(ActorTypeInformation.ActorTypeName), BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public) - ?.SetValue(actorTypeInfo, remoteServiceAttr.Name); - } - - return actorTypeInfo; + var remoteServiceAttr = actorType.GetRemoteServiceAttribute(); + if (remoteServiceAttr != null && + !string.Equals(actorTypeInfo.ActorTypeName, remoteServiceAttr.Name)) + { + typeof(ActorTypeInformation) + .GetProperty(nameof(ActorTypeInformation.ActorTypeName), BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public) + ?.SetValue(actorTypeInfo, remoteServiceAttr.Name); } + + return actorTypeInfo; } } diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN.Abp.Dapr.Actors.csproj b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN.Abp.Dapr.Actors.csproj index 047197726..acce6e572 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN.Abp.Dapr.Actors.csproj +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN.Abp.Dapr.Actors.csproj @@ -1,10 +1,15 @@ - + net8.0 + LINGYUN.Abp.Dapr.Actors + LINGYUN.Abp.Dapr.Actors + false + false + false diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/AbpDaprActorCallException.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/AbpDaprActorCallException.cs index 8ce89ad5f..9ed526e28 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/AbpDaprActorCallException.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/AbpDaprActorCallException.cs @@ -1,40 +1,43 @@ -using System.Runtime.Serialization; +using System; using Volo.Abp; using Volo.Abp.ExceptionHandling; using Volo.Abp.Http; -namespace LINGYUN.Abp.Dapr.Actors +namespace LINGYUN.Abp.Dapr.Actors; + +public class AbpDaprActorCallException : AbpException, IHasErrorCode, IHasErrorDetails { - public class AbpDaprActorCallException : AbpException, IHasErrorCode, IHasErrorDetails - { - public string Code => Error?.Code; + public string Code => Error?.Code; - public string Details => Error?.Details; + public string Details => Error?.Details; - public RemoteServiceErrorInfo Error { get; set; } + public RemoteServiceErrorInfo Error { get; set; } - public AbpDaprActorCallException() - { + public AbpDaprActorCallException() + { - } + } - public AbpDaprActorCallException(SerializationInfo serializationInfo, StreamingContext context) - : base(serializationInfo, context) - { + public AbpDaprActorCallException(string message) + : base(message) + { + } - } + public AbpDaprActorCallException(string message, Exception innerException) + : base(message, innerException) + { + } - public AbpDaprActorCallException(RemoteServiceErrorInfo error) - : base(error.Message) - { - Error = error; + public AbpDaprActorCallException(RemoteServiceErrorInfo error) + : base(error.Message) + { + Error = error; - if (error.Data != null) + if (error.Data != null) + { + foreach (var dataKey in error.Data.Keys) { - foreach (var dataKey in error.Data.Keys) - { - Data[dataKey] = error.Data[dataKey]; - } + Data[dataKey] = error.Data[dataKey]; } } } diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/AbpDaprActorProxyOptions.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/AbpDaprActorProxyOptions.cs index 890064acc..3b0ba8908 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/AbpDaprActorProxyOptions.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/AbpDaprActorProxyOptions.cs @@ -2,15 +2,14 @@ using System; using System.Collections.Generic; -namespace LINGYUN.Abp.Dapr.Actors +namespace LINGYUN.Abp.Dapr.Actors; + +public class AbpDaprActorProxyOptions { - public class AbpDaprActorProxyOptions - { - public Dictionary ActorProxies { get; set; } + public Dictionary ActorProxies { get; set; } - public AbpDaprActorProxyOptions() - { - ActorProxies = new Dictionary(); - } + public AbpDaprActorProxyOptions() + { + ActorProxies = new Dictionary(); } } diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/AbpDaprActorsModule.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/AbpDaprActorsModule.cs index 4750254fd..37ded535c 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/AbpDaprActorsModule.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/AbpDaprActorsModule.cs @@ -2,21 +2,20 @@ using Volo.Abp.Http.Client; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.Dapr.Actors +namespace LINGYUN.Abp.Dapr.Actors; + +[DependsOn( + typeof(AbpHttpClientModule) + )] +public class AbpDaprActorsModule : AbpModule { - [DependsOn( - typeof(AbpHttpClientModule) - )] - public class AbpDaprActorsModule : AbpModule - { - /// - /// 与AbpHttpClient集成,创建一个命名HttpClient - /// - internal const string DaprHttpClient = "_AbpDaprActorsClient"; + /// + /// 与AbpHttpClient集成,创建一个命名HttpClient + /// + internal const string DaprHttpClient = "_AbpDaprActorsClient"; - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddHttpClient(DaprHttpClient); - } + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddHttpClient(DaprHttpClient); } } diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/DynamicProxying/DaprHttpClientHandler.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/DynamicProxying/DaprHttpClientHandler.cs index 69f993eac..33ffa1372 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/DynamicProxying/DaprHttpClientHandler.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/DynamicProxying/DaprHttpClientHandler.cs @@ -4,53 +4,52 @@ using System.Threading; using System.Threading.Tasks; -namespace LINGYUN.Abp.Dapr.Actors.DynamicProxying +namespace LINGYUN.Abp.Dapr.Actors.DynamicProxying; + +public class DaprHttpClientHandler : HttpClientHandler { - public class DaprHttpClientHandler : HttpClientHandler - { - private Func _preConfigureInvoke; - protected Func PreConfigureInvoke => _preConfigureInvoke; + private Func _preConfigureInvoke; + protected Func PreConfigureInvoke => _preConfigureInvoke; - public virtual void PreConfigure(Func config) + public virtual void PreConfigure(Func config) + { + if (_preConfigureInvoke == null) { - if (_preConfigureInvoke == null) - { - _preConfigureInvoke = config; - } - else - { - _preConfigureInvoke += config; - } + _preConfigureInvoke = config; } - - public void AddHeader(string key, string value) + else { - PreConfigure(request => - { - request.Headers.Add(key, value); - - return Task.CompletedTask; - }); + _preConfigureInvoke += config; } + } - public void AcceptLanguage(string value) + public void AddHeader(string key, string value) + { + PreConfigure(request => { - PreConfigure(request => - { - request.Headers.AcceptLanguage.Add(new StringWithQualityHeaderValue(value)); + request.Headers.Add(key, value); - return Task.CompletedTask; - }); - } + return Task.CompletedTask; + }); + } - protected override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) + public void AcceptLanguage(string value) + { + PreConfigure(request => { - if (PreConfigureInvoke != null) - { - await PreConfigureInvoke(request); - } + request.Headers.AcceptLanguage.Add(new StringWithQualityHeaderValue(value)); + + return Task.CompletedTask; + }); + } - return await base.SendAsync(request, cancellationToken); + protected override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) + { + if (PreConfigureInvoke != null) + { + await PreConfigureInvoke(request); } + + return await base.SendAsync(request, cancellationToken); } } diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/DynamicProxying/DynamicDaprActorProxyConfig.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/DynamicProxying/DynamicDaprActorProxyConfig.cs index 7dfb41a90..0df78cf3b 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/DynamicProxying/DynamicDaprActorProxyConfig.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/DynamicProxying/DynamicDaprActorProxyConfig.cs @@ -1,17 +1,16 @@ using System; -namespace LINGYUN.Abp.Dapr.Actors.DynamicProxying +namespace LINGYUN.Abp.Dapr.Actors.DynamicProxying; + +public class DynamicDaprActorProxyConfig { - public class DynamicDaprActorProxyConfig - { - public Type Type { get; } + public Type Type { get; } - public string RemoteServiceName { get; } + public string RemoteServiceName { get; } - public DynamicDaprActorProxyConfig(Type type, string remoteServiceName) - { - Type = type; - RemoteServiceName = remoteServiceName; - } + public DynamicDaprActorProxyConfig(Type type, string remoteServiceName) + { + Type = type; + RemoteServiceName = remoteServiceName; } } diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/DynamicProxying/DynamicDaprActorProxyInterceptor.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/DynamicProxying/DynamicDaprActorProxyInterceptor.cs index fb6022956..06ef73a2a 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/DynamicProxying/DynamicDaprActorProxyInterceptor.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/LINGYUN/Abp/Dapr/Actors/DynamicProxying/DynamicDaprActorProxyInterceptor.cs @@ -20,172 +20,171 @@ using Volo.Abp.MultiTenancy; using Volo.Abp.Threading; -namespace LINGYUN.Abp.Dapr.Actors.DynamicProxying +namespace LINGYUN.Abp.Dapr.Actors.DynamicProxying; + +public class DynamicDaprActorProxyInterceptor : AbpInterceptor, ITransientDependency + where TService: IActor { - public class DynamicDaprActorProxyInterceptor : AbpInterceptor, ITransientDependency - where TService: IActor + protected ICurrentTenant CurrentTenant { get; } + protected AbpSystemTextJsonSerializerOptions JsonSerializerOptions { get; } + protected AbpDaprActorProxyOptions DaprActorProxyOptions { get; } + protected IProxyHttpClientFactory HttpClientFactory { get; } + protected IRemoteServiceHttpClientAuthenticator ClientAuthenticator { get; } + protected IRemoteServiceConfigurationProvider RemoteServiceConfigurationProvider { get; } + public ILogger> Logger { get; set; } + + public DynamicDaprActorProxyInterceptor( + IOptions daprActorProxyOptions, + IOptions jsonSerializerOptions, + IProxyHttpClientFactory httpClientFactory, + IRemoteServiceHttpClientAuthenticator clientAuthenticator, + IRemoteServiceConfigurationProvider remoteServiceConfigurationProvider, + ICurrentTenant currentTenant) { - protected ICurrentTenant CurrentTenant { get; } - protected AbpSystemTextJsonSerializerOptions JsonSerializerOptions { get; } - protected AbpDaprActorProxyOptions DaprActorProxyOptions { get; } - protected IProxyHttpClientFactory HttpClientFactory { get; } - protected IRemoteServiceHttpClientAuthenticator ClientAuthenticator { get; } - protected IRemoteServiceConfigurationProvider RemoteServiceConfigurationProvider { get; } - public ILogger> Logger { get; set; } - - public DynamicDaprActorProxyInterceptor( - IOptions daprActorProxyOptions, - IOptions jsonSerializerOptions, - IProxyHttpClientFactory httpClientFactory, - IRemoteServiceHttpClientAuthenticator clientAuthenticator, - IRemoteServiceConfigurationProvider remoteServiceConfigurationProvider, - ICurrentTenant currentTenant) + CurrentTenant = currentTenant; + HttpClientFactory = httpClientFactory; + ClientAuthenticator = clientAuthenticator; + DaprActorProxyOptions = daprActorProxyOptions.Value; + JsonSerializerOptions = jsonSerializerOptions.Value; + RemoteServiceConfigurationProvider = remoteServiceConfigurationProvider; + + Logger = NullLogger>.Instance; + } + + public override async Task InterceptAsync(IAbpMethodInvocation invocation) + { + var isAsyncMethod = invocation.Method.IsAsync(); + if (!isAsyncMethod) { - CurrentTenant = currentTenant; - HttpClientFactory = httpClientFactory; - ClientAuthenticator = clientAuthenticator; - DaprActorProxyOptions = daprActorProxyOptions.Value; - JsonSerializerOptions = jsonSerializerOptions.Value; - RemoteServiceConfigurationProvider = remoteServiceConfigurationProvider; - - Logger = NullLogger>.Instance; + // see: https://docs.dapr.io/developing-applications/sdks/dotnet/dotnet-actors/dotnet-actors-howto/ + // Dapr Actor文档: Actor方法的返回类型必须为Task或Task + throw new AbpException("The return type of Actor method must be Task or Task"); } + if (invocation.Arguments.Length > 1) + { + // see: https://docs.dapr.io/developing-applications/sdks/dotnet/dotnet-actors/dotnet-actors-howto/ + // Dapr Actor文档: Actor方法最多可以有一个参数 + throw new AbpException("Actor method can have one argument at a maximum"); + } + await MakeRequestAsync(invocation); + } + + private async Task MakeRequestAsync(IAbpMethodInvocation invocation) + { + // 获取Actor配置 + var actorProxyConfig = DaprActorProxyOptions.ActorProxies.GetOrDefault(typeof(TService)) ?? throw new AbpException($"Could not get DynamicDaprActorProxyConfig for {typeof(TService).FullName}."); + var remoteServiceConfig = await RemoteServiceConfigurationProvider.GetConfigurationOrDefaultAsync(actorProxyConfig.RemoteServiceName); - public override async Task InterceptAsync(IAbpMethodInvocation invocation) + // Actors的定义太多, 可以考虑使用默认的 BaseUrl 作为远程地址 + if (remoteServiceConfig.BaseUrl.IsNullOrWhiteSpace()) { - var isAsyncMethod = invocation.Method.IsAsync(); - if (!isAsyncMethod) - { - // see: https://docs.dapr.io/developing-applications/sdks/dotnet/dotnet-actors/dotnet-actors-howto/ - // Dapr Actor文档: Actor方法的返回类型必须为Task或Task - throw new AbpException("The return type of Actor method must be Task or Task"); - } - if (invocation.Arguments.Length > 1) - { - // see: https://docs.dapr.io/developing-applications/sdks/dotnet/dotnet-actors/dotnet-actors-howto/ - // Dapr Actor文档: Actor方法最多可以有一个参数 - throw new AbpException("Actor method can have one argument at a maximum"); - } - await MakeRequestAsync(invocation); + throw new AbpException($"Could not get BaseUrl for {actorProxyConfig.RemoteServiceName} Or Default."); } - private async Task MakeRequestAsync(IAbpMethodInvocation invocation) + var actorProxyOptions = new ActorProxyOptions { - // 获取Actor配置 - var actorProxyConfig = DaprActorProxyOptions.ActorProxies.GetOrDefault(typeof(TService)) ?? throw new AbpException($"Could not get DynamicDaprActorProxyConfig for {typeof(TService).FullName}."); - var remoteServiceConfig = await RemoteServiceConfigurationProvider.GetConfigurationOrDefaultAsync(actorProxyConfig.RemoteServiceName); + HttpEndpoint = remoteServiceConfig.BaseUrl, + RequestTimeout = TimeSpan.FromMilliseconds(remoteServiceConfig.GetRequestTimeOut()), + DaprApiToken = remoteServiceConfig.GetApiToken(), + JsonSerializerOptions = JsonSerializerOptions.JsonSerializerOptions, + }; - // Actors的定义太多, 可以考虑使用默认的 BaseUrl 作为远程地址 - if (remoteServiceConfig.BaseUrl.IsNullOrWhiteSpace()) - { - throw new AbpException($"Could not get BaseUrl for {actorProxyConfig.RemoteServiceName} Or Default."); - } + // 自定义请求处理器 + // 添加请求头用于传递状态 + // TODO: Actor一次只能处理一个请求,使用状态管理来传递状态的可行性? + var httpClientHandler = new DaprHttpClientHandler(); - var actorProxyOptions = new ActorProxyOptions - { - HttpEndpoint = remoteServiceConfig.BaseUrl, - RequestTimeout = TimeSpan.FromMilliseconds(remoteServiceConfig.GetRequestTimeOut()), - DaprApiToken = remoteServiceConfig.GetApiToken(), - JsonSerializerOptions = JsonSerializerOptions.JsonSerializerOptions, - }; + AddHeaders(httpClientHandler); - // 自定义请求处理器 - // 添加请求头用于传递状态 - // TODO: Actor一次只能处理一个请求,使用状态管理来传递状态的可行性? - var httpClientHandler = new DaprHttpClientHandler(); + httpClientHandler.PreConfigure(async (requestMessage) => + { + // 占位 + var httpClient = HttpClientFactory.Create(AbpDaprActorsModule.DaprHttpClient); + + await ClientAuthenticator.Authenticate( + new RemoteServiceHttpClientAuthenticateContext( + httpClient, + requestMessage, + remoteServiceConfig, + actorProxyConfig.RemoteServiceName)); + // 标头 + if (requestMessage.Headers.Authorization == null && + httpClient.DefaultRequestHeaders.Authorization != null) + { + requestMessage.Headers.Authorization = httpClient.DefaultRequestHeaders.Authorization; + } + }); - AddHeaders(httpClientHandler); + // 代理工厂 + var proxyFactory = new ActorProxyFactory(actorProxyOptions, (HttpMessageHandler)httpClientHandler); - httpClientHandler.PreConfigure(async (requestMessage) => - { - // 占位 - var httpClient = HttpClientFactory.Create(AbpDaprActorsModule.DaprHttpClient); - - await ClientAuthenticator.Authenticate( - new RemoteServiceHttpClientAuthenticateContext( - httpClient, - requestMessage, - remoteServiceConfig, - actorProxyConfig.RemoteServiceName)); - // 标头 - if (requestMessage.Headers.Authorization == null && - httpClient.DefaultRequestHeaders.Authorization != null) - { - requestMessage.Headers.Authorization = httpClient.DefaultRequestHeaders.Authorization; - } - }); - - // 代理工厂 - var proxyFactory = new ActorProxyFactory(actorProxyOptions, (HttpMessageHandler)httpClientHandler); - - await MakeRequestAsync(invocation, proxyFactory); - } + await MakeRequestAsync(invocation, proxyFactory); + } - private async Task MakeRequestAsync( - IAbpMethodInvocation invocation, - ActorProxyFactory proxyFactory - ) - { - var invokeType = typeof(TService); + private async Task MakeRequestAsync( + IAbpMethodInvocation invocation, + ActorProxyFactory proxyFactory + ) + { + var invokeType = typeof(TService); - // 约定的 RemoteServiceAttribute 为Actor名称 - var remoteServiceAttr = invokeType.GetTypeInfo().GetCustomAttribute(); - var actorType = remoteServiceAttr != null - ? remoteServiceAttr.Name - : invokeType.Name; + // 约定的 RemoteServiceAttribute 为Actor名称 + var remoteServiceAttr = invokeType.GetTypeInfo().GetCustomAttribute(); + var actorType = remoteServiceAttr != null + ? remoteServiceAttr.Name + : invokeType.Name; - var actorId = new ActorId(invokeType.FullName); + var actorId = new ActorId(invokeType.FullName); - try + try + { + // 创建强类型代理 + var actorProxy = proxyFactory.CreateActorProxy(actorId, actorType); + // 远程调用 + var task = (Task)invocation.Method.Invoke(actorProxy, invocation.Arguments); + await task; + + // 存在返回值 + if (!invocation.Method.ReturnType.GenericTypeArguments.IsNullOrEmpty()) { - // 创建强类型代理 - var actorProxy = proxyFactory.CreateActorProxy(actorId, actorType); - // 远程调用 - var task = (Task)invocation.Method.Invoke(actorProxy, invocation.Arguments); - await task; - - // 存在返回值 - if (!invocation.Method.ReturnType.GenericTypeArguments.IsNullOrEmpty()) - { - // 处理返回值 - invocation.ReturnValue = typeof(Task<>) - .MakeGenericType(invocation.Method.ReturnType.GenericTypeArguments[0]) - .GetProperty(nameof(Task.Result), BindingFlags.Public | BindingFlags.Instance) - .GetValue(task); - } + // 处理返回值 + invocation.ReturnValue = typeof(Task<>) + .MakeGenericType(invocation.Method.ReturnType.GenericTypeArguments[0]) + .GetProperty(nameof(Task.Result), BindingFlags.Public | BindingFlags.Instance) + .GetValue(task); } - catch (ActorMethodInvocationException amie) // 其他异常忽略交给框架处理 + } + catch (ActorMethodInvocationException amie) // 其他异常忽略交给框架处理 + { + if (amie.InnerException != null && amie.InnerException is ActorInvokeException aie) { - if (amie.InnerException != null && amie.InnerException is ActorInvokeException aie) - { - // Dapr 包装了远程服务异常 - throw new AbpDaprActorCallException( - new RemoteServiceErrorInfo - { - Message = aie.Message, - Code = aie.ActualExceptionType - } - ); - } - throw; + // Dapr 包装了远程服务异常 + throw new AbpDaprActorCallException( + new RemoteServiceErrorInfo + { + Message = aie.Message, + Code = aie.ActualExceptionType + } + ); } + throw; } + } - private void AddHeaders(DaprHttpClientHandler handler) + private void AddHeaders(DaprHttpClientHandler handler) + { + //TenantId + if (CurrentTenant.Id.HasValue) { - //TenantId - if (CurrentTenant.Id.HasValue) - { - //TODO: Use AbpAspNetCoreMultiTenancyOptions to get the key - handler.AddHeader(TenantResolverConsts.DefaultTenantKey, CurrentTenant.Id.Value.ToString()); - } - //Culture - //TODO: Is that the way we want? Couldn't send the culture (not ui culture) - var currentCulture = CultureInfo.CurrentUICulture.Name ?? CultureInfo.CurrentCulture.Name; - if (!currentCulture.IsNullOrEmpty()) - { - handler.AcceptLanguage(currentCulture); - } + //TODO: Use AbpAspNetCoreMultiTenancyOptions to get the key + handler.AddHeader(TenantResolverConsts.DefaultTenantKey, CurrentTenant.Id.Value.ToString()); + } + //Culture + //TODO: Is that the way we want? Couldn't send the culture (not ui culture) + var currentCulture = CultureInfo.CurrentUICulture.Name ?? CultureInfo.CurrentCulture.Name; + if (!currentCulture.IsNullOrEmpty()) + { + handler.AcceptLanguage(currentCulture); } } } diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/Microsoft/Extensions/DependencyInjection/ServiceCollectionDynamicDaprActorProxyExtensions.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/Microsoft/Extensions/DependencyInjection/ServiceCollectionDynamicDaprActorProxyExtensions.cs index 85090054c..789277f15 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/Microsoft/Extensions/DependencyInjection/ServiceCollectionDynamicDaprActorProxyExtensions.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Actors/Microsoft/Extensions/DependencyInjection/ServiceCollectionDynamicDaprActorProxyExtensions.cs @@ -11,95 +11,94 @@ using Volo.Abp.Http.Client; using Volo.Abp.Validation; -namespace Microsoft.Extensions.DependencyInjection +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionDynamicDaprActorProxyExtensions { - public static class ServiceCollectionDynamicDaprActorProxyExtensions + private static readonly ProxyGenerator ProxyGeneratorInstance = new ProxyGenerator(); + + public static IServiceCollection AddDaprActorProxies( + [NotNull] this IServiceCollection services, + [NotNull] Assembly assembly, + [NotNull] string remoteServiceConfigurationName = RemoteServiceConfigurationDictionary.DefaultName, + bool asDefaultServices = true) { - private static readonly ProxyGenerator ProxyGeneratorInstance = new ProxyGenerator(); + Check.NotNull(services, nameof(assembly)); + + var serviceTypes = assembly.GetTypes().Where(IsSuitableForDynamicActorProxying).ToArray(); - public static IServiceCollection AddDaprActorProxies( - [NotNull] this IServiceCollection services, - [NotNull] Assembly assembly, - [NotNull] string remoteServiceConfigurationName = RemoteServiceConfigurationDictionary.DefaultName, - bool asDefaultServices = true) + foreach (var serviceType in serviceTypes) { - Check.NotNull(services, nameof(assembly)); + services.AddDaprActorProxy( + serviceType, + remoteServiceConfigurationName, + asDefaultServices + ); + } - var serviceTypes = assembly.GetTypes().Where(IsSuitableForDynamicActorProxying).ToArray(); + return services; + } + + public static IServiceCollection AddDaprActorProxy( + [NotNull] this IServiceCollection services, + [NotNull] string remoteServiceConfigurationName = RemoteServiceConfigurationDictionary.DefaultName, + bool asDefaultService = true) + { + return services.AddDaprActorProxy( + typeof(T), + remoteServiceConfigurationName, + asDefaultService + ); + } - foreach (var serviceType in serviceTypes) - { - services.AddDaprActorProxy( - serviceType, - remoteServiceConfigurationName, - asDefaultServices - ); - } + public static IServiceCollection AddDaprActorProxy( + [NotNull] this IServiceCollection services, + [NotNull] Type type, + [NotNull] string remoteServiceConfigurationName = RemoteServiceConfigurationDictionary.DefaultName, + bool asDefaultService = true) + { + Check.NotNull(services, nameof(services)); + Check.NotNull(type, nameof(type)); + Check.NotNullOrWhiteSpace(remoteServiceConfigurationName, nameof(remoteServiceConfigurationName)); - return services; - } + // AddHttpClientFactory(services, remoteServiceConfigurationName); - public static IServiceCollection AddDaprActorProxy( - [NotNull] this IServiceCollection services, - [NotNull] string remoteServiceConfigurationName = RemoteServiceConfigurationDictionary.DefaultName, - bool asDefaultService = true) + services.Configure(options => { - return services.AddDaprActorProxy( - typeof(T), - remoteServiceConfigurationName, - asDefaultService - ); - } + options.ActorProxies[type] = new DynamicDaprActorProxyConfig(type, remoteServiceConfigurationName); + }); + + var interceptorType = typeof(DynamicDaprActorProxyInterceptor<>).MakeGenericType(type); + services.AddTransient(interceptorType); + + var interceptorAdapterType = typeof(AbpAsyncDeterminationInterceptor<>).MakeGenericType(interceptorType); + + var validationInterceptorAdapterType = + typeof(AbpAsyncDeterminationInterceptor<>).MakeGenericType(typeof(ValidationInterceptor)); - public static IServiceCollection AddDaprActorProxy( - [NotNull] this IServiceCollection services, - [NotNull] Type type, - [NotNull] string remoteServiceConfigurationName = RemoteServiceConfigurationDictionary.DefaultName, - bool asDefaultService = true) + if (asDefaultService) { - Check.NotNull(services, nameof(services)); - Check.NotNull(type, nameof(type)); - Check.NotNullOrWhiteSpace(remoteServiceConfigurationName, nameof(remoteServiceConfigurationName)); - - // AddHttpClientFactory(services, remoteServiceConfigurationName); - - services.Configure(options => - { - options.ActorProxies[type] = new DynamicDaprActorProxyConfig(type, remoteServiceConfigurationName); - }); - - var interceptorType = typeof(DynamicDaprActorProxyInterceptor<>).MakeGenericType(type); - services.AddTransient(interceptorType); - - var interceptorAdapterType = typeof(AbpAsyncDeterminationInterceptor<>).MakeGenericType(interceptorType); - - var validationInterceptorAdapterType = - typeof(AbpAsyncDeterminationInterceptor<>).MakeGenericType(typeof(ValidationInterceptor)); - - if (asDefaultService) - { - services.AddTransient( - type, - serviceProvider => ProxyGeneratorInstance - .CreateInterfaceProxyWithoutTarget( - type, - (IInterceptor)serviceProvider.GetRequiredService(validationInterceptorAdapterType), - (IInterceptor)serviceProvider.GetRequiredService(interceptorAdapterType) - ) - ); - } - - return services; + services.AddTransient( + type, + serviceProvider => ProxyGeneratorInstance + .CreateInterfaceProxyWithoutTarget( + type, + (IInterceptor)serviceProvider.GetRequiredService(validationInterceptorAdapterType), + (IInterceptor)serviceProvider.GetRequiredService(interceptorAdapterType) + ) + ); } - private static bool IsSuitableForDynamicActorProxying(Type type) - { - //TODO: Add option to change type filter + return services; + } - return type.IsInterface - && type.IsPublic - && !type.IsGenericType - && typeof(IActor).IsAssignableFrom(type); - } + private static bool IsSuitableForDynamicActorProxying(Type type) + { + //TODO: Add option to change type filter + + return type.IsInterface + && type.IsPublic + && !type.IsGenericType + && typeof(IActor).IsAssignableFrom(type); } } diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client.Wrapper/LINGYUN.Abp.Dapr.Client.Wrapper.csproj b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client.Wrapper/LINGYUN.Abp.Dapr.Client.Wrapper.csproj index c5dc53099..b629ef740 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client.Wrapper/LINGYUN.Abp.Dapr.Client.Wrapper.csproj +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client.Wrapper/LINGYUN.Abp.Dapr.Client.Wrapper.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.Dapr.Client.Wrapper + LINGYUN.Abp.Dapr.Client.Wrapper + false + false + false diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client.Wrapper/LINGYUN/Abp/Dapr/Client/Wrapper/AbpDaprClientWrapperModule.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client.Wrapper/LINGYUN/Abp/Dapr/Client/Wrapper/AbpDaprClientWrapperModule.cs index 7495caace..4db480468 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client.Wrapper/LINGYUN/Abp/Dapr/Client/Wrapper/AbpDaprClientWrapperModule.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client.Wrapper/LINGYUN/Abp/Dapr/Client/Wrapper/AbpDaprClientWrapperModule.cs @@ -7,84 +7,83 @@ using Microsoft.Extensions.DependencyInjection; using LINGYUN.Abp.Dapr.Client.ClientProxying; -namespace LINGYUN.Abp.Dapr.Client.Wrapper +namespace LINGYUN.Abp.Dapr.Client.Wrapper; + +[DependsOn(typeof(AbpDaprClientModule))] +[DependsOn(typeof(AbpWrapperModule))] +public class AbpDaprClientWrapperModule : AbpModule { - [DependsOn(typeof(AbpDaprClientModule))] - [DependsOn(typeof(AbpWrapperModule))] - public class AbpDaprClientWrapperModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + var wrapperOptions = context.Services.ExecutePreConfiguredActions(); + + Configure(options => { - var wrapperOptions = context.Services.ExecutePreConfiguredActions(); + options.ProxyRequestActions.Add( + (_, request) => + { + var wrapperHeader = wrapperOptions.IsEnabled + ? AbpHttpWrapConsts.AbpWrapResult + : AbpHttpWrapConsts.AbpDontWrapResult; - Configure(options => - { - options.ProxyRequestActions.Add( - (_, request) => - { - var wrapperHeader = wrapperOptions.IsEnabled - ? AbpHttpWrapConsts.AbpWrapResult - : AbpHttpWrapConsts.AbpDontWrapResult; + request.Headers.TryAddWithoutValidation(wrapperHeader, "true"); + }); - request.Headers.TryAddWithoutValidation(wrapperHeader, "true"); - }); + options.OnResponse(async (response, serviceProvider) => + { + var stringContent = await response.Content.ReadAsStringAsync(); - options.OnResponse(async (response, serviceProvider) => + // 包装后的响应结果需要处理 + if (response.Headers.Contains(AbpHttpWrapConsts.AbpWrapResult)) { - var stringContent = await response.Content.ReadAsStringAsync(); + var jsonSerializer = serviceProvider.LazyGetRequiredService(); + var wrapperOptions = serviceProvider.LazyGetRequiredService>().Value; + var wrapResult = jsonSerializer.Deserialize(stringContent); - // 包装后的响应结果需要处理 - if (response.Headers.Contains(AbpHttpWrapConsts.AbpWrapResult)) + if (!string.Equals(wrapResult.Code, wrapperOptions.CodeWithSuccess)) { - var jsonSerializer = serviceProvider.LazyGetRequiredService(); - var wrapperOptions = serviceProvider.LazyGetRequiredService>().Value; - var wrapResult = jsonSerializer.Deserialize(stringContent); + var errorInfo = new RemoteServiceErrorInfo( + wrapResult.Message, + wrapResult.Details, + wrapResult.Code); - if (!string.Equals(wrapResult.Code, wrapperOptions.CodeWithSuccess)) + throw new AbpRemoteCallException(errorInfo) { - var errorInfo = new RemoteServiceErrorInfo( - wrapResult.Message, - wrapResult.Details, - wrapResult.Code); - - throw new AbpRemoteCallException(errorInfo) - { - HttpStatusCode = (int)wrapperOptions.HttpStatusCode - }; - } - - return jsonSerializer.Serialize(wrapResult.Result); + HttpStatusCode = (int)wrapperOptions.HttpStatusCode + }; } - return stringContent; - }); - options.OnError(async (response, serviceProvider) => + return jsonSerializer.Serialize(wrapResult.Result); + } + + return stringContent; + }); + options.OnError(async (response, serviceProvider) => + { + if (response.Headers.Contains(AbpHttpWrapConsts.AbpWrapResult)) { - if (response.Headers.Contains(AbpHttpWrapConsts.AbpWrapResult)) + try { - try - { - var jsonSerializer = serviceProvider.LazyGetRequiredService(); - var result = jsonSerializer.Deserialize( - await response.Content.ReadAsStringAsync()); + var jsonSerializer = serviceProvider.LazyGetRequiredService(); + var result = jsonSerializer.Deserialize( + await response.Content.ReadAsStringAsync()); - return new RemoteServiceErrorInfo( - result.Message, - result.Details, - result.Code); - } - catch + return new RemoteServiceErrorInfo( + result.Message, + result.Details, + result.Code); + } + catch + { + return new RemoteServiceErrorInfo { - return new RemoteServiceErrorInfo - { - Message = response.ReasonPhrase, - Code = response.StatusCode.ToString() - }; - } + Message = response.ReasonPhrase, + Code = response.StatusCode.ToString() + }; } - return null; - }); + } + return null; }); - } + }); } } diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN.Abp.Dapr.Client.csproj b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN.Abp.Dapr.Client.csproj index cb37cce1a..0d5c00033 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN.Abp.Dapr.Client.csproj +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN.Abp.Dapr.Client.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.Dapr.Client + LINGYUN.Abp.Dapr.Client + false + false + false diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/AbpDaprClientBuilderOptions.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/AbpDaprClientBuilderOptions.cs index 4a02e419f..6407b6482 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/AbpDaprClientBuilderOptions.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/AbpDaprClientBuilderOptions.cs @@ -2,21 +2,20 @@ using System; using System.Collections.Generic; -namespace LINGYUN.Abp.Dapr.Client +namespace LINGYUN.Abp.Dapr.Client; + +public class AbpDaprClientBuilderOptions { - public class AbpDaprClientBuilderOptions - { - public List> ProxyClientActions { get; } + public List> ProxyClientActions { get; } - public List> ProxyClientBuildActions { get; } + public List> ProxyClientBuildActions { get; } - internal HashSet ConfiguredProxyClients { get; } + internal HashSet ConfiguredProxyClients { get; } - public AbpDaprClientBuilderOptions() - { - ConfiguredProxyClients = new HashSet(); - ProxyClientActions = new List>(); - ProxyClientBuildActions = new List>(); - } + public AbpDaprClientBuilderOptions() + { + ConfiguredProxyClients = new HashSet(); + ProxyClientActions = new List>(); + ProxyClientBuildActions = new List>(); } } diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/AbpDaprClientModule.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/AbpDaprClientModule.cs index d1b4bac34..a254f932d 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/AbpDaprClientModule.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/AbpDaprClientModule.cs @@ -3,23 +3,22 @@ using Volo.Abp.Http.Client; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.Dapr.Client +namespace LINGYUN.Abp.Dapr.Client; + +[DependsOn( + typeof(AbpHttpClientModule) + )] +public class AbpDaprClientModule : AbpModule { - [DependsOn( - typeof(AbpHttpClientModule) - )] - public class AbpDaprClientModule : AbpModule - { - /// - /// 与AbpHttpClient集成,创建一个命名HttpClient - /// - internal const string DaprHttpClient = "_AbpDaprProxyClient"; + /// + /// 与AbpHttpClient集成,创建一个命名HttpClient + /// + internal const string DaprHttpClient = "_AbpDaprProxyClient"; - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddHttpClient(DaprHttpClient); + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddHttpClient(DaprHttpClient); - context.Services.AddTransient(typeof(DynamicDaprProxyInterceptorClientProxy<>)); - } + context.Services.AddTransient(typeof(DynamicDaprProxyInterceptorClientProxy<>)); } } diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/ClientProxying/AbpDaprClientProxyOptions.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/ClientProxying/AbpDaprClientProxyOptions.cs index 0605deab0..e1467f68a 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/ClientProxying/AbpDaprClientProxyOptions.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/ClientProxying/AbpDaprClientProxyOptions.cs @@ -6,50 +6,49 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.Http; -namespace LINGYUN.Abp.Dapr.Client.ClientProxying +namespace LINGYUN.Abp.Dapr.Client.ClientProxying; + +public class AbpDaprClientProxyOptions { - public class AbpDaprClientProxyOptions + public Dictionary DaprClientProxies { get; set; } + /// + /// 增加一个可配置的请求消息 + /// 参数一: appId + /// 参数二: HttpRequestMessage + /// + public List> ProxyRequestActions { get; } + /// + /// 对响应进行处理,返回响应内容 + /// + public Func> ProxyResponseContent { get; private set; } + /// + /// 格式化错误 + /// + public Func> ProxyErrorFormat { get; private set; } + public AbpDaprClientProxyOptions() { - public Dictionary DaprClientProxies { get; set; } - /// - /// 增加一个可配置的请求消息 - /// 参数一: appId - /// 参数二: HttpRequestMessage - /// - public List> ProxyRequestActions { get; } - /// - /// 对响应进行处理,返回响应内容 - /// - public Func> ProxyResponseContent { get; private set; } - /// - /// 格式化错误 - /// - public Func> ProxyErrorFormat { get; private set; } - public AbpDaprClientProxyOptions() - { - DaprClientProxies = new Dictionary(); - ProxyRequestActions = new List>(); + DaprClientProxies = new Dictionary(); + ProxyRequestActions = new List>(); - OnResponse(async (response, serviceProvider) => - { - return await response.Content.ReadAsStringAsync(); - }); - } - /// - /// 处理服务间调用响应数据 - /// - /// - public void OnResponse(Func> func) + OnResponse(async (response, serviceProvider) => { - ProxyResponseContent = func; - } - /// - /// 处理服务间调用错误消息 - /// - /// - public void OnError(Func> func) - { - ProxyErrorFormat = func; - } + return await response.Content.ReadAsStringAsync(); + }); + } + /// + /// 处理服务间调用响应数据 + /// + /// + public void OnResponse(Func> func) + { + ProxyResponseContent = func; + } + /// + /// 处理服务间调用错误消息 + /// + /// + public void OnError(Func> func) + { + ProxyErrorFormat = func; } } diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/ClientProxying/DaprClientProxyBase.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/ClientProxying/DaprClientProxyBase.cs index 492831fda..40d5e28b5 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/ClientProxying/DaprClientProxyBase.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/ClientProxying/DaprClientProxyBase.cs @@ -11,127 +11,126 @@ using Volo.Abp.Http.Client.Authentication; using Volo.Abp.Http.Client.ClientProxying; -namespace LINGYUN.Abp.Dapr.Client.ClientProxying -{ - public abstract class DaprClientProxyBase : ClientProxyBase - { - protected IOptions DaprClientProxyOptions => LazyServiceProvider.LazyGetRequiredService>(); - protected IDaprClientFactory DaprClientFactory => LazyServiceProvider.LazyGetRequiredService(); +namespace LINGYUN.Abp.Dapr.Client.ClientProxying; - protected async override Task RequestAsync(ClientProxyRequestContext requestContext) - { - var response = await MakeRequestAsync(requestContext); - - var responseContent = response.Content; +public abstract class DaprClientProxyBase : ClientProxyBase +{ + protected IOptions DaprClientProxyOptions => LazyServiceProvider.LazyGetRequiredService>(); + protected IDaprClientFactory DaprClientFactory => LazyServiceProvider.LazyGetRequiredService(); - if (typeof(T) == typeof(IRemoteStreamContent) || - typeof(T) == typeof(RemoteStreamContent)) - { - /* returning a class that holds a reference to response - * content just to be sure that GC does not dispose of - * it before we finish doing our work with the stream */ - return (T)(object)new RemoteStreamContent( - await responseContent.ReadAsStreamAsync(), - responseContent.Headers?.ContentDisposition?.FileNameStar ?? - RemoveQuotes(responseContent.Headers?.ContentDisposition?.FileName).ToString(), - responseContent.Headers?.ContentType?.ToString(), - responseContent.Headers?.ContentLength); - } + protected async override Task RequestAsync(ClientProxyRequestContext requestContext) + { + var response = await MakeRequestAsync(requestContext); - var stringContent = await DaprClientProxyOptions - .Value - .ProxyResponseContent(response, LazyServiceProvider); + var responseContent = response.Content; - if (stringContent.IsNullOrWhiteSpace()) - { - return default; - } + if (typeof(T) == typeof(IRemoteStreamContent) || + typeof(T) == typeof(RemoteStreamContent)) + { + /* returning a class that holds a reference to response + * content just to be sure that GC does not dispose of + * it before we finish doing our work with the stream */ + return (T)(object)new RemoteStreamContent( + await responseContent.ReadAsStreamAsync(), + responseContent.Headers?.ContentDisposition?.FileNameStar ?? + RemoveQuotes(responseContent.Headers?.ContentDisposition?.FileName).ToString(), + responseContent.Headers?.ContentType?.ToString(), + responseContent.Headers?.ContentLength); + } - if (typeof(T) == typeof(string)) - { - return (T)(object)stringContent; - } + var stringContent = await DaprClientProxyOptions + .Value + .ProxyResponseContent(response, LazyServiceProvider); - return JsonSerializer.Deserialize(stringContent); + if (stringContent.IsNullOrWhiteSpace()) + { + return default; } - protected async override Task GetConfiguredApiVersionAsync(ClientProxyRequestContext requestContext) + if (typeof(T) == typeof(string)) { - var clientConfig = DaprClientProxyOptions.Value.DaprClientProxies.GetOrDefault(requestContext.ServiceType) - ?? throw new AbpException($"Could not get DynamicDaprClientProxyConfig for {requestContext.ServiceType.FullName}."); - var remoteServiceConfig = await RemoteServiceConfigurationProvider.GetConfigurationOrDefaultAsync(clientConfig.RemoteServiceName); - - return remoteServiceConfig?.Version; + return (T)(object)stringContent; } - private async Task MakeRequestAsync(ClientProxyRequestContext requestContext) + return JsonSerializer.Deserialize(stringContent); + } + + protected async override Task GetConfiguredApiVersionAsync(ClientProxyRequestContext requestContext) + { + var clientConfig = DaprClientProxyOptions.Value.DaprClientProxies.GetOrDefault(requestContext.ServiceType) + ?? throw new AbpException($"Could not get DynamicDaprClientProxyConfig for {requestContext.ServiceType.FullName}."); + var remoteServiceConfig = await RemoteServiceConfigurationProvider.GetConfigurationOrDefaultAsync(clientConfig.RemoteServiceName); + + return remoteServiceConfig?.Version; + } + + private async Task MakeRequestAsync(ClientProxyRequestContext requestContext) + { + var clientConfig = DaprClientProxyOptions.Value.DaprClientProxies.GetOrDefault(requestContext.ServiceType) ?? throw new AbpException($"Could not get DaprClientProxyConfig for {requestContext.ServiceType.FullName}."); + var remoteServiceConfig = await RemoteServiceConfigurationProvider.GetConfigurationOrDefaultAsync(clientConfig.RemoteServiceName); + + var appId = remoteServiceConfig.GetAppId(); + var apiVersion = await GetApiVersionInfoAsync(requestContext); + var methodName = await GetUrlWithParametersAsync(requestContext, apiVersion); + // See: https://docs.dapr.io/reference/api/service_invocation_api/#examples + var daprClient = DaprClientFactory.CreateClient(clientConfig.RemoteServiceName); + var requestMessage = daprClient.CreateInvokeMethodRequest( + requestContext.Action.GetHttpMethod(), + appId, + methodName); + requestMessage.Content = await ClientProxyRequestPayloadBuilder.BuildContentAsync( + requestContext.Action, + requestContext.Arguments, + JsonSerializer, + apiVersion); + + AddHeaders(requestContext.Arguments, requestContext.Action, requestMessage, apiVersion); + + if (requestContext.Action.AllowAnonymous != true) { - var clientConfig = DaprClientProxyOptions.Value.DaprClientProxies.GetOrDefault(requestContext.ServiceType) ?? throw new AbpException($"Could not get DaprClientProxyConfig for {requestContext.ServiceType.FullName}."); - var remoteServiceConfig = await RemoteServiceConfigurationProvider.GetConfigurationOrDefaultAsync(clientConfig.RemoteServiceName); - - var appId = remoteServiceConfig.GetAppId(); - var apiVersion = await GetApiVersionInfoAsync(requestContext); - var methodName = await GetUrlWithParametersAsync(requestContext, apiVersion); - // See: https://docs.dapr.io/reference/api/service_invocation_api/#examples - var daprClient = DaprClientFactory.CreateClient(clientConfig.RemoteServiceName); - var requestMessage = daprClient.CreateInvokeMethodRequest( - requestContext.Action.GetHttpMethod(), - appId, - methodName); - requestMessage.Content = await ClientProxyRequestPayloadBuilder.BuildContentAsync( - requestContext.Action, - requestContext.Arguments, - JsonSerializer, - apiVersion); - - AddHeaders(requestContext.Arguments, requestContext.Action, requestMessage, apiVersion); - - if (requestContext.Action.AllowAnonymous != true) + var httpClient = HttpClientFactory.Create(AbpDaprClientModule.DaprHttpClient); + + await ClientAuthenticator.Authenticate( + new RemoteServiceHttpClientAuthenticateContext( + httpClient, + requestMessage, + remoteServiceConfig, + clientConfig.RemoteServiceName + ) + ); + + // 其他库可能将授权标头写入到HttpClient中 + if (requestMessage.Headers.Authorization == null && + httpClient.DefaultRequestHeaders.Authorization != null) { - var httpClient = HttpClientFactory.Create(AbpDaprClientModule.DaprHttpClient); - - await ClientAuthenticator.Authenticate( - new RemoteServiceHttpClientAuthenticateContext( - httpClient, - requestMessage, - remoteServiceConfig, - clientConfig.RemoteServiceName - ) - ); - - // 其他库可能将授权标头写入到HttpClient中 - if (requestMessage.Headers.Authorization == null && - httpClient.DefaultRequestHeaders.Authorization != null) - { - requestMessage.Headers.Authorization = httpClient.DefaultRequestHeaders.Authorization; - } + requestMessage.Headers.Authorization = httpClient.DefaultRequestHeaders.Authorization; } + } - // 增加一个可配置的请求消息 - foreach (var clientRequestAction in DaprClientProxyOptions.Value.ProxyRequestActions) - { - clientRequestAction(appId, requestMessage); - } + // 增加一个可配置的请求消息 + foreach (var clientRequestAction in DaprClientProxyOptions.Value.ProxyRequestActions) + { + clientRequestAction(appId, requestMessage); + } - var response = await daprClient.InvokeMethodWithResponseAsync(requestMessage, GetCancellationToken(requestContext.Arguments)); + var response = await daprClient.InvokeMethodWithResponseAsync(requestMessage, GetCancellationToken(requestContext.Arguments)); - if (!response.IsSuccessStatusCode) + if (!response.IsSuccessStatusCode) + { + if (DaprClientProxyOptions.Value.ProxyErrorFormat != null) { - if (DaprClientProxyOptions.Value.ProxyErrorFormat != null) + var errorInfo = await DaprClientProxyOptions.Value.ProxyErrorFormat(response, LazyServiceProvider); + if (errorInfo != null) { - var errorInfo = await DaprClientProxyOptions.Value.ProxyErrorFormat(response, LazyServiceProvider); - if (errorInfo != null) + throw new AbpRemoteCallException(errorInfo) { - throw new AbpRemoteCallException(errorInfo) - { - HttpStatusCode = (int)response.StatusCode - }; - } + HttpStatusCode = (int)response.StatusCode + }; } - await ThrowExceptionForResponseAsync(response); } - - return response; + await ThrowExceptionForResponseAsync(response); } + + return response; } } diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/DaprApiDescriptionFinder.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/DaprApiDescriptionFinder.cs index 18dfa87b3..e970d2027 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/DaprApiDescriptionFinder.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/DaprApiDescriptionFinder.cs @@ -18,137 +18,136 @@ using Volo.Abp.Threading; using Volo.Abp.Tracing; -namespace LINGYUN.Abp.Dapr.Client.DynamicProxying +namespace LINGYUN.Abp.Dapr.Client.DynamicProxying; + +public class DaprApiDescriptionFinder : IDaprApiDescriptionFinder, ITransientDependency { - public class DaprApiDescriptionFinder : IDaprApiDescriptionFinder, ITransientDependency + public static JsonSerializerOptions DeserializeOptions = new JsonSerializerOptions { - public static JsonSerializerOptions DeserializeOptions = new JsonSerializerOptions - { - PropertyNamingPolicy = JsonNamingPolicy.CamelCase - }; - - public ICancellationTokenProvider CancellationTokenProvider { get; set; } - protected IApiDescriptionCache Cache { get; } - protected AbpCorrelationIdOptions AbpCorrelationIdOptions { get; } - protected ICorrelationIdProvider CorrelationIdProvider { get; } - protected ICurrentTenant CurrentTenant { get; } - - protected IDaprClientFactory DaprClientFactory { get; } - public DaprApiDescriptionFinder( - IDaprClientFactory daprClientFactory, - IApiDescriptionCache cache, - IOptions abpCorrelationIdOptions, - ICorrelationIdProvider correlationIdProvider, - ICurrentTenant currentTenant) - { - DaprClientFactory = daprClientFactory; + PropertyNamingPolicy = JsonNamingPolicy.CamelCase + }; + + public ICancellationTokenProvider CancellationTokenProvider { get; set; } + protected IApiDescriptionCache Cache { get; } + protected AbpCorrelationIdOptions AbpCorrelationIdOptions { get; } + protected ICorrelationIdProvider CorrelationIdProvider { get; } + protected ICurrentTenant CurrentTenant { get; } + + protected IDaprClientFactory DaprClientFactory { get; } + public DaprApiDescriptionFinder( + IDaprClientFactory daprClientFactory, + IApiDescriptionCache cache, + IOptions abpCorrelationIdOptions, + ICorrelationIdProvider correlationIdProvider, + ICurrentTenant currentTenant) + { + DaprClientFactory = daprClientFactory; - Cache = cache; - AbpCorrelationIdOptions = abpCorrelationIdOptions.Value; - CorrelationIdProvider = correlationIdProvider; - CurrentTenant = currentTenant; - CancellationTokenProvider = NullCancellationTokenProvider.Instance; - } + Cache = cache; + AbpCorrelationIdOptions = abpCorrelationIdOptions.Value; + CorrelationIdProvider = correlationIdProvider; + CurrentTenant = currentTenant; + CancellationTokenProvider = NullCancellationTokenProvider.Instance; + } - public async virtual Task FindActionAsync(string service, string appId, Type serviceType, MethodInfo method) - { - var apiDescription = await GetApiDescriptionAsync(service, appId); + public async virtual Task FindActionAsync(string service, string appId, Type serviceType, MethodInfo method) + { + var apiDescription = await GetApiDescriptionAsync(service, appId); - //TODO: Cache finding? + //TODO: Cache finding? - var methodParameters = method.GetParameters().ToArray(); + var methodParameters = method.GetParameters().ToArray(); - foreach (var module in apiDescription.Modules.Values) + foreach (var module in apiDescription.Modules.Values) + { + foreach (var controller in module.Controllers.Values) { - foreach (var controller in module.Controllers.Values) + if (!controller.Implements(serviceType)) { - if (!controller.Implements(serviceType)) - { - continue; - } + continue; + } - foreach (var action in controller.Actions.Values) + foreach (var action in controller.Actions.Values) + { + if (action.Name == method.Name && action.ParametersOnMethod.Count == methodParameters.Length) { - if (action.Name == method.Name && action.ParametersOnMethod.Count == methodParameters.Length) - { - var found = true; + var found = true; - for (int i = 0; i < methodParameters.Length; i++) + for (int i = 0; i < methodParameters.Length; i++) + { + if (!TypeMatches(action.ParametersOnMethod[i], methodParameters[i])) { - if (!TypeMatches(action.ParametersOnMethod[i], methodParameters[i])) - { - found = false; - break; - } + found = false; + break; } + } - if (found) - { - return action; - } + if (found) + { + return action; } } } } - - throw new AbpException($"Could not found remote action for method: {method} on the appId: {appId}"); - } - - public async virtual Task GetApiDescriptionAsync(string service, string appId) - { - return await Cache.GetAsync(appId, () => GetApiDescriptionFromServerAsync(service, appId)); } - protected async virtual Task GetApiDescriptionFromServerAsync(string service, string appId) - { - var client = DaprClientFactory.CreateClient(service); - var requestMessage = client.CreateInvokeMethodRequest(HttpMethod.Get, appId, "api/abp/api-definition"); - - AddHeaders(requestMessage); + throw new AbpException($"Could not found remote action for method: {method} on the appId: {appId}"); + } - var response = await client.InvokeMethodWithResponseAsync( - requestMessage, - CancellationTokenProvider.Token); + public async virtual Task GetApiDescriptionAsync(string service, string appId) + { + return await Cache.GetAsync(appId, () => GetApiDescriptionFromServerAsync(service, appId)); + } - if (!response.IsSuccessStatusCode) - { - throw new AbpException("Remote service returns error! StatusCode = " + response.StatusCode); - } + protected async virtual Task GetApiDescriptionFromServerAsync(string service, string appId) + { + var client = DaprClientFactory.CreateClient(service); + var requestMessage = client.CreateInvokeMethodRequest(HttpMethod.Get, appId, "api/abp/api-definition"); - var content = await response.Content.ReadAsStringAsync(); + AddHeaders(requestMessage); - var result = JsonSerializer.Deserialize(content, DeserializeOptions); + var response = await client.InvokeMethodWithResponseAsync( + requestMessage, + CancellationTokenProvider.Token); - return result; + if (!response.IsSuccessStatusCode) + { + throw new AbpException("Remote service returns error! StatusCode = " + response.StatusCode); } - protected virtual void AddHeaders(HttpRequestMessage requestMessage) - { - //CorrelationId - requestMessage.Headers.Add(AbpCorrelationIdOptions.HttpHeaderName, CorrelationIdProvider.Get()); + var content = await response.Content.ReadAsStringAsync(); - //TenantId - if (CurrentTenant.Id.HasValue) - { - //TODO: Use AbpAspNetCoreMultiTenancyOptions to get the key - requestMessage.Headers.Add(TenantResolverConsts.DefaultTenantKey, CurrentTenant.Id.Value.ToString()); - } + var result = JsonSerializer.Deserialize(content, DeserializeOptions); - //Culture - //TODO: Is that the way we want? Couldn't send the culture (not ui culture) - var currentCulture = CultureInfo.CurrentUICulture.Name ?? CultureInfo.CurrentCulture.Name; - if (!currentCulture.IsNullOrEmpty()) - { - requestMessage.Headers.AcceptLanguage.Add(new StringWithQualityHeaderValue(currentCulture)); - } + return result; + } + + protected virtual void AddHeaders(HttpRequestMessage requestMessage) + { + //CorrelationId + requestMessage.Headers.Add(AbpCorrelationIdOptions.HttpHeaderName, CorrelationIdProvider.Get()); - //X-Requested-With - requestMessage.Headers.Add("X-Requested-With", "XMLHttpRequest"); + //TenantId + if (CurrentTenant.Id.HasValue) + { + //TODO: Use AbpAspNetCoreMultiTenancyOptions to get the key + requestMessage.Headers.Add(TenantResolverConsts.DefaultTenantKey, CurrentTenant.Id.Value.ToString()); } - protected virtual bool TypeMatches(MethodParameterApiDescriptionModel actionParameter, ParameterInfo methodParameter) + //Culture + //TODO: Is that the way we want? Couldn't send the culture (not ui culture) + var currentCulture = CultureInfo.CurrentUICulture.Name ?? CultureInfo.CurrentCulture.Name; + if (!currentCulture.IsNullOrEmpty()) { - return actionParameter.Type.ToUpper() == TypeHelper.GetFullNameHandlingNullableAndGenerics(methodParameter.ParameterType).ToUpper(); + requestMessage.Headers.AcceptLanguage.Add(new StringWithQualityHeaderValue(currentCulture)); } + + //X-Requested-With + requestMessage.Headers.Add("X-Requested-With", "XMLHttpRequest"); + } + + protected virtual bool TypeMatches(MethodParameterApiDescriptionModel actionParameter, ParameterInfo methodParameter) + { + return actionParameter.Type.ToUpper() == TypeHelper.GetFullNameHandlingNullableAndGenerics(methodParameter.ParameterType).ToUpper(); } } diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/DaprClientProxy.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/DaprClientProxy.cs index 23a380bfb..4de4294d3 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/DaprClientProxy.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/DaprClientProxy.cs @@ -1,12 +1,11 @@ -namespace LINGYUN.Abp.Dapr.Client.DynamicProxying +namespace LINGYUN.Abp.Dapr.Client.DynamicProxying; + +public class DaprClientProxy : IDaprClientProxy { - public class DaprClientProxy : IDaprClientProxy - { - public TRemoteService Service { get; } + public TRemoteService Service { get; } - public DaprClientProxy(TRemoteService service) - { - Service = service; - } + public DaprClientProxy(TRemoteService service) + { + Service = service; } } diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/DynamicDaprClientProxyConfig.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/DynamicDaprClientProxyConfig.cs index f90cae728..e6c26418e 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/DynamicDaprClientProxyConfig.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/DynamicDaprClientProxyConfig.cs @@ -1,17 +1,16 @@ using System; -namespace LINGYUN.Abp.Dapr.Client.DynamicProxying +namespace LINGYUN.Abp.Dapr.Client.DynamicProxying; + +public class DynamicDaprClientProxyConfig { - public class DynamicDaprClientProxyConfig - { - public Type Type { get; } + public Type Type { get; } - public string RemoteServiceName { get; } + public string RemoteServiceName { get; } - public DynamicDaprClientProxyConfig(Type type, string remoteServiceName) - { - Type = type; - RemoteServiceName = remoteServiceName; - } + public DynamicDaprClientProxyConfig(Type type, string remoteServiceName) + { + Type = type; + RemoteServiceName = remoteServiceName; } } diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/DynamicDaprClientProxyInterceptor.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/DynamicDaprClientProxyInterceptor.cs index 6eb13cf15..900d01044 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/DynamicDaprClientProxyInterceptor.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/DynamicDaprClientProxyInterceptor.cs @@ -14,89 +14,88 @@ using Volo.Abp.Http.Client.ClientProxying; using Volo.Abp.Http.Modeling; -namespace LINGYUN.Abp.Dapr.Client.DynamicProxying +namespace LINGYUN.Abp.Dapr.Client.DynamicProxying; + +public class DynamicDaprClientProxyInterceptor : AbpInterceptor, ITransientDependency { - public class DynamicDaprClientProxyInterceptor : AbpInterceptor, ITransientDependency + // ReSharper disable once StaticMemberInGenericType + protected static MethodInfo CallRequestAsyncMethod { get; } + + static DynamicDaprClientProxyInterceptor() { - // ReSharper disable once StaticMemberInGenericType - protected static MethodInfo CallRequestAsyncMethod { get; } + CallRequestAsyncMethod = typeof(DynamicDaprClientProxyInterceptor) + .GetMethods(BindingFlags.NonPublic | BindingFlags.Instance) + .First(m => m.Name == nameof(CallRequestAsync) && m.IsGenericMethodDefinition); + } - static DynamicDaprClientProxyInterceptor() - { - CallRequestAsyncMethod = typeof(DynamicDaprClientProxyInterceptor) - .GetMethods(BindingFlags.NonPublic | BindingFlags.Instance) - .First(m => m.Name == nameof(CallRequestAsync) && m.IsGenericMethodDefinition); - } + public ILogger> Logger { get; set; } + protected DynamicDaprProxyInterceptorClientProxy InterceptorClientProxy { get; } + protected AbpDaprClientProxyOptions ClientProxyOptions { get; } + protected IRemoteServiceConfigurationProvider RemoteServiceConfigurationProvider { get; } + protected IDaprApiDescriptionFinder ApiDescriptionFinder { get; } - public ILogger> Logger { get; set; } - protected DynamicDaprProxyInterceptorClientProxy InterceptorClientProxy { get; } - protected AbpDaprClientProxyOptions ClientProxyOptions { get; } - protected IRemoteServiceConfigurationProvider RemoteServiceConfigurationProvider { get; } - protected IDaprApiDescriptionFinder ApiDescriptionFinder { get; } + public DynamicDaprClientProxyInterceptor( + DynamicDaprProxyInterceptorClientProxy interceptorClientProxy, + IOptions clientProxyOptions, + IRemoteServiceConfigurationProvider remoteServiceConfigurationProvider, + IDaprApiDescriptionFinder apiDescriptionFinder) + { + InterceptorClientProxy = interceptorClientProxy; + RemoteServiceConfigurationProvider = remoteServiceConfigurationProvider; + ApiDescriptionFinder = apiDescriptionFinder; + ClientProxyOptions = clientProxyOptions.Value; - public DynamicDaprClientProxyInterceptor( - DynamicDaprProxyInterceptorClientProxy interceptorClientProxy, - IOptions clientProxyOptions, - IRemoteServiceConfigurationProvider remoteServiceConfigurationProvider, - IDaprApiDescriptionFinder apiDescriptionFinder) - { - InterceptorClientProxy = interceptorClientProxy; - RemoteServiceConfigurationProvider = remoteServiceConfigurationProvider; - ApiDescriptionFinder = apiDescriptionFinder; - ClientProxyOptions = clientProxyOptions.Value; + Logger = NullLogger>.Instance; + } - Logger = NullLogger>.Instance; - } + public override async Task InterceptAsync(IAbpMethodInvocation invocation) + { + var context = new ClientProxyRequestContext( + await GetActionApiDescriptionModel(invocation), + invocation.ArgumentsDictionary, + typeof(TService)); - public override async Task InterceptAsync(IAbpMethodInvocation invocation) + if (invocation.Method.ReturnType.GenericTypeArguments.IsNullOrEmpty()) { - var context = new ClientProxyRequestContext( - await GetActionApiDescriptionModel(invocation), - invocation.ArgumentsDictionary, - typeof(TService)); - - if (invocation.Method.ReturnType.GenericTypeArguments.IsNullOrEmpty()) - { - await InterceptorClientProxy.CallRequestAsync(context); - } - else - { - var returnType = invocation.Method.ReturnType.GenericTypeArguments[0]; - var result = (Task)CallRequestAsyncMethod - .MakeGenericMethod(returnType) - .Invoke(this, new object[] { context }); - - invocation.ReturnValue = await GetResultAsync(result, returnType); - } + await InterceptorClientProxy.CallRequestAsync(context); } - - protected async virtual Task GetActionApiDescriptionModel(IAbpMethodInvocation invocation) + else { - var clientConfig = ClientProxyOptions.DaprClientProxies.GetOrDefault(typeof(TService)) ?? - throw new AbpException($"Could not get DynamicDaprClientProxyConfig for {typeof(TService).FullName}."); - var remoteServiceConfig = await RemoteServiceConfigurationProvider.GetConfigurationOrDefaultAsync(clientConfig.RemoteServiceName); + var returnType = invocation.Method.ReturnType.GenericTypeArguments[0]; + var result = (Task)CallRequestAsyncMethod + .MakeGenericMethod(returnType) + .Invoke(this, new object[] { context }); - return await ApiDescriptionFinder.FindActionAsync( - clientConfig.RemoteServiceName, - remoteServiceConfig.GetAppId(), - typeof(TService), - invocation.Method - ); + invocation.ReturnValue = await GetResultAsync(result, returnType); } + } - protected async virtual Task CallRequestAsync(ClientProxyRequestContext context) - { - return await InterceptorClientProxy.CallRequestAsync(context); - } + protected async virtual Task GetActionApiDescriptionModel(IAbpMethodInvocation invocation) + { + var clientConfig = ClientProxyOptions.DaprClientProxies.GetOrDefault(typeof(TService)) ?? + throw new AbpException($"Could not get DynamicDaprClientProxyConfig for {typeof(TService).FullName}."); + var remoteServiceConfig = await RemoteServiceConfigurationProvider.GetConfigurationOrDefaultAsync(clientConfig.RemoteServiceName); - protected async virtual Task GetResultAsync(Task task, Type resultType) - { - await task; - var resultProperty = typeof(Task<>) - .MakeGenericType(resultType) - .GetProperty(nameof(Task.Result), BindingFlags.Instance | BindingFlags.Public); - Check.NotNull(resultProperty, nameof(resultProperty)); - return resultProperty.GetValue(task); - } + return await ApiDescriptionFinder.FindActionAsync( + clientConfig.RemoteServiceName, + remoteServiceConfig.GetAppId(), + typeof(TService), + invocation.Method + ); + } + + protected async virtual Task CallRequestAsync(ClientProxyRequestContext context) + { + return await InterceptorClientProxy.CallRequestAsync(context); + } + + protected async virtual Task GetResultAsync(Task task, Type resultType) + { + await task; + var resultProperty = typeof(Task<>) + .MakeGenericType(resultType) + .GetProperty(nameof(Task.Result), BindingFlags.Instance | BindingFlags.Public); + Check.NotNull(resultProperty, nameof(resultProperty)); + return resultProperty.GetValue(task); } } diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/DynamicDaprProxyInterceptorClientProxy.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/DynamicDaprProxyInterceptorClientProxy.cs index 1d74e83ba..e899425bb 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/DynamicDaprProxyInterceptorClientProxy.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/DynamicDaprProxyInterceptorClientProxy.cs @@ -3,18 +3,17 @@ using System.Threading.Tasks; using Volo.Abp.Http.Client.ClientProxying; -namespace LINGYUN.Abp.Dapr.Client.DynamicProxying +namespace LINGYUN.Abp.Dapr.Client.DynamicProxying; + +public class DynamicDaprProxyInterceptorClientProxy : DaprClientProxyBase { - public class DynamicDaprProxyInterceptorClientProxy : DaprClientProxyBase + public async virtual Task CallRequestAsync(ClientProxyRequestContext requestContext) { - public async virtual Task CallRequestAsync(ClientProxyRequestContext requestContext) - { - return await RequestAsync(requestContext); - } + return await RequestAsync(requestContext); + } - public async virtual Task CallRequestAsync(ClientProxyRequestContext requestContext) - { - return await RequestAsync(requestContext); - } + public async virtual Task CallRequestAsync(ClientProxyRequestContext requestContext) + { + return await RequestAsync(requestContext); } } diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/IDaprApiDescriptionFinder.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/IDaprApiDescriptionFinder.cs index f99067250..cd16ec8da 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/IDaprApiDescriptionFinder.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/IDaprApiDescriptionFinder.cs @@ -3,12 +3,11 @@ using System.Threading.Tasks; using Volo.Abp.Http.Modeling; -namespace LINGYUN.Abp.Dapr.Client.DynamicProxying +namespace LINGYUN.Abp.Dapr.Client.DynamicProxying; + +public interface IDaprApiDescriptionFinder { - public interface IDaprApiDescriptionFinder - { - Task FindActionAsync(string service, string appId, Type serviceType, MethodInfo invocationMethod); + Task FindActionAsync(string service, string appId, Type serviceType, MethodInfo invocationMethod); - Task GetApiDescriptionAsync(string service, string appId); - } + Task GetApiDescriptionAsync(string service, string appId); } diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/IDaprClientProxy.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/IDaprClientProxy.cs index 9686f3fad..a8caff076 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/IDaprClientProxy.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/LINGYUN/Abp/Dapr/Client/DynamicProxying/IDaprClientProxy.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.Dapr.Client.DynamicProxying +namespace LINGYUN.Abp.Dapr.Client.DynamicProxying; + +public interface IDaprClientProxy { - public interface IDaprClientProxy - { - TRemoteService Service { get; } - } + TRemoteService Service { get; } } diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/Microsoft/Extensions/DependencyInjection/ServiceCollectionDaprClientProxyExtensions.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/Microsoft/Extensions/DependencyInjection/ServiceCollectionDaprClientProxyExtensions.cs index 49ae5441b..fefe07001 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/Microsoft/Extensions/DependencyInjection/ServiceCollectionDaprClientProxyExtensions.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr.Client/Microsoft/Extensions/DependencyInjection/ServiceCollectionDaprClientProxyExtensions.cs @@ -13,183 +13,182 @@ using Volo.Abp.Http.Client; using Volo.Abp.Validation; -namespace Microsoft.Extensions.DependencyInjection +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionDaprClientProxyExtensions { - public static class ServiceCollectionDaprClientProxyExtensions + private static readonly ProxyGenerator ProxyGeneratorInstance = new ProxyGenerator(); + + #region Add Static DaprClient Proxies + + public static IServiceCollection AddStaticDaprClientProxies( + [NotNull] this IServiceCollection services, + [NotNull] Assembly assembly, + [NotNull] string remoteServiceConfigurationName = RemoteServiceConfigurationDictionary.DefaultName) { - private static readonly ProxyGenerator ProxyGeneratorInstance = new ProxyGenerator(); + Check.NotNull(services, nameof(assembly)); - #region Add Static DaprClient Proxies + var serviceTypes = assembly.GetTypes().Where(IsSuitableForClientProxying).ToArray(); - public static IServiceCollection AddStaticDaprClientProxies( - [NotNull] this IServiceCollection services, - [NotNull] Assembly assembly, - [NotNull] string remoteServiceConfigurationName = RemoteServiceConfigurationDictionary.DefaultName) + foreach (var serviceType in serviceTypes) { - Check.NotNull(services, nameof(assembly)); - - var serviceTypes = assembly.GetTypes().Where(IsSuitableForClientProxying).ToArray(); + AddDaprClientFactory(services, remoteServiceConfigurationName); - foreach (var serviceType in serviceTypes) + services.Configure(options => { - AddDaprClientFactory(services, remoteServiceConfigurationName); - - services.Configure(options => - { - options.DaprClientProxies[serviceType] = new DynamicDaprClientProxyConfig(serviceType, remoteServiceConfigurationName); - }); - } - - return services; + options.DaprClientProxies[serviceType] = new DynamicDaprClientProxyConfig(serviceType, remoteServiceConfigurationName); + }); } - #endregion - - #region Add Dynamic DaprClient Proxies + return services; + } - public static IServiceCollection AddDaprClientProxies( - [NotNull] this IServiceCollection services, - [NotNull] Assembly assembly, - [NotNull] string remoteServiceConfigurationName = RemoteServiceConfigurationDictionary.DefaultName, - bool asDefaultServices = true) - { - Check.NotNull(services, nameof(assembly)); + #endregion - var serviceTypes = assembly.GetTypes().Where(IsSuitableForClientProxying).ToArray(); + #region Add Dynamic DaprClient Proxies - foreach (var serviceType in serviceTypes) - { - services.AddDaprClientProxy( - serviceType, - remoteServiceConfigurationName, - asDefaultServices - ); - } + public static IServiceCollection AddDaprClientProxies( + [NotNull] this IServiceCollection services, + [NotNull] Assembly assembly, + [NotNull] string remoteServiceConfigurationName = RemoteServiceConfigurationDictionary.DefaultName, + bool asDefaultServices = true) + { + Check.NotNull(services, nameof(assembly)); - return services; - } + var serviceTypes = assembly.GetTypes().Where(IsSuitableForClientProxying).ToArray(); - public static IServiceCollection AddDaprClientProxy( - [NotNull] this IServiceCollection services, - [NotNull] string remoteServiceConfigurationName = RemoteServiceConfigurationDictionary.DefaultName, - bool asDefaultService = true) + foreach (var serviceType in serviceTypes) { - return services.AddDaprClientProxy( - typeof(T), + services.AddDaprClientProxy( + serviceType, remoteServiceConfigurationName, - asDefaultService + asDefaultServices ); } - public static IServiceCollection AddDaprClientProxy( - [NotNull] this IServiceCollection services, - [NotNull] Type type, - [NotNull] string remoteServiceConfigurationName = RemoteServiceConfigurationDictionary.DefaultName, - bool asDefaultService = true) - { - Check.NotNull(services, nameof(services)); - Check.NotNull(type, nameof(type)); - Check.NotNullOrWhiteSpace(remoteServiceConfigurationName, nameof(remoteServiceConfigurationName)); + return services; + } - services.AddDaprClientFactory(remoteServiceConfigurationName); + public static IServiceCollection AddDaprClientProxy( + [NotNull] this IServiceCollection services, + [NotNull] string remoteServiceConfigurationName = RemoteServiceConfigurationDictionary.DefaultName, + bool asDefaultService = true) + { + return services.AddDaprClientProxy( + typeof(T), + remoteServiceConfigurationName, + asDefaultService + ); + } - services.Configure(options => - { - options.DaprClientProxies[type] = new DynamicDaprClientProxyConfig(type, remoteServiceConfigurationName); - }); + public static IServiceCollection AddDaprClientProxy( + [NotNull] this IServiceCollection services, + [NotNull] Type type, + [NotNull] string remoteServiceConfigurationName = RemoteServiceConfigurationDictionary.DefaultName, + bool asDefaultService = true) + { + Check.NotNull(services, nameof(services)); + Check.NotNull(type, nameof(type)); + Check.NotNullOrWhiteSpace(remoteServiceConfigurationName, nameof(remoteServiceConfigurationName)); - var interceptorType = typeof(DynamicDaprClientProxyInterceptor<>).MakeGenericType(type); - services.AddTransient(interceptorType); + services.AddDaprClientFactory(remoteServiceConfigurationName); - var interceptorAdapterType = typeof(AbpAsyncDeterminationInterceptor<>).MakeGenericType(interceptorType); + services.Configure(options => + { + options.DaprClientProxies[type] = new DynamicDaprClientProxyConfig(type, remoteServiceConfigurationName); + }); - var validationInterceptorAdapterType = - typeof(AbpAsyncDeterminationInterceptor<>).MakeGenericType(typeof(ValidationInterceptor)); + var interceptorType = typeof(DynamicDaprClientProxyInterceptor<>).MakeGenericType(type); + services.AddTransient(interceptorType); - if (asDefaultService) - { - services.AddTransient( - type, - serviceProvider => ProxyGeneratorInstance - .CreateInterfaceProxyWithoutTarget( - type, - (IInterceptor)serviceProvider.GetRequiredService(validationInterceptorAdapterType), - (IInterceptor)serviceProvider.GetRequiredService(interceptorAdapterType) - ) - ); - } + var interceptorAdapterType = typeof(AbpAsyncDeterminationInterceptor<>).MakeGenericType(interceptorType); + var validationInterceptorAdapterType = + typeof(AbpAsyncDeterminationInterceptor<>).MakeGenericType(typeof(ValidationInterceptor)); + + if (asDefaultService) + { services.AddTransient( - typeof(IDaprClientProxy<>).MakeGenericType(type), - serviceProvider => - { - var service = ProxyGeneratorInstance - .CreateInterfaceProxyWithoutTarget( - type, - (IInterceptor)serviceProvider.GetRequiredService(validationInterceptorAdapterType), - (IInterceptor)serviceProvider.GetRequiredService(interceptorAdapterType) - ); - - return Activator.CreateInstance( - typeof(DaprClientProxy<>).MakeGenericType(type), - service + type, + serviceProvider => ProxyGeneratorInstance + .CreateInterfaceProxyWithoutTarget( + type, + (IInterceptor)serviceProvider.GetRequiredService(validationInterceptorAdapterType), + (IInterceptor)serviceProvider.GetRequiredService(interceptorAdapterType) + ) + ); + } + + services.AddTransient( + typeof(IDaprClientProxy<>).MakeGenericType(type), + serviceProvider => + { + var service = ProxyGeneratorInstance + .CreateInterfaceProxyWithoutTarget( + type, + (IInterceptor)serviceProvider.GetRequiredService(validationInterceptorAdapterType), + (IInterceptor)serviceProvider.GetRequiredService(interceptorAdapterType) ); - }); + return Activator.CreateInstance( + typeof(DaprClientProxy<>).MakeGenericType(type), + service + ); + }); + + return services; + } + + private static IServiceCollection AddDaprClientFactory( + [NotNull] this IServiceCollection services, + [NotNull] string remoteServiceConfigurationName = RemoteServiceConfigurationDictionary.DefaultName) + { + var preOptions = services.ExecutePreConfiguredActions(); + + if (preOptions.ConfiguredProxyClients.Contains(remoteServiceConfigurationName)) + { return services; } - private static IServiceCollection AddDaprClientFactory( - [NotNull] this IServiceCollection services, - [NotNull] string remoteServiceConfigurationName = RemoteServiceConfigurationDictionary.DefaultName) + var clientBuilder = services.AddDaprClient(remoteServiceConfigurationName, (IServiceProvider provider, DaprClientBuilder builder) => { - var preOptions = services.ExecutePreConfiguredActions(); + var options = provider.GetRequiredService>().Value; + builder.UseHttpEndpoint( + options.RemoteServices + .GetConfigurationOrDefault(remoteServiceConfigurationName).BaseUrl); - if (preOptions.ConfiguredProxyClients.Contains(remoteServiceConfigurationName)) + foreach (var clientBuildAction in preOptions.ProxyClientBuildActions) { - return services; + clientBuildAction(remoteServiceConfigurationName, provider, builder); } + }); - var clientBuilder = services.AddDaprClient(remoteServiceConfigurationName, (IServiceProvider provider, DaprClientBuilder builder) => - { - var options = provider.GetRequiredService>().Value; - builder.UseHttpEndpoint( - options.RemoteServices - .GetConfigurationOrDefault(remoteServiceConfigurationName).BaseUrl); - - foreach (var clientBuildAction in preOptions.ProxyClientBuildActions) - { - clientBuildAction(remoteServiceConfigurationName, provider, builder); - } - }); - - clientBuilder.ConfigureDaprClient((client) => - { - foreach (var clientBuildAction in preOptions.ProxyClientActions) - { - clientBuildAction(remoteServiceConfigurationName, client); - } - }); - - - services.PreConfigure(options => + clientBuilder.ConfigureDaprClient((client) => + { + foreach (var clientBuildAction in preOptions.ProxyClientActions) { - options.ConfiguredProxyClients.Add(remoteServiceConfigurationName); - }); - - return services; - } + clientBuildAction(remoteServiceConfigurationName, client); + } + }); + - private static bool IsSuitableForClientProxying(Type type) + services.PreConfigure(options => { - //TODO: Add option to change type filter + options.ConfiguredProxyClients.Add(remoteServiceConfigurationName); + }); - return type.IsInterface - && type.IsPublic - && !type.IsGenericType - && typeof(IRemoteService).IsAssignableFrom(type); - } + return services; + } - #endregion + private static bool IsSuitableForClientProxying(Type type) + { + //TODO: Add option to change type filter + + return type.IsInterface + && type.IsPublic + && !type.IsGenericType + && typeof(IRemoteService).IsAssignableFrom(type); } + + #endregion } diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/Dapr/Client/DaprClientBuilderExtensions.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/Dapr/Client/DaprClientBuilderExtensions.cs index fef9d9732..60af08b2e 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/Dapr/Client/DaprClientBuilderExtensions.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/Dapr/Client/DaprClientBuilderExtensions.cs @@ -2,71 +2,70 @@ using Microsoft.Extensions.Options; using System; -namespace Dapr.Client +namespace Dapr.Client; + +public static class DaprClientBuilderExtensions { - public static class DaprClientBuilderExtensions + public static IDaprClientBuilder ConfigureDaprClient(this IDaprClientBuilder builder, Action configureClient) { - public static IDaprClientBuilder ConfigureDaprClient(this IDaprClientBuilder builder, Action configureClient) + if (builder == null) { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } + throw new ArgumentNullException(nameof(builder)); + } - if (configureClient == null) - { - throw new ArgumentNullException(nameof(configureClient)); - } + if (configureClient == null) + { + throw new ArgumentNullException(nameof(configureClient)); + } - builder.Services.Configure(builder.Name, options => - { - options.DaprClientActions.Add(configureClient); - }); + builder.Services.Configure(builder.Name, options => + { + options.DaprClientActions.Add(configureClient); + }); + + return builder; + } - return builder; + public static IDaprClientBuilder ConfigureDaprClient(this IDaprClientBuilder builder, Action configureBuilder) + { + if (builder == null) + { + throw new ArgumentNullException(nameof(builder)); } - public static IDaprClientBuilder ConfigureDaprClient(this IDaprClientBuilder builder, Action configureBuilder) + if (configureBuilder == null) { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } + throw new ArgumentNullException(nameof(configureBuilder)); + } - if (configureBuilder == null) - { - throw new ArgumentNullException(nameof(configureBuilder)); - } + builder.Services.Configure(builder.Name, options => + { + options.DaprClientBuilderActions.Add(configureBuilder); + }); - builder.Services.Configure(builder.Name, options => - { - options.DaprClientBuilderActions.Add(configureBuilder); - }); + return builder; + } - return builder; + public static IDaprClientBuilder ConfigureDaprClient(this IDaprClientBuilder builder, Action configureClientBuilder) + { + if (builder == null) + { + throw new ArgumentNullException(nameof(builder)); } - public static IDaprClientBuilder ConfigureDaprClient(this IDaprClientBuilder builder, Action configureClientBuilder) + if (configureClientBuilder == null) { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - if (configureClientBuilder == null) - { - throw new ArgumentNullException(nameof(configureClientBuilder)); - } + throw new ArgumentNullException(nameof(configureClientBuilder)); + } - builder.Services.AddTransient>(services => + builder.Services.AddTransient>(services => + { + return new ConfigureNamedOptions(builder.Name, (options) => { - return new ConfigureNamedOptions(builder.Name, (options) => - { - options.DaprClientBuilderActions.Add(client => configureClientBuilder(services, client)); - }); + options.DaprClientBuilderActions.Add(client => configureClientBuilder(services, client)); }); + }); - return builder; - } + return builder; } } diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/Dapr/Client/DaprClientFactoryOptions.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/Dapr/Client/DaprClientFactoryOptions.cs index 6a379ab74..bae80e192 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/Dapr/Client/DaprClientFactoryOptions.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/Dapr/Client/DaprClientFactoryOptions.cs @@ -3,19 +3,18 @@ using System.Collections.Generic; using System.Text.Json; -namespace Dapr.Client +namespace Dapr.Client; + +public class DaprClientFactoryOptions { - public class DaprClientFactoryOptions + public string? DaprApiToken{ get; set; } + public string? HttpEndpoint { get; set; } + public string? GrpcEndpoint { get; set; } + public GrpcChannelOptions? GrpcChannelOptions { get; set; } + public JsonSerializerOptions? JsonSerializerOptions { get; set; } + public IList> DaprClientActions { get; } = new List>(); + public IList> DaprClientBuilderActions { get; } = new List>(); + public DaprClientFactoryOptions() { - public string DaprApiToken{ get; set; } - public string HttpEndpoint { get; set; } - public string GrpcEndpoint { get; set; } - public GrpcChannelOptions GrpcChannelOptions { get; set; } - public JsonSerializerOptions JsonSerializerOptions { get; set; } - public IList> DaprClientActions { get; } = new List>(); - public IList> DaprClientBuilderActions { get; } = new List>(); - public DaprClientFactoryOptions() - { - } } } diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/Dapr/Client/DefaultDaprClientBuilder.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/Dapr/Client/DefaultDaprClientBuilder.cs index 6a8a5da8d..4dc48ea26 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/Dapr/Client/DefaultDaprClientBuilder.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/Dapr/Client/DefaultDaprClientBuilder.cs @@ -1,17 +1,16 @@ using Microsoft.Extensions.DependencyInjection; -namespace Dapr.Client +namespace Dapr.Client; + +internal class DefaultDaprClientBuilder : IDaprClientBuilder { - internal class DefaultDaprClientBuilder : IDaprClientBuilder + public DefaultDaprClientBuilder(IServiceCollection services, string name) { - public DefaultDaprClientBuilder(IServiceCollection services, string name) - { - Services = services; - Name = name; - } + Services = services; + Name = name; + } - public string Name { get; } + public string Name { get; } - public IServiceCollection Services { get; } - } + public IServiceCollection Services { get; } } diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/Dapr/Client/DefaultDaprClientFactory.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/Dapr/Client/DefaultDaprClientFactory.cs index d565d98ef..439222a0b 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/Dapr/Client/DefaultDaprClientFactory.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/Dapr/Client/DefaultDaprClientFactory.cs @@ -5,95 +5,94 @@ using System.Threading; using Volo.Abp.Json.SystemTextJson; -namespace Dapr.Client +namespace Dapr.Client; + +public class DefaultDaprClientFactory : IDaprClientFactory { - public class DefaultDaprClientFactory : IDaprClientFactory - { - private readonly AbpSystemTextJsonSerializerOptions _systemTextJsonSerializerOptions; - private readonly IOptionsMonitor _daprClientFactoryOptions; + private readonly AbpSystemTextJsonSerializerOptions _systemTextJsonSerializerOptions; + private readonly IOptionsMonitor _daprClientFactoryOptions; - private readonly Func> _daprClientFactory; - internal readonly ConcurrentDictionary> _daprClients; - internal readonly ConcurrentDictionary _jsonSerializerOptions; + private readonly Func> _daprClientFactory; + internal readonly ConcurrentDictionary> _daprClients; + internal readonly ConcurrentDictionary _jsonSerializerOptions; - public DefaultDaprClientFactory( - IOptions systemTextJsonSerializerOptions, - IOptionsMonitor daprClientFactoryOptions) - { - _daprClientFactoryOptions = daprClientFactoryOptions ?? throw new ArgumentNullException(nameof(daprClientFactoryOptions)); - _systemTextJsonSerializerOptions= systemTextJsonSerializerOptions?.Value ?? throw new ArgumentNullException(nameof(systemTextJsonSerializerOptions)); - - _daprClients = new ConcurrentDictionary>(); - _jsonSerializerOptions = new ConcurrentDictionary(); + public DefaultDaprClientFactory( + IOptions systemTextJsonSerializerOptions, + IOptionsMonitor daprClientFactoryOptions) + { + _daprClientFactoryOptions = daprClientFactoryOptions ?? throw new ArgumentNullException(nameof(daprClientFactoryOptions)); + _systemTextJsonSerializerOptions= systemTextJsonSerializerOptions?.Value ?? throw new ArgumentNullException(nameof(systemTextJsonSerializerOptions)); - _daprClientFactory = (name) => - { - return new Lazy(() => - { - return InternalCreateDaprClient(name); - }, LazyThreadSafetyMode.ExecutionAndPublication); - }; - } + _daprClients = new ConcurrentDictionary>(); + _jsonSerializerOptions = new ConcurrentDictionary(); - public DaprClient CreateClient(string name) + _daprClientFactory = (name) => { - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - var client = _daprClients.GetOrAdd(name, _daprClientFactory).Value; - - var options = _daprClientFactoryOptions.Get(name); - for (var i = 0; i < options.DaprClientActions.Count; i++) + return new Lazy(() => { - options.DaprClientActions[i](client); - } + return InternalCreateDaprClient(name); + }, LazyThreadSafetyMode.ExecutionAndPublication); + }; + } - return client; + public DaprClient CreateClient(string name) + { + if (name == null) + { + throw new ArgumentNullException(nameof(name)); } - internal DaprClient InternalCreateDaprClient(string name) - { - var builder = new DaprClientBuilder(); + var client = _daprClients.GetOrAdd(name, _daprClientFactory).Value; - var options = _daprClientFactoryOptions.Get(name); + var options = _daprClientFactoryOptions.Get(name); + for (var i = 0; i < options.DaprClientActions.Count; i++) + { + options.DaprClientActions[i](client); + } - if (!string.IsNullOrWhiteSpace(options.HttpEndpoint)) - { - builder.UseHttpEndpoint(options.HttpEndpoint); - } - if (!string.IsNullOrWhiteSpace(options.GrpcEndpoint)) - { - builder.UseGrpcEndpoint(options.GrpcEndpoint); - } - if (options.GrpcChannelOptions != null) - { - builder.UseGrpcChannelOptions(options.GrpcChannelOptions); - } - if (options.JsonSerializerOptions != null) - { - builder.UseJsonSerializationOptions(options.JsonSerializerOptions); - } - else - { - builder.UseJsonSerializationOptions(CreateJsonSerializerOptions(name)); - } + return client; + } - builder.UseDaprApiToken(options.DaprApiToken); + internal DaprClient InternalCreateDaprClient(string name) + { + var builder = new DaprClientBuilder(); - for (var i = 0; i < options.DaprClientBuilderActions.Count; i++) - { - options.DaprClientBuilderActions[i](builder); - } + var options = _daprClientFactoryOptions.Get(name); - return builder.Build(); + if (!string.IsNullOrWhiteSpace(options.HttpEndpoint)) + { + builder.UseHttpEndpoint(options.HttpEndpoint); + } + if (!string.IsNullOrWhiteSpace(options.GrpcEndpoint)) + { + builder.UseGrpcEndpoint(options.GrpcEndpoint); + } + if (options.GrpcChannelOptions != null) + { + builder.UseGrpcChannelOptions(options.GrpcChannelOptions); } + if (options.JsonSerializerOptions != null) + { + builder.UseJsonSerializationOptions(options.JsonSerializerOptions); + } + else + { + builder.UseJsonSerializationOptions(CreateJsonSerializerOptions(name)); + } + + builder.UseDaprApiToken(options.DaprApiToken); - private JsonSerializerOptions CreateJsonSerializerOptions(string name) + for (var i = 0; i < options.DaprClientBuilderActions.Count; i++) { - return _jsonSerializerOptions.GetOrAdd(name, - _ => new JsonSerializerOptions(_systemTextJsonSerializerOptions.JsonSerializerOptions)); + options.DaprClientBuilderActions[i](builder); } + + return builder.Build(); + } + + private JsonSerializerOptions CreateJsonSerializerOptions(string name) + { + return _jsonSerializerOptions.GetOrAdd(name, + _ => new JsonSerializerOptions(_systemTextJsonSerializerOptions.JsonSerializerOptions)); } } diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/Dapr/Client/IDaprClientBuilder.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/Dapr/Client/IDaprClientBuilder.cs index 1e4122f0c..c2f2b0c56 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/Dapr/Client/IDaprClientBuilder.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/Dapr/Client/IDaprClientBuilder.cs @@ -1,10 +1,9 @@ using Microsoft.Extensions.DependencyInjection; -namespace Dapr.Client +namespace Dapr.Client; + +public interface IDaprClientBuilder { - public interface IDaprClientBuilder - { - string Name { get; } - IServiceCollection Services { get; } - } + string Name { get; } + IServiceCollection Services { get; } } diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/Dapr/Client/IDaprClientFactory.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/Dapr/Client/IDaprClientFactory.cs index 66bc3d13f..170086842 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/Dapr/Client/IDaprClientFactory.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/Dapr/Client/IDaprClientFactory.cs @@ -1,7 +1,6 @@ -namespace Dapr.Client +namespace Dapr.Client; + +public interface IDaprClientFactory { - public interface IDaprClientFactory - { - DaprClient CreateClient(string name); - } + DaprClient CreateClient(string name); } diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/LINGYUN.Abp.Dapr.csproj b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/LINGYUN.Abp.Dapr.csproj index e33433ddd..c90ad7018 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/LINGYUN.Abp.Dapr.csproj +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/LINGYUN.Abp.Dapr.csproj @@ -5,6 +5,13 @@ net8.0 + enable + Nullable + LINGYUN.Abp.Dapr + LINGYUN.Abp.Dapr + false + false + false diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/LINGYUN/Abp/Dapr/AbpDaprModule.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/LINGYUN/Abp/Dapr/AbpDaprModule.cs index 064e694b3..e51dd7bd1 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/LINGYUN/Abp/Dapr/AbpDaprModule.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/LINGYUN/Abp/Dapr/AbpDaprModule.cs @@ -1,10 +1,9 @@ using Volo.Abp.Json; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.Dapr +namespace LINGYUN.Abp.Dapr; + +[DependsOn(typeof(AbpJsonModule))] +public class AbpDaprModule : AbpModule { - [DependsOn(typeof(AbpJsonModule))] - public class AbpDaprModule : AbpModule - { - } } diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/Microsoft/Extensions/DependencyInjection/ServiceCollectionDaprClientExtensions.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/Microsoft/Extensions/DependencyInjection/ServiceCollectionDaprClientExtensions.cs index 5f5e7a169..a37244086 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/Microsoft/Extensions/DependencyInjection/ServiceCollectionDaprClientExtensions.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.Dapr/Microsoft/Extensions/DependencyInjection/ServiceCollectionDaprClientExtensions.cs @@ -3,97 +3,96 @@ using Microsoft.Extensions.DependencyInjection.Extensions; using System; -namespace Microsoft.Extensions.DependencyInjection +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionDaprClientExtensions { - public static class ServiceCollectionDaprClientExtensions - { - #region Add DaprClient Builder + #region Add DaprClient Builder - public static IServiceCollection AddDaprClient( - [NotNull] this IServiceCollection services) + public static IServiceCollection AddDaprClient( + [NotNull] this IServiceCollection services) + { + if (services == null) { - if (services == null) - { - throw new ArgumentNullException(nameof(services)); - } + throw new ArgumentNullException(nameof(services)); + } + + services.AddLogging(); + services.AddOptions(); - services.AddLogging(); - services.AddOptions(); + services.TryAddSingleton(); + services.TryAddSingleton(serviceProvider => serviceProvider.GetRequiredService()); - services.TryAddSingleton(); - services.TryAddSingleton(serviceProvider => serviceProvider.GetRequiredService()); + return services; + } - return services; + public static IDaprClientBuilder AddDaprClient( + [NotNull] this IServiceCollection services, + string name) + { + if (services == null) + { + throw new ArgumentNullException(nameof(services)); } - public static IDaprClientBuilder AddDaprClient( - [NotNull] this IServiceCollection services, - string name) + services.AddDaprClient(); + + return new DefaultDaprClientBuilder(services, name); + } + + public static IDaprClientBuilder AddDaprClient( + [NotNull] this IServiceCollection services, + string name, + Action configureClient) + { + if (services == null) { - if (services == null) - { - throw new ArgumentNullException(nameof(services)); - } + throw new ArgumentNullException(nameof(services)); + } - services.AddDaprClient(); + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } - return new DefaultDaprClientBuilder(services, name); + if (configureClient == null) + { + throw new ArgumentNullException(nameof(configureClient)); } - public static IDaprClientBuilder AddDaprClient( - [NotNull] this IServiceCollection services, - string name, - Action configureClient) + services.AddDaprClient(); + + var builder = new DefaultDaprClientBuilder(services, name); + builder.ConfigureDaprClient(configureClient); + return builder; + } + + public static IDaprClientBuilder AddDaprClient( + [NotNull] this IServiceCollection services, + string name, + Action configureClient) + { + if (services == null) { - if (services == null) - { - throw new ArgumentNullException(nameof(services)); - } - - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - if (configureClient == null) - { - throw new ArgumentNullException(nameof(configureClient)); - } - - services.AddDaprClient(); - - var builder = new DefaultDaprClientBuilder(services, name); - builder.ConfigureDaprClient(configureClient); - return builder; + throw new ArgumentNullException(nameof(services)); } - public static IDaprClientBuilder AddDaprClient( - [NotNull] this IServiceCollection services, - string name, - Action configureClient) + if (name == null) { - if (services == null) - { - throw new ArgumentNullException(nameof(services)); - } - - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - if (configureClient == null) - { - throw new ArgumentNullException(nameof(configureClient)); - } - - services.AddDaprClient(); - var builder = new DefaultDaprClientBuilder(services, name); - builder.ConfigureDaprClient(configureClient); - return builder; + throw new ArgumentNullException(nameof(name)); } + if (configureClient == null) + { + throw new ArgumentNullException(nameof(configureClient)); + } - #endregion + services.AddDaprClient(); + var builder = new DefaultDaprClientBuilder(services, name); + builder.ConfigureDaprClient(configureClient); + return builder; } + + + #endregion } diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.DistributedLocking.Dapr/LINGYUN.Abp.DistributedLocking.Dapr.csproj b/aspnet-core/framework/dapr/LINGYUN.Abp.DistributedLocking.Dapr/LINGYUN.Abp.DistributedLocking.Dapr.csproj index 9ffedd46c..93f129daf 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.DistributedLocking.Dapr/LINGYUN.Abp.DistributedLocking.Dapr.csproj +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.DistributedLocking.Dapr/LINGYUN.Abp.DistributedLocking.Dapr.csproj @@ -5,6 +5,13 @@ net8.0 + enable + Nullable + LINGYUN.Abp.DistributedLocking.Dapr + LINGYUN.Abp.DistributedLocking.Dapr + false + false + false diff --git a/aspnet-core/framework/dapr/LINGYUN.Abp.DistributedLocking.Dapr/LINGYUN/Abp/DistributedLocking/Dapr/DaprAbpDistributedLock.cs b/aspnet-core/framework/dapr/LINGYUN.Abp.DistributedLocking.Dapr/LINGYUN/Abp/DistributedLocking/Dapr/DaprAbpDistributedLock.cs index abf239c4a..0d971c121 100644 --- a/aspnet-core/framework/dapr/LINGYUN.Abp.DistributedLocking.Dapr/LINGYUN/Abp/DistributedLocking/Dapr/DaprAbpDistributedLock.cs +++ b/aspnet-core/framework/dapr/LINGYUN.Abp.DistributedLocking.Dapr/LINGYUN/Abp/DistributedLocking/Dapr/DaprAbpDistributedLock.cs @@ -29,7 +29,7 @@ public DaprAbpDistributedLock( CancellationTokenProvider = cancellationTokenProvider; } - public async virtual Task TryAcquireAsync(string name, TimeSpan timeout = default, CancellationToken cancellationToken = default) + public async virtual Task TryAcquireAsync(string name, TimeSpan timeout = default, CancellationToken cancellationToken = default) { if (timeout == default) { diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN.Abp.DataProtection.Abstractions.csproj b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN.Abp.DataProtection.Abstractions.csproj index 41542b6b4..6370f425a 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN.Abp.DataProtection.Abstractions.csproj +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN.Abp.DataProtection.Abstractions.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.DataProtection.Abstractions + LINGYUN.Abp.DataProtection.Abstractions + false + false + false diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN.Abp.DataProtection.EntityFrameworkCore.csproj b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN.Abp.DataProtection.EntityFrameworkCore.csproj index 19a0fd98a..8c274540e 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN.Abp.DataProtection.EntityFrameworkCore.csproj +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN.Abp.DataProtection.EntityFrameworkCore.csproj @@ -6,6 +6,11 @@ net8.0 latest + LINGYUN.Abp.DataProtection.EntityFrameworkCore + LINGYUN.Abp.DataProtection.EntityFrameworkCore + false + false + false diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN.Abp.DataProtection.csproj b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN.Abp.DataProtection.csproj index 74a879b50..738fb09dd 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN.Abp.DataProtection.csproj +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN.Abp.DataProtection.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.DataProtection + LINGYUN.Abp.DataProtection + false + false + false diff --git a/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application.Contracts/LINGYUN.Abp.Dynamic.Queryable.Application.Contracts.csproj b/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application.Contracts/LINGYUN.Abp.Dynamic.Queryable.Application.Contracts.csproj index 6b1a73e80..bdecc8ecf 100644 --- a/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application.Contracts/LINGYUN.Abp.Dynamic.Queryable.Application.Contracts.csproj +++ b/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application.Contracts/LINGYUN.Abp.Dynamic.Queryable.Application.Contracts.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Dynamic.Queryable.Application.Contracts + LINGYUN.Abp.Dynamic.Queryable.Application.Contracts + false + false + false diff --git a/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application/LINGYUN.Abp.Dynamic.Queryable.Application.csproj b/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application/LINGYUN.Abp.Dynamic.Queryable.Application.csproj index 318aa61ad..340a88f4c 100644 --- a/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application/LINGYUN.Abp.Dynamic.Queryable.Application.csproj +++ b/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application/LINGYUN.Abp.Dynamic.Queryable.Application.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Dynamic.Queryable.Application + LINGYUN.Abp.Dynamic.Queryable.Application + false + false + false diff --git a/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.HttpApi/LINGYUN.Abp.Dynamic.Queryable.HttpApi.csproj b/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.HttpApi/LINGYUN.Abp.Dynamic.Queryable.HttpApi.csproj index df1dc789a..71df9d0d0 100644 --- a/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.HttpApi/LINGYUN.Abp.Dynamic.Queryable.HttpApi.csproj +++ b/aspnet-core/framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.HttpApi/LINGYUN.Abp.Dynamic.Queryable.HttpApi.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.Dynamic.Queryable.HttpApi + LINGYUN.Abp.Dynamic.Queryable.HttpApi + false + false + false diff --git a/aspnet-core/framework/dynamic-queryable/LINGYUN.Linq.Dynamic.Queryable/LINGYUN.Linq.Dynamic.Queryable.csproj b/aspnet-core/framework/dynamic-queryable/LINGYUN.Linq.Dynamic.Queryable/LINGYUN.Linq.Dynamic.Queryable.csproj index 797f2ce0f..1098ab853 100644 --- a/aspnet-core/framework/dynamic-queryable/LINGYUN.Linq.Dynamic.Queryable/LINGYUN.Linq.Dynamic.Queryable.csproj +++ b/aspnet-core/framework/dynamic-queryable/LINGYUN.Linq.Dynamic.Queryable/LINGYUN.Linq.Dynamic.Queryable.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Linq.Dynamic.Queryable + LINGYUN.Linq.Dynamic.Queryable + false + false + false diff --git a/aspnet-core/framework/elasticsearch/LINGYUN.Abp.Elasticsearch/LINGYUN.Abp.Elasticsearch.csproj b/aspnet-core/framework/elasticsearch/LINGYUN.Abp.Elasticsearch/LINGYUN.Abp.Elasticsearch.csproj index 116d8d49d..6536b73b3 100644 --- a/aspnet-core/framework/elasticsearch/LINGYUN.Abp.Elasticsearch/LINGYUN.Abp.Elasticsearch.csproj +++ b/aspnet-core/framework/elasticsearch/LINGYUN.Abp.Elasticsearch/LINGYUN.Abp.Elasticsearch.csproj @@ -4,7 +4,14 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + enable + Nullable + LINGYUN.Abp.Elasticsearch + LINGYUN.Abp.Elasticsearch + false + false + false diff --git a/aspnet-core/framework/elasticsearch/LINGYUN.Abp.Elasticsearch/LINGYUN/Abp/Elasticsearch/AbpElasticsearchOptions.cs b/aspnet-core/framework/elasticsearch/LINGYUN.Abp.Elasticsearch/LINGYUN/Abp/Elasticsearch/AbpElasticsearchOptions.cs index 9936bbb00..2159d89b9 100644 --- a/aspnet-core/framework/elasticsearch/LINGYUN.Abp.Elasticsearch/LINGYUN/Abp/Elasticsearch/AbpElasticsearchOptions.cs +++ b/aspnet-core/framework/elasticsearch/LINGYUN.Abp.Elasticsearch/LINGYUN/Abp/Elasticsearch/AbpElasticsearchOptions.cs @@ -18,8 +18,8 @@ public class AbpElasticsearchOptions public bool DisableDirectStreaming { get; set; } public string NodeUris { get; set; } public int ConnectionLimit { get; set; } - public string UserName { get; set; } - public string Password { get; set; } + public string? UserName { get; set; } + public string? Password { get; set; } public TimeSpan ConnectionTimeout { get; set; } public IConnection Connection { get; set; } public ConnectionSettings.SourceSerializerFactory SerializerFactory { get; set; } diff --git a/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application.Contracts/LINGYUN.Abp.EntityChange.Application.Contracts.csproj b/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application.Contracts/LINGYUN.Abp.EntityChange.Application.Contracts.csproj index f394bfa99..f066b7759 100644 --- a/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application.Contracts/LINGYUN.Abp.EntityChange.Application.Contracts.csproj +++ b/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application.Contracts/LINGYUN.Abp.EntityChange.Application.Contracts.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.EntityChange.Application.Contracts + LINGYUN.Abp.EntityChange.Application.Contracts + false + false + false diff --git a/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application/LINGYUN.Abp.EntityChange.Application.csproj b/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application/LINGYUN.Abp.EntityChange.Application.csproj index a66d30472..97f2f599d 100644 --- a/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application/LINGYUN.Abp.EntityChange.Application.csproj +++ b/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.Application/LINGYUN.Abp.EntityChange.Application.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.EntityChange.Application + LINGYUN.Abp.EntityChange.Application + false + false + false diff --git a/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.HttpApi/LINGYUN.Abp.EntityChange.HttpApi.csproj b/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.HttpApi/LINGYUN.Abp.EntityChange.HttpApi.csproj index 8e5619c4b..46382a0f1 100644 --- a/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.HttpApi/LINGYUN.Abp.EntityChange.HttpApi.csproj +++ b/aspnet-core/framework/entity-change/LINGYUN.Abp.EntityChange.HttpApi/LINGYUN.Abp.EntityChange.HttpApi.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.EntityChange.HttpApi + LINGYUN.Abp.EntityChange.HttpApi + false + false + false diff --git a/aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN.Abp.FeatureManagement.Client.csproj b/aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN.Abp.FeatureManagement.Client.csproj index 9b1cfd838..7687661bd 100644 --- a/aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN.Abp.FeatureManagement.Client.csproj +++ b/aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN.Abp.FeatureManagement.Client.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.FeatureManagement.Client + LINGYUN.Abp.FeatureManagement.Client + false + false + false diff --git a/aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN/Abp/FeatureManagement/Client/AbpFeatureManagementClientModule.cs b/aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN/Abp/FeatureManagement/Client/AbpFeatureManagementClientModule.cs index 53073bb72..a07018616 100644 --- a/aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN/Abp/FeatureManagement/Client/AbpFeatureManagementClientModule.cs +++ b/aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN/Abp/FeatureManagement/Client/AbpFeatureManagementClientModule.cs @@ -7,34 +7,33 @@ using Volo.Abp.VirtualFileSystem; using Volo.Abp.FeatureManagement.Localization; -namespace LINGYUN.Abp.FeatureManagement +namespace LINGYUN.Abp.FeatureManagement; + +[DependsOn( + typeof(AbpFeaturesClientModule), + typeof(AbpFeatureManagementDomainModule) + )] +public class AbpFeatureManagementClientModule : AbpModule { - [DependsOn( - typeof(AbpFeaturesClientModule), - typeof(AbpFeatureManagementDomainModule) - )] - public class AbpFeatureManagementClientModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + Configure(options => { - Configure(options => - { - options.FileSets.AddEmbedded(); - }); + options.FileSets.AddEmbedded(); + }); - Configure(options => - { - options.Providers.Add(); + Configure(options => + { + options.Providers.Add(); - options.ProviderPolicies[ClientFeatureValueProvider.ProviderName] = ClientFeaturePermissionNames.ManageClientFeatures; - }); + options.ProviderPolicies[ClientFeatureValueProvider.ProviderName] = ClientFeaturePermissionNames.ManageClientFeatures; + }); - Configure(options => - { - options.Resources - .Get() - .AddVirtualJson("/LINGYUN/Abp/FeatureManagement/Client/Localization/Resources"); - }); - } + Configure(options => + { + options.Resources + .Get() + .AddVirtualJson("/LINGYUN/Abp/FeatureManagement/Client/Localization/Resources"); + }); } } diff --git a/aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN/Abp/FeatureManagement/Client/ClientFeatureManagementProvider.cs b/aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN/Abp/FeatureManagement/Client/ClientFeatureManagementProvider.cs index a7f441917..cad41f55a 100644 --- a/aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN/Abp/FeatureManagement/Client/ClientFeatureManagementProvider.cs +++ b/aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN/Abp/FeatureManagement/Client/ClientFeatureManagementProvider.cs @@ -4,32 +4,31 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.FeatureManagement; -namespace LINGYUN.Abp.FeatureManagement.Client +namespace LINGYUN.Abp.FeatureManagement.Client; + + +public class ClientFeatureManagementProvider : FeatureManagementProvider, ITransientDependency { + public override string Name => ClientFeatureValueProvider.ProviderName; + + protected ICurrentClient CurrentClient; - public class ClientFeatureManagementProvider : FeatureManagementProvider, ITransientDependency + public ClientFeatureManagementProvider( + ICurrentClient currentClient, + IFeatureManagementStore store) + : base(store) { - public override string Name => ClientFeatureValueProvider.ProviderName; + CurrentClient = currentClient; + } - protected ICurrentClient CurrentClient; - public ClientFeatureManagementProvider( - ICurrentClient currentClient, - IFeatureManagementStore store) - : base(store) + protected override Task NormalizeProviderKeyAsync(string providerKey) + { + if (providerKey != null) { - CurrentClient = currentClient; + return base.NormalizeProviderKeyAsync(providerKey); } - - protected override Task NormalizeProviderKeyAsync(string providerKey) - { - if (providerKey != null) - { - return base.NormalizeProviderKeyAsync(providerKey); - } - - return Task.FromResult(CurrentClient.Id); - } + return Task.FromResult(CurrentClient.Id); } } diff --git a/aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN/Abp/FeatureManagement/Client/Permissions/ClientFeaturePermissionDefinitionProvider.cs b/aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN/Abp/FeatureManagement/Client/Permissions/ClientFeaturePermissionDefinitionProvider.cs index 10c57f654..6f050c2ad 100644 --- a/aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN/Abp/FeatureManagement/Client/Permissions/ClientFeaturePermissionDefinitionProvider.cs +++ b/aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN/Abp/FeatureManagement/Client/Permissions/ClientFeaturePermissionDefinitionProvider.cs @@ -3,27 +3,26 @@ using Volo.Abp.FeatureManagement.Localization; using Volo.Abp.Localization; -namespace LINGYUN.Abp.FeatureManagement.Client.Permissions +namespace LINGYUN.Abp.FeatureManagement.Client.Permissions; + +public class ClientFeaturePermissionDefinitionProvider : PermissionDefinitionProvider { - public class ClientFeaturePermissionDefinitionProvider : PermissionDefinitionProvider + public override void Define(IPermissionDefinitionContext context) { - public override void Define(IPermissionDefinitionContext context) - { - // TODO: 硬编码权限名称还是引用 Volo.Abp.FeatureManagement.Application.Contracts? + // TODO: 硬编码权限名称还是引用 Volo.Abp.FeatureManagement.Application.Contracts? - var identityServerGroup = context.GetGroupOrNull(ClientFeaturePermissionNames.GroupName); - Check.NotNull(identityServerGroup, $"Permissions:{ClientFeaturePermissionNames.GroupName}"); + var identityServerGroup = context.GetGroupOrNull(ClientFeaturePermissionNames.GroupName); + Check.NotNull(identityServerGroup, $"Permissions:{ClientFeaturePermissionNames.GroupName}"); - identityServerGroup - .AddPermission( - name: ClientFeaturePermissionNames.ManageClientFeatures, - displayName: L("Permissions:ManageClientFeatures"), - multiTenancySide: Volo.Abp.MultiTenancy.MultiTenancySides.Host); - } + identityServerGroup + .AddPermission( + name: ClientFeaturePermissionNames.ManageClientFeatures, + displayName: L("Permissions:ManageClientFeatures"), + multiTenancySide: Volo.Abp.MultiTenancy.MultiTenancySides.Host); + } - protected virtual LocalizableString L(string name) - { - return LocalizableString.Create(name); - } + protected virtual LocalizableString L(string name) + { + return LocalizableString.Create(name); } } diff --git a/aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN/Abp/FeatureManagement/Client/Permissions/ClientFeaturePermissionNames.cs b/aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN/Abp/FeatureManagement/Client/Permissions/ClientFeaturePermissionNames.cs index 137fc7efb..195a2507f 100644 --- a/aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN/Abp/FeatureManagement/Client/Permissions/ClientFeaturePermissionNames.cs +++ b/aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN/Abp/FeatureManagement/Client/Permissions/ClientFeaturePermissionNames.cs @@ -1,9 +1,8 @@ -namespace LINGYUN.Abp.FeatureManagement.Client.Permissions +namespace LINGYUN.Abp.FeatureManagement.Client.Permissions; + +public class ClientFeaturePermissionNames { - public class ClientFeaturePermissionNames - { - public const string GroupName = "FeatureManagement"; + public const string GroupName = "FeatureManagement"; - public const string ManageClientFeatures = GroupName + ".ManageClientFeatures"; - } + public const string ManageClientFeatures = GroupName + ".ManageClientFeatures"; } diff --git a/aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN/Abp/FeatureManagement/ClientFeatureManagerExtensions.cs b/aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN/Abp/FeatureManagement/ClientFeatureManagerExtensions.cs index 60f929f79..229ec1b2f 100644 --- a/aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN/Abp/FeatureManagement/ClientFeatureManagerExtensions.cs +++ b/aspnet-core/framework/features/LINGYUN.Abp.FeatureManagement.Client/LINGYUN/Abp/FeatureManagement/ClientFeatureManagerExtensions.cs @@ -4,33 +4,32 @@ using System.Threading.Tasks; using Volo.Abp.FeatureManagement; -namespace LINGYUN.Abp.FeatureManagement +namespace LINGYUN.Abp.FeatureManagement; + +public static class ClientFeatureManagerExtensions { - public static class ClientFeatureManagerExtensions + public static Task GetOrNullForClientAsync(this IFeatureManager featureManager, [NotNull] string name, string clientId, bool fallback = true) { - public static Task GetOrNullForClientAsync(this IFeatureManager featureManager, [NotNull] string name, string clientId, bool fallback = true) - { - return featureManager.GetOrNullAsync(name, ClientFeatureValueProvider.ProviderName, clientId, fallback); - } + return featureManager.GetOrNullAsync(name, ClientFeatureValueProvider.ProviderName, clientId, fallback); + } - public static Task> GetAllForClientAsync(this IFeatureManager featureManager, string clientId, bool fallback = true) - { - return featureManager.GetAllAsync(ClientFeatureValueProvider.ProviderName, clientId, fallback); - } + public static Task> GetAllForClientAsync(this IFeatureManager featureManager, string clientId, bool fallback = true) + { + return featureManager.GetAllAsync(ClientFeatureValueProvider.ProviderName, clientId, fallback); + } - public static Task GetOrNullWithProviderForClientAsync(this IFeatureManager featureManager, [NotNull] string name, string clientId, bool fallback = true) - { - return featureManager.GetOrNullWithProviderAsync(name, ClientFeatureValueProvider.ProviderName, clientId, fallback); - } + public static Task GetOrNullWithProviderForClientAsync(this IFeatureManager featureManager, [NotNull] string name, string clientId, bool fallback = true) + { + return featureManager.GetOrNullWithProviderAsync(name, ClientFeatureValueProvider.ProviderName, clientId, fallback); + } - public static Task> GetAllWithProviderForClientAsync(this IFeatureManager featureManager, string clientId, bool fallback = true) - { - return featureManager.GetAllWithProviderAsync(ClientFeatureValueProvider.ProviderName, clientId, fallback); - } + public static Task> GetAllWithProviderForClientAsync(this IFeatureManager featureManager, string clientId, bool fallback = true) + { + return featureManager.GetAllWithProviderAsync(ClientFeatureValueProvider.ProviderName, clientId, fallback); + } - public static Task SetForEditionAsync(this IFeatureManager featureManager, string clientId, [NotNull] string name, [CanBeNull] string value, bool forceToSet = false) - { - return featureManager.SetAsync(name, value, ClientFeatureValueProvider.ProviderName, clientId, forceToSet); - } + public static Task SetForEditionAsync(this IFeatureManager featureManager, string clientId, [NotNull] string name, [CanBeNull] string value, bool forceToSet = false) + { + return featureManager.SetAsync(name, value, ClientFeatureValueProvider.ProviderName, clientId, forceToSet); } } diff --git a/aspnet-core/framework/features/LINGYUN.Abp.Features.Client/LINGYUN.Abp.Features.Client.csproj b/aspnet-core/framework/features/LINGYUN.Abp.Features.Client/LINGYUN.Abp.Features.Client.csproj index ee9a1dd77..a2be6ee55 100644 --- a/aspnet-core/framework/features/LINGYUN.Abp.Features.Client/LINGYUN.Abp.Features.Client.csproj +++ b/aspnet-core/framework/features/LINGYUN.Abp.Features.Client/LINGYUN.Abp.Features.Client.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Features.Client + LINGYUN.Abp.Features.Client + false + false + false diff --git a/aspnet-core/framework/features/LINGYUN.Abp.Features.Client/LINGYUN/Abp/Features/Client/AbpFeaturesClientModule.cs b/aspnet-core/framework/features/LINGYUN.Abp.Features.Client/LINGYUN/Abp/Features/Client/AbpFeaturesClientModule.cs index 6b5b6475f..be858dfac 100644 --- a/aspnet-core/framework/features/LINGYUN.Abp.Features.Client/LINGYUN/Abp/Features/Client/AbpFeaturesClientModule.cs +++ b/aspnet-core/framework/features/LINGYUN.Abp.Features.Client/LINGYUN/Abp/Features/Client/AbpFeaturesClientModule.cs @@ -1,18 +1,17 @@ using Volo.Abp.Features; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.Features.Client +namespace LINGYUN.Abp.Features.Client; + +[DependsOn( + typeof(AbpFeaturesModule))] +public class AbpFeaturesClientModule : AbpModule { - [DependsOn( - typeof(AbpFeaturesModule))] - public class AbpFeaturesClientModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + Configure(options => { - Configure(options => - { - options.ValueProviders.Add(); - }); - } + options.ValueProviders.Add(); + }); } } diff --git a/aspnet-core/framework/features/LINGYUN.Abp.Features.Client/LINGYUN/Abp/Features/Client/ClientFeatureValueProvider.cs b/aspnet-core/framework/features/LINGYUN.Abp.Features.Client/LINGYUN/Abp/Features/Client/ClientFeatureValueProvider.cs index 14ac3ea22..380f7330e 100644 --- a/aspnet-core/framework/features/LINGYUN.Abp.Features.Client/LINGYUN/Abp/Features/Client/ClientFeatureValueProvider.cs +++ b/aspnet-core/framework/features/LINGYUN.Abp.Features.Client/LINGYUN/Abp/Features/Client/ClientFeatureValueProvider.cs @@ -2,32 +2,31 @@ using Volo.Abp.Clients; using Volo.Abp.Features; -namespace LINGYUN.Abp.Features.Client +namespace LINGYUN.Abp.Features.Client; + +public class ClientFeatureValueProvider : FeatureValueProvider { - public class ClientFeatureValueProvider : FeatureValueProvider - { - public const string ProviderName = "C"; + public const string ProviderName = "C"; - public override string Name => ProviderName; + public override string Name => ProviderName; - protected ICurrentClient CurrentClient; + protected ICurrentClient CurrentClient; - public ClientFeatureValueProvider( - IFeatureStore featureStore, - ICurrentClient currentClient) - : base(featureStore) - { - CurrentClient = currentClient; - } + public ClientFeatureValueProvider( + IFeatureStore featureStore, + ICurrentClient currentClient) + : base(featureStore) + { + CurrentClient = currentClient; + } - public override async Task GetOrNullAsync(FeatureDefinition feature) + public override async Task GetOrNullAsync(FeatureDefinition feature) + { + if (!CurrentClient.IsAuthenticated) { - if (!CurrentClient.IsAuthenticated) - { - return null; - } - - return await FeatureStore.GetOrNullAsync(feature.Name, Name, CurrentClient.Id); + return null; } + + return await FeatureStore.GetOrNullAsync(feature.Name, Name, CurrentClient.Id); } } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN.Abp.AspNetCore.Mvc.Localization.csproj b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN.Abp.AspNetCore.Mvc.Localization.csproj index 68995e5c5..f37a9f4b2 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN.Abp.AspNetCore.Mvc.Localization.csproj +++ b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN.Abp.AspNetCore.Mvc.Localization.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.AspNetCore.Mvc.Localization + LINGYUN.Abp.AspNetCore.Mvc.Localization + false + false + false diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetLanguageWithFilterDto.cs b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetLanguageWithFilterDto.cs index 8f9ba08c5..c26f460ff 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetLanguageWithFilterDto.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetLanguageWithFilterDto.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.AspNetCore.Mvc.Localization +namespace LINGYUN.Abp.AspNetCore.Mvc.Localization; + +public class GetLanguageWithFilterDto { - public class GetLanguageWithFilterDto - { - public string Filter { get; set; } - } + public string Filter { get; set; } } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetResourceWithFilterDto.cs b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetResourceWithFilterDto.cs index 5bf1fdf17..bf2134dad 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetResourceWithFilterDto.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetResourceWithFilterDto.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.AspNetCore.Mvc.Localization +namespace LINGYUN.Abp.AspNetCore.Mvc.Localization; + +public class GetResourceWithFilterDto { - public class GetResourceWithFilterDto - { - public string Filter { get; set; } - } + public string Filter { get; set; } } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetTextByKeyInput.cs b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetTextByKeyInput.cs index 0029e1567..8a08370cf 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetTextByKeyInput.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetTextByKeyInput.cs @@ -1,17 +1,16 @@ using System.ComponentModel.DataAnnotations; using Volo.Abp.Validation; -namespace LINGYUN.Abp.AspNetCore.Mvc.Localization +namespace LINGYUN.Abp.AspNetCore.Mvc.Localization; + +public class GetTextByKeyInput { - public class GetTextByKeyInput - { - [Required] - public string Key { get; set; } + [Required] + public string Key { get; set; } - [Required] - public string CultureName { get; set; } + [Required] + public string CultureName { get; set; } - [Required] - public string ResourceName { get; set; } - } + [Required] + public string ResourceName { get; set; } } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetTextsInput.cs b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetTextsInput.cs index 87e0c3711..e1536930f 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetTextsInput.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/GetTextsInput.cs @@ -1,19 +1,18 @@ using System.ComponentModel.DataAnnotations; -namespace LINGYUN.Abp.AspNetCore.Mvc.Localization +namespace LINGYUN.Abp.AspNetCore.Mvc.Localization; + +public class GetTextsInput { - public class GetTextsInput - { - [Required] - public string CultureName { get; set; } + [Required] + public string CultureName { get; set; } - [Required] - public string TargetCultureName { get; set; } + [Required] + public string TargetCultureName { get; set; } - public string ResourceName { get; set; } + public string ResourceName { get; set; } - public bool? OnlyNull { get; set; } + public bool? OnlyNull { get; set; } - public string Filter { get; set; } - } + public string Filter { get; set; } } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/ILanguageAppService.cs b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/ILanguageAppService.cs index de63709fb..fbef33e29 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/ILanguageAppService.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/ILanguageAppService.cs @@ -2,10 +2,9 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; -namespace LINGYUN.Abp.AspNetCore.Mvc.Localization +namespace LINGYUN.Abp.AspNetCore.Mvc.Localization; + +public interface ILanguageAppService : IApplicationService { - public interface ILanguageAppService : IApplicationService - { - Task> GetListAsync(GetLanguageWithFilterDto input); - } + Task> GetListAsync(GetLanguageWithFilterDto input); } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/IResourceAppService.cs b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/IResourceAppService.cs index 307a1bcd4..8a5ead219 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/IResourceAppService.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/IResourceAppService.cs @@ -2,10 +2,9 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; -namespace LINGYUN.Abp.AspNetCore.Mvc.Localization +namespace LINGYUN.Abp.AspNetCore.Mvc.Localization; + +public interface IResourceAppService : IApplicationService { - public interface IResourceAppService : IApplicationService - { - Task> GetListAsync(GetResourceWithFilterDto input); - } + Task> GetListAsync(GetResourceWithFilterDto input); } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/ITextAppService.cs b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/ITextAppService.cs index a22c23611..f3fa5c996 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/ITextAppService.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/ITextAppService.cs @@ -2,12 +2,11 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; -namespace LINGYUN.Abp.AspNetCore.Mvc.Localization +namespace LINGYUN.Abp.AspNetCore.Mvc.Localization; + +public interface ITextAppService : IApplicationService { - public interface ITextAppService : IApplicationService - { - Task GetByCultureKeyAsync(GetTextByKeyInput input); + Task GetByCultureKeyAsync(GetTextByKeyInput input); - Task> GetListAsync(GetTextsInput input); - } + Task> GetListAsync(GetTextsInput input); } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/LanguageAppService.cs b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/LanguageAppService.cs index 730736158..7c7b34a07 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/LanguageAppService.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/LanguageAppService.cs @@ -8,35 +8,34 @@ using Volo.Abp.Application.Services; using Volo.Abp.Localization; -namespace LINGYUN.Abp.AspNetCore.Mvc.Localization +namespace LINGYUN.Abp.AspNetCore.Mvc.Localization; + +[Authorize] +public class LanguageAppService : ApplicationService, ILanguageAppService { - [Authorize] - public class LanguageAppService : ApplicationService, ILanguageAppService + private readonly ILanguageProvider _languageProvider; + public LanguageAppService(ILanguageProvider languageProvider) { - private readonly ILanguageProvider _languageProvider; - public LanguageAppService(ILanguageProvider languageProvider) - { - _languageProvider = languageProvider; - } + _languageProvider = languageProvider; + } - public async virtual Task> GetListAsync(GetLanguageWithFilterDto input) - { - var languages = (await _languageProvider.GetLanguagesAsync()) - .WhereIf(!input.Filter.IsNullOrWhiteSpace(), x => x.CultureName.IndexOf(input.Filter, StringComparison.OrdinalIgnoreCase) >= 0 - || x.UiCultureName.IndexOf(input.Filter, StringComparison.OrdinalIgnoreCase) >= 0 - || x.DisplayName.IndexOf(input.Filter, StringComparison.OrdinalIgnoreCase) >= 0); + public async virtual Task> GetListAsync(GetLanguageWithFilterDto input) + { + var languages = (await _languageProvider.GetLanguagesAsync()) + .WhereIf(!input.Filter.IsNullOrWhiteSpace(), x => x.CultureName.IndexOf(input.Filter, StringComparison.OrdinalIgnoreCase) >= 0 + || x.UiCultureName.IndexOf(input.Filter, StringComparison.OrdinalIgnoreCase) >= 0 + || x.DisplayName.IndexOf(input.Filter, StringComparison.OrdinalIgnoreCase) >= 0); - return new ListResultDto( - languages.Select(l => new LanguageDto - { - CultureName = l.CultureName, - UiCultureName = l.UiCultureName, - DisplayName = l.DisplayName, - FlagIcon = l.FlagIcon - }) - .OrderBy(l => l.CultureName) - .DistinctBy(l => l.CultureName) - .ToList()); - } + return new ListResultDto( + languages.Select(l => new LanguageDto + { + CultureName = l.CultureName, + UiCultureName = l.UiCultureName, + DisplayName = l.DisplayName, + TwoLetterISOLanguageName = l.TwoLetterISOLanguageName + }) + .OrderBy(l => l.CultureName) + .DistinctBy(l => l.CultureName) + .ToList()); } } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/LanguageController.cs b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/LanguageController.cs index fcb9b199e..0774266d0 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/LanguageController.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/LanguageController.cs @@ -4,24 +4,23 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.AspNetCore.Mvc; -namespace LINGYUN.Abp.AspNetCore.Mvc.Localization +namespace LINGYUN.Abp.AspNetCore.Mvc.Localization; + +[Area("abp")] +[RemoteService(Name = "abp")] +[Route("api/abp/localization/languages")] +public class LanguageController : AbpControllerBase, ILanguageAppService { - [Area("abp")] - [RemoteService(Name = "abp")] - [Route("api/abp/localization/languages")] - public class LanguageController : AbpControllerBase, ILanguageAppService - { - private readonly ILanguageAppService _service; + private readonly ILanguageAppService _service; - public LanguageController(ILanguageAppService service) - { - _service = service; - } + public LanguageController(ILanguageAppService service) + { + _service = service; + } - [HttpGet] - public virtual Task> GetListAsync(GetLanguageWithFilterDto input) - { - return _service.GetListAsync(input); - } + [HttpGet] + public virtual Task> GetListAsync(GetLanguageWithFilterDto input) + { + return _service.GetListAsync(input); } } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/LanguageDto.cs b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/LanguageDto.cs index e0e38627c..024d9d1c4 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/LanguageDto.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/LanguageDto.cs @@ -5,6 +5,6 @@ public class LanguageDto public string CultureName { get; set; } public string UiCultureName { get; set; } public string DisplayName { get; set; } - public string FlagIcon { get; set; } + public string TwoLetterISOLanguageName { get; set; } } } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/ResourceAppService.cs b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/ResourceAppService.cs index 1ce569143..ac8d6db76 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/ResourceAppService.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/ResourceAppService.cs @@ -10,46 +10,45 @@ using Volo.Abp.Localization; using Volo.Abp.Localization.External; -namespace LINGYUN.Abp.AspNetCore.Mvc.Localization +namespace LINGYUN.Abp.AspNetCore.Mvc.Localization; + +[Authorize] +public class ResourceAppService : ApplicationService, IResourceAppService { - [Authorize] - public class ResourceAppService : ApplicationService, IResourceAppService - { - private readonly IExternalLocalizationStore _externalLocalizationStore; - private readonly AbpLocalizationOptions _localizationOptions; + private readonly IExternalLocalizationStore _externalLocalizationStore; + private readonly AbpLocalizationOptions _localizationOptions; - public ResourceAppService( - IOptions localizationOptions, - IExternalLocalizationStore externalLocalizationStore) - { - _localizationOptions = localizationOptions.Value; - _externalLocalizationStore = externalLocalizationStore; - } + public ResourceAppService( + IOptions localizationOptions, + IExternalLocalizationStore externalLocalizationStore) + { + _localizationOptions = localizationOptions.Value; + _externalLocalizationStore = externalLocalizationStore; + } - public virtual async Task> GetListAsync(GetResourceWithFilterDto input) - { - var externalResources = (await _externalLocalizationStore.GetResourcesAsync()) - .WhereIf(!input.Filter.IsNullOrWhiteSpace(), x => x.ResourceName.Contains(input.Filter, StringComparison.OrdinalIgnoreCase)); + public virtual async Task> GetListAsync(GetResourceWithFilterDto input) + { + var externalResources = (await _externalLocalizationStore.GetResourcesAsync()) + .WhereIf(!input.Filter.IsNullOrWhiteSpace(), x => x.ResourceName.Contains(input.Filter, StringComparison.OrdinalIgnoreCase)); - var resources = _localizationOptions - .Resources - .WhereIf(!input.Filter.IsNullOrWhiteSpace(), x => x.Value.ResourceName.Contains(input.Filter, StringComparison.OrdinalIgnoreCase)) - .Select(x => new ResourceDto - { - Name = x.Value.ResourceName, - DisplayName = x.Value.ResourceName, - Description = x.Value.ResourceName, - }) - .Union(externalResources.Select(resource => new ResourceDto - { - Name = resource.ResourceName, - DisplayName = resource.ResourceName, - Description = resource.ResourceName, - })) - .OrderBy(l => l.Name) - .DistinctBy(l => l.Name); + var resources = _localizationOptions + .Resources + .WhereIf(!input.Filter.IsNullOrWhiteSpace(), x => x.Value.ResourceName.Contains(input.Filter, StringComparison.OrdinalIgnoreCase)) + .Select(x => new ResourceDto + { + Name = x.Value.ResourceName, + DisplayName = x.Value.ResourceName, + Description = x.Value.ResourceName, + }) + .Union(externalResources.Select(resource => new ResourceDto + { + Name = resource.ResourceName, + DisplayName = resource.ResourceName, + Description = resource.ResourceName, + })) + .OrderBy(l => l.Name) + .DistinctBy(l => l.Name); - return new ListResultDto(resources.ToList()); - } + return new ListResultDto(resources.ToList()); } } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/ResourceController.cs b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/ResourceController.cs index c867ee506..9adcb0c1d 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/ResourceController.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/ResourceController.cs @@ -4,24 +4,23 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.AspNetCore.Mvc; -namespace LINGYUN.Abp.AspNetCore.Mvc.Localization +namespace LINGYUN.Abp.AspNetCore.Mvc.Localization; + +[Area("abp")] +[RemoteService(Name = "abp")] +[Route("api/abp/localization/resources")] +public class ResourceController : AbpControllerBase, IResourceAppService { - [Area("abp")] - [RemoteService(Name = "abp")] - [Route("api/abp/localization/resources")] - public class ResourceController : AbpControllerBase, IResourceAppService - { - private readonly IResourceAppService _service; + private readonly IResourceAppService _service; - public ResourceController(IResourceAppService service) - { - _service = service; - } + public ResourceController(IResourceAppService service) + { + _service = service; + } - [HttpGet] - public virtual Task> GetListAsync(GetResourceWithFilterDto input) - { - return _service.GetListAsync(input); - } + [HttpGet] + public virtual Task> GetListAsync(GetResourceWithFilterDto input) + { + return _service.GetListAsync(input); } } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/ResourceDto.cs b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/ResourceDto.cs index d47887849..8fe5dc568 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/ResourceDto.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/ResourceDto.cs @@ -1,9 +1,8 @@ -namespace LINGYUN.Abp.AspNetCore.Mvc.Localization +namespace LINGYUN.Abp.AspNetCore.Mvc.Localization; + +public class ResourceDto { - public class ResourceDto - { - public string Name { get; set; } - public string DisplayName { get; set; } - public string Description { get; set; } - } + public string Name { get; set; } + public string DisplayName { get; set; } + public string Description { get; set; } } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/TextAppService.cs b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/TextAppService.cs index 1c9f0b5c0..a5cf04a00 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/TextAppService.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/TextAppService.cs @@ -10,133 +10,120 @@ using Volo.Abp.Localization; using Volo.Abp.Localization.External; -namespace LINGYUN.Abp.AspNetCore.Mvc.Localization +namespace LINGYUN.Abp.AspNetCore.Mvc.Localization; + +[Authorize] +public class TextAppService : ApplicationService, ITextAppService { - [Authorize] - public class TextAppService : ApplicationService, ITextAppService + private readonly AbpLocalizationOptions _localizationOptions; + private readonly IStringLocalizerFactory _localizerFactory; + private readonly IExternalLocalizationStore _externalLocalizationStore; + public TextAppService( + IStringLocalizerFactory stringLocalizerFactory, + IExternalLocalizationStore externalLocalizationStore, + IOptions localizationOptions) { - private readonly AbpLocalizationOptions _localizationOptions; - private readonly IStringLocalizerFactory _localizerFactory; - private readonly IExternalLocalizationStore _externalLocalizationStore; - public TextAppService( - IStringLocalizerFactory stringLocalizerFactory, - IExternalLocalizationStore externalLocalizationStore, - IOptions localizationOptions) - { - _localizerFactory = stringLocalizerFactory; - _externalLocalizationStore = externalLocalizationStore; - _localizationOptions = localizationOptions.Value; - } + _localizerFactory = stringLocalizerFactory; + _externalLocalizationStore = externalLocalizationStore; + _localizationOptions = localizationOptions.Value; + } - public async virtual Task GetByCultureKeyAsync(GetTextByKeyInput input) - { - var localizer = await _localizerFactory.CreateByResourceNameAsync(input.ResourceName); + public async virtual Task GetByCultureKeyAsync(GetTextByKeyInput input) + { + var localizer = await _localizerFactory.CreateByResourceNameAsync(input.ResourceName); - using (CultureHelper.Use(input.CultureName, input.CultureName)) + using (CultureHelper.Use(input.CultureName, input.CultureName)) + { + var result = new TextDto { - var result = new TextDto - { - Key = input.Key, - CultureName = input.CultureName, - ResourceName = input.ResourceName, - Value = localizer[input.Key]?.Value - }; + Key = input.Key, + CultureName = input.CultureName, + ResourceName = input.ResourceName, + Value = localizer[input.Key]?.Value + }; - return result; - } + return result; } + } + + public async virtual Task> GetListAsync(GetTextsInput input) + { + var result = new List(); - public async virtual Task> GetListAsync(GetTextsInput input) + if (input.ResourceName.IsNullOrWhiteSpace()) { - var result = new List(); + var filterResources = _localizationOptions.Resources + .Select(r => r.Value) + .Union(await _externalLocalizationStore.GetResourcesAsync()) + .DistinctBy(r => r.ResourceName) + .WhereIf(!input.Filter.IsNullOrWhiteSpace(), x => x.ResourceName.Contains(input.Filter)) + .OrderBy(r => r.ResourceName); - if (input.ResourceName.IsNullOrWhiteSpace()) + foreach (var resource in filterResources) { - var filterResources = _localizationOptions.Resources - .Select(r => r.Value) - .Union(await _externalLocalizationStore.GetResourcesAsync()) - .DistinctBy(r => r.ResourceName) - .WhereIf(!input.Filter.IsNullOrWhiteSpace(), x => x.ResourceName.Contains(input.Filter)) - .OrderBy(r => r.ResourceName); - - foreach (var resource in filterResources) - { - result.AddRange( - await GetTextDifferences(resource, input.CultureName, input.TargetCultureName, input.Filter, input.OnlyNull)); - } + result.AddRange( + await GetTextDifferences(resource, input.CultureName, input.TargetCultureName, input.Filter, input.OnlyNull)); } - else + } + else + { + var resource = _localizationOptions.Resources + .Select(r => r.Value) + .Union(await _externalLocalizationStore.GetResourcesAsync()) + .DistinctBy(r => r.ResourceName) + .Where(l => l.ResourceName.Equals(input.ResourceName)) + .WhereIf(!input.Filter.IsNullOrWhiteSpace(), x => x.ResourceName.Contains(input.Filter)) + .FirstOrDefault(); + if (resource != null) { - var resource = _localizationOptions.Resources - .Select(r => r.Value) - .Union(await _externalLocalizationStore.GetResourcesAsync()) - .DistinctBy(r => r.ResourceName) - .Where(l => l.ResourceName.Equals(input.ResourceName)) - .WhereIf(!input.Filter.IsNullOrWhiteSpace(), x => x.ResourceName.Contains(input.Filter)) - .FirstOrDefault(); - if (resource != null) - { - result.AddRange( - await GetTextDifferences(resource, input.CultureName, input.TargetCultureName, input.Filter, input.OnlyNull)); - } + result.AddRange( + await GetTextDifferences(resource, input.CultureName, input.TargetCultureName, input.Filter, input.OnlyNull)); } - - return new ListResultDto(result); } - protected async virtual Task> GetTextDifferences( - LocalizationResourceBase resource, - string cultureName, - string targetCultureName, - string filter = null, - bool? onlyNull = null) - { - var result = new List(); + return new ListResultDto(result); + } + + protected async virtual Task> GetTextDifferences( + LocalizationResourceBase resource, + string cultureName, + string targetCultureName, + string filter = null, + bool? onlyNull = null) + { + var result = new List(); - IEnumerable localizedStrings = new List(); - IEnumerable targetLocalizedStrings = new List(); - var localizer = await _localizerFactory.CreateByResourceNameAsync(resource.ResourceName); + IEnumerable localizedStrings = new List(); + IEnumerable targetLocalizedStrings = new List(); + var localizer = await _localizerFactory.CreateByResourceNameAsync(resource.ResourceName); - using (CultureHelper.Use(cultureName, cultureName)) + using (CultureHelper.Use(cultureName, cultureName)) + { + localizedStrings = (await localizer.GetAllStringsAsync(true)) + .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Name.Contains(filter)) + .OrderBy(l => l.Name); + } + + if (Equals(cultureName, targetCultureName)) + { + targetLocalizedStrings = localizedStrings; + } + else + { + using (CultureHelper.Use(targetCultureName, targetCultureName)) { - localizedStrings = (await localizer.GetAllStringsAsync(true)) + targetLocalizedStrings = (await localizer.GetAllStringsAsync(true)) .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Name.Contains(filter)) .OrderBy(l => l.Name); } + } - if (Equals(cultureName, targetCultureName)) - { - targetLocalizedStrings = localizedStrings; - } - else - { - using (CultureHelper.Use(targetCultureName, targetCultureName)) - { - targetLocalizedStrings = (await localizer.GetAllStringsAsync(true)) - .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Name.Contains(filter)) - .OrderBy(l => l.Name); - } - } - - foreach (var localizedString in localizedStrings) + foreach (var localizedString in localizedStrings) + { + var targetLocalizedString = targetLocalizedStrings.FirstOrDefault(l => l.Name.Equals(localizedString.Name)); + if (onlyNull == true) { - var targetLocalizedString = targetLocalizedStrings.FirstOrDefault(l => l.Name.Equals(localizedString.Name)); - if (onlyNull == true) - { - if (targetLocalizedString == null || targetLocalizedString.Value.IsNullOrWhiteSpace()) - { - result.Add(new TextDifferenceDto - { - CultureName = cultureName, - TargetCultureName = targetCultureName, - Key = localizedString.Name, - Value = localizedString.Value, - TargetValue = null, - ResourceName = resource.ResourceName - }); - } - } - else + if (targetLocalizedString == null || targetLocalizedString.Value.IsNullOrWhiteSpace()) { result.Add(new TextDifferenceDto { @@ -144,13 +131,25 @@ protected async virtual Task> GetTextDifferences( TargetCultureName = targetCultureName, Key = localizedString.Name, Value = localizedString.Value, - TargetValue = targetLocalizedString?.Value, + TargetValue = null, ResourceName = resource.ResourceName }); } } - - return result; + else + { + result.Add(new TextDifferenceDto + { + CultureName = cultureName, + TargetCultureName = targetCultureName, + Key = localizedString.Name, + Value = localizedString.Value, + TargetValue = targetLocalizedString?.Value, + ResourceName = resource.ResourceName + }); + } } + + return result; } } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/TextController.cs b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/TextController.cs index 54540641a..2b51fbab7 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/TextController.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/TextController.cs @@ -4,31 +4,30 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.AspNetCore.Mvc; -namespace LINGYUN.Abp.AspNetCore.Mvc.Localization +namespace LINGYUN.Abp.AspNetCore.Mvc.Localization; + +[Area("abp")] +[RemoteService(Name = "abp")] +[Route("api/abp/localization/texts")] +public class TextController : AbpControllerBase, ITextAppService { - [Area("abp")] - [RemoteService(Name = "abp")] - [Route("api/abp/localization/texts")] - public class TextController : AbpControllerBase, ITextAppService - { - private readonly ITextAppService _service; + private readonly ITextAppService _service; - public TextController(ITextAppService service) - { - _service = service; - } + public TextController(ITextAppService service) + { + _service = service; + } - [HttpGet] - [Route("by-culture-key")] - public virtual Task GetByCultureKeyAsync(GetTextByKeyInput input) - { - return _service.GetByCultureKeyAsync(input); - } + [HttpGet] + [Route("by-culture-key")] + public virtual Task GetByCultureKeyAsync(GetTextByKeyInput input) + { + return _service.GetByCultureKeyAsync(input); + } - [HttpGet] - public virtual Task> GetListAsync(GetTextsInput input) - { - return _service.GetListAsync(input); - } + [HttpGet] + public virtual Task> GetListAsync(GetTextsInput input) + { + return _service.GetListAsync(input); } } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/TextDifferenceDto.cs b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/TextDifferenceDto.cs index 6205a4522..19e983319 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/TextDifferenceDto.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/TextDifferenceDto.cs @@ -1,17 +1,16 @@ -namespace LINGYUN.Abp.AspNetCore.Mvc.Localization +namespace LINGYUN.Abp.AspNetCore.Mvc.Localization; + +public class TextDifferenceDto { - public class TextDifferenceDto - { - public string CultureName { get; set; } - public string Key { get; set; } - public string Value { get; set; } - public string ResourceName { get; set; } - public string TargetCultureName { get; set; } - public string TargetValue { get; set; } + public string CultureName { get; set; } + public string Key { get; set; } + public string Value { get; set; } + public string ResourceName { get; set; } + public string TargetCultureName { get; set; } + public string TargetValue { get; set; } - public int CompareTo(TextDifferenceDto other) - { - return other.ResourceName.CompareTo(ResourceName) ^ other.Key.CompareTo(Key); - } + public int CompareTo(TextDifferenceDto other) + { + return other.ResourceName.CompareTo(ResourceName) ^ other.Key.CompareTo(Key); } } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/TextDto.cs b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/TextDto.cs index 9b4e77322..110793d38 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/TextDto.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.AspNetCore.Mvc.Localization/LINGYUN/Abp/AspNetCore/Mvc/Localization/TextDto.cs @@ -1,10 +1,9 @@ -namespace LINGYUN.Abp.AspNetCore.Mvc.Localization +namespace LINGYUN.Abp.AspNetCore.Mvc.Localization; + +public class TextDto { - public class TextDto - { - public string Key { get; set; } - public string Value { get; set; } - public string CultureName { get; set; } - public string ResourceName { get; set; } - } + public string Key { get; set; } + public string Value { get; set; } + public string CultureName { get; set; } + public string ResourceName { get; set; } } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/LINGYUN.Abp.Localization.CultureMap.csproj b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/LINGYUN.Abp.Localization.CultureMap.csproj index 2298ea3fd..b2d3ae2c2 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/LINGYUN.Abp.Localization.CultureMap.csproj +++ b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/LINGYUN.Abp.Localization.CultureMap.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.Localization.CultureMap + LINGYUN.Abp.Localization.CultureMap + false + false + false diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/LINGYUN/Abp/Localization/CultureMap/AbpCultureMapRequestCultureProvider.cs b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/LINGYUN/Abp/Localization/CultureMap/AbpCultureMapRequestCultureProvider.cs index 2f98d4317..8b3cae4a9 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/LINGYUN/Abp/Localization/CultureMap/AbpCultureMapRequestCultureProvider.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/LINGYUN/Abp/Localization/CultureMap/AbpCultureMapRequestCultureProvider.cs @@ -9,54 +9,53 @@ using System.Linq; using System.Threading.Tasks; -namespace LINGYUN.Abp.Localization.CultureMap +namespace LINGYUN.Abp.Localization.CultureMap; + +public class AbpCultureMapRequestCultureProvider : RequestCultureProvider { - public class AbpCultureMapRequestCultureProvider : RequestCultureProvider + public override async Task DetermineProviderCultureResult(HttpContext httpContext) { - public override async Task DetermineProviderCultureResult(HttpContext httpContext) + if (httpContext == null) { - if (httpContext == null) - { - throw new ArgumentNullException(nameof(httpContext)); - } + throw new ArgumentNullException(nameof(httpContext)); + } - var option = httpContext.RequestServices.GetRequiredService>().Value; + var option = httpContext.RequestServices.GetRequiredService>().Value; - var mapCultures = new List(); - var mapUiCultures = new List(); + var mapCultures = new List(); + var mapUiCultures = new List(); - var requestLocalizationOptionsProvider = httpContext.RequestServices.GetRequiredService(); - foreach (var provider in (await requestLocalizationOptionsProvider.GetLocalizationOptionsAsync()).RequestCultureProviders) + var requestLocalizationOptionsProvider = httpContext.RequestServices.GetRequiredService(); + foreach (var provider in (await requestLocalizationOptionsProvider.GetLocalizationOptionsAsync()).RequestCultureProviders) + { + if (provider == this) { - if (provider == this) - { - continue; - } + continue; + } - var providerCultureResult = await provider.DetermineProviderCultureResult(httpContext); - if (providerCultureResult == null) - { - continue; - } - - mapCultures.AddRange(providerCultureResult.Cultures.Where(x => x.HasValue) - .Select(culture => - { - var map = option.CulturesMaps.FirstOrDefault(x => - x.SourceCultures.Contains(culture.Value, StringComparer.OrdinalIgnoreCase)); - return new StringSegment(map?.TargetCulture ?? culture.Value); - })); - - mapUiCultures.AddRange(providerCultureResult.UICultures.Where(x => x.HasValue) - .Select(culture => - { - var map = option.UiCulturesMaps.FirstOrDefault(x => - x.SourceCultures.Contains(culture.Value, StringComparer.OrdinalIgnoreCase)); - return new StringSegment(map?.TargetCulture ?? culture.Value); - })); + var providerCultureResult = await provider.DetermineProviderCultureResult(httpContext); + if (providerCultureResult == null) + { + continue; } - return new ProviderCultureResult(mapCultures, mapUiCultures); + mapCultures.AddRange(providerCultureResult.Cultures.Where(x => x.HasValue) + .Select(culture => + { + var map = option.CulturesMaps.FirstOrDefault(x => + x.SourceCultures.Contains(culture.Value, StringComparer.OrdinalIgnoreCase)); + return new StringSegment(map?.TargetCulture ?? culture.Value); + })); + + mapUiCultures.AddRange(providerCultureResult.UICultures.Where(x => x.HasValue) + .Select(culture => + { + var map = option.UiCulturesMaps.FirstOrDefault(x => + x.SourceCultures.Contains(culture.Value, StringComparer.OrdinalIgnoreCase)); + return new StringSegment(map?.TargetCulture ?? culture.Value); + })); } + + return new ProviderCultureResult(mapCultures, mapUiCultures); } } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/LINGYUN/Abp/Localization/CultureMap/AbpLocalizationCultureMapModule.cs b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/LINGYUN/Abp/Localization/CultureMap/AbpLocalizationCultureMapModule.cs index 1a341e625..3ea6fdfc6 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/LINGYUN/Abp/Localization/CultureMap/AbpLocalizationCultureMapModule.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/LINGYUN/Abp/Localization/CultureMap/AbpLocalizationCultureMapModule.cs @@ -1,10 +1,9 @@ using Volo.Abp.AspNetCore; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.Localization.CultureMap +namespace LINGYUN.Abp.Localization.CultureMap; + +[DependsOn(typeof(AbpAspNetCoreModule))] +public class AbpLocalizationCultureMapModule : AbpModule { - [DependsOn(typeof(AbpAspNetCoreModule))] - public class AbpLocalizationCultureMapModule : AbpModule - { - } } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/LINGYUN/Abp/Localization/CultureMap/AbpLocalizationCultureMapOptions.cs b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/LINGYUN/Abp/Localization/CultureMap/AbpLocalizationCultureMapOptions.cs index d1d9831eb..7b06eda33 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/LINGYUN/Abp/Localization/CultureMap/AbpLocalizationCultureMapOptions.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/LINGYUN/Abp/Localization/CultureMap/AbpLocalizationCultureMapOptions.cs @@ -1,17 +1,16 @@ using System.Collections.Generic; -namespace LINGYUN.Abp.Localization.CultureMap +namespace LINGYUN.Abp.Localization.CultureMap; + +public class AbpLocalizationCultureMapOptions { - public class AbpLocalizationCultureMapOptions - { - public List CulturesMaps { get; } + public List CulturesMaps { get; } - public List UiCulturesMaps { get; } + public List UiCulturesMaps { get; } - public AbpLocalizationCultureMapOptions() - { - CulturesMaps = new List(); - UiCulturesMaps = new List(); - } + public AbpLocalizationCultureMapOptions() + { + CulturesMaps = new List(); + UiCulturesMaps = new List(); } } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/LINGYUN/Abp/Localization/CultureMap/CultureMapInfo.cs b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/LINGYUN/Abp/Localization/CultureMap/CultureMapInfo.cs index 3bbbafe07..d4c493e03 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/LINGYUN/Abp/Localization/CultureMap/CultureMapInfo.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/LINGYUN/Abp/Localization/CultureMap/CultureMapInfo.cs @@ -1,9 +1,8 @@ -namespace LINGYUN.Abp.Localization.CultureMap +namespace LINGYUN.Abp.Localization.CultureMap; + +public class CultureMapInfo { - public class CultureMapInfo - { - public string TargetCulture { get; set; } + public string TargetCulture { get; set; } - public string[] SourceCultures { get; set; } - } + public string[] SourceCultures { get; set; } } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/Microsoft/AspNetCore/Builder/AbpCultureMapApplicationBuilderExtensions.cs b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/Microsoft/AspNetCore/Builder/AbpCultureMapApplicationBuilderExtensions.cs index b13441c81..a26e0ee22 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/Microsoft/AspNetCore/Builder/AbpCultureMapApplicationBuilderExtensions.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.CultureMap/Microsoft/AspNetCore/Builder/AbpCultureMapApplicationBuilderExtensions.cs @@ -1,19 +1,18 @@ using LINGYUN.Abp.Localization.CultureMap; using System; -namespace Microsoft.AspNetCore.Builder +namespace Microsoft.AspNetCore.Builder; + +public static class AbpCultureMapApplicationBuilderExtensions { - public static class AbpCultureMapApplicationBuilderExtensions + public static IApplicationBuilder UseMapRequestLocalization( + this IApplicationBuilder app, + Action optionsAction = null) { - public static IApplicationBuilder UseMapRequestLocalization( - this IApplicationBuilder app, - Action optionsAction = null) + return app.UseAbpRequestLocalization(options => { - return app.UseAbpRequestLocalization(options => - { - options.RequestCultureProviders.Insert(0, new AbpCultureMapRequestCultureProvider()); - optionsAction?.Invoke(options); - }); - } + options.RequestCultureProviders.Insert(0, new AbpCultureMapRequestCultureProvider()); + optionsAction?.Invoke(options); + }); } } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Persistence/LINGYUN.Abp.Localization.Persistence.csproj b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Persistence/LINGYUN.Abp.Localization.Persistence.csproj index 903836158..851710a9d 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Persistence/LINGYUN.Abp.Localization.Persistence.csproj +++ b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Persistence/LINGYUN.Abp.Localization.Persistence.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Localization.Persistence + LINGYUN.Abp.Localization.Persistence + false + false + false diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN.Abp.Localization.Xml.csproj b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN.Abp.Localization.Xml.csproj index b0727fea2..c21ee1745 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN.Abp.Localization.Xml.csproj +++ b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN.Abp.Localization.Xml.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Localization.Xml + LINGYUN.Abp.Localization.Xml + false + false + false diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/AbpLocalizationXmlModule.cs b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/AbpLocalizationXmlModule.cs index 60d9bd316..63a8f2e13 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/AbpLocalizationXmlModule.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/AbpLocalizationXmlModule.cs @@ -1,10 +1,9 @@ using Volo.Abp.Localization; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.Localization.Xml +namespace LINGYUN.Abp.Localization.Xml; + +[DependsOn(typeof(AbpLocalizationModule))] +public class AbpLocalizationXmlModule : AbpModule { - [DependsOn(typeof(AbpLocalizationModule))] - public class AbpLocalizationXmlModule : AbpModule - { - } } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/LocalizationResourceExtensions.cs b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/LocalizationResourceExtensions.cs index d6b90bfe9..30bc673f2 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/LocalizationResourceExtensions.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/LocalizationResourceExtensions.cs @@ -3,45 +3,44 @@ using Volo.Abp; using Volo.Abp.Localization; -namespace LINGYUN.Abp.Localization.Xml +namespace LINGYUN.Abp.Localization.Xml; + +public static class LocalizationResourceExtensions { - public static class LocalizationResourceExtensions + /// + /// 添加Xml虚拟文件系统支持 + /// + /// + /// + /// + public static LocalizationResource AddVirtualXml( + [NotNull] this LocalizationResource localizationResource, + [NotNull] string virtualPath) { - /// - /// 添加Xml虚拟文件系统支持 - /// - /// - /// - /// - public static LocalizationResource AddVirtualXml( - [NotNull] this LocalizationResource localizationResource, - [NotNull] string virtualPath) - { - Check.NotNull(localizationResource, nameof(localizationResource)); - Check.NotNull(virtualPath, nameof(virtualPath)); + Check.NotNull(localizationResource, nameof(localizationResource)); + Check.NotNull(virtualPath, nameof(virtualPath)); - localizationResource.Contributors.Add(new XmlVirtualFileLocalizationResourceContributor( - virtualPath.EnsureStartsWith('/') - )); + localizationResource.Contributors.Add(new XmlVirtualFileLocalizationResourceContributor( + virtualPath.EnsureStartsWith('/') + )); - return localizationResource; - } - /// - /// 添加Xml本地磁盘文件支持 - /// - /// - /// - /// - public static LocalizationResource AddPhysicalXml( - [NotNull] this LocalizationResource localizationResource, - [NotNull] string xmlFilePath) - { - Check.NotNull(localizationResource, nameof(localizationResource)); - Check.NotNull(xmlFilePath, nameof(xmlFilePath)); + return localizationResource; + } + /// + /// 添加Xml本地磁盘文件支持 + /// + /// + /// + /// + public static LocalizationResource AddPhysicalXml( + [NotNull] this LocalizationResource localizationResource, + [NotNull] string xmlFilePath) + { + Check.NotNull(localizationResource, nameof(localizationResource)); + Check.NotNull(xmlFilePath, nameof(xmlFilePath)); - localizationResource.Contributors.Add(new XmlPhysicalFileLocalizationResourceContributor(xmlFilePath)); + localizationResource.Contributors.Add(new XmlPhysicalFileLocalizationResourceContributor(xmlFilePath)); - return localizationResource; - } + return localizationResource; } } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/XmlFileLocalizationResourceContributorBase.cs b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/XmlFileLocalizationResourceContributorBase.cs index cfb3121c7..cceb81851 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/XmlFileLocalizationResourceContributorBase.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/XmlFileLocalizationResourceContributorBase.cs @@ -8,127 +8,126 @@ using Volo.Abp.Internal; using Volo.Abp.Localization; -namespace LINGYUN.Abp.Localization.Xml +namespace LINGYUN.Abp.Localization.Xml; + +public abstract class XmlFileLocalizationResourceContributorBase : ILocalizationResourceContributor { - public abstract class XmlFileLocalizationResourceContributorBase : ILocalizationResourceContributor - { - private readonly string _filePath; + private readonly string _filePath; - private IFileProvider _fileProvider; - private Dictionary _dictionaries; - private bool _subscribedForChanges; - private readonly object _syncObj = new object(); + private IFileProvider _fileProvider; + private Dictionary _dictionaries; + private bool _subscribedForChanges; + private readonly object _syncObj = new object(); - public bool IsDynamic => false; + public bool IsDynamic => false; - protected XmlFileLocalizationResourceContributorBase(string filePath) - { - _filePath = filePath; - } + protected XmlFileLocalizationResourceContributorBase(string filePath) + { + _filePath = filePath; + } - public virtual void Initialize(LocalizationResourceInitializationContext context) - { - _fileProvider = BuildFileProvider(context); + public virtual void Initialize(LocalizationResourceInitializationContext context) + { + _fileProvider = BuildFileProvider(context); - Check.NotNull(_fileProvider, nameof(_fileProvider)); - } + Check.NotNull(_fileProvider, nameof(_fileProvider)); + } - public virtual LocalizedString GetOrNull(string cultureName, string name) - { - return GetDictionaries().GetOrDefault(cultureName)?.GetOrNull(name); - } + public virtual LocalizedString GetOrNull(string cultureName, string name) + { + return GetDictionaries().GetOrDefault(cultureName)?.GetOrNull(name); + } + + public virtual void Fill(string cultureName, Dictionary dictionary) + { + GetDictionaries().GetOrDefault(cultureName)?.Fill(dictionary); + } - public virtual void Fill(string cultureName, Dictionary dictionary) + protected virtual Dictionary GetDictionaries() + { + var dictionaries = _dictionaries; + if (dictionaries != null) { - GetDictionaries().GetOrDefault(cultureName)?.Fill(dictionary); + return dictionaries; } - protected virtual Dictionary GetDictionaries() + lock (_syncObj) { - var dictionaries = _dictionaries; + dictionaries = _dictionaries; if (dictionaries != null) { return dictionaries; } - lock (_syncObj) + if (!_subscribedForChanges) { - dictionaries = _dictionaries; - if (dictionaries != null) - { - return dictionaries; - } - - if (!_subscribedForChanges) - { - ChangeToken.OnChange(() => _fileProvider.Watch(_filePath.EnsureEndsWith('/') + "*.*"), - () => - { - _dictionaries = null; - }); - - _subscribedForChanges = true; - } - - dictionaries = _dictionaries = CreateDictionaries(_fileProvider, _filePath); + ChangeToken.OnChange(() => _fileProvider.Watch(_filePath.EnsureEndsWith('/') + "*.*"), + () => + { + _dictionaries = null; + }); + + _subscribedForChanges = true; } - return dictionaries; + dictionaries = _dictionaries = CreateDictionaries(_fileProvider, _filePath); } - protected virtual Dictionary CreateDictionaries(IFileProvider fileProvider, string filePath) + return dictionaries; + } + + protected virtual Dictionary CreateDictionaries(IFileProvider fileProvider, string filePath) + { + var dictionaries = new Dictionary(); + + foreach (var file in fileProvider.GetDirectoryContents(filePath)) { - var dictionaries = new Dictionary(); + if (file.IsDirectory || !CanParseFile(file)) + { + continue; + } - foreach (var file in fileProvider.GetDirectoryContents(filePath)) + var dictionary = CreateDictionaryFromFile(file); + if (dictionaries.ContainsKey(dictionary.CultureName)) { - if (file.IsDirectory || !CanParseFile(file)) - { - continue; - } - - var dictionary = CreateDictionaryFromFile(file); - if (dictionaries.ContainsKey(dictionary.CultureName)) - { - throw new AbpException($"{file.GetVirtualOrPhysicalPathOrNull()} dictionary has a culture name '{dictionary.CultureName}' which is already defined!"); - } - - dictionaries[dictionary.CultureName] = dictionary; + throw new AbpException($"{file.GetVirtualOrPhysicalPathOrNull()} dictionary has a culture name '{dictionary.CultureName}' which is already defined!"); } - return dictionaries; + dictionaries[dictionary.CultureName] = dictionary; } - protected virtual bool CanParseFile(IFileInfo file) - { - return file.Name.EndsWith(".xml", StringComparison.OrdinalIgnoreCase); - } + return dictionaries; + } - protected virtual ILocalizationDictionary CreateDictionaryFromFile(IFileInfo file) - { - using (var stream = file.CreateReadStream()) - { - return CreateDictionaryFromFileContent(Utf8Helper.ReadStringFromStream(stream)); - } - } + protected virtual bool CanParseFile(IFileInfo file) + { + return file.Name.EndsWith(".xml", StringComparison.OrdinalIgnoreCase); + } - protected virtual ILocalizationDictionary CreateDictionaryFromFileContent(string fileContent) + protected virtual ILocalizationDictionary CreateDictionaryFromFile(IFileInfo file) + { + using (var stream = file.CreateReadStream()) { - return XmlLocalizationDictionaryBuilder.BuildFromXmlString(fileContent); + return CreateDictionaryFromFileContent(Utf8Helper.ReadStringFromStream(stream)); } + } - protected abstract IFileProvider BuildFileProvider(LocalizationResourceInitializationContext context); + protected virtual ILocalizationDictionary CreateDictionaryFromFileContent(string fileContent) + { + return XmlLocalizationDictionaryBuilder.BuildFromXmlString(fileContent); + } - public virtual Task FillAsync(string cultureName, Dictionary dictionary) - { - Fill(cultureName, dictionary); + protected abstract IFileProvider BuildFileProvider(LocalizationResourceInitializationContext context); - return Task.CompletedTask; - } + public virtual Task FillAsync(string cultureName, Dictionary dictionary) + { + Fill(cultureName, dictionary); - public virtual Task> GetSupportedCulturesAsync() - { - return Task.FromResult((IEnumerable)GetDictionaries().Keys); - } + return Task.CompletedTask; + } + + public virtual Task> GetSupportedCulturesAsync() + { + return Task.FromResult((IEnumerable)GetDictionaries().Keys); } } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/XmlLocalizationDictionaryBuilder.cs b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/XmlLocalizationDictionaryBuilder.cs index f3dbb712e..4ce17d66f 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/XmlLocalizationDictionaryBuilder.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/XmlLocalizationDictionaryBuilder.cs @@ -6,69 +6,68 @@ using Volo.Abp; using Volo.Abp.Localization; -namespace LINGYUN.Abp.Localization.Xml +namespace LINGYUN.Abp.Localization.Xml; + +public static class XmlLocalizationDictionaryBuilder { - public static class XmlLocalizationDictionaryBuilder + public static ILocalizationDictionary BuildFromFile(string filePath) { - public static ILocalizationDictionary BuildFromFile(string filePath) + try { - try - { - return BuildFromXmlString(File.ReadAllText(filePath)); - } - catch (Exception ex) - { - throw new AbpException("Invalid localization file format: " + filePath, ex); - } + return BuildFromXmlString(File.ReadAllText(filePath)); + } + catch (Exception ex) + { + throw new AbpException("Invalid localization file format: " + filePath, ex); } + } - public static ILocalizationDictionary BuildFromXmlString(string xmlString) + public static ILocalizationDictionary BuildFromXmlString(string xmlString) + { + XmlLocalizationFile xmlFile; + try { - XmlLocalizationFile xmlFile; - try - { - XmlSerializer serializer = new XmlSerializer(typeof(XmlLocalizationFile)); - using (StringReader reader = new StringReader(xmlString)) - { - xmlFile = (XmlLocalizationFile)serializer.Deserialize(reader); - } - } - catch (Exception ex) + XmlSerializer serializer = new XmlSerializer(typeof(XmlLocalizationFile)); + using (StringReader reader = new StringReader(xmlString)) { - throw new AbpException("Can not parse xml string. " + ex.Message); + xmlFile = (XmlLocalizationFile)serializer.Deserialize(reader); } + } + catch (Exception ex) + { + throw new AbpException("Can not parse xml string. " + ex.Message); + } - var cultureCode = xmlFile.Culture.Name; - if (string.IsNullOrEmpty(cultureCode)) - { - throw new AbpException("Culture is empty in language json file."); - } + var cultureCode = xmlFile.Culture.Name; + if (string.IsNullOrEmpty(cultureCode)) + { + throw new AbpException("Culture is empty in language json file."); + } - var dictionary = new Dictionary(); - var dublicateNames = new List(); - foreach (var item in xmlFile.Texts) + var dictionary = new Dictionary(); + var dublicateNames = new List(); + foreach (var item in xmlFile.Texts) + { + if (string.IsNullOrEmpty(item.Key)) { - if (string.IsNullOrEmpty(item.Key)) - { - throw new AbpException("The key is empty in given json string."); - } - - if (dictionary.GetOrDefault(item.Key) != null) - { - dublicateNames.Add(item.Key); - } - - dictionary[item.Key] = new LocalizedString(item.Key, item.Value.NormalizeLineEndings()); + throw new AbpException("The key is empty in given json string."); } - if (dublicateNames.Count > 0) + if (dictionary.GetOrDefault(item.Key) != null) { - throw new AbpException( - "A dictionary can not contain same key twice. There are some duplicated names: " + - dublicateNames.JoinAsString(", ")); + dublicateNames.Add(item.Key); } - return new StaticLocalizationDictionary(cultureCode, dictionary); + dictionary[item.Key] = new LocalizedString(item.Key, item.Value.NormalizeLineEndings()); + } + + if (dublicateNames.Count > 0) + { + throw new AbpException( + "A dictionary can not contain same key twice. There are some duplicated names: " + + dublicateNames.JoinAsString(", ")); } + + return new StaticLocalizationDictionary(cultureCode, dictionary); } } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/XmlLocalizationFile.cs b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/XmlLocalizationFile.cs index bd003aa49..8e7178289 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/XmlLocalizationFile.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/XmlLocalizationFile.cs @@ -4,95 +4,94 @@ using System.Xml; using System.Xml.Serialization; -namespace LINGYUN.Abp.Localization.Xml -{ - [Serializable] - [XmlRoot(ElementName = "localization")] - public class XmlLocalizationFile - { - [XmlElement("culture")] - public CultureInfo Culture { get; set; } = new CultureInfo(); +namespace LINGYUN.Abp.Localization.Xml; - [XmlArray("texts")] - [XmlArrayItem("text")] - public LocalizationText[] Texts { get; set; } = new LocalizationText[0]; +[Serializable] +[XmlRoot(ElementName = "localization")] +public class XmlLocalizationFile +{ + [XmlElement("culture")] + public CultureInfo Culture { get; set; } = new CultureInfo(); - public XmlLocalizationFile() { } + [XmlArray("texts")] + [XmlArrayItem("text")] + public LocalizationText[] Texts { get; set; } = new LocalizationText[0]; - public XmlLocalizationFile(string culture) - { - Culture = new CultureInfo(culture); - } + public XmlLocalizationFile() { } - public XmlLocalizationFile(string culture, LocalizationText[] texts) - { - Culture = new CultureInfo(culture); - Texts = texts; - } - - public void WriteToPath(string filePath) - { - var fileName = Path.Combine(filePath, Culture.Name + ".xml"); - using FileStream fileStream = new(fileName, FileMode.Create, FileAccess.Write); - InternalWrite(fileStream, Encoding.UTF8); - } + public XmlLocalizationFile(string culture) + { + Culture = new CultureInfo(culture); + } - private void InternalWrite(Stream stream, Encoding encoding) - { - if (encoding == null) - { - throw new ArgumentNullException("encoding"); - } - - XmlSerializer serializer = new(GetType()); - XmlWriterSettings settings = new() - { - Indent = true, - NewLineChars = "\r\n", - Encoding = encoding, - IndentChars = " " - }; - - using XmlWriter writer = XmlWriter.Create(stream, settings); - serializer.Serialize(writer, this); - writer.Close(); - } + public XmlLocalizationFile(string culture, LocalizationText[] texts) + { + Culture = new CultureInfo(culture); + Texts = texts; } - [Serializable] - public class CultureInfo + public void WriteToPath(string filePath) { - [XmlAttribute("name")] - public string Name { get; set; } + var fileName = Path.Combine(filePath, Culture.Name + ".xml"); + using FileStream fileStream = new(fileName, FileMode.Create, FileAccess.Write); + InternalWrite(fileStream, Encoding.UTF8); + } - public CultureInfo() + private void InternalWrite(Stream stream, Encoding encoding) + { + if (encoding == null) { + throw new ArgumentNullException("encoding"); } - public CultureInfo(string name) + XmlSerializer serializer = new(GetType()); + XmlWriterSettings settings = new() { - Name = name; - } + Indent = true, + NewLineChars = "\r\n", + Encoding = encoding, + IndentChars = " " + }; + + using XmlWriter writer = XmlWriter.Create(stream, settings); + serializer.Serialize(writer, this); + writer.Close(); } +} + +[Serializable] +public class CultureInfo +{ + [XmlAttribute("name")] + public string Name { get; set; } - [Serializable] - public class LocalizationText + public CultureInfo() { - [XmlAttribute("key")] - public string Key { get; set; } + } - [XmlAttribute("value")] - public string Value { get; set; } + public CultureInfo(string name) + { + Name = name; + } +} - public LocalizationText() - { +[Serializable] +public class LocalizationText +{ + [XmlAttribute("key")] + public string Key { get; set; } - } + [XmlAttribute("value")] + public string Value { get; set; } - public LocalizationText(string key, string value) - { - Key = key; - Value = value; - } + public LocalizationText() + { + + } + + public LocalizationText(string key, string value) + { + Key = key; + Value = value; } } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/XmlPhysicalFileLocalizationResourceContributor.cs b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/XmlPhysicalFileLocalizationResourceContributor.cs index fc3161bfa..bbb624c21 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/XmlPhysicalFileLocalizationResourceContributor.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/XmlPhysicalFileLocalizationResourceContributor.cs @@ -3,44 +3,43 @@ using Volo.Abp; using Volo.Abp.Localization; -namespace LINGYUN.Abp.Localization.Xml +namespace LINGYUN.Abp.Localization.Xml; + +public class XmlPhysicalFileLocalizationResourceContributor : XmlFileLocalizationResourceContributorBase { - public class XmlPhysicalFileLocalizationResourceContributor : XmlFileLocalizationResourceContributorBase + private readonly string _filePath; + + public XmlPhysicalFileLocalizationResourceContributor(string filePath) + : base(filePath) { - private readonly string _filePath; + _filePath = filePath; + } - public XmlPhysicalFileLocalizationResourceContributor(string filePath) - : base(filePath) - { - _filePath = filePath; - } + protected override IFileProvider BuildFileProvider(LocalizationResourceInitializationContext context) + { + return new PhysicalFileProvider(_filePath); + } - protected override IFileProvider BuildFileProvider(LocalizationResourceInitializationContext context) - { - return new PhysicalFileProvider(_filePath); - } + protected override Dictionary CreateDictionaries(IFileProvider fileProvider, string filePath) + { + var dictionaries = new Dictionary(); - protected override Dictionary CreateDictionaries(IFileProvider fileProvider, string filePath) + foreach (var file in fileProvider.GetDirectoryContents(string.Empty)) { - var dictionaries = new Dictionary(); + if (file.IsDirectory || !CanParseFile(file)) + { + continue; + } - foreach (var file in fileProvider.GetDirectoryContents(string.Empty)) + var dictionary = CreateDictionaryFromFile(file); + if (dictionaries.ContainsKey(dictionary.CultureName)) { - if (file.IsDirectory || !CanParseFile(file)) - { - continue; - } - - var dictionary = CreateDictionaryFromFile(file); - if (dictionaries.ContainsKey(dictionary.CultureName)) - { - throw new AbpException($"{file.GetVirtualOrPhysicalPathOrNull()} dictionary has a culture name '{dictionary.CultureName}' which is already defined!"); - } - - dictionaries[dictionary.CultureName] = dictionary; + throw new AbpException($"{file.GetVirtualOrPhysicalPathOrNull()} dictionary has a culture name '{dictionary.CultureName}' which is already defined!"); } - return dictionaries; + dictionaries[dictionary.CultureName] = dictionary; } + + return dictionaries; } } diff --git a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/XmlVirtualFileLocalizationResourceContributor.cs b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/XmlVirtualFileLocalizationResourceContributor.cs index e6ced1dfe..1b082e1e6 100644 --- a/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/XmlVirtualFileLocalizationResourceContributor.cs +++ b/aspnet-core/framework/localization/LINGYUN.Abp.Localization.Xml/LINGYUN/Abp/Localization/Xml/XmlVirtualFileLocalizationResourceContributor.cs @@ -3,18 +3,17 @@ using Volo.Abp.Localization; using Volo.Abp.VirtualFileSystem; -namespace LINGYUN.Abp.Localization.Xml +namespace LINGYUN.Abp.Localization.Xml; + +public class XmlVirtualFileLocalizationResourceContributor : XmlFileLocalizationResourceContributorBase { - public class XmlVirtualFileLocalizationResourceContributor : XmlFileLocalizationResourceContributorBase + public XmlVirtualFileLocalizationResourceContributor(string filePath) + : base(filePath) { - public XmlVirtualFileLocalizationResourceContributor(string filePath) - : base(filePath) - { - } + } - protected override IFileProvider BuildFileProvider(LocalizationResourceInitializationContext context) - { - return context.ServiceProvider.GetRequiredService(); - } + protected override IFileProvider BuildFileProvider(LocalizationResourceInitializationContext context) + { + return context.ServiceProvider.GetRequiredService(); } } diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN.Abp.Logging.Serilog.Elasticsearch.csproj b/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN.Abp.Logging.Serilog.Elasticsearch.csproj index 6330a774a..6f8e5b867 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN.Abp.Logging.Serilog.Elasticsearch.csproj +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN.Abp.Logging.Serilog.Elasticsearch.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.Logging.Serilog.Elasticsearch + LINGYUN.Abp.Logging.Serilog.Elasticsearch + false + false + false diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/AbpLoggingSerilogElasticsearchMapperProfile.cs b/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/AbpLoggingSerilogElasticsearchMapperProfile.cs index f79d2cc33..3618d88a4 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/AbpLoggingSerilogElasticsearchMapperProfile.cs +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/AbpLoggingSerilogElasticsearchMapperProfile.cs @@ -1,30 +1,29 @@ using AutoMapper; using Serilog.Events; -namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch +namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch; + +public class AbpLoggingSerilogElasticsearchMapperProfile : Profile { - public class AbpLoggingSerilogElasticsearchMapperProfile : Profile + public AbpLoggingSerilogElasticsearchMapperProfile() { - public AbpLoggingSerilogElasticsearchMapperProfile() - { - CreateMap(); - CreateMap() - .ForMember(log => log.Id, map => map.MapFrom(slog => slog.UniqueId.ToString())); - CreateMap() - .ForMember(log => log.Level, map => map.MapFrom(slog => GetLogLevel(slog.Level))); - } + CreateMap(); + CreateMap() + .ForMember(log => log.Id, map => map.MapFrom(slog => slog.UniqueId.ToString())); + CreateMap() + .ForMember(log => log.Level, map => map.MapFrom(slog => GetLogLevel(slog.Level))); + } - private static Microsoft.Extensions.Logging.LogLevel GetLogLevel(LogEventLevel logEventLevel) + private static Microsoft.Extensions.Logging.LogLevel GetLogLevel(LogEventLevel logEventLevel) + { + return logEventLevel switch { - return logEventLevel switch - { - LogEventLevel.Fatal => Microsoft.Extensions.Logging.LogLevel.Critical, - LogEventLevel.Error => Microsoft.Extensions.Logging.LogLevel.Error, - LogEventLevel.Warning => Microsoft.Extensions.Logging.LogLevel.Warning, - LogEventLevel.Information => Microsoft.Extensions.Logging.LogLevel.Information, - LogEventLevel.Debug => Microsoft.Extensions.Logging.LogLevel.Debug, - _ => Microsoft.Extensions.Logging.LogLevel.Trace, - }; - } + LogEventLevel.Fatal => Microsoft.Extensions.Logging.LogLevel.Critical, + LogEventLevel.Error => Microsoft.Extensions.Logging.LogLevel.Error, + LogEventLevel.Warning => Microsoft.Extensions.Logging.LogLevel.Warning, + LogEventLevel.Information => Microsoft.Extensions.Logging.LogLevel.Information, + LogEventLevel.Debug => Microsoft.Extensions.Logging.LogLevel.Debug, + _ => Microsoft.Extensions.Logging.LogLevel.Trace, + }; } } diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/AbpLoggingSerilogElasticsearchModule.cs b/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/AbpLoggingSerilogElasticsearchModule.cs index ba789c351..8f9f7b273 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/AbpLoggingSerilogElasticsearchModule.cs +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/AbpLoggingSerilogElasticsearchModule.cs @@ -4,27 +4,26 @@ using Volo.Abp.Json; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch +namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch; + +[DependsOn( + typeof(AbpLoggingModule), + typeof(AbpElasticsearchModule), + typeof(AbpAutoMapperModule), + typeof(AbpJsonModule))] +public class AbpLoggingSerilogElasticsearchModule : AbpModule { - [DependsOn( - typeof(AbpLoggingModule), - typeof(AbpElasticsearchModule), - typeof(AbpAutoMapperModule), - typeof(AbpJsonModule))] - public class AbpLoggingSerilogElasticsearchModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) - { - var configuration = context.Services.GetConfiguration(); + var configuration = context.Services.GetConfiguration(); - Configure(configuration.GetSection("Logging:Serilog:Elasticsearch")); + Configure(configuration.GetSection("Logging:Serilog:Elasticsearch")); - context.Services.AddAutoMapperObjectMapper(); + context.Services.AddAutoMapperObjectMapper(); - Configure(options => - { - options.AddProfile(validate: true); - }); - } + Configure(options => + { + options.AddProfile(validate: true); + }); } } diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/AbpLoggingSerilogElasticsearchOptions.cs b/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/AbpLoggingSerilogElasticsearchOptions.cs index 95f0c8b5c..b715ae59d 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/AbpLoggingSerilogElasticsearchOptions.cs +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/AbpLoggingSerilogElasticsearchOptions.cs @@ -1,12 +1,11 @@ -namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch +namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch; + +public class AbpLoggingSerilogElasticsearchOptions { - public class AbpLoggingSerilogElasticsearchOptions - { - public string IndexFormat { get; set; } + public string IndexFormat { get; set; } - public AbpLoggingSerilogElasticsearchOptions() - { - IndexFormat = "logstash-{0:yyyy.MM.dd}"; - } + public AbpLoggingSerilogElasticsearchOptions() + { + IndexFormat = "logstash-{0:yyyy.MM.dd}"; } } diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogElasticsearchLoggingManager.cs b/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogElasticsearchLoggingManager.cs index 3d5548315..7a94574bd 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogElasticsearchLoggingManager.cs +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogElasticsearchLoggingManager.cs @@ -17,415 +17,414 @@ using Volo.Abp.ObjectMapping; using Volo.Abp.Timing; -namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch +namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch; + +[Dependency(ReplaceServices = true)] +public class SerilogElasticsearchLoggingManager : ILoggingManager, ISingletonDependency { - [Dependency(ReplaceServices = true)] - public class SerilogElasticsearchLoggingManager : ILoggingManager, ISingletonDependency - { - private readonly static Regex IndexFormatRegex = new Regex(@"^(.*)(?:\{0\:.+\})(.*)$"); + private readonly static Regex IndexFormatRegex = new Regex(@"^(.*)(?:\{0\:.+\})(.*)$"); - private readonly IClock _clock; - private readonly IObjectMapper _objectMapper; - private readonly ICurrentTenant _currentTenant; - private readonly AbpLoggingSerilogElasticsearchOptions _options; - private readonly IElasticsearchClientFactory _clientFactory; + private readonly IClock _clock; + private readonly IObjectMapper _objectMapper; + private readonly ICurrentTenant _currentTenant; + private readonly AbpLoggingSerilogElasticsearchOptions _options; + private readonly IElasticsearchClientFactory _clientFactory; - public ILogger Logger { protected get; set; } + public ILogger Logger { protected get; set; } - public SerilogElasticsearchLoggingManager( - IClock clock, - IObjectMapper objectMapper, - ICurrentTenant currentTenant, - IOptions options, - IElasticsearchClientFactory clientFactory) - { - _clock = clock; - _objectMapper = objectMapper; - _currentTenant = currentTenant; - _clientFactory = clientFactory; - _options = options.Value; + public SerilogElasticsearchLoggingManager( + IClock clock, + IObjectMapper objectMapper, + ICurrentTenant currentTenant, + IOptions options, + IElasticsearchClientFactory clientFactory) + { + _clock = clock; + _objectMapper = objectMapper; + _currentTenant = currentTenant; + _clientFactory = clientFactory; + _options = options.Value; - Logger = NullLogger.Instance; - } + Logger = NullLogger.Instance; + } - /// - /// - /// - /// 时间类型或者转换为timestamp都可以查询 - /// - /// - public async virtual Task GetAsync( - string id, - CancellationToken cancellationToken = default(CancellationToken)) - { - var client = _clientFactory.Create(); + /// + /// + /// + /// 时间类型或者转换为timestamp都可以查询 + /// + /// + public async virtual Task GetAsync( + string id, + CancellationToken cancellationToken = default) + { + var client = _clientFactory.Create(); - ISearchResponse response; + ISearchResponse response; - if (_currentTenant.IsAvailable) - { - /* - "query": { - "bool": { - "must": [ - { - "term": { - "fields.TenantId.keyword": { - "value": _currentTenant.GetId() - } + if (_currentTenant.IsAvailable) + { + /* + "query": { + "bool": { + "must": [ + { + "term": { + "fields.TenantId.keyword": { + "value": _currentTenant.GetId() } - }, - { - "term": { - "fields.UniqueId": { - "value": "1474021081433481216" - } + } + }, + { + "term": { + "fields.UniqueId": { + "value": "1474021081433481216" } } - ] - } + } + ] } - */ - response = await client.SearchAsync( - dsl => - dsl.Index(CreateIndex()) - .Query( - (q) => q.Bool( - (b) => b.Must( - (s) => s.Term( - (t) => t.Field(GetField(nameof(SerilogInfo.Fields.UniqueId))).Value(id)), - (s) => s.Term( - (t) => t.Field(GetField(nameof(SerilogInfo.Fields.TenantId))).Value(_currentTenant.GetId()))))) - .Size(1), - cancellationToken); } - else - { - /* - "query": { - "bool": { - "must": [ - { - "term": { - "fields.UniqueId": { - "value": "1474021081433481216" - } + */ + response = await client.SearchAsync( + dsl => + dsl.Index(CreateIndex()) + .Query( + (q) => q.Bool( + (b) => b.Must( + (s) => s.Term( + (t) => t.Field(GetField(nameof(SerilogInfo.Fields.UniqueId))).Value(id)), + (s) => s.Term( + (t) => t.Field(GetField(nameof(SerilogInfo.Fields.TenantId))).Value(_currentTenant.GetId()))))) + .Size(1), + cancellationToken); + } + else + { + /* + "query": { + "bool": { + "must": [ + { + "term": { + "fields.UniqueId": { + "value": "1474021081433481216" } } - ] - } + } + ] } - */ - response = await client.SearchAsync( - dsl => - dsl.Index(CreateIndex()) - .Query( - (q) => q.Bool( - (b) => b.Must( - (s) => s.Term( - (t) => t.Field(GetField(nameof(SerilogInfo.Fields.UniqueId))).Value(id))))) - .Size(1), - cancellationToken); } - - return _objectMapper.Map(response.Documents.FirstOrDefault()); + */ + response = await client.SearchAsync( + dsl => + dsl.Index(CreateIndex()) + .Query( + (q) => q.Bool( + (b) => b.Must( + (s) => s.Term( + (t) => t.Field(GetField(nameof(SerilogInfo.Fields.UniqueId))).Value(id))))) + .Size(1), + cancellationToken); } - public async virtual Task GetCountAsync( - DateTime? startTime = null, - DateTime? endTime = null, - Microsoft.Extensions.Logging.LogLevel? level = null, - string machineName = null, - string environment = null, - string application = null, - string context = null, - string requestId = null, - string requestPath = null, - string correlationId = null, - int? processId = null, - int? threadId = null, - bool? hasException = null, - CancellationToken cancellationToken = default(CancellationToken)) - { - var client = _clientFactory.Create(); + return _objectMapper.Map(response.Documents.FirstOrDefault()); + } + + public async virtual Task GetCountAsync( + DateTime? startTime = null, + DateTime? endTime = null, + Microsoft.Extensions.Logging.LogLevel? level = null, + string machineName = null, + string environment = null, + string application = null, + string context = null, + string requestId = null, + string requestPath = null, + string correlationId = null, + int? processId = null, + int? threadId = null, + bool? hasException = null, + CancellationToken cancellationToken = default) + { + var client = _clientFactory.Create(); - var querys = BuildQueryDescriptor( - startTime, - endTime, - level, - machineName, - environment, - application, - context, - requestId, - requestPath, - correlationId, - processId, - threadId, - hasException); + var querys = BuildQueryDescriptor( + startTime, + endTime, + level, + machineName, + environment, + application, + context, + requestId, + requestPath, + correlationId, + processId, + threadId, + hasException); - var response = await client.CountAsync((dsl) => - dsl.Index(CreateIndex()) - .Query(log => log.Bool(b => b.Must(querys.ToArray()))), - cancellationToken); + var response = await client.CountAsync((dsl) => + dsl.Index(CreateIndex()) + .Query(log => log.Bool(b => b.Must(querys.ToArray()))), + cancellationToken); - return response.Count; - } + return response.Count; + } - /// - /// 获取日志列表 - /// - /// 排序字段 - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - public async virtual Task> GetListAsync( - string sorting = null, - int maxResultCount = 50, - int skipCount = 0, - DateTime? startTime = null, - DateTime? endTime = null, - Microsoft.Extensions.Logging.LogLevel? level = null, - string machineName = null, - string environment = null, - string application = null, - string context = null, - string requestId = null, - string requestPath = null, - string correlationId = null, - int? processId = null, - int? threadId = null, - bool? hasException = null, - bool includeDetails = false, - CancellationToken cancellationToken = default(CancellationToken)) - { - var client = _clientFactory.Create(); + /// + /// 获取日志列表 + /// + /// 排序字段 + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public async virtual Task> GetListAsync( + string sorting = null, + int maxResultCount = 50, + int skipCount = 0, + DateTime? startTime = null, + DateTime? endTime = null, + Microsoft.Extensions.Logging.LogLevel? level = null, + string machineName = null, + string environment = null, + string application = null, + string context = null, + string requestId = null, + string requestPath = null, + string correlationId = null, + int? processId = null, + int? threadId = null, + bool? hasException = null, + bool includeDetails = false, + CancellationToken cancellationToken = default) + { + var client = _clientFactory.Create(); - var sortOrder = !sorting.IsNullOrWhiteSpace() && sorting.EndsWith("asc", StringComparison.InvariantCultureIgnoreCase) - ? SortOrder.Ascending : SortOrder.Descending; - sorting = !sorting.IsNullOrWhiteSpace() - ? sorting.Split()[0] - : nameof(SerilogInfo.TimeStamp); + var sortOrder = !sorting.IsNullOrWhiteSpace() && sorting.EndsWith("asc", StringComparison.InvariantCultureIgnoreCase) + ? SortOrder.Ascending : SortOrder.Descending; + sorting = !sorting.IsNullOrWhiteSpace() + ? sorting.Split()[0] + : nameof(SerilogInfo.TimeStamp); - var querys = BuildQueryDescriptor( - startTime, - endTime, - level, - machineName, - environment, - application, - context, - requestId, - requestPath, - correlationId, - processId, - threadId, - hasException); + var querys = BuildQueryDescriptor( + startTime, + endTime, + level, + machineName, + environment, + application, + context, + requestId, + requestPath, + correlationId, + processId, + threadId, + hasException); - SourceFilterDescriptor SourceFilter(SourceFilterDescriptor selector) + SourceFilterDescriptor SourceFilter(SourceFilterDescriptor selector) + { + selector.IncludeAll(); + if (!includeDetails) { - selector.IncludeAll(); - if (!includeDetails) - { - selector.Excludes(field => - field.Field("exceptions")); - } - - return selector; + selector.Excludes(field => + field.Field("exceptions")); } - var response = await client.SearchAsync((dsl) => - dsl.Index(CreateIndex()) - .Query(log => - log.Bool(b => - b.Must(querys.ToArray()))) - .Source(SourceFilter) - .Sort(log => log.Field(GetField(sorting), sortOrder)) - .From(skipCount) - .Size(maxResultCount), - cancellationToken); - - return _objectMapper.Map, List>(response.Documents.ToList()); + return selector; } - protected virtual List, QueryContainer>> BuildQueryDescriptor( - DateTime? startTime = null, - DateTime? endTime = null, - Microsoft.Extensions.Logging.LogLevel? level = null, - string machineName = null, - string environment = null, - string application = null, - string context = null, - string requestId = null, - string requestPath = null, - string correlationId = null, - int? processId = null, - int? threadId = null, - bool? hasException = null) - { - var querys = new List, QueryContainer>>(); + var response = await client.SearchAsync((dsl) => + dsl.Index(CreateIndex()) + .Query(log => + log.Bool(b => + b.Must(querys.ToArray()))) + .Source(SourceFilter) + .Sort(log => log.Field(GetField(sorting), sortOrder)) + .From(skipCount) + .Size(maxResultCount), + cancellationToken); - if (_currentTenant.IsAvailable) - { - querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SerilogInfo.Fields.TenantId))).Value(_currentTenant.GetId()))); - } - if (startTime.HasValue) - { - querys.Add((log) => log.DateRange((q) => q.Field(GetField(nameof(SerilogInfo.TimeStamp))).GreaterThanOrEquals(_clock.Normalize(startTime.Value)))); - } - if (endTime.HasValue) - { - querys.Add((log) => log.DateRange((q) => q.Field(GetField(nameof(SerilogInfo.TimeStamp))).LessThanOrEquals(_clock.Normalize(endTime.Value)))); - } - if (level.HasValue) - { - querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SerilogInfo.Level))).Value(GetLogEventLevel(level.Value).ToString()))); - } - if (!machineName.IsNullOrWhiteSpace()) - { - querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SerilogInfo.Fields.MachineName))).Value(machineName))); - } - if (!environment.IsNullOrWhiteSpace()) - { - querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SerilogInfo.Fields.Environment))).Value(environment))); - } - if (!application.IsNullOrWhiteSpace()) - { - querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SerilogInfo.Fields.Application))).Value(application))); - } - if (!context.IsNullOrWhiteSpace()) - { - querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SerilogInfo.Fields.Context))).Value(context))); - } - if (!requestId.IsNullOrWhiteSpace()) - { - querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SerilogInfo.Fields.RequestId))).Value(requestId))); - } - if (!requestPath.IsNullOrWhiteSpace()) - { - // 模糊匹配 - querys.Add((log) => log.MatchPhrasePrefix((q) => q.Field(f => f.Fields.RequestPath).Query(requestPath))); - } - if (!correlationId.IsNullOrWhiteSpace()) - { - querys.Add((log) => log.MatchPhrase((q) => q.Field(GetField(nameof(SerilogInfo.Fields.CorrelationId))).Query(correlationId))); - } - if (processId.HasValue) - { - querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SerilogInfo.Fields.ProcessId))).Value(processId))); - } - if (threadId.HasValue) - { - querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SerilogInfo.Fields.ThreadId))).Value(threadId))); - } + return _objectMapper.Map, List>(response.Documents.ToList()); + } - if (hasException.HasValue) - { - if (hasException.Value) - { - /* 存在exceptions字段则就是有异常信息 - * "exists": { - "field": "exceptions" - } - */ - querys.Add( - (q) => q.Exists( - (e) => e.Field("exceptions"))); - } - else - { - // 不存在 exceptions字段就是没有异常信息的消息 - /* - * "bool": { - "must_not": [ - { - "exists": { - "field": "exceptions" - } - } - ] - } - */ - querys.Add( - (q) => q.Bool( - (b) => b.MustNot( - (m) => m.Exists( - (e) => e.Field("exceptions"))))); - } - } + protected virtual List, QueryContainer>> BuildQueryDescriptor( + DateTime? startTime = null, + DateTime? endTime = null, + Microsoft.Extensions.Logging.LogLevel? level = null, + string machineName = null, + string environment = null, + string application = null, + string context = null, + string requestId = null, + string requestPath = null, + string correlationId = null, + int? processId = null, + int? threadId = null, + bool? hasException = null) + { + var querys = new List, QueryContainer>>(); - return querys; + if (_currentTenant.IsAvailable) + { + querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SerilogInfo.Fields.TenantId))).Value(_currentTenant.GetId()))); + } + if (startTime.HasValue) + { + querys.Add((log) => log.DateRange((q) => q.Field(GetField(nameof(SerilogInfo.TimeStamp))).GreaterThanOrEquals(_clock.Normalize(startTime.Value)))); + } + if (endTime.HasValue) + { + querys.Add((log) => log.DateRange((q) => q.Field(GetField(nameof(SerilogInfo.TimeStamp))).LessThanOrEquals(_clock.Normalize(endTime.Value)))); + } + if (level.HasValue) + { + querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SerilogInfo.Level))).Value(GetLogEventLevel(level.Value).ToString()))); + } + if (!machineName.IsNullOrWhiteSpace()) + { + querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SerilogInfo.Fields.MachineName))).Value(machineName))); + } + if (!environment.IsNullOrWhiteSpace()) + { + querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SerilogInfo.Fields.Environment))).Value(environment))); + } + if (!application.IsNullOrWhiteSpace()) + { + querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SerilogInfo.Fields.Application))).Value(application))); + } + if (!context.IsNullOrWhiteSpace()) + { + querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SerilogInfo.Fields.Context))).Value(context))); + } + if (!requestId.IsNullOrWhiteSpace()) + { + querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SerilogInfo.Fields.RequestId))).Value(requestId))); + } + if (!requestPath.IsNullOrWhiteSpace()) + { + // 模糊匹配 + querys.Add((log) => log.MatchPhrasePrefix((q) => q.Field(f => f.Fields.RequestPath).Query(requestPath))); + } + if (!correlationId.IsNullOrWhiteSpace()) + { + querys.Add((log) => log.MatchPhrase((q) => q.Field(GetField(nameof(SerilogInfo.Fields.CorrelationId))).Query(correlationId))); + } + if (processId.HasValue) + { + querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SerilogInfo.Fields.ProcessId))).Value(processId))); + } + if (threadId.HasValue) + { + querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SerilogInfo.Fields.ThreadId))).Value(threadId))); } - protected virtual string CreateIndex(DateTimeOffset? offset = null) + if (hasException.HasValue) { - if (!offset.HasValue) + if (hasException.Value) { - return IndexFormatRegex.Replace(_options.IndexFormat, @"$1*$2"); + /* 存在exceptions字段则就是有异常信息 + * "exists": { + "field": "exceptions" + } + */ + querys.Add( + (q) => q.Exists( + (e) => e.Field("exceptions"))); + } + else + { + // 不存在 exceptions字段就是没有异常信息的消息 + /* + * "bool": { + "must_not": [ + { + "exists": { + "field": "exceptions" + } + } + ] + } + */ + querys.Add( + (q) => q.Bool( + (b) => b.MustNot( + (m) => m.Exists( + (e) => e.Field("exceptions"))))); } - return string.Format(_options.IndexFormat, offset.Value).ToLowerInvariant(); } - protected virtual LogEventLevel GetLogEventLevel(Microsoft.Extensions.Logging.LogLevel logLevel) + return querys; + } + + protected virtual string CreateIndex(DateTimeOffset? offset = null) + { + if (!offset.HasValue) { - return logLevel switch - { - Microsoft.Extensions.Logging.LogLevel.None or Microsoft.Extensions.Logging.LogLevel.Critical => LogEventLevel.Fatal, - Microsoft.Extensions.Logging.LogLevel.Error => LogEventLevel.Error, - Microsoft.Extensions.Logging.LogLevel.Warning => LogEventLevel.Warning, - Microsoft.Extensions.Logging.LogLevel.Information => LogEventLevel.Information, - Microsoft.Extensions.Logging.LogLevel.Debug => LogEventLevel.Debug, - _ => LogEventLevel.Verbose, - }; + return IndexFormatRegex.Replace(_options.IndexFormat, @"$1*$2"); } + return string.Format(_options.IndexFormat, offset.Value).ToLowerInvariant(); + } - private readonly static IDictionary _fieldMaps = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + protected virtual LogEventLevel GetLogEventLevel(Microsoft.Extensions.Logging.LogLevel logLevel) + { + return logLevel switch { - { "timestamp", "@timestamp" }, - { "level", "level.raw" }, - { "machinename", $"fields.{AbpLoggingEnricherPropertyNames.MachineName}.raw" }, - { "environment", $"fields.{AbpLoggingEnricherPropertyNames.EnvironmentName}.raw" }, - { "application", $"fields.{AbpSerilogEnrichersConsts.ApplicationNamePropertyName}.raw" }, - { "context", "fields.SourceContext.raw" }, - { "actionid", "fields.ActionId.raw" }, - { "actionname", "fields.ActionName.raw" }, - { "requestid", "fields.RequestId.raw" }, - { "requestpath", "fields.RequestPath" }, - { "connectionid", "fields.ConnectionId" }, - { "correlationid", "fields.CorrelationId.raw" }, - { "clientid", "fields.ClientId.raw" }, - { "userid", "fields.UserId.raw" }, - { "processid", "fields.ProcessId" }, - { "threadid", "fields.ThreadId" }, - { "id", $"fields.{AbpSerilogUniqueIdConsts.UniqueIdPropertyName}" }, - { "uniqueid", $"fields.{AbpSerilogUniqueIdConsts.UniqueIdPropertyName}" }, + Microsoft.Extensions.Logging.LogLevel.None or Microsoft.Extensions.Logging.LogLevel.Critical => LogEventLevel.Fatal, + Microsoft.Extensions.Logging.LogLevel.Error => LogEventLevel.Error, + Microsoft.Extensions.Logging.LogLevel.Warning => LogEventLevel.Warning, + Microsoft.Extensions.Logging.LogLevel.Information => LogEventLevel.Information, + Microsoft.Extensions.Logging.LogLevel.Debug => LogEventLevel.Debug, + _ => LogEventLevel.Verbose, }; - protected virtual string GetField(string field) + } + + private readonly static IDictionary _fieldMaps = new Dictionary(StringComparer.InvariantCultureIgnoreCase) + { + { "timestamp", "@timestamp" }, + { "level", "level.raw" }, + { "machinename", $"fields.{AbpLoggingEnricherPropertyNames.MachineName}.raw" }, + { "environment", $"fields.{AbpLoggingEnricherPropertyNames.EnvironmentName}.raw" }, + { "application", $"fields.{AbpSerilogEnrichersConsts.ApplicationNamePropertyName}.raw" }, + { "context", "fields.SourceContext.raw" }, + { "actionid", "fields.ActionId.raw" }, + { "actionname", "fields.ActionName.raw" }, + { "requestid", "fields.RequestId.raw" }, + { "requestpath", "fields.RequestPath" }, + { "connectionid", "fields.ConnectionId" }, + { "correlationid", "fields.CorrelationId.raw" }, + { "clientid", "fields.ClientId.raw" }, + { "userid", "fields.UserId.raw" }, + { "processid", "fields.ProcessId" }, + { "threadid", "fields.ThreadId" }, + { "id", $"fields.{AbpSerilogUniqueIdConsts.UniqueIdPropertyName}" }, + { "uniqueid", $"fields.{AbpSerilogUniqueIdConsts.UniqueIdPropertyName}" }, + }; + protected virtual string GetField(string field) + { + foreach (var fieldMap in _fieldMaps) { - foreach (var fieldMap in _fieldMaps) + if (field.ToLowerInvariant().Contains(fieldMap.Key)) { - if (field.ToLowerInvariant().Contains(fieldMap.Key)) - { - return fieldMap.Value; - } + return fieldMap.Value; } - - return field; } + + return field; } } diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogException.cs b/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogException.cs index 067ddbce0..377c340a0 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogException.cs +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogException.cs @@ -1,26 +1,25 @@ -namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch +namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch; + +public class SerilogException { - public class SerilogException - { - [Nest.PropertyName("SourceContext")] - public int Depth { get; set; } + [Nest.PropertyName("SourceContext")] + public int Depth { get; set; } - [Nest.PropertyName("ClassName")] - public string Class { get; set; } + [Nest.PropertyName("ClassName")] + public string Class { get; set; } - [Nest.PropertyName("Message")] - public string Message { get; set; } + [Nest.PropertyName("Message")] + public string Message { get; set; } - [Nest.PropertyName("Source")] - public string Source { get; set; } + [Nest.PropertyName("Source")] + public string Source { get; set; } - [Nest.PropertyName("StackTraceString")] - public string StackTrace { get; set; } + [Nest.PropertyName("StackTraceString")] + public string StackTrace { get; set; } - [Nest.PropertyName("HResult")] - public int HResult { get; set; } + [Nest.PropertyName("HResult")] + public int HResult { get; set; } - [Nest.PropertyName("HelpURL")] - public string HelpURL { get; set; } - } + [Nest.PropertyName("HelpURL")] + public string HelpURL { get; set; } } diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogField.cs b/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogField.cs index 1a0cdc901..a65e709ff 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogField.cs +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogField.cs @@ -2,56 +2,55 @@ using LINGYUN.Abp.Serilog.Enrichers.UniqueId; using System; -namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch +namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch; + +public class SerilogField { - public class SerilogField - { - [Nest.PropertyName(AbpSerilogUniqueIdConsts.UniqueIdPropertyName)] - public long UniqueId { get; set; } + [Nest.PropertyName(AbpSerilogUniqueIdConsts.UniqueIdPropertyName)] + public long UniqueId { get; set; } - [Nest.PropertyName(AbpLoggingEnricherPropertyNames.MachineName)] - public string MachineName { get; set; } + [Nest.PropertyName(AbpLoggingEnricherPropertyNames.MachineName)] + public string MachineName { get; set; } - [Nest.PropertyName(AbpLoggingEnricherPropertyNames.EnvironmentName)] - public string Environment { get; set; } + [Nest.PropertyName(AbpLoggingEnricherPropertyNames.EnvironmentName)] + public string Environment { get; set; } - [Nest.PropertyName(AbpSerilogEnrichersConsts.ApplicationNamePropertyName)] - public string Application { get; set; } + [Nest.PropertyName(AbpSerilogEnrichersConsts.ApplicationNamePropertyName)] + public string Application { get; set; } - [Nest.PropertyName("SourceContext")] - public string Context { get; set; } + [Nest.PropertyName("SourceContext")] + public string Context { get; set; } - [Nest.PropertyName("ActionId")] - public string ActionId { get; set; } + [Nest.PropertyName("ActionId")] + public string ActionId { get; set; } - [Nest.PropertyName("ActionName")] - public string ActionName { get; set; } + [Nest.PropertyName("ActionName")] + public string ActionName { get; set; } - [Nest.PropertyName("RequestId")] - public string RequestId { get; set; } + [Nest.PropertyName("RequestId")] + public string RequestId { get; set; } - [Nest.PropertyName("RequestPath")] - public string RequestPath { get; set; } + [Nest.PropertyName("RequestPath")] + public string RequestPath { get; set; } - [Nest.PropertyName("ConnectionId")] - public string ConnectionId { get; set; } + [Nest.PropertyName("ConnectionId")] + public string ConnectionId { get; set; } - [Nest.PropertyName("CorrelationId")] - public string CorrelationId { get; set; } + [Nest.PropertyName("CorrelationId")] + public string CorrelationId { get; set; } - [Nest.PropertyName("ClientId")] - public string ClientId { get; set; } + [Nest.PropertyName("ClientId")] + public string ClientId { get; set; } - [Nest.PropertyName("UserId")] - public string UserId { get; set; } + [Nest.PropertyName("UserId")] + public string UserId { get; set; } - [Nest.PropertyName("TenantId")] - public Guid? TenantId { get; set; } + [Nest.PropertyName("TenantId")] + public Guid? TenantId { get; set; } - [Nest.PropertyName("ProcessId")] - public int ProcessId { get; set; } + [Nest.PropertyName("ProcessId")] + public int ProcessId { get; set; } - [Nest.PropertyName("ThreadId")] - public int ThreadId { get; set; } - } + [Nest.PropertyName("ThreadId")] + public int ThreadId { get; set; } } diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogInfo.cs b/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogInfo.cs index 82a8feabc..b02b878fc 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogInfo.cs +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogInfo.cs @@ -3,24 +3,23 @@ using System; using System.Collections.Generic; -namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch +namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch; + +[Serializable] +public class SerilogInfo { - [Serializable] - public class SerilogInfo - { - [Nest.PropertyName(ElasticsearchJsonFormatter.TimestampPropertyName)] - public DateTime TimeStamp { get; set; } + [Nest.PropertyName(ElasticsearchJsonFormatter.TimestampPropertyName)] + public DateTime TimeStamp { get; set; } - [Nest.PropertyName(ElasticsearchJsonFormatter.LevelPropertyName)] - public LogEventLevel Level { get; set; } + [Nest.PropertyName(ElasticsearchJsonFormatter.LevelPropertyName)] + public LogEventLevel Level { get; set; } - [Nest.PropertyName(ElasticsearchJsonFormatter.RenderedMessagePropertyName)] - public string Message { get; set; } + [Nest.PropertyName(ElasticsearchJsonFormatter.RenderedMessagePropertyName)] + public string Message { get; set; } - [Nest.PropertyName("fields")] - public SerilogField Fields { get; set; } + [Nest.PropertyName("fields")] + public SerilogField Fields { get; set; } - [Nest.PropertyName("exceptions")] - public List Exceptions { get; set; } - } + [Nest.PropertyName("exceptions")] + public List Exceptions { get; set; } } diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN.Abp.Logging.csproj b/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN.Abp.Logging.csproj index 020f81c7f..4532af196 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN.Abp.Logging.csproj +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN.Abp.Logging.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Logging + LINGYUN.Abp.Logging + false + false + false diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/AbpLoggingEnricherPropertyNames.cs b/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/AbpLoggingEnricherPropertyNames.cs index e3aff205c..929f72b3e 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/AbpLoggingEnricherPropertyNames.cs +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/AbpLoggingEnricherPropertyNames.cs @@ -1,8 +1,7 @@ -namespace LINGYUN.Abp.Logging +namespace LINGYUN.Abp.Logging; + +public class AbpLoggingEnricherPropertyNames { - public class AbpLoggingEnricherPropertyNames - { - public const string MachineName = "MachineName"; - public const string EnvironmentName = "EnvironmentName"; - } + public const string MachineName = "MachineName"; + public const string EnvironmentName = "EnvironmentName"; } diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/AbpLoggingModule.cs b/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/AbpLoggingModule.cs index 18db2bc1d..25d46980a 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/AbpLoggingModule.cs +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/AbpLoggingModule.cs @@ -1,15 +1,14 @@ using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.Logging +namespace LINGYUN.Abp.Logging; + +public class AbpLoggingModule : AbpModule { - public class AbpLoggingModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) - { - var configuration = context.Services.GetConfiguration(); + var configuration = context.Services.GetConfiguration(); - Configure(configuration.GetSection("Logging")); - } + Configure(configuration.GetSection("Logging")); } } diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/DefaultLoggingManager.cs b/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/DefaultLoggingManager.cs index ae917790d..b21772d68 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/DefaultLoggingManager.cs +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/DefaultLoggingManager.cs @@ -6,67 +6,66 @@ using System.Threading.Tasks; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.Logging +namespace LINGYUN.Abp.Logging; + +[Dependency(TryRegister = true)] +public class DefaultLoggingManager : ILoggingManager, ISingletonDependency { - [Dependency(TryRegister = true)] - public class DefaultLoggingManager : ILoggingManager, ISingletonDependency - { - public ILogger Logger { protected get; set; } + public ILogger Logger { protected get; set; } - public DefaultLoggingManager() - { - Logger = NullLogger.Instance; - } + public DefaultLoggingManager() + { + Logger = NullLogger.Instance; + } - public Task GetAsync(string id, CancellationToken cancellationToken = default) - { - Logger.LogDebug("No logging manager is available!"); - LogInfo logInfo = null; - return Task.FromResult(logInfo); - } + public Task GetAsync(string id, CancellationToken cancellationToken = default) + { + Logger.LogDebug("No logging manager is available!"); + LogInfo logInfo = null; + return Task.FromResult(logInfo); + } - public Task GetCountAsync( - DateTime? startTime = null, - DateTime? endTime = null, - LogLevel? level = null, - string machineName = null, - string environment = null, - string application = null, - string context = null, - string requestId = null, - string requestPath = null, - string correlationId = null, - int? processId = null, - int? threadId = null, - bool? hasException = null, - CancellationToken cancellationToken = default) - { - Logger.LogDebug("No logging manager is available!"); - return Task.FromResult(0L); - } + public Task GetCountAsync( + DateTime? startTime = null, + DateTime? endTime = null, + LogLevel? level = null, + string machineName = null, + string environment = null, + string application = null, + string context = null, + string requestId = null, + string requestPath = null, + string correlationId = null, + int? processId = null, + int? threadId = null, + bool? hasException = null, + CancellationToken cancellationToken = default) + { + Logger.LogDebug("No logging manager is available!"); + return Task.FromResult(0L); + } - public Task> GetListAsync( - string sorting = null, - int maxResultCount = 50, - int skipCount = 0, - DateTime? startTime = null, - DateTime? endTime = null, - LogLevel? level = null, - string machineName = null, - string environment = null, - string application = null, - string context = null, - string requestId = null, - string requestPath = null, - string correlationId = null, - int? processId = null, - int? threadId = null, - bool? hasException = null, - bool includeDetails = false, - CancellationToken cancellationToken = default) - { - Logger.LogDebug("No logging manager is available!"); - return Task.FromResult(new List()); - } + public Task> GetListAsync( + string sorting = null, + int maxResultCount = 50, + int skipCount = 0, + DateTime? startTime = null, + DateTime? endTime = null, + LogLevel? level = null, + string machineName = null, + string environment = null, + string application = null, + string context = null, + string requestId = null, + string requestPath = null, + string correlationId = null, + int? processId = null, + int? threadId = null, + bool? hasException = null, + bool includeDetails = false, + CancellationToken cancellationToken = default) + { + Logger.LogDebug("No logging manager is available!"); + return Task.FromResult(new List()); } } diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/ILoggingManager.cs b/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/ILoggingManager.cs index 391bc20f3..8f38b1ba8 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/ILoggingManager.cs +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/ILoggingManager.cs @@ -4,48 +4,47 @@ using System.Threading; using System.Threading.Tasks; -namespace LINGYUN.Abp.Logging +namespace LINGYUN.Abp.Logging; + +public interface ILoggingManager { - public interface ILoggingManager - { - Task GetAsync( - string id, - CancellationToken cancellationToken = default(CancellationToken)); + Task GetAsync( + string id, + CancellationToken cancellationToken = default); - Task GetCountAsync( - DateTime? startTime = null, - DateTime? endTime = null, - LogLevel? level = null, - string machineName = null, - string environment = null, - string application = null, - string context = null, - string requestId = null, - string requestPath = null, - string correlationId = null, - int? processId = null, - int? threadId = null, - bool? hasException = null, - CancellationToken cancellationToken = default(CancellationToken)); + Task GetCountAsync( + DateTime? startTime = null, + DateTime? endTime = null, + LogLevel? level = null, + string machineName = null, + string environment = null, + string application = null, + string context = null, + string requestId = null, + string requestPath = null, + string correlationId = null, + int? processId = null, + int? threadId = null, + bool? hasException = null, + CancellationToken cancellationToken = default); - Task> GetListAsync( - string sorting = null, - int maxResultCount = 50, - int skipCount = 0, - DateTime? startTime = null, - DateTime? endTime = null, - LogLevel? level = null, - string machineName = null, - string environment = null, - string application = null, - string context = null, - string requestId = null, - string requestPath = null, - string correlationId = null, - int? processId = null, - int? threadId = null, - bool? hasException = null, - bool includeDetails = false, - CancellationToken cancellationToken = default(CancellationToken)); - } + Task> GetListAsync( + string sorting = null, + int maxResultCount = 50, + int skipCount = 0, + DateTime? startTime = null, + DateTime? endTime = null, + LogLevel? level = null, + string machineName = null, + string environment = null, + string application = null, + string context = null, + string requestId = null, + string requestPath = null, + string correlationId = null, + int? processId = null, + int? threadId = null, + bool? hasException = null, + bool includeDetails = false, + CancellationToken cancellationToken = default); } diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/LogException.cs b/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/LogException.cs index d699663f5..69de9768f 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/LogException.cs +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/LogException.cs @@ -1,13 +1,12 @@ -namespace LINGYUN.Abp.Logging +namespace LINGYUN.Abp.Logging; + +public class LogException { - public class LogException - { - public int Depth { get; set; } - public string Class { get; set; } - public string Message { get; set; } - public string Source { get; set; } - public string StackTrace { get; set; } - public int HResult { get; set; } - public string HelpURL { get; set; } - } + public int Depth { get; set; } + public string Class { get; set; } + public string Message { get; set; } + public string Source { get; set; } + public string StackTrace { get; set; } + public int HResult { get; set; } + public string HelpURL { get; set; } } diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/LogField.cs b/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/LogField.cs index 670af290d..d1469cfd0 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/LogField.cs +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/LogField.cs @@ -1,21 +1,20 @@ -namespace LINGYUN.Abp.Logging +namespace LINGYUN.Abp.Logging; + +public class LogField { - public class LogField - { - public string Id { get; set; } - public string MachineName { get; set; } - public string Environment { get; set; } - public string Application { get; set; } - public string Context { get; set; } - public string ActionId { get; set; } - public string ActionName { get; set; } - public string RequestId { get; set; } - public string RequestPath { get; set; } - public string ConnectionId { get; set; } - public string CorrelationId { get; set; } - public string ClientId { get; set; } - public string UserId { get; set; } - public int ProcessId { get; set; } - public int ThreadId { get; set; } - } + public string Id { get; set; } + public string MachineName { get; set; } + public string Environment { get; set; } + public string Application { get; set; } + public string Context { get; set; } + public string ActionId { get; set; } + public string ActionName { get; set; } + public string RequestId { get; set; } + public string RequestPath { get; set; } + public string ConnectionId { get; set; } + public string CorrelationId { get; set; } + public string ClientId { get; set; } + public string UserId { get; set; } + public int ProcessId { get; set; } + public int ThreadId { get; set; } } diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/LogInfo.cs b/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/LogInfo.cs index e03a1d445..36e767590 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/LogInfo.cs +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/LogInfo.cs @@ -2,14 +2,13 @@ using System; using System.Collections.Generic; -namespace LINGYUN.Abp.Logging +namespace LINGYUN.Abp.Logging; + +public class LogInfo { - public class LogInfo - { - public DateTime TimeStamp { get; set; } - public LogLevel Level { get; set; } - public string Message { get; set; } - public LogField Fields { get; set; } - public List Exceptions { get; set; } - } + public DateTime TimeStamp { get; set; } + public LogLevel Level { get; set; } + public string Message { get; set; } + public LogField Fields { get; set; } + public List Exceptions { get; set; } } diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.Application/LINGYUN.Abp.Serilog.Enrichers.Application.csproj b/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.Application/LINGYUN.Abp.Serilog.Enrichers.Application.csproj index a062dce15..84beaddc6 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.Application/LINGYUN.Abp.Serilog.Enrichers.Application.csproj +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.Application/LINGYUN.Abp.Serilog.Enrichers.Application.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Serilog.Enrichers.Application + LINGYUN.Abp.Serilog.Enrichers.Application + false + false + false diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.Application/LINGYUN/Abp/Serilog/Enrichers/Application/AbpSerilogEnrichersApplicationModule.cs b/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.Application/LINGYUN/Abp/Serilog/Enrichers/Application/AbpSerilogEnrichersApplicationModule.cs index c9f9a32ab..1c0c6f340 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.Application/LINGYUN/Abp/Serilog/Enrichers/Application/AbpSerilogEnrichersApplicationModule.cs +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.Application/LINGYUN/Abp/Serilog/Enrichers/Application/AbpSerilogEnrichersApplicationModule.cs @@ -1,8 +1,7 @@ using Volo.Abp.Modularity; -namespace LINGYUN.Abp.Serilog.Enrichers.Application +namespace LINGYUN.Abp.Serilog.Enrichers.Application; + +public class AbpSerilogEnrichersApplicationModule : AbpModule { - public class AbpSerilogEnrichersApplicationModule : AbpModule - { - } } diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.Application/LINGYUN/Abp/Serilog/Enrichers/Application/AbpSerilogEnrichersConsts.cs b/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.Application/LINGYUN/Abp/Serilog/Enrichers/Application/AbpSerilogEnrichersConsts.cs index f5f788b76..c3d38969a 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.Application/LINGYUN/Abp/Serilog/Enrichers/Application/AbpSerilogEnrichersConsts.cs +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.Application/LINGYUN/Abp/Serilog/Enrichers/Application/AbpSerilogEnrichersConsts.cs @@ -1,8 +1,7 @@ -namespace LINGYUN.Abp.Serilog.Enrichers.Application +namespace LINGYUN.Abp.Serilog.Enrichers.Application; + +public class AbpSerilogEnrichersConsts { - public class AbpSerilogEnrichersConsts - { - public const string ApplicationNamePropertyName = "ApplicationName"; - public static string ApplicationName { get; set; } = "app"; - } + public const string ApplicationNamePropertyName = "ApplicationName"; + public static string ApplicationName { get; set; } = "app"; } diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.Application/LINGYUN/Abp/Serilog/Enrichers/Application/ApplicationNameEnricher.cs b/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.Application/LINGYUN/Abp/Serilog/Enrichers/Application/ApplicationNameEnricher.cs index 8d5c3482b..9be8cb26f 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.Application/LINGYUN/Abp/Serilog/Enrichers/Application/ApplicationNameEnricher.cs +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.Application/LINGYUN/Abp/Serilog/Enrichers/Application/ApplicationNameEnricher.cs @@ -1,29 +1,28 @@ using Serilog.Core; using Serilog.Events; -namespace LINGYUN.Abp.Serilog.Enrichers.Application +namespace LINGYUN.Abp.Serilog.Enrichers.Application; + +public class ApplicationNameEnricher : ILogEventEnricher { - public class ApplicationNameEnricher : ILogEventEnricher + LogEventProperty _cachedProperty; + public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory) { - LogEventProperty _cachedProperty; - public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory) - { - logEvent.AddPropertyIfAbsent(GetLogEventProperty(propertyFactory)); - } + logEvent.AddPropertyIfAbsent(GetLogEventProperty(propertyFactory)); + } - private LogEventProperty GetLogEventProperty(ILogEventPropertyFactory propertyFactory) - { - if (_cachedProperty == null) - _cachedProperty = CreateProperty(propertyFactory); + private LogEventProperty GetLogEventProperty(ILogEventPropertyFactory propertyFactory) + { + if (_cachedProperty == null) + _cachedProperty = CreateProperty(propertyFactory); - return _cachedProperty; - } + return _cachedProperty; + } - private static LogEventProperty CreateProperty(ILogEventPropertyFactory propertyFactory) - { - return propertyFactory.CreateProperty( - AbpSerilogEnrichersConsts.ApplicationNamePropertyName, - AbpSerilogEnrichersConsts.ApplicationName); - } + private static LogEventProperty CreateProperty(ILogEventPropertyFactory propertyFactory) + { + return propertyFactory.CreateProperty( + AbpSerilogEnrichersConsts.ApplicationNamePropertyName, + AbpSerilogEnrichersConsts.ApplicationName); } } diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.Application/Serilog/ApplicationLoggerConfigurationExtensions.cs b/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.Application/Serilog/ApplicationLoggerConfigurationExtensions.cs index fc65060f2..c952551cd 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.Application/Serilog/ApplicationLoggerConfigurationExtensions.cs +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.Application/Serilog/ApplicationLoggerConfigurationExtensions.cs @@ -2,15 +2,14 @@ using Serilog.Configuration; using System; -namespace Serilog +namespace Serilog; + +public static class ApplicationLoggerConfigurationExtensions { - public static class ApplicationLoggerConfigurationExtensions + public static LoggerConfiguration WithApplicationName( + this LoggerEnrichmentConfiguration enrichmentConfiguration) { - public static LoggerConfiguration WithApplicationName( - this LoggerEnrichmentConfiguration enrichmentConfiguration) - { - if (enrichmentConfiguration == null) throw new ArgumentNullException(nameof(enrichmentConfiguration)); - return enrichmentConfiguration.With(); - } + if (enrichmentConfiguration == null) throw new ArgumentNullException(nameof(enrichmentConfiguration)); + return enrichmentConfiguration.With(); } } diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/LINGYUN.Abp.Serilog.Enrichers.UniqueId.csproj b/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/LINGYUN.Abp.Serilog.Enrichers.UniqueId.csproj index 837aa3f4d..4470e93f1 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/LINGYUN.Abp.Serilog.Enrichers.UniqueId.csproj +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/LINGYUN.Abp.Serilog.Enrichers.UniqueId.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Serilog.Enrichers.UniqueId + LINGYUN.Abp.Serilog.Enrichers.UniqueId + false + false + false diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/LINGYUN/Abp/Serilog/Enrichers/UniqueId/AbpSerilogEnrichersUniqueIdModule.cs b/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/LINGYUN/Abp/Serilog/Enrichers/UniqueId/AbpSerilogEnrichersUniqueIdModule.cs index b5a31e195..1211dec1c 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/LINGYUN/Abp/Serilog/Enrichers/UniqueId/AbpSerilogEnrichersUniqueIdModule.cs +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/LINGYUN/Abp/Serilog/Enrichers/UniqueId/AbpSerilogEnrichersUniqueIdModule.cs @@ -3,15 +3,14 @@ using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.Serilog.Enrichers.UniqueId +namespace LINGYUN.Abp.Serilog.Enrichers.UniqueId; + +[DependsOn(typeof(AbpIdGeneratorModule))] +public class AbpSerilogEnrichersUniqueIdModule : AbpModule { - [DependsOn(typeof(AbpIdGeneratorModule))] - public class AbpSerilogEnrichersUniqueIdModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) - { - var options = context.Services.ExecutePreConfiguredActions(); - UniqueIdEnricher.DistributedIdGenerator = SnowflakeIdGenerator.Create(options.SnowflakeIdOptions); - } + var options = context.Services.ExecutePreConfiguredActions(); + UniqueIdEnricher.DistributedIdGenerator = SnowflakeIdGenerator.Create(options.SnowflakeIdOptions); } } diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/LINGYUN/Abp/Serilog/Enrichers/UniqueId/AbpSerilogUniqueIdConsts.cs b/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/LINGYUN/Abp/Serilog/Enrichers/UniqueId/AbpSerilogUniqueIdConsts.cs index bad87e4cc..b1da6a681 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/LINGYUN/Abp/Serilog/Enrichers/UniqueId/AbpSerilogUniqueIdConsts.cs +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/LINGYUN/Abp/Serilog/Enrichers/UniqueId/AbpSerilogUniqueIdConsts.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.Serilog.Enrichers.UniqueId +namespace LINGYUN.Abp.Serilog.Enrichers.UniqueId; + +public class AbpSerilogUniqueIdConsts { - public class AbpSerilogUniqueIdConsts - { - public const string UniqueIdPropertyName = "UniqueId"; - } + public const string UniqueIdPropertyName = "UniqueId"; } diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/LINGYUN/Abp/Serilog/Enrichers/UniqueId/UniqueIdEnricher.cs b/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/LINGYUN/Abp/Serilog/Enrichers/UniqueId/UniqueIdEnricher.cs index c26ce56ef..cc71471ac 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/LINGYUN/Abp/Serilog/Enrichers/UniqueId/UniqueIdEnricher.cs +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/LINGYUN/Abp/Serilog/Enrichers/UniqueId/UniqueIdEnricher.cs @@ -2,18 +2,17 @@ using Serilog.Core; using Serilog.Events; -namespace LINGYUN.Abp.Serilog.Enrichers.UniqueId +namespace LINGYUN.Abp.Serilog.Enrichers.UniqueId; + +public class UniqueIdEnricher : ILogEventEnricher { - public class UniqueIdEnricher : ILogEventEnricher - { - internal static IDistributedIdGenerator DistributedIdGenerator; + internal static IDistributedIdGenerator DistributedIdGenerator; - public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory) - { - logEvent.AddOrUpdateProperty( - propertyFactory.CreateProperty( - AbpSerilogUniqueIdConsts.UniqueIdPropertyName, - DistributedIdGenerator.Create())); - } + public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory) + { + logEvent.AddOrUpdateProperty( + propertyFactory.CreateProperty( + AbpSerilogUniqueIdConsts.UniqueIdPropertyName, + DistributedIdGenerator.Create())); } } diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/Serilog/UniqueIdLoggerConfigurationExtensions.cs b/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/Serilog/UniqueIdLoggerConfigurationExtensions.cs index 6c9d91d28..28b939108 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/Serilog/UniqueIdLoggerConfigurationExtensions.cs +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/Serilog/UniqueIdLoggerConfigurationExtensions.cs @@ -2,15 +2,14 @@ using Serilog.Configuration; using System; -namespace Serilog +namespace Serilog; + +public static class UniqueIdLoggerConfigurationExtensions { - public static class UniqueIdLoggerConfigurationExtensions + public static LoggerConfiguration WithUniqueId( + this LoggerEnrichmentConfiguration enrichmentConfiguration) { - public static LoggerConfiguration WithUniqueId( - this LoggerEnrichmentConfiguration enrichmentConfiguration) - { - if (enrichmentConfiguration == null) throw new ArgumentNullException(nameof(enrichmentConfiguration)); - return enrichmentConfiguration.With(); - } + if (enrichmentConfiguration == null) throw new ArgumentNullException(nameof(enrichmentConfiguration)); + return enrichmentConfiguration.With(); } } diff --git a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Idempotent.Wrapper/LINGYUN.Abp.AspNetCore.Mvc.Idempotent.Wrapper.csproj b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Idempotent.Wrapper/LINGYUN.Abp.AspNetCore.Mvc.Idempotent.Wrapper.csproj index 64fe150a7..ea23177f1 100644 --- a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Idempotent.Wrapper/LINGYUN.Abp.AspNetCore.Mvc.Idempotent.Wrapper.csproj +++ b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Idempotent.Wrapper/LINGYUN.Abp.AspNetCore.Mvc.Idempotent.Wrapper.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.AspNetCore.Mvc.Idempotent.Wrapper + LINGYUN.Abp.AspNetCore.Mvc.Idempotent.Wrapper + false + false + false diff --git a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Idempotent/LINGYUN.Abp.AspNetCore.Mvc.Idempotent.csproj b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Idempotent/LINGYUN.Abp.AspNetCore.Mvc.Idempotent.csproj index bdf8baacb..97c65da02 100644 --- a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Idempotent/LINGYUN.Abp.AspNetCore.Mvc.Idempotent.csproj +++ b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Idempotent/LINGYUN.Abp.AspNetCore.Mvc.Idempotent.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.AspNetCore.Mvc.Idempotent + LINGYUN.Abp.AspNetCore.Mvc.Idempotent + false + false + false diff --git a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN.Abp.AspNetCore.Mvc.Wrapper.csproj b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN.Abp.AspNetCore.Mvc.Wrapper.csproj index c3929b190..bf8418195 100644 --- a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN.Abp.AspNetCore.Mvc.Wrapper.csproj +++ b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN.Abp.AspNetCore.Mvc.Wrapper.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.AspNetCore.Mvc.Wrapper + LINGYUN.Abp.AspNetCore.Mvc.Wrapper + false + false + false diff --git a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/AbpAspNetCoreMvcWrapperModule.cs b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/AbpAspNetCoreMvcWrapperModule.cs index 840736a10..eb171a97c 100644 --- a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/AbpAspNetCoreMvcWrapperModule.cs +++ b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/AbpAspNetCoreMvcWrapperModule.cs @@ -5,85 +5,84 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Localization; -using System.Collections.Generic; using Volo.Abp.AspNetCore.Mvc; -using Volo.Abp.AspNetCore.Mvc.ApiExploring; using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; using Volo.Abp.AspNetCore.Mvc.ProxyScripting; using Volo.Abp.Content; -using Volo.Abp.Http.Modeling; using Volo.Abp.Localization; using Volo.Abp.Modularity; using Volo.Abp.VirtualFileSystem; -namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper +namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper; + +[DependsOn( + typeof(AbpWrapperModule), + typeof(AbpAspNetCoreWrapperModule))] +public class AbpAspNetCoreMvcWrapperModule : AbpModule { - [DependsOn( - typeof(AbpWrapperModule), - typeof(AbpAspNetCoreWrapperModule))] - public class AbpAspNetCoreMvcWrapperModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + Configure(options => { - Configure(options => - { - options.FileSets.AddEmbedded(); - }); + options.FileSets.AddEmbedded(); + }); - Configure(options => - { - options.Resources - .Add("en") - .AddVirtualJson("/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Localization/Resources"); - }); + Configure(options => + { + options.Resources + .Add("en") + .AddVirtualJson("/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Localization/Resources"); + }); - Configure(mvcOptions => - { - // Wrap Result Filter - mvcOptions.Filters.AddService(typeof(AbpWrapResultFilter)); - }); + Configure(mvcOptions => + { + // Wrap Result Filter + mvcOptions.Filters.AddService(typeof(AbpWrapResultFilter)); + }); - Configure(options => - { - // 即使重写端点也不包装返回结果 - // api/abp/api-definition - options.IgnoreReturnTypes.Add(); - // api/abp/application-configuration - options.IgnoreReturnTypes.Add(); - // api/abp/application-localization - options.IgnoreReturnTypes.Add(); - // 文件流 - options.IgnoreReturnTypes.Add(); - options.IgnoreReturnTypes.Add(); + Configure(options => + { + // 即使重写端点也不包装返回结果 + // api/abp/api-definition + // options.IgnoreReturnTypes.Add(); + // api/abp/application-configuration + // options.IgnoreReturnTypes.Add(); + // api/abp/application-localization + // options.IgnoreReturnTypes.Add(); + // 文件流 + options.IgnoreReturnTypes.Add(); + // options.IgnoreReturnTypes.Add(); - //options.IgnoreReturnTypes.Add(); - //options.IgnoreReturnTypes.Add(); - //options.IgnoreReturnTypes.Add(); - - //options.IgnoreReturnTypes.Add(); - //options.IgnoreReturnTypes.Add(); - //options.IgnoreReturnTypes.Add(); + //options.IgnoreReturnTypes.Add(); + //options.IgnoreReturnTypes.Add(); + //options.IgnoreReturnTypes.Add(); + + //options.IgnoreReturnTypes.Add(); + //options.IgnoreReturnTypes.Add(); + //options.IgnoreReturnTypes.Add(); - //options.IgnoreReturnTypes.Add(); - //options.IgnoreReturnTypes.Add(); - //options.IgnoreReturnTypes.Add(); + //options.IgnoreReturnTypes.Add(); + //options.IgnoreReturnTypes.Add(); + //options.IgnoreReturnTypes.Add(); - // Abp/ServiceProxyScript - options.IgnoreControllers.Add(); - options.IgnoreControllers.Add(); - options.IgnoreControllers.Add(); - options.IgnoreControllers.Add(); + // Abp/ServiceProxyScript + options.IgnoreControllers.Add(); + // options.IgnoreControllers.Add(); + // options.IgnoreControllers.Add(); + options.IgnoreControllers.Add(); - // 官方模块不包装结果 - options.IgnoreNamespaces.Add("Volo.Abp"); + // 官方模块不包装结果 + // options.IgnoreNamespaces.Add("Volo.Abp"); - // 返回本地化的 404 错误消息 - options.MessageWithEmptyResult = (serviceProvider) => - { - var localizer = serviceProvider.GetRequiredService>(); - return localizer["Wrapper:NotFound"]; - }; - }); - } + // oidc端点不包装结果 + options.IgnorePrefixUrls.Add("/connect"); + + // 返回本地化的 404 错误消息 + options.MessageWithEmptyResult = (serviceProvider) => + { + var localizer = serviceProvider.GetRequiredService>(); + return localizer["Wrapper:NotFound"]; + }; + }); } } diff --git a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionPageWrapResultFilter.cs b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionPageWrapResultFilter.cs index 3d14a576a..00c89938b 100644 --- a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionPageWrapResultFilter.cs +++ b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionPageWrapResultFilter.cs @@ -19,81 +19,96 @@ using Volo.Abp.Http; using Volo.Abp.Json; -namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper.ExceptionHandling +namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper.ExceptionHandling; + +[Dependency(ReplaceServices = true)] +[ExposeServices(typeof(AbpExceptionPageFilter))] +public class AbpExceptionPageWrapResultFilter: AbpExceptionPageFilter, ITransientDependency { - [Dependency(ReplaceServices = true)] - [ExposeServices(typeof(AbpExceptionPageFilter))] - public class AbpExceptionPageWrapResultFilter: AbpExceptionPageFilter, ITransientDependency + protected override async Task HandleAndWrapException(PageHandlerExecutedContext context) { - protected override async Task HandleAndWrapException(PageHandlerExecutedContext context) + var wrapResultChecker = context.GetRequiredService(); + if (!wrapResultChecker.WrapOnException(context)) { - var wrapResultChecker = context.GetRequiredService(); - if (!wrapResultChecker.WrapOnException(context)) - { - await base.HandleAndWrapException(context); - return; - } + await base.HandleAndWrapException(context); + return; + } - var wrapOptions = context.GetRequiredService>().Value; - var exceptionHandlingOptions = context.GetRequiredService>().Value; - var exceptionToErrorInfoConverter = context.GetRequiredService(); - var remoteServiceErrorInfo = exceptionToErrorInfoConverter.Convert(context.Exception, options => - { - options.SendExceptionsDetailsToClients = exceptionHandlingOptions.SendExceptionsDetailsToClients; - options.SendStackTraceToClients = exceptionHandlingOptions.SendStackTraceToClients; - }); + var wrapOptions = context.GetRequiredService>().Value; + var exceptionHandlingOptions = context.GetRequiredService>().Value; + var exceptionToErrorInfoConverter = context.GetRequiredService(); + var remoteServiceErrorInfo = exceptionToErrorInfoConverter.Convert(context.Exception, options => + { + options.SendExceptionsDetailsToClients = exceptionHandlingOptions.SendExceptionsDetailsToClients; + options.SendStackTraceToClients = exceptionHandlingOptions.SendStackTraceToClients; + }); - var logLevel = context.Exception.GetLogLevel(); + var logLevel = context.Exception.GetLogLevel(); - var remoteServiceErrorInfoBuilder = new StringBuilder(); - remoteServiceErrorInfoBuilder.AppendLine($"---------- {nameof(RemoteServiceErrorInfo)} ----------"); - remoteServiceErrorInfoBuilder.AppendLine(context.GetRequiredService().Serialize(remoteServiceErrorInfo, indented: true)); + var remoteServiceErrorInfoBuilder = new StringBuilder(); + remoteServiceErrorInfoBuilder.AppendLine($"---------- {nameof(RemoteServiceErrorInfo)} ----------"); + remoteServiceErrorInfoBuilder.AppendLine(context.GetRequiredService().Serialize(remoteServiceErrorInfo, indented: true)); - var logger = context.GetService>(NullLogger.Instance); - logger.LogWithLevel(logLevel, remoteServiceErrorInfoBuilder.ToString()); + var logger = context.GetService>(NullLogger.Instance); + logger.LogWithLevel(logLevel, remoteServiceErrorInfoBuilder.ToString()); - logger.LogException(context.Exception, logLevel); + logger.LogException(context.Exception, logLevel); - await context.GetRequiredService().NotifyAsync(new ExceptionNotificationContext(context.Exception)); + await context.GetRequiredService().NotifyAsync(new ExceptionNotificationContext(context.Exception)); + var isAuthenticated = context.HttpContext.User?.Identity?.IsAuthenticated ?? false; - if (context.Exception is AbpAuthorizationException) + if (context.Exception is AbpAuthorizationException) + { + if (!wrapOptions.IsWrapUnauthorizedEnabled) { await context.HttpContext.RequestServices.GetRequiredService() - .HandleAsync(context.Exception.As(), context.HttpContext); + .HandleAsync(context.Exception.As(), context.HttpContext); + + context.Exception = null; + + return; } - else + + if (isAuthenticated) { - var httpResponseWrapper = context.GetRequiredService(); - var statusCodFinder = context.GetRequiredService(); - var exceptionWrapHandler = context.GetRequiredService(); - var exceptionWrapContext = new ExceptionWrapContext( - context.Exception, - remoteServiceErrorInfo, - context.HttpContext.RequestServices, - statusCodFinder.GetStatusCode(context.HttpContext, context.Exception)); - exceptionWrapHandler.CreateFor(exceptionWrapContext).Wrap(exceptionWrapContext); - context.Result = new ObjectResult(new WrapResult( - exceptionWrapContext.ErrorInfo.Code, - exceptionWrapContext.ErrorInfo.Message, - exceptionWrapContext.ErrorInfo.Details)); - - var wrapperHeaders = new Dictionary() - { - { AbpHttpWrapConsts.AbpWrapResult, "true" } - }; - var responseWrapperContext = new HttpResponseWrapperContext( - context.HttpContext, - (int)wrapOptions.HttpStatusCode, - wrapperHeaders); - - httpResponseWrapper.Wrap(responseWrapperContext); - - //context.HttpContext.Response.Headers.Add(AbpHttpWrapConsts.AbpWrapResult, "true"); - //context.HttpContext.Response.StatusCode = (int)wrapOptions.HttpStatusCode; - } + await context.HttpContext.RequestServices.GetRequiredService() + .HandleAsync(context.Exception.As(), context.HttpContext); + + context.Exception = null; - context.Exception = null; //Handled! + return; + } } + + var httpResponseWrapper = context.GetRequiredService(); + var statusCodFinder = context.GetRequiredService(); + var exceptionWrapHandler = context.GetRequiredService(); + var exceptionWrapContext = new ExceptionWrapContext( + context.Exception, + remoteServiceErrorInfo, + context.HttpContext.RequestServices, + statusCodFinder.GetStatusCode(context.HttpContext, context.Exception)); + exceptionWrapHandler.CreateFor(exceptionWrapContext).Wrap(exceptionWrapContext); + context.Result = new ObjectResult(new WrapResult( + exceptionWrapContext.ErrorInfo.Code, + exceptionWrapContext.ErrorInfo.Message, + exceptionWrapContext.ErrorInfo.Details)); + + var wrapperHeaders = new Dictionary() + { + { AbpHttpWrapConsts.AbpWrapResult, "true" } + }; + var responseWrapperContext = new HttpResponseWrapperContext( + context.HttpContext, + (int)wrapOptions.HttpStatusCode, + wrapperHeaders); + + httpResponseWrapper.Wrap(responseWrapperContext); + + //context.HttpContext.Response.Headers.Add(AbpHttpWrapConsts.AbpWrapResult, "true"); + //context.HttpContext.Response.StatusCode = (int)wrapOptions.HttpStatusCode; + + context.Exception = null; //Handled! } } diff --git a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionWrapResultFilter.cs b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionWrapResultFilter.cs index 61ad6e677..3c4021c0f 100644 --- a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionWrapResultFilter.cs +++ b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionWrapResultFilter.cs @@ -1,5 +1,6 @@ using LINGYUN.Abp.AspNetCore.Wrapper; using LINGYUN.Abp.Wrapper; +using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.Extensions.DependencyInjection; @@ -20,7 +21,7 @@ namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper.ExceptionHandling; [ExposeServices(typeof(AbpExceptionFilter))] public class AbpExceptionWrapResultFilter : AbpExceptionFilter, ITransientDependency { - protected override async Task HandleAndWrapException(ExceptionContext context) + protected async override Task HandleAndWrapException(ExceptionContext context) { var wrapResultChecker = context.GetRequiredService(); @@ -34,40 +35,57 @@ protected override async Task HandleAndWrapException(ExceptionContext context) await context.GetRequiredService().NotifyAsync(new ExceptionNotificationContext(context.Exception)); + var isAuthenticated = context.HttpContext.User?.Identity?.IsAuthenticated ?? false; + var wrapOptions = context.GetRequiredService>().Value; + if (context.Exception is AbpAuthorizationException) { - await context.HttpContext.RequestServices.GetRequiredService() - .HandleAsync(context.Exception.As(), context.HttpContext); + if (!wrapOptions.IsWrapUnauthorizedEnabled) + { + await context.HttpContext.RequestServices.GetRequiredService() + .HandleAsync(context.Exception.As(), context.HttpContext); + + context.Exception = null; + + return; + } + + if (isAuthenticated) + { + await context.HttpContext.RequestServices.GetRequiredService() + .HandleAsync(context.Exception.As(), context.HttpContext); + + context.Exception = null; + + return; + } } - else - { - var wrapOptions = context.GetRequiredService>().Value; - var httpResponseWrapper = context.GetRequiredService(); - var statusCodFinder = context.GetRequiredService(); - var exceptionWrapHandler = context.GetRequiredService(); - - var exceptionWrapContext = new ExceptionWrapContext( - context.Exception, - remoteServiceErrorInfo, - context.HttpContext.RequestServices, - statusCodFinder.GetStatusCode(context.HttpContext, context.Exception)); - exceptionWrapHandler.CreateFor(exceptionWrapContext).Wrap(exceptionWrapContext); - context.Result = new ObjectResult(new WrapResult( - exceptionWrapContext.ErrorInfo.Code, - exceptionWrapContext.ErrorInfo.Message, - exceptionWrapContext.ErrorInfo.Details)); - - var wrapperHeaders = new Dictionary() + + var httpResponseWrapper = context.GetRequiredService(); + var statusCodFinder = context.GetRequiredService(); + var exceptionWrapHandler = context.GetRequiredService(); + + var exceptionWrapContext = new ExceptionWrapContext( + context.Exception, + remoteServiceErrorInfo, + context.HttpContext.RequestServices, + statusCodFinder.GetStatusCode(context.HttpContext, context.Exception)); + exceptionWrapHandler.CreateFor(exceptionWrapContext).Wrap(exceptionWrapContext); + context.Result = new ObjectResult(new WrapResult( + exceptionWrapContext.ErrorInfo.Code, + exceptionWrapContext.ErrorInfo.Message, + exceptionWrapContext.ErrorInfo.Details)); + + var wrapperHeaders = new Dictionary() { { AbpHttpWrapConsts.AbpWrapResult, "true" } }; - var responseWrapperContext = new HttpResponseWrapperContext( - context.HttpContext, - (int)wrapOptions.HttpStatusCode, - wrapperHeaders); + var responseWrapperContext = new HttpResponseWrapperContext( + context.HttpContext, + (int)wrapOptions.HttpStatusCode, + wrapperHeaders); - httpResponseWrapper.Wrap(responseWrapperContext); - } + httpResponseWrapper.Wrap(responseWrapperContext); context.Exception = null; //Handled! } diff --git a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Filters/AbpWrapResultFilter.cs b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Filters/AbpWrapResultFilter.cs index 8cefd3273..2d74f5e07 100644 --- a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Filters/AbpWrapResultFilter.cs +++ b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Filters/AbpWrapResultFilter.cs @@ -8,49 +8,48 @@ using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper.Filters +namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper.Filters; + +public class AbpWrapResultFilter : IAsyncResultFilter, ITransientDependency { - public class AbpWrapResultFilter : IAsyncResultFilter, ITransientDependency + public async Task OnResultExecutionAsync(ResultExecutingContext context, ResultExecutionDelegate next) { - public async Task OnResultExecutionAsync(ResultExecutingContext context, ResultExecutionDelegate next) + if (ShouldWrapResult(context)) { - if (ShouldWrapResult(context)) - { - await HandleAndWrapResult(context); - } - - await next(); + await HandleAndWrapResult(context); } - protected virtual bool ShouldWrapResult(ResultExecutingContext context) - { - var wrapResultChecker = context.GetRequiredService(); + await next(); + } - return wrapResultChecker.WrapOnExecution(context); - } + protected virtual bool ShouldWrapResult(ResultExecutingContext context) + { + var wrapResultChecker = context.GetRequiredService(); + + return wrapResultChecker.WrapOnExecution(context); + } + + protected virtual Task HandleAndWrapResult(ResultExecutingContext context) + { + var options = context.GetRequiredService>().Value; + var httpResponseWrapper = context.GetRequiredService(); + var actionResultWrapperFactory = context.GetRequiredService(); + actionResultWrapperFactory.CreateFor(context).Wrap(context); - protected virtual Task HandleAndWrapResult(ResultExecutingContext context) + var wrapperHeaders = new Dictionary() { - var options = context.GetRequiredService>().Value; - var httpResponseWrapper = context.GetRequiredService(); - var actionResultWrapperFactory = context.GetRequiredService(); - actionResultWrapperFactory.CreateFor(context).Wrap(context); - - var wrapperHeaders = new Dictionary() - { - { AbpHttpWrapConsts.AbpWrapResult, "true" } - }; - var responseWrapperContext = new HttpResponseWrapperContext( - context.HttpContext, - (int)options.HttpStatusCode, - wrapperHeaders); - - httpResponseWrapper.Wrap(responseWrapperContext); - - //context.HttpContext.Response.Headers.Add(AbpHttpWrapConsts.AbpWrapResult, "true"); - //context.HttpContext.Response.StatusCode = (int)options.HttpStatusCode; - - return Task.CompletedTask; - } + { AbpHttpWrapConsts.AbpWrapResult, "true" } + }; + var responseWrapperContext = new HttpResponseWrapperContext( + context.HttpContext, + (int)options.HttpStatusCode, + wrapperHeaders); + + httpResponseWrapper.Wrap(responseWrapperContext); + + //context.HttpContext.Response.Headers.Add(AbpHttpWrapConsts.AbpWrapResult, "true"); + //context.HttpContext.Response.StatusCode = (int)options.HttpStatusCode; + + return Task.CompletedTask; } } diff --git a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/IWrapResultChecker.cs b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/IWrapResultChecker.cs index 2ec59073a..a98c5bf5f 100644 --- a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/IWrapResultChecker.cs +++ b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/IWrapResultChecker.cs @@ -1,16 +1,15 @@ using Microsoft.AspNetCore.Mvc.Abstractions; using Microsoft.AspNetCore.Mvc.Filters; -namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper +namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper; + +public interface IWrapResultChecker { - public interface IWrapResultChecker - { - bool WrapOnAction(ActionDescriptor actionDescriptor); + bool WrapOnAction(ActionDescriptor actionDescriptor); - bool WrapOnExecution(FilterContext context); + bool WrapOnExecution(FilterContext context); - bool WrapOnException(ExceptionContext context); + bool WrapOnException(ExceptionContext context); - bool WrapOnException(PageHandlerExecutedContext context); - } + bool WrapOnException(PageHandlerExecutedContext context); } diff --git a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Localization/AbpMvcWrapperResource.cs b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Localization/AbpMvcWrapperResource.cs index c11c18efa..7d4fb0374 100644 --- a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Localization/AbpMvcWrapperResource.cs +++ b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Localization/AbpMvcWrapperResource.cs @@ -1,9 +1,8 @@ using Volo.Abp.Localization; -namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper.Localization +namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper.Localization; + +[LocalizationResourceName("AbpMvcWrapper")] +public class AbpMvcWrapperResource { - [LocalizationResourceName("AbpMvcWrapper")] - public class AbpMvcWrapperResource - { - } } diff --git a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/WrapResultChecker.cs b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/WrapResultChecker.cs index 8ebaf38a3..31bedc28c 100644 --- a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/WrapResultChecker.cs +++ b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/WrapResultChecker.cs @@ -9,191 +9,190 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.Threading; -namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper +namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper; + +public class WrapResultChecker : IWrapResultChecker, ISingletonDependency { - public class WrapResultChecker : IWrapResultChecker, ISingletonDependency + protected AbpWrapperOptions Options { get; } + + public WrapResultChecker(IOptionsMonitor optionsMonitor) { - protected AbpWrapperOptions Options { get; } + Options = optionsMonitor.CurrentValue; + } - public WrapResultChecker(IOptionsMonitor optionsMonitor) + public virtual bool WrapOnAction(ActionDescriptor actionDescriptor) + { + if (!Options.IsEnabled) { - Options = optionsMonitor.CurrentValue; + return false; } - public virtual bool WrapOnAction(ActionDescriptor actionDescriptor) - { - if (!Options.IsEnabled) - { - return false; - } + return CheckForActionDescriptor(actionDescriptor); + } - return CheckForActionDescriptor(actionDescriptor); + public bool WrapOnException(ExceptionContext context) + { + if (!CheckForBase(context)) + { + return false; } - public bool WrapOnException(ExceptionContext context) + return CheckForException(context.Exception); + } + + public bool WrapOnException(PageHandlerExecutedContext context) + { + if (!CheckForBase(context)) { - if (!CheckForBase(context)) - { - return false; - } + return false; + } - return CheckForException(context.Exception); + return CheckForException(context.Exception); + } + + public bool WrapOnExecution(FilterContext context) + { + return CheckForBase(context); + } + + protected virtual bool CheckForBase(FilterContext context) + { + if (!Options.IsEnabled) + { + return false; } - public bool WrapOnException(PageHandlerExecutedContext context) + // 用户传递不包装 + if (context.HttpContext.Request.Headers.ContainsKey(AbpHttpWrapConsts.AbpDontWrapResult)) { - if (!CheckForBase(context)) - { - return false; - } + return false; + } - return CheckForException(context.Exception); + // 用户传递需要包装 + if (context.HttpContext.Request.Headers.ContainsKey(AbpHttpWrapConsts.AbpWrapResult)) + { + return true; } - public bool WrapOnExecution(FilterContext context) + if (!CheckForUrl(context)) { - return CheckForBase(context); + return false; } - protected virtual bool CheckForBase(FilterContext context) + return CheckForActionDescriptor(context.ActionDescriptor); + } + + protected virtual bool CheckForActionDescriptor(ActionDescriptor descriptor) + { + if (descriptor is ControllerActionDescriptor controllerActionDescriptor) { - if (!Options.IsEnabled) + if (!descriptor.HasObjectResult()) { return false; } - // 用户传递不包装 - if (context.HttpContext.Request.Headers.ContainsKey(AbpHttpWrapConsts.AbpDontWrapResult)) + if (!CheckForNamespace(controllerActionDescriptor)) { return false; } - // 用户传递需要包装 - if (context.HttpContext.Request.Headers.ContainsKey(AbpHttpWrapConsts.AbpWrapResult)) - { - return true; - } - - if (!CheckForUrl(context)) + if (!CheckForController(controllerActionDescriptor)) { return false; } - return CheckForActionDescriptor(context.ActionDescriptor); - } - - protected virtual bool CheckForActionDescriptor(ActionDescriptor descriptor) - { - if (descriptor is ControllerActionDescriptor controllerActionDescriptor) + if (!CheckForInterfaces(controllerActionDescriptor)) { - if (!descriptor.HasObjectResult()) - { - return false; - } - - if (!CheckForNamespace(controllerActionDescriptor)) - { - return false; - } - - if (!CheckForController(controllerActionDescriptor)) - { - return false; - } - - if (!CheckForInterfaces(controllerActionDescriptor)) - { - return false; - } - - if (!CheckForMethod(controllerActionDescriptor)) - { - return false; - } - - if (!CheckForReturnType(controllerActionDescriptor)) - { - return false; - } - - return true; + return false; } - return false; - } - - protected virtual bool CheckForUrl(FilterContext context) - { - if (!Options.IgnorePrefixUrls.Any()) + if (!CheckForMethod(controllerActionDescriptor)) { - return true; + return false; } - var url = BuildUrl(context.HttpContext); - return !Options.IgnorePrefixUrls.Any(urlPrefix => urlPrefix.StartsWith(url)); - } - protected virtual bool CheckForController(ControllerActionDescriptor controllerActionDescriptor) - { - if (controllerActionDescriptor.ControllerTypeInfo.IsDefined(typeof(IgnoreWrapResultAttribute), true)) + if (!CheckForReturnType(controllerActionDescriptor)) { return false; } - return !Options.IgnoreControllers.Any(controller => - controller.IsAssignableFrom(controllerActionDescriptor.ControllerTypeInfo)); + return true; } - protected virtual bool CheckForMethod(ControllerActionDescriptor controllerActionDescriptor) + return false; + } + + protected virtual bool CheckForUrl(FilterContext context) + { + if (!Options.IgnorePrefixUrls.Any()) { - return !controllerActionDescriptor.MethodInfo.IsDefined(typeof(IgnoreWrapResultAttribute), true); + return true; } + var url = BuildUrl(context.HttpContext); + return !Options.IgnorePrefixUrls.Any(urlPrefix => urlPrefix.StartsWith(url)); + } - protected virtual bool CheckForNamespace(ControllerActionDescriptor controllerActionDescriptor) + protected virtual bool CheckForController(ControllerActionDescriptor controllerActionDescriptor) + { + if (controllerActionDescriptor.ControllerTypeInfo.IsDefined(typeof(IgnoreWrapResultAttribute), true)) { - if (string.IsNullOrWhiteSpace(controllerActionDescriptor.ControllerTypeInfo.Namespace)) - { - return true; - } - - return !Options.IgnoreNamespaces.Any(nsp => - controllerActionDescriptor.ControllerTypeInfo.Namespace.StartsWith(nsp)); + return false; } - protected virtual bool CheckForInterfaces(ControllerActionDescriptor controllerActionDescriptor) + return !Options.IgnoreControllers.Any(controller => + controller.IsAssignableFrom(controllerActionDescriptor.ControllerTypeInfo)); + } + + protected virtual bool CheckForMethod(ControllerActionDescriptor controllerActionDescriptor) + { + return !controllerActionDescriptor.MethodInfo.IsDefined(typeof(IgnoreWrapResultAttribute), true); + } + + protected virtual bool CheckForNamespace(ControllerActionDescriptor controllerActionDescriptor) + { + if (string.IsNullOrWhiteSpace(controllerActionDescriptor.ControllerTypeInfo.Namespace)) { - return !Options.IgnoredInterfaces.Any(type => - type.IsAssignableFrom(controllerActionDescriptor.ControllerTypeInfo)); + return true; } - protected virtual bool CheckForReturnType(ControllerActionDescriptor controllerActionDescriptor) - { - var returnType = AsyncHelper.UnwrapTask(controllerActionDescriptor.MethodInfo.ReturnType); + return !Options.IgnoreNamespaces.Any(nsp => + controllerActionDescriptor.ControllerTypeInfo.Namespace.StartsWith(nsp)); + } - if (returnType.IsDefined(typeof(IgnoreWrapResultAttribute), true)) - { - return false; - } + protected virtual bool CheckForInterfaces(ControllerActionDescriptor controllerActionDescriptor) + { + return !Options.IgnoredInterfaces.Any(type => + type.IsAssignableFrom(controllerActionDescriptor.ControllerTypeInfo)); + } - return !Options.IgnoreReturnTypes.Any(type => returnType.IsAssignableFrom(type)); - } + protected virtual bool CheckForReturnType(ControllerActionDescriptor controllerActionDescriptor) + { + var returnType = AsyncHelper.UnwrapTask(controllerActionDescriptor.MethodInfo.ReturnType); - protected virtual bool CheckForException(Exception exception) + if (returnType.IsDefined(typeof(IgnoreWrapResultAttribute), true)) { - return !Options.IgnoreExceptions.Any(ex => ex.IsAssignableFrom(exception.GetType())); + return false; } - protected virtual string BuildUrl(HttpContext httpContext) - { - //TODO: Add options to include/exclude query, schema and host + return !Options.IgnoreReturnTypes.Any(type => returnType.IsAssignableFrom(type)); + } + + protected virtual bool CheckForException(Exception exception) + { + return !Options.IgnoreExceptions.Any(ex => ex.IsAssignableFrom(exception.GetType())); + } - var uriBuilder = new UriBuilder(); + protected virtual string BuildUrl(HttpContext httpContext) + { + //TODO: Add options to include/exclude query, schema and host - uriBuilder.Scheme = httpContext.Request.Scheme; - uriBuilder.Host = httpContext.Request.Host.Host; - uriBuilder.Path = httpContext.Request.Path.ToString(); - uriBuilder.Query = httpContext.Request.QueryString.ToString(); + var uriBuilder = new UriBuilder(); - return uriBuilder.Uri.AbsolutePath; - } + uriBuilder.Scheme = httpContext.Request.Scheme; + uriBuilder.Host = httpContext.Request.Host.Host; + uriBuilder.Path = httpContext.Request.Path.ToString(); + uriBuilder.Query = httpContext.Request.QueryString.ToString(); + + return uriBuilder.Uri.AbsolutePath; } } diff --git a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/ActionResultWrapperFactory.cs b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/ActionResultWrapperFactory.cs index f6cd3f8a9..d039158f8 100644 --- a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/ActionResultWrapperFactory.cs +++ b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/ActionResultWrapperFactory.cs @@ -2,24 +2,23 @@ using Microsoft.AspNetCore.Mvc.Filters; using Volo.Abp; -namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper.Wraping +namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper.Wraping; + +public class ActionResultWrapperFactory : IActionResultWrapperFactory { - public class ActionResultWrapperFactory : IActionResultWrapperFactory + public IActionResultWrapper CreateFor(FilterContext context) { - public IActionResultWrapper CreateFor(FilterContext context) - { - Check.NotNull(context, nameof(context)); + Check.NotNull(context, nameof(context)); - return context switch - { - ResultExecutingContext resultExecutingContext when resultExecutingContext.Result is ObjectResult => new ObjectActionResultWrapper(), - ResultExecutingContext resultExecutingContext when resultExecutingContext.Result is JsonResult => new JsonActionResultWrapper(), - ResultExecutingContext resultExecutingContext when resultExecutingContext.Result is EmptyResult => new EmptyActionResultWrapper(), - PageHandlerExecutedContext pageHandlerExecutedContext when pageHandlerExecutedContext.Result is ObjectResult => new ObjectActionResultWrapper(), - PageHandlerExecutedContext pageHandlerExecutedContext when pageHandlerExecutedContext.Result is JsonResult => new JsonActionResultWrapper(), - PageHandlerExecutedContext pageHandlerExecutedContext when pageHandlerExecutedContext.Result is EmptyResult => new EmptyActionResultWrapper(), - _ => new NullActionResultWrapper(), - }; - } + return context switch + { + ResultExecutingContext resultExecutingContext when resultExecutingContext.Result is ObjectResult => new ObjectActionResultWrapper(), + ResultExecutingContext resultExecutingContext when resultExecutingContext.Result is JsonResult => new JsonActionResultWrapper(), + ResultExecutingContext resultExecutingContext when resultExecutingContext.Result is EmptyResult => new EmptyActionResultWrapper(), + PageHandlerExecutedContext pageHandlerExecutedContext when pageHandlerExecutedContext.Result is ObjectResult => new ObjectActionResultWrapper(), + PageHandlerExecutedContext pageHandlerExecutedContext when pageHandlerExecutedContext.Result is JsonResult => new JsonActionResultWrapper(), + PageHandlerExecutedContext pageHandlerExecutedContext when pageHandlerExecutedContext.Result is EmptyResult => new EmptyActionResultWrapper(), + _ => new NullActionResultWrapper(), + }; } } diff --git a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/EmptyActionResultWrapper.cs b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/EmptyActionResultWrapper.cs index 8439810db..b3787025e 100644 --- a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/EmptyActionResultWrapper.cs +++ b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/EmptyActionResultWrapper.cs @@ -4,37 +4,36 @@ using Microsoft.Extensions.Options; using Volo.Abp.AspNetCore.Mvc; -namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper.Wraping +namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper.Wraping; + +public class EmptyActionResultWrapper : IActionResultWrapper { - public class EmptyActionResultWrapper : IActionResultWrapper + public void Wrap(FilterContext context) { - public void Wrap(FilterContext context) + var options = context.GetRequiredService>().Value; + switch (context) { - var options = context.GetRequiredService>().Value; - switch (context) - { - case ResultExecutingContext resultExecutingContext: - if (options.ErrorWithEmptyResult) - { - var code = options.CodeWithEmptyResult(context.HttpContext.RequestServices); - var message = options.MessageWithEmptyResult(context.HttpContext.RequestServices); - resultExecutingContext.Result = new ObjectResult(new WrapResult(code, message)); - return; - } - resultExecutingContext.Result = new ObjectResult(new WrapResult(options.CodeWithSuccess, result: null)); + case ResultExecutingContext resultExecutingContext: + if (options.ErrorWithEmptyResult) + { + var code = options.CodeWithEmptyResult(context.HttpContext.RequestServices); + var message = options.MessageWithEmptyResult(context.HttpContext.RequestServices); + resultExecutingContext.Result = new ObjectResult(new WrapResult(code, message)); return; + } + resultExecutingContext.Result = new ObjectResult(new WrapResult(options.CodeWithSuccess, result: null)); + return; - case PageHandlerExecutedContext pageHandlerExecutedContext: - if (options.ErrorWithEmptyResult) - { - var code = options.CodeWithEmptyResult(context.HttpContext.RequestServices); - var message = options.MessageWithEmptyResult(context.HttpContext.RequestServices); - pageHandlerExecutedContext.Result = new ObjectResult(new WrapResult(code, message)); - return; - } - pageHandlerExecutedContext.Result = new ObjectResult(new WrapResult(options.CodeWithSuccess, result: null)); + case PageHandlerExecutedContext pageHandlerExecutedContext: + if (options.ErrorWithEmptyResult) + { + var code = options.CodeWithEmptyResult(context.HttpContext.RequestServices); + var message = options.MessageWithEmptyResult(context.HttpContext.RequestServices); + pageHandlerExecutedContext.Result = new ObjectResult(new WrapResult(code, message)); return; - } + } + pageHandlerExecutedContext.Result = new ObjectResult(new WrapResult(options.CodeWithSuccess, result: null)); + return; } } } diff --git a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/IActionResultWrapper.cs b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/IActionResultWrapper.cs index 7f5732ba6..e80d5aafd 100644 --- a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/IActionResultWrapper.cs +++ b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/IActionResultWrapper.cs @@ -1,9 +1,8 @@ using Microsoft.AspNetCore.Mvc.Filters; -namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper.Wraping +namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper.Wraping; + +public interface IActionResultWrapper { - public interface IActionResultWrapper - { - void Wrap(FilterContext context); - } + void Wrap(FilterContext context); } diff --git a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/IActionResultWrapperFactory.cs b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/IActionResultWrapperFactory.cs index a94c6ba82..2d061e004 100644 --- a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/IActionResultWrapperFactory.cs +++ b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/IActionResultWrapperFactory.cs @@ -1,10 +1,9 @@ using Microsoft.AspNetCore.Mvc.Filters; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper.Wraping +namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper.Wraping; + +public interface IActionResultWrapperFactory : ITransientDependency { - public interface IActionResultWrapperFactory : ITransientDependency - { - IActionResultWrapper CreateFor(FilterContext context); - } + IActionResultWrapper CreateFor(FilterContext context); } diff --git a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/JsonActionResultWrapper.cs b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/JsonActionResultWrapper.cs index a7b150ec9..d64936d38 100644 --- a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/JsonActionResultWrapper.cs +++ b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/JsonActionResultWrapper.cs @@ -5,36 +5,35 @@ using System; using Volo.Abp.AspNetCore.Mvc; -namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper.Wraping +namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper.Wraping; + +public class JsonActionResultWrapper : IActionResultWrapper { - public class JsonActionResultWrapper : IActionResultWrapper + public void Wrap(FilterContext context) { - public void Wrap(FilterContext context) - { - JsonResult jsonResult = null; + JsonResult jsonResult = null; - switch (context) - { - case ResultExecutingContext resultExecutingContext: - jsonResult = resultExecutingContext.Result as JsonResult; - break; + switch (context) + { + case ResultExecutingContext resultExecutingContext: + jsonResult = resultExecutingContext.Result as JsonResult; + break; - case PageHandlerExecutedContext pageHandlerExecutedContext: - jsonResult = pageHandlerExecutedContext.Result as JsonResult; - break; - } + case PageHandlerExecutedContext pageHandlerExecutedContext: + jsonResult = pageHandlerExecutedContext.Result as JsonResult; + break; + } - if (jsonResult == null) - { - throw new ArgumentException("Action Result should be JsonResult!"); - } + if (jsonResult == null) + { + throw new ArgumentException("Action Result should be JsonResult!"); + } - if (!(jsonResult.Value is WrapResult)) - { - var options = context.GetRequiredService>().Value; + if (!(jsonResult.Value is WrapResult)) + { + var options = context.GetRequiredService>().Value; - jsonResult.Value = new WrapResult(options.CodeWithSuccess, jsonResult.Value); - } + jsonResult.Value = new WrapResult(options.CodeWithSuccess, jsonResult.Value); } } } diff --git a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/NullActionResultWrapper.cs b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/NullActionResultWrapper.cs index 710695d1f..dc08bff86 100644 --- a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/NullActionResultWrapper.cs +++ b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/NullActionResultWrapper.cs @@ -1,12 +1,11 @@ using Microsoft.AspNetCore.Mvc.Filters; -namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper.Wraping +namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper.Wraping; + +public class NullActionResultWrapper : IActionResultWrapper { - public class NullActionResultWrapper : IActionResultWrapper + public void Wrap(FilterContext context) { - public void Wrap(FilterContext context) - { - } } } diff --git a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/ObjectActionResultWrapper.cs b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/ObjectActionResultWrapper.cs index b47d55d27..7fbe2b75b 100644 --- a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/ObjectActionResultWrapper.cs +++ b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/Wraping/ObjectActionResultWrapper.cs @@ -5,47 +5,46 @@ using System; using Volo.Abp.AspNetCore.Mvc; -namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper.Wraping +namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper.Wraping; + +public class ObjectActionResultWrapper : IActionResultWrapper { - public class ObjectActionResultWrapper : IActionResultWrapper + public void Wrap(FilterContext context) { - public void Wrap(FilterContext context) + ObjectResult objectResult = null; + + switch (context) { - ObjectResult objectResult = null; + case ResultExecutingContext resultExecutingContext: + objectResult = resultExecutingContext.Result as ObjectResult; + break; - switch (context) - { - case ResultExecutingContext resultExecutingContext: - objectResult = resultExecutingContext.Result as ObjectResult; - break; + case PageHandlerExecutedContext pageHandlerExecutedContext: + objectResult = pageHandlerExecutedContext.Result as ObjectResult; + break; + } - case PageHandlerExecutedContext pageHandlerExecutedContext: - objectResult = pageHandlerExecutedContext.Result as ObjectResult; - break; - } + if (objectResult == null) + { + throw new ArgumentException("Action Result should be ObjectResult!"); + } + + if (!(objectResult.Value is WrapResult)) + { + var options = context.GetRequiredService>().Value; - if (objectResult == null) + if (objectResult.Value == null && options.ErrorWithEmptyResult) { - throw new ArgumentException("Action Result should be ObjectResult!"); + var code = options.CodeWithEmptyResult(context.HttpContext.RequestServices); + var message = options.MessageWithEmptyResult(context.HttpContext.RequestServices); + objectResult.Value = new WrapResult(code, message); } - - if (!(objectResult.Value is WrapResult)) + else { - var options = context.GetRequiredService>().Value; - - if (objectResult.Value == null && options.ErrorWithEmptyResult) - { - var code = options.CodeWithEmptyResult(context.HttpContext.RequestServices); - var message = options.MessageWithEmptyResult(context.HttpContext.RequestServices); - objectResult.Value = new WrapResult(code, message); - } - else - { - objectResult.Value = new WrapResult(options.CodeWithSuccess, objectResult.Value); - } - - objectResult.DeclaredType = typeof(WrapResult); + objectResult.Value = new WrapResult(options.CodeWithSuccess, objectResult.Value); } + + objectResult.DeclaredType = typeof(WrapResult); } } } diff --git a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/Microsoft/AspNetCore/Mvc/ActionContextExtensions.cs b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/Microsoft/AspNetCore/Mvc/ActionContextExtensions.cs index 96f6dc535..1b8d7ae0c 100644 --- a/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/Microsoft/AspNetCore/Mvc/ActionContextExtensions.cs +++ b/aspnet-core/framework/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/Microsoft/AspNetCore/Mvc/ActionContextExtensions.cs @@ -2,27 +2,26 @@ using Microsoft.AspNetCore.Mvc.Abstractions; using Microsoft.AspNetCore.Mvc.Controllers; -namespace Microsoft.AspNetCore.Mvc +namespace Microsoft.AspNetCore.Mvc; + +public static class ActionContextExtensions { - public static class ActionContextExtensions + public static bool CanWarpRsult(this ActionDescriptor actionDescriptor) { - public static bool CanWarpRsult(this ActionDescriptor actionDescriptor) + if (actionDescriptor is ControllerActionDescriptor descriptor) { - if (actionDescriptor is ControllerActionDescriptor descriptor) + if (descriptor.MethodInfo.IsDefined(typeof(IgnoreWrapResultAttribute), true)) { - if (descriptor.MethodInfo.IsDefined(typeof(IgnoreWrapResultAttribute), true)) - { - return false; - } - - if (descriptor.ControllerTypeInfo.IsDefined(typeof(IgnoreWrapResultAttribute), true)) - { - return false; - } + return false; + } - return true; + if (descriptor.ControllerTypeInfo.IsDefined(typeof(IgnoreWrapResultAttribute), true)) + { + return false; } - return false; + + return true; } + return false; } } diff --git a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN.Abp.UI.Navigation.csproj b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN.Abp.UI.Navigation.csproj index 4f304bff9..1a170f45f 100644 --- a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN.Abp.UI.Navigation.csproj +++ b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN.Abp.UI.Navigation.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.UI.Navigation + LINGYUN.Abp.UI.Navigation + false + false + false diff --git a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/AbpNavigationOptions.cs b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/AbpNavigationOptions.cs index b22646521..ba5139836 100644 --- a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/AbpNavigationOptions.cs +++ b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/AbpNavigationOptions.cs @@ -1,17 +1,16 @@ using Volo.Abp.Collections; -namespace LINGYUN.Abp.UI.Navigation +namespace LINGYUN.Abp.UI.Navigation; + +public class AbpNavigationOptions { - public class AbpNavigationOptions - { - public ITypeList DefinitionProviders { get; } + public ITypeList DefinitionProviders { get; } - public ITypeList NavigationSeedContributors { get; } + public ITypeList NavigationSeedContributors { get; } - public AbpNavigationOptions() - { - DefinitionProviders = new TypeList(); - NavigationSeedContributors = new TypeList(); - } + public AbpNavigationOptions() + { + DefinitionProviders = new TypeList(); + NavigationSeedContributors = new TypeList(); } } diff --git a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/AbpUINavigationModule.cs b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/AbpUINavigationModule.cs index 7accf9d7b..61219de2b 100644 --- a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/AbpUINavigationModule.cs +++ b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/AbpUINavigationModule.cs @@ -5,34 +5,33 @@ using Volo.Abp.MultiTenancy; using Volo.Abp.ObjectExtending; -namespace LINGYUN.Abp.UI.Navigation +namespace LINGYUN.Abp.UI.Navigation; + +[DependsOn( + typeof(AbpMultiTenancyModule), + typeof(AbpObjectExtendingModule))] +public class AbpUINavigationModule : AbpModule { - [DependsOn( - typeof(AbpMultiTenancyModule), - typeof(AbpObjectExtendingModule))] - public class AbpUINavigationModule : AbpModule + public override void PreConfigureServices(ServiceConfigurationContext context) { - public override void PreConfigureServices(ServiceConfigurationContext context) - { - AutoAddDefinitionProviders(context.Services); - } + AutoAddDefinitionProviders(context.Services); + } - private static void AutoAddDefinitionProviders(IServiceCollection services) - { - var definitionProviders = new List(); + private static void AutoAddDefinitionProviders(IServiceCollection services) + { + var definitionProviders = new List(); - services.OnRegistered(context => + services.OnRegistered(context => + { + if (typeof(INavigationDefinitionProvider).IsAssignableFrom(context.ImplementationType)) { - if (typeof(INavigationDefinitionProvider).IsAssignableFrom(context.ImplementationType)) - { - definitionProviders.Add(context.ImplementationType); - } - }); + definitionProviders.Add(context.ImplementationType); + } + }); - services.Configure(options => - { - options.DefinitionProviders.AddIfNotContains(definitionProviders); - }); - } + services.Configure(options => + { + options.DefinitionProviders.AddIfNotContains(definitionProviders); + }); } } diff --git a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/ApplicationMenu.cs b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/ApplicationMenu.cs index 59ad0fb44..93cf0266c 100644 --- a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/ApplicationMenu.cs +++ b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/ApplicationMenu.cs @@ -5,109 +5,108 @@ using Volo.Abp.Data; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.UI.Navigation +namespace LINGYUN.Abp.UI.Navigation; + +public class ApplicationMenu : IHasMenuItems, IHasExtraProperties { - public class ApplicationMenu : IHasMenuItems, IHasExtraProperties - { - public const int DefaultOrder = 1000; - /// - /// 名称 - /// - [NotNull] - public string Name { get; } - /// - /// 显示名称 - /// - [NotNull] - public string DisplayName { get; } - /// - /// 说明 - /// - [CanBeNull] - public string Description { get; } - /// - /// 路径 - /// - [NotNull] - public string Url { get; } - /// - /// 组件 - /// - [CanBeNull] - public string Component { get; } - /// - /// 重定向 - /// - [CanBeNull] - public string Redirect { get; } - /// - /// 图标 - /// - [CanBeNull] - public string Icon { get; set; } - /// - /// 排序 - /// - public int Order { get; set; } - /// - /// 是否禁用 - /// - public bool IsDisabled { get; set; } - /// - /// 是否可视 - /// - public bool IsVisible { get; set; } + public const int DefaultOrder = 1000; + /// + /// 名称 + /// + [NotNull] + public string Name { get; } + /// + /// 显示名称 + /// + [NotNull] + public string DisplayName { get; } + /// + /// 说明 + /// + [CanBeNull] + public string Description { get; } + /// + /// 路径 + /// + [NotNull] + public string Url { get; } + /// + /// 组件 + /// + [CanBeNull] + public string Component { get; } + /// + /// 重定向 + /// + [CanBeNull] + public string Redirect { get; } + /// + /// 图标 + /// + [CanBeNull] + public string Icon { get; set; } + /// + /// 排序 + /// + public int Order { get; set; } + /// + /// 是否禁用 + /// + public bool IsDisabled { get; set; } + /// + /// 是否可视 + /// + public bool IsVisible { get; set; } - [NotNull] - public ApplicationMenuList Items { get; } + [NotNull] + public ApplicationMenuList Items { get; } - public bool IsLeaf => Items.IsNullOrEmpty(); + public bool IsLeaf => Items.IsNullOrEmpty(); - [NotNull] - public ExtraPropertyDictionary ExtraProperties { get; } + [NotNull] + public ExtraPropertyDictionary ExtraProperties { get; } - public MultiTenancySides MultiTenancySides { get; } + public MultiTenancySides MultiTenancySides { get; } - public ApplicationMenu( - [NotNull] string name, - [NotNull] string displayName, - [NotNull] string url, - [CanBeNull] string component, - string description = null, - string icon = null, - string redirect = null, - int order = DefaultOrder, - MultiTenancySides multiTenancySides = MultiTenancySides.Both) - { - Check.NotNullOrWhiteSpace(name, nameof(name)); - Check.NotNullOrWhiteSpace(displayName, nameof(displayName)); + public ApplicationMenu( + [NotNull] string name, + [NotNull] string displayName, + [NotNull] string url, + [CanBeNull] string component, + string description = null, + string icon = null, + string redirect = null, + int order = DefaultOrder, + MultiTenancySides multiTenancySides = MultiTenancySides.Both) + { + Check.NotNullOrWhiteSpace(name, nameof(name)); + Check.NotNullOrWhiteSpace(displayName, nameof(displayName)); - Check.NotNullOrWhiteSpace(url, nameof(url)); + Check.NotNullOrWhiteSpace(url, nameof(url)); - Name = name; - DisplayName = displayName; - Url = url; - Component = component; - Description = description; - Icon = icon; - Redirect = redirect ?? ""; - Order = order; - MultiTenancySides = multiTenancySides; + Name = name; + DisplayName = displayName; + Url = url; + Component = component; + Description = description; + Icon = icon; + Redirect = redirect ?? ""; + Order = order; + MultiTenancySides = multiTenancySides; - Items = new ApplicationMenuList(); - ExtraProperties = new ExtraPropertyDictionary(); - this.SetDefaultsForExtraProperties(); - } + Items = new ApplicationMenuList(); + ExtraProperties = new ExtraPropertyDictionary(); + this.SetDefaultsForExtraProperties(); + } - public ApplicationMenu AddItem([NotNull] ApplicationMenu menuItem) - { - Items.Add(menuItem); - return menuItem; - } + public ApplicationMenu AddItem([NotNull] ApplicationMenu menuItem) + { + Items.Add(menuItem); + return menuItem; + } - public override string ToString() - { - return $"[ApplicationMenu] Name = {Name}"; - } + public override string ToString() + { + return $"[ApplicationMenu] Name = {Name}"; } } diff --git a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/ApplicationMenuList.cs b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/ApplicationMenuList.cs index 5103890ee..109b5ced6 100644 --- a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/ApplicationMenuList.cs +++ b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/ApplicationMenuList.cs @@ -2,44 +2,43 @@ using System.Collections.Generic; using System.Linq; -namespace LINGYUN.Abp.UI.Navigation +namespace LINGYUN.Abp.UI.Navigation; + +public class ApplicationMenuList : List { - public class ApplicationMenuList : List + public ApplicationMenuList() { - public ApplicationMenuList() - { - } + } - public ApplicationMenuList(int capacity) - : base(capacity) - { + public ApplicationMenuList(int capacity) + : base(capacity) + { - } + } - public ApplicationMenuList(IEnumerable collection) - : base(collection) - { + public ApplicationMenuList(IEnumerable collection) + : base(collection) + { - } + } - public void Normalize() - { - RemoveEmptyItems(); - Order(); - } + public void Normalize() + { + RemoveEmptyItems(); + Order(); + } - private void RemoveEmptyItems() - { - RemoveAll(item => item.IsLeaf && item.Url.IsNullOrEmpty()); - } + private void RemoveEmptyItems() + { + RemoveAll(item => item.IsLeaf && item.Url.IsNullOrEmpty()); + } - private void Order() - { - //TODO: Is there any way that is more performant? - var orderedItems = this.OrderBy(item => item.Order).ToArray(); - Clear(); - AddRange(orderedItems); - } + private void Order() + { + //TODO: Is there any way that is more performant? + var orderedItems = this.OrderBy(item => item.Order).ToArray(); + Clear(); + AddRange(orderedItems); } } diff --git a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/IHasMenuItems.cs b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/IHasMenuItems.cs index ba5eb84ed..5e03ba940 100644 --- a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/IHasMenuItems.cs +++ b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/IHasMenuItems.cs @@ -1,10 +1,9 @@ -namespace LINGYUN.Abp.UI.Navigation +namespace LINGYUN.Abp.UI.Navigation; + +public interface IHasMenuItems { - public interface IHasMenuItems - { - /// - /// Menu items. - /// - ApplicationMenuList Items { get; } - } + /// + /// Menu items. + /// + ApplicationMenuList Items { get; } } diff --git a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/INavigationDefinitionContext.cs b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/INavigationDefinitionContext.cs index 330a9cdc7..1bbb88fed 100644 --- a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/INavigationDefinitionContext.cs +++ b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/INavigationDefinitionContext.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.UI.Navigation +namespace LINGYUN.Abp.UI.Navigation; + +public interface INavigationDefinitionContext { - public interface INavigationDefinitionContext - { - void Add(params NavigationDefinition[] definitions); - } + void Add(params NavigationDefinition[] definitions); } diff --git a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/INavigationDefinitionManager.cs b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/INavigationDefinitionManager.cs index 288932f82..f06182697 100644 --- a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/INavigationDefinitionManager.cs +++ b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/INavigationDefinitionManager.cs @@ -1,9 +1,8 @@ using System.Collections.Generic; -namespace LINGYUN.Abp.UI.Navigation +namespace LINGYUN.Abp.UI.Navigation; + +public interface INavigationDefinitionManager { - public interface INavigationDefinitionManager - { - IReadOnlyList GetAll(); - } + IReadOnlyList GetAll(); } diff --git a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/INavigationDefinitionProvider.cs b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/INavigationDefinitionProvider.cs index 5dbd01233..e2a4e4659 100644 --- a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/INavigationDefinitionProvider.cs +++ b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/INavigationDefinitionProvider.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.UI.Navigation +namespace LINGYUN.Abp.UI.Navigation; + +public interface INavigationDefinitionProvider { - public interface INavigationDefinitionProvider - { - void Define(INavigationDefinitionContext context); - } + void Define(INavigationDefinitionContext context); } diff --git a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/INavigationProvider.cs b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/INavigationProvider.cs index d7464db89..51719a16c 100644 --- a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/INavigationProvider.cs +++ b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/INavigationProvider.cs @@ -1,10 +1,9 @@ using System.Collections.Generic; using System.Threading.Tasks; -namespace LINGYUN.Abp.UI.Navigation +namespace LINGYUN.Abp.UI.Navigation; + +public interface INavigationProvider { - public interface INavigationProvider - { - Task> GetAllAsync(); - } + Task> GetAllAsync(); } diff --git a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/INavigationSeedContributor.cs b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/INavigationSeedContributor.cs index 14f513efe..c92d4654d 100644 --- a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/INavigationSeedContributor.cs +++ b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/INavigationSeedContributor.cs @@ -1,14 +1,13 @@ using System.Threading.Tasks; -namespace LINGYUN.Abp.UI.Navigation +namespace LINGYUN.Abp.UI.Navigation; + +public interface INavigationSeedContributor { - public interface INavigationSeedContributor - { - /// - /// - /// - /// - /// - Task SeedAsync(NavigationSeedContext context); - } + /// + /// + /// + /// + /// + Task SeedAsync(NavigationSeedContext context); } diff --git a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationDataSeedContributor.cs b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationDataSeedContributor.cs index 45a857ce9..42e7d2fe1 100644 --- a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationDataSeedContributor.cs +++ b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationDataSeedContributor.cs @@ -8,58 +8,57 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.UI.Navigation +namespace LINGYUN.Abp.UI.Navigation; + +public class NavigationDataSeedContributor : IDataSeedContributor, ITransientDependency { - public class NavigationDataSeedContributor : IDataSeedContributor, ITransientDependency - { - private readonly IServiceProvider _serviceProvider; - private readonly ICurrentTenant _currentTenant; - private readonly INavigationProvider _navigationProvider; + private readonly IServiceProvider _serviceProvider; + private readonly ICurrentTenant _currentTenant; + private readonly INavigationProvider _navigationProvider; - private readonly AbpNavigationOptions _options; + private readonly AbpNavigationOptions _options; - public List Contributors => _lazyContributors.Value; - private readonly Lazy> _lazyContributors; + public List Contributors => _lazyContributors.Value; + private readonly Lazy> _lazyContributors; - public NavigationDataSeedContributor( - IServiceProvider serviceProvider, - ICurrentTenant currentTenant, - INavigationProvider navigationProvider, - IOptions options) - { - _serviceProvider = serviceProvider; - _currentTenant = currentTenant; - _navigationProvider = navigationProvider; + public NavigationDataSeedContributor( + IServiceProvider serviceProvider, + ICurrentTenant currentTenant, + INavigationProvider navigationProvider, + IOptions options) + { + _serviceProvider = serviceProvider; + _currentTenant = currentTenant; + _navigationProvider = navigationProvider; - _options = options.Value; - _lazyContributors = new Lazy>(CreateContributors); - } + _options = options.Value; + _lazyContributors = new Lazy>(CreateContributors); + } - public async virtual Task SeedAsync(DataSeedContext context) + public async virtual Task SeedAsync(DataSeedContext context) + { + using (_currentTenant.Change(context.TenantId)) { - using (_currentTenant.Change(context.TenantId)) - { - var menus = await _navigationProvider.GetAllAsync(); + var menus = await _navigationProvider.GetAllAsync(); - var multiTenancySides = _currentTenant.IsAvailable - ? MultiTenancySides.Tenant - : MultiTenancySides.Host; + var multiTenancySides = _currentTenant.IsAvailable + ? MultiTenancySides.Tenant + : MultiTenancySides.Host; - var seedContext = new NavigationSeedContext(menus, multiTenancySides); + var seedContext = new NavigationSeedContext(menus, multiTenancySides); - foreach (var contributor in Contributors) - { - await contributor.SeedAsync(seedContext); - } + foreach (var contributor in Contributors) + { + await contributor.SeedAsync(seedContext); } } + } - private List CreateContributors() - { - return _options - .NavigationSeedContributors - .Select(type => _serviceProvider.GetRequiredService(type) as INavigationSeedContributor) - .ToList(); - } + private List CreateContributors() + { + return _options + .NavigationSeedContributors + .Select(type => _serviceProvider.GetRequiredService(type) as INavigationSeedContributor) + .ToList(); } } diff --git a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationDefinition.cs b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationDefinition.cs index ab87c7044..03a4e0902 100644 --- a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationDefinition.cs +++ b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationDefinition.cs @@ -1,11 +1,10 @@ -namespace LINGYUN.Abp.UI.Navigation +namespace LINGYUN.Abp.UI.Navigation; + +public class NavigationDefinition { - public class NavigationDefinition + public ApplicationMenu Menu { get; } + public NavigationDefinition(ApplicationMenu menu) { - public ApplicationMenu Menu { get; } - public NavigationDefinition(ApplicationMenu menu) - { - Menu = menu; - } + Menu = menu; } } diff --git a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationDefinitionContext.cs b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationDefinitionContext.cs index 1d473d2ac..b24e09dc9 100644 --- a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationDefinitionContext.cs +++ b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationDefinitionContext.cs @@ -2,27 +2,26 @@ using System.Collections.Generic; using System.Collections.Immutable; -namespace LINGYUN.Abp.UI.Navigation +namespace LINGYUN.Abp.UI.Navigation; + +public class NavigationDefinitionContext : INavigationDefinitionContext { - public class NavigationDefinitionContext : INavigationDefinitionContext + protected List Navigations { get; } + public NavigationDefinitionContext(List navigations) { - protected List Navigations { get; } - public NavigationDefinitionContext(List navigations) - { - Navigations = navigations; - } - public virtual IReadOnlyList GetAll() - { - return Navigations.ToImmutableList(); - } + Navigations = navigations; + } + public virtual IReadOnlyList GetAll() + { + return Navigations.ToImmutableList(); + } - public virtual void Add(params NavigationDefinition[] definitions) + public virtual void Add(params NavigationDefinition[] definitions) + { + if (definitions.IsNullOrEmpty()) { - if (definitions.IsNullOrEmpty()) - { - return; - } - Navigations.AddRange(definitions); + return; } + Navigations.AddRange(definitions); } } diff --git a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationDefinitionManager.cs b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationDefinitionManager.cs index 1f29a5fc4..95c58b28e 100644 --- a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationDefinitionManager.cs +++ b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationDefinitionManager.cs @@ -6,49 +6,48 @@ using System.Linq; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.UI.Navigation +namespace LINGYUN.Abp.UI.Navigation; + +public class NavigationDefinitionManager : INavigationDefinitionManager, ISingletonDependency { - public class NavigationDefinitionManager : INavigationDefinitionManager, ISingletonDependency - { - protected Lazy> NavigationDefinitions { get; } + protected Lazy> NavigationDefinitions { get; } - protected AbpNavigationOptions Options { get; } + protected AbpNavigationOptions Options { get; } - protected IServiceProvider ServiceProvider { get; } + protected IServiceProvider ServiceProvider { get; } - public NavigationDefinitionManager( - IOptions options, - IServiceProvider serviceProvider) - { - ServiceProvider = serviceProvider; - Options = options.Value; + public NavigationDefinitionManager( + IOptions options, + IServiceProvider serviceProvider) + { + ServiceProvider = serviceProvider; + Options = options.Value; - NavigationDefinitions = new Lazy>(CreateSettingDefinitions, true); - } + NavigationDefinitions = new Lazy>(CreateSettingDefinitions, true); + } - public virtual IReadOnlyList GetAll() - { - return NavigationDefinitions.Value.ToImmutableList(); - } + public virtual IReadOnlyList GetAll() + { + return NavigationDefinitions.Value.ToImmutableList(); + } - protected virtual IList CreateSettingDefinitions() + protected virtual IList CreateSettingDefinitions() + { + var settings = new List(); + + using (var scope = ServiceProvider.CreateScope()) { - var settings = new List(); + var providers = Options + .DefinitionProviders + .Select(p => scope.ServiceProvider.GetRequiredService(p) as INavigationDefinitionProvider) + .ToList(); - using (var scope = ServiceProvider.CreateScope()) + foreach (var provider in providers) { - var providers = Options - .DefinitionProviders - .Select(p => scope.ServiceProvider.GetRequiredService(p) as INavigationDefinitionProvider) - .ToList(); - - foreach (var provider in providers) - { - provider.Define(new NavigationDefinitionContext(settings)); - } + provider.Define(new NavigationDefinitionContext(settings)); } - - return settings; } + + return settings; } } diff --git a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationDefinitionProvider.cs b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationDefinitionProvider.cs index eaaf9104b..1f4cadcc7 100644 --- a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationDefinitionProvider.cs +++ b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationDefinitionProvider.cs @@ -1,12 +1,11 @@ using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.UI.Navigation +namespace LINGYUN.Abp.UI.Navigation; + +public abstract class NavigationDefinitionProvider : INavigationDefinitionProvider, ITransientDependency { - public abstract class NavigationDefinitionProvider : INavigationDefinitionProvider, ITransientDependency + protected NavigationDefinitionProvider() { - protected NavigationDefinitionProvider() - { - } - public abstract void Define(INavigationDefinitionContext context); } + public abstract void Define(INavigationDefinitionContext context); } diff --git a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationProvider.cs b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationProvider.cs index 5e5c34350..48058194f 100644 --- a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationProvider.cs +++ b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationProvider.cs @@ -3,28 +3,27 @@ using System.Threading.Tasks; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.UI.Navigation +namespace LINGYUN.Abp.UI.Navigation; + +public class NavigationProvider : INavigationProvider, ITransientDependency { - public class NavigationProvider : INavigationProvider, ITransientDependency + protected INavigationDefinitionManager NavigationDefinitionManager { get; } + public NavigationProvider( + INavigationDefinitionManager navigationDefinitionManager) + { + NavigationDefinitionManager = navigationDefinitionManager; + } + public Task> GetAllAsync() { - protected INavigationDefinitionManager NavigationDefinitionManager { get; } - public NavigationProvider( - INavigationDefinitionManager navigationDefinitionManager) + var navigations = new List(); + var navigationDefineitions = NavigationDefinitionManager.GetAll(); + foreach (var navigationDefineition in navigationDefineitions) { - NavigationDefinitionManager = navigationDefinitionManager; + navigations.Add(navigationDefineition.Menu); } - public Task> GetAllAsync() - { - var navigations = new List(); - var navigationDefineitions = NavigationDefinitionManager.GetAll(); - foreach (var navigationDefineition in navigationDefineitions) - { - navigations.Add(navigationDefineition.Menu); - } - IReadOnlyCollection menus = navigations.ToImmutableList(); + IReadOnlyCollection menus = navigations.ToImmutableList(); - return Task.FromResult(menus); - } + return Task.FromResult(menus); } } diff --git a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationSeedContext.cs b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationSeedContext.cs index dd2b66a59..998fac193 100644 --- a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationSeedContext.cs +++ b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationSeedContext.cs @@ -1,20 +1,19 @@ using System.Collections.Generic; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.UI.Navigation +namespace LINGYUN.Abp.UI.Navigation; + +public class NavigationSeedContext { - public class NavigationSeedContext - { - public IReadOnlyCollection Menus { get; } + public IReadOnlyCollection Menus { get; } - public MultiTenancySides MultiTenancySides { get; } + public MultiTenancySides MultiTenancySides { get; } - public NavigationSeedContext( - IReadOnlyCollection menus, - MultiTenancySides multiTenancySides = MultiTenancySides.Both) - { - Menus = menus; - MultiTenancySides = multiTenancySides; - } + public NavigationSeedContext( + IReadOnlyCollection menus, + MultiTenancySides multiTenancySides = MultiTenancySides.Both) + { + Menus = menus; + MultiTenancySides = multiTenancySides; } } diff --git a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationSeedContributor.cs b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationSeedContributor.cs index 11d4b8563..8c63fef25 100644 --- a/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationSeedContributor.cs +++ b/aspnet-core/framework/navigation/LINGYUN.Abp.UI.Navigation/LINGYUN/Abp/UI/Navigation/NavigationSeedContributor.cs @@ -1,10 +1,9 @@ using System.Threading.Tasks; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.UI.Navigation +namespace LINGYUN.Abp.UI.Navigation; + +public abstract class NavigationSeedContributor : INavigationSeedContributor, ITransientDependency { - public abstract class NavigationSeedContributor : INavigationSeedContributor, ITransientDependency - { - public abstract Task SeedAsync(NavigationSeedContext context); - } + public abstract Task SeedAsync(NavigationSeedContext context); } diff --git a/aspnet-core/framework/nexus/LINGYUN.Abp.BlobStoring.Nexus/LINGYUN.Abp.BlobStoring.Nexus.csproj b/aspnet-core/framework/nexus/LINGYUN.Abp.BlobStoring.Nexus/LINGYUN.Abp.BlobStoring.Nexus.csproj index 98d398801..29db0704d 100644 --- a/aspnet-core/framework/nexus/LINGYUN.Abp.BlobStoring.Nexus/LINGYUN.Abp.BlobStoring.Nexus.csproj +++ b/aspnet-core/framework/nexus/LINGYUN.Abp.BlobStoring.Nexus/LINGYUN.Abp.BlobStoring.Nexus.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.BlobStoring.Nexus + LINGYUN.Abp.BlobStoring.Nexus + false + false + false Oss对象存储Nexus集成 diff --git a/aspnet-core/framework/nexus/LINGYUN.Abp.BlobStoring.Nexus/LINGYUN/Abp/BlobStoring/Nexus/NexusBlobContainerConfigurationExtensions.cs b/aspnet-core/framework/nexus/LINGYUN.Abp.BlobStoring.Nexus/LINGYUN/Abp/BlobStoring/Nexus/NexusBlobContainerConfigurationExtensions.cs index 40670bc0b..cb48b9766 100644 --- a/aspnet-core/framework/nexus/LINGYUN.Abp.BlobStoring.Nexus/LINGYUN/Abp/BlobStoring/Nexus/NexusBlobContainerConfigurationExtensions.cs +++ b/aspnet-core/framework/nexus/LINGYUN.Abp.BlobStoring.Nexus/LINGYUN/Abp/BlobStoring/Nexus/NexusBlobContainerConfigurationExtensions.cs @@ -1,26 +1,25 @@ using System; using Volo.Abp.BlobStoring; -namespace LINGYUN.Abp.BlobStoring.Nexus +namespace LINGYUN.Abp.BlobStoring.Nexus; + +public static class NexusBlobContainerConfigurationExtensions { - public static class NexusBlobContainerConfigurationExtensions + public static NexusBlobProviderConfiguration GetNexusConfiguration( + this BlobContainerConfiguration containerConfiguration) { - public static NexusBlobProviderConfiguration GetNexusConfiguration( - this BlobContainerConfiguration containerConfiguration) - { - return new NexusBlobProviderConfiguration(containerConfiguration); - } + return new NexusBlobProviderConfiguration(containerConfiguration); + } - public static BlobContainerConfiguration UseNexus( - this BlobContainerConfiguration containerConfiguration, - Action nexusConfigureAction) - { - containerConfiguration.ProviderType = typeof(NexusBlobProvider); - containerConfiguration.NamingNormalizers.TryAdd(); + public static BlobContainerConfiguration UseNexus( + this BlobContainerConfiguration containerConfiguration, + Action nexusConfigureAction) + { + containerConfiguration.ProviderType = typeof(NexusBlobProvider); + containerConfiguration.NamingNormalizers.TryAdd(); - nexusConfigureAction(new NexusBlobProviderConfiguration(containerConfiguration)); + nexusConfigureAction(new NexusBlobProviderConfiguration(containerConfiguration)); - return containerConfiguration; - } + return containerConfiguration; } } diff --git a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN.Abp.Sonatype.Nexus.csproj b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN.Abp.Sonatype.Nexus.csproj index a75e050a8..8913fc5ad 100644 --- a/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN.Abp.Sonatype.Nexus.csproj +++ b/aspnet-core/framework/nexus/LINGYUN.Abp.Sonatype.Nexus/LINGYUN.Abp.Sonatype.Nexus.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Sonatype.Nexus + LINGYUN.Abp.Sonatype.Nexus + false + false + false diff --git a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.Authorization/LINGYUN.Abp.OpenApi.Authorization.csproj b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.Authorization/LINGYUN.Abp.OpenApi.Authorization.csproj index baba1b680..3e8fc072c 100644 --- a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.Authorization/LINGYUN.Abp.OpenApi.Authorization.csproj +++ b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.Authorization/LINGYUN.Abp.OpenApi.Authorization.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.OpenApi.Authorization + LINGYUN.Abp.OpenApi.Authorization + false + false + false diff --git a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.IdentityServer/LINGYUN.Abp.OpenApi.IdentityServer.csproj b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.IdentityServer/LINGYUN.Abp.OpenApi.IdentityServer.csproj index b17c8a6cc..cbdcebb93 100644 --- a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.IdentityServer/LINGYUN.Abp.OpenApi.IdentityServer.csproj +++ b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.IdentityServer/LINGYUN.Abp.OpenApi.IdentityServer.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.OpenApi.IdentityServer + LINGYUN.Abp.OpenApi.IdentityServer + false + false + false diff --git a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.IdentityServer/LINGYUN/Abp/OpenApi/IdentityServer/IdentityServerAppKeyStore.cs b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.IdentityServer/LINGYUN/Abp/OpenApi/IdentityServer/IdentityServerAppKeyStore.cs index 42713b0cc..5387957af 100644 --- a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.IdentityServer/LINGYUN/Abp/OpenApi/IdentityServer/IdentityServerAppKeyStore.cs +++ b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.IdentityServer/LINGYUN/Abp/OpenApi/IdentityServer/IdentityServerAppKeyStore.cs @@ -55,16 +55,31 @@ public async virtual Task FindAsync(string appKey, CancellationTo public async virtual Task StoreAsync(AppDescriptor descriptor, CancellationToken cancellationToken = default) { - var client = new Client(_guidGenerator.Create(), descriptor.AppKey) + var client = await _clientRepository.FindByClientIdAsync(descriptor.AppKey); + if (client == null) { - ClientName = descriptor.AppName, - }; - client.AddSecret(descriptor.AppSecret); - if (descriptor.SignLifetime.HasValue) + client = new Client(_guidGenerator.Create(), descriptor.AppKey) + { + ClientName = descriptor.AppName, + }; + client.AddSecret(descriptor.AppSecret); + if (descriptor.SignLifetime.HasValue) + { + client.AddProperty(nameof(AppDescriptor.SignLifetime), descriptor.SignLifetime.Value.ToString()); + } + await _clientRepository.InsertAsync(client, cancellationToken: cancellationToken); + } + else { - client.AddProperty(nameof(AppDescriptor.SignLifetime), descriptor.SignLifetime.Value.ToString()); + if (client.FindSecret(descriptor.AppSecret) == null) + { + client.AddSecret(descriptor.AppSecret); + } + if (descriptor.SignLifetime.HasValue) + { + client.AddProperty(nameof(AppDescriptor.SignLifetime), descriptor.SignLifetime.Value.ToString()); + await _clientRepository.UpdateAsync(client, cancellationToken: cancellationToken); + } } - - await _clientRepository.InsertAsync(client, cancellationToken: cancellationToken); } } diff --git a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.OpenIddict/LINGYUN.Abp.OpenApi.OpenIddict.csproj b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.OpenIddict/LINGYUN.Abp.OpenApi.OpenIddict.csproj index 926fa3a56..b35b635f3 100644 --- a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.OpenIddict/LINGYUN.Abp.OpenApi.OpenIddict.csproj +++ b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.OpenIddict/LINGYUN.Abp.OpenApi.OpenIddict.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.OpenApi.OpenIddict + LINGYUN.Abp.OpenApi.OpenIddict + false + false + false diff --git a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.OpenIddict/LINGYUN/Abp/OpenApi/OpenIddict/OpenIddictAppKeyStore.cs b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.OpenIddict/LINGYUN/Abp/OpenApi/OpenIddict/OpenIddictAppKeyStore.cs index 1a3e5b6e6..952dade27 100644 --- a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.OpenIddict/LINGYUN/Abp/OpenApi/OpenIddict/OpenIddictAppKeyStore.cs +++ b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi.OpenIddict/LINGYUN/Abp/OpenApi/OpenIddict/OpenIddictAppKeyStore.cs @@ -43,17 +43,30 @@ public async virtual Task FindAsync(string appKey, CancellationTo public async virtual Task StoreAsync(AppDescriptor descriptor, CancellationToken cancellationToken = default) { - var application = new OpenIddictApplicationModel + var application = await _appStore.FindByClientIdAsync(descriptor.AppKey, cancellationToken); + if (application == null) { - Id = _guidGenerator.Create(), - ClientId = descriptor.AppKey, - ClientSecret = descriptor.AppSecret, - DisplayName = descriptor.AppName, - }; - if (descriptor.SignLifetime.HasValue) + application = new OpenIddictApplicationModel + { + Id = _guidGenerator.Create(), + ClientId = descriptor.AppKey, + ClientSecret = descriptor.AppSecret, + DisplayName = descriptor.AppName, + }; + if (descriptor.SignLifetime.HasValue) + { + application.SetProperty(nameof(AppDescriptor.SignLifetime), descriptor.SignLifetime); + } + await _appStore.CreateAsync(application, cancellationToken); + } + else { - application.SetProperty(nameof(AppDescriptor.SignLifetime), descriptor.SignLifetime); + application.ClientSecret = descriptor.AppSecret; + if (descriptor.SignLifetime.HasValue) + { + application.SetProperty(nameof(AppDescriptor.SignLifetime), descriptor.SignLifetime); + } + await _appStore.UpdateAsync(application, cancellationToken); } - await _appStore.CreateAsync(application, cancellationToken); } } diff --git a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN.Abp.OpenApi.csproj b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN.Abp.OpenApi.csproj index 9e02123db..9d1c596ab 100644 --- a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN.Abp.OpenApi.csproj +++ b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN.Abp.OpenApi.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.OpenApi + LINGYUN.Abp.OpenApi + false + false + false diff --git a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/AbpOpenApiConsts.cs b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/AbpOpenApiConsts.cs index ad092f245..ed9a08fa5 100644 --- a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/AbpOpenApiConsts.cs +++ b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/AbpOpenApiConsts.cs @@ -1,25 +1,24 @@ -namespace LINGYUN.Abp.OpenApi +namespace LINGYUN.Abp.OpenApi; + +public static class AbpOpenApiConsts { - public static class AbpOpenApiConsts - { - public const string SecurityChecking = "_AbpOpenApiSecurityChecking"; + public const string SecurityChecking = "_AbpOpenApiSecurityChecking"; - public const string AppKeyFieldName = "appKey"; - public const string SignatureFieldName = "sign"; - public const string TimeStampFieldName = "t"; + public const string AppKeyFieldName = "appKey"; + public const string SignatureFieldName = "sign"; + public const string TimeStampFieldName = "t"; - public const string KeyPrefix = "AbpOpenApi"; + public const string KeyPrefix = "AbpOpenApi"; - public const string InvalidAccessWithAppKey = KeyPrefix + ":9100"; - public const string InvalidAccessWithAppKeyNotFound = KeyPrefix + ":9101"; + public const string InvalidAccessWithAppKey = KeyPrefix + ":9100"; + public const string InvalidAccessWithAppKeyNotFound = KeyPrefix + ":9101"; - public const string InvalidAccessWithSign = KeyPrefix + ":9110"; - public const string InvalidAccessWithSignNotFound = KeyPrefix + ":9111"; + public const string InvalidAccessWithSign = KeyPrefix + ":9110"; + public const string InvalidAccessWithSignNotFound = KeyPrefix + ":9111"; - public const string InvalidAccessWithTimestamp = KeyPrefix + ":9210"; - public const string InvalidAccessWithTimestampNotFound = KeyPrefix + ":9211"; + public const string InvalidAccessWithTimestamp = KeyPrefix + ":9210"; + public const string InvalidAccessWithTimestampNotFound = KeyPrefix + ":9211"; - public const string InvalidAccessWithClientId = KeyPrefix + ":9300"; - public const string InvalidAccessWithIpAddress = KeyPrefix + ":9400"; - } + public const string InvalidAccessWithClientId = KeyPrefix + ":9300"; + public const string InvalidAccessWithIpAddress = KeyPrefix + ":9400"; } diff --git a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/AbpOpenApiModule.cs b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/AbpOpenApiModule.cs index 6c18560e2..08c7b65ab 100644 --- a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/AbpOpenApiModule.cs +++ b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/AbpOpenApiModule.cs @@ -7,37 +7,36 @@ using Volo.Abp.Security; using Volo.Abp.VirtualFileSystem; -namespace LINGYUN.Abp.OpenApi +namespace LINGYUN.Abp.OpenApi; + +[DependsOn( + typeof(AbpSecurityModule), + typeof(AbpLocalizationModule))] +public class AbpOpenApiModule : AbpModule { - [DependsOn( - typeof(AbpSecurityModule), - typeof(AbpLocalizationModule))] - public class AbpOpenApiModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) - { - var configuration = context.Services.GetConfiguration(); + var configuration = context.Services.GetConfiguration(); - var openApiConfig = configuration.GetSection("OpenApi"); - Configure(openApiConfig); - Configure(openApiConfig); + var openApiConfig = configuration.GetSection("OpenApi"); + Configure(openApiConfig); + Configure(openApiConfig); - Configure(options => - { - options.FileSets.AddEmbedded(); - }); + Configure(options => + { + options.FileSets.AddEmbedded(); + }); - Configure(options => - { - options.Resources - .Add() - .AddVirtualJson("/LINGYUN/Abp/OpenApi/Localization/Resources"); - }); + Configure(options => + { + options.Resources + .Add() + .AddVirtualJson("/LINGYUN/Abp/OpenApi/Localization/Resources"); + }); - Configure(options => - { - options.MapCodeNamespace(AbpOpenApiConsts.KeyPrefix, typeof(OpenApiResource)); - }); - } + Configure(options => + { + options.MapCodeNamespace(AbpOpenApiConsts.KeyPrefix, typeof(OpenApiResource)); + }); } } diff --git a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/AbpOpenApiOptions.cs b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/AbpOpenApiOptions.cs index ac717f89a..960694271 100644 --- a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/AbpOpenApiOptions.cs +++ b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/AbpOpenApiOptions.cs @@ -1,11 +1,10 @@ -namespace LINGYUN.Abp.OpenApi +namespace LINGYUN.Abp.OpenApi; + +public class AbpOpenApiOptions { - public class AbpOpenApiOptions + public bool IsEnabled { get; set; } + public AbpOpenApiOptions() { - public bool IsEnabled { get; set; } - public AbpOpenApiOptions() - { - IsEnabled = true; - } + IsEnabled = true; } } diff --git a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/AppDescriptor.cs b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/AppDescriptor.cs index 789f92e69..74a2d6889 100644 --- a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/AppDescriptor.cs +++ b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/AppDescriptor.cs @@ -1,42 +1,41 @@ -namespace LINGYUN.Abp.OpenApi +namespace LINGYUN.Abp.OpenApi; + +public class AppDescriptor { - public class AppDescriptor - { - /// - /// 应用名称 - /// - public string AppName { get; set; } - /// - /// 应用标识 - /// - public string AppKey { get; set; } - /// - /// 应用密钥 - /// - public string AppSecret { get; set; } - /// - /// 应用token - /// - public string AppToken { get; set; } - /// - /// 签名有效时间 - /// 单位: s - /// - public int? SignLifetime { get; set; } + /// + /// 应用名称 + /// + public string AppName { get; set; } + /// + /// 应用标识 + /// + public string AppKey { get; set; } + /// + /// 应用密钥 + /// + public string AppSecret { get; set; } + /// + /// 应用token + /// + public string AppToken { get; set; } + /// + /// 签名有效时间 + /// 单位: s + /// + public int? SignLifetime { get; set; } - public AppDescriptor() { } - public AppDescriptor( - string appName, - string appKey, - string appSecret, - string appToken = null, - int? signLifeTime = null) - { - AppName = appName; - AppKey = appKey; - AppSecret = appSecret; - AppToken = appToken; - SignLifetime = signLifeTime; - } + public AppDescriptor() { } + public AppDescriptor( + string appName, + string appKey, + string appSecret, + string appToken = null, + int? signLifeTime = null) + { + AppName = appName; + AppKey = appKey; + AppSecret = appSecret; + AppToken = appToken; + SignLifetime = signLifeTime; } } diff --git a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/ConfigurationStore/AbpDefaultAppKeyStoreOptions.cs b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/ConfigurationStore/AbpDefaultAppKeyStoreOptions.cs index 01090663b..b3f11ae2e 100644 --- a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/ConfigurationStore/AbpDefaultAppKeyStoreOptions.cs +++ b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/ConfigurationStore/AbpDefaultAppKeyStoreOptions.cs @@ -1,12 +1,11 @@ -namespace LINGYUN.Abp.OpenApi.ConfigurationStore +namespace LINGYUN.Abp.OpenApi.ConfigurationStore; + +public class AbpDefaultAppKeyStoreOptions { - public class AbpDefaultAppKeyStoreOptions - { - public AppDescriptor[] AppDescriptors { get; set; } + public AppDescriptor[] AppDescriptors { get; set; } - public AbpDefaultAppKeyStoreOptions() - { - AppDescriptors = new AppDescriptor[0]; - } + public AbpDefaultAppKeyStoreOptions() + { + AppDescriptors = new AppDescriptor[0]; } } diff --git a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/ConfigurationStore/DefaultAppKeyStore.cs b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/ConfigurationStore/DefaultAppKeyStore.cs index ae91920c2..301c4005c 100644 --- a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/ConfigurationStore/DefaultAppKeyStore.cs +++ b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/ConfigurationStore/DefaultAppKeyStore.cs @@ -5,32 +5,31 @@ using System.Threading.Tasks; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.OpenApi.ConfigurationStore +namespace LINGYUN.Abp.OpenApi.ConfigurationStore; + +[Dependency(TryRegister = true)] +public class DefaultAppKeyStore : IAppKeyStore, ITransientDependency { - [Dependency(TryRegister = true)] - public class DefaultAppKeyStore : IAppKeyStore, ITransientDependency - { - private readonly AbpDefaultAppKeyStoreOptions _options; + private readonly AbpDefaultAppKeyStoreOptions _options; - public DefaultAppKeyStore(IOptionsMonitor options) - { - _options = options.CurrentValue; - } + public DefaultAppKeyStore(IOptionsMonitor options) + { + _options = options.CurrentValue; + } - public Task FindAsync(string appKey, CancellationToken cancellationToken = default) - { - return Task.FromResult(Find(appKey)); - } + public Task FindAsync(string appKey, CancellationToken cancellationToken = default) + { + return Task.FromResult(Find(appKey)); + } - public AppDescriptor Find(string appKey) - { - return _options.AppDescriptors?.FirstOrDefault(t => t.AppKey == appKey); - } + public AppDescriptor Find(string appKey) + { + return _options.AppDescriptors?.FirstOrDefault(t => t.AppKey == appKey); + } - public Task StoreAsync(AppDescriptor descriptor, CancellationToken cancellationToken = default) - { - _options.AppDescriptors.AddIfNotContains(descriptor); - return Task.CompletedTask; - } + public Task StoreAsync(AppDescriptor descriptor, CancellationToken cancellationToken = default) + { + _options.AppDescriptors.AddIfNotContains(descriptor); + return Task.CompletedTask; } } diff --git a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/Localization/OpenApiResource.cs b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/Localization/OpenApiResource.cs index c9148ad6a..22b4827b7 100644 --- a/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/Localization/OpenApiResource.cs +++ b/aspnet-core/framework/open-api/LINGYUN.Abp.OpenApi/LINGYUN/Abp/OpenApi/Localization/OpenApiResource.cs @@ -1,9 +1,8 @@ using Volo.Abp.Localization; -namespace LINGYUN.Abp.OpenApi.Localization +namespace LINGYUN.Abp.OpenApi.Localization; + +[LocalizationResourceName("OpenApi")] +public class OpenApiResource { - [LocalizationResourceName("OpenApi")] - public class OpenApiResource - { - } } diff --git a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/LINGYUN.Abp.PushPlus.SettingManagement.csproj b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/LINGYUN.Abp.PushPlus.SettingManagement.csproj index a4b9ccfd5..9a0a2f74f 100644 --- a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/LINGYUN.Abp.PushPlus.SettingManagement.csproj +++ b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/LINGYUN.Abp.PushPlus.SettingManagement.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.PushPlus.SettingManagement + LINGYUN.Abp.PushPlus.SettingManagement + false + false + false diff --git a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN.Abp.PushPlus.csproj b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN.Abp.PushPlus.csproj index 5d51f81c1..eb2cbed23 100644 --- a/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN.Abp.PushPlus.csproj +++ b/aspnet-core/framework/pushplus/LINGYUN.Abp.PushPlus/LINGYUN.Abp.PushPlus.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.PushPlus + LINGYUN.Abp.PushPlus + false + false + false diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN.Abp.Rules.NRules.csproj b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN.Abp.Rules.NRules.csproj index f1dc8fdcd..b3b4c5198 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN.Abp.Rules.NRules.csproj +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN.Abp.Rules.NRules.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Rules.NRules + LINGYUN.Abp.Rules.NRules + false + false + false diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/AbpNRulesModule.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/AbpNRulesModule.cs index 5118ba6ad..edcd80aab 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/AbpNRulesModule.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/AbpNRulesModule.cs @@ -3,43 +3,42 @@ using System.Collections.Generic; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.Rules.NRules +namespace LINGYUN.Abp.Rules.NRules; + +[DependsOn( + typeof(AbpRulesModule))] +public class AbpNRulesModule : AbpModule { - [DependsOn( - typeof(AbpRulesModule))] - public class AbpNRulesModule : AbpModule + public override void PreConfigureServices(ServiceConfigurationContext context) { - public override void PreConfigureServices(ServiceConfigurationContext context) - { - AddDefinitionRules(context.Services); - } + AddDefinitionRules(context.Services); + } - public override void ConfigureServices(ServiceConfigurationContext context) + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddNRules(); + + Configure(options => { - context.Services.AddNRules(); + options.Contributors.Add(); + }); + } - Configure(options => - { - options.Contributors.Add(); - }); - } + private static void AddDefinitionRules(IServiceCollection services) + { + var definitionRules = new List(); - private static void AddDefinitionRules(IServiceCollection services) + services.OnRegistered(context => { - var definitionRules = new List(); - - services.OnRegistered(context => + if (typeof(RuleBase).IsAssignableFrom(context.ImplementationType)) { - if (typeof(RuleBase).IsAssignableFrom(context.ImplementationType)) - { - definitionRules.Add(context.ImplementationType); - } - }); + definitionRules.Add(context.ImplementationType); + } + }); - services.Configure(options => - { - options.DefinitionRules.AddIfNotContains(definitionRules); - }); - } + services.Configure(options => + { + options.DefinitionRules.AddIfNotContains(definitionRules); + }); } } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/AbpNRulesOptions.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/AbpNRulesOptions.cs index 9d7fa83c9..fa3c90243 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/AbpNRulesOptions.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/AbpNRulesOptions.cs @@ -1,14 +1,13 @@ using Volo.Abp.Collections; -namespace LINGYUN.Abp.Rules.NRules +namespace LINGYUN.Abp.Rules.NRules; + +public class AbpNRulesOptions { - public class AbpNRulesOptions - { - public ITypeList DefinitionRules { get; } + public ITypeList DefinitionRules { get; } - public AbpNRulesOptions() - { - DefinitionRules = new TypeList(); - } + public AbpNRulesOptions() + { + DefinitionRules = new TypeList(); } } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/ActionInterceptor.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/ActionInterceptor.cs index cf7f59cff..e79486f6e 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/ActionInterceptor.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/ActionInterceptor.cs @@ -2,13 +2,12 @@ using NRules.RuleModel; using System.Collections.Generic; -namespace LINGYUN.Abp.Rules.NRules +namespace LINGYUN.Abp.Rules.NRules; + +public class ActionInterceptor : IActionInterceptor { - public class ActionInterceptor : IActionInterceptor + public void Intercept(IContext context, IEnumerable actions) { - public void Intercept(IContext context, IEnumerable actions) - { - // TODO: Intercept - } + // TODO: Intercept } } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/DependencyResolver.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/DependencyResolver.cs index 945439354..f6f20d682 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/DependencyResolver.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/DependencyResolver.cs @@ -1,21 +1,20 @@ using NRules.Extensibility; using System; -namespace LINGYUN.Abp.Rules.NRules +namespace LINGYUN.Abp.Rules.NRules; + +public class DependencyResolver : IDependencyResolver { - public class DependencyResolver : IDependencyResolver - { - private readonly IServiceProvider _serviceProvider; + private readonly IServiceProvider _serviceProvider; - public DependencyResolver( - IServiceProvider serviceProvider) - { - _serviceProvider = serviceProvider; - } + public DependencyResolver( + IServiceProvider serviceProvider) + { + _serviceProvider = serviceProvider; + } - public object Resolve(IResolutionContext context, Type serviceType) - { - return _serviceProvider.GetService(serviceType); - } + public object Resolve(IResolutionContext context, Type serviceType) + { + return _serviceProvider.GetService(serviceType); } } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/NRulesContributor.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/NRulesContributor.cs index 1cdaf7cf1..8ef96ecc0 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/NRulesContributor.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/NRulesContributor.cs @@ -8,44 +8,43 @@ using System.Threading.Tasks; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.Rules.NRules +namespace LINGYUN.Abp.Rules.NRules; + +public class NRulesContributor : RuleContributorBase, ISingletonDependency { - public class NRulesContributor : RuleContributorBase, ISingletonDependency + private readonly AbpNRulesOptions _options; + private readonly IServiceProvider _serviceProvider; + + public NRulesContributor( + IServiceProvider serviceProvider, + IOptions options) { - private readonly AbpNRulesOptions _options; - private readonly IServiceProvider _serviceProvider; + _options = options.Value; + _serviceProvider = serviceProvider; + } - public NRulesContributor( - IServiceProvider serviceProvider, - IOptions options) - { - _options = options.Value; - _serviceProvider = serviceProvider; - } + public override void Initialize(RulesInitializationContext context) + { + context.GetRequiredService() + .Load(loader => loader.From(_options.DefinitionRules)); + } - public override void Initialize(RulesInitializationContext context) + public override Task ExecuteAsync(T input, object[] @params = null, CancellationToken cancellationToken = default) + { + using (var scope = _serviceProvider.CreateScope()) { - context.GetRequiredService() - .Load(loader => loader.From(_options.DefinitionRules)); - } + var session = scope.ServiceProvider.GetRequiredService(); - public override Task ExecuteAsync(T input, object[] @params = null, CancellationToken cancellationToken = default) - { - using (var scope = _serviceProvider.CreateScope()) + session.Insert(input); + if (@params != null && @params.Any()) { - var session = scope.ServiceProvider.GetRequiredService(); - - session.Insert(input); - if (@params != null && @params.Any()) - { - session.InsertAll(@params); - } - - // TODO: 需要研究源码 - session.Fire(cancellationToken); + session.InsertAll(@params); } - return Task.CompletedTask; + // TODO: 需要研究源码 + session.Fire(cancellationToken); } + + return Task.CompletedTask; } } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/RuleActivator.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/RuleActivator.cs index 5ebe51fcd..dbda46c17 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/RuleActivator.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/RuleActivator.cs @@ -3,33 +3,32 @@ using System; using System.Collections.Generic; -namespace LINGYUN.Abp.Rules.NRules +namespace LINGYUN.Abp.Rules.NRules; + +public class RuleActivator : IRuleActivator { - public class RuleActivator : IRuleActivator + private readonly IServiceProvider _serviceProvider; + + public RuleActivator(IServiceProvider serviceProvider) { - private readonly IServiceProvider _serviceProvider; + _serviceProvider = serviceProvider; + } - public RuleActivator(IServiceProvider serviceProvider) - { - _serviceProvider = serviceProvider; - } + public IEnumerable Activate(Type type) + { + var collectionType = typeof(IEnumerable<>).MakeGenericType(type); + var rules = _serviceProvider.GetService(collectionType); - public IEnumerable Activate(Type type) + if (rules != null) { - var collectionType = typeof(IEnumerable<>).MakeGenericType(type); - var rules = _serviceProvider.GetService(collectionType); - - if (rules != null) - { - return (IEnumerable)rules; - } - - return ActivateDefault(type); + return (IEnumerable)rules; } - private static IEnumerable ActivateDefault(Type type) - { - yield return (Rule)Activator.CreateInstance(type); - } + return ActivateDefault(type); + } + + private static IEnumerable ActivateDefault(Type type) + { + yield return (Rule)Activator.CreateInstance(type); } } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/RuleBase.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/RuleBase.cs index e43edf665..0c50db93a 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/RuleBase.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/LINGYUN/Abp/Rules/NRules/RuleBase.cs @@ -1,9 +1,8 @@ using NRules.Fluent.Dsl; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.Rules.NRules +namespace LINGYUN.Abp.Rules.NRules; + +public abstract class RuleBase : Rule, ITransientDependency { - public abstract class RuleBase : Rule, ITransientDependency - { - } } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/Microsoft/Extensions/DependencyInjection/NRulesServiceCollectionExtensions.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/Microsoft/Extensions/DependencyInjection/NRulesServiceCollectionExtensions.cs index 33c364098..9d7939371 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/Microsoft/Extensions/DependencyInjection/NRulesServiceCollectionExtensions.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.NRules/Microsoft/Extensions/DependencyInjection/NRulesServiceCollectionExtensions.cs @@ -4,27 +4,26 @@ using NRules.Fluent; using NRules.RuleModel; -namespace Microsoft.Extensions.DependencyInjection +namespace Microsoft.Extensions.DependencyInjection; + +public static class NRulesServiceCollectionExtensions { - public static class NRulesServiceCollectionExtensions + public static IServiceCollection AddNRules(this IServiceCollection services) { - public static IServiceCollection AddNRules(this IServiceCollection services) - { - services.AddSingleton(); - services.AddSingleton(); - services.AddSingleton(); - services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); - services.AddSingleton((serviceProvider) => - { - return serviceProvider.GetRequiredService().Compile(); - }); - services.AddScoped((serviceProvider) => - { - return serviceProvider.GetRequiredService().CreateSession(); - }); + services.AddSingleton((serviceProvider) => + { + return serviceProvider.GetRequiredService().Compile(); + }); + services.AddScoped((serviceProvider) => + { + return serviceProvider.GetRequiredService().CreateSession(); + }); - return services; - } + return services; } } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN.Abp.Rules.RulesEngine.csproj b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN.Abp.Rules.RulesEngine.csproj index f44d62501..164440596 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN.Abp.Rules.RulesEngine.csproj +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN.Abp.Rules.RulesEngine.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Rules.RulesEngine + LINGYUN.Abp.Rules.RulesEngine + false + false + false diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/AbpRulesEngineModule.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/AbpRulesEngineModule.cs index 06807302e..2f121f3bd 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/AbpRulesEngineModule.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/AbpRulesEngineModule.cs @@ -7,33 +7,32 @@ using Volo.Abp.Modularity; using Engine = RulesEngine.RulesEngine; -namespace LINGYUN.Abp.Rules.RulesEngine +namespace LINGYUN.Abp.Rules.RulesEngine; + +[DependsOn( + typeof(AbpRulesModule), + typeof(AbpJsonModule))] +public class AbpRulesEngineModule : AbpModule { - [DependsOn( - typeof(AbpRulesModule), - typeof(AbpJsonModule))] - public class AbpRulesEngineModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddMemoryCache(); + context.Services.AddMemoryCache(); - Configure(options => - { - options.Contributors.Add(); - }); + Configure(options => + { + options.Contributors.Add(); + }); - Configure(options => - { - options.WorkflowsResolvers.Add(new PersistentWorkflowsResolveContributor()); - options.WorkflowsResolvers.Add(new PhysicalFileWorkflowsResolveContributor()); - }); + Configure(options => + { + options.WorkflowsResolvers.Add(new PersistentWorkflowsResolveContributor()); + options.WorkflowsResolvers.Add(new PhysicalFileWorkflowsResolveContributor()); + }); - context.Services.AddSingleton((sp) => - { - var options = sp.GetRequiredService>().Value; - return new Engine(options.Settings); - }); - } + context.Services.AddSingleton((sp) => + { + var options = sp.GetRequiredService>().Value; + return new Engine(options.Settings); + }); } } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/AbpRulesEngineOptions.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/AbpRulesEngineOptions.cs index 47a296fb0..81b680313 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/AbpRulesEngineOptions.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/AbpRulesEngineOptions.cs @@ -1,24 +1,23 @@ using RulesEngine.Models; -namespace LINGYUN.Abp.Rules.RulesEngine +namespace LINGYUN.Abp.Rules.RulesEngine; + +public class AbpRulesEngineOptions { - public class AbpRulesEngineOptions - { - /// - /// 是否忽略租户 - /// - public bool IgnoreMultiTenancy { get; set; } - /// - /// 规则引擎可配置 - /// - public ReSettings Settings { get; set; } + /// + /// 是否忽略租户 + /// + public bool IgnoreMultiTenancy { get; set; } + /// + /// 规则引擎可配置 + /// + public ReSettings Settings { get; set; } - public AbpRulesEngineOptions() + public AbpRulesEngineOptions() + { + Settings = new ReSettings { - Settings = new ReSettings - { - NestedRuleExecutionMode = NestedRuleExecutionMode.Performance - }; - } + NestedRuleExecutionMode = NestedRuleExecutionMode.Performance + }; } } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/AbpRulesEngineResolveOptions.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/AbpRulesEngineResolveOptions.cs index ffc623c93..a0e3b67a9 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/AbpRulesEngineResolveOptions.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/AbpRulesEngineResolveOptions.cs @@ -1,27 +1,26 @@ using JetBrains.Annotations; using System.Collections.Generic; -namespace LINGYUN.Abp.Rules.RulesEngine +namespace LINGYUN.Abp.Rules.RulesEngine; + +public class AbpRulesEngineResolveOptions { - public class AbpRulesEngineResolveOptions - { - /// - /// 合并规则 - /// 如果为 true,在上一个提供者解析规则之后继续执行下一个提供者 - /// 如果为 false,在上一个提供者解析规则之后立即执行规则 - /// 默认:false - /// - public bool MergingWorkflows { get; set; } - /// - /// 规则解析提供者 - /// - [NotNull] - public List WorkflowsResolvers { get; } + /// + /// 合并规则 + /// 如果为 true,在上一个提供者解析规则之后继续执行下一个提供者 + /// 如果为 false,在上一个提供者解析规则之后立即执行规则 + /// 默认:false + /// + public bool MergingWorkflows { get; set; } + /// + /// 规则解析提供者 + /// + [NotNull] + public List WorkflowsResolvers { get; } - public AbpRulesEngineResolveOptions() - { - MergingWorkflows = false; - WorkflowsResolvers = new List(); - } + public AbpRulesEngineResolveOptions() + { + MergingWorkflows = false; + WorkflowsResolvers = new List(); } } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/FileProviders/FileProviderWorkflowsResolveContributor.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/FileProviders/FileProviderWorkflowsResolveContributor.cs index 613faa183..c25cd3008 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/FileProviders/FileProviderWorkflowsResolveContributor.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/FileProviders/FileProviderWorkflowsResolveContributor.cs @@ -9,94 +9,93 @@ using System.Threading.Tasks; using Volo.Abp.Json; -namespace LINGYUN.Abp.Rules.RulesEngine.FileProviders +namespace LINGYUN.Abp.Rules.RulesEngine.FileProviders; + +public abstract class FileProviderWorkflowsResolveContributor : WorkflowsResolveContributorBase { - public abstract class FileProviderWorkflowsResolveContributor : WorkflowsResolveContributorBase - { - protected IMemoryCache RulesCache { get; private set; } - protected IJsonSerializer JsonSerializer { get; private set; } + protected IMemoryCache RulesCache { get; private set; } + protected IJsonSerializer JsonSerializer { get; private set; } - protected IFileProvider FileProvider { get; private set; } - protected FileProviderWorkflowsResolveContributor() - { - } + protected IFileProvider FileProvider { get; private set; } + protected FileProviderWorkflowsResolveContributor() + { + } - public override void Initialize(RulesInitializationContext context) - { - Initialize(context.ServiceProvider); + public override void Initialize(RulesInitializationContext context) + { + Initialize(context.ServiceProvider); - RulesCache = context.GetRequiredService(); - JsonSerializer = context.GetRequiredService(); + RulesCache = context.GetRequiredService(); + JsonSerializer = context.GetRequiredService(); - FileProvider = BuildFileProvider(context); - } + FileProvider = BuildFileProvider(context); + } - protected virtual void Initialize(IServiceProvider serviceProvider) - { - } + protected virtual void Initialize(IServiceProvider serviceProvider) + { + } - protected abstract IFileProvider BuildFileProvider(RulesInitializationContext context); + protected abstract IFileProvider BuildFileProvider(RulesInitializationContext context); - public async override Task ResolveAsync(IWorkflowsResolveContext context) + public async override Task ResolveAsync(IWorkflowsResolveContext context) + { + if (FileProvider != null) { - if (FileProvider != null) - { - context.Workflows = await GetCachedRulesAsync(context.Type); - } - context.Handled = true; + context.Workflows = await GetCachedRulesAsync(context.Type); } + context.Handled = true; + } - public override void Shutdown() + public override void Shutdown() + { + if (FileProvider != null && FileProvider is IDisposable resource) { - if (FileProvider != null && FileProvider is IDisposable resource) - { - resource.Dispose(); - } + resource.Dispose(); } + } - private async Task GetCachedRulesAsync(Type type, CancellationToken cancellationToken = default) - { - cancellationToken.ThrowIfCancellationRequested(); + private async Task GetCachedRulesAsync(Type type, CancellationToken cancellationToken = default) + { + cancellationToken.ThrowIfCancellationRequested(); - var ruleId = GetRuleId(type); + var ruleId = GetRuleId(type); - return await RulesCache.GetOrCreateAsync(ruleId, - async (entry) => - { - entry.SetAbsoluteExpiration(TimeSpan.FromMinutes(30)); + return await RulesCache.GetOrCreateAsync(ruleId, + async (entry) => + { + entry.SetAbsoluteExpiration(TimeSpan.FromMinutes(30)); - return await GetFileSystemRulesAsync(type, cancellationToken); - }); - } - protected abstract int GetRuleId(Type type); + return await GetFileSystemRulesAsync(type, cancellationToken); + }); + } + protected abstract int GetRuleId(Type type); - protected abstract string GetRuleName(Type type); + protected abstract string GetRuleName(Type type); - protected async virtual Task GetFileSystemRulesAsync(Type type, CancellationToken cancellationToken = default) + protected async virtual Task GetFileSystemRulesAsync(Type type, CancellationToken cancellationToken = default) + { + var ruleId = GetRuleId(type); + var ruleFile = GetRuleName(type); + var fileInfo = FileProvider.GetFileInfo(ruleFile); + if (fileInfo != null && fileInfo.Exists) { - var ruleId = GetRuleId(type); - var ruleFile = GetRuleName(type); - var fileInfo = FileProvider.GetFileInfo(ruleFile); - if (fileInfo != null && fileInfo.Exists) - { - // 规则文件监控 - ChangeToken.OnChange( - () => FileProvider.Watch(ruleFile), - (int ruleId) => - { - // 清除规则缓存 - RulesCache.Remove(ruleId); - }, ruleId); - - // 打开文本流 - using var stream = fileInfo.CreateReadStream(); - var result = new byte[stream.Length]; - await stream.ReadAsync(result, 0, (int)stream.Length); - var ruleDsl = Encoding.UTF8.GetString(result); - // 解析 - return JsonSerializer.Deserialize(ruleDsl); - } - return new Workflow[0]; + // 规则文件监控 + ChangeToken.OnChange( + () => FileProvider.Watch(ruleFile), + (int ruleId) => + { + // 清除规则缓存 + RulesCache.Remove(ruleId); + }, ruleId); + + // 打开文本流 + using var stream = fileInfo.CreateReadStream(); + var result = new byte[stream.Length]; + await stream.ReadAsync(result, 0, (int)stream.Length); + var ruleDsl = Encoding.UTF8.GetString(result); + // 解析 + return JsonSerializer.Deserialize(ruleDsl); } + return new Workflow[0]; } } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/FileProviders/Physical/AbpRulesEnginePhysicalFileResolveOptions.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/FileProviders/Physical/AbpRulesEnginePhysicalFileResolveOptions.cs index ddb4b124b..7a29c3f68 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/FileProviders/Physical/AbpRulesEnginePhysicalFileResolveOptions.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/FileProviders/Physical/AbpRulesEnginePhysicalFileResolveOptions.cs @@ -1,10 +1,9 @@ -namespace LINGYUN.Abp.Rules.RulesEngine.FileProviders.Physical +namespace LINGYUN.Abp.Rules.RulesEngine.FileProviders.Physical; + +public class AbpRulesEnginePhysicalFileResolveOptions { - public class AbpRulesEnginePhysicalFileResolveOptions - { - /// - /// 本地文件路径 - /// - public string PhysicalPath { get; set; } - } + /// + /// 本地文件路径 + /// + public string PhysicalPath { get; set; } } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/FileProviders/Physical/PhysicalFileWorkflowsResolveContributor.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/FileProviders/Physical/PhysicalFileWorkflowsResolveContributor.cs index 8e14d3c76..14027ec7e 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/FileProviders/Physical/PhysicalFileWorkflowsResolveContributor.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/FileProviders/Physical/PhysicalFileWorkflowsResolveContributor.cs @@ -5,40 +5,39 @@ using System.IO; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.Rules.RulesEngine.FileProviders.Physical +namespace LINGYUN.Abp.Rules.RulesEngine.FileProviders.Physical; + +public class PhysicalFileWorkflowsResolveContributor : FileProviderWorkflowsResolveContributor, ISingletonDependency { - public class PhysicalFileWorkflowsResolveContributor : FileProviderWorkflowsResolveContributor, ISingletonDependency - { - public override string Name => "PhysicalFile"; + public override string Name => "PhysicalFile"; - private RuleIdGenerator _ruleIdGenerator; - private AbpRulesEngineOptions _rulesEngineOptions; - private AbpRulesEnginePhysicalFileResolveOptions _fileResolveOptions; + private RuleIdGenerator _ruleIdGenerator; + private AbpRulesEngineOptions _rulesEngineOptions; + private AbpRulesEnginePhysicalFileResolveOptions _fileResolveOptions; - public PhysicalFileWorkflowsResolveContributor() - { - } + public PhysicalFileWorkflowsResolveContributor() + { + } - protected override void Initialize(IServiceProvider serviceProvider) - { - _ruleIdGenerator = serviceProvider.GetRequiredService(); - _rulesEngineOptions = serviceProvider.GetRequiredService>().Value; - _fileResolveOptions = serviceProvider.GetRequiredService>().Value; - } + protected override void Initialize(IServiceProvider serviceProvider) + { + _ruleIdGenerator = serviceProvider.GetRequiredService(); + _rulesEngineOptions = serviceProvider.GetRequiredService>().Value; + _fileResolveOptions = serviceProvider.GetRequiredService>().Value; + } - protected override IFileProvider BuildFileProvider(RulesInitializationContext context) + protected override IFileProvider BuildFileProvider(RulesInitializationContext context) + { + // 未指定路径不启用 + if (!_fileResolveOptions.PhysicalPath.IsNullOrWhiteSpace() && + Directory.Exists(_fileResolveOptions.PhysicalPath)) { - // 未指定路径不启用 - if (!_fileResolveOptions.PhysicalPath.IsNullOrWhiteSpace() && - Directory.Exists(_fileResolveOptions.PhysicalPath)) - { - return new PhysicalFileProvider(_fileResolveOptions.PhysicalPath); - } - return null; + return new PhysicalFileProvider(_fileResolveOptions.PhysicalPath); } + return null; + } - protected override int GetRuleId(Type type) => _ruleIdGenerator.CreateRuleId(type, _rulesEngineOptions.IgnoreMultiTenancy); + protected override int GetRuleId(Type type) => _ruleIdGenerator.CreateRuleId(type, _rulesEngineOptions.IgnoreMultiTenancy); - protected override string GetRuleName(Type type) => $"{_ruleIdGenerator.CreateRuleName(type, _rulesEngineOptions.IgnoreMultiTenancy)}.json"; - } + protected override string GetRuleName(Type type) => $"{_ruleIdGenerator.CreateRuleName(type, _rulesEngineOptions.IgnoreMultiTenancy)}.json"; } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/IWorkflowsResolveContext.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/IWorkflowsResolveContext.cs index 0a0831cee..b4101d395 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/IWorkflowsResolveContext.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/IWorkflowsResolveContext.cs @@ -4,16 +4,15 @@ using System.Collections.Generic; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.Rules.RulesEngine +namespace LINGYUN.Abp.Rules.RulesEngine; + +public interface IWorkflowsResolveContext : IServiceProviderAccessor { - public interface IWorkflowsResolveContext : IServiceProviderAccessor - { - [CanBeNull] - IEnumerable Workflows { get; set; } + [CanBeNull] + IEnumerable Workflows { get; set; } - [NotNull] - Type Type { get; } + [NotNull] + Type Type { get; } - bool Handled { get; set; } - } + bool Handled { get; set; } } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/IWorkflowsResolveContributor.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/IWorkflowsResolveContributor.cs index 578bde992..3867af380 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/IWorkflowsResolveContributor.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/IWorkflowsResolveContributor.cs @@ -1,15 +1,14 @@ using System.Threading.Tasks; -namespace LINGYUN.Abp.Rules.RulesEngine +namespace LINGYUN.Abp.Rules.RulesEngine; + +public interface IWorkflowsResolveContributor { - public interface IWorkflowsResolveContributor - { - string Name { get; } + string Name { get; } - Task ResolveAsync(IWorkflowsResolveContext context); + Task ResolveAsync(IWorkflowsResolveContext context); - void Initialize(RulesInitializationContext context); + void Initialize(RulesInitializationContext context); - void Shutdown(); - } + void Shutdown(); } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/IWorkflowsResolver.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/IWorkflowsResolver.cs index a6a37ce19..625bf32c6 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/IWorkflowsResolver.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/IWorkflowsResolver.cs @@ -2,15 +2,14 @@ using System; using System.Threading.Tasks; -namespace LINGYUN.Abp.Rules.RulesEngine +namespace LINGYUN.Abp.Rules.RulesEngine; + +public interface IWorkflowsResolver { - public interface IWorkflowsResolver - { - void Initialize(RulesInitializationContext context); + void Initialize(RulesInitializationContext context); - [NotNull] - Task ResolveWorkflowsAsync(Type type); + [NotNull] + Task ResolveWorkflowsAsync(Type type); - void Shutdown(); - } + void Shutdown(); } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/Persistent/IWorkflowStore.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/Persistent/IWorkflowStore.cs index b1bfc802c..e01122952 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/Persistent/IWorkflowStore.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/Persistent/IWorkflowStore.cs @@ -4,15 +4,14 @@ using System.Threading; using System.Threading.Tasks; -namespace LINGYUN.Abp.Rules.RulesEngine.Persistent +namespace LINGYUN.Abp.Rules.RulesEngine.Persistent; + +/// +/// 实现此接口以用于从其他持久化存储中获取规则 +/// +public interface IWorkflowStore { - /// - /// 实现此接口以用于从其他持久化存储中获取规则 - /// - public interface IWorkflowStore - { - Task> GetWorkflowsAsync(Type inputType, CancellationToken cancellationToken = default); + Task> GetWorkflowsAsync(Type inputType, CancellationToken cancellationToken = default); - Task GetWorkflowAsync(string workflowName, CancellationToken cancellationToken = default); - } + Task GetWorkflowAsync(string workflowName, CancellationToken cancellationToken = default); } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/Persistent/NullWorkflowStore.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/Persistent/NullWorkflowStore.cs index a8d984fc3..1e97c156e 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/Persistent/NullWorkflowStore.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/Persistent/NullWorkflowStore.cs @@ -5,20 +5,19 @@ using System.Threading.Tasks; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.Rules.RulesEngine.Persistent +namespace LINGYUN.Abp.Rules.RulesEngine.Persistent; + +[Dependency(TryRegister = true)] +public class NullWorkflowStore : IWorkflowStore, ISingletonDependency { - [Dependency(TryRegister = true)] - public class NullWorkflowStore : IWorkflowStore, ISingletonDependency + public Task GetWorkflowAsync(string workflowName, CancellationToken cancellationToken = default) { - public Task GetWorkflowAsync(string workflowName, CancellationToken cancellationToken = default) - { - return Task.FromResult(null); - } + return Task.FromResult(null); + } - public Task> GetWorkflowsAsync(Type inputType, CancellationToken cancellationToken = default) - { - IEnumerable rules = new Workflow[0]; - return Task.FromResult(rules); - } + public Task> GetWorkflowsAsync(Type inputType, CancellationToken cancellationToken = default) + { + IEnumerable rules = new Workflow[0]; + return Task.FromResult(rules); } } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/Persistent/PersistentWorkflowsResolveContributor.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/Persistent/PersistentWorkflowsResolveContributor.cs index 3614369cd..86641062f 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/Persistent/PersistentWorkflowsResolveContributor.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/Persistent/PersistentWorkflowsResolveContributor.cs @@ -2,33 +2,32 @@ using System.Threading.Tasks; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.Rules.RulesEngine.Persistent +namespace LINGYUN.Abp.Rules.RulesEngine.Persistent; + +public class PersistentWorkflowsResolveContributor : WorkflowsResolveContributorBase, ITransientDependency { - public class PersistentWorkflowsResolveContributor : WorkflowsResolveContributorBase, ITransientDependency - { - public override string Name => "Persistent"; + public override string Name => "Persistent"; - public PersistentWorkflowsResolveContributor() - { - } + public PersistentWorkflowsResolveContributor() + { + } - public async override Task ResolveAsync(IWorkflowsResolveContext context) - { - var store = context.ServiceProvider.GetRequiredService(); - var workflows = await store.GetWorkflowsAsync(context.Type); + public async override Task ResolveAsync(IWorkflowsResolveContext context) + { + var store = context.ServiceProvider.GetRequiredService(); + var workflows = await store.GetWorkflowsAsync(context.Type); - //foreach (var workflow in workflows ) - //{ - // if (workflow.WorkflowsToInject != null) - // { - // foreach (var injectWorkflow in workflow.WorkflowsToInject) - // { - // } - // } - //} + //foreach (var workflow in workflows ) + //{ + // if (workflow.WorkflowsToInject != null) + // { + // foreach (var injectWorkflow in workflow.WorkflowsToInject) + // { + // } + // } + //} - context.Handled = true; - context.Workflows = workflows; - } + context.Handled = true; + context.Workflows = workflows; } } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/RulesEngineContributor.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/RulesEngineContributor.cs index 08b5b331b..61075e484 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/RulesEngineContributor.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/RulesEngineContributor.cs @@ -7,61 +7,60 @@ using System.Threading.Tasks; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.Rules.RulesEngine +namespace LINGYUN.Abp.Rules.RulesEngine; + +public class RulesEngineContributor : RuleContributorBase, ISingletonDependency { - public class RulesEngineContributor : RuleContributorBase, ISingletonDependency + private readonly IRulesEngine _ruleEngine; + private readonly IWorkflowsResolver _workflowRulesResolver; + + public RulesEngineContributor(IWorkflowsResolver workflowRulesResolver) { - private readonly IRulesEngine _ruleEngine; - private readonly IWorkflowsResolver _workflowRulesResolver; + _workflowRulesResolver = workflowRulesResolver; + } - public RulesEngineContributor(IWorkflowsResolver workflowRulesResolver) - { - _workflowRulesResolver = workflowRulesResolver; - } + public override void Initialize(RulesInitializationContext context) + { + _workflowRulesResolver.Initialize(context); + } + + public override async Task ExecuteAsync(T input, object[] @params = null, CancellationToken cancellationToken = default) + { + var result = await _workflowRulesResolver.ResolveWorkflowsAsync(typeof(T)); - public override void Initialize(RulesInitializationContext context) + if (result.Workflows.Any()) { - _workflowRulesResolver.Initialize(context); + await ExecuteRulesAsync(input, result.Workflows.ToArray(), @params); } + } - public override async Task ExecuteAsync(T input, object[] @params = null, CancellationToken cancellationToken = default) - { - var result = await _workflowRulesResolver.ResolveWorkflowsAsync(typeof(T)); + public override void Shutdown() + { + _workflowRulesResolver.Shutdown(); + } - if (result.Workflows.Any()) - { - await ExecuteRulesAsync(input, result.Workflows.ToArray(), @params); - } - } + protected async virtual Task ExecuteRulesAsync(T input, Workflow[] workflows, object[] @params = null) + { + // TODO: 性能缺陷 规则文件每一次调用都会重复编译 + _ruleEngine.AddOrUpdateWorkflow(workflows); - public override void Shutdown() + // 传入参与验证的实体参数 + var inputs = new List() + { + input + }; + if (@params != null && @params.Any()) { - _workflowRulesResolver.Shutdown(); + inputs.AddRange(@params); } + // 其他参数以此类推 - protected async virtual Task ExecuteRulesAsync(T input, Workflow[] workflows, object[] @params = null) + foreach (var workflow in workflows) { - // TODO: 性能缺陷 规则文件每一次调用都会重复编译 - _ruleEngine.AddOrUpdateWorkflow(workflows); - - // 传入参与验证的实体参数 - var inputs = new List() - { - input - }; - if (@params != null && @params.Any()) - { - inputs.AddRange(@params); - } - // 其他参数以此类推 - - foreach (var workflow in workflows) - { - // 执行当前的规则 - var ruleResult = await _ruleEngine.ExecuteAllRulesAsync(workflow.WorkflowName, inputs.ToArray()); - // 用户自定义扩展方法,规则校验错误抛出异常 - ruleResult.ThrowOfFaildExecute(); - } + // 执行当前的规则 + var ruleResult = await _ruleEngine.ExecuteAllRulesAsync(workflow.WorkflowName, inputs.ToArray()); + // 用户自定义扩展方法,规则校验错误抛出异常 + ruleResult.ThrowOfFaildExecute(); } } } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/WorkflowsResolveContext.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/WorkflowsResolveContext.cs index 8b9333ca6..78613dd74 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/WorkflowsResolveContext.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/WorkflowsResolveContext.cs @@ -5,26 +5,25 @@ using System.Linq; using Volo.Abp; -namespace LINGYUN.Abp.Rules.RulesEngine +namespace LINGYUN.Abp.Rules.RulesEngine; + +public class WorkflowsResolveContext : IWorkflowsResolveContext { - public class WorkflowsResolveContext : IWorkflowsResolveContext - { - public Type Type { get; } - public IServiceProvider ServiceProvider { get; } - public IEnumerable Workflows { get; set; } - public bool Handled { get; set; } + public Type Type { get; } + public IServiceProvider ServiceProvider { get; } + public IEnumerable Workflows { get; set; } + public bool Handled { get; set; } - public bool HasResolved() - { - return Handled && Workflows?.Any() == true; - } + public bool HasResolved() + { + return Handled && Workflows?.Any() == true; + } - public WorkflowsResolveContext( - [NotNull] Type type, - IServiceProvider serviceProvider) - { - Type = Check.NotNull(type, nameof(type)); - ServiceProvider = serviceProvider; - } + public WorkflowsResolveContext( + [NotNull] Type type, + IServiceProvider serviceProvider) + { + Type = Check.NotNull(type, nameof(type)); + ServiceProvider = serviceProvider; } } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/WorkflowsResolveContributorBase.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/WorkflowsResolveContributorBase.cs index addf28fda..7aafe43f5 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/WorkflowsResolveContributorBase.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/WorkflowsResolveContributorBase.cs @@ -1,18 +1,17 @@ using System.Threading.Tasks; -namespace LINGYUN.Abp.Rules.RulesEngine +namespace LINGYUN.Abp.Rules.RulesEngine; + +public abstract class WorkflowsResolveContributorBase : IWorkflowsResolveContributor { - public abstract class WorkflowsResolveContributorBase : IWorkflowsResolveContributor - { - public abstract string Name { get; } + public abstract string Name { get; } - public virtual void Initialize(RulesInitializationContext context) - { - } - public abstract Task ResolveAsync(IWorkflowsResolveContext context); + public virtual void Initialize(RulesInitializationContext context) + { + } + public abstract Task ResolveAsync(IWorkflowsResolveContext context); - public virtual void Shutdown() - { - } + public virtual void Shutdown() + { } } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/WorkflowsResolveResult.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/WorkflowsResolveResult.cs index 03ffa2908..8ed7bb79f 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/WorkflowsResolveResult.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/WorkflowsResolveResult.cs @@ -1,18 +1,17 @@ using RulesEngine.Models; using System.Collections.Generic; -namespace LINGYUN.Abp.Rules.RulesEngine +namespace LINGYUN.Abp.Rules.RulesEngine; + +public class WorkflowsResolveResult { - public class WorkflowsResolveResult - { - public List Workflows { get; set; } + public List Workflows { get; set; } - public List AppliedResolvers { get; } + public List AppliedResolvers { get; } - public WorkflowsResolveResult() - { - AppliedResolvers = new List(); - Workflows = new List(); - } + public WorkflowsResolveResult() + { + AppliedResolvers = new List(); + Workflows = new List(); } } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/WorkflowsResolver.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/WorkflowsResolver.cs index 8deeb38a2..4637a9aaa 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/WorkflowsResolver.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/LINGYUN/Abp/Rules/RulesEngine/WorkflowsResolver.cs @@ -4,64 +4,63 @@ using System.Threading.Tasks; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.Rules.RulesEngine +namespace LINGYUN.Abp.Rules.RulesEngine; + +public class WorkflowsResolver : IWorkflowsResolver, ITransientDependency { - public class WorkflowsResolver : IWorkflowsResolver, ITransientDependency + private readonly IServiceScopeFactory _serviceScopeFactory; + private readonly AbpRulesEngineResolveOptions _options; + + public WorkflowsResolver( + IServiceScopeFactory serviceScopeFactory, + IOptions options) { - private readonly IServiceScopeFactory _serviceScopeFactory; - private readonly AbpRulesEngineResolveOptions _options; + _options = options.Value; + _serviceScopeFactory = serviceScopeFactory; + } - public WorkflowsResolver( - IServiceScopeFactory serviceScopeFactory, - IOptions options) + public virtual void Initialize(RulesInitializationContext context) + { + foreach (var workflowRulesResolver in _options.WorkflowsResolvers) { - _options = options.Value; - _serviceScopeFactory = serviceScopeFactory; + workflowRulesResolver.Initialize(context); } + } - public virtual void Initialize(RulesInitializationContext context) - { - foreach (var workflowRulesResolver in _options.WorkflowsResolvers) - { - workflowRulesResolver.Initialize(context); - } - } + public async virtual Task ResolveWorkflowsAsync(Type type) + { + var result = new WorkflowsResolveResult(); - public async virtual Task ResolveWorkflowsAsync(Type type) + using (var serviceScope = _serviceScopeFactory.CreateScope()) { - var result = new WorkflowsResolveResult(); + var context = new WorkflowsResolveContext(type, serviceScope.ServiceProvider); - using (var serviceScope = _serviceScopeFactory.CreateScope()) + foreach (var workflowRulesResolver in _options.WorkflowsResolvers) { - var context = new WorkflowsResolveContext(type, serviceScope.ServiceProvider); + await workflowRulesResolver.ResolveAsync(context); - foreach (var workflowRulesResolver in _options.WorkflowsResolvers) - { - await workflowRulesResolver.ResolveAsync(context); + result.AppliedResolvers.Add(workflowRulesResolver.Name); - result.AppliedResolvers.Add(workflowRulesResolver.Name); + if (context.HasResolved()) + { + result.Workflows.AddRange(context.Workflows); - if (context.HasResolved()) + if (!_options.MergingWorkflows) { - result.Workflows.AddRange(context.Workflows); - - if (!_options.MergingWorkflows) - { - break; - } + break; } } } - - return result; } - public virtual void Shutdown() + return result; + } + + public virtual void Shutdown() + { + foreach (var workflowRulesResolver in _options.WorkflowsResolvers) { - foreach (var workflowRulesResolver in _options.WorkflowsResolvers) - { - workflowRulesResolver.Shutdown(); - } + workflowRulesResolver.Shutdown(); } } } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/RulesEngine/ListofRuleResultTreeExtension.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/RulesEngine/ListofRuleResultTreeExtension.cs index fc708c330..da1906321 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/RulesEngine/ListofRuleResultTreeExtension.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules.RulesEngine/RulesEngine/ListofRuleResultTreeExtension.cs @@ -6,71 +6,70 @@ using System.Text; using Volo.Abp.Validation; -namespace RulesEngine +namespace RulesEngine; + +public static class ListofRuleResultTreeExtension { - public static class ListofRuleResultTreeExtension + public static void ThrowOfFaildExecute(this IEnumerable ruleResultTrees) { - public static void ThrowOfFaildExecute(this IEnumerable ruleResultTrees) - { - List validationResults = new List(); + List validationResults = new List(); - ruleResultTrees.WrapValidationResult(validationResults); + ruleResultTrees.WrapValidationResult(validationResults); - if (validationResults.Any()) - { - throw new AbpValidationException("一个或多个规则未通过", validationResults); - } + if (validationResults.Any()) + { + throw new AbpValidationException("一个或多个规则未通过", validationResults); } + } - private static void WrapValidationResult(this IEnumerable ruleResultTrees, List validationResults) - { - var failedResults = ruleResultTrees.Where(rule => !rule.IsSuccess).ToArray(); + private static void WrapValidationResult(this IEnumerable ruleResultTrees, List validationResults) + { + var failedResults = ruleResultTrees.Where(rule => !rule.IsSuccess).ToArray(); - foreach (var failedResult in failedResults) + foreach (var failedResult in failedResults) + { + string member = null; + var errorBuilder = new StringBuilder(36); + if (!failedResult.ExceptionMessage.IsNullOrWhiteSpace()) { - string member = null; - var errorBuilder = new StringBuilder(36); - if (!failedResult.ExceptionMessage.IsNullOrWhiteSpace()) - { - errorBuilder.AppendLine(failedResult.ExceptionMessage); - } - - // TODO: 需要修改源代码, ChildResults的验证错误个人认为有必要展示出来 - if (failedResult.ChildResults != null && failedResult.ChildResults.Any()) - { - errorBuilder.Append(failedResult.ChildResults.GetErrorMessage(out member)); - } + errorBuilder.AppendLine(failedResult.ExceptionMessage); + } - validationResults.Add(new ValidationResult( - errorBuilder.ToString().TrimEnd(), - new string[] { member ?? failedResult.Rule?.Properties?.GetOrDefault("Property")?.ToString() ?? "input" })); + // TODO: 需要修改源代码, ChildResults的验证错误个人认为有必要展示出来 + if (failedResult.ChildResults != null && failedResult.ChildResults.Any()) + { + errorBuilder.Append(failedResult.ChildResults.GetErrorMessage(out member)); } + + validationResults.Add(new ValidationResult( + errorBuilder.ToString().TrimEnd(), + new string[] { member ?? failedResult.Rule?.Properties?.GetOrDefault("Property")?.ToString() ?? "input" })); } + } - private static string GetErrorMessage(this IEnumerable ruleResultTrees, out string member) + private static string GetErrorMessage(this IEnumerable ruleResultTrees, out string member) + { + member = null; + var errorBuilder = new StringBuilder(36); + var failedResults = ruleResultTrees.Where(rule => !rule.IsSuccess).ToArray(); + + for (int index = 0; index < failedResults.Length; index++) { - member = null; - var errorBuilder = new StringBuilder(36); - var failedResults = ruleResultTrees.Where(rule => !rule.IsSuccess).ToArray(); + member = failedResults[index].Rule?.Properties?.GetOrDefault("Property")?.ToString(); - for (int index = 0; index < failedResults.Length; index++) + if (!failedResults[index].ExceptionMessage.IsNullOrWhiteSpace()) { - member = failedResults[index].Rule?.Properties?.GetOrDefault("Property")?.ToString(); - - if (!failedResults[index].ExceptionMessage.IsNullOrWhiteSpace()) - { - errorBuilder.AppendLine(failedResults[index].ExceptionMessage); - } - - if (failedResults[index].ChildResults != null && failedResults[index].ChildResults.Any()) - { - errorBuilder.Append(failedResults[index].ChildResults.GetErrorMessage(out member)); - } + errorBuilder.AppendLine(failedResults[index].ExceptionMessage); } - return errorBuilder.ToString(); + if (failedResults[index].ChildResults != null && failedResults[index].ChildResults.Any()) + { + errorBuilder.Append(failedResults[index].ChildResults.GetErrorMessage(out member)); + } } + + return errorBuilder.ToString(); } } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN.Abp.Rules.csproj b/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN.Abp.Rules.csproj index 6338ff173..94ed0c3cc 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN.Abp.Rules.csproj +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN.Abp.Rules.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Rules + LINGYUN.Abp.Rules + false + false + false diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/AbpRulesModule.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/AbpRulesModule.cs index 7910a7ef6..0ee28d0e6 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/AbpRulesModule.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/AbpRulesModule.cs @@ -3,24 +3,23 @@ using Volo.Abp.Modularity; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.Rules +namespace LINGYUN.Abp.Rules; + +[DependsOn( + typeof(AbpMultiTenancyModule))] +public class AbpRulesModule : AbpModule { - [DependsOn( - typeof(AbpMultiTenancyModule))] - public class AbpRulesModule : AbpModule + public override void OnPostApplicationInitialization(ApplicationInitializationContext context) { - public override void OnPostApplicationInitialization(ApplicationInitializationContext context) - { - context.ServiceProvider - .GetRequiredService() - .Initialize(); - } + context.ServiceProvider + .GetRequiredService() + .Initialize(); + } - public override void OnApplicationShutdown(ApplicationShutdownContext context) - { - context.ServiceProvider - .GetRequiredService() - .Shutdown(); - } + public override void OnApplicationShutdown(ApplicationShutdownContext context) + { + context.ServiceProvider + .GetRequiredService() + .Shutdown(); } } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/AbpRulesOptions.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/AbpRulesOptions.cs index 52c801958..cc08541f8 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/AbpRulesOptions.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/AbpRulesOptions.cs @@ -1,14 +1,13 @@ using Volo.Abp.Collections; -namespace LINGYUN.Abp.Rules +namespace LINGYUN.Abp.Rules; + +public class AbpRulesOptions { - public class AbpRulesOptions - { - public ITypeList Contributors { get; } + public ITypeList Contributors { get; } - public AbpRulesOptions() - { - Contributors = new TypeList(); - } + public AbpRulesOptions() + { + Contributors = new TypeList(); } } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/IRuleContributor.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/IRuleContributor.cs index 62623fabd..24b410641 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/IRuleContributor.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/IRuleContributor.cs @@ -1,14 +1,13 @@ using System.Threading; using System.Threading.Tasks; -namespace LINGYUN.Abp.Rules +namespace LINGYUN.Abp.Rules; + +public interface IRuleContributor { - public interface IRuleContributor - { - void Initialize(RulesInitializationContext context); + void Initialize(RulesInitializationContext context); - Task ExecuteAsync(T input, object[] @params = null, CancellationToken cancellationToken = default); + Task ExecuteAsync(T input, object[] @params = null, CancellationToken cancellationToken = default); - void Shutdown(); - } + void Shutdown(); } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/IRuleProvider.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/IRuleProvider.cs index 87889a638..30191df5e 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/IRuleProvider.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/IRuleProvider.cs @@ -1,10 +1,9 @@ using System.Threading; using System.Threading.Tasks; -namespace LINGYUN.Abp.Rules +namespace LINGYUN.Abp.Rules; + +public interface IRuleProvider { - public interface IRuleProvider - { - Task ExecuteAsync(T input, object[] @params = null, CancellationToken cancellationToken = default); - } + Task ExecuteAsync(T input, object[] @params = null, CancellationToken cancellationToken = default); } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/RuleContributorBase.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/RuleContributorBase.cs index 5a3639f9b..fd5cb787c 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/RuleContributorBase.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/RuleContributorBase.cs @@ -3,29 +3,28 @@ using System.Threading; using System.Threading.Tasks; -namespace LINGYUN.Abp.Rules +namespace LINGYUN.Abp.Rules; + +public abstract class RuleContributorBase : IRuleContributor { - public abstract class RuleContributorBase : IRuleContributor - { - public ILogger Logger { get; protected set; } + public ILogger Logger { get; protected set; } - protected RuleContributorBase() - { - Logger = NullLogger.Instance; - } + protected RuleContributorBase() + { + Logger = NullLogger.Instance; + } - public virtual void Initialize(RulesInitializationContext context) - { - } + public virtual void Initialize(RulesInitializationContext context) + { + } - public virtual Task ExecuteAsync(T input, object[] @params = null, CancellationToken cancellationToken = default) - { - return Task.CompletedTask; - } + public virtual Task ExecuteAsync(T input, object[] @params = null, CancellationToken cancellationToken = default) + { + return Task.CompletedTask; + } - public virtual void Shutdown() - { + public virtual void Shutdown() + { - } } } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/RuleIdGenerator.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/RuleIdGenerator.cs index e09df6344..df407aa2f 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/RuleIdGenerator.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/RuleIdGenerator.cs @@ -2,44 +2,43 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.Rules +namespace LINGYUN.Abp.Rules; + +public class RuleIdGenerator : ISingletonDependency { - public class RuleIdGenerator : ISingletonDependency + private readonly ICurrentTenant _currentTenant; + + public RuleIdGenerator( + ICurrentTenant currentTenant) { - private readonly ICurrentTenant _currentTenant; + _currentTenant = currentTenant; + } - public RuleIdGenerator( - ICurrentTenant currentTenant) - { - _currentTenant = currentTenant; - } + public virtual int CreateRuleId(Type type, bool ignoreMultiTenancy = false) + { + var typeId = type.GetHashCode(); - public virtual int CreateRuleId(Type type, bool ignoreMultiTenancy = false) + if (!ignoreMultiTenancy) { - var typeId = type.GetHashCode(); - - if (!ignoreMultiTenancy) + if (_currentTenant.Id.HasValue) { - if (_currentTenant.Id.HasValue) - { - return _currentTenant.Id.GetHashCode() & typeId; - } + return _currentTenant.Id.GetHashCode() & typeId; } - - return typeId; } - public virtual string CreateRuleName(Type type, bool ignoreMultiTenancy = false) + return typeId; + } + + public virtual string CreateRuleName(Type type, bool ignoreMultiTenancy = false) + { + var ruleName = type.Name; + if (!ignoreMultiTenancy) { - var ruleName = type.Name; - if (!ignoreMultiTenancy) + if (_currentTenant.Id.HasValue) { - if (_currentTenant.Id.HasValue) - { - return $"{_currentTenant.Id.Value:D}/{ruleName}"; - } + return $"{_currentTenant.Id.Value:D}/{ruleName}"; } - return ruleName; } + return ruleName; } } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/RuleProvider.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/RuleProvider.cs index f5f40da27..f339b9776 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/RuleProvider.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/RuleProvider.cs @@ -8,58 +8,57 @@ using System.Threading.Tasks; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.Rules +namespace LINGYUN.Abp.Rules; + +public class RuleProvider : IRuleProvider, ISingletonDependency { - public class RuleProvider : IRuleProvider, ISingletonDependency - { - private readonly IServiceProvider _serviceProvider; - private readonly ILogger _logger; + private readonly IServiceProvider _serviceProvider; + private readonly ILogger _logger; - private readonly IEnumerable _rulesEngineContributors; + private readonly IEnumerable _rulesEngineContributors; - public RuleProvider( - IServiceProvider serviceProvider, - IOptions options, - ILogger logger) - { - _rulesEngineContributors = options.Value - .Contributors - .Select(serviceProvider.GetRequiredService) - .Cast() - .ToArray(); + public RuleProvider( + IServiceProvider serviceProvider, + IOptions options, + ILogger logger) + { + _rulesEngineContributors = options.Value + .Contributors + .Select(serviceProvider.GetRequiredService) + .Cast() + .ToArray(); - _logger = logger; - _serviceProvider = serviceProvider; - } + _logger = logger; + _serviceProvider = serviceProvider; + } + + public async virtual Task ExecuteAsync(T input, object[] @params = null, CancellationToken cancellationToken = default) + { + _logger.LogDebug("Starting all typed rules engine."); - public async virtual Task ExecuteAsync(T input, object[] @params = null, CancellationToken cancellationToken = default) + foreach (var contributor in _rulesEngineContributors) { - _logger.LogDebug("Starting all typed rules engine."); + await contributor.ExecuteAsync(input, @params, cancellationToken); + } - foreach (var contributor in _rulesEngineContributors) - { - await contributor.ExecuteAsync(input, @params, cancellationToken); - } + _logger.LogDebug("Executed all typed rules engine."); + } - _logger.LogDebug("Executed all typed rules engine."); - } + internal void Initialize() + { + var context = new RulesInitializationContext(_serviceProvider); - internal void Initialize() + foreach (var contributor in _rulesEngineContributors) { - var context = new RulesInitializationContext(_serviceProvider); - - foreach (var contributor in _rulesEngineContributors) - { - contributor.Initialize(context); - } + contributor.Initialize(context); } + } - internal void Shutdown() + internal void Shutdown() + { + foreach (var contributor in _rulesEngineContributors) { - foreach (var contributor in _rulesEngineContributors) - { - contributor.Shutdown(); - } + contributor.Shutdown(); } } } diff --git a/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/RulesInitializationContext.cs b/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/RulesInitializationContext.cs index b2a209127..d5cf9700c 100644 --- a/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/RulesInitializationContext.cs +++ b/aspnet-core/framework/rules/LINGYUN.Abp.Rules/LINGYUN/Abp/Rules/RulesInitializationContext.cs @@ -1,20 +1,19 @@ using System; using Volo.Abp.Data; -namespace LINGYUN.Abp.Rules -{ - public class RulesInitializationContext : IServiceProvider, IHasExtraProperties - { - public IServiceProvider ServiceProvider { get; } +namespace LINGYUN.Abp.Rules; - public ExtraPropertyDictionary ExtraProperties { get; } +public class RulesInitializationContext : IServiceProvider, IHasExtraProperties +{ + public IServiceProvider ServiceProvider { get; } - internal RulesInitializationContext(IServiceProvider serviceProvider) - { - ServiceProvider = serviceProvider; - ExtraProperties = new ExtraPropertyDictionary(); - } + public ExtraPropertyDictionary ExtraProperties { get; } - public object GetService(Type serviceType) => ServiceProvider.GetService(serviceType); + internal RulesInitializationContext(IServiceProvider serviceProvider) + { + ServiceProvider = serviceProvider; + ExtraProperties = new ExtraPropertyDictionary(); } + + public object GetService(Type serviceType) => ServiceProvider.GetService(serviceType); } diff --git a/aspnet-core/framework/security/LINGYUN.Abp.Claims.Mapping/LINGYUN.Abp.Claims.Mapping.csproj b/aspnet-core/framework/security/LINGYUN.Abp.Claims.Mapping/LINGYUN.Abp.Claims.Mapping.csproj index 0e279cec7..31b7f14fd 100644 --- a/aspnet-core/framework/security/LINGYUN.Abp.Claims.Mapping/LINGYUN.Abp.Claims.Mapping.csproj +++ b/aspnet-core/framework/security/LINGYUN.Abp.Claims.Mapping/LINGYUN.Abp.Claims.Mapping.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Claims.Mapping + LINGYUN.Abp.Claims.Mapping + false + false + false diff --git a/aspnet-core/framework/security/LINGYUN.Abp.Security/LINGYUN.Abp.Security.csproj b/aspnet-core/framework/security/LINGYUN.Abp.Security/LINGYUN.Abp.Security.csproj index 0e279cec7..79f966370 100644 --- a/aspnet-core/framework/security/LINGYUN.Abp.Security/LINGYUN.Abp.Security.csproj +++ b/aspnet-core/framework/security/LINGYUN.Abp.Security/LINGYUN.Abp.Security.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Security + LINGYUN.Abp.Security + false + false + false diff --git a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN.Abp.SettingManagement.Application.Contracts.csproj b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN.Abp.SettingManagement.Application.Contracts.csproj index 52d8095d5..bd95d4edd 100644 --- a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN.Abp.SettingManagement.Application.Contracts.csproj +++ b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN.Abp.SettingManagement.Application.Contracts.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.SettingManagement.Application.Contracts + LINGYUN.Abp.SettingManagement.Application.Contracts + false + false + false diff --git a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/AbpSettingManagementApplicationContractsModule.cs b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/AbpSettingManagementApplicationContractsModule.cs index a239c8666..02f7d9f75 100644 --- a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/AbpSettingManagementApplicationContractsModule.cs +++ b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/AbpSettingManagementApplicationContractsModule.cs @@ -8,56 +8,55 @@ using Volo.Abp.SettingManagement.Localization; using Volo.Abp.VirtualFileSystem; -namespace LINGYUN.Abp.SettingManagement +namespace LINGYUN.Abp.SettingManagement; + +[DependsOn(typeof(AbpDddApplicationContractsModule))] +[DependsOn(typeof(AbpSettingManagementDomainSharedModule))] +public class AbpSettingManagementApplicationContractsModule : AbpModule { - [DependsOn(typeof(AbpDddApplicationContractsModule))] - [DependsOn(typeof(AbpSettingManagementDomainSharedModule))] - public class AbpSettingManagementApplicationContractsModule : AbpModule + public override void PreConfigureServices(ServiceConfigurationContext context) + { + AutoAddSettingProviders(context.Services); + } + + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void PreConfigureServices(ServiceConfigurationContext context) + Configure(options => { - AutoAddSettingProviders(context.Services); - } + options.FileSets.AddEmbedded(); + }); - public override void ConfigureServices(ServiceConfigurationContext context) + Configure(options => { - Configure(options => - { - options.FileSets.AddEmbedded(); - }); + options.Resources + .Get() + .AddVirtualJson("/LINGYUN/Abp/SettingManagement/Localization/ApplicationContracts"); + }); + } - Configure(options => - { - options.Resources - .Get() - .AddVirtualJson("/LINGYUN/Abp/SettingManagement/Localization/ApplicationContracts"); - }); - } + private static void AutoAddSettingProviders(IServiceCollection services) + { + var userSettingProviders = new List(); + var globalSettingProviders = new List(); - private static void AutoAddSettingProviders(IServiceCollection services) + services.OnRegistered(context => { - var userSettingProviders = new List(); - var globalSettingProviders = new List(); - - services.OnRegistered(context => + if (typeof(IUserSettingAppService).IsAssignableFrom(context.ImplementationType) && + context.ImplementationType.Name.EndsWith("AppService")) { - if (typeof(IUserSettingAppService).IsAssignableFrom(context.ImplementationType) && - context.ImplementationType.Name.EndsWith("AppService")) - { - userSettingProviders.Add(context.ImplementationType); - } - if (typeof(IReadonlySettingAppService).IsAssignableFrom(context.ImplementationType) && - context.ImplementationType.Name.EndsWith("AppService")) - { - globalSettingProviders.Add(context.ImplementationType); - } - }); - - services.Configure(options => + userSettingProviders.Add(context.ImplementationType); + } + if (typeof(IReadonlySettingAppService).IsAssignableFrom(context.ImplementationType) && + context.ImplementationType.Name.EndsWith("AppService")) { - options.UserSettingProviders.AddIfNotContains(userSettingProviders); - options.GlobalSettingProviders.AddIfNotContains(globalSettingProviders); - }); - } + globalSettingProviders.Add(context.ImplementationType); + } + }); + + services.Configure(options => + { + options.UserSettingProviders.AddIfNotContains(userSettingProviders); + options.GlobalSettingProviders.AddIfNotContains(globalSettingProviders); + }); } } diff --git a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/AbpSettingManagementPermissionProvider.cs b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/AbpSettingManagementPermissionProvider.cs index 5a44604e7..d306cbd28 100644 --- a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/AbpSettingManagementPermissionProvider.cs +++ b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/AbpSettingManagementPermissionProvider.cs @@ -2,21 +2,20 @@ using Volo.Abp.Localization; using Volo.Abp.SettingManagement.Localization; -namespace LINGYUN.Abp.SettingManagement +namespace LINGYUN.Abp.SettingManagement; + +public class AbpSettingManagementPermissionProvider : PermissionDefinitionProvider { - public class AbpSettingManagementPermissionProvider : PermissionDefinitionProvider + public override void Define(IPermissionDefinitionContext context) { - public override void Define(IPermissionDefinitionContext context) - { - var settingPermissionGroup = context.AddGroup(AbpSettingManagementPermissions.GroupName, L("Permission:SettingManagement")); - - var settingPermissions = settingPermissionGroup.AddPermission(AbpSettingManagementPermissions.Settings.Default, L("Permission:Settings")); - settingPermissions.AddChild(AbpSettingManagementPermissions.Settings.Manager, L("Permission:Manager")); - } + var settingPermissionGroup = context.AddGroup(AbpSettingManagementPermissions.GroupName, L("Permission:SettingManagement")); + + var settingPermissions = settingPermissionGroup.AddPermission(AbpSettingManagementPermissions.Settings.Default, L("Permission:Settings")); + settingPermissions.AddChild(AbpSettingManagementPermissions.Settings.Manager, L("Permission:Manager")); + } - private static LocalizableString L(string name) - { - return LocalizableString.Create(name); - } + private static LocalizableString L(string name) + { + return LocalizableString.Create(name); } } diff --git a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/AbpSettingManagementPermissions.cs b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/AbpSettingManagementPermissions.cs index 55bc01414..bdb78ae89 100644 --- a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/AbpSettingManagementPermissions.cs +++ b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/AbpSettingManagementPermissions.cs @@ -1,16 +1,15 @@ using System; -namespace LINGYUN.Abp.SettingManagement +namespace LINGYUN.Abp.SettingManagement; + +public class AbpSettingManagementPermissions { - public class AbpSettingManagementPermissions - { - public const string GroupName = "AbpSettingManagement"; + public const string GroupName = "AbpSettingManagement"; - public class Settings - { - public const string Default = GroupName + ".Settings"; + public class Settings + { + public const string Default = GroupName + ".Settings"; - public const string Manager = GroupName + ".Manager"; - } + public const string Manager = GroupName + ".Manager"; } } diff --git a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/AbpSettingManagementRemoteServiceConsts.cs b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/AbpSettingManagementRemoteServiceConsts.cs index 170b673c2..5d0b1a59f 100644 --- a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/AbpSettingManagementRemoteServiceConsts.cs +++ b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/AbpSettingManagementRemoteServiceConsts.cs @@ -1,8 +1,7 @@ -namespace LINGYUN.Abp.SettingManagement +namespace LINGYUN.Abp.SettingManagement; + +public class AbpSettingManagementRemoteServiceConsts { - public class AbpSettingManagementRemoteServiceConsts - { - public const string ModuleName = "setting-management"; - public const string RemoteServiceName = "AbpSettingManagement"; - } + public const string ModuleName = "setting-management"; + public const string RemoteServiceName = "AbpSettingManagement"; } \ No newline at end of file diff --git a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/OptionDto.cs b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/OptionDto.cs index 3bfc6eabd..4c5ab59be 100644 --- a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/OptionDto.cs +++ b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/OptionDto.cs @@ -1,19 +1,18 @@ -namespace LINGYUN.Abp.SettingManagement +namespace LINGYUN.Abp.SettingManagement; + +public class OptionDto { - public class OptionDto - { - public string Name { get; set; } - public string Value { get; set; } + public string Name { get; set; } + public string Value { get; set; } - public OptionDto() - { + public OptionDto() + { - } + } - public OptionDto(string name, string value) - { - Name = name; - Value = value; - } + public OptionDto(string name, string value) + { + Name = name; + Value = value; } } diff --git a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/SettingDetailsDto.cs b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/SettingDetailsDto.cs index 010ea2f41..1c488302d 100644 --- a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/SettingDetailsDto.cs +++ b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/SettingDetailsDto.cs @@ -1,78 +1,77 @@ using System.Collections.Generic; using System.Linq; -namespace LINGYUN.Abp.SettingManagement +namespace LINGYUN.Abp.SettingManagement; + +public class SettingDetailsDto { - public class SettingDetailsDto - { - public string Name { get; set; } + public string Name { get; set; } - public string DisplayName { get; set; } + public string DisplayName { get; set; } - public string Description { get; set; } + public string Description { get; set; } - public string Value { get; set; } + public string Value { get; set; } - public string DefaultValue { get; set; } + public string DefaultValue { get; set; } - public bool IsEncrypted { get; set; } + public bool IsEncrypted { get; set; } - public ValueType ValueType { get; set; } - /// - /// 插槽,前端定义控件 - /// - public string Slot { get; set; } - /// - /// 选项列表,仅当 ValueType 为 Option有效 - /// - public List Options { get; set; } = new List(); + public ValueType ValueType { get; set; } + /// + /// 插槽,前端定义控件 + /// + public string Slot { get; set; } + /// + /// 选项列表,仅当 ValueType 为 Option有效 + /// + public List Options { get; set; } = new List(); - public List Providers { get; set; } = new List(); + public List Providers { get; set; } = new List(); - public List RequiredFeatures { get; set; } = new List(); + public List RequiredFeatures { get; set; } = new List(); - public List RequiredPermissions { get; set; } = new List(); + public List RequiredPermissions { get; set; } = new List(); - public SettingDetailsDto WithSlot(string slot) - { - Slot = slot; + public SettingDetailsDto WithSlot(string slot) + { + Slot = slot; - return this; - } + return this; + } - public SettingDetailsDto AddOption(string name, string value) + public SettingDetailsDto AddOption(string name, string value) + { + Options.Add(new OptionDto { - Options.Add(new OptionDto - { - Name = name, - Value = value - }); + Name = name, + Value = value + }); - return this; - } + return this; + } - public SettingDetailsDto AddOptions(IEnumerable options) - { - Options.AddRange(options); - return this; - } + public SettingDetailsDto AddOptions(IEnumerable options) + { + Options.AddRange(options); + return this; + } - public SettingDetailsDto RequiredPermission(params string[] permissions) + public SettingDetailsDto RequiredPermission(params string[] permissions) + { + if (permissions.Any()) { - if (permissions.Any()) - { - RequiredPermissions.AddRange(permissions); - } - return this; + RequiredPermissions.AddRange(permissions); } + return this; + } - public SettingDetailsDto RequiredFeature(params string[] features) + public SettingDetailsDto RequiredFeature(params string[] features) + { + if (features.Any()) { - if (features.Any()) - { - RequiredFeatures.AddRange(features); - } - return this; + RequiredFeatures.AddRange(features); } + return this; } } \ No newline at end of file diff --git a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/SettingDto.cs b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/SettingDto.cs index 2963d6f6a..7288598a3 100644 --- a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/SettingDto.cs +++ b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/SettingDto.cs @@ -4,61 +4,61 @@ using System.Linq; using Volo.Abp.Settings; -namespace LINGYUN.Abp.SettingManagement +namespace LINGYUN.Abp.SettingManagement; + +public class SettingDto { - public class SettingDto - { - public string DisplayName { get; set; } + public string DisplayName { get; set; } - public string Description { get; set; } + public string Description { get; set; } - public List Details { get; set; } = new List(); + public List Details { get; set; } = new List(); - + - public SettingDto() - { + public SettingDto() + { - } + } - public SettingDto(string displayName, string description = "") - { - DisplayName = displayName; - Description = description; - } + public SettingDto(string displayName, string description = "") + { + DisplayName = displayName; + Description = description; + } #nullable enable - public SettingDetailsDto? AddDetail( - SettingDefinition setting, - IStringLocalizerFactory factory, - string value, - ValueType type, - string keepProvider = "") + public SettingDetailsDto? AddDetail( + SettingDefinition setting, + IStringLocalizerFactory factory, + string value, + ValueType type, + string keepProvider = "") + { + if (setting.Providers.Any() && + !keepProvider.IsNullOrWhiteSpace() && + !setting.Providers.Any(p => p.Equals(keepProvider))) { - if (setting.Providers.Any() && - !keepProvider.IsNullOrWhiteSpace() && - !setting.Providers.Any(p => p.Equals(keepProvider))) - { - return null; - } - var detail = new SettingDetailsDto() - { - DefaultValue = setting.DefaultValue, - IsEncrypted = setting.IsEncrypted, - DisplayName = setting.DisplayName.Localize(factory), - Name = setting.Name, - Value = value, - ValueType = type - }; - if (setting.Description != null) - { - detail.Description = setting.Description.Localize(factory); - } - detail.Providers.AddRange(setting.Providers); - Details.Add(detail); - - return detail; + return null; + } + var detail = new SettingDetailsDto() + { + DefaultValue = setting.DefaultValue, + IsEncrypted = setting.IsEncrypted, + DisplayName = setting.DisplayName.Localize(factory), + Name = setting.Name, + Value = value, + ValueType = type + }; + if (setting.Description != null) + { + detail.Description = setting.Description.Localize(factory); } + detail.Providers.AddRange(setting.Providers); + Details.Add(detail); + + return detail; } -#nullable disable } +#nullable disable + diff --git a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/SettingGroupDto.cs b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/SettingGroupDto.cs index aec50aa94..bf800e4b0 100644 --- a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/SettingGroupDto.cs +++ b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/SettingGroupDto.cs @@ -1,31 +1,30 @@ using System.Collections.Generic; -namespace LINGYUN.Abp.SettingManagement +namespace LINGYUN.Abp.SettingManagement; + +public class SettingGroupDto { - public class SettingGroupDto - { - public string DisplayName { get; set; } + public string DisplayName { get; set; } - public string Description { get; set; } + public string Description { get; set; } - public List Settings { get; set; } = new List(); + public List Settings { get; set; } = new List(); - public SettingGroupDto() - { + public SettingGroupDto() + { - } + } - public SettingGroupDto(string displayName, string description = "") - { - DisplayName = displayName; - Description = description; - } + public SettingGroupDto(string displayName, string description = "") + { + DisplayName = displayName; + Description = description; + } - public SettingDto AddSetting(string displayName, string description = "") - { - var setting = new SettingDto(displayName, description); - Settings.Add(setting); - return setting; - } + public SettingDto AddSetting(string displayName, string description = "") + { + var setting = new SettingDto(displayName, description); + Settings.Add(setting); + return setting; } } diff --git a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/SettingGroupResult.cs b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/SettingGroupResult.cs index 7a45bd595..3bd193a50 100644 --- a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/SettingGroupResult.cs +++ b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/SettingGroupResult.cs @@ -1,23 +1,22 @@ using System.Collections.Generic; using System.Linq; -namespace LINGYUN.Abp.SettingManagement +namespace LINGYUN.Abp.SettingManagement; + +public class SettingGroupResult { - public class SettingGroupResult - { - public IList Items { get; } + public IList Items { get; } - public SettingGroupResult() - { - Items = new List(); - } + public SettingGroupResult() + { + Items = new List(); + } - public void AddGroup(SettingGroupDto group) + public void AddGroup(SettingGroupDto group) + { + if (group.Settings.Any(g => g.Details.Any())) { - if (group.Settings.Any(g => g.Details.Any())) - { - Items.Add(group); - } + Items.Add(group); } } } diff --git a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/UpdateSettingDto.cs b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/UpdateSettingDto.cs index d568b4447..71176cd1a 100644 --- a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/UpdateSettingDto.cs +++ b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/UpdateSettingDto.cs @@ -2,15 +2,14 @@ using Volo.Abp.SettingManagement; using Volo.Abp.Validation; -namespace LINGYUN.Abp.SettingManagement +namespace LINGYUN.Abp.SettingManagement; + +public class UpdateSettingDto { - public class UpdateSettingDto - { - [Required] - [DynamicStringLength(typeof(SettingConsts), nameof(SettingConsts.MaxNameLength))] - public string Name { get; set; } + [Required] + [DynamicStringLength(typeof(SettingConsts), nameof(SettingConsts.MaxNameLength))] + public string Name { get; set; } - [DynamicStringLength(typeof(SettingConsts), nameof(SettingConsts.MaxValueLength))] - public string Value { get; set; } - } + [DynamicStringLength(typeof(SettingConsts), nameof(SettingConsts.MaxValueLength))] + public string Value { get; set; } } diff --git a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/UpdateSettingsDto.cs b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/UpdateSettingsDto.cs index 378ff0236..8b785c830 100644 --- a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/UpdateSettingsDto.cs +++ b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/UpdateSettingsDto.cs @@ -1,11 +1,10 @@ -namespace LINGYUN.Abp.SettingManagement +namespace LINGYUN.Abp.SettingManagement; + +public class UpdateSettingsDto { - public class UpdateSettingsDto + public UpdateSettingDto[] Settings { get; set; } + public UpdateSettingsDto() { - public UpdateSettingDto[] Settings { get; set; } - public UpdateSettingsDto() - { - Settings = new UpdateSettingDto[0]; - } + Settings = new UpdateSettingDto[0]; } } diff --git a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/ValueType.cs b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/ValueType.cs index 5ba92e13a..4ad54a458 100644 --- a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/ValueType.cs +++ b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Dto/ValueType.cs @@ -1,34 +1,33 @@ -namespace LINGYUN.Abp.SettingManagement +namespace LINGYUN.Abp.SettingManagement; + +public enum ValueType { - public enum ValueType - { - /// - /// 字符 - /// - String = 0, - /// - /// 数字 - /// - Number = 1, - /// - /// 布尔 - /// - Boolean = 2, - /// - /// 日期 - /// - Date = 3, - /// - /// 数组 - /// - Array = 4, - /// - /// 选项 - /// - Option = 5, - /// - /// 对象 - /// - Object = 10 - } + /// + /// 字符 + /// + String = 0, + /// + /// 数字 + /// + Number = 1, + /// + /// 布尔 + /// + Boolean = 2, + /// + /// 日期 + /// + Date = 3, + /// + /// 数组 + /// + Array = 4, + /// + /// 选项 + /// + Option = 5, + /// + /// 对象 + /// + Object = 10 } diff --git a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/IReadonlySettingAppService.cs b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/IReadonlySettingAppService.cs index 41dc5d98f..ea54abb49 100644 --- a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/IReadonlySettingAppService.cs +++ b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/IReadonlySettingAppService.cs @@ -1,12 +1,11 @@ using System.Threading.Tasks; using Volo.Abp.Application.Services; -namespace LINGYUN.Abp.SettingManagement +namespace LINGYUN.Abp.SettingManagement; + +public interface IReadonlySettingAppService : IApplicationService { - public interface IReadonlySettingAppService : IApplicationService - { - Task GetAllForGlobalAsync(); + Task GetAllForGlobalAsync(); - Task GetAllForCurrentTenantAsync(); - } + Task GetAllForCurrentTenantAsync(); } diff --git a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/ISettingAppService.cs b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/ISettingAppService.cs index cccab79aa..8a00c7594 100644 --- a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/ISettingAppService.cs +++ b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/ISettingAppService.cs @@ -1,11 +1,10 @@ using System.Threading.Tasks; -namespace LINGYUN.Abp.SettingManagement +namespace LINGYUN.Abp.SettingManagement; + +public interface ISettingAppService : IReadonlySettingAppService { - public interface ISettingAppService : IReadonlySettingAppService - { - Task SetGlobalAsync(UpdateSettingsDto input); + Task SetGlobalAsync(UpdateSettingsDto input); - Task SetCurrentTenantAsync(UpdateSettingsDto input); - } + Task SetCurrentTenantAsync(UpdateSettingsDto input); } diff --git a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/IUserSettingAppService.cs b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/IUserSettingAppService.cs index 4b68c5e96..c48649a9b 100644 --- a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/IUserSettingAppService.cs +++ b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/IUserSettingAppService.cs @@ -1,12 +1,11 @@ using System.Threading.Tasks; using Volo.Abp.Application.Services; -namespace LINGYUN.Abp.SettingManagement +namespace LINGYUN.Abp.SettingManagement; + +public interface IUserSettingAppService : IApplicationService { - public interface IUserSettingAppService : IApplicationService - { - Task SetCurrentUserAsync(UpdateSettingsDto input); + Task SetCurrentUserAsync(UpdateSettingsDto input); - Task GetAllForCurrentUserAsync(); - } + Task GetAllForCurrentUserAsync(); } diff --git a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Localization/ApplicationContracts/en.json b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Localization/ApplicationContracts/en.json index a58c75c63..a19565641 100644 --- a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Localization/ApplicationContracts/en.json +++ b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Localization/ApplicationContracts/en.json @@ -31,6 +31,8 @@ "Description:Identity.TwoFactor": "TwoFactor", "DisplayName:Identity.OrganizationUnit": "OrganizationUnit", "Description:Identity.OrganizationUnit": "OrganizationUnit", + "DisplayName:Identity.Session": "Session", + "Description:Identity.Session": "Session", "DisplayName:Emailing": "Emailing", "Description:Emailing": "Emailing", "DisplayName:Emailing.Default": "Default", diff --git a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Localization/ApplicationContracts/zh-Hans.json b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Localization/ApplicationContracts/zh-Hans.json index 4e1cae356..1d65ca2eb 100644 --- a/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Localization/ApplicationContracts/zh-Hans.json +++ b/aspnet-core/framework/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/Localization/ApplicationContracts/zh-Hans.json @@ -31,6 +31,8 @@ "Description:Identity.TwoFactor": "双因素认证配置策略", "DisplayName:Identity.OrganizationUnit": "组织机构", "Description:Identity.OrganizationUnit": "组织机构配置策略", + "DisplayName:Identity.Session": "会话配置", + "Description:Identity.Session": "配置用户会话", "DisplayName:Emailing": "邮件设置", "Description:Emailing": "邮件通知相关的配置", "DisplayName:Emailing.Default": "默认配置", diff --git a/aspnet-core/framework/settings/LINGYUN.Abp.Settings/LINGYUN.Abp.Settings.csproj b/aspnet-core/framework/settings/LINGYUN.Abp.Settings/LINGYUN.Abp.Settings.csproj index b92c7215d..9b228e562 100644 --- a/aspnet-core/framework/settings/LINGYUN.Abp.Settings/LINGYUN.Abp.Settings.csproj +++ b/aspnet-core/framework/settings/LINGYUN.Abp.Settings/LINGYUN.Abp.Settings.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Settings + LINGYUN.Abp.Settings + false + false + false diff --git a/aspnet-core/framework/settings/LINGYUN.Abp.Settings/Volo/Abp/Settings/ISettingProviderExtensions.cs b/aspnet-core/framework/settings/LINGYUN.Abp.Settings/Volo/Abp/Settings/ISettingProviderExtensions.cs index e8a35633a..f0b47e2b0 100644 --- a/aspnet-core/framework/settings/LINGYUN.Abp.Settings/Volo/Abp/Settings/ISettingProviderExtensions.cs +++ b/aspnet-core/framework/settings/LINGYUN.Abp.Settings/Volo/Abp/Settings/ISettingProviderExtensions.cs @@ -3,26 +3,25 @@ using System; using System.Threading.Tasks; -namespace Volo.Abp.Settings +namespace Volo.Abp.Settings; + +public static class ISettingProviderExtensions { - public static class ISettingProviderExtensions + public static async Task GetOrDefaultAsync( + [NotNull] this ISettingProvider settingProvider, + [NotNull] string name, + [NotNull] IServiceProvider serviceProvider) { - public static async Task GetOrDefaultAsync( - [NotNull] this ISettingProvider settingProvider, - [NotNull] string name, - [NotNull] IServiceProvider serviceProvider) + Check.NotNull(settingProvider, nameof(settingProvider)); + Check.NotNull(serviceProvider, nameof(serviceProvider)); + Check.NotNullOrWhiteSpace(name, nameof(name)); + var value = await settingProvider.GetOrNullAsync(name); + if (value.IsNullOrWhiteSpace()) { - Check.NotNull(settingProvider, nameof(settingProvider)); - Check.NotNull(serviceProvider, nameof(serviceProvider)); - Check.NotNullOrWhiteSpace(name, nameof(name)); - var value = await settingProvider.GetOrNullAsync(name); - if (value.IsNullOrWhiteSpace()) - { - var settingDefintionManager = serviceProvider.GetRequiredService(); - var setting = await settingDefintionManager.GetAsync(name); - return setting.DefaultValue; - } - return value; + var settingDefintionManager = serviceProvider.GetRequiredService(); + var setting = await settingDefintionManager.GetAsync(name); + return setting.DefaultValue; } + return value; } } diff --git a/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/LINGYUN.Abp.MultiTenancy.Editions.csproj b/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/LINGYUN.Abp.MultiTenancy.Editions.csproj index afb3e1451..d6477f2e7 100644 --- a/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/LINGYUN.Abp.MultiTenancy.Editions.csproj +++ b/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/LINGYUN.Abp.MultiTenancy.Editions.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.MultiTenancy.Editions + LINGYUN.Abp.MultiTenancy.Editions + false + false + false diff --git a/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/LINGYUN/Abp/MultiTenancy/Editions/EditionClaimsPrincipalContributor.cs b/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/LINGYUN/Abp/MultiTenancy/Editions/EditionClaimsPrincipalContributor.cs index 7daab0d29..06b64dc04 100644 --- a/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/LINGYUN/Abp/MultiTenancy/Editions/EditionClaimsPrincipalContributor.cs +++ b/aspnet-core/framework/tenants/LINGYUN.Abp.MultiTenancy.Editions/LINGYUN/Abp/MultiTenancy/Editions/EditionClaimsPrincipalContributor.cs @@ -12,20 +12,6 @@ namespace LINGYUN.Abp.MultiTenancy.Editions; public class EditionClaimsPrincipalContributor : IAbpClaimsPrincipalContributor, ITransientDependency { - // https://github.com/dotnet/aspnetcore/blob/v5.0.0/src/Identity/Extensions.Core/src/UserClaimsPrincipalFactory.cs#L79 - private static string IdentityAuthenticationType => "Identity.Application"; - - protected ICurrentTenant CurrentTenant { get; } - protected IEditionConfigurationProvider EditionConfigurationProvider { get; } - - public EditionClaimsPrincipalContributor( - ICurrentTenant currentTenant, - IEditionConfigurationProvider editionConfigurationProvider) - { - CurrentTenant = currentTenant; - EditionConfigurationProvider = editionConfigurationProvider; - } - public async virtual Task ContributeAsync(AbpClaimsPrincipalContributorContext context) { if (!GlobalFeatureManager.Instance.IsEnabled()) @@ -33,18 +19,24 @@ public async virtual Task ContributeAsync(AbpClaimsPrincipalContributorContext c return; } - if (!CurrentTenant.IsAvailable) + var currentTenant = context.GetRequiredService(); + if (!currentTenant.IsAvailable) { return; } - var edition = await EditionConfigurationProvider.GetAsync(CurrentTenant.Id); - if (edition == null) + var claimsIdentity = context.ClaimsPrincipal.Identities.FirstOrDefault(); + if (claimsIdentity.FindAll(x => x.Type == AbpClaimTypes.EditionId).Any()) { return; } - var claimsIdentity = context.ClaimsPrincipal.Identities.First(x => x.AuthenticationType == IdentityAuthenticationType); + var editionConfigurationProvider = context.GetRequiredService(); + var edition = await editionConfigurationProvider.GetAsync(currentTenant.Id); + if (edition == null) + { + return; + } claimsIdentity.AddOrReplace(new Claim(AbpClaimTypes.EditionId, edition.Id.ToString())); diff --git a/aspnet-core/framework/tui-juhe/LINGYUN.Abp.TuiJuhe.SettingManagement/LINGYUN.Abp.TuiJuhe.SettingManagement.csproj b/aspnet-core/framework/tui-juhe/LINGYUN.Abp.TuiJuhe.SettingManagement/LINGYUN.Abp.TuiJuhe.SettingManagement.csproj index 58d914621..a4af93d85 100644 --- a/aspnet-core/framework/tui-juhe/LINGYUN.Abp.TuiJuhe.SettingManagement/LINGYUN.Abp.TuiJuhe.SettingManagement.csproj +++ b/aspnet-core/framework/tui-juhe/LINGYUN.Abp.TuiJuhe.SettingManagement/LINGYUN.Abp.TuiJuhe.SettingManagement.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.TuiJuhe.SettingManagement + LINGYUN.Abp.TuiJuhe.SettingManagement + false + false + false diff --git a/aspnet-core/framework/tui-juhe/LINGYUN.Abp.TuiJuhe.SettingManagement/LINGYUN/Abp/TuiJuhe/SettingManagement/AbpTuiJuheSettingManagementModule.cs b/aspnet-core/framework/tui-juhe/LINGYUN.Abp.TuiJuhe.SettingManagement/LINGYUN/Abp/TuiJuhe/SettingManagement/AbpTuiJuheSettingManagementModule.cs index c748992d8..c6e029256 100644 --- a/aspnet-core/framework/tui-juhe/LINGYUN.Abp.TuiJuhe.SettingManagement/LINGYUN/Abp/TuiJuhe/SettingManagement/AbpTuiJuheSettingManagementModule.cs +++ b/aspnet-core/framework/tui-juhe/LINGYUN.Abp.TuiJuhe.SettingManagement/LINGYUN/Abp/TuiJuhe/SettingManagement/AbpTuiJuheSettingManagementModule.cs @@ -6,43 +6,42 @@ using Volo.Abp.Modularity; using Volo.Abp.VirtualFileSystem; -namespace LINGYUN.Abp.TuiJuhe.SettingManagement +namespace LINGYUN.Abp.TuiJuhe.SettingManagement; + +[DependsOn( + typeof(AbpTuiJuheModule), + typeof(AbpAspNetCoreMvcModule))] +public class AbpTuiJuheSettingManagementModule : AbpModule { - [DependsOn( - typeof(AbpTuiJuheModule), - typeof(AbpAspNetCoreMvcModule))] - public class AbpTuiJuheSettingManagementModule : AbpModule + public override void PreConfigureServices(ServiceConfigurationContext context) { - public override void PreConfigureServices(ServiceConfigurationContext context) + PreConfigure(mvcBuilder => { - PreConfigure(mvcBuilder => - { - mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpTuiJuheSettingManagementModule).Assembly); - }); - } + mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpTuiJuheSettingManagementModule).Assembly); + }); + } - public override void ConfigureServices(ServiceConfigurationContext context) + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => { - Configure(options => - { - options.FileSets.AddEmbedded(); - }); + options.FileSets.AddEmbedded(); + }); - Configure(options => - { - options.Resources - .Get() - .AddVirtualJson("/LINGYUN/Abp/TuiJuhe/SettingManagement/Localization/Resources"); - }); + Configure(options => + { + options.Resources + .Get() + .AddVirtualJson("/LINGYUN/Abp/TuiJuhe/SettingManagement/Localization/Resources"); + }); - Configure(options => - { - options.Resources - .Get() - .AddBaseTypes( - typeof(AbpUiResource) - ); - }); - } + Configure(options => + { + options.Resources + .Get() + .AddBaseTypes( + typeof(AbpUiResource) + ); + }); } } diff --git a/aspnet-core/framework/tui-juhe/LINGYUN.Abp.TuiJuhe.SettingManagement/LINGYUN/Abp/TuiJuhe/SettingManagement/ITuiJuheSettingAppService.cs b/aspnet-core/framework/tui-juhe/LINGYUN.Abp.TuiJuhe.SettingManagement/LINGYUN/Abp/TuiJuhe/SettingManagement/ITuiJuheSettingAppService.cs index bdc6e7659..1e994ca26 100644 --- a/aspnet-core/framework/tui-juhe/LINGYUN.Abp.TuiJuhe.SettingManagement/LINGYUN/Abp/TuiJuhe/SettingManagement/ITuiJuheSettingAppService.cs +++ b/aspnet-core/framework/tui-juhe/LINGYUN.Abp.TuiJuhe.SettingManagement/LINGYUN/Abp/TuiJuhe/SettingManagement/ITuiJuheSettingAppService.cs @@ -1,8 +1,7 @@ using LINGYUN.Abp.SettingManagement; -namespace LINGYUN.Abp.TuiJuhe.SettingManagement +namespace LINGYUN.Abp.TuiJuhe.SettingManagement; + +public interface ITuiJuheSettingAppService : IReadonlySettingAppService { - public interface ITuiJuheSettingAppService : IReadonlySettingAppService - { - } } diff --git a/aspnet-core/framework/tui-juhe/LINGYUN.Abp.TuiJuhe.SettingManagement/LINGYUN/Abp/TuiJuhe/SettingManagement/TuiJuheSettingAppService.cs b/aspnet-core/framework/tui-juhe/LINGYUN.Abp.TuiJuhe.SettingManagement/LINGYUN/Abp/TuiJuhe/SettingManagement/TuiJuheSettingAppService.cs index 1d95fe631..ad1b07a3a 100644 --- a/aspnet-core/framework/tui-juhe/LINGYUN.Abp.TuiJuhe.SettingManagement/LINGYUN/Abp/TuiJuhe/SettingManagement/TuiJuheSettingAppService.cs +++ b/aspnet-core/framework/tui-juhe/LINGYUN.Abp.TuiJuhe.SettingManagement/LINGYUN/Abp/TuiJuhe/SettingManagement/TuiJuheSettingAppService.cs @@ -8,54 +8,53 @@ using Volo.Abp.SettingManagement; using Volo.Abp.Settings; -namespace LINGYUN.Abp.TuiJuhe.SettingManagement +namespace LINGYUN.Abp.TuiJuhe.SettingManagement; + +public class TuiJuheSettingAppService : ApplicationService, ITuiJuheSettingAppService { - public class TuiJuheSettingAppService : ApplicationService, ITuiJuheSettingAppService + protected ISettingManager SettingManager { get; } + protected IPermissionChecker PermissionChecker { get; } + protected ISettingDefinitionManager SettingDefinitionManager { get; } + + public TuiJuheSettingAppService( + ISettingManager settingManager, + IPermissionChecker permissionChecker, + ISettingDefinitionManager settingDefinitionManager) { - protected ISettingManager SettingManager { get; } - protected IPermissionChecker PermissionChecker { get; } - protected ISettingDefinitionManager SettingDefinitionManager { get; } - - public TuiJuheSettingAppService( - ISettingManager settingManager, - IPermissionChecker permissionChecker, - ISettingDefinitionManager settingDefinitionManager) - { - SettingManager = settingManager; - PermissionChecker = permissionChecker; - SettingDefinitionManager = settingDefinitionManager; - LocalizationResource = typeof(TuiJuheResource); - } + SettingManager = settingManager; + PermissionChecker = permissionChecker; + SettingDefinitionManager = settingDefinitionManager; + LocalizationResource = typeof(TuiJuheResource); + } - public async virtual Task GetAllForCurrentTenantAsync() - { - return await GetAllForProviderAsync(TenantSettingValueProvider.ProviderName, CurrentTenant.GetId().ToString()); - } + public async virtual Task GetAllForCurrentTenantAsync() + { + return await GetAllForProviderAsync(TenantSettingValueProvider.ProviderName, CurrentTenant.GetId().ToString()); + } - public async virtual Task GetAllForGlobalAsync() - { - return await GetAllForProviderAsync(GlobalSettingValueProvider.ProviderName, null); - } + public async virtual Task GetAllForGlobalAsync() + { + return await GetAllForProviderAsync(GlobalSettingValueProvider.ProviderName, null); + } - protected async virtual Task GetAllForProviderAsync(string providerName, string providerKey) + protected async virtual Task GetAllForProviderAsync(string providerName, string providerKey) + { + var settingGroups = new SettingGroupResult(); + var wxPusherSettingGroup = new SettingGroupDto(L["DisplayName:TuiJuhe"], L["Description:TuiJuhe"]); + + if (await PermissionChecker.IsGrantedAsync(TuiJuheSettingPermissionNames.ManageSetting)) { - var settingGroups = new SettingGroupResult(); - var wxPusherSettingGroup = new SettingGroupDto(L["DisplayName:TuiJuhe"], L["Description:TuiJuhe"]); - - if (await PermissionChecker.IsGrantedAsync(TuiJuheSettingPermissionNames.ManageSetting)) - { - var securitySetting = wxPusherSettingGroup.AddSetting(L["Security"], L["Security"]); - securitySetting.AddDetail( - await SettingDefinitionManager.GetAsync(TuiJuheSettingNames.Security.Token), - StringLocalizerFactory, - await SettingManager.GetOrNullAsync(TuiJuheSettingNames.Security.Token, providerName, providerKey), - ValueType.String, - providerName); - } - - settingGroups.AddGroup(wxPusherSettingGroup); - - return settingGroups; + var securitySetting = wxPusherSettingGroup.AddSetting(L["Security"], L["Security"]); + securitySetting.AddDetail( + await SettingDefinitionManager.GetAsync(TuiJuheSettingNames.Security.Token), + StringLocalizerFactory, + await SettingManager.GetOrNullAsync(TuiJuheSettingNames.Security.Token, providerName, providerKey), + ValueType.String, + providerName); } + + settingGroups.AddGroup(wxPusherSettingGroup); + + return settingGroups; } } diff --git a/aspnet-core/framework/tui-juhe/LINGYUN.Abp.TuiJuhe.SettingManagement/LINGYUN/Abp/TuiJuhe/SettingManagement/TuiJuheSettingController.cs b/aspnet-core/framework/tui-juhe/LINGYUN.Abp.TuiJuhe.SettingManagement/LINGYUN/Abp/TuiJuhe/SettingManagement/TuiJuheSettingController.cs index 4521554d3..f97844867 100644 --- a/aspnet-core/framework/tui-juhe/LINGYUN.Abp.TuiJuhe.SettingManagement/LINGYUN/Abp/TuiJuhe/SettingManagement/TuiJuheSettingController.cs +++ b/aspnet-core/framework/tui-juhe/LINGYUN.Abp.TuiJuhe.SettingManagement/LINGYUN/Abp/TuiJuhe/SettingManagement/TuiJuheSettingController.cs @@ -4,33 +4,32 @@ using Volo.Abp; using Volo.Abp.AspNetCore.Mvc; -namespace LINGYUN.Abp.TuiJuhe.SettingManagement +namespace LINGYUN.Abp.TuiJuhe.SettingManagement; + +[RemoteService(Name = AbpSettingManagementRemoteServiceConsts.RemoteServiceName)] +[Area(AbpSettingManagementRemoteServiceConsts.ModuleName)] +[Route($"api/{AbpSettingManagementRemoteServiceConsts.ModuleName}/tui-juhe")] +public class TuiJuheSettingController : AbpController, ITuiJuheSettingAppService { - [RemoteService(Name = AbpSettingManagementRemoteServiceConsts.RemoteServiceName)] - [Area(AbpSettingManagementRemoteServiceConsts.ModuleName)] - [Route($"api/{AbpSettingManagementRemoteServiceConsts.ModuleName}/tui-juhe")] - public class TuiJuheSettingController : AbpController, ITuiJuheSettingAppService - { - protected ITuiJuheSettingAppService Service { get; } + protected ITuiJuheSettingAppService Service { get; } - public TuiJuheSettingController( - ITuiJuheSettingAppService service) - { - Service = service; - } + public TuiJuheSettingController( + ITuiJuheSettingAppService service) + { + Service = service; + } - [HttpGet] - [Route("by-current-tenant")] - public async virtual Task GetAllForCurrentTenantAsync() - { - return await Service.GetAllForCurrentTenantAsync(); - } + [HttpGet] + [Route("by-current-tenant")] + public async virtual Task GetAllForCurrentTenantAsync() + { + return await Service.GetAllForCurrentTenantAsync(); + } - [HttpGet] - [Route("by-global")] - public async virtual Task GetAllForGlobalAsync() - { - return await Service.GetAllForGlobalAsync(); - } + [HttpGet] + [Route("by-global")] + public async virtual Task GetAllForGlobalAsync() + { + return await Service.GetAllForGlobalAsync(); } } diff --git a/aspnet-core/framework/tui-juhe/LINGYUN.Abp.TuiJuhe.SettingManagement/LINGYUN/Abp/TuiJuhe/SettingManagement/TuiJuheSettingPermissionDefinitionProvider.cs b/aspnet-core/framework/tui-juhe/LINGYUN.Abp.TuiJuhe.SettingManagement/LINGYUN/Abp/TuiJuhe/SettingManagement/TuiJuheSettingPermissionDefinitionProvider.cs index 68e7977e3..694c9cd70 100644 --- a/aspnet-core/framework/tui-juhe/LINGYUN.Abp.TuiJuhe.SettingManagement/LINGYUN/Abp/TuiJuhe/SettingManagement/TuiJuheSettingPermissionDefinitionProvider.cs +++ b/aspnet-core/framework/tui-juhe/LINGYUN.Abp.TuiJuhe.SettingManagement/LINGYUN/Abp/TuiJuhe/SettingManagement/TuiJuheSettingPermissionDefinitionProvider.cs @@ -2,23 +2,22 @@ using Volo.Abp.Authorization.Permissions; using Volo.Abp.Localization; -namespace LINGYUN.Abp.TuiJuhe.SettingManagement +namespace LINGYUN.Abp.TuiJuhe.SettingManagement; + +public class WxPusherSettingPermissionDefinitionProvider : PermissionDefinitionProvider { - public class WxPusherSettingPermissionDefinitionProvider : PermissionDefinitionProvider + public override void Define(IPermissionDefinitionContext context) { - public override void Define(IPermissionDefinitionContext context) - { - var tuiJuheGroup = context.AddGroup( - TuiJuheSettingPermissionNames.GroupName, - L("Permission:TuiJuhe")); + var tuiJuheGroup = context.AddGroup( + TuiJuheSettingPermissionNames.GroupName, + L("Permission:TuiJuhe")); - tuiJuheGroup.AddPermission( - TuiJuheSettingPermissionNames.ManageSetting, L("Permission:ManageSetting")); - } + tuiJuheGroup.AddPermission( + TuiJuheSettingPermissionNames.ManageSetting, L("Permission:ManageSetting")); + } - private static LocalizableString L(string name) - { - return LocalizableString.Create(name); - } + private static LocalizableString L(string name) + { + return LocalizableString.Create(name); } } diff --git a/aspnet-core/framework/tui-juhe/LINGYUN.Abp.TuiJuhe.SettingManagement/LINGYUN/Abp/TuiJuhe/SettingManagement/TuiJuheSettingPermissionNames.cs b/aspnet-core/framework/tui-juhe/LINGYUN.Abp.TuiJuhe.SettingManagement/LINGYUN/Abp/TuiJuhe/SettingManagement/TuiJuheSettingPermissionNames.cs index ad5fd02c3..59e7d513e 100644 --- a/aspnet-core/framework/tui-juhe/LINGYUN.Abp.TuiJuhe.SettingManagement/LINGYUN/Abp/TuiJuhe/SettingManagement/TuiJuheSettingPermissionNames.cs +++ b/aspnet-core/framework/tui-juhe/LINGYUN.Abp.TuiJuhe.SettingManagement/LINGYUN/Abp/TuiJuhe/SettingManagement/TuiJuheSettingPermissionNames.cs @@ -1,9 +1,8 @@ -namespace LINGYUN.Abp.TuiJuhe.SettingManagement +namespace LINGYUN.Abp.TuiJuhe.SettingManagement; + +public class TuiJuheSettingPermissionNames { - public class TuiJuheSettingPermissionNames - { - public const string GroupName = "Abp.TuiJuhe"; + public const string GroupName = "Abp.TuiJuhe"; - public const string ManageSetting = GroupName + ".ManageSetting"; - } + public const string ManageSetting = GroupName + ".ManageSetting"; } diff --git a/aspnet-core/framework/tui-juhe/LINGYUN.Abp.TuiJuhe/LINGYUN.Abp.TuiJuhe.csproj b/aspnet-core/framework/tui-juhe/LINGYUN.Abp.TuiJuhe/LINGYUN.Abp.TuiJuhe.csproj index e799548cc..101df68b8 100644 --- a/aspnet-core/framework/tui-juhe/LINGYUN.Abp.TuiJuhe/LINGYUN.Abp.TuiJuhe.csproj +++ b/aspnet-core/framework/tui-juhe/LINGYUN.Abp.TuiJuhe/LINGYUN.Abp.TuiJuhe.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.TuiJuhe + LINGYUN.Abp.TuiJuhe + false + false + false diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat.Work/LINGYUN.Abp.Identity.WeChat.Work.csproj b/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat.Work/LINGYUN.Abp.Identity.WeChat.Work.csproj index 2da347de2..cc5a01861 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat.Work/LINGYUN.Abp.Identity.WeChat.Work.csproj +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat.Work/LINGYUN.Abp.Identity.WeChat.Work.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.Identity.WeChat.Work + LINGYUN.Abp.Identity.WeChat.Work + false + false + false diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat.Work/LINGYUN/Abp/Identity/WeChat/Work/WeChatWorkInternalUserFinder.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat.Work/LINGYUN/Abp/Identity/WeChat/Work/WeChatWorkInternalUserFinder.cs index 691a7a86e..874050057 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat.Work/LINGYUN/Abp/Identity/WeChat/Work/WeChatWorkInternalUserFinder.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat.Work/LINGYUN/Abp/Identity/WeChat/Work/WeChatWorkInternalUserFinder.cs @@ -9,51 +9,50 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.Identity; -namespace LINGYUN.Abp.Identity.WeChat.Work +namespace LINGYUN.Abp.Identity.WeChat.Work; + +[Dependency(ServiceLifetime.Transient, ReplaceServices = true)] +[ExposeServices(typeof(IWeChatWorkInternalUserFinder))] +public class WeChatWorkInternalUserFinder : IWeChatWorkInternalUserFinder { - [Dependency(ServiceLifetime.Transient, ReplaceServices = true)] - [ExposeServices(typeof(IWeChatWorkInternalUserFinder))] - public class WeChatWorkInternalUserFinder : IWeChatWorkInternalUserFinder - { - protected IdentityUserManager UserManager { get; } + protected IdentityUserManager UserManager { get; } - public WeChatWorkInternalUserFinder( - IdentityUserManager userManager) - { - UserManager = userManager; - } + public WeChatWorkInternalUserFinder( + IdentityUserManager userManager) + { + UserManager = userManager; + } - protected string GetUserOpenIdOrNull(IdentityUser user, string provider) - { - // 微信扩展登录后openid存储在Login中 - var userLogin = user?.Logins - .Where(login => login.LoginProvider == provider) - .FirstOrDefault(); + protected string GetUserOpenIdOrNull(IdentityUser user, string provider) + { + // 微信扩展登录后openid存储在Login中 + var userLogin = user?.Logins + .Where(login => login.LoginProvider == provider) + .FirstOrDefault(); - return userLogin?.ProviderKey; - } + return userLogin?.ProviderKey; + } - public async virtual Task FindUserIdentifierAsync(string agentId, Guid userId, CancellationToken cancellationToken = default) - { - var user = await UserManager.FindByIdAsync(userId.ToString()); + public async virtual Task FindUserIdentifierAsync(string agentId, Guid userId, CancellationToken cancellationToken = default) + { + var user = await UserManager.FindByIdAsync(userId.ToString()); - return GetUserOpenIdOrNull(user, AbpWeChatWorkGlobalConsts.ProviderName); - } + return GetUserOpenIdOrNull(user, AbpWeChatWorkGlobalConsts.ProviderName); + } - public async virtual Task> FindUserIdentifierListAsync(string agentId, IEnumerable userIdList, CancellationToken cancellationToken = default) + public async virtual Task> FindUserIdentifierListAsync(string agentId, IEnumerable userIdList, CancellationToken cancellationToken = default) + { + var userIdentifiers = new List(); + foreach (var userId in userIdList) { - var userIdentifiers = new List(); - foreach (var userId in userIdList) + var user = await UserManager.FindByIdAsync(userId.ToString()); + var weChatWorkUserId = GetUserOpenIdOrNull(user, AbpWeChatWorkGlobalConsts.ProviderName); + if (!weChatWorkUserId.IsNullOrWhiteSpace()) { - var user = await UserManager.FindByIdAsync(userId.ToString()); - var weChatWorkUserId = GetUserOpenIdOrNull(user, AbpWeChatWorkGlobalConsts.ProviderName); - if (!weChatWorkUserId.IsNullOrWhiteSpace()) - { - userIdentifiers.Add(weChatWorkUserId); - } + userIdentifiers.Add(weChatWorkUserId); } - - return userIdentifiers; } + + return userIdentifiers; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat/LINGYUN.Abp.Identity.WeChat.csproj b/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat/LINGYUN.Abp.Identity.WeChat.csproj index 386704ec5..15a098f26 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat/LINGYUN.Abp.Identity.WeChat.csproj +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat/LINGYUN.Abp.Identity.WeChat.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.Identity.WeChat + LINGYUN.Abp.Identity.WeChat + false + false + false diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat/LINGYUN/Abp/Identity/WeChat/AbpIdentityWeChatModule.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat/LINGYUN/Abp/Identity/WeChat/AbpIdentityWeChatModule.cs index bab02c30c..ea6c59430 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat/LINGYUN/Abp/Identity/WeChat/AbpIdentityWeChatModule.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat/LINGYUN/Abp/Identity/WeChat/AbpIdentityWeChatModule.cs @@ -2,12 +2,11 @@ using Volo.Abp.Identity; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.Identity.WeChat +namespace LINGYUN.Abp.Identity.WeChat; + +[DependsOn( + typeof(AbpWeChatModule), + typeof(AbpIdentityDomainModule))] +public class AbpIdentityWeChatModule : AbpModule { - [DependsOn( - typeof(AbpWeChatModule), - typeof(AbpIdentityDomainModule))] - public class AbpIdentityWeChatModule : AbpModule - { - } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat/LINGYUN/Abp/Identity/WeChat/OpenId/UserWeChatOpenIdFinder.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat/LINGYUN/Abp/Identity/WeChat/OpenId/UserWeChatOpenIdFinder.cs index 3d3f48397..70d459aea 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat/LINGYUN/Abp/Identity/WeChat/OpenId/UserWeChatOpenIdFinder.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.Identity.WeChat/LINGYUN/Abp/Identity/WeChat/OpenId/UserWeChatOpenIdFinder.cs @@ -6,42 +6,41 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.Identity; -namespace LINGYUN.Abp.Identity.WeChat.OpenId +namespace LINGYUN.Abp.Identity.WeChat.OpenId; + +[Dependency(ServiceLifetime.Transient, ReplaceServices = true)] +[ExposeServices(typeof(IUserWeChatOpenIdFinder))] +public class UserWeChatOpenIdFinder : IUserWeChatOpenIdFinder { - [Dependency(ServiceLifetime.Transient, ReplaceServices = true)] - [ExposeServices(typeof(IUserWeChatOpenIdFinder))] - public class UserWeChatOpenIdFinder : IUserWeChatOpenIdFinder - { - protected IdentityUserManager UserManager { get; } + protected IdentityUserManager UserManager { get; } - public UserWeChatOpenIdFinder( - IdentityUserManager userManager) - { - UserManager = userManager; - } + public UserWeChatOpenIdFinder( + IdentityUserManager userManager) + { + UserManager = userManager; + } - public async virtual Task FindByUserIdAsync(Guid userId, string provider) - { - var user = await UserManager.FindByIdAsync(userId.ToString()); + public async virtual Task FindByUserIdAsync(Guid userId, string provider) + { + var user = await UserManager.FindByIdAsync(userId.ToString()); - return GetUserOpenIdOrNull(user, provider); - } + return GetUserOpenIdOrNull(user, provider); + } - public async virtual Task FindByUserNameAsync(string userName, string provider) - { - var user = await UserManager.FindByNameAsync(userName); + public async virtual Task FindByUserNameAsync(string userName, string provider) + { + var user = await UserManager.FindByNameAsync(userName); - return GetUserOpenIdOrNull(user, provider); - } + return GetUserOpenIdOrNull(user, provider); + } - protected string GetUserOpenIdOrNull(IdentityUser user, string provider) - { - // 微信扩展登录后openid存储在Login中 - var userLogin = user?.Logins - .Where(login => login.LoginProvider == provider) - .FirstOrDefault(); + protected string GetUserOpenIdOrNull(IdentityUser user, string provider) + { + // 微信扩展登录后openid存储在Login中 + var userLogin = user?.Logins + .Where(login => login.LoginProvider == provider) + .FirstOrDefault(); - return userLogin?.ProviderKey; - } + return userLogin?.ProviderKey; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN.Abp.WeChat.Common.csproj b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN.Abp.WeChat.Common.csproj index 9a3ec0a9d..a17136af6 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN.Abp.WeChat.Common.csproj +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN.Abp.WeChat.Common.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.WeChat.Common + LINGYUN.Abp.WeChat.Common + false + false + false diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/AbpWeChatException.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/AbpWeChatException.cs index 176bb465b..d6b245c7f 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/AbpWeChatException.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/AbpWeChatException.cs @@ -1,5 +1,4 @@ using System; -using System.Runtime.Serialization; using Volo.Abp; namespace LINGYUN.Abp.WeChat.Common; @@ -18,9 +17,4 @@ public AbpWeChatException( : base(code, message, details, innerException) { } - - public AbpWeChatException(SerializationInfo serializationInfo, StreamingContext context) - : base(serializationInfo, context) - { - } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Crypto/AbpWeChatCryptoException.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Crypto/AbpWeChatCryptoException.cs index c6e1fe958..54152984e 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Crypto/AbpWeChatCryptoException.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Crypto/AbpWeChatCryptoException.cs @@ -9,12 +9,6 @@ public AbpWeChatCryptoException() { } - public AbpWeChatCryptoException( - SerializationInfo serializationInfo, - StreamingContext context) : base(serializationInfo, context) - { - } - public AbpWeChatCryptoException( string appId, string message = null, diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Crypto/IWeChatCryptoService.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Crypto/IWeChatCryptoService.cs index a8beb523f..ff0462319 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Crypto/IWeChatCryptoService.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Crypto/IWeChatCryptoService.cs @@ -1,29 +1,28 @@ using LINGYUN.Abp.WeChat.Common.Crypto.Models; -namespace LINGYUN.Abp.WeChat.Common.Crypto +namespace LINGYUN.Abp.WeChat.Common.Crypto; + +public interface IWeChatCryptoService { - public interface IWeChatCryptoService - { - /// - /// 校验 - /// - /// - /// - /// - string Validation(WeChatCryptoEchoData data); - /// - /// 解密 - /// - /// - /// - /// - string Decrypt(WeChatCryptoDecryptData data); - /// - /// 加密 - /// - /// - /// - /// - string Encrypt(WeChatCryptoEncryptData data); - } + /// + /// 校验 + /// + /// + /// + /// + string Validation(WeChatCryptoEchoData data); + /// + /// 解密 + /// + /// + /// + /// + string Decrypt(WeChatCryptoDecryptData data); + /// + /// 加密 + /// + /// + /// + /// + string Encrypt(WeChatCryptoEncryptData data); } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Crypto/WeChatCryptoService.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Crypto/WeChatCryptoService.cs index aaef074ae..859ec234a 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Crypto/WeChatCryptoService.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Crypto/WeChatCryptoService.cs @@ -3,92 +3,91 @@ using System; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.WeChat.Common.Crypto +namespace LINGYUN.Abp.WeChat.Common.Crypto; + +public class WeChatCryptoService : IWeChatCryptoService, ITransientDependency { - public class WeChatCryptoService : IWeChatCryptoService, ITransientDependency + public string Decrypt(WeChatCryptoDecryptData data) { - public string Decrypt(WeChatCryptoDecryptData data) + var crypto = new WXBizMsgCrypt( + data.Token, + data.EncodingAESKey, + data.ReceiveId); + + var retMsg = ""; + var ret = crypto.DecryptMsg( + data.MsgSignature, + data.TimeStamp, + data.Nonce, + data.PostData, + ref retMsg); + + if (ret != 0) { - var crypto = new WXBizMsgCrypt( - data.Token, - data.EncodingAESKey, - data.ReceiveId); - - var retMsg = ""; - var ret = crypto.DecryptMsg( - data.MsgSignature, - data.TimeStamp, - data.Nonce, - data.PostData, - ref retMsg); - - if (ret != 0) - { - throw new AbpWeChatCryptoException(data.ReceiveId, code: $"WeChat:{ret}"); - } - - return retMsg; + throw new AbpWeChatCryptoException(data.ReceiveId, code: $"WeChat:{ret}"); } - public string Encrypt(WeChatCryptoEncryptData data) + return retMsg; + } + + public string Encrypt(WeChatCryptoEncryptData data) + { + var crypto = new WXBizMsgCrypt( + data.Token, + data.EncodingAESKey, + data.ReceiveId); + + var sinature = ""; + var timestamp = DateTimeOffset.Now.ToLocalTime().ToUnixTimeSeconds().ToString(); + var nonce = DateTimeOffset.Now.Ticks.ToString("x"); + var sinatureRet = WXBizMsgCrypt.GenarateSinature( + data.Token, + timestamp, + nonce, + data.Data, + ref sinature); + if (sinatureRet != 0) { - var crypto = new WXBizMsgCrypt( - data.Token, - data.EncodingAESKey, - data.ReceiveId); - - var sinature = ""; - var timestamp = DateTimeOffset.Now.ToLocalTime().ToUnixTimeSeconds().ToString(); - var nonce = DateTimeOffset.Now.Ticks.ToString("x"); - var sinatureRet = WXBizMsgCrypt.GenarateSinature( - data.Token, - timestamp, - nonce, - data.Data, - ref sinature); - if (sinatureRet != 0) - { - throw new AbpWeChatCryptoException(data.ReceiveId, code: $"WeChat:{sinatureRet}"); - } - - var retMsg = ""; - - var ret = crypto.EncryptMsg( - sinature, - timestamp, - nonce, - ref retMsg); - - if (ret != 0) - { - throw new AbpWeChatCryptoException(data.ReceiveId, code: $"WeChat:{ret}"); - } - - return retMsg; + throw new AbpWeChatCryptoException(data.ReceiveId, code: $"WeChat:{sinatureRet}"); } - public string Validation(WeChatCryptoEchoData data) + var retMsg = ""; + + var ret = crypto.EncryptMsg( + sinature, + timestamp, + nonce, + ref retMsg); + + if (ret != 0) { - var crypto = new WXBizMsgCrypt( - data.Token, - data.EncodingAESKey, - data.ReceiveId); - - var retMsg = ""; - - var ret = crypto.VerifyURL( - data.MsgSignature, - data.TimeStamp, - data.Nonce, - data.EchoStr, - ref retMsg); - - if (ret != 0) - { - throw new AbpWeChatCryptoException(data.ReceiveId, code: $"WeChat:{ret}"); - } - - return retMsg; + throw new AbpWeChatCryptoException(data.ReceiveId, code: $"WeChat:{ret}"); } + + return retMsg; + } + + public string Validation(WeChatCryptoEchoData data) + { + var crypto = new WXBizMsgCrypt( + data.Token, + data.EncodingAESKey, + data.ReceiveId); + + var retMsg = ""; + + var ret = crypto.VerifyURL( + data.MsgSignature, + data.TimeStamp, + data.Nonce, + data.EchoStr, + ref retMsg); + + if (ret != 0) + { + throw new AbpWeChatCryptoException(data.ReceiveId, code: $"WeChat:{ret}"); + } + + return retMsg; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Security/Claims/AbpWeChatClaimTypes.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Security/Claims/AbpWeChatClaimTypes.cs index 4407215ee..51a67165f 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Security/Claims/AbpWeChatClaimTypes.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Security/Claims/AbpWeChatClaimTypes.cs @@ -1,48 +1,47 @@ -namespace LINGYUN.Abp.WeChat.Common.Security.Claims +namespace LINGYUN.Abp.WeChat.Common.Security.Claims; + +/// +/// 微信认证身份类型,可以像 自行配置 +///
+/// See: +///
+public class AbpWeChatClaimTypes { /// - /// 微信认证身份类型,可以像 自行配置 - ///
- /// See: - ///
- public class AbpWeChatClaimTypes - { - /// - /// 用户的唯一标识 - /// - public static string OpenId { get; set; } = "wx-openid"; // 可变更 - /// - /// 只有在用户将公众号绑定到微信开放平台帐号后,才会出现该字段。 - /// - public static string UnionId { get; set; } = "wx-unionid"; //可变更 - /// - /// 用户昵称 - /// - public static string NickName { get; set; } = "nickname"; - /// - /// 用户的性别,值为1时是男性,值为2时是女性,值为0时是未知 - /// - public static string Sex { get; set; } = "sex"; - /// - /// 国家,如中国为CN - /// - public static string Country { get; set; } = "country"; - /// - /// 用户个人资料填写的省份 - /// - public static string Province { get; set; } = "province"; - /// - /// 普通用户个人资料填写的城市 - /// - public static string City { get; set; } = "city"; - /// - /// 用户头像,最后一个数值代表正方形头像大小(有0、46、64、96、132数值可选,0代表640*640正方形头像),用户没有头像时该项为空。 - /// 若用户更换头像,原有头像URL将失效。 - /// - public static string AvatarUrl { get; set; } = "avatar"; - /// - /// 用户特权信息,json 数组,如微信沃卡用户为(chinaunicom) - /// - public static string Privilege { get; set; } = "privilege"; - } + /// 用户的唯一标识 + /// + public static string OpenId { get; set; } = "wx-openid"; // 可变更 + /// + /// 只有在用户将公众号绑定到微信开放平台帐号后,才会出现该字段。 + /// + public static string UnionId { get; set; } = "wx-unionid"; //可变更 + /// + /// 用户昵称 + /// + public static string NickName { get; set; } = "nickname"; + /// + /// 用户的性别,值为1时是男性,值为2时是女性,值为0时是未知 + /// + public static string Sex { get; set; } = "sex"; + /// + /// 国家,如中国为CN + /// + public static string Country { get; set; } = "country"; + /// + /// 用户个人资料填写的省份 + /// + public static string Province { get; set; } = "province"; + /// + /// 普通用户个人资料填写的城市 + /// + public static string City { get; set; } = "city"; + /// + /// 用户头像,最后一个数值代表正方形头像大小(有0、46、64、96、132数值可选,0代表640*640正方形头像),用户没有头像时该项为空。 + /// 若用户更换头像,原有头像URL将失效。 + /// + public static string AvatarUrl { get; set; } = "avatar"; + /// + /// 用户特权信息,json 数组,如微信沃卡用户为(chinaunicom) + /// + public static string Privilege { get; set; } = "privilege"; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Utils/Cryptography.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Utils/Cryptography.cs index 7ef1e2cd7..a532e10e1 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Utils/Cryptography.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Utils/Cryptography.cs @@ -6,228 +6,227 @@ using System.IO; using System.Net; -namespace LINGYUN.Abp.WeChat.Common.Utils +namespace LINGYUN.Abp.WeChat.Common.Utils; + +public class Cryptography { - public class Cryptography + public static uint HostToNetworkOrder(uint inval) { - public static uint HostToNetworkOrder(uint inval) - { - uint outval = 0; - for (var i = 0; i < 4; i++) - outval = (outval << 8) + (inval >> i * 8 & 255); - return outval; - } + uint outval = 0; + for (var i = 0; i < 4; i++) + outval = (outval << 8) + (inval >> i * 8 & 255); + return outval; + } - public static int HostToNetworkOrder(int inval) - { - var outval = 0; - for (var i = 0; i < 4; i++) - outval = (outval << 8) + (inval >> i * 8 & 255); - return outval; - } - /// - /// 解密方法 - /// - /// 密文 - /// - /// - /// - public static string AES_decrypt(string Input, string EncodingAESKey, ref string corpid) - { - byte[] Key; - Key = Convert.FromBase64String(EncodingAESKey + "="); - var Iv = new byte[16]; - Array.Copy(Key, Iv, 16); - var btmpMsg = AES_decrypt(Input, Iv, Key); + public static int HostToNetworkOrder(int inval) + { + var outval = 0; + for (var i = 0; i < 4; i++) + outval = (outval << 8) + (inval >> i * 8 & 255); + return outval; + } + /// + /// 解密方法 + /// + /// 密文 + /// + /// + /// + public static string AES_decrypt(string Input, string EncodingAESKey, ref string corpid) + { + byte[] Key; + Key = Convert.FromBase64String(EncodingAESKey + "="); + var Iv = new byte[16]; + Array.Copy(Key, Iv, 16); + var btmpMsg = AES_decrypt(Input, Iv, Key); - var len = BitConverter.ToInt32(btmpMsg, 16); - len = IPAddress.NetworkToHostOrder(len); + var len = BitConverter.ToInt32(btmpMsg, 16); + len = IPAddress.NetworkToHostOrder(len); - var bMsg = new byte[len]; - var bCorpid = new byte[btmpMsg.Length - 20 - len]; - Array.Copy(btmpMsg, 20, bMsg, 0, len); - Array.Copy(btmpMsg, 20 + len, bCorpid, 0, btmpMsg.Length - 20 - len); - var oriMsg = Encoding.UTF8.GetString(bMsg); - corpid = Encoding.UTF8.GetString(bCorpid); + var bMsg = new byte[len]; + var bCorpid = new byte[btmpMsg.Length - 20 - len]; + Array.Copy(btmpMsg, 20, bMsg, 0, len); + Array.Copy(btmpMsg, 20 + len, bCorpid, 0, btmpMsg.Length - 20 - len); + var oriMsg = Encoding.UTF8.GetString(bMsg); + corpid = Encoding.UTF8.GetString(bCorpid); - return oriMsg; - } + return oriMsg; + } - public static string AES_encrypt(string Input, string EncodingAESKey, string corpid) - { - byte[] Key; - Key = Convert.FromBase64String(EncodingAESKey + "="); - var Iv = new byte[16]; - Array.Copy(Key, Iv, 16); - var Randcode = CreateRandCode(16); - var bRand = Encoding.UTF8.GetBytes(Randcode); - var bCorpid = Encoding.UTF8.GetBytes(corpid); - var btmpMsg = Encoding.UTF8.GetBytes(Input); - var bMsgLen = BitConverter.GetBytes(HostToNetworkOrder(btmpMsg.Length)); - var bMsg = new byte[bRand.Length + bMsgLen.Length + bCorpid.Length + btmpMsg.Length]; - - Array.Copy(bRand, bMsg, bRand.Length); - Array.Copy(bMsgLen, 0, bMsg, bRand.Length, bMsgLen.Length); - Array.Copy(btmpMsg, 0, bMsg, bRand.Length + bMsgLen.Length, btmpMsg.Length); - Array.Copy(bCorpid, 0, bMsg, bRand.Length + bMsgLen.Length + btmpMsg.Length, bCorpid.Length); - - return AES_encrypt(bMsg, Iv, Key); + public static string AES_encrypt(string Input, string EncodingAESKey, string corpid) + { + byte[] Key; + Key = Convert.FromBase64String(EncodingAESKey + "="); + var Iv = new byte[16]; + Array.Copy(Key, Iv, 16); + var Randcode = CreateRandCode(16); + var bRand = Encoding.UTF8.GetBytes(Randcode); + var bCorpid = Encoding.UTF8.GetBytes(corpid); + var btmpMsg = Encoding.UTF8.GetBytes(Input); + var bMsgLen = BitConverter.GetBytes(HostToNetworkOrder(btmpMsg.Length)); + var bMsg = new byte[bRand.Length + bMsgLen.Length + bCorpid.Length + btmpMsg.Length]; + + Array.Copy(bRand, bMsg, bRand.Length); + Array.Copy(bMsgLen, 0, bMsg, bRand.Length, bMsgLen.Length); + Array.Copy(btmpMsg, 0, bMsg, bRand.Length + bMsgLen.Length, btmpMsg.Length); + Array.Copy(bCorpid, 0, bMsg, bRand.Length + bMsgLen.Length + btmpMsg.Length, bCorpid.Length); + + return AES_encrypt(bMsg, Iv, Key); + } + private static string CreateRandCode(int codeLen) + { + var codeSerial = "2,3,4,5,6,7,a,c,d,e,f,h,i,j,k,m,n,p,r,s,t,A,C,D,E,F,G,H,J,K,M,N,P,Q,R,S,U,V,W,X,Y,Z"; + if (codeLen == 0) + { + codeLen = 16; } - private static string CreateRandCode(int codeLen) + var arr = codeSerial.Split(','); + var code = ""; + var randValue = -1; + var rand = new Random(unchecked((int)DateTime.Now.Ticks)); + for (var i = 0; i < codeLen; i++) { - var codeSerial = "2,3,4,5,6,7,a,c,d,e,f,h,i,j,k,m,n,p,r,s,t,A,C,D,E,F,G,H,J,K,M,N,P,Q,R,S,U,V,W,X,Y,Z"; - if (codeLen == 0) - { - codeLen = 16; - } - var arr = codeSerial.Split(','); - var code = ""; - var randValue = -1; - var rand = new Random(unchecked((int)DateTime.Now.Ticks)); - for (var i = 0; i < codeLen; i++) - { - randValue = rand.Next(0, arr.Length - 1); - code += arr[randValue]; - } - return code; + randValue = rand.Next(0, arr.Length - 1); + code += arr[randValue]; } + return code; + } - private static string AES_encrypt(string Input, byte[] Iv, byte[] Key) + private static string AES_encrypt(string Input, byte[] Iv, byte[] Key) + { + var aes = new RijndaelManaged(); + //秘钥的大小,以位为单位 + aes.KeySize = 256; + //支持的块大小 + aes.BlockSize = 128; + //填充模式 + aes.Padding = PaddingMode.PKCS7; + aes.Mode = CipherMode.CBC; + aes.Key = Key; + aes.IV = Iv; + var encrypt = aes.CreateEncryptor(aes.Key, aes.IV); + byte[] xBuff = null; + + using (var ms = new MemoryStream()) { - var aes = new RijndaelManaged(); - //秘钥的大小,以位为单位 - aes.KeySize = 256; - //支持的块大小 - aes.BlockSize = 128; - //填充模式 - aes.Padding = PaddingMode.PKCS7; - aes.Mode = CipherMode.CBC; - aes.Key = Key; - aes.IV = Iv; - var encrypt = aes.CreateEncryptor(aes.Key, aes.IV); - byte[] xBuff = null; - - using (var ms = new MemoryStream()) + using (var cs = new CryptoStream(ms, encrypt, CryptoStreamMode.Write)) { - using (var cs = new CryptoStream(ms, encrypt, CryptoStreamMode.Write)) - { - var xXml = Encoding.UTF8.GetBytes(Input); - cs.Write(xXml, 0, xXml.Length); - } - xBuff = ms.ToArray(); + var xXml = Encoding.UTF8.GetBytes(Input); + cs.Write(xXml, 0, xXml.Length); } - var Output = Convert.ToBase64String(xBuff); - return Output; + xBuff = ms.ToArray(); } + var Output = Convert.ToBase64String(xBuff); + return Output; + } - private static string AES_encrypt(byte[] Input, byte[] Iv, byte[] Key) + private static string AES_encrypt(byte[] Input, byte[] Iv, byte[] Key) + { + var aes = new RijndaelManaged(); + //秘钥的大小,以位为单位 + aes.KeySize = 256; + //支持的块大小 + aes.BlockSize = 128; + //填充模式 + //aes.Padding = PaddingMode.PKCS7; + aes.Padding = PaddingMode.None; + aes.Mode = CipherMode.CBC; + aes.Key = Key; + aes.IV = Iv; + var encrypt = aes.CreateEncryptor(aes.Key, aes.IV); + byte[] xBuff = null; + + #region 自己进行PKCS7补位,用系统自己带的不行 + var msg = new byte[Input.Length + 32 - Input.Length % 32]; + Array.Copy(Input, msg, Input.Length); + var pad = KCS7Encoder(Input.Length); + Array.Copy(pad, 0, msg, Input.Length, pad.Length); + #endregion + + #region 注释的也是一种方法,效果一样 + //ICryptoTransform transform = aes.CreateEncryptor(); + //byte[] xBuff = transform.TransformFinalBlock(msg, 0, msg.Length); + #endregion + + using (var ms = new MemoryStream()) { - var aes = new RijndaelManaged(); - //秘钥的大小,以位为单位 - aes.KeySize = 256; - //支持的块大小 - aes.BlockSize = 128; - //填充模式 - //aes.Padding = PaddingMode.PKCS7; - aes.Padding = PaddingMode.None; - aes.Mode = CipherMode.CBC; - aes.Key = Key; - aes.IV = Iv; - var encrypt = aes.CreateEncryptor(aes.Key, aes.IV); - byte[] xBuff = null; - - #region 自己进行PKCS7补位,用系统自己带的不行 - var msg = new byte[Input.Length + 32 - Input.Length % 32]; - Array.Copy(Input, msg, Input.Length); - var pad = KCS7Encoder(Input.Length); - Array.Copy(pad, 0, msg, Input.Length, pad.Length); - #endregion - - #region 注释的也是一种方法,效果一样 - //ICryptoTransform transform = aes.CreateEncryptor(); - //byte[] xBuff = transform.TransformFinalBlock(msg, 0, msg.Length); - #endregion - - using (var ms = new MemoryStream()) + using (var cs = new CryptoStream(ms, encrypt, CryptoStreamMode.Write)) { - using (var cs = new CryptoStream(ms, encrypt, CryptoStreamMode.Write)) - { - cs.Write(msg, 0, msg.Length); - } - xBuff = ms.ToArray(); + cs.Write(msg, 0, msg.Length); } - - var Output = Convert.ToBase64String(xBuff); - return Output; + xBuff = ms.ToArray(); } - private static byte[] KCS7Encoder(int text_length) + var Output = Convert.ToBase64String(xBuff); + return Output; + } + + private static byte[] KCS7Encoder(int text_length) + { + var block_size = 32; + // 计算需要填充的位数 + var amount_to_pad = block_size - text_length % block_size; + if (amount_to_pad == 0) { - var block_size = 32; - // 计算需要填充的位数 - var amount_to_pad = block_size - text_length % block_size; - if (amount_to_pad == 0) - { - amount_to_pad = block_size; - } - // 获得补位所用的字符 - var pad_chr = chr(amount_to_pad); - var tmp = ""; - for (var index = 0; index < amount_to_pad; index++) - { - tmp += pad_chr; - } - return Encoding.UTF8.GetBytes(tmp); + amount_to_pad = block_size; } - /** - * 将数字转化成ASCII码对应的字符,用于对明文进行补码 - * - * @param a 需要转化的数字 - * @return 转化得到的字符 - */ - static char chr(int a) + // 获得补位所用的字符 + var pad_chr = chr(amount_to_pad); + var tmp = ""; + for (var index = 0; index < amount_to_pad; index++) { - - var target = (byte)(a & 0xFF); - return (char)target; + tmp += pad_chr; } - private static byte[] AES_decrypt(string Input, byte[] Iv, byte[] Key) + return Encoding.UTF8.GetBytes(tmp); + } + /** + * 将数字转化成ASCII码对应的字符,用于对明文进行补码 + * + * @param a 需要转化的数字 + * @return 转化得到的字符 + */ + static char chr(int a) + { + + var target = (byte)(a & 0xFF); + return (char)target; + } + private static byte[] AES_decrypt(string Input, byte[] Iv, byte[] Key) + { + var aes = new RijndaelManaged(); + aes.KeySize = 256; + aes.BlockSize = 128; + aes.Mode = CipherMode.CBC; + aes.Padding = PaddingMode.None; + aes.Key = Key; + aes.IV = Iv; + var decrypt = aes.CreateDecryptor(aes.Key, aes.IV); + byte[] xBuff = null; + using (var ms = new MemoryStream()) { - var aes = new RijndaelManaged(); - aes.KeySize = 256; - aes.BlockSize = 128; - aes.Mode = CipherMode.CBC; - aes.Padding = PaddingMode.None; - aes.Key = Key; - aes.IV = Iv; - var decrypt = aes.CreateDecryptor(aes.Key, aes.IV); - byte[] xBuff = null; - using (var ms = new MemoryStream()) + using (var cs = new CryptoStream(ms, decrypt, CryptoStreamMode.Write)) { - using (var cs = new CryptoStream(ms, decrypt, CryptoStreamMode.Write)) - { - var xXml = Convert.FromBase64String(Input); - var msg = new byte[xXml.Length + 32 - xXml.Length % 32]; - Array.Copy(xXml, msg, xXml.Length); - cs.Write(xXml, 0, xXml.Length); - } - xBuff = decode2(ms.ToArray()); + var xXml = Convert.FromBase64String(Input); + var msg = new byte[xXml.Length + 32 - xXml.Length % 32]; + Array.Copy(xXml, msg, xXml.Length); + cs.Write(xXml, 0, xXml.Length); } - return xBuff; + xBuff = decode2(ms.ToArray()); } - private static byte[] decode2(byte[] decrypted) + return xBuff; + } + private static byte[] decode2(byte[] decrypted) + { + var pad = (int)decrypted[decrypted.Length - 1]; + if (pad < 1 || pad > 32) { - var pad = (int)decrypted[decrypted.Length - 1]; - if (pad < 1 || pad > 32) - { - pad = 0; - } - var res = new byte[decrypted.Length - pad]; - Array.Copy(decrypted, 0, res, 0, decrypted.Length - pad); - return res; + pad = 0; } + var res = new byte[decrypted.Length - pad]; + Array.Copy(decrypted, 0, res, 0, decrypted.Length - pad); + return res; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Utils/WXBizMsgCrypt.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Utils/WXBizMsgCrypt.cs index 7a2068f72..62f8a177e 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Utils/WXBizMsgCrypt.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Utils/WXBizMsgCrypt.cs @@ -16,244 +16,243 @@ //-40008 : 解密后得到的buffer非法 //-40009 : base64加密异常 //-40010 : base64解密异常 -namespace LINGYUN.Abp.WeChat.Common.Utils +namespace LINGYUN.Abp.WeChat.Common.Utils; + +public class WXBizMsgCrypt { - public class WXBizMsgCrypt + string m_sToken; + string m_sEncodingAESKey; + string m_sReceiveId; + enum WXBizMsgCryptErrorCode { - string m_sToken; - string m_sEncodingAESKey; - string m_sReceiveId; - enum WXBizMsgCryptErrorCode - { - WXBizMsgCrypt_OK = 0, - WXBizMsgCrypt_ValidateSignature_Error = -40001, - WXBizMsgCrypt_ParseXml_Error = -40002, - WXBizMsgCrypt_ComputeSignature_Error = -40003, - WXBizMsgCrypt_IllegalAesKey = -40004, - WXBizMsgCrypt_ValidateCorpid_Error = -40005, - WXBizMsgCrypt_EncryptAES_Error = -40006, - WXBizMsgCrypt_DecryptAES_Error = -40007, - WXBizMsgCrypt_IllegalBuffer = -40008, - WXBizMsgCrypt_EncodeBase64_Error = -40009, - WXBizMsgCrypt_DecodeBase64_Error = -40010 - }; + WXBizMsgCrypt_OK = 0, + WXBizMsgCrypt_ValidateSignature_Error = -40001, + WXBizMsgCrypt_ParseXml_Error = -40002, + WXBizMsgCrypt_ComputeSignature_Error = -40003, + WXBizMsgCrypt_IllegalAesKey = -40004, + WXBizMsgCrypt_ValidateCorpid_Error = -40005, + WXBizMsgCrypt_EncryptAES_Error = -40006, + WXBizMsgCrypt_DecryptAES_Error = -40007, + WXBizMsgCrypt_IllegalBuffer = -40008, + WXBizMsgCrypt_EncodeBase64_Error = -40009, + WXBizMsgCrypt_DecodeBase64_Error = -40010 + }; + + //构造函数 + // @param sToken: 企业微信后台,开发者设置的Token + // @param sEncodingAESKey: 企业微信后台,开发者设置的EncodingAESKey + // @param sReceiveId: 不同场景含义不同,详见文档说明 + public WXBizMsgCrypt(string sToken, string sEncodingAESKey, string sReceiveId) + { + m_sToken = sToken; + m_sReceiveId = sReceiveId; + m_sEncodingAESKey = sEncodingAESKey; + } - //构造函数 - // @param sToken: 企业微信后台,开发者设置的Token - // @param sEncodingAESKey: 企业微信后台,开发者设置的EncodingAESKey - // @param sReceiveId: 不同场景含义不同,详见文档说明 - public WXBizMsgCrypt(string sToken, string sEncodingAESKey, string sReceiveId) + //验证URL + // @param sMsgSignature: 签名串,对应URL参数的msg_signature + // @param sTimeStamp: 时间戳,对应URL参数的timestamp + // @param sNonce: 随机串,对应URL参数的nonce + // @param sEchoStr: 随机串,对应URL参数的echostr + // @param sReplyEchoStr: 解密之后的echostr,当return返回0时有效 + // @return:成功0,失败返回对应的错误码 + public int VerifyURL(string sMsgSignature, string sTimeStamp, string sNonce, string sEchoStr, ref string sReplyEchoStr) + { + var ret = 0; + if (m_sEncodingAESKey.Length != 43) { - m_sToken = sToken; - m_sReceiveId = sReceiveId; - m_sEncodingAESKey = sEncodingAESKey; + return (int)WXBizMsgCryptErrorCode.WXBizMsgCrypt_IllegalAesKey; } - - //验证URL - // @param sMsgSignature: 签名串,对应URL参数的msg_signature - // @param sTimeStamp: 时间戳,对应URL参数的timestamp - // @param sNonce: 随机串,对应URL参数的nonce - // @param sEchoStr: 随机串,对应URL参数的echostr - // @param sReplyEchoStr: 解密之后的echostr,当return返回0时有效 - // @return:成功0,失败返回对应的错误码 - public int VerifyURL(string sMsgSignature, string sTimeStamp, string sNonce, string sEchoStr, ref string sReplyEchoStr) + ret = VerifySignature(m_sToken, sTimeStamp, sNonce, sEchoStr, sMsgSignature); + if (0 != ret) + { + return ret; + } + sReplyEchoStr = ""; + var cpid = ""; + try + { + sReplyEchoStr = Cryptography.AES_decrypt(sEchoStr, m_sEncodingAESKey, ref cpid); //m_sReceiveId); + } + catch (Exception) { - var ret = 0; - if (m_sEncodingAESKey.Length != 43) - { - return (int)WXBizMsgCryptErrorCode.WXBizMsgCrypt_IllegalAesKey; - } - ret = VerifySignature(m_sToken, sTimeStamp, sNonce, sEchoStr, sMsgSignature); - if (0 != ret) - { - return ret; - } sReplyEchoStr = ""; - var cpid = ""; - try - { - sReplyEchoStr = Cryptography.AES_decrypt(sEchoStr, m_sEncodingAESKey, ref cpid); //m_sReceiveId); - } - catch (Exception) - { - sReplyEchoStr = ""; - return (int)WXBizMsgCryptErrorCode.WXBizMsgCrypt_DecryptAES_Error; - } - if (cpid != m_sReceiveId) - { - sReplyEchoStr = ""; - return (int)WXBizMsgCryptErrorCode.WXBizMsgCrypt_ValidateCorpid_Error; - } - return 0; + return (int)WXBizMsgCryptErrorCode.WXBizMsgCrypt_DecryptAES_Error; } - - // 检验消息的真实性,并且获取解密后的明文 - // @param sMsgSignature: 签名串,对应URL参数的msg_signature - // @param sTimeStamp: 时间戳,对应URL参数的timestamp - // @param sNonce: 随机串,对应URL参数的nonce - // @param sPostData: 密文,对应POST请求的数据 - // @param sMsg: 解密后的原文,当return返回0时有效 - // @return: 成功0,失败返回对应的错误码 - public int DecryptMsg(string sMsgSignature, string sTimeStamp, string sNonce, string sPostData, ref string sMsg) + if (cpid != m_sReceiveId) { - if (m_sEncodingAESKey.Length != 43) - { - return (int)WXBizMsgCryptErrorCode.WXBizMsgCrypt_IllegalAesKey; - } - var doc = new XmlDocument(); - XmlNode root; - string sEncryptMsg; - try - { - doc.LoadXml(sPostData); - root = doc.FirstChild; - sEncryptMsg = root["Encrypt"].InnerText; - } - catch (Exception) - { - return (int)WXBizMsgCryptErrorCode.WXBizMsgCrypt_ParseXml_Error; - } - //verify signature - var ret = 0; - ret = VerifySignature(m_sToken, sTimeStamp, sNonce, sEncryptMsg, sMsgSignature); - if (ret != 0) - return ret; - //decrypt - var cpid = ""; - try - { - sMsg = Cryptography.AES_decrypt(sEncryptMsg, m_sEncodingAESKey, ref cpid); - } - catch (FormatException) - { - sMsg = ""; - return (int)WXBizMsgCryptErrorCode.WXBizMsgCrypt_DecodeBase64_Error; - } - catch (Exception) - { - sMsg = ""; - return (int)WXBizMsgCryptErrorCode.WXBizMsgCrypt_DecryptAES_Error; - } - if (cpid != m_sReceiveId) - return (int)WXBizMsgCryptErrorCode.WXBizMsgCrypt_ValidateCorpid_Error; - return 0; + sReplyEchoStr = ""; + return (int)WXBizMsgCryptErrorCode.WXBizMsgCrypt_ValidateCorpid_Error; } + return 0; + } - //将企业号回复用户的消息加密打包 - // @param sReplyMsg: 企业号待回复用户的消息,xml格式的字符串 - // @param sTimeStamp: 时间戳,可以自己生成,也可以用URL参数的timestamp - // @param sNonce: 随机串,可以自己生成,也可以用URL参数的nonce - // @param sEncryptMsg: 加密后的可以直接回复用户的密文,包括msg_signature, timestamp, nonce, encrypt的xml格式的字符串, - // 当return返回0时有效 - // return:成功0,失败返回对应的错误码 - public int EncryptMsg(string sReplyMsg, string sTimeStamp, string sNonce, ref string sEncryptMsg) + // 检验消息的真实性,并且获取解密后的明文 + // @param sMsgSignature: 签名串,对应URL参数的msg_signature + // @param sTimeStamp: 时间戳,对应URL参数的timestamp + // @param sNonce: 随机串,对应URL参数的nonce + // @param sPostData: 密文,对应POST请求的数据 + // @param sMsg: 解密后的原文,当return返回0时有效 + // @return: 成功0,失败返回对应的错误码 + public int DecryptMsg(string sMsgSignature, string sTimeStamp, string sNonce, string sPostData, ref string sMsg) + { + if (m_sEncodingAESKey.Length != 43) { - if (m_sEncodingAESKey.Length != 43) - { - return (int)WXBizMsgCryptErrorCode.WXBizMsgCrypt_IllegalAesKey; - } - var raw = ""; - try - { - raw = Cryptography.AES_encrypt(sReplyMsg, m_sEncodingAESKey, m_sReceiveId); - } - catch (Exception) - { - return (int)WXBizMsgCryptErrorCode.WXBizMsgCrypt_EncryptAES_Error; - } - var MsgSigature = ""; - var ret = 0; - ret = GenarateSinature(m_sToken, sTimeStamp, sNonce, raw, ref MsgSigature); - if (0 != ret) - return ret; - sEncryptMsg = ""; - - var EncryptLabelHead = ""; - var MsgSigLabelHead = ""; - var TimeStampLabelHead = ""; - var NonceLabelHead = ""; - sEncryptMsg = sEncryptMsg + "" + EncryptLabelHead + raw + EncryptLabelTail; - sEncryptMsg = sEncryptMsg + MsgSigLabelHead + MsgSigature + MsgSigLabelTail; - sEncryptMsg = sEncryptMsg + TimeStampLabelHead + sTimeStamp + TimeStampLabelTail; - sEncryptMsg = sEncryptMsg + NonceLabelHead + sNonce + NonceLabelTail; - sEncryptMsg += ""; - return 0; + return (int)WXBizMsgCryptErrorCode.WXBizMsgCrypt_IllegalAesKey; } - - public class DictionarySort : IComparer + var doc = new XmlDocument(); + XmlNode root; + string sEncryptMsg; + try { - public int Compare(object oLeft, object oRight) - { - var sLeft = oLeft as string; - var sRight = oRight as string; - var iLeftLength = sLeft.Length; - var iRightLength = sRight.Length; - var index = 0; - while (index < iLeftLength && index < iRightLength) - { - if (sLeft[index] < sRight[index]) - return -1; - else if (sLeft[index] > sRight[index]) - return 1; - else - index++; - } - return iLeftLength - iRightLength; + doc.LoadXml(sPostData); + root = doc.FirstChild; + sEncryptMsg = root["Encrypt"].InnerText; + } + catch (Exception) + { + return (int)WXBizMsgCryptErrorCode.WXBizMsgCrypt_ParseXml_Error; + } + //verify signature + var ret = 0; + ret = VerifySignature(m_sToken, sTimeStamp, sNonce, sEncryptMsg, sMsgSignature); + if (ret != 0) + return ret; + //decrypt + var cpid = ""; + try + { + sMsg = Cryptography.AES_decrypt(sEncryptMsg, m_sEncodingAESKey, ref cpid); + } + catch (FormatException) + { + sMsg = ""; + return (int)WXBizMsgCryptErrorCode.WXBizMsgCrypt_DecodeBase64_Error; + } + catch (Exception) + { + sMsg = ""; + return (int)WXBizMsgCryptErrorCode.WXBizMsgCrypt_DecryptAES_Error; + } + if (cpid != m_sReceiveId) + return (int)WXBizMsgCryptErrorCode.WXBizMsgCrypt_ValidateCorpid_Error; + return 0; + } - } + //将企业号回复用户的消息加密打包 + // @param sReplyMsg: 企业号待回复用户的消息,xml格式的字符串 + // @param sTimeStamp: 时间戳,可以自己生成,也可以用URL参数的timestamp + // @param sNonce: 随机串,可以自己生成,也可以用URL参数的nonce + // @param sEncryptMsg: 加密后的可以直接回复用户的密文,包括msg_signature, timestamp, nonce, encrypt的xml格式的字符串, + // 当return返回0时有效 + // return:成功0,失败返回对应的错误码 + public int EncryptMsg(string sReplyMsg, string sTimeStamp, string sNonce, ref string sEncryptMsg) + { + if (m_sEncodingAESKey.Length != 43) + { + return (int)WXBizMsgCryptErrorCode.WXBizMsgCrypt_IllegalAesKey; } - //Verify Signature - private static int VerifySignature(string sToken, string sTimeStamp, string sNonce, string sMsgEncrypt, string sSigture) + var raw = ""; + try { - var hash = ""; - var ret = 0; - ret = GenarateSinature(sToken, sTimeStamp, sNonce, sMsgEncrypt, ref hash); - if (ret != 0) - return ret; - if (hash == sSigture) - return 0; - else - { - return (int)WXBizMsgCryptErrorCode.WXBizMsgCrypt_ValidateSignature_Error; - } + raw = Cryptography.AES_encrypt(sReplyMsg, m_sEncodingAESKey, m_sReceiveId); + } + catch (Exception) + { + return (int)WXBizMsgCryptErrorCode.WXBizMsgCrypt_EncryptAES_Error; } + var MsgSigature = ""; + var ret = 0; + ret = GenarateSinature(m_sToken, sTimeStamp, sNonce, raw, ref MsgSigature); + if (0 != ret) + return ret; + sEncryptMsg = ""; - public static int GenarateSinature(string sToken, string sTimeStamp, string sNonce, string sMsgEncrypt, ref string sMsgSignature) + var EncryptLabelHead = ""; + var MsgSigLabelHead = ""; + var TimeStampLabelHead = ""; + var NonceLabelHead = ""; + sEncryptMsg = sEncryptMsg + "" + EncryptLabelHead + raw + EncryptLabelTail; + sEncryptMsg = sEncryptMsg + MsgSigLabelHead + MsgSigature + MsgSigLabelTail; + sEncryptMsg = sEncryptMsg + TimeStampLabelHead + sTimeStamp + TimeStampLabelTail; + sEncryptMsg = sEncryptMsg + NonceLabelHead + sNonce + NonceLabelTail; + sEncryptMsg += ""; + return 0; + } + + public class DictionarySort : IComparer + { + public int Compare(object oLeft, object oRight) { - var AL = new ArrayList(); - AL.Add(sToken); - AL.Add(sTimeStamp); - AL.Add(sNonce); - AL.Add(sMsgEncrypt); - AL.Sort(new DictionarySort()); - var raw = ""; - for (var i = 0; i < AL.Count; ++i) + var sLeft = oLeft as string; + var sRight = oRight as string; + var iLeftLength = sLeft.Length; + var iRightLength = sRight.Length; + var index = 0; + while (index < iLeftLength && index < iRightLength) { - raw += AL[i]; + if (sLeft[index] < sRight[index]) + return -1; + else if (sLeft[index] > sRight[index]) + return 1; + else + index++; } + return iLeftLength - iRightLength; - SHA1 sha; - ASCIIEncoding enc; - var hash = ""; - try - { - sha = new SHA1CryptoServiceProvider(); - enc = new ASCIIEncoding(); - var dataToHash = enc.GetBytes(raw); - var dataHashed = sha.ComputeHash(dataToHash); - hash = BitConverter.ToString(dataHashed).Replace("-", ""); - hash = hash.ToLower(); - } - catch (Exception) - { - return (int)WXBizMsgCryptErrorCode.WXBizMsgCrypt_ComputeSignature_Error; - } - sMsgSignature = hash; + } + } + //Verify Signature + private static int VerifySignature(string sToken, string sTimeStamp, string sNonce, string sMsgEncrypt, string sSigture) + { + var hash = ""; + var ret = 0; + ret = GenarateSinature(sToken, sTimeStamp, sNonce, sMsgEncrypt, ref hash); + if (ret != 0) + return ret; + if (hash == sSigture) return 0; + else + { + return (int)WXBizMsgCryptErrorCode.WXBizMsgCrypt_ValidateSignature_Error; + } + } + + public static int GenarateSinature(string sToken, string sTimeStamp, string sNonce, string sMsgEncrypt, ref string sMsgSignature) + { + var AL = new ArrayList(); + AL.Add(sToken); + AL.Add(sTimeStamp); + AL.Add(sNonce); + AL.Add(sMsgEncrypt); + AL.Sort(new DictionarySort()); + var raw = ""; + for (var i = 0; i < AL.Count; ++i) + { + raw += AL[i]; + } + + SHA1 sha; + ASCIIEncoding enc; + var hash = ""; + try + { + sha = new SHA1CryptoServiceProvider(); + enc = new ASCIIEncoding(); + var dataToHash = enc.GetBytes(raw); + var dataHashed = sha.ComputeHash(dataToHash); + hash = BitConverter.ToString(dataHashed).Replace("-", ""); + hash = hash.ToLower(); + } + catch (Exception) + { + return (int)WXBizMsgCryptErrorCode.WXBizMsgCrypt_ComputeSignature_Error; } + sMsgSignature = hash; + return 0; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN.Abp.WeChat.MiniProgram.csproj b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN.Abp.WeChat.MiniProgram.csproj index 6e6aa572b..b733d2855 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN.Abp.WeChat.MiniProgram.csproj +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN.Abp.WeChat.MiniProgram.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.WeChat.MiniProgram + LINGYUN.Abp.WeChat.MiniProgram + false + false + false diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/AbpWeChatMiniProgramConsts.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/AbpWeChatMiniProgramConsts.cs index 54f1773a0..918c53c73 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/AbpWeChatMiniProgramConsts.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/AbpWeChatMiniProgramConsts.cs @@ -1,21 +1,20 @@ -namespace LINGYUN.Abp.WeChat.MiniProgram +namespace LINGYUN.Abp.WeChat.MiniProgram; + +public class AbpWeChatMiniProgramConsts { - public class AbpWeChatMiniProgramConsts - { - /// - /// 微信小程序对应的Provider名称 - /// - public static string ProviderName { get; set; } = "WeChat.MiniProgram"; + /// + /// 微信小程序对应的Provider名称 + /// + public static string ProviderName { get; set; } = "WeChat.MiniProgram"; - /// - /// 微信小程序授权类型 - /// - public static string GrantType { get; set; } = "wx-mp"; + /// + /// 微信小程序授权类型 + /// + public static string GrantType { get; set; } = "wx-mp"; - /// - /// 微信小程序授权方法名称 - /// - public static string AuthenticationMethod { get; set; } = "wma"; - public static string HttpClient { get; set; } = "Abp.WeChat.MiniProgram"; - } + /// + /// 微信小程序授权方法名称 + /// + public static string AuthenticationMethod { get; set; } = "wma"; + public static string HttpClient { get; set; } = "Abp.WeChat.MiniProgram"; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/AbpWeChatMiniProgramModule.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/AbpWeChatMiniProgramModule.cs index 23b2cfe99..e31dc6abf 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/AbpWeChatMiniProgramModule.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/AbpWeChatMiniProgramModule.cs @@ -6,33 +6,32 @@ using Volo.Abp.Modularity; using Volo.Abp.VirtualFileSystem; -namespace LINGYUN.Abp.WeChat.MiniProgram +namespace LINGYUN.Abp.WeChat.MiniProgram; + +[DependsOn( + typeof(AbpWeChatModule), + typeof(AbpFeaturesLimitValidationModule))] +public class AbpWeChatMiniProgramModule : AbpModule { - [DependsOn( - typeof(AbpWeChatModule), - typeof(AbpFeaturesLimitValidationModule))] - public class AbpWeChatMiniProgramModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + Configure(options => { - Configure(options => - { - options.FileSets.AddEmbedded(); - }); + options.FileSets.AddEmbedded(); + }); - Configure(options => - { - options.Resources - .Get() - .AddVirtualJson("/LINGYUN/Abp/WeChat/MiniProgram/Localization/Resources"); - }); + Configure(options => + { + options.Resources + .Get() + .AddVirtualJson("/LINGYUN/Abp/WeChat/MiniProgram/Localization/Resources"); + }); - context.Services.AddHttpClient(AbpWeChatMiniProgramConsts.HttpClient, options => - { - options.BaseAddress = new Uri("https://api.weixin.qq.com"); - }); + context.Services.AddHttpClient(AbpWeChatMiniProgramConsts.HttpClient, options => + { + options.BaseAddress = new Uri("https://api.weixin.qq.com"); + }); - context.Services.AddAbpDynamicOptions(); - } + context.Services.AddAbpDynamicOptions(); } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/AbpWeChatMiniProgramOptions.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/AbpWeChatMiniProgramOptions.cs index b7fd0df83..b68cc58bd 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/AbpWeChatMiniProgramOptions.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/AbpWeChatMiniProgramOptions.cs @@ -1,22 +1,21 @@ -namespace LINGYUN.Abp.WeChat.MiniProgram +namespace LINGYUN.Abp.WeChat.MiniProgram; + +public class AbpWeChatMiniProgramOptions { - public class AbpWeChatMiniProgramOptions - { - /// - /// 小程序AppId - /// - public string AppId { get; set; } - /// - /// 小程序AppSecret - /// - public string AppSecret { get; set; } - /// - /// 小程序消息解密Token - /// - public string Token { get; set; } - /// - /// 小程序消息解密AESKey - /// - public string EncodingAESKey { get; set; } - } + /// + /// 小程序AppId + /// + public string AppId { get; set; } + /// + /// 小程序AppSecret + /// + public string AppSecret { get; set; } + /// + /// 小程序消息解密Token + /// + public string Token { get; set; } + /// + /// 小程序消息解密AESKey + /// + public string EncodingAESKey { get; set; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/AbpWeChatMiniProgramOptionsFactory.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/AbpWeChatMiniProgramOptionsFactory.cs index 16d9951f5..485e8abbb 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/AbpWeChatMiniProgramOptionsFactory.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/AbpWeChatMiniProgramOptionsFactory.cs @@ -2,23 +2,22 @@ using System.Threading.Tasks; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.WeChat.MiniProgram +namespace LINGYUN.Abp.WeChat.MiniProgram; + +public class AbpWeChatMiniProgramOptionsFactory : ITransientDependency { - public class AbpWeChatMiniProgramOptionsFactory : ITransientDependency - { - protected IOptions Options { get; } + protected IOptions Options { get; } - public AbpWeChatMiniProgramOptionsFactory( - IOptions options) - { - Options = options; - } + public AbpWeChatMiniProgramOptionsFactory( + IOptions options) + { + Options = options; + } - public async virtual Task CreateAsync() - { - await Options.SetAsync(); + public async virtual Task CreateAsync() + { + await Options.SetAsync(); - return Options.Value; - } + return Options.Value; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/AbpWeChatMiniProgramOptionsManager.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/AbpWeChatMiniProgramOptionsManager.cs index 1f6d26ce8..81470dbad 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/AbpWeChatMiniProgramOptionsManager.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/AbpWeChatMiniProgramOptionsManager.cs @@ -4,31 +4,30 @@ using Volo.Abp.Options; using Volo.Abp.Settings; -namespace LINGYUN.Abp.WeChat.MiniProgram +namespace LINGYUN.Abp.WeChat.MiniProgram; + +public class AbpWeChatMiniProgramOptionsManager : AbpDynamicOptionsManager { - public class AbpWeChatMiniProgramOptionsManager : AbpDynamicOptionsManager - { - protected ISettingProvider SettingProvider { get; } + protected ISettingProvider SettingProvider { get; } - public AbpWeChatMiniProgramOptionsManager( - ISettingProvider settingProvider, - IOptionsFactory factory) - : base(factory) - { - SettingProvider = settingProvider; - } + public AbpWeChatMiniProgramOptionsManager( + ISettingProvider settingProvider, + IOptionsFactory factory) + : base(factory) + { + SettingProvider = settingProvider; + } - protected override async Task OverrideOptionsAsync(string name, AbpWeChatMiniProgramOptions options) - { - var appId = await SettingProvider.GetOrNullAsync(WeChatMiniProgramSettingNames.AppId); - var appSecret = await SettingProvider.GetOrNullAsync(WeChatMiniProgramSettingNames.AppSecret); - var token = await SettingProvider.GetOrNullAsync(WeChatMiniProgramSettingNames.Token); - var aesKey = await SettingProvider.GetOrNullAsync(WeChatMiniProgramSettingNames.EncodingAESKey); + protected override async Task OverrideOptionsAsync(string name, AbpWeChatMiniProgramOptions options) + { + var appId = await SettingProvider.GetOrNullAsync(WeChatMiniProgramSettingNames.AppId); + var appSecret = await SettingProvider.GetOrNullAsync(WeChatMiniProgramSettingNames.AppSecret); + var token = await SettingProvider.GetOrNullAsync(WeChatMiniProgramSettingNames.Token); + var aesKey = await SettingProvider.GetOrNullAsync(WeChatMiniProgramSettingNames.EncodingAESKey); - options.AppId = appId ?? options.AppId; - options.AppSecret = appSecret ?? options.AppSecret; - options.Token = token ?? options.Token; - options.EncodingAESKey = aesKey ?? options.EncodingAESKey; - } + options.AppId = appId ?? options.AppId; + options.AppSecret = appSecret ?? options.AppSecret; + options.Token = token ?? options.Token; + options.EncodingAESKey = aesKey ?? options.EncodingAESKey; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Features/WeChatMiniProgramFeatureDefinitionProvider.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Features/WeChatMiniProgramFeatureDefinitionProvider.cs index b94e905eb..2a5056683 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Features/WeChatMiniProgramFeatureDefinitionProvider.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Features/WeChatMiniProgramFeatureDefinitionProvider.cs @@ -4,56 +4,55 @@ using Volo.Abp.Localization; using Volo.Abp.Validation.StringValues; -namespace LINGYUN.Abp.WeChat.MiniProgram.Features +namespace LINGYUN.Abp.WeChat.MiniProgram.Features; + +public class WeChatMiniProgramFeatureDefinitionProvider : FeatureDefinitionProvider { - public class WeChatMiniProgramFeatureDefinitionProvider : FeatureDefinitionProvider + public override void Define(IFeatureDefinitionContext context) { - public override void Define(IFeatureDefinitionContext context) - { - var group = context.GetGroupOrNull(WeChatFeatures.GroupName); + var group = context.GetGroupOrNull(WeChatFeatures.GroupName); - //var miniProgram = group.AddFeature( - // name: WeChatMiniProgramFeatures.GroupName, - // displayName: L("Features:WeChat.MiniProgram"), - // description: L("Features:WeChat.MiniProgramDesc")); + //var miniProgram = group.AddFeature( + // name: WeChatMiniProgramFeatures.GroupName, + // displayName: L("Features:WeChat.MiniProgram"), + // description: L("Features:WeChat.MiniProgramDesc")); - var miniProgramEnableFeature = group.AddFeature( - name: WeChatMiniProgramFeatures.Enable, - defaultValue: true.ToString(), - displayName: L("Features:WeChat.MiniProgram.Enable"), - description: L("Features:WeChat.MiniProgram.EnableDesc"), - valueType: new ToggleStringValueType(new BooleanValueValidator())); - miniProgramEnableFeature.CreateChild( - name: WeChatMiniProgramFeatures.EnableAuthorization, - defaultValue: true.ToString(), - displayName: L("Features:WeChat.MiniProgram.EnableAuthorization"), - description: L("Features:WeChat.MiniProgram.EnableAuthorizationDesc"), - valueType: new ToggleStringValueType(new BooleanValueValidator())); + var miniProgramEnableFeature = group.AddFeature( + name: WeChatMiniProgramFeatures.Enable, + defaultValue: true.ToString(), + displayName: L("Features:WeChat.MiniProgram.Enable"), + description: L("Features:WeChat.MiniProgram.EnableDesc"), + valueType: new ToggleStringValueType(new BooleanValueValidator())); + miniProgramEnableFeature.CreateChild( + name: WeChatMiniProgramFeatures.EnableAuthorization, + defaultValue: true.ToString(), + displayName: L("Features:WeChat.MiniProgram.EnableAuthorization"), + description: L("Features:WeChat.MiniProgram.EnableAuthorizationDesc"), + valueType: new ToggleStringValueType(new BooleanValueValidator())); - var messageEnableFeature = group.AddFeature( - name: WeChatMiniProgramFeatures.Messages.Enable, - defaultValue: true.ToString(), - displayName: L("Features:WeChat.MiniProgram.EnableMessages"), - description: L("Features:WeChat.MiniProgram.EnableMessagesDesc"), - valueType: new ToggleStringValueType(new BooleanValueValidator())); - messageEnableFeature.CreateChild( - name: WeChatMiniProgramFeatures.Messages.SendLimit, - defaultValue: WeChatMiniProgramFeatures.Messages.DefaultSendLimit.ToString(), - displayName: L("Features:WeChat.MiniProgram.SendLimit"), - description: L("Features:WeChat.MiniProgram.SendLimitDesc"), - valueType: new FreeTextStringValueType(new NumericValueValidator(1, 100_0000))); - messageEnableFeature.CreateChild( - name: WeChatMiniProgramFeatures.Messages.SendLimitInterval, - defaultValue: WeChatMiniProgramFeatures.Messages.DefaultSendLimitInterval.ToString(), - displayName: L("Features:WeChat.MiniProgram.SendLimitInterval"), - description: L("Features:WeChat.MiniProgram.SendLimitIntervalDesc"), - valueType: new FreeTextStringValueType(new NumericValueValidator(1, 100_0000))); - } + var messageEnableFeature = group.AddFeature( + name: WeChatMiniProgramFeatures.Messages.Enable, + defaultValue: true.ToString(), + displayName: L("Features:WeChat.MiniProgram.EnableMessages"), + description: L("Features:WeChat.MiniProgram.EnableMessagesDesc"), + valueType: new ToggleStringValueType(new BooleanValueValidator())); + messageEnableFeature.CreateChild( + name: WeChatMiniProgramFeatures.Messages.SendLimit, + defaultValue: WeChatMiniProgramFeatures.Messages.DefaultSendLimit.ToString(), + displayName: L("Features:WeChat.MiniProgram.SendLimit"), + description: L("Features:WeChat.MiniProgram.SendLimitDesc"), + valueType: new FreeTextStringValueType(new NumericValueValidator(1, 100_0000))); + messageEnableFeature.CreateChild( + name: WeChatMiniProgramFeatures.Messages.SendLimitInterval, + defaultValue: WeChatMiniProgramFeatures.Messages.DefaultSendLimitInterval.ToString(), + displayName: L("Features:WeChat.MiniProgram.SendLimitInterval"), + description: L("Features:WeChat.MiniProgram.SendLimitIntervalDesc"), + valueType: new FreeTextStringValueType(new NumericValueValidator(1, 100_0000))); + } - protected LocalizableString L(string name) - { - return LocalizableString.Create(name); - } + protected LocalizableString L(string name) + { + return LocalizableString.Create(name); } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Features/WeChatMiniProgramFeatures.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Features/WeChatMiniProgramFeatures.cs index 5f43f23b6..14fd01a4c 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Features/WeChatMiniProgramFeatures.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Features/WeChatMiniProgramFeatures.cs @@ -1,36 +1,35 @@ using LINGYUN.Abp.WeChat.Features; -namespace LINGYUN.Abp.WeChat.MiniProgram.Features +namespace LINGYUN.Abp.WeChat.MiniProgram.Features; + +public static class WeChatMiniProgramFeatures { - public static class WeChatMiniProgramFeatures - { - public const string GroupName = WeChatFeatures.GroupName + ".MiniProgram"; + public const string GroupName = WeChatFeatures.GroupName + ".MiniProgram"; - public const string Enable = GroupName + ".Enable"; + public const string Enable = GroupName + ".Enable"; - public const string EnableAuthorization = GroupName + ".EnableAuthorization"; + public const string EnableAuthorization = GroupName + ".EnableAuthorization"; - public static class Messages - { - public const string Default = GroupName + ".Messages"; + public static class Messages + { + public const string Default = GroupName + ".Messages"; - public const string Enable = Default + ".Enable"; - /// - /// 发送次数上限 - /// - public const string SendLimit = Default + ".SendLimit"; - /// - /// 发送次数上限时长 - /// - public const string SendLimitInterval = Default + ".SendLimitInterval"; - /// - /// 默认发布次数上限 - /// - public const int DefaultSendLimit = 1000; - /// - /// 默认发布次数上限时长 - /// - public const int DefaultSendLimitInterval = 1; - } + public const string Enable = Default + ".Enable"; + /// + /// 发送次数上限 + /// + public const string SendLimit = Default + ".SendLimit"; + /// + /// 发送次数上限时长 + /// + public const string SendLimitInterval = Default + ".SendLimitInterval"; + /// + /// 默认发布次数上限 + /// + public const int DefaultSendLimit = 1000; + /// + /// 默认发布次数上限时长 + /// + public const int DefaultSendLimitInterval = 1; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/ISubscribeMessager.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/ISubscribeMessager.cs index b9e8e5b49..42b7318e0 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/ISubscribeMessager.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/ISubscribeMessager.cs @@ -3,42 +3,41 @@ using System.Threading; using System.Threading.Tasks; -namespace LINGYUN.Abp.WeChat.MiniProgram.Messages +namespace LINGYUN.Abp.WeChat.MiniProgram.Messages; + +/// +/// 小程序模板消息 +/// 详情: https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/subscribe-message/subscribeMessage.send.html +/// +/// +/// 暂时仅实现发送订阅消息 +/// +public interface ISubscribeMessager { /// - /// 小程序模板消息 - /// 详情: https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/subscribe-message/subscribeMessage.send.html + /// 发送订阅消息 + /// + /// + /// + /// + Task SendAsync(SubscribeMessage message, CancellationToken cancellation = default); + /// + /// 发送订阅消息 /// - /// - /// 暂时仅实现发送订阅消息 - /// - public interface ISubscribeMessager - { - /// - /// 发送订阅消息 - /// - /// - /// - /// - Task SendAsync(SubscribeMessage message, CancellationToken cancellation = default); - /// - /// 发送订阅消息 - /// - /// 用户 - /// 模板 - /// 跳转页面 - /// 语言 - /// 类型 - /// 数据 - /// - /// - Task SendAsync( - Guid toUser, - string templateId, - string page = "", - string lang = "zh_CN", - string state = "formal", - Dictionary data = null, - CancellationToken cancellation = default); - } + /// 用户 + /// 模板 + /// 跳转页面 + /// 语言 + /// 类型 + /// 数据 + /// + /// + Task SendAsync( + Guid toUser, + string templateId, + string page = "", + string lang = "zh_CN", + string state = "formal", + Dictionary data = null, + CancellationToken cancellation = default); } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/Response.SubscribeMessage.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/Response.SubscribeMessage.cs index eb1dd58a5..e737e42c6 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/Response.SubscribeMessage.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/Response.SubscribeMessage.cs @@ -1,24 +1,23 @@ using Newtonsoft.Json; using Volo.Abp; -namespace LINGYUN.Abp.WeChat.MiniProgram.Messages +namespace LINGYUN.Abp.WeChat.MiniProgram.Messages; + +public class SubscribeMessageResponse { - public class SubscribeMessageResponse - { - [JsonProperty("errcode")] - public int ErrorCode { get; set; } + [JsonProperty("errcode")] + public int ErrorCode { get; set; } - [JsonProperty("errmsg")] - public string ErrorMessage { get; set; } + [JsonProperty("errmsg")] + public string ErrorMessage { get; set; } - public bool IsSuccessed => ErrorCode == 0; + public bool IsSuccessed => ErrorCode == 0; - public void ThrowIfNotSuccess() + public void ThrowIfNotSuccess() + { + if (ErrorCode != 0) { - if (ErrorCode != 0) - { - throw new AbpException($"Send wechat weapp notification error:{ErrorMessage}"); - } + throw new AbpException($"Send wechat weapp notification error:{ErrorMessage}"); } } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/SubscribeMessage.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/SubscribeMessage.cs index 36d27397c..6f97c77a9 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/SubscribeMessage.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/SubscribeMessage.cs @@ -1,106 +1,105 @@ using Newtonsoft.Json; using System.Collections.Generic; -namespace LINGYUN.Abp.WeChat.MiniProgram.Messages +namespace LINGYUN.Abp.WeChat.MiniProgram.Messages; + +public class SubscribeMessage { - public class SubscribeMessage - { - /// - /// 接收者(用户)的 openid - /// - [JsonProperty("touser")] - public string ToUser { get; set; } - /// - /// 所需下发的订阅模板id - /// - [JsonProperty("template_id")] - public string TemplateId { get; set; } - /// - /// 点击模板卡片后的跳转页面,仅限本小程序内的页面。 - /// 支持带参数,(示例index?foo=bar)。 - /// 该字段不填则模板无跳转 - /// - [JsonProperty("page")] - public string Page { get; set; } - /// - /// 跳转小程序类型: - /// developer为开发版;trial为体验版;formal为正式版; - /// 默认为正式版 - /// - [JsonProperty("miniprogram_state")] - public string MiniProgramState { get; set; } - /// - /// 进入小程序查看”的语言类型, - /// 支持zh_CN(简体中文)、en_US(英文)、zh_HK(繁体中文)、zh_TW(繁体中文), - /// 默认为zh_CN - /// - [JsonProperty("lang")] - public string Lang { get; set; } = "zh_CN"; - /// - /// 模板内容, - /// 格式形如 { "key1": { "value": any }, "key2": { "value": any } } - /// - [JsonProperty("data")] - public Dictionary Data { get; set; } = new Dictionary(); + /// + /// 接收者(用户)的 openid + /// + [JsonProperty("touser")] + public string ToUser { get; set; } + /// + /// 所需下发的订阅模板id + /// + [JsonProperty("template_id")] + public string TemplateId { get; set; } + /// + /// 点击模板卡片后的跳转页面,仅限本小程序内的页面。 + /// 支持带参数,(示例index?foo=bar)。 + /// 该字段不填则模板无跳转 + /// + [JsonProperty("page")] + public string Page { get; set; } + /// + /// 跳转小程序类型: + /// developer为开发版;trial为体验版;formal为正式版; + /// 默认为正式版 + /// + [JsonProperty("miniprogram_state")] + public string MiniProgramState { get; set; } + /// + /// 进入小程序查看”的语言类型, + /// 支持zh_CN(简体中文)、en_US(英文)、zh_HK(繁体中文)、zh_TW(繁体中文), + /// 默认为zh_CN + /// + [JsonProperty("lang")] + public string Lang { get; set; } = "zh_CN"; + /// + /// 模板内容, + /// 格式形如 { "key1": { "value": any }, "key2": { "value": any } } + /// + [JsonProperty("data")] + public Dictionary Data { get; set; } = new Dictionary(); - public SubscribeMessage() { } - public SubscribeMessage( - string openId, - string templateId, - string redirectPage = "", - string state = "formal", - string miniLang = "zh_CN") - { - ToUser = openId; - TemplateId = templateId; - Page = redirectPage; - MiniProgramState = state; - Lang = miniLang; - } + public SubscribeMessage() { } + public SubscribeMessage( + string openId, + string templateId, + string redirectPage = "", + string state = "formal", + string miniLang = "zh_CN") + { + ToUser = openId; + TemplateId = templateId; + Page = redirectPage; + MiniProgramState = state; + Lang = miniLang; + } - public SubscribeMessage WriteData(string prefix, string key, object value) + public SubscribeMessage WriteData(string prefix, string key, object value) + { + // 只截取符合标记的数据 + if (key.StartsWith(prefix)) { - // 只截取符合标记的数据 - if (key.StartsWith(prefix)) + key = key.Replace(prefix, ""); + if (!Data.ContainsKey(key)) { - key = key.Replace(prefix, ""); - if (!Data.ContainsKey(key)) - { - Data.Add(key, new MessageData(value)); - } + Data.Add(key, new MessageData(value)); } - return this; } + return this; + } - public SubscribeMessage WriteData(string prefix, IDictionary setData) + public SubscribeMessage WriteData(string prefix, IDictionary setData) + { + foreach (var kv in setData) { - foreach (var kv in setData) - { - WriteData(prefix, kv.Key, kv.Value); - } - return this; + WriteData(prefix, kv.Key, kv.Value); } + return this; + } - public SubscribeMessage WriteData(IDictionary setData) + public SubscribeMessage WriteData(IDictionary setData) + { + foreach (var kv in setData) { - foreach (var kv in setData) + if (!Data.ContainsKey(kv.Key)) { - if (!Data.ContainsKey(kv.Key)) - { - Data.Add(kv.Key, new MessageData(kv.Value)); - } + Data.Add(kv.Key, new MessageData(kv.Value)); } - return this; } + return this; } +} - public class MessageData - { - public object Value { get; } +public class MessageData +{ + public object Value { get; } - public MessageData(object value) - { - Value = value; - } + public MessageData(object value) + { + Value = value; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/SubscribeMessager.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/SubscribeMessager.cs index 16679b195..643efbb50 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/SubscribeMessager.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Messages/SubscribeMessager.cs @@ -15,119 +15,118 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.Features; -namespace LINGYUN.Abp.WeChat.MiniProgram.Messages +namespace LINGYUN.Abp.WeChat.MiniProgram.Messages; + +[RequiresFeature(WeChatMiniProgramFeatures.Enable)] +public class SubscribeMessager : ISubscribeMessager, ITransientDependency { - [RequiresFeature(WeChatMiniProgramFeatures.Enable)] - public class SubscribeMessager : ISubscribeMessager, ITransientDependency + public ILogger Logger { get; set; } + protected IHttpClientFactory HttpClientFactory { get; } + protected AbpWeChatMiniProgramOptionsFactory MiniProgramOptionsFactory { get; } + protected IWeChatTokenProvider WeChatTokenProvider { get; } + protected IUserWeChatOpenIdFinder UserWeChatOpenIdFinder { get; } + public SubscribeMessager( + IHttpClientFactory httpClientFactory, + IWeChatTokenProvider weChatTokenProvider, + IUserWeChatOpenIdFinder userWeChatOpenIdFinder, + AbpWeChatMiniProgramOptionsFactory miniProgramOptionsFactory) { - public ILogger Logger { get; set; } - protected IHttpClientFactory HttpClientFactory { get; } - protected AbpWeChatMiniProgramOptionsFactory MiniProgramOptionsFactory { get; } - protected IWeChatTokenProvider WeChatTokenProvider { get; } - protected IUserWeChatOpenIdFinder UserWeChatOpenIdFinder { get; } - public SubscribeMessager( - IHttpClientFactory httpClientFactory, - IWeChatTokenProvider weChatTokenProvider, - IUserWeChatOpenIdFinder userWeChatOpenIdFinder, - AbpWeChatMiniProgramOptionsFactory miniProgramOptionsFactory) - { - HttpClientFactory = httpClientFactory; - WeChatTokenProvider = weChatTokenProvider; - UserWeChatOpenIdFinder = userWeChatOpenIdFinder; - MiniProgramOptionsFactory = miniProgramOptionsFactory; + HttpClientFactory = httpClientFactory; + WeChatTokenProvider = weChatTokenProvider; + UserWeChatOpenIdFinder = userWeChatOpenIdFinder; + MiniProgramOptionsFactory = miniProgramOptionsFactory; - Logger = NullLogger.Instance; - } + Logger = NullLogger.Instance; + } - [RequiresFeature(WeChatMiniProgramFeatures.Messages.Enable)] - [RequiresLimitFeature( - WeChatMiniProgramFeatures.Messages.SendLimit, - WeChatMiniProgramFeatures.Messages.SendLimitInterval, - LimitPolicy.Month, - WeChatMiniProgramFeatures.Messages.DefaultSendLimit)] - public async virtual Task SendAsync( - Guid toUser, - string templateId, - string page = "", - string lang = "zh_CN", - string state = "formal", - Dictionary data = null, - CancellationToken cancellation = default) + [RequiresFeature(WeChatMiniProgramFeatures.Messages.Enable)] + [RequiresLimitFeature( + WeChatMiniProgramFeatures.Messages.SendLimit, + WeChatMiniProgramFeatures.Messages.SendLimitInterval, + LimitPolicy.Month, + WeChatMiniProgramFeatures.Messages.DefaultSendLimit)] + public async virtual Task SendAsync( + Guid toUser, + string templateId, + string page = "", + string lang = "zh_CN", + string state = "formal", + Dictionary data = null, + CancellationToken cancellation = default) + { + var openId = await UserWeChatOpenIdFinder.FindByUserIdAsync(toUser, AbpWeChatMiniProgramConsts.ProviderName); + if (openId.IsNullOrWhiteSpace()) { - var openId = await UserWeChatOpenIdFinder.FindByUserIdAsync(toUser, AbpWeChatMiniProgramConsts.ProviderName); - if (openId.IsNullOrWhiteSpace()) - { - Logger.LogWarning("Can not found openId, Unable to send WeChat message!"); - return; - } - var messageData = new SubscribeMessage(openId, templateId, page, state, lang); - if (data != null) - { - messageData.WriteData(data); - } - await SendAsync(messageData, cancellation); + Logger.LogWarning("Can not found openId, Unable to send WeChat message!"); + return; } - - [RequiresFeature(WeChatMiniProgramFeatures.Messages.Enable)] - [RequiresLimitFeature( - WeChatMiniProgramFeatures.Messages.SendLimit, - WeChatMiniProgramFeatures.Messages.SendLimitInterval, - LimitPolicy.Month, - WeChatMiniProgramFeatures.Messages.DefaultSendLimit)] - public async virtual Task SendAsync(SubscribeMessage message, CancellationToken cancellationToken = default) + var messageData = new SubscribeMessage(openId, templateId, page, state, lang); + if (data != null) { - var options = await MiniProgramOptionsFactory.CreateAsync(); + messageData.WriteData(data); + } + await SendAsync(messageData, cancellation); + } - var weChatToken = await WeChatTokenProvider.GetTokenAsync(options.AppId, options.AppSecret, cancellationToken); - var requestParamters = new Dictionary - { - { "access_token", weChatToken.AccessToken } - }; - var weChatSendNotificationUrl = "https://api.weixin.qq.com"; - var weChatSendNotificationPath = "/cgi-bin/message/subscribe/send"; - var requestUrl = BuildRequestUrl(weChatSendNotificationUrl, weChatSendNotificationPath, requestParamters); - var responseContent = await MakeRequestAndGetResultAsync(requestUrl, message, cancellationToken); - var response = JsonConvert.DeserializeObject(responseContent); + [RequiresFeature(WeChatMiniProgramFeatures.Messages.Enable)] + [RequiresLimitFeature( + WeChatMiniProgramFeatures.Messages.SendLimit, + WeChatMiniProgramFeatures.Messages.SendLimitInterval, + LimitPolicy.Month, + WeChatMiniProgramFeatures.Messages.DefaultSendLimit)] + public async virtual Task SendAsync(SubscribeMessage message, CancellationToken cancellationToken = default) + { + var options = await MiniProgramOptionsFactory.CreateAsync(); - if (!response.IsSuccessed) - { - Logger.LogWarning("Send wechat we app subscribe message failed"); - Logger.LogWarning($"Error code: {response.ErrorCode}, message: {response.ErrorMessage}"); - } - } + var weChatToken = await WeChatTokenProvider.GetTokenAsync(options.AppId, options.AppSecret, cancellationToken); + var requestParamters = new Dictionary + { + { "access_token", weChatToken.AccessToken } + }; + var weChatSendNotificationUrl = "https://api.weixin.qq.com"; + var weChatSendNotificationPath = "/cgi-bin/message/subscribe/send"; + var requestUrl = BuildRequestUrl(weChatSendNotificationUrl, weChatSendNotificationPath, requestParamters); + var responseContent = await MakeRequestAndGetResultAsync(requestUrl, message, cancellationToken); + var response = JsonConvert.DeserializeObject(responseContent); - protected async virtual Task MakeRequestAndGetResultAsync(string url, SubscribeMessage message, CancellationToken cancellationToken = default) + if (!response.IsSuccessed) { - var client = HttpClientFactory.CreateClient(AbpWeChatMiniProgramConsts.HttpClient); - var sendDataContent = JsonConvert.SerializeObject(message); - var requestContent = new StringContent(sendDataContent); - var requestMessage = new HttpRequestMessage(HttpMethod.Post, url) - { - Content = requestContent - }; + Logger.LogWarning("Send wechat we app subscribe message failed"); + Logger.LogWarning($"Error code: {response.ErrorCode}, message: {response.ErrorMessage}"); + } + } - var response = await client.SendAsync(requestMessage, cancellationToken); - if (!response.IsSuccessStatusCode) - { - throw new AbpException($"WeChat send subscribe message http request service returns error! HttpStatusCode: {response.StatusCode}, ReasonPhrase: {response.ReasonPhrase}"); - } - var resultContent = await response.Content.ReadAsStringAsync(); + protected async virtual Task MakeRequestAndGetResultAsync(string url, SubscribeMessage message, CancellationToken cancellationToken = default) + { + var client = HttpClientFactory.CreateClient(AbpWeChatMiniProgramConsts.HttpClient); + var sendDataContent = JsonConvert.SerializeObject(message); + var requestContent = new StringContent(sendDataContent); + var requestMessage = new HttpRequestMessage(HttpMethod.Post, url) + { + Content = requestContent + }; - return resultContent; + var response = await client.SendAsync(requestMessage, cancellationToken); + if (!response.IsSuccessStatusCode) + { + throw new AbpException($"WeChat send subscribe message http request service returns error! HttpStatusCode: {response.StatusCode}, ReasonPhrase: {response.ReasonPhrase}"); } + var resultContent = await response.Content.ReadAsStringAsync(); + + return resultContent; + } - protected virtual string BuildRequestUrl(string uri, string path, IDictionary paramters) + protected virtual string BuildRequestUrl(string uri, string path, IDictionary paramters) + { + var requestUrlBuilder = new StringBuilder(128); + requestUrlBuilder.Append(uri); + requestUrlBuilder.Append(path).Append("?"); + foreach (var paramter in paramters) { - var requestUrlBuilder = new StringBuilder(128); - requestUrlBuilder.Append(uri); - requestUrlBuilder.Append(path).Append("?"); - foreach (var paramter in paramters) - { - requestUrlBuilder.AppendFormat("{0}={1}", paramter.Key, paramter.Value); - requestUrlBuilder.Append("&"); - } - requestUrlBuilder.Remove(requestUrlBuilder.Length - 1, 1); - return requestUrlBuilder.ToString(); + requestUrlBuilder.AppendFormat("{0}={1}", paramter.Key, paramter.Value); + requestUrlBuilder.Append("&"); } + requestUrlBuilder.Remove(requestUrlBuilder.Length - 1, 1); + return requestUrlBuilder.ToString(); } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Settings/WeChatMiniProgramSettingDefinitionProvider.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Settings/WeChatMiniProgramSettingDefinitionProvider.cs index f5bb7ec4d..f01767e8f 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Settings/WeChatMiniProgramSettingDefinitionProvider.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Settings/WeChatMiniProgramSettingDefinitionProvider.cs @@ -2,63 +2,62 @@ using Volo.Abp.Localization; using Volo.Abp.Settings; -namespace LINGYUN.Abp.WeChat.MiniProgram.Settings +namespace LINGYUN.Abp.WeChat.MiniProgram.Settings; + +public class WeChatMiniProgramSettingDefinitionProvider : SettingDefinitionProvider { - public class WeChatMiniProgramSettingDefinitionProvider : SettingDefinitionProvider + public override void Define(ISettingDefinitionContext context) { - public override void Define(ISettingDefinitionContext context) - { - context.Add( - new SettingDefinition( - WeChatMiniProgramSettingNames.AppId, "", - L("DisplayName:WeChat.MiniProgram.AppId"), - L("Description:WeChat.MiniProgram.AppId"), - isVisibleToClients: false, - isEncrypted: true) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName), - new SettingDefinition( - WeChatMiniProgramSettingNames.AppSecret, "", - L("DisplayName:WeChat.MiniProgram.AppSecret"), - L("Description:WeChat.MiniProgram.AppSecret"), - isVisibleToClients: false, - isEncrypted: true) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName), - new SettingDefinition( - WeChatMiniProgramSettingNames.Token, "", - L("DisplayName:WeChat.MiniProgram.Token"), - L("Description:WeChat.MiniProgram.Token"), - isVisibleToClients: false, - isEncrypted: true) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName), - new SettingDefinition( - WeChatMiniProgramSettingNames.EncodingAESKey, "", - L("DisplayName:WeChat.MiniProgram.EncodingAESKey"), - L("Description:WeChat.MiniProgram.EncodingAESKey"), - isVisibleToClients: false, - isEncrypted: true) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName) - ); - } + context.Add( + new SettingDefinition( + WeChatMiniProgramSettingNames.AppId, "", + L("DisplayName:WeChat.MiniProgram.AppId"), + L("Description:WeChat.MiniProgram.AppId"), + isVisibleToClients: false, + isEncrypted: true) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName), + new SettingDefinition( + WeChatMiniProgramSettingNames.AppSecret, "", + L("DisplayName:WeChat.MiniProgram.AppSecret"), + L("Description:WeChat.MiniProgram.AppSecret"), + isVisibleToClients: false, + isEncrypted: true) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName), + new SettingDefinition( + WeChatMiniProgramSettingNames.Token, "", + L("DisplayName:WeChat.MiniProgram.Token"), + L("Description:WeChat.MiniProgram.Token"), + isVisibleToClients: false, + isEncrypted: true) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName), + new SettingDefinition( + WeChatMiniProgramSettingNames.EncodingAESKey, "", + L("DisplayName:WeChat.MiniProgram.EncodingAESKey"), + L("Description:WeChat.MiniProgram.EncodingAESKey"), + isVisibleToClients: false, + isEncrypted: true) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName) + ); + } - protected ILocalizableString L(string name) - { - return LocalizableString.Create(name); - } + protected ILocalizableString L(string name) + { + return LocalizableString.Create(name); } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Settings/WeChatMiniProgramSettingNames.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Settings/WeChatMiniProgramSettingNames.cs index 65275d510..9b4b58abd 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Settings/WeChatMiniProgramSettingNames.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.MiniProgram/LINGYUN/Abp/WeChat/MiniProgram/Settings/WeChatMiniProgramSettingNames.cs @@ -1,14 +1,13 @@ using LINGYUN.Abp.WeChat.Settings; -namespace LINGYUN.Abp.WeChat.MiniProgram.Settings +namespace LINGYUN.Abp.WeChat.MiniProgram.Settings; + +public class WeChatMiniProgramSettingNames { - public class WeChatMiniProgramSettingNames - { - private const string Prefix = WeChatSettingNames.Prefix + ".MiniProgram"; + private const string Prefix = WeChatSettingNames.Prefix + ".MiniProgram"; - public static string AppId = Prefix + "." + nameof(AbpWeChatMiniProgramOptions.AppId); - public static string AppSecret = Prefix + "." + nameof(AbpWeChatMiniProgramOptions.AppSecret); - public static string Token = Prefix + "." + nameof(AbpWeChatMiniProgramOptions.Token); - public static string EncodingAESKey = Prefix + "." + nameof(AbpWeChatMiniProgramOptions.EncodingAESKey); - } + public static string AppId = Prefix + "." + nameof(AbpWeChatMiniProgramOptions.AppId); + public static string AppSecret = Prefix + "." + nameof(AbpWeChatMiniProgramOptions.AppSecret); + public static string Token = Prefix + "." + nameof(AbpWeChatMiniProgramOptions.Token); + public static string EncodingAESKey = Prefix + "." + nameof(AbpWeChatMiniProgramOptions.EncodingAESKey); } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Application.Contracts/LINGYUN.Abp.WeChat.Official.Application.Contracts.csproj b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Application.Contracts/LINGYUN.Abp.WeChat.Official.Application.Contracts.csproj index e9c4263b3..9f1a44faa 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Application.Contracts/LINGYUN.Abp.WeChat.Official.Application.Contracts.csproj +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Application.Contracts/LINGYUN.Abp.WeChat.Official.Application.Contracts.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.WeChat.Official.Application.Contracts + LINGYUN.Abp.WeChat.Official.Application.Contracts + false + false + false diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Application/LINGYUN.Abp.WeChat.Official.Application.csproj b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Application/LINGYUN.Abp.WeChat.Official.Application.csproj index 2814aa9c1..d0b2735d5 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Application/LINGYUN.Abp.WeChat.Official.Application.csproj +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Application/LINGYUN.Abp.WeChat.Official.Application.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.WeChat.Official.Application + LINGYUN.Abp.WeChat.Official.Application + false + false + false diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.HttpApi/LINGYUN.Abp.WeChat.Official.HttpApi.csproj b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.HttpApi/LINGYUN.Abp.WeChat.Official.HttpApi.csproj index 8704f96ad..f1c33e1c4 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.HttpApi/LINGYUN.Abp.WeChat.Official.HttpApi.csproj +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.HttpApi/LINGYUN.Abp.WeChat.Official.HttpApi.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.WeChat.Official.HttpApi + LINGYUN.Abp.WeChat.Official.HttpApi + false + false + false diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Senparc/LINGYUN.Abp.WeChat.Official.Senparc.csproj b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Senparc/LINGYUN.Abp.WeChat.Official.Senparc.csproj index 47e9b9f4c..e252b0847 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Senparc/LINGYUN.Abp.WeChat.Official.Senparc.csproj +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official.Senparc/LINGYUN.Abp.WeChat.Official.Senparc.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.WeChat.Official.Senparc + LINGYUN.Abp.WeChat.Official.Senparc + false + false + false diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN.Abp.WeChat.Official.csproj b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN.Abp.WeChat.Official.csproj index e6088a243..4e06c762e 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN.Abp.WeChat.Official.csproj +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN.Abp.WeChat.Official.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.WeChat.Official + LINGYUN.Abp.WeChat.Official + false + false + false diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/AbpWeChatOfficialConsts.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/AbpWeChatOfficialConsts.cs index 0beddeacb..8ef145e55 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/AbpWeChatOfficialConsts.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/AbpWeChatOfficialConsts.cs @@ -1,22 +1,21 @@ -namespace LINGYUN.Abp.WeChat.Official +namespace LINGYUN.Abp.WeChat.Official; + +public class AbpWeChatOfficialConsts { - public class AbpWeChatOfficialConsts - { - /// - /// 微信公众号对应的Provider名称 - /// - public static string ProviderName { get; set; } = "WeChat.Official"; + /// + /// 微信公众号对应的Provider名称 + /// + public static string ProviderName { get; set; } = "WeChat.Official"; - /// - /// 微信公众平台授权类型 - /// - public static string GrantType { get; set; } = "wx-op"; + /// + /// 微信公众平台授权类型 + /// + public static string GrantType { get; set; } = "wx-op"; - /// - /// 微信公众平台授权方法名称 - /// - public static string AuthenticationMethod { get; set; } = "woa"; + /// + /// 微信公众平台授权方法名称 + /// + public static string AuthenticationMethod { get; set; } = "woa"; - public static string HttpClient { get; set; } = "Abp.WeChat.Official"; - } + public static string HttpClient { get; set; } = "Abp.WeChat.Official"; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/AbpWeChatOfficialModule.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/AbpWeChatOfficialModule.cs index 9ad334465..da7bf8ab7 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/AbpWeChatOfficialModule.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/AbpWeChatOfficialModule.cs @@ -11,66 +11,65 @@ using Volo.Abp.Modularity; using Volo.Abp.VirtualFileSystem; -namespace LINGYUN.Abp.WeChat.Official +namespace LINGYUN.Abp.WeChat.Official; + +[DependsOn( + typeof(AbpWeChatModule))] +public class AbpWeChatOfficialModule : AbpModule { - [DependsOn( - typeof(AbpWeChatModule))] - public class AbpWeChatOfficialModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + Configure(options => { - Configure(options => + options.MapEvent("subscribe", context => { - options.MapEvent("subscribe", context => - { - return context.HasMessageKey("Ticket") - // 用户未关注公众号时, 扫描带参数二维码后进行关注的事件 - ? context.GetWeChatMessage() - // 用户关注/取消关注 - : context.GetWeChatMessage(); - }); - options.MapEvent("unsubscribe", context => context.GetWeChatMessage()); - options.MapEvent("LOCATION", context => context.GetWeChatMessage()); - options.MapEvent("CLICK", context => context.GetWeChatMessage()); - options.MapEvent("VIEW", context => context.GetWeChatMessage()); - options.MapEvent("SCAN", context => context.GetWeChatMessage()); - - options.MapMessage("text", context => context.GetWeChatMessage()); - options.MapMessage("image", context => context.GetWeChatMessage()); - options.MapMessage("voice", context => context.GetWeChatMessage()); - options.MapMessage("video", context => context.GetWeChatMessage()); - options.MapMessage("shortvideo", context => context.GetWeChatMessage()); - options.MapMessage("location", context => context.GetWeChatMessage()); - options.MapMessage("link", context => context.GetWeChatMessage()); + return context.HasMessageKey("Ticket") + // 用户未关注公众号时, 扫描带参数二维码后进行关注的事件 + ? context.GetWeChatMessage() + // 用户关注/取消关注 + : context.GetWeChatMessage(); }); + options.MapEvent("unsubscribe", context => context.GetWeChatMessage()); + options.MapEvent("LOCATION", context => context.GetWeChatMessage()); + options.MapEvent("CLICK", context => context.GetWeChatMessage()); + options.MapEvent("VIEW", context => context.GetWeChatMessage()); + options.MapEvent("SCAN", context => context.GetWeChatMessage()); - Configure(options => - { - // 事件处理器 - options.MessageResolvers.AddIfNotContains(new WeChatOfficialEventResolveContributor()); - // 消息处理器 - options.MessageResolvers.AddIfNotContains(new WeChatOfficialMessageResolveContributor()); - }); + options.MapMessage("text", context => context.GetWeChatMessage()); + options.MapMessage("image", context => context.GetWeChatMessage()); + options.MapMessage("voice", context => context.GetWeChatMessage()); + options.MapMessage("video", context => context.GetWeChatMessage()); + options.MapMessage("shortvideo", context => context.GetWeChatMessage()); + options.MapMessage("location", context => context.GetWeChatMessage()); + options.MapMessage("link", context => context.GetWeChatMessage()); + }); - Configure(options => - { - options.FileSets.AddEmbedded(); - }); + Configure(options => + { + // 事件处理器 + options.MessageResolvers.AddIfNotContains(new WeChatOfficialEventResolveContributor()); + // 消息处理器 + options.MessageResolvers.AddIfNotContains(new WeChatOfficialMessageResolveContributor()); + }); - Configure(options => - { - options.Resources - .Get() - .AddVirtualJson("/LINGYUN/Abp/WeChat/Official/Localization/Resources"); - }); + Configure(options => + { + options.FileSets.AddEmbedded(); + }); - context.Services.AddAbpDynamicOptions(); + Configure(options => + { + options.Resources + .Get() + .AddVirtualJson("/LINGYUN/Abp/WeChat/Official/Localization/Resources"); + }); - context.Services.AddHttpClient(AbpWeChatOfficialConsts.HttpClient, - options => - { - options.BaseAddress = new Uri("https://mp.weixin.qq.com"); - }); - } + context.Services.AddAbpDynamicOptions(); + + context.Services.AddHttpClient(AbpWeChatOfficialConsts.HttpClient, + options => + { + options.BaseAddress = new Uri("https://mp.weixin.qq.com"); + }); } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/AbpWeChatOfficialOptions.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/AbpWeChatOfficialOptions.cs index 5e9a88cf0..1c4a5ea0f 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/AbpWeChatOfficialOptions.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/AbpWeChatOfficialOptions.cs @@ -1,33 +1,32 @@ -namespace LINGYUN.Abp.WeChat.Official +namespace LINGYUN.Abp.WeChat.Official; + +public class AbpWeChatOfficialOptions { - public class AbpWeChatOfficialOptions - { - /// - /// 是否沙盒测试 - /// - /// - /// Tips: 当使用测试号时,消息为明文传输,调试时需要启用 - /// - public bool IsSandBox { get; set; } - /// - /// 公众号服务器消息Url - /// - public string Url { get; set; } - /// - /// 公众号AppId - /// - public string AppId { get; set; } - /// - /// 公众号AppSecret - /// - public string AppSecret { get; set; } - /// - /// 公众号消息解密Token - /// - public string Token { get; set; } - /// - /// 公众号消息解密AESKey - /// - public string EncodingAESKey { get; set; } - } + /// + /// 是否沙盒测试 + /// + /// + /// Tips: 当使用测试号时,消息为明文传输,调试时需要启用 + /// + public bool IsSandBox { get; set; } + /// + /// 公众号服务器消息Url + /// + public string Url { get; set; } + /// + /// 公众号AppId + /// + public string AppId { get; set; } + /// + /// 公众号AppSecret + /// + public string AppSecret { get; set; } + /// + /// 公众号消息解密Token + /// + public string Token { get; set; } + /// + /// 公众号消息解密AESKey + /// + public string EncodingAESKey { get; set; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/AbpWeChatOfficialOptionsFactory.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/AbpWeChatOfficialOptionsFactory.cs index 83bde65ca..882c1b719 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/AbpWeChatOfficialOptionsFactory.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/AbpWeChatOfficialOptionsFactory.cs @@ -2,23 +2,22 @@ using System.Threading.Tasks; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.WeChat.Official +namespace LINGYUN.Abp.WeChat.Official; + +public class AbpWeChatOfficialOptionsFactory : ITransientDependency { - public class AbpWeChatOfficialOptionsFactory : ITransientDependency - { - protected IOptions Options { get; } + protected IOptions Options { get; } - public AbpWeChatOfficialOptionsFactory( - IOptions options) - { - Options = options; - } + public AbpWeChatOfficialOptionsFactory( + IOptions options) + { + Options = options; + } - public async virtual Task CreateAsync() - { - await Options.SetAsync(); + public async virtual Task CreateAsync() + { + await Options.SetAsync(); - return Options.Value; - } + return Options.Value; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/AbpWeChatOfficialOptionsManager.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/AbpWeChatOfficialOptionsManager.cs index fb8197f0f..96af1a8c5 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/AbpWeChatOfficialOptionsManager.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/AbpWeChatOfficialOptionsManager.cs @@ -4,34 +4,33 @@ using Volo.Abp.Options; using Volo.Abp.Settings; -namespace LINGYUN.Abp.WeChat.Official +namespace LINGYUN.Abp.WeChat.Official; + +public class AbpWeChatOfficialOptionsManager : AbpDynamicOptionsManager { - public class AbpWeChatOfficialOptionsManager : AbpDynamicOptionsManager + protected ISettingProvider SettingProvider { get; } + public AbpWeChatOfficialOptionsManager( + ISettingProvider settingProvider, + IOptionsFactory factory) + : base(factory) { - protected ISettingProvider SettingProvider { get; } - public AbpWeChatOfficialOptionsManager( - ISettingProvider settingProvider, - IOptionsFactory factory) - : base(factory) - { - SettingProvider = settingProvider; - } + SettingProvider = settingProvider; + } - protected async override Task OverrideOptionsAsync(string name, AbpWeChatOfficialOptions options) - { - var isSandBox = await SettingProvider.IsTrueAsync(WeChatOfficialSettingNames.IsSandBox); - var appId = await SettingProvider.GetOrNullAsync(WeChatOfficialSettingNames.AppId); - var appSecret = await SettingProvider.GetOrNullAsync(WeChatOfficialSettingNames.AppSecret); - var url = await SettingProvider.GetOrNullAsync(WeChatOfficialSettingNames.Url); - var token = await SettingProvider.GetOrNullAsync(WeChatOfficialSettingNames.Token); - var aesKey = await SettingProvider.GetOrNullAsync(WeChatOfficialSettingNames.EncodingAESKey); + protected async override Task OverrideOptionsAsync(string name, AbpWeChatOfficialOptions options) + { + var isSandBox = await SettingProvider.IsTrueAsync(WeChatOfficialSettingNames.IsSandBox); + var appId = await SettingProvider.GetOrNullAsync(WeChatOfficialSettingNames.AppId); + var appSecret = await SettingProvider.GetOrNullAsync(WeChatOfficialSettingNames.AppSecret); + var url = await SettingProvider.GetOrNullAsync(WeChatOfficialSettingNames.Url); + var token = await SettingProvider.GetOrNullAsync(WeChatOfficialSettingNames.Token); + var aesKey = await SettingProvider.GetOrNullAsync(WeChatOfficialSettingNames.EncodingAESKey); - options.IsSandBox = isSandBox; - options.AppId = appId ?? options.AppId; - options.AppSecret = appSecret ?? options.AppSecret; - options.Url = url ?? options.Url; - options.Token = token ?? options.Token; - options.EncodingAESKey = aesKey ?? options.EncodingAESKey; - } + options.IsSandBox = isSandBox; + options.AppId = appId ?? options.AppId; + options.AppSecret = appSecret ?? options.AppSecret; + options.Url = url ?? options.Url; + options.Token = token ?? options.Token; + options.EncodingAESKey = aesKey ?? options.EncodingAESKey; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Features/WeChatOfficialFeatureDefinitionProvider.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Features/WeChatOfficialFeatureDefinitionProvider.cs index b835fd807..3a62bcc8d 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Features/WeChatOfficialFeatureDefinitionProvider.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Features/WeChatOfficialFeatureDefinitionProvider.cs @@ -4,32 +4,31 @@ using Volo.Abp.Localization; using Volo.Abp.Validation.StringValues; -namespace LINGYUN.Abp.WeChat.Official.Features +namespace LINGYUN.Abp.WeChat.Official.Features; + +public class WeChatOfficialFeatureDefinitionProvider : FeatureDefinitionProvider { - public class WeChatOfficialFeatureDefinitionProvider : FeatureDefinitionProvider + public override void Define(IFeatureDefinitionContext context) { - public override void Define(IFeatureDefinitionContext context) - { - var group = context.GetGroupOrNull(WeChatFeatures.GroupName); + var group = context.GetGroupOrNull(WeChatFeatures.GroupName); - var officialEnableFeature = group.AddFeature( - name: WeChatOfficialFeatures.Enable, - defaultValue: true.ToString(), - displayName: L("Features:WeChat.Official.Enable"), - description: L("Features:WeChat.Official.EnableDesc"), - valueType: new ToggleStringValueType(new BooleanValueValidator())); + var officialEnableFeature = group.AddFeature( + name: WeChatOfficialFeatures.Enable, + defaultValue: true.ToString(), + displayName: L("Features:WeChat.Official.Enable"), + description: L("Features:WeChat.Official.EnableDesc"), + valueType: new ToggleStringValueType(new BooleanValueValidator())); - officialEnableFeature.CreateChild( - name: WeChatOfficialFeatures.EnableAuthorization, - defaultValue: true.ToString(), - displayName: L("Features:WeChat.Official.EnableAuthorization"), - description: L("Features:WeChat.Official.EnableAuthorizationDesc"), - valueType: new ToggleStringValueType(new BooleanValueValidator())); - } + officialEnableFeature.CreateChild( + name: WeChatOfficialFeatures.EnableAuthorization, + defaultValue: true.ToString(), + displayName: L("Features:WeChat.Official.EnableAuthorization"), + description: L("Features:WeChat.Official.EnableAuthorizationDesc"), + valueType: new ToggleStringValueType(new BooleanValueValidator())); + } - protected LocalizableString L(string name) - { - return LocalizableString.Create(name); - } + protected LocalizableString L(string name) + { + return LocalizableString.Create(name); } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Features/WeChatOfficialFeatures.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Features/WeChatOfficialFeatures.cs index 3b31a0297..5ff03e252 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Features/WeChatOfficialFeatures.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Features/WeChatOfficialFeatures.cs @@ -1,13 +1,12 @@ using LINGYUN.Abp.WeChat.Features; -namespace LINGYUN.Abp.WeChat.Official.Features +namespace LINGYUN.Abp.WeChat.Official.Features; + +public static class WeChatOfficialFeatures { - public static class WeChatOfficialFeatures - { - public const string GroupName = WeChatFeatures.GroupName + ".Official"; + public const string GroupName = WeChatFeatures.GroupName + ".Official"; - public const string Enable = GroupName + ".Enable"; + public const string Enable = GroupName + ".Enable"; - public const string EnableAuthorization = GroupName + ".EnableAuthorization"; - } + public const string EnableAuthorization = GroupName + ".EnableAuthorization"; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Settings/WeChatOfficialSettingDefinitionProvider.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Settings/WeChatOfficialSettingDefinitionProvider.cs index f3432169c..22144d7ab 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Settings/WeChatOfficialSettingDefinitionProvider.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Settings/WeChatOfficialSettingDefinitionProvider.cs @@ -2,86 +2,85 @@ using Volo.Abp.Localization; using Volo.Abp.Settings; -namespace LINGYUN.Abp.WeChat.Official.Settings +namespace LINGYUN.Abp.WeChat.Official.Settings; + +public class WeChatOfficialSettingDefinitionProvider : SettingDefinitionProvider { - public class WeChatOfficialSettingDefinitionProvider : SettingDefinitionProvider + public override void Define(ISettingDefinitionContext context) { - public override void Define(ISettingDefinitionContext context) - { - context.Add( - new SettingDefinition( - WeChatOfficialSettingNames.IsSandBox, - "false", - L("DisplayName:WeChat.Official.IsSandBox"), - L("Description:WeChat.Official.IsSandBox"), - isVisibleToClients: false, - isEncrypted: false) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName), - new SettingDefinition( - WeChatOfficialSettingNames.AppId, "", - L("DisplayName:WeChat.Official.AppId"), - L("Description:WeChat.Official.AppId"), - isVisibleToClients: false, - isEncrypted: true) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName), - new SettingDefinition( - WeChatOfficialSettingNames.AppSecret, "", - L("DisplayName:WeChat.Official.AppSecret"), - L("Description:WeChat.Official.AppSecret"), - isVisibleToClients: false, - isEncrypted: true) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName), - new SettingDefinition( - WeChatOfficialSettingNames.Url, "", - L("DisplayName:WeChat.Official.Url"), - L("Description:WeChat.Official.Url"), - isVisibleToClients: false, - isEncrypted: false) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName), - new SettingDefinition( - WeChatOfficialSettingNames.Token, "", - L("DisplayName:WeChat.Official.Token"), - L("Description:WeChat.Official.Token"), - isVisibleToClients: false, - isEncrypted: true) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName), - new SettingDefinition( - WeChatOfficialSettingNames.EncodingAESKey, "", - L("DisplayName:WeChat.Official.EncodingAESKey"), - L("Description:WeChat.Official.EncodingAESKey"), - isVisibleToClients: false, - isEncrypted: true) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName) - ); - } + context.Add( + new SettingDefinition( + WeChatOfficialSettingNames.IsSandBox, + "false", + L("DisplayName:WeChat.Official.IsSandBox"), + L("Description:WeChat.Official.IsSandBox"), + isVisibleToClients: false, + isEncrypted: false) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName), + new SettingDefinition( + WeChatOfficialSettingNames.AppId, "", + L("DisplayName:WeChat.Official.AppId"), + L("Description:WeChat.Official.AppId"), + isVisibleToClients: false, + isEncrypted: true) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName), + new SettingDefinition( + WeChatOfficialSettingNames.AppSecret, "", + L("DisplayName:WeChat.Official.AppSecret"), + L("Description:WeChat.Official.AppSecret"), + isVisibleToClients: false, + isEncrypted: true) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName), + new SettingDefinition( + WeChatOfficialSettingNames.Url, "", + L("DisplayName:WeChat.Official.Url"), + L("Description:WeChat.Official.Url"), + isVisibleToClients: false, + isEncrypted: false) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName), + new SettingDefinition( + WeChatOfficialSettingNames.Token, "", + L("DisplayName:WeChat.Official.Token"), + L("Description:WeChat.Official.Token"), + isVisibleToClients: false, + isEncrypted: true) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName), + new SettingDefinition( + WeChatOfficialSettingNames.EncodingAESKey, "", + L("DisplayName:WeChat.Official.EncodingAESKey"), + L("Description:WeChat.Official.EncodingAESKey"), + isVisibleToClients: false, + isEncrypted: true) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName) + ); + } - protected ILocalizableString L(string name) - { - return LocalizableString.Create(name); - } + protected ILocalizableString L(string name) + { + return LocalizableString.Create(name); } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Settings/WeChatOfficialSettingNames.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Settings/WeChatOfficialSettingNames.cs index 9b179e1c4..bb0a1ac9d 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Settings/WeChatOfficialSettingNames.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Official/LINGYUN/Abp/WeChat/Official/Settings/WeChatOfficialSettingNames.cs @@ -1,16 +1,15 @@ using LINGYUN.Abp.WeChat.Settings; -namespace LINGYUN.Abp.WeChat.Official.Settings +namespace LINGYUN.Abp.WeChat.Official.Settings; + +public class WeChatOfficialSettingNames { - public class WeChatOfficialSettingNames - { - private const string Prefix = WeChatSettingNames.Prefix + ".Official"; + private const string Prefix = WeChatSettingNames.Prefix + ".Official"; - public static string IsSandBox = Prefix + "." + nameof(AbpWeChatOfficialOptions.IsSandBox); - public static string AppId = Prefix + "." + nameof(AbpWeChatOfficialOptions.AppId); - public static string AppSecret = Prefix + "." + nameof(AbpWeChatOfficialOptions.AppSecret); - public static string Url = Prefix + "." + nameof(AbpWeChatOfficialOptions.Url); - public static string Token = Prefix + "." + nameof(AbpWeChatOfficialOptions.Token); - public static string EncodingAESKey = Prefix + "." + nameof(AbpWeChatOfficialOptions.EncodingAESKey); - } + public static string IsSandBox = Prefix + "." + nameof(AbpWeChatOfficialOptions.IsSandBox); + public static string AppId = Prefix + "." + nameof(AbpWeChatOfficialOptions.AppId); + public static string AppSecret = Prefix + "." + nameof(AbpWeChatOfficialOptions.AppSecret); + public static string Url = Prefix + "." + nameof(AbpWeChatOfficialOptions.Url); + public static string Token = Prefix + "." + nameof(AbpWeChatOfficialOptions.Token); + public static string EncodingAESKey = Prefix + "." + nameof(AbpWeChatOfficialOptions.EncodingAESKey); } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN.Abp.WeChat.SettingManagement.csproj b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN.Abp.WeChat.SettingManagement.csproj index 39560879b..ff246a89a 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN.Abp.WeChat.SettingManagement.csproj +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN.Abp.WeChat.SettingManagement.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.WeChat.SettingManagement + LINGYUN.Abp.WeChat.SettingManagement + false + false + false diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/AbpWeChatSettingManagementModule.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/AbpWeChatSettingManagementModule.cs index d3a954d11..5edfa835a 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/AbpWeChatSettingManagementModule.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/AbpWeChatSettingManagementModule.cs @@ -10,46 +10,45 @@ using Volo.Abp.Modularity; using Volo.Abp.VirtualFileSystem; -namespace LINGYUN.Abp.WeChat.SettingManagement +namespace LINGYUN.Abp.WeChat.SettingManagement; + +[DependsOn( + typeof(AbpWeChatOfficialModule), + typeof(AbpWeChatMiniProgramModule), + typeof(AbpWeChatWorkModule), + typeof(AbpAspNetCoreMvcModule))] +public class AbpWeChatSettingManagementModule : AbpModule { - [DependsOn( - typeof(AbpWeChatOfficialModule), - typeof(AbpWeChatMiniProgramModule), - typeof(AbpWeChatWorkModule), - typeof(AbpAspNetCoreMvcModule))] - public class AbpWeChatSettingManagementModule : AbpModule + public override void PreConfigureServices(ServiceConfigurationContext context) { - public override void PreConfigureServices(ServiceConfigurationContext context) + PreConfigure(mvcBuilder => { - PreConfigure(mvcBuilder => - { - mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpWeChatSettingManagementModule).Assembly); - }); - } + mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpWeChatSettingManagementModule).Assembly); + }); + } - public override void ConfigureServices(ServiceConfigurationContext context) + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => { - Configure(options => - { - options.FileSets.AddEmbedded(); - }); + options.FileSets.AddEmbedded(); + }); - Configure(options => - { - options.Resources - .Get() - .AddVirtualJson("/LINGYUN/Abp/WeChat/SettingManagement/Localization/Resources"); - }); + Configure(options => + { + options.Resources + .Get() + .AddVirtualJson("/LINGYUN/Abp/WeChat/SettingManagement/Localization/Resources"); + }); - Configure(options => - { - options.Resources - .Get() - .AddBaseTypes( - typeof(AbpUiResource), - typeof(WeChatWorkResource) - ); - }); - } + Configure(options => + { + options.Resources + .Get() + .AddBaseTypes( + typeof(AbpUiResource), + typeof(WeChatWorkResource) + ); + }); } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/IWeChatSettingAppService.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/IWeChatSettingAppService.cs index 5abc87f4c..5cecea6a6 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/IWeChatSettingAppService.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/IWeChatSettingAppService.cs @@ -1,8 +1,7 @@ using LINGYUN.Abp.SettingManagement; -namespace LINGYUN.Abp.WeChat.SettingManagement +namespace LINGYUN.Abp.WeChat.SettingManagement; + +public interface IWeChatSettingAppService : IReadonlySettingAppService { - public interface IWeChatSettingAppService : IReadonlySettingAppService - { - } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/WeChatSettingAppService.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/WeChatSettingAppService.cs index e03d89bdb..80fbadfc5 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/WeChatSettingAppService.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/WeChatSettingAppService.cs @@ -14,159 +14,158 @@ using Volo.Abp.SettingManagement; using Volo.Abp.Settings; -namespace LINGYUN.Abp.WeChat.SettingManagement +namespace LINGYUN.Abp.WeChat.SettingManagement; + +public class WeChatSettingAppService : ApplicationService, IWeChatSettingAppService { - public class WeChatSettingAppService : ApplicationService, IWeChatSettingAppService + protected ISettingManager SettingManager { get; } + protected IPermissionChecker PermissionChecker { get; } + protected ISettingDefinitionManager SettingDefinitionManager { get; } + + public WeChatSettingAppService( + ISettingManager settingManager, + IPermissionChecker permissionChecker, + ISettingDefinitionManager settingDefinitionManager) { - protected ISettingManager SettingManager { get; } - protected IPermissionChecker PermissionChecker { get; } - protected ISettingDefinitionManager SettingDefinitionManager { get; } - - public WeChatSettingAppService( - ISettingManager settingManager, - IPermissionChecker permissionChecker, - ISettingDefinitionManager settingDefinitionManager) - { - SettingManager = settingManager; - PermissionChecker = permissionChecker; - SettingDefinitionManager = settingDefinitionManager; - LocalizationResource = typeof(WeChatResource); - } + SettingManager = settingManager; + PermissionChecker = permissionChecker; + SettingDefinitionManager = settingDefinitionManager; + LocalizationResource = typeof(WeChatResource); + } - public async virtual Task GetAllForCurrentTenantAsync() + public async virtual Task GetAllForCurrentTenantAsync() + { + return await GetAllForProviderAsync(TenantSettingValueProvider.ProviderName, CurrentTenant.GetId().ToString()); + } + + public async virtual Task GetAllForGlobalAsync() + { + return await GetAllForProviderAsync(GlobalSettingValueProvider.ProviderName, null); + } + + protected async virtual Task GetAllForProviderAsync(string providerName, string providerKey) + { + var settingGroups = new SettingGroupResult(); + var wechatSettingGroup = new SettingGroupDto(L["DisplayName:WeChat"], L["Description:WeChat"]); + + var loginSetting = wechatSettingGroup.AddSetting(L["UserLogin"], L["UserLogin"]); + loginSetting.AddDetail( + await SettingDefinitionManager.GetAsync(WeChatSettingNames.EnabledQuickLogin), + StringLocalizerFactory, + await SettingManager.GetOrNullAsync(WeChatSettingNames.EnabledQuickLogin, providerName, providerKey), + ValueType.Boolean, + providerName); + + // 无权限返回空结果,直接报错的话,网关聚合会抛出异常 + if (await FeatureChecker.IsEnabledAsync(WeChatOfficialFeatures.Enable) && + await PermissionChecker.IsGrantedAsync(WeChatSettingPermissionNames.Official)) { - return await GetAllForProviderAsync(TenantSettingValueProvider.ProviderName, CurrentTenant.GetId().ToString()); + #region 公众号 + + var officialSetting = wechatSettingGroup.AddSetting(L["DisplayName:WeChat.Official"], L["Description:WeChat.Official"]); + officialSetting.AddDetail( + await SettingDefinitionManager.GetAsync(WeChatOfficialSettingNames.IsSandBox), + StringLocalizerFactory, + await SettingManager.GetOrNullAsync(WeChatOfficialSettingNames.IsSandBox, providerName, providerKey), + ValueType.Boolean, + providerName); + officialSetting.AddDetail( + await SettingDefinitionManager.GetAsync(WeChatOfficialSettingNames.AppId), + StringLocalizerFactory, + await SettingManager.GetOrNullAsync(WeChatOfficialSettingNames.AppId, providerName, providerKey), + ValueType.String, + providerName); + officialSetting.AddDetail( + await SettingDefinitionManager.GetAsync(WeChatOfficialSettingNames.AppSecret), + StringLocalizerFactory, + await SettingManager.GetOrNullAsync(WeChatOfficialSettingNames.AppSecret, providerName, providerKey), + ValueType.String, + providerName); + officialSetting.AddDetail( + await SettingDefinitionManager.GetAsync(WeChatOfficialSettingNames.Url), + StringLocalizerFactory, + await SettingManager.GetOrNullAsync(WeChatOfficialSettingNames.Url, providerName, providerKey), + ValueType.String, + providerName); + officialSetting.AddDetail( + await SettingDefinitionManager.GetAsync(WeChatOfficialSettingNames.Token), + StringLocalizerFactory, + await SettingManager.GetOrNullAsync(WeChatOfficialSettingNames.Token, providerName, providerKey), + ValueType.String, + providerName); + officialSetting.AddDetail( + await SettingDefinitionManager.GetAsync(WeChatOfficialSettingNames.EncodingAESKey), + StringLocalizerFactory, + await SettingManager.GetOrNullAsync(WeChatOfficialSettingNames.EncodingAESKey, providerName, providerKey), + ValueType.String, + providerName); + + #endregion } - public async virtual Task GetAllForGlobalAsync() + if (await FeatureChecker.IsEnabledAsync(WeChatMiniProgramFeatures.Enable) && + await PermissionChecker.IsGrantedAsync(WeChatSettingPermissionNames.MiniProgram)) { - return await GetAllForProviderAsync(GlobalSettingValueProvider.ProviderName, null); + #region 小程序 + + var miniProgramSetting = wechatSettingGroup.AddSetting(L["DisplayName:WeChat.MiniProgram"], L["Description:WeChat.MiniProgram"]); + miniProgramSetting.AddDetail( + await SettingDefinitionManager.GetAsync(WeChatMiniProgramSettingNames.AppId), + StringLocalizerFactory, + await SettingManager.GetOrNullAsync(WeChatMiniProgramSettingNames.AppId, providerName, providerKey), + ValueType.String, + providerName); + miniProgramSetting.AddDetail( + await SettingDefinitionManager.GetAsync(WeChatMiniProgramSettingNames.AppSecret), + StringLocalizerFactory, + await SettingManager.GetOrNullAsync(WeChatMiniProgramSettingNames.AppSecret, providerName, providerKey), + ValueType.String, + providerName); + miniProgramSetting.AddDetail( + await SettingDefinitionManager.GetAsync(WeChatMiniProgramSettingNames.Token), + StringLocalizerFactory, + await SettingManager.GetOrNullAsync(WeChatMiniProgramSettingNames.Token, providerName, providerKey), + ValueType.String, + providerName); + miniProgramSetting.AddDetail( + await SettingDefinitionManager.GetAsync(WeChatMiniProgramSettingNames.EncodingAESKey), + StringLocalizerFactory, + await SettingManager.GetOrNullAsync(WeChatMiniProgramSettingNames.EncodingAESKey, providerName, providerKey), + ValueType.String, + providerName); + + #endregion } - protected async virtual Task GetAllForProviderAsync(string providerName, string providerKey) + settingGroups.AddGroup(wechatSettingGroup); + + if (await FeatureChecker.IsEnabledAsync(WeChatWorkFeatureNames.Enable) && + await PermissionChecker.IsGrantedAsync(WeChatSettingPermissionNames.Work)) { - var settingGroups = new SettingGroupResult(); - var wechatSettingGroup = new SettingGroupDto(L["DisplayName:WeChat"], L["Description:WeChat"]); + #region 企业微信 + var wechatWorkSettingGroup = new SettingGroupDto(L["DisplayName:WeChatWork"], L["Description:WeChatWork"]); - var loginSetting = wechatSettingGroup.AddSetting(L["UserLogin"], L["UserLogin"]); - loginSetting.AddDetail( - await SettingDefinitionManager.GetAsync(WeChatSettingNames.EnabledQuickLogin), + var workLoginSetting = wechatWorkSettingGroup.AddSetting(L["UserLogin"], L["UserLogin"]); + workLoginSetting.AddDetail( + await SettingDefinitionManager.GetAsync(WeChatWorkSettingNames.EnabledQuickLogin), StringLocalizerFactory, - await SettingManager.GetOrNullAsync(WeChatSettingNames.EnabledQuickLogin, providerName, providerKey), + await SettingManager.GetOrNullAsync(WeChatWorkSettingNames.EnabledQuickLogin, providerName, providerKey), ValueType.Boolean, providerName); - // 无权限返回空结果,直接报错的话,网关聚合会抛出异常 - if (await FeatureChecker.IsEnabledAsync(WeChatOfficialFeatures.Enable) && - await PermissionChecker.IsGrantedAsync(WeChatSettingPermissionNames.Official)) - { - #region 公众号 - - var officialSetting = wechatSettingGroup.AddSetting(L["DisplayName:WeChat.Official"], L["Description:WeChat.Official"]); - officialSetting.AddDetail( - await SettingDefinitionManager.GetAsync(WeChatOfficialSettingNames.IsSandBox), - StringLocalizerFactory, - await SettingManager.GetOrNullAsync(WeChatOfficialSettingNames.IsSandBox, providerName, providerKey), - ValueType.Boolean, - providerName); - officialSetting.AddDetail( - await SettingDefinitionManager.GetAsync(WeChatOfficialSettingNames.AppId), - StringLocalizerFactory, - await SettingManager.GetOrNullAsync(WeChatOfficialSettingNames.AppId, providerName, providerKey), - ValueType.String, - providerName); - officialSetting.AddDetail( - await SettingDefinitionManager.GetAsync(WeChatOfficialSettingNames.AppSecret), - StringLocalizerFactory, - await SettingManager.GetOrNullAsync(WeChatOfficialSettingNames.AppSecret, providerName, providerKey), - ValueType.String, - providerName); - officialSetting.AddDetail( - await SettingDefinitionManager.GetAsync(WeChatOfficialSettingNames.Url), - StringLocalizerFactory, - await SettingManager.GetOrNullAsync(WeChatOfficialSettingNames.Url, providerName, providerKey), - ValueType.String, - providerName); - officialSetting.AddDetail( - await SettingDefinitionManager.GetAsync(WeChatOfficialSettingNames.Token), - StringLocalizerFactory, - await SettingManager.GetOrNullAsync(WeChatOfficialSettingNames.Token, providerName, providerKey), - ValueType.String, - providerName); - officialSetting.AddDetail( - await SettingDefinitionManager.GetAsync(WeChatOfficialSettingNames.EncodingAESKey), - StringLocalizerFactory, - await SettingManager.GetOrNullAsync(WeChatOfficialSettingNames.EncodingAESKey, providerName, providerKey), - ValueType.String, - providerName); - - #endregion - } - - if (await FeatureChecker.IsEnabledAsync(WeChatMiniProgramFeatures.Enable) && - await PermissionChecker.IsGrantedAsync(WeChatSettingPermissionNames.MiniProgram)) - { - #region 小程序 - - var miniProgramSetting = wechatSettingGroup.AddSetting(L["DisplayName:WeChat.MiniProgram"], L["Description:WeChat.MiniProgram"]); - miniProgramSetting.AddDetail( - await SettingDefinitionManager.GetAsync(WeChatMiniProgramSettingNames.AppId), - StringLocalizerFactory, - await SettingManager.GetOrNullAsync(WeChatMiniProgramSettingNames.AppId, providerName, providerKey), - ValueType.String, - providerName); - miniProgramSetting.AddDetail( - await SettingDefinitionManager.GetAsync(WeChatMiniProgramSettingNames.AppSecret), - StringLocalizerFactory, - await SettingManager.GetOrNullAsync(WeChatMiniProgramSettingNames.AppSecret, providerName, providerKey), - ValueType.String, - providerName); - miniProgramSetting.AddDetail( - await SettingDefinitionManager.GetAsync(WeChatMiniProgramSettingNames.Token), - StringLocalizerFactory, - await SettingManager.GetOrNullAsync(WeChatMiniProgramSettingNames.Token, providerName, providerKey), - ValueType.String, - providerName); - miniProgramSetting.AddDetail( - await SettingDefinitionManager.GetAsync(WeChatMiniProgramSettingNames.EncodingAESKey), - StringLocalizerFactory, - await SettingManager.GetOrNullAsync(WeChatMiniProgramSettingNames.EncodingAESKey, providerName, providerKey), - ValueType.String, - providerName); - - #endregion - } - - settingGroups.AddGroup(wechatSettingGroup); - - if (await FeatureChecker.IsEnabledAsync(WeChatWorkFeatureNames.Enable) && - await PermissionChecker.IsGrantedAsync(WeChatSettingPermissionNames.Work)) - { - #region 企业微信 - var wechatWorkSettingGroup = new SettingGroupDto(L["DisplayName:WeChatWork"], L["Description:WeChatWork"]); - - var workLoginSetting = wechatWorkSettingGroup.AddSetting(L["UserLogin"], L["UserLogin"]); - workLoginSetting.AddDetail( - await SettingDefinitionManager.GetAsync(WeChatWorkSettingNames.EnabledQuickLogin), - StringLocalizerFactory, - await SettingManager.GetOrNullAsync(WeChatWorkSettingNames.EnabledQuickLogin, providerName, providerKey), - ValueType.Boolean, - providerName); - - var workConnectionSetting = wechatWorkSettingGroup.AddSetting(L["DisplayName:Connection"], L["Description:Connection"]); - - workConnectionSetting.AddDetail( - await SettingDefinitionManager.GetAsync(WeChatWorkSettingNames.Connection.CorpId), - StringLocalizerFactory, - await SettingManager.GetOrNullAsync(WeChatWorkSettingNames.Connection.CorpId, providerName, providerKey), - ValueType.String, - providerName); - - settingGroups.AddGroup(wechatWorkSettingGroup); - #endregion - } - - return settingGroups; + var workConnectionSetting = wechatWorkSettingGroup.AddSetting(L["DisplayName:Connection"], L["Description:Connection"]); + + workConnectionSetting.AddDetail( + await SettingDefinitionManager.GetAsync(WeChatWorkSettingNames.Connection.CorpId), + StringLocalizerFactory, + await SettingManager.GetOrNullAsync(WeChatWorkSettingNames.Connection.CorpId, providerName, providerKey), + ValueType.String, + providerName); + + settingGroups.AddGroup(wechatWorkSettingGroup); + #endregion } + + return settingGroups; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/WeChatSettingController.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/WeChatSettingController.cs index da92d40f7..5a953a91b 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/WeChatSettingController.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/WeChatSettingController.cs @@ -4,33 +4,32 @@ using Volo.Abp; using Volo.Abp.AspNetCore.Mvc; -namespace LINGYUN.Abp.WeChat.SettingManagement +namespace LINGYUN.Abp.WeChat.SettingManagement; + +[RemoteService(Name = AbpSettingManagementRemoteServiceConsts.RemoteServiceName)] +[Area("settingManagement")] +[Route("api/setting-management/wechat")] +public class WeChatSettingController : AbpControllerBase, IWeChatSettingAppService { - [RemoteService(Name = AbpSettingManagementRemoteServiceConsts.RemoteServiceName)] - [Area("settingManagement")] - [Route("api/setting-management/wechat")] - public class WeChatSettingController : AbpControllerBase, IWeChatSettingAppService - { - protected IWeChatSettingAppService WeChatSettingAppService { get; } + protected IWeChatSettingAppService WeChatSettingAppService { get; } - public WeChatSettingController( - IWeChatSettingAppService weChatSettingAppService) - { - WeChatSettingAppService = weChatSettingAppService; - } + public WeChatSettingController( + IWeChatSettingAppService weChatSettingAppService) + { + WeChatSettingAppService = weChatSettingAppService; + } - [HttpGet] - [Route("by-current-tenant")] - public async virtual Task GetAllForCurrentTenantAsync() - { - return await WeChatSettingAppService.GetAllForCurrentTenantAsync(); - } + [HttpGet] + [Route("by-current-tenant")] + public async virtual Task GetAllForCurrentTenantAsync() + { + return await WeChatSettingAppService.GetAllForCurrentTenantAsync(); + } - [HttpGet] - [Route("by-global")] - public async virtual Task GetAllForGlobalAsync() - { - return await WeChatSettingAppService.GetAllForGlobalAsync(); - } + [HttpGet] + [Route("by-global")] + public async virtual Task GetAllForGlobalAsync() + { + return await WeChatSettingAppService.GetAllForGlobalAsync(); } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/WeChatSettingPermissionDefinitionProvider.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/WeChatSettingPermissionDefinitionProvider.cs index fb5f3bf42..29b23444f 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/WeChatSettingPermissionDefinitionProvider.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/WeChatSettingPermissionDefinitionProvider.cs @@ -6,32 +6,31 @@ using Volo.Abp.Features; using Volo.Abp.Localization; -namespace LINGYUN.Abp.WeChat.SettingManagement +namespace LINGYUN.Abp.WeChat.SettingManagement; + +public class WeChatSettingPermissionDefinitionProvider : PermissionDefinitionProvider { - public class WeChatSettingPermissionDefinitionProvider : PermissionDefinitionProvider + public override void Define(IPermissionDefinitionContext context) { - public override void Define(IPermissionDefinitionContext context) - { - var wechatGroup = context.AddGroup( - WeChatSettingPermissionNames.GroupName, - L("Permission:WeChat")); + var wechatGroup = context.AddGroup( + WeChatSettingPermissionNames.GroupName, + L("Permission:WeChat")); - wechatGroup.AddPermission( - WeChatSettingPermissionNames.Official, L("Permission:WeChat.Official")) - .RequireFeatures(WeChatOfficialFeatures.Enable); + wechatGroup.AddPermission( + WeChatSettingPermissionNames.Official, L("Permission:WeChat.Official")) + .RequireFeatures(WeChatOfficialFeatures.Enable); - wechatGroup.AddPermission( - WeChatSettingPermissionNames.MiniProgram, L("Permission:WeChat.MiniProgram")) - .RequireFeatures(WeChatMiniProgramFeatures.Enable); + wechatGroup.AddPermission( + WeChatSettingPermissionNames.MiniProgram, L("Permission:WeChat.MiniProgram")) + .RequireFeatures(WeChatMiniProgramFeatures.Enable); - wechatGroup.AddPermission( - WeChatSettingPermissionNames.Work, L("Permission:WeChat.Work")) - .RequireFeatures(WeChatWorkFeatureNames.Enable); - } + wechatGroup.AddPermission( + WeChatSettingPermissionNames.Work, L("Permission:WeChat.Work")) + .RequireFeatures(WeChatWorkFeatureNames.Enable); + } - protected LocalizableString L(string name) - { - return LocalizableString.Create(name); - } + protected LocalizableString L(string name) + { + return LocalizableString.Create(name); } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/WeChatSettingPermissionNames.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/WeChatSettingPermissionNames.cs index 9a57c954c..76fe8616c 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/WeChatSettingPermissionNames.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/WeChatSettingPermissionNames.cs @@ -1,11 +1,10 @@ -namespace LINGYUN.Abp.WeChat.SettingManagement +namespace LINGYUN.Abp.WeChat.SettingManagement; + +public class WeChatSettingPermissionNames { - public class WeChatSettingPermissionNames - { - public const string GroupName = "Abp.WeChat"; + public const string GroupName = "Abp.WeChat"; - public const string Official = GroupName + ".Official"; - public const string MiniProgram = GroupName + ".MiniProgram"; - public const string Work = GroupName + ".Work"; - } + public const string Official = GroupName + ".Official"; + public const string MiniProgram = GroupName + ".MiniProgram"; + public const string Work = GroupName + ".Work"; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application.Contracts/LINGYUN.Abp.WeChat.Work.Application.Contracts.csproj b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application.Contracts/LINGYUN.Abp.WeChat.Work.Application.Contracts.csproj index e9c4263b3..e67b5b9bf 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application.Contracts/LINGYUN.Abp.WeChat.Work.Application.Contracts.csproj +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application.Contracts/LINGYUN.Abp.WeChat.Work.Application.Contracts.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.WeChat.Work.Application.Contracts + LINGYUN.Abp.WeChat.Work.Application.Contracts + false + false + false diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application/LINGYUN.Abp.WeChat.Work.Application.csproj b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application/LINGYUN.Abp.WeChat.Work.Application.csproj index 2e9c96174..2fe01ec8f 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application/LINGYUN.Abp.WeChat.Work.Application.csproj +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Application/LINGYUN.Abp.WeChat.Work.Application.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.WeChat.Work.Application + LINGYUN.Abp.WeChat.Work.Application + false + false + false diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN.Abp.WeChat.Work.Common.csproj b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN.Abp.WeChat.Work.Common.csproj index 899829919..ee3cb3236 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN.Abp.WeChat.Work.Common.csproj +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN.Abp.WeChat.Work.Common.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.WeChat.Work.Common + LINGYUN.Abp.WeChat.Work.Common + false + false + false diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.HttpApi/LINGYUN.Abp.WeChat.Work.HttpApi.csproj b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.HttpApi/LINGYUN.Abp.WeChat.Work.HttpApi.csproj index 354eb9ed7..883b6647b 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.HttpApi/LINGYUN.Abp.WeChat.Work.HttpApi.csproj +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.HttpApi/LINGYUN.Abp.WeChat.Work.HttpApi.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.WeChat.Work.HttpApi + LINGYUN.Abp.WeChat.Work.HttpApi + false + false + false diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN.Abp.WeChat.Work.csproj b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN.Abp.WeChat.Work.csproj index 3f15746dd..faca3c205 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN.Abp.WeChat.Work.csproj +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN.Abp.WeChat.Work.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.WeChat.Work + LINGYUN.Abp.WeChat.Work + false + false + false diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/AbpWeChatWorkException.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/AbpWeChatWorkException.cs index cbad5bf4d..6de70a1c4 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/AbpWeChatWorkException.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/AbpWeChatWorkException.cs @@ -1,5 +1,4 @@ using System; -using System.Runtime.Serialization; using Volo.Abp; namespace LINGYUN.Abp.WeChat.Work; @@ -18,9 +17,4 @@ public AbpWeChatWorkException( : base(code, message, details, innerException) { } - - public AbpWeChatWorkException(SerializationInfo serializationInfo, StreamingContext context) - : base(serializationInfo, context) - { - } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/AbpWeChatWorkGlobalConsts.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/AbpWeChatWorkGlobalConsts.cs index 7c8fa9867..d5b5ba2dd 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/AbpWeChatWorkGlobalConsts.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/AbpWeChatWorkGlobalConsts.cs @@ -1,42 +1,41 @@ -namespace LINGYUN.Abp.WeChat.Work +namespace LINGYUN.Abp.WeChat.Work; + +public class AbpWeChatWorkGlobalConsts { - public class AbpWeChatWorkGlobalConsts - { - /// - /// 企业微信对应的Provider名称 - /// - public static string ProviderName { get; set; } = "WeChat.Work"; - /// - /// 企业微信授权类型 - /// - public static string GrantType { get; set; } = "wx-work"; - /// - /// 企业微信授权名称 - /// - public static string AuthenticationScheme { get; set; }= "WeCom"; - /// - /// 企业微信个人信息标识 - /// - public static string ProfileKey { get; set; } = "wecom.profile"; - /// - /// 企业微信授权应用标识参数 - /// - public static string AgentId { get; set; } = "agent_id"; - /// - /// 企业微信授权Code参数 - /// - public static string Code { get; set; }= "code"; - /// - /// 企业微信授权显示名称 - /// - public static string DisplayName { get; set; } = "企业微信"; - /// - ///企业微信授权方法名称 - /// - public static string AuthenticationMethod { get; set; } = "wecom"; + /// + /// 企业微信对应的Provider名称 + /// + public static string ProviderName { get; set; } = "WeChat.Work"; + /// + /// 企业微信授权类型 + /// + public static string GrantType { get; set; } = "wx-work"; + /// + /// 企业微信授权名称 + /// + public static string AuthenticationScheme { get; set; }= "WeCom"; + /// + /// 企业微信个人信息标识 + /// + public static string ProfileKey { get; set; } = "wecom.profile"; + /// + /// 企业微信授权应用标识参数 + /// + public static string AgentId { get; set; } = "agent_id"; + /// + /// 企业微信授权Code参数 + /// + public static string Code { get; set; }= "code"; + /// + /// 企业微信授权显示名称 + /// + public static string DisplayName { get; set; } = "企业微信"; + /// + ///企业微信授权方法名称 + /// + public static string AuthenticationMethod { get; set; } = "wecom"; - internal static string ApiClient { get; set; } = "Abp.WeChat.Work"; - internal static string OAuthClient { get; set; } = "Abp.WeChat.Work.OAuth"; - internal static string LoginClient { get; set; } = "Abp.WeChat.Work.Login"; - } + internal static string ApiClient { get; set; } = "Abp.WeChat.Work"; + internal static string OAuthClient { get; set; } = "Abp.WeChat.Work.OAuth"; + internal static string LoginClient { get; set; } = "Abp.WeChat.Work.Login"; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Settings/WeChatWorkSettingDefinitionProvider.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Settings/WeChatWorkSettingDefinitionProvider.cs index 9597b3a43..489653086 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Settings/WeChatWorkSettingDefinitionProvider.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Settings/WeChatWorkSettingDefinitionProvider.cs @@ -2,50 +2,49 @@ using Volo.Abp.Localization; using Volo.Abp.Settings; -namespace LINGYUN.Abp.WeChat.Work.Settings +namespace LINGYUN.Abp.WeChat.Work.Settings; + +public class WeChatWorkSettingDefinitionProvider : SettingDefinitionProvider { - public class WeChatWorkSettingDefinitionProvider : SettingDefinitionProvider + public override void Define(ISettingDefinitionContext context) { - public override void Define(ISettingDefinitionContext context) - { - context.Add( - new SettingDefinition( - WeChatWorkSettingNames.EnabledQuickLogin, - // 默认启用 - true.ToString(), - L("DisplayName:WeChatWork.EnabledQuickLogin"), - L("Description:WeChatWork.EnabledQuickLogin"), - isVisibleToClients: true, - isEncrypted: false) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName) - ); - context.Add(GetConnectionSettings()); - } + context.Add( + new SettingDefinition( + WeChatWorkSettingNames.EnabledQuickLogin, + // 默认启用 + true.ToString(), + L("DisplayName:WeChatWork.EnabledQuickLogin"), + L("Description:WeChatWork.EnabledQuickLogin"), + isVisibleToClients: true, + isEncrypted: false) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName) + ); + context.Add(GetConnectionSettings()); + } - protected virtual SettingDefinition[] GetConnectionSettings() + protected virtual SettingDefinition[] GetConnectionSettings() + { + return new[] { - return new[] - { - new SettingDefinition( - WeChatWorkSettingNames.Connection.CorpId, - displayName: L("DisplayName:WeChatWork.Connection.CorpId"), - description: L("Description:WeChatWork.Connection.CorpId"), - isEncrypted: true) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName), - }; - } + new SettingDefinition( + WeChatWorkSettingNames.Connection.CorpId, + displayName: L("DisplayName:WeChatWork.Connection.CorpId"), + description: L("Description:WeChatWork.Connection.CorpId"), + isEncrypted: true) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName), + }; + } - protected ILocalizableString L(string name) - { - return LocalizableString.Create(name); - } + protected ILocalizableString L(string name) + { + return LocalizableString.Create(name); } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Settings/WeChatWorkSettingNames.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Settings/WeChatWorkSettingNames.cs index 6ca0fe582..d5f75f798 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Settings/WeChatWorkSettingNames.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Settings/WeChatWorkSettingNames.cs @@ -1,19 +1,18 @@ -namespace LINGYUN.Abp.WeChat.Work.Settings +namespace LINGYUN.Abp.WeChat.Work.Settings; + +public static class WeChatWorkSettingNames { - public static class WeChatWorkSettingNames - { - public const string Prefix = "Abp.WeChat.Work"; + public const string Prefix = "Abp.WeChat.Work"; - /// - /// 启用快捷登录 - /// - public const string EnabledQuickLogin = Prefix + ".EnabledQuickLogin"; + /// + /// 启用快捷登录 + /// + public const string EnabledQuickLogin = Prefix + ".EnabledQuickLogin"; - public static class Connection - { - public const string Prefix = WeChatWorkSettingNames.Prefix + ".Connection"; + public static class Connection + { + public const string Prefix = WeChatWorkSettingNames.Prefix + ".Connection"; - public static string CorpId = Prefix + ".CorpId"; - } + public static string CorpId = Prefix + ".CorpId"; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/Models/WeChatWorkToken.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/Models/WeChatWorkToken.cs index c7ebab39a..bdcff3ae3 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/Models/WeChatWorkToken.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/Models/WeChatWorkToken.cs @@ -1,26 +1,25 @@ -namespace LINGYUN.Abp.WeChat.Work.Token.Models +namespace LINGYUN.Abp.WeChat.Work.Token.Models; + +/// +/// 企业微信令牌 +/// +public class WeChatWorkToken { /// - /// 企业微信令牌 + /// 访问令牌 + /// + public string AccessToken { get; set; } + /// + /// 过期时间,单位(s) /// - public class WeChatWorkToken + public int ExpiresIn { get; set; } + public WeChatWorkToken() { - /// - /// 访问令牌 - /// - public string AccessToken { get; set; } - /// - /// 过期时间,单位(s) - /// - public int ExpiresIn { get; set; } - public WeChatWorkToken() - { - } - public WeChatWorkToken(string token, int expiresIn) - { - AccessToken = token; - ExpiresIn = expiresIn; - } + } + public WeChatWorkToken(string token, int expiresIn) + { + AccessToken = token; + ExpiresIn = expiresIn; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/Models/WeChatWorkTokenCacheItem.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/Models/WeChatWorkTokenCacheItem.cs index 675f86b67..6208bb9b2 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/Models/WeChatWorkTokenCacheItem.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/Models/WeChatWorkTokenCacheItem.cs @@ -1,28 +1,27 @@ -namespace LINGYUN.Abp.WeChat.Work.Token.Models +namespace LINGYUN.Abp.WeChat.Work.Token.Models; + +public class WeChatWorkTokenCacheItem { - public class WeChatWorkTokenCacheItem - { - public string CorpId { get; set; } + public string CorpId { get; set; } - public string AgentId { get; set; } + public string AgentId { get; set; } - public WeChatWorkToken Token { get; set; } + public WeChatWorkToken Token { get; set; } - public WeChatWorkTokenCacheItem() - { + public WeChatWorkTokenCacheItem() + { - } + } - public WeChatWorkTokenCacheItem(string corpId, string agentId, WeChatWorkToken token) - { - CorpId = corpId; - AgentId = agentId; - Token = token; - } + public WeChatWorkTokenCacheItem(string corpId, string agentId, WeChatWorkToken token) + { + CorpId = corpId; + AgentId = agentId; + Token = token; + } - public static string CalculateCacheKey(string provider, string corpId, string agentId) - { - return "p:" + provider + ",cp:" + corpId + ",ag:" + agentId; - } + public static string CalculateCacheKey(string provider, string corpId, string agentId) + { + return "p:" + provider + ",cp:" + corpId + ",ag:" + agentId; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/Models/WeChatWorkTokenRequest.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/Models/WeChatWorkTokenRequest.cs index 664f54f7b..c988da881 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/Models/WeChatWorkTokenRequest.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/Models/WeChatWorkTokenRequest.cs @@ -1,8 +1,7 @@ -namespace LINGYUN.Abp.WeChat.Work.Token.Models +namespace LINGYUN.Abp.WeChat.Work.Token.Models; + +public class WeChatWorkTokenRequest { - public class WeChatWorkTokenRequest - { - public string CorpId { get; set; } - public string CorpSecret { get; set; } - } + public string CorpId { get; set; } + public string CorpSecret { get; set; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/Models/WeChatWorkTokenResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/Models/WeChatWorkTokenResponse.cs index d13f3176e..0abc409ff 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/Models/WeChatWorkTokenResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Token/Models/WeChatWorkTokenResponse.cs @@ -1,27 +1,26 @@ using Newtonsoft.Json; -namespace LINGYUN.Abp.WeChat.Work.Token.Models +namespace LINGYUN.Abp.WeChat.Work.Token.Models; + +/// +/// 微信访问令牌返回对象 +/// +public class WeChatWorkTokenResponse : WeChatWorkResponse { /// - /// 微信访问令牌返回对象 + /// 访问令牌 /// - public class WeChatWorkTokenResponse : WeChatWorkResponse - { - /// - /// 访问令牌 - /// - [JsonProperty("access_token")] - public string AccessToken { get; set; } - /// - /// 过期时间,单位(s) - /// - [JsonProperty("expires_in")] - public int ExpiresIn { get; set; } + [JsonProperty("access_token")] + public string AccessToken { get; set; } + /// + /// 过期时间,单位(s) + /// + [JsonProperty("expires_in")] + public int ExpiresIn { get; set; } - public WeChatWorkToken ToWeChatWorkToken() - { - ThrowIfNotSuccess(); - return new WeChatWorkToken(AccessToken, ExpiresIn); - } + public WeChatWorkToken ToWeChatWorkToken() + { + ThrowIfNotSuccess(); + return new WeChatWorkToken(AccessToken, ExpiresIn); } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/System/Net/Http/HttpClientWeChatWorkRequestExtensions.Auth.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/System/Net/Http/HttpClientWeChatWorkRequestExtensions.Auth.cs index 9dee97074..5ffc5cfde 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/System/Net/Http/HttpClientWeChatWorkRequestExtensions.Auth.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/System/Net/Http/HttpClientWeChatWorkRequestExtensions.Auth.cs @@ -3,44 +3,43 @@ using System.Threading; using System.Threading.Tasks; -namespace System.Net.Http +namespace System.Net.Http; + +internal static partial class HttpClientWeChatWorkRequestExtensions { - internal static partial class HttpClientWeChatWorkRequestExtensions + public async static Task GetUserInfoAsync( + this HttpMessageInvoker client, + string accessToken, + string code, + CancellationToken cancellationToken = default) { - public async static Task GetUserInfoAsync( - this HttpMessageInvoker client, - string accessToken, - string code, - CancellationToken cancellationToken = default) - { - var urlBuilder = new StringBuilder(); - urlBuilder.Append("/cgi-bin/auth/getuserinfo"); - urlBuilder.AppendFormat("?access_token={0}", accessToken); - urlBuilder.AppendFormat("&code={0}", code); + var urlBuilder = new StringBuilder(); + urlBuilder.Append("/cgi-bin/auth/getuserinfo"); + urlBuilder.AppendFormat("?access_token={0}", accessToken); + urlBuilder.AppendFormat("&code={0}", code); + + var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlBuilder.ToString()); - var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlBuilder.ToString()); + return await client.SendAsync(httpRequest, cancellationToken); + } - return await client.SendAsync(httpRequest, cancellationToken); - } + public async static Task GetUserDetailAsync( + this HttpMessageInvoker client, + string accessToken, + WeChatWorkUserDetailRequest request, + CancellationToken cancellationToken = default) + { + var urlBuilder = new StringBuilder(); + urlBuilder.Append("/cgi-bin/auth/getuserdetail"); + urlBuilder.AppendFormat("?access_token={0}", accessToken); - public async static Task GetUserDetailAsync( - this HttpMessageInvoker client, - string accessToken, - WeChatWorkUserDetailRequest request, - CancellationToken cancellationToken = default) + var httpRequest = new HttpRequestMessage( + HttpMethod.Post, + urlBuilder.ToString()) { - var urlBuilder = new StringBuilder(); - urlBuilder.Append("/cgi-bin/auth/getuserdetail"); - urlBuilder.AppendFormat("?access_token={0}", accessToken); - - var httpRequest = new HttpRequestMessage( - HttpMethod.Post, - urlBuilder.ToString()) - { - Content = new StringContent(request.SerializeToJson()) - }; + Content = new StringContent(request.SerializeToJson()) + }; - return await client.SendAsync(httpRequest, cancellationToken); - } + return await client.SendAsync(httpRequest, cancellationToken); } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/System/Net/Http/HttpClientWeChatWorkRequestExtensions.Chat.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/System/Net/Http/HttpClientWeChatWorkRequestExtensions.Chat.cs index 4d84c7c95..183a47378 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/System/Net/Http/HttpClientWeChatWorkRequestExtensions.Chat.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/System/Net/Http/HttpClientWeChatWorkRequestExtensions.Chat.cs @@ -3,66 +3,65 @@ using System.Threading; using System.Threading.Tasks; -namespace System.Net.Http +namespace System.Net.Http; + +internal static partial class HttpClientWeChatWorkRequestExtensions { - internal static partial class HttpClientWeChatWorkRequestExtensions + public async static Task GetAppChatAsync( + this HttpMessageInvoker client, + string accessToken, + string chatId, + CancellationToken cancellationToken = default) { - public async static Task GetAppChatAsync( - this HttpMessageInvoker client, - string accessToken, - string chatId, - CancellationToken cancellationToken = default) - { - var urlBuilder = new StringBuilder(); - urlBuilder.Append("/cgi-bin/appchat/get"); - urlBuilder.AppendFormat("?access_token={0}", accessToken); - urlBuilder.AppendFormat("&chatid={0}", chatId); + var urlBuilder = new StringBuilder(); + urlBuilder.Append("/cgi-bin/appchat/get"); + urlBuilder.AppendFormat("?access_token={0}", accessToken); + urlBuilder.AppendFormat("&chatid={0}", chatId); - var httpRequest = new HttpRequestMessage( - HttpMethod.Get, - urlBuilder.ToString()); + var httpRequest = new HttpRequestMessage( + HttpMethod.Get, + urlBuilder.ToString()); + + return await client.SendAsync(httpRequest, cancellationToken); + } - return await client.SendAsync(httpRequest, cancellationToken); - } + public async static Task CreateAppChatAsync( + this HttpMessageInvoker client, + string accessToken, + WeChatWorkAppChatCreateRequest request, + CancellationToken cancellationToken = default) + { + var urlBuilder = new StringBuilder(); + urlBuilder.Append("/cgi-bin/appchat/create"); + urlBuilder.AppendFormat("?access_token={0}", accessToken); - public async static Task CreateAppChatAsync( - this HttpMessageInvoker client, - string accessToken, - WeChatWorkAppChatCreateRequest request, - CancellationToken cancellationToken = default) + var httpRequest = new HttpRequestMessage( + HttpMethod.Post, + urlBuilder.ToString()) { - var urlBuilder = new StringBuilder(); - urlBuilder.Append("/cgi-bin/appchat/create"); - urlBuilder.AppendFormat("?access_token={0}", accessToken); + Content = new StringContent(request.SerializeToJson()) + }; - var httpRequest = new HttpRequestMessage( - HttpMethod.Post, - urlBuilder.ToString()) - { - Content = new StringContent(request.SerializeToJson()) - }; + return await client.SendAsync(httpRequest, cancellationToken); + } - return await client.SendAsync(httpRequest, cancellationToken); - } + public async static Task UpdateAppChatAsync( + this HttpMessageInvoker client, + string accessToken, + WeChatWorkAppChatUpdateRequest request, + CancellationToken cancellationToken = default) + { + var urlBuilder = new StringBuilder(); + urlBuilder.Append("/cgi-bin/appchat/update"); + urlBuilder.AppendFormat("?access_token={0}", accessToken); - public async static Task UpdateAppChatAsync( - this HttpMessageInvoker client, - string accessToken, - WeChatWorkAppChatUpdateRequest request, - CancellationToken cancellationToken = default) + var httpRequest = new HttpRequestMessage( + HttpMethod.Post, + urlBuilder.ToString()) { - var urlBuilder = new StringBuilder(); - urlBuilder.Append("/cgi-bin/appchat/update"); - urlBuilder.AppendFormat("?access_token={0}", accessToken); - - var httpRequest = new HttpRequestMessage( - HttpMethod.Post, - urlBuilder.ToString()) - { - Content = new StringContent(request.SerializeToJson()) - }; + Content = new StringContent(request.SerializeToJson()) + }; - return await client.SendAsync(httpRequest, cancellationToken); - } + return await client.SendAsync(httpRequest, cancellationToken); } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/System/Net/Http/HttpClientWeChatWorkRequestExtensions.Media.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/System/Net/Http/HttpClientWeChatWorkRequestExtensions.Media.cs index f4bac29da..fb4c2e77e 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/System/Net/Http/HttpClientWeChatWorkRequestExtensions.Media.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/System/Net/Http/HttpClientWeChatWorkRequestExtensions.Media.cs @@ -5,66 +5,65 @@ using System.Threading; using System.Threading.Tasks; -namespace System.Net.Http +namespace System.Net.Http; + +internal static partial class HttpClientWeChatWorkRequestExtensions { - internal static partial class HttpClientWeChatWorkRequestExtensions + public async static Task GetMediaAsync( + this HttpMessageInvoker client, + string accessToken, + string mediaId, + CancellationToken cancellationToken = default) { - public async static Task GetMediaAsync( - this HttpMessageInvoker client, - string accessToken, - string mediaId, - CancellationToken cancellationToken = default) - { - var urlBuilder = new StringBuilder(); - urlBuilder.Append("/cgi-bin/media/get"); - urlBuilder.AppendFormat("?access_token={0}", accessToken); - urlBuilder.AppendFormat("&media_id={0}", mediaId); + var urlBuilder = new StringBuilder(); + urlBuilder.Append("/cgi-bin/media/get"); + urlBuilder.AppendFormat("?access_token={0}", accessToken); + urlBuilder.AppendFormat("&media_id={0}", mediaId); - var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlBuilder.ToString()); + var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlBuilder.ToString()); + + return await client.SendAsync(httpRequest, cancellationToken); + } - return await client.SendAsync(httpRequest, cancellationToken); - } + public async static Task UploadMediaAsync( + this HttpMessageInvoker client, + string type, + WeChatWorkMediaRequest request, + CancellationToken cancellationToken = default) + { + var urlBuilder = new StringBuilder(); + urlBuilder.Append("/cgi-bin/media/upload"); + urlBuilder.AppendFormat("?access_token={0}", request.AccessToken); + urlBuilder.AppendFormat("&type={0}", type); - public async static Task UploadMediaAsync( - this HttpMessageInvoker client, - string type, - WeChatWorkMediaRequest request, - CancellationToken cancellationToken = default) + var fileBytes = await request.Content.GetStream().GetAllBytesAsync(); + var httpRequest = new HttpRequestMessage( + HttpMethod.Post, + urlBuilder.ToString()) { - var urlBuilder = new StringBuilder(); - urlBuilder.Append("/cgi-bin/media/upload"); - urlBuilder.AppendFormat("?access_token={0}", request.AccessToken); - urlBuilder.AppendFormat("&type={0}", type); + Content = HttpContentBuildHelper.BuildUploadMediaContent("media", fileBytes, request.Content.FileName) + }; - var fileBytes = await request.Content.GetStream().GetAllBytesAsync(); - var httpRequest = new HttpRequestMessage( - HttpMethod.Post, - urlBuilder.ToString()) - { - Content = HttpContentBuildHelper.BuildUploadMediaContent("media", fileBytes, request.Content.FileName) - }; + return await client.SendAsync(httpRequest, cancellationToken); + } - return await client.SendAsync(httpRequest, cancellationToken); - } + public async static Task UploadImageAsync( + this HttpMessageInvoker client, + WeChatWorkMediaRequest request, + CancellationToken cancellationToken = default) + { + var urlBuilder = new StringBuilder(); + urlBuilder.Append("/cgi-bin/media/uploadimg"); + urlBuilder.AppendFormat("?access_token={0}", request.AccessToken); - public async static Task UploadImageAsync( - this HttpMessageInvoker client, - WeChatWorkMediaRequest request, - CancellationToken cancellationToken = default) + var fileBytes = await request.Content.GetStream().GetAllBytesAsync(); + var httpRequest = new HttpRequestMessage( + HttpMethod.Post, + urlBuilder.ToString()) { - var urlBuilder = new StringBuilder(); - urlBuilder.Append("/cgi-bin/media/uploadimg"); - urlBuilder.AppendFormat("?access_token={0}", request.AccessToken); - - var fileBytes = await request.Content.GetStream().GetAllBytesAsync(); - var httpRequest = new HttpRequestMessage( - HttpMethod.Post, - urlBuilder.ToString()) - { - Content = HttpContentBuildHelper.BuildUploadMediaContent("file", fileBytes, request.Content.FileName) - }; + Content = HttpContentBuildHelper.BuildUploadMediaContent("file", fileBytes, request.Content.FileName) + }; - return await client.SendAsync(httpRequest, cancellationToken); - } + return await client.SendAsync(httpRequest, cancellationToken); } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/System/Net/Http/HttpClientWeChatWorkRequestExtensions.Message.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/System/Net/Http/HttpClientWeChatWorkRequestExtensions.Message.cs index 790794bfc..6b354d260 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/System/Net/Http/HttpClientWeChatWorkRequestExtensions.Message.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/System/Net/Http/HttpClientWeChatWorkRequestExtensions.Message.cs @@ -4,65 +4,64 @@ using System.Threading; using System.Threading.Tasks; -namespace System.Net.Http +namespace System.Net.Http; + +internal static partial class HttpClientWeChatWorkRequestExtensions { - internal static partial class HttpClientWeChatWorkRequestExtensions + public async static Task SendMessageAsync( + this HttpMessageInvoker client, + WeChatWorkMessageRequest request, + CancellationToken cancellationToken = default) { - public async static Task SendMessageAsync( - this HttpMessageInvoker client, - WeChatWorkMessageRequest request, - CancellationToken cancellationToken = default) + var urlBuilder = new StringBuilder(); + urlBuilder.Append("/cgi-bin/message/send"); + urlBuilder.AppendFormat("?access_token={0}", request.AccessToken); + + var httpRequest = new HttpRequestMessage( + HttpMethod.Post, + urlBuilder.ToString()) { - var urlBuilder = new StringBuilder(); - urlBuilder.Append("/cgi-bin/message/send"); - urlBuilder.AppendFormat("?access_token={0}", request.AccessToken); + Content = new StringContent(request.Message.SerializeToJson()) + }; - var httpRequest = new HttpRequestMessage( - HttpMethod.Post, - urlBuilder.ToString()) - { - Content = new StringContent(request.Message.SerializeToJson()) - }; + return await client.SendAsync(httpRequest, cancellationToken); + } - return await client.SendAsync(httpRequest, cancellationToken); - } + public async static Task SendMessageAsync( + this HttpMessageInvoker client, + WeChatWorkMessageRequest request, + CancellationToken cancellationToken = default) + { + var urlBuilder = new StringBuilder(); + urlBuilder.Append("/cgi-bin/appchat/send"); + urlBuilder.AppendFormat("?access_token={0}", request.AccessToken); - public async static Task SendMessageAsync( - this HttpMessageInvoker client, - WeChatWorkMessageRequest request, - CancellationToken cancellationToken = default) + var httpRequest = new HttpRequestMessage( + HttpMethod.Post, + urlBuilder.ToString()) { - var urlBuilder = new StringBuilder(); - urlBuilder.Append("/cgi-bin/appchat/send"); - urlBuilder.AppendFormat("?access_token={0}", request.AccessToken); + Content = new StringContent(request.Message.SerializeToJson()) + }; - var httpRequest = new HttpRequestMessage( - HttpMethod.Post, - urlBuilder.ToString()) - { - Content = new StringContent(request.Message.SerializeToJson()) - }; + return await client.SendAsync(httpRequest, cancellationToken); + } - return await client.SendAsync(httpRequest, cancellationToken); - } + public async static Task ReCallMessageAsync( + this HttpMessageInvoker client, + WeChatWorkMessageReCallRequest request, + CancellationToken cancellationToken = default) + { + var urlBuilder = new StringBuilder(); + urlBuilder.Append("/cgi-bin/message/recall"); + urlBuilder.AppendFormat("?access_token={0}", request.AccessToken); - public async static Task ReCallMessageAsync( - this HttpMessageInvoker client, - WeChatWorkMessageReCallRequest request, - CancellationToken cancellationToken = default) + var httpRequest = new HttpRequestMessage( + HttpMethod.Post, + urlBuilder.ToString()) { - var urlBuilder = new StringBuilder(); - urlBuilder.Append("/cgi-bin/message/recall"); - urlBuilder.AppendFormat("?access_token={0}", request.AccessToken); - - var httpRequest = new HttpRequestMessage( - HttpMethod.Post, - urlBuilder.ToString()) - { - Content = new StringContent(request.SerializeToJson()) - }; + Content = new StringContent(request.SerializeToJson()) + }; - return await client.SendAsync(httpRequest, cancellationToken); - } + return await client.SendAsync(httpRequest, cancellationToken); } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/System/Net/Http/HttpClientWeChatWorkRequestExtensions.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/System/Net/Http/HttpClientWeChatWorkRequestExtensions.cs index 4a1937d9a..971f2fe83 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/System/Net/Http/HttpClientWeChatWorkRequestExtensions.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/System/Net/Http/HttpClientWeChatWorkRequestExtensions.cs @@ -3,20 +3,19 @@ using System.Threading; using System.Threading.Tasks; -namespace System.Net.Http +namespace System.Net.Http; + +internal static partial class HttpClientWeChatWorkRequestExtensions { - internal static partial class HttpClientWeChatWorkRequestExtensions + public async static Task GetTokenAsync(this HttpMessageInvoker client, WeChatWorkTokenRequest request, CancellationToken cancellationToken = default) { - public async static Task GetTokenAsync(this HttpMessageInvoker client, WeChatWorkTokenRequest request, CancellationToken cancellationToken = default) - { - var urlBuilder = new StringBuilder(); - urlBuilder.Append("/cgi-bin/gettoken"); - urlBuilder.AppendFormat("?corpid={0}", request.CorpId); - urlBuilder.AppendFormat("&corpsecret={0}", request.CorpSecret); + var urlBuilder = new StringBuilder(); + urlBuilder.Append("/cgi-bin/gettoken"); + urlBuilder.AppendFormat("?corpid={0}", request.CorpId); + urlBuilder.AppendFormat("&corpsecret={0}", request.CorpSecret); - var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlBuilder.ToString()); + var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlBuilder.ToString()); - return await client.SendAsync(httpRequest, cancellationToken); - } + return await client.SendAsync(httpRequest, cancellationToken); } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN.Abp.WeChat.csproj b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN.Abp.WeChat.csproj index 6cb648386..6c6e47c1d 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN.Abp.WeChat.csproj +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN.Abp.WeChat.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.WeChat + LINGYUN.Abp.WeChat + false + false + false diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/AbpWeChatGlobalConsts.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/AbpWeChatGlobalConsts.cs index e4d952923..89368a609 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/AbpWeChatGlobalConsts.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/AbpWeChatGlobalConsts.cs @@ -1,24 +1,23 @@ -namespace LINGYUN.Abp.WeChat +namespace LINGYUN.Abp.WeChat; + +public class AbpWeChatGlobalConsts { - public class AbpWeChatGlobalConsts - { - /// - /// 微信授权名称 - /// - public static string AuthenticationScheme { get; set; }= "WeChat"; - /// - /// 微信个人信息标识 - /// - public static string ProfileKey { get; set; } = "wechat.profile"; - /// - /// 微信授权Token参数名称 - /// - public static string TokenName { get; set; }= "code"; - /// - /// 微信授权显示名称 - /// - public static string DisplayName { get; set; } = "WeChat"; + /// + /// 微信授权名称 + /// + public static string AuthenticationScheme { get; set; }= "WeChat"; + /// + /// 微信个人信息标识 + /// + public static string ProfileKey { get; set; } = "wechat.profile"; + /// + /// 微信授权Token参数名称 + /// + public static string TokenName { get; set; }= "code"; + /// + /// 微信授权显示名称 + /// + public static string DisplayName { get; set; } = "WeChat"; - public static string HttpClient { get; set; } = "Abp.WeChat"; - } + public static string HttpClient { get; set; } = "Abp.WeChat"; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Features/WeChatFeatureDefinitionProvider.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Features/WeChatFeatureDefinitionProvider.cs index 3a255e923..1c659ff44 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Features/WeChatFeatureDefinitionProvider.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Features/WeChatFeatureDefinitionProvider.cs @@ -2,18 +2,17 @@ using Volo.Abp.Features; using Volo.Abp.Localization; -namespace LINGYUN.Abp.WeChat.Features +namespace LINGYUN.Abp.WeChat.Features; + +public class WeChatFeatureDefinitionProvider : FeatureDefinitionProvider { - public class WeChatFeatureDefinitionProvider : FeatureDefinitionProvider + public override void Define(IFeatureDefinitionContext context) { - public override void Define(IFeatureDefinitionContext context) - { - context.AddGroup(WeChatFeatures.GroupName, L("Features:WeChat")); - } + context.AddGroup(WeChatFeatures.GroupName, L("Features:WeChat")); + } - protected LocalizableString L(string name) - { - return LocalizableString.Create(name); - } + protected LocalizableString L(string name) + { + return LocalizableString.Create(name); } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Features/WeChatFeatures.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Features/WeChatFeatures.cs index 497ddad1c..53e283303 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Features/WeChatFeatures.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Features/WeChatFeatures.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.WeChat.Features +namespace LINGYUN.Abp.WeChat.Features; + +public static class WeChatFeatures { - public static class WeChatFeatures - { - public const string GroupName = "Abp.WeChat"; - } + public const string GroupName = "Abp.WeChat"; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Localization/WeChatResource.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Localization/WeChatResource.cs index 764c804bc..46496146e 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Localization/WeChatResource.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Localization/WeChatResource.cs @@ -1,9 +1,8 @@ using Volo.Abp.Localization; -namespace LINGYUN.Abp.WeChat.Localization +namespace LINGYUN.Abp.WeChat.Localization; + +[LocalizationResourceName("WeChat")] +public class WeChatResource { - [LocalizationResourceName("WeChat")] - public class WeChatResource - { - } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/IUserWeChatOpenIdFinder.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/IUserWeChatOpenIdFinder.cs index 79f2c703f..92badcebd 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/IUserWeChatOpenIdFinder.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/IUserWeChatOpenIdFinder.cs @@ -1,12 +1,11 @@ using System; using System.Threading.Tasks; -namespace LINGYUN.Abp.WeChat.OpenId +namespace LINGYUN.Abp.WeChat.OpenId; + +public interface IUserWeChatOpenIdFinder { - public interface IUserWeChatOpenIdFinder - { - Task FindByUserIdAsync(Guid userId, string provider); + Task FindByUserIdAsync(Guid userId, string provider); - Task FindByUserNameAsync(string userName, string provider); - } + Task FindByUserNameAsync(string userName, string provider); } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/IWeChatOpenIdFinder.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/IWeChatOpenIdFinder.cs index 7bab4e580..b604dfe58 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/IWeChatOpenIdFinder.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/IWeChatOpenIdFinder.cs @@ -1,17 +1,16 @@ using System.Threading.Tasks; -namespace LINGYUN.Abp.WeChat.OpenId +namespace LINGYUN.Abp.WeChat.OpenId; + +public interface IWeChatOpenIdFinder { - public interface IWeChatOpenIdFinder - { - Task FindAsync(string code, string appId, string appSecret); - /// - /// 获取当前登录用户OpenId - /// - /// 应用标识 - /// - /// 用户未登录时 - /// 微信sessionKey过期时 - Task FindAsync(string appId); - } + Task FindAsync(string code, string appId, string appSecret); + /// + /// 获取当前登录用户OpenId + /// + /// 应用标识 + /// + /// 用户未登录时 + /// 微信sessionKey过期时 + Task FindAsync(string appId); } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/NullUserWeChatOpenIdFinder.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/NullUserWeChatOpenIdFinder.cs index 5eac9d338..0e22fc601 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/NullUserWeChatOpenIdFinder.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/NullUserWeChatOpenIdFinder.cs @@ -2,18 +2,17 @@ using System.Threading.Tasks; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.WeChat.OpenId +namespace LINGYUN.Abp.WeChat.OpenId; + +public class NullUserWeChatOpenIdFinder : IUserWeChatOpenIdFinder, ISingletonDependency { - public class NullUserWeChatOpenIdFinder : IUserWeChatOpenIdFinder, ISingletonDependency + public Task FindByUserIdAsync(Guid userId, string provider) { - public Task FindByUserIdAsync(Guid userId, string provider) - { - return Task.FromResult(""); - } + return Task.FromResult(""); + } - public Task FindByUserNameAsync(string userName, string provider) - { - return Task.FromResult(""); - } + public Task FindByUserNameAsync(string userName, string provider) + { + return Task.FromResult(""); } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenId.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenId.cs index f7047cb6b..5ded29e1b 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenId.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenId.cs @@ -1,30 +1,29 @@ -namespace LINGYUN.Abp.WeChat.OpenId +namespace LINGYUN.Abp.WeChat.OpenId; + +public class WeChatOpenId { - public class WeChatOpenId - { - /// - /// 用户在开放平台的唯一标识符,在满足 UnionID 下发条件的情况下会返回 - /// - public string UnionId { get; set; } - /// - /// 用户唯一标识 - /// - public string OpenId { get; set; } - /// - /// 会话密钥 - /// - public string SessionKey { get; set; } + /// + /// 用户在开放平台的唯一标识符,在满足 UnionID 下发条件的情况下会返回 + /// + public string UnionId { get; set; } + /// + /// 用户唯一标识 + /// + public string OpenId { get; set; } + /// + /// 会话密钥 + /// + public string SessionKey { get; set; } - public WeChatOpenId() - { + public WeChatOpenId() + { - } + } - public WeChatOpenId(string openId, string sessionKey, string unionId = null) - { - OpenId = openId; - SessionKey = sessionKey; - UnionId = unionId; - } + public WeChatOpenId(string openId, string sessionKey, string unionId = null) + { + OpenId = openId; + SessionKey = sessionKey; + UnionId = unionId; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdCacheItem.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdCacheItem.cs index 6f579580e..c8543d874 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdCacheItem.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdCacheItem.cs @@ -1,32 +1,31 @@ using System; -namespace LINGYUN.Abp.WeChat.OpenId +namespace LINGYUN.Abp.WeChat.OpenId; + +public class WeChatOpenIdCacheItem { - public class WeChatOpenIdCacheItem - { - public string Code { get; set; } + public string Code { get; set; } - public WeChatOpenId WeChatOpenId { get; set; } - public WeChatOpenIdCacheItem() - { + public WeChatOpenId WeChatOpenId { get; set; } + public WeChatOpenIdCacheItem() + { - } + } - public WeChatOpenIdCacheItem(string code, WeChatOpenId weChatOpenId) - { - Code = code; - WeChatOpenId = weChatOpenId; - } + public WeChatOpenIdCacheItem(string code, WeChatOpenId weChatOpenId) + { + Code = code; + WeChatOpenId = weChatOpenId; + } - public static string CalculateCacheKey(string appId, Guid userId) - { - return "app:" + appId + ";user:" + userId.ToString("D"); - } + public static string CalculateCacheKey(string appId, Guid userId) + { + return "app:" + appId + ";user:" + userId.ToString("D"); + } - public static string CalculateCacheKey(string appId, string code) - { - return "app:" + appId + ";code:" + code; - } + public static string CalculateCacheKey(string appId, string code) + { + return "app:" + appId + ";code:" + code; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdFinder.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdFinder.cs index 755755f24..ac64fa84d 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdFinder.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdFinder.cs @@ -13,105 +13,104 @@ using Volo.Abp.MultiTenancy; using Volo.Abp.Users; -namespace LINGYUN.Abp.WeChat.OpenId +namespace LINGYUN.Abp.WeChat.OpenId; + +[Dependency(ServiceLifetime.Singleton, ReplaceServices = true)] +[ExposeServices(typeof(IWeChatOpenIdFinder))] +public class WeChatOpenIdFinder : IWeChatOpenIdFinder { - [Dependency(ServiceLifetime.Singleton, ReplaceServices = true)] - [ExposeServices(typeof(IWeChatOpenIdFinder))] - public class WeChatOpenIdFinder : IWeChatOpenIdFinder + public ILogger Logger { get; set; } + protected ICurrentTenant CurrentTenant { get; } + protected ICurrentUser CurrentUser { get; } + protected IHttpClientFactory HttpClientFactory { get; } + protected IDistributedCache Cache { get; } + public WeChatOpenIdFinder( + ICurrentUser currentUser, + ICurrentTenant currentTenant, + IHttpClientFactory httpClientFactory, + IDistributedCache cache) { - public ILogger Logger { get; set; } - protected ICurrentTenant CurrentTenant { get; } - protected ICurrentUser CurrentUser { get; } - protected IHttpClientFactory HttpClientFactory { get; } - protected IDistributedCache Cache { get; } - public WeChatOpenIdFinder( - ICurrentUser currentUser, - ICurrentTenant currentTenant, - IHttpClientFactory httpClientFactory, - IDistributedCache cache) - { - CurrentUser = currentUser; - CurrentTenant = currentTenant; - HttpClientFactory = httpClientFactory; - - Cache = cache; + CurrentUser = currentUser; + CurrentTenant = currentTenant; + HttpClientFactory = httpClientFactory; - Logger = NullLogger.Instance; - } + Cache = cache; - public async virtual Task FindAsync(string appId) - { - if (!CurrentUser.IsAuthenticated) - { - throw new AbpAuthorizationException("Try to get wechat information when the user is not logged in!"); - } - var cacheKey = WeChatOpenIdCacheItem.CalculateCacheKey(appId, CurrentUser.Id.Value); - var openIdCache = await Cache.GetAsync(cacheKey); - return openIdCache?.WeChatOpenId ?? - throw new AbpException("The wechat login session has expired. Use 'wx.login' result code to exchange the sessionKey"); - } + Logger = NullLogger.Instance; + } - public async virtual Task FindAsync(string code, string appId, string appSecret) + public async virtual Task FindAsync(string appId) + { + if (!CurrentUser.IsAuthenticated) { - // TODO: 如果需要获取SessionKey的话呢,需要再以openid作为标识来缓存一下吗 - // 或者前端保存code,通过传递code来获取 - return (await GetCacheItemAsync(code, appId, appSecret)).WeChatOpenId; + throw new AbpAuthorizationException("Try to get wechat information when the user is not logged in!"); } + var cacheKey = WeChatOpenIdCacheItem.CalculateCacheKey(appId, CurrentUser.Id.Value); + var openIdCache = await Cache.GetAsync(cacheKey); + return openIdCache?.WeChatOpenId ?? + throw new AbpException("The wechat login session has expired. Use 'wx.login' result code to exchange the sessionKey"); + } - protected async virtual Task GetCacheItemAsync(string code, string appId, string appSecret) - { - var cacheKey = WeChatOpenIdCacheItem.CalculateCacheKey(appId, code); - - Logger.LogDebug($"WeChatOpenIdFinder.GetCacheItemAsync: {cacheKey}"); - - var cacheItem = await Cache.GetAsync(cacheKey); + public async virtual Task FindAsync(string code, string appId, string appSecret) + { + // TODO: 如果需要获取SessionKey的话呢,需要再以openid作为标识来缓存一下吗 + // 或者前端保存code,通过传递code来获取 + return (await GetCacheItemAsync(code, appId, appSecret)).WeChatOpenId; + } - if (cacheItem != null) - { - Logger.LogDebug($"Found in the cache: {cacheKey}"); - return cacheItem; - } + protected async virtual Task GetCacheItemAsync(string code, string appId, string appSecret) + { + var cacheKey = WeChatOpenIdCacheItem.CalculateCacheKey(appId, code); - Logger.LogDebug($"Not found in the cache, getting from the httpClient: {cacheKey}"); + Logger.LogDebug($"WeChatOpenIdFinder.GetCacheItemAsync: {cacheKey}"); - var client = HttpClientFactory.CreateClient(AbpWeChatGlobalConsts.HttpClient); + var cacheItem = await Cache.GetAsync(cacheKey); - var request = new WeChatOpenIdRequest - { - BaseUrl = client.BaseAddress.AbsoluteUri, - AppId = appId, - Secret = appSecret, - Code = code - }; + if (cacheItem != null) + { + Logger.LogDebug($"Found in the cache: {cacheKey}"); + return cacheItem; + } - var response = await client.RequestWeChatOpenIdAsync(request); - var responseContent = await response.Content.ReadAsStringAsync(); - // 改为直接引用 Newtownsoft.Json - var weChatOpenIdResponse = JsonConvert.DeserializeObject(responseContent); - var weChatOpenId = weChatOpenIdResponse.ToWeChatOpenId(); - cacheItem = new WeChatOpenIdCacheItem(code, weChatOpenId); + Logger.LogDebug($"Not found in the cache, getting from the httpClient: {cacheKey}"); - Logger.LogDebug($"Setting the cache item: {cacheKey}"); + var client = HttpClientFactory.CreateClient(AbpWeChatGlobalConsts.HttpClient); - var cacheOptions = new DistributedCacheEntryOptions - { - // 微信官方文档表示 session_key的有效期是3天 - // https://developers.weixin.qq.com/community/develop/doc/000c2424654c40bd9c960e71e5b009 - AbsoluteExpiration = DateTimeOffset.Now.AddDays(3).AddSeconds(-120) - // SlidingExpiration = TimeSpan.FromDays(3), - }; + var request = new WeChatOpenIdRequest + { + BaseUrl = client.BaseAddress.AbsoluteUri, + AppId = appId, + Secret = appSecret, + Code = code + }; + + var response = await client.RequestWeChatOpenIdAsync(request); + var responseContent = await response.Content.ReadAsStringAsync(); + // 改为直接引用 Newtownsoft.Json + var weChatOpenIdResponse = JsonConvert.DeserializeObject(responseContent); + var weChatOpenId = weChatOpenIdResponse.ToWeChatOpenId(); + cacheItem = new WeChatOpenIdCacheItem(code, weChatOpenId); + + Logger.LogDebug($"Setting the cache item: {cacheKey}"); + + var cacheOptions = new DistributedCacheEntryOptions + { + // 微信官方文档表示 session_key的有效期是3天 + // https://developers.weixin.qq.com/community/develop/doc/000c2424654c40bd9c960e71e5b009 + AbsoluteExpiration = DateTimeOffset.Now.AddDays(3).AddSeconds(-120) + // SlidingExpiration = TimeSpan.FromDays(3), + }; - await Cache.SetAsync(cacheKey, cacheItem, cacheOptions); + await Cache.SetAsync(cacheKey, cacheItem, cacheOptions); - if (CurrentUser.IsAuthenticated) - { - await Cache.SetAsync(WeChatOpenIdCacheItem.CalculateCacheKey(appId, CurrentUser.Id.Value), cacheItem, cacheOptions); - } + if (CurrentUser.IsAuthenticated) + { + await Cache.SetAsync(WeChatOpenIdCacheItem.CalculateCacheKey(appId, CurrentUser.Id.Value), cacheItem, cacheOptions); + } - Logger.LogDebug($"Finished setting the cache item: {cacheKey}"); + Logger.LogDebug($"Finished setting the cache item: {cacheKey}"); - return cacheItem; - } + return cacheItem; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdRequest.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdRequest.cs index 5bd322665..b648b1e96 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdRequest.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdRequest.cs @@ -1,10 +1,9 @@ -namespace LINGYUN.Abp.WeChat.OpenId +namespace LINGYUN.Abp.WeChat.OpenId; + +public class WeChatOpenIdRequest { - public class WeChatOpenIdRequest - { - public string BaseUrl { get; set; } - public string AppId { get; set; } - public string Secret { get; set; } - public string Code { get; set; } - } + public string BaseUrl { get; set; } + public string AppId { get; set; } + public string Secret { get; set; } + public string Code { get; set; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdResponse.cs index e2760383d..7bd009601 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/OpenId/WeChatOpenIdResponse.cs @@ -2,63 +2,62 @@ using Newtonsoft.Json; using System; -namespace LINGYUN.Abp.WeChat.OpenId +namespace LINGYUN.Abp.WeChat.OpenId; + +/// +/// 微信OpenId返回对象 +/// +public class WeChatOpenIdResponse { /// - /// 微信OpenId返回对象 + /// 错误码 + /// + [JsonProperty("errcode")] + public string ErrorCode { get; set; } + /// + /// 会话密钥 + /// + [JsonProperty("session_key")] + public string SessionKey { get; set; } + /// + /// 用户唯一标识 + /// + [JsonProperty("openid")] + public string OpenId { get; set; } + /// + /// 用户在开放平台的唯一标识符,在满足 UnionID 下发条件的情况下会返回 /// - public class WeChatOpenIdResponse + [JsonProperty("unionid")] + public string UnionId { get; set; } + /// + /// 错误消息 + /// + public string ErrorMessage { - /// - /// 错误码 - /// - [JsonProperty("errcode")] - public string ErrorCode { get; set; } - /// - /// 会话密钥 - /// - [JsonProperty("session_key")] - public string SessionKey { get; set; } - /// - /// 用户唯一标识 - /// - [JsonProperty("openid")] - public string OpenId { get; set; } - /// - /// 用户在开放平台的唯一标识符,在满足 UnionID 下发条件的情况下会返回 - /// - [JsonProperty("unionid")] - public string UnionId { get; set; } - /// - /// 错误消息 - /// - public string ErrorMessage + get { - get + return ErrorCode switch { - return ErrorCode switch - { - "-1" => "系统繁忙,此时请开发者稍候再试", - "0" => string.Empty, - "40029" => "code 无效", - "45011" => "频率限制,每个用户每分钟100次", - _ => $"未定义的异常代码:{ErrorCode},请重试", - }; - ; - } + "-1" => "系统繁忙,此时请开发者稍候再试", + "0" => string.Empty, + "40029" => "code 无效", + "45011" => "频率限制,每个用户每分钟100次", + _ => $"未定义的异常代码:{ErrorCode},请重试", + }; + ; } - /// - /// 微信认证成功没有errorcode或者errorcode为0 - /// - public bool IsError => !ErrorCode.IsNullOrWhiteSpace() && !"0".Equals(ErrorCode); + } + /// + /// 微信认证成功没有errorcode或者errorcode为0 + /// + public bool IsError => !ErrorCode.IsNullOrWhiteSpace() && !"0".Equals(ErrorCode); - public WeChatOpenId ToWeChatOpenId() + public WeChatOpenId ToWeChatOpenId() + { + if(IsError) { - if(IsError) - { - throw new AbpWeChatException(ErrorCode, ErrorMessage); - } - return new WeChatOpenId(OpenId, SessionKey, UnionId); + throw new AbpWeChatException(ErrorCode, ErrorMessage); } + return new WeChatOpenId(OpenId, SessionKey, UnionId); } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Settings/WeChatSettingDefinitionProvider.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Settings/WeChatSettingDefinitionProvider.cs index 31f2bafa2..feb0844b3 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Settings/WeChatSettingDefinitionProvider.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Settings/WeChatSettingDefinitionProvider.cs @@ -2,32 +2,31 @@ using Volo.Abp.Localization; using Volo.Abp.Settings; -namespace LINGYUN.Abp.WeChat.Settings +namespace LINGYUN.Abp.WeChat.Settings; + +public class WeChatSettingDefinitionProvider : SettingDefinitionProvider { - public class WeChatSettingDefinitionProvider : SettingDefinitionProvider + public override void Define(ISettingDefinitionContext context) { - public override void Define(ISettingDefinitionContext context) - { - context.Add( - new SettingDefinition( - WeChatSettingNames.EnabledQuickLogin, - // 默认启用 - true.ToString(), - L("DisplayName:WeChat.EnabledQuickLogin"), - L("Description:WeChat.EnabledQuickLogin"), - isVisibleToClients: true, - isEncrypted: false) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName) - ); - } + context.Add( + new SettingDefinition( + WeChatSettingNames.EnabledQuickLogin, + // 默认启用 + true.ToString(), + L("DisplayName:WeChat.EnabledQuickLogin"), + L("Description:WeChat.EnabledQuickLogin"), + isVisibleToClients: true, + isEncrypted: false) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName) + ); + } - protected ILocalizableString L(string name) - { - return LocalizableString.Create(name); - } + protected ILocalizableString L(string name) + { + return LocalizableString.Create(name); } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Settings/WeChatSettingNames.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Settings/WeChatSettingNames.cs index cf0c4ffd4..2c768b7c7 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Settings/WeChatSettingNames.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Settings/WeChatSettingNames.cs @@ -1,12 +1,11 @@ -namespace LINGYUN.Abp.WeChat.Settings +namespace LINGYUN.Abp.WeChat.Settings; + +public static class WeChatSettingNames { - public static class WeChatSettingNames - { - public const string Prefix = "Abp.WeChat"; - /// - /// 启用快捷登录 - /// 通过微信code登录时,如果没有注册用户信息且此配置启用时,直接创建新用户并关联openid - /// - public const string EnabledQuickLogin = Prefix + ".EnabledQuickLogin"; - } + public const string Prefix = "Abp.WeChat"; + /// + /// 启用快捷登录 + /// 通过微信code登录时,如果没有注册用户信息且此配置启用时,直接创建新用户并关联openid + /// + public const string EnabledQuickLogin = Prefix + ".EnabledQuickLogin"; } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/IWeChatTokenProvider.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/IWeChatTokenProvider.cs index e9c5e845b..8124fcc5c 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/IWeChatTokenProvider.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/IWeChatTokenProvider.cs @@ -1,10 +1,9 @@ using System.Threading; using System.Threading.Tasks; -namespace LINGYUN.Abp.WeChat.Token +namespace LINGYUN.Abp.WeChat.Token; + +public interface IWeChatTokenProvider { - public interface IWeChatTokenProvider - { - Task GetTokenAsync(string appId, string appSecret, CancellationToken cancellationToken = default); - } + Task GetTokenAsync(string appId, string appSecret, CancellationToken cancellationToken = default); } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatToken.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatToken.cs index 590ede7fb..267f622e8 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatToken.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatToken.cs @@ -1,26 +1,25 @@ -namespace LINGYUN.Abp.WeChat.Token +namespace LINGYUN.Abp.WeChat.Token; + +/// +/// 微信令牌 +/// +public class WeChatToken { /// - /// 微信令牌 + /// 访问令牌 + /// + public string AccessToken { get; set; } + /// + /// 过期时间,单位(s) /// - public class WeChatToken + public int ExpiresIn { get; set; } + public WeChatToken() { - /// - /// 访问令牌 - /// - public string AccessToken { get; set; } - /// - /// 过期时间,单位(s) - /// - public int ExpiresIn { get; set; } - public WeChatToken() - { - } - public WeChatToken(string token, int expiresIn) - { - AccessToken = token; - ExpiresIn = expiresIn; - } + } + public WeChatToken(string token, int expiresIn) + { + AccessToken = token; + ExpiresIn = expiresIn; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenCacheItem.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenCacheItem.cs index c61502111..8560683e3 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenCacheItem.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenCacheItem.cs @@ -1,24 +1,23 @@ -namespace LINGYUN.Abp.WeChat.Token +namespace LINGYUN.Abp.WeChat.Token; + +public class WeChatTokenCacheItem { - public class WeChatTokenCacheItem - { - public string AppId { get; set; } + public string AppId { get; set; } - public WeChatToken WeChatToken { get; set; } - public WeChatTokenCacheItem() - { + public WeChatToken WeChatToken { get; set; } + public WeChatTokenCacheItem() + { - } + } - public WeChatTokenCacheItem(string appId, WeChatToken weChatToken) - { - AppId = appId; - WeChatToken = weChatToken; - } + public WeChatTokenCacheItem(string appId, WeChatToken weChatToken) + { + AppId = appId; + WeChatToken = weChatToken; + } - public static string CalculateCacheKey(string provider, string appId) - { - return "p:" + provider + ",o:" + appId; - } + public static string CalculateCacheKey(string provider, string appId) + { + return "p:" + provider + ",o:" + appId; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenProvider.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenProvider.cs index eb0a422f4..ef32df947 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenProvider.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenProvider.cs @@ -9,82 +9,81 @@ using Volo.Abp.Caching; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.WeChat.Token +namespace LINGYUN.Abp.WeChat.Token; + +public class WeChatTokenProvider : IWeChatTokenProvider, ISingletonDependency { - public class WeChatTokenProvider : IWeChatTokenProvider, ISingletonDependency + public ILogger Logger { get; set; } + protected IHttpClientFactory HttpClientFactory { get; } + protected IDistributedCache Cache { get; } + public WeChatTokenProvider( + IHttpClientFactory httpClientFactory, + IDistributedCache cache) { - public ILogger Logger { get; set; } - protected IHttpClientFactory HttpClientFactory { get; } - protected IDistributedCache Cache { get; } - public WeChatTokenProvider( - IHttpClientFactory httpClientFactory, - IDistributedCache cache) - { - HttpClientFactory = httpClientFactory; - - Cache = cache; - - Logger = NullLogger.Instance; - } + HttpClientFactory = httpClientFactory; - public async virtual Task GetTokenAsync( - string appId, - string appSecret, - CancellationToken cancellationToken = default) - { - return (await GetCacheItemAsync("WeChatToken", appId, appSecret, cancellationToken)).WeChatToken; - } + Cache = cache; - protected async virtual Task GetCacheItemAsync( - string provider, - string appId, - string appSecret, - CancellationToken cancellationToken = default) - { - var cacheKey = WeChatTokenCacheItem.CalculateCacheKey(provider, appId); - - Logger.LogDebug($"WeChatTokenProvider.GetCacheItemAsync: {cacheKey}"); + Logger = NullLogger.Instance; + } - var cacheItem = await Cache.GetAsync(cacheKey, token: cancellationToken); + public async virtual Task GetTokenAsync( + string appId, + string appSecret, + CancellationToken cancellationToken = default) + { + return (await GetCacheItemAsync("WeChatToken", appId, appSecret, cancellationToken)).WeChatToken; + } - if (cacheItem != null) - { - Logger.LogDebug($"Found in the cache: {cacheKey}"); - return cacheItem; - } + protected async virtual Task GetCacheItemAsync( + string provider, + string appId, + string appSecret, + CancellationToken cancellationToken = default) + { + var cacheKey = WeChatTokenCacheItem.CalculateCacheKey(provider, appId); - Logger.LogDebug($"Not found in the cache, getting from the httpClient: {cacheKey}"); + Logger.LogDebug($"WeChatTokenProvider.GetCacheItemAsync: {cacheKey}"); - var client = HttpClientFactory.CreateClient(AbpWeChatGlobalConsts.HttpClient); + var cacheItem = await Cache.GetAsync(cacheKey, token: cancellationToken); - var request = new WeChatTokenRequest - { - BaseUrl = client.BaseAddress.AbsoluteUri, - AppSecret = appSecret, - AppId = appId, - GrantType = "client_credential" - }; + if (cacheItem != null) + { + Logger.LogDebug($"Found in the cache: {cacheKey}"); + return cacheItem; + } - var response = await client.RequestWeChatCodeTokenAsync(request, cancellationToken); - var responseContent = await response.Content.ReadAsStringAsync(); - // 改为直接引用 Newtownsoft.Json - var weChatTokenResponse = JsonConvert.DeserializeObject(responseContent); - var weChatToken = weChatTokenResponse.ToWeChatToken(); - cacheItem = new WeChatTokenCacheItem(appId, weChatToken); + Logger.LogDebug($"Not found in the cache, getting from the httpClient: {cacheKey}"); - Logger.LogDebug($"Setting the cache item: {cacheKey}"); + var client = HttpClientFactory.CreateClient(AbpWeChatGlobalConsts.HttpClient); - var cacheOptions = new DistributedCacheEntryOptions - { - // 设置绝对过期时间为Token有效期剩余的二分钟 - AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(weChatToken.ExpiresIn - 120) - }; + var request = new WeChatTokenRequest + { + BaseUrl = client.BaseAddress.AbsoluteUri, + AppSecret = appSecret, + AppId = appId, + GrantType = "client_credential" + }; + + var response = await client.RequestWeChatCodeTokenAsync(request, cancellationToken); + var responseContent = await response.Content.ReadAsStringAsync(); + // 改为直接引用 Newtownsoft.Json + var weChatTokenResponse = JsonConvert.DeserializeObject(responseContent); + var weChatToken = weChatTokenResponse.ToWeChatToken(); + cacheItem = new WeChatTokenCacheItem(appId, weChatToken); + + Logger.LogDebug($"Setting the cache item: {cacheKey}"); + + var cacheOptions = new DistributedCacheEntryOptions + { + // 设置绝对过期时间为Token有效期剩余的二分钟 + AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(weChatToken.ExpiresIn - 120) + }; - await Cache.SetAsync(cacheKey, cacheItem, cacheOptions, token: cancellationToken); + await Cache.SetAsync(cacheKey, cacheItem, cacheOptions, token: cancellationToken); - Logger.LogDebug($"Finished setting the cache item: {cacheKey}"); + Logger.LogDebug($"Finished setting the cache item: {cacheKey}"); - return cacheItem; - } + return cacheItem; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenRequest.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenRequest.cs index c95b428b1..5e14dd790 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenRequest.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenRequest.cs @@ -1,10 +1,9 @@ -namespace LINGYUN.Abp.WeChat.Token +namespace LINGYUN.Abp.WeChat.Token; + +public class WeChatTokenRequest { - public class WeChatTokenRequest - { - public string BaseUrl { get; set; } - public string GrantType { get; set; } - public string AppId { get; set; } - public string AppSecret { get; set; } - } + public string BaseUrl { get; set; } + public string GrantType { get; set; } + public string AppId { get; set; } + public string AppSecret { get; set; } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenResponse.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenResponse.cs index 166b9d518..5eb5074ed 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenResponse.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Token/WeChatTokenResponse.cs @@ -1,41 +1,40 @@ using LINGYUN.Abp.WeChat.Common; using Newtonsoft.Json; -namespace LINGYUN.Abp.WeChat.Token +namespace LINGYUN.Abp.WeChat.Token; + +/// +/// 微信访问令牌返回对象 +/// +public class WeChatTokenResponse { /// - /// 微信访问令牌返回对象 + /// 错误码 /// - public class WeChatTokenResponse - { - /// - /// 错误码 - /// - [JsonProperty("errcode")] - public int ErrorCode { get; set; } - /// - /// 错误消息 - /// - [JsonProperty("errmsg")] - public string ErrorMessage { get; set; } - /// - /// 访问令牌 - /// - [JsonProperty("access_token")] - public string AccessToken { get; set; } - /// - /// 过期时间,单位(s) - /// - [JsonProperty("expires_in")] - public int ExpiresIn { get; set; } + [JsonProperty("errcode")] + public int ErrorCode { get; set; } + /// + /// 错误消息 + /// + [JsonProperty("errmsg")] + public string ErrorMessage { get; set; } + /// + /// 访问令牌 + /// + [JsonProperty("access_token")] + public string AccessToken { get; set; } + /// + /// 过期时间,单位(s) + /// + [JsonProperty("expires_in")] + public int ExpiresIn { get; set; } - public WeChatToken ToWeChatToken() + public WeChatToken ToWeChatToken() + { + if(ErrorCode != 0) { - if(ErrorCode != 0) - { - throw new AbpWeChatException(ErrorCode.ToString(), ErrorMessage); - } - return new WeChatToken(AccessToken, ExpiresIn); + throw new AbpWeChatException(ErrorCode.ToString(), ErrorMessage); } + return new WeChatToken(AccessToken, ExpiresIn); } } diff --git a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/System/Net/Http/HttpClientWeChatTokenRequestExtensions.cs b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/System/Net/Http/HttpClientWeChatTokenRequestExtensions.cs index dc1883c6b..f37ce33f1 100644 --- a/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/System/Net/Http/HttpClientWeChatTokenRequestExtensions.cs +++ b/aspnet-core/framework/wechat/LINGYUN.Abp.WeChat/System/Net/Http/HttpClientWeChatTokenRequestExtensions.cs @@ -4,43 +4,42 @@ using System.Threading; using System.Threading.Tasks; -namespace System.Net.Http +namespace System.Net.Http; + +public static class HttpClientWeChatTokenRequestExtensions { - public static class HttpClientWeChatTokenRequestExtensions + public static async Task RequestWeChatCodeTokenAsync(this HttpMessageInvoker client, WeChatTokenRequest request, CancellationToken cancellationToken = default) + { + var getResuestUrlBuilder = new StringBuilder(); + getResuestUrlBuilder.Append(request.BaseUrl); + getResuestUrlBuilder.Append("cgi-bin/token"); + getResuestUrlBuilder.Append("?grant_type=client_credential"); + getResuestUrlBuilder.AppendFormat("&appid={0}", request.AppId); + getResuestUrlBuilder.AppendFormat("&secret={0}", request.AppSecret); + + var getRequest = new HttpRequestMessage(HttpMethod.Get, getResuestUrlBuilder.ToString()); + HttpResponseMessage httpResponse; + + httpResponse = await client.SendAsync(getRequest, cancellationToken).ConfigureAwait(false); + + return httpResponse; + } + + public static async Task RequestWeChatOpenIdAsync(this HttpMessageInvoker client, WeChatOpenIdRequest request, CancellationToken cancellationToken = default) { - public static async Task RequestWeChatCodeTokenAsync(this HttpMessageInvoker client, WeChatTokenRequest request, CancellationToken cancellationToken = default) - { - var getResuestUrlBuilder = new StringBuilder(); - getResuestUrlBuilder.Append(request.BaseUrl); - getResuestUrlBuilder.Append("cgi-bin/token"); - getResuestUrlBuilder.Append("?grant_type=client_credential"); - getResuestUrlBuilder.AppendFormat("&appid={0}", request.AppId); - getResuestUrlBuilder.AppendFormat("&secret={0}", request.AppSecret); - - var getRequest = new HttpRequestMessage(HttpMethod.Get, getResuestUrlBuilder.ToString()); - HttpResponseMessage httpResponse; - - httpResponse = await client.SendAsync(getRequest, cancellationToken).ConfigureAwait(false); - - return httpResponse; - } - - public static async Task RequestWeChatOpenIdAsync(this HttpMessageInvoker client, WeChatOpenIdRequest request, CancellationToken cancellationToken = default) - { - var getResuestUrlBuiilder = new StringBuilder(); - getResuestUrlBuiilder.Append(request.BaseUrl); - getResuestUrlBuiilder.Append("sns/jscode2session"); - getResuestUrlBuiilder.AppendFormat("?appid={0}", request.AppId); - getResuestUrlBuiilder.AppendFormat("&secret={0}", request.Secret); - getResuestUrlBuiilder.AppendFormat("&js_code={0}", request.Code); - getResuestUrlBuiilder.Append("&grant_type=authorization_code"); - - var getRequest = new HttpRequestMessage(HttpMethod.Get, getResuestUrlBuiilder.ToString()); - HttpResponseMessage httpResponse; - - httpResponse = await client.SendAsync(getRequest, cancellationToken).ConfigureAwait(false); - - return httpResponse; - } + var getResuestUrlBuiilder = new StringBuilder(); + getResuestUrlBuiilder.Append(request.BaseUrl); + getResuestUrlBuiilder.Append("sns/jscode2session"); + getResuestUrlBuiilder.AppendFormat("?appid={0}", request.AppId); + getResuestUrlBuiilder.AppendFormat("&secret={0}", request.Secret); + getResuestUrlBuiilder.AppendFormat("&js_code={0}", request.Code); + getResuestUrlBuiilder.Append("&grant_type=authorization_code"); + + var getRequest = new HttpRequestMessage(HttpMethod.Get, getResuestUrlBuiilder.ToString()); + HttpResponseMessage httpResponse; + + httpResponse = await client.SendAsync(getRequest, cancellationToken).ConfigureAwait(false); + + return httpResponse; } } diff --git a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.Identity.WxPusher/LINGYUN.Abp.Identity.WxPusher.csproj b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.Identity.WxPusher/LINGYUN.Abp.Identity.WxPusher.csproj index e37bb288f..646305446 100644 --- a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.Identity.WxPusher/LINGYUN.Abp.Identity.WxPusher.csproj +++ b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.Identity.WxPusher/LINGYUN.Abp.Identity.WxPusher.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.Identity.WxPusher + LINGYUN.Abp.Identity.WxPusher + false + false + false diff --git a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN.Abp.WxPusher.SettingManagement.csproj b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN.Abp.WxPusher.SettingManagement.csproj index 8e10d1665..032cbc797 100644 --- a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN.Abp.WxPusher.SettingManagement.csproj +++ b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN.Abp.WxPusher.SettingManagement.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.WxPusher.SettingManagement + LINGYUN.Abp.WxPusher.SettingManagement + false + false + false diff --git a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/AbpWxPusherSettingManagementModule.cs b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/AbpWxPusherSettingManagementModule.cs index 13d7b4b40..288cf966e 100644 --- a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/AbpWxPusherSettingManagementModule.cs +++ b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/AbpWxPusherSettingManagementModule.cs @@ -6,43 +6,42 @@ using Volo.Abp.Modularity; using Volo.Abp.VirtualFileSystem; -namespace LINGYUN.Abp.WxPusher.SettingManagement +namespace LINGYUN.Abp.WxPusher.SettingManagement; + +[DependsOn( + typeof(AbpWxPusherModule), + typeof(AbpAspNetCoreMvcModule))] +public class AbpWxPusherSettingManagementModule : AbpModule { - [DependsOn( - typeof(AbpWxPusherModule), - typeof(AbpAspNetCoreMvcModule))] - public class AbpWxPusherSettingManagementModule : AbpModule + public override void PreConfigureServices(ServiceConfigurationContext context) { - public override void PreConfigureServices(ServiceConfigurationContext context) + PreConfigure(mvcBuilder => { - PreConfigure(mvcBuilder => - { - mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpWxPusherSettingManagementModule).Assembly); - }); - } + mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpWxPusherSettingManagementModule).Assembly); + }); + } - public override void ConfigureServices(ServiceConfigurationContext context) + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => { - Configure(options => - { - options.FileSets.AddEmbedded(); - }); + options.FileSets.AddEmbedded(); + }); - Configure(options => - { - options.Resources - .Get() - .AddVirtualJson("/LINGYUN/Abp/WxPusher/SettingManagement/Localization/Resources"); - }); + Configure(options => + { + options.Resources + .Get() + .AddVirtualJson("/LINGYUN/Abp/WxPusher/SettingManagement/Localization/Resources"); + }); - Configure(options => - { - options.Resources - .Get() - .AddBaseTypes( - typeof(AbpUiResource) - ); - }); - } + Configure(options => + { + options.Resources + .Get() + .AddBaseTypes( + typeof(AbpUiResource) + ); + }); } } diff --git a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/IWxPusherSettingAppService.cs b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/IWxPusherSettingAppService.cs index a51e6bba9..6d06ae9c7 100644 --- a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/IWxPusherSettingAppService.cs +++ b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/IWxPusherSettingAppService.cs @@ -1,8 +1,7 @@ using LINGYUN.Abp.SettingManagement; -namespace LINGYUN.Abp.WxPusher.SettingManagement +namespace LINGYUN.Abp.WxPusher.SettingManagement; + +public interface IWxPusherSettingAppService : IReadonlySettingAppService { - public interface IWxPusherSettingAppService : IReadonlySettingAppService - { - } } diff --git a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/WxPusherSettingAppService.cs b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/WxPusherSettingAppService.cs index 8689fa90c..12158e5ce 100644 --- a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/WxPusherSettingAppService.cs +++ b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/WxPusherSettingAppService.cs @@ -9,55 +9,54 @@ using Volo.Abp.SettingManagement; using Volo.Abp.Settings; -namespace LINGYUN.Abp.WxPusher.SettingManagement +namespace LINGYUN.Abp.WxPusher.SettingManagement; + +public class WxPusherSettingAppService : ApplicationService, IWxPusherSettingAppService { - public class WxPusherSettingAppService : ApplicationService, IWxPusherSettingAppService + protected ISettingManager SettingManager { get; } + protected IPermissionChecker PermissionChecker { get; } + protected ISettingDefinitionManager SettingDefinitionManager { get; } + + public WxPusherSettingAppService( + ISettingManager settingManager, + IPermissionChecker permissionChecker, + ISettingDefinitionManager settingDefinitionManager) { - protected ISettingManager SettingManager { get; } - protected IPermissionChecker PermissionChecker { get; } - protected ISettingDefinitionManager SettingDefinitionManager { get; } - - public WxPusherSettingAppService( - ISettingManager settingManager, - IPermissionChecker permissionChecker, - ISettingDefinitionManager settingDefinitionManager) - { - SettingManager = settingManager; - PermissionChecker = permissionChecker; - SettingDefinitionManager = settingDefinitionManager; - LocalizationResource = typeof(WxPusherResource); - } + SettingManager = settingManager; + PermissionChecker = permissionChecker; + SettingDefinitionManager = settingDefinitionManager; + LocalizationResource = typeof(WxPusherResource); + } - public async virtual Task GetAllForCurrentTenantAsync() - { - return await GetAllForProviderAsync(TenantSettingValueProvider.ProviderName, CurrentTenant.GetId().ToString()); - } + public async virtual Task GetAllForCurrentTenantAsync() + { + return await GetAllForProviderAsync(TenantSettingValueProvider.ProviderName, CurrentTenant.GetId().ToString()); + } - public async virtual Task GetAllForGlobalAsync() - { - return await GetAllForProviderAsync(GlobalSettingValueProvider.ProviderName, null); - } + public async virtual Task GetAllForGlobalAsync() + { + return await GetAllForProviderAsync(GlobalSettingValueProvider.ProviderName, null); + } - protected async virtual Task GetAllForProviderAsync(string providerName, string providerKey) + protected async virtual Task GetAllForProviderAsync(string providerName, string providerKey) + { + var settingGroups = new SettingGroupResult(); + var wxPusherSettingGroup = new SettingGroupDto(L["DisplayName:WxPusher"], L["Description:WxPusher"]); + + if (await FeatureChecker.IsEnabledAsync(WxPusherFeatureNames.Enable) && + await PermissionChecker.IsGrantedAsync(WxPusherSettingPermissionNames.ManageSetting)) { - var settingGroups = new SettingGroupResult(); - var wxPusherSettingGroup = new SettingGroupDto(L["DisplayName:WxPusher"], L["Description:WxPusher"]); - - if (await FeatureChecker.IsEnabledAsync(WxPusherFeatureNames.Enable) && - await PermissionChecker.IsGrantedAsync(WxPusherSettingPermissionNames.ManageSetting)) - { - var securitySetting = wxPusherSettingGroup.AddSetting(L["Security"], L["Security"]); - securitySetting.AddDetail( - await SettingDefinitionManager.GetAsync(WxPusherSettingNames.Security.AppToken), - StringLocalizerFactory, - await SettingManager.GetOrNullAsync(WxPusherSettingNames.Security.AppToken, providerName, providerKey), - ValueType.String, - providerName); - } - - settingGroups.AddGroup(wxPusherSettingGroup); - - return settingGroups; + var securitySetting = wxPusherSettingGroup.AddSetting(L["Security"], L["Security"]); + securitySetting.AddDetail( + await SettingDefinitionManager.GetAsync(WxPusherSettingNames.Security.AppToken), + StringLocalizerFactory, + await SettingManager.GetOrNullAsync(WxPusherSettingNames.Security.AppToken, providerName, providerKey), + ValueType.String, + providerName); } + + settingGroups.AddGroup(wxPusherSettingGroup); + + return settingGroups; } } diff --git a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/WxPusherSettingController.cs b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/WxPusherSettingController.cs index be5896e36..ab7c44f8a 100644 --- a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/WxPusherSettingController.cs +++ b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/WxPusherSettingController.cs @@ -4,33 +4,32 @@ using Volo.Abp; using Volo.Abp.AspNetCore.Mvc; -namespace LINGYUN.Abp.WxPusher.SettingManagement +namespace LINGYUN.Abp.WxPusher.SettingManagement; + +[RemoteService(Name = AbpSettingManagementRemoteServiceConsts.RemoteServiceName)] +[Area(AbpSettingManagementRemoteServiceConsts.ModuleName)] +[Route($"api/{AbpSettingManagementRemoteServiceConsts.ModuleName}/wx-pusher")] +public class WxPusherSettingController : AbpControllerBase, IWxPusherSettingAppService { - [RemoteService(Name = AbpSettingManagementRemoteServiceConsts.RemoteServiceName)] - [Area(AbpSettingManagementRemoteServiceConsts.ModuleName)] - [Route($"api/{AbpSettingManagementRemoteServiceConsts.ModuleName}/wx-pusher")] - public class WxPusherSettingController : AbpControllerBase, IWxPusherSettingAppService - { - protected IWxPusherSettingAppService Service { get; } + protected IWxPusherSettingAppService Service { get; } - public WxPusherSettingController( - IWxPusherSettingAppService service) - { - Service = service; - } + public WxPusherSettingController( + IWxPusherSettingAppService service) + { + Service = service; + } - [HttpGet] - [Route("by-current-tenant")] - public async virtual Task GetAllForCurrentTenantAsync() - { - return await Service.GetAllForCurrentTenantAsync(); - } + [HttpGet] + [Route("by-current-tenant")] + public async virtual Task GetAllForCurrentTenantAsync() + { + return await Service.GetAllForCurrentTenantAsync(); + } - [HttpGet] - [Route("by-global")] - public async virtual Task GetAllForGlobalAsync() - { - return await Service.GetAllForGlobalAsync(); - } + [HttpGet] + [Route("by-global")] + public async virtual Task GetAllForGlobalAsync() + { + return await Service.GetAllForGlobalAsync(); } } diff --git a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/WxPusherSettingPermissionDefinitionProvider.cs b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/WxPusherSettingPermissionDefinitionProvider.cs index 7256f2e51..9915f29d4 100644 --- a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/WxPusherSettingPermissionDefinitionProvider.cs +++ b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/WxPusherSettingPermissionDefinitionProvider.cs @@ -2,23 +2,22 @@ using Volo.Abp.Authorization.Permissions; using Volo.Abp.Localization; -namespace LINGYUN.Abp.WxPusher.SettingManagement +namespace LINGYUN.Abp.WxPusher.SettingManagement; + +public class WxPusherSettingPermissionDefinitionProvider : PermissionDefinitionProvider { - public class WxPusherSettingPermissionDefinitionProvider : PermissionDefinitionProvider + public override void Define(IPermissionDefinitionContext context) { - public override void Define(IPermissionDefinitionContext context) - { - var wxPusherGroup = context.AddGroup( - WxPusherSettingPermissionNames.GroupName, - L("Permission:WxPusher")); + var wxPusherGroup = context.AddGroup( + WxPusherSettingPermissionNames.GroupName, + L("Permission:WxPusher")); - wxPusherGroup.AddPermission( - WxPusherSettingPermissionNames.ManageSetting, L("Permission:ManageSetting")); - } + wxPusherGroup.AddPermission( + WxPusherSettingPermissionNames.ManageSetting, L("Permission:ManageSetting")); + } - private static LocalizableString L(string name) - { - return LocalizableString.Create(name); - } + private static LocalizableString L(string name) + { + return LocalizableString.Create(name); } } diff --git a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/WxPusherSettingPermissionNames.cs b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/WxPusherSettingPermissionNames.cs index 6fa23ddcd..1ed0dc92e 100644 --- a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/WxPusherSettingPermissionNames.cs +++ b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/WxPusherSettingPermissionNames.cs @@ -1,9 +1,8 @@ -namespace LINGYUN.Abp.WxPusher.SettingManagement +namespace LINGYUN.Abp.WxPusher.SettingManagement; + +public class WxPusherSettingPermissionNames { - public class WxPusherSettingPermissionNames - { - public const string GroupName = "Abp.WxPusher"; + public const string GroupName = "Abp.WxPusher"; - public const string ManageSetting = GroupName + ".ManageSetting"; - } + public const string ManageSetting = GroupName + ".ManageSetting"; } diff --git a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN.Abp.WxPusher.csproj b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN.Abp.WxPusher.csproj index 9e5d55058..ca9c3a7d1 100644 --- a/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN.Abp.WxPusher.csproj +++ b/aspnet-core/framework/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN.Abp.WxPusher.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.WxPusher + LINGYUN.Abp.WxPusher + false + false + false diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/LY.MicroService.Applications.Single.DbMigrator.csproj b/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/LY.MicroService.Applications.Single.DbMigrator.csproj index d4974c9a5..5413d85b2 100644 --- a/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/LY.MicroService.Applications.Single.DbMigrator.csproj +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/LY.MicroService.Applications.Single.DbMigrator.csproj @@ -28,6 +28,18 @@ + + + + + + + PreserveNewest + true + PreserveNewest + + + diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.json b/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.json index 72622dc23..cdbc3c08f 100644 --- a/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.json +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.json @@ -1,22 +1,22 @@ { "ConnectionStrings": { - "Default": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456", - "AbpAuditLogging": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456", - "AbpOpenIddict": "Server=127.0.0.1;Database=IdentityServer-V70;User Id=root;Password=123456", - "AbpIdentity": "Server=127.0.0.1;Database=IdentityServer-V70;User Id=root;Password=123456", - "AbpIdentityServer": "Server=127.0.0.1;Database=IdentityServer-V70;User Id=root;Password=123456", - "AbpSaas": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456", - "AbpTenantManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456", - "AbpFeatureManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456", - "AbpSettingManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456", - "AbpPermissionManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456", - "AbpLocalizationManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456", - "AbpTextTemplating": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456", - "AppPlatform": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456", - "TaskManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456", - "Workflow": "Server=127.0.0.1;Database=Workflow-V70;User Id=root;Password=123456", - "Notifications": "Server=127.0.0.1;Database=Messages-V70;User Id=root;Password=123456", - "MessageService": "Server=127.0.0.1;Database=Messages-V70;User Id=root;Password=123456" + "Default": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None", + "AbpAuditLogging": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None", + "AbpOpenIddict": "Server=127.0.0.1;Database=IdentityServer-V70;User Id=root;Password=123456;SslMode=None", + "AbpIdentity": "Server=127.0.0.1;Database=IdentityServer-V70;User Id=root;Password=123456;SslMode=None", + "AbpIdentityServer": "Server=127.0.0.1;Database=IdentityServer-V70;User Id=root;Password=123456;SslMode=None", + "AbpSaas": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None", + "AbpTenantManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None", + "AbpFeatureManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None", + "AbpSettingManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None", + "AbpPermissionManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None", + "AbpLocalizationManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None", + "AbpTextTemplating": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None", + "AppPlatform": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None", + "TaskManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None", + "Workflow": "Server=127.0.0.1;Database=Workflow-V70;User Id=root;Password=123456;SslMode=None", + "Notifications": "Server=127.0.0.1;Database=Messages-V70;User Id=root;Password=123456;SslMode=None", + "MessageService": "Server=127.0.0.1;Database=Messages-V70;User Id=root;Password=123456;SslMode=None" }, "StringEncryption": { "DefaultPassPhrase": "s46c5q55nxpeS8Ra", diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/LY.MicroService.Applications.Single.EntityFrameworkCore.csproj b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/LY.MicroService.Applications.Single.EntityFrameworkCore.csproj index 34c2f1d33..fa6c94c57 100644 --- a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/LY.MicroService.Applications.Single.EntityFrameworkCore.csproj +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/LY.MicroService.Applications.Single.EntityFrameworkCore.csproj @@ -13,7 +13,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + + diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/Migrations/20240624002940_Upgrade-Abp-Framework-To-8.1.3.Designer.cs b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/Migrations/20240624002940_Upgrade-Abp-Framework-To-8.1.3.Designer.cs new file mode 100644 index 000000000..16bdefa42 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/Migrations/20240624002940_Upgrade-Abp-Framework-To-8.1.3.Designer.cs @@ -0,0 +1,5329 @@ +// +using System; +using LY.MicroService.Applications.Single.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace LY.MicroService.Applications.Single.EntityFrameworkCore.Migrations +{ + [DbContext(typeof(SingleMigrationsDbContext))] + [Migration("20240624002940_Upgrade-Abp-Framework-To-8.1.3")] + partial class UpgradeAbpFrameworkTo813 + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) + .HasAnnotation("ProductVersion", "8.0.0") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("LINGYUN.Abp.LocalizationManagement.Language", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("CultureName") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasColumnName("CultureName"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("DisplayName"); + + b.Property("Enable") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true); + + b.Property("FlagIcon") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("FlagIcon"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("UiCultureName") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasColumnName("UiCultureName"); + + b.HasKey("Id"); + + b.HasIndex("CultureName"); + + b.ToTable("AbpLocalizationLanguages", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.LocalizationManagement.Resource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DefaultCultureName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("DefaultCultureName"); + + b.Property("Description") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Description"); + + b.Property("DisplayName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("DisplayName"); + + b.Property("Enable") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasColumnName("Name"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AbpLocalizationResources", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.LocalizationManagement.Text", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("CultureName") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasColumnName("CultureName"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("Key"); + + b.Property("ResourceName") + .HasColumnType("longtext"); + + b.Property("Value") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)") + .HasColumnName("Value"); + + b.HasKey("Id"); + + b.HasIndex("Key"); + + b.ToTable("AbpLocalizationTexts", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatCard", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("Age") + .HasColumnType("int"); + + b.Property("AvatarUrl") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("Birthday") + .HasColumnType("datetime(6)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Description") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LastOnlineTime") + .HasColumnType("datetime(6)"); + + b.Property("NickName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Sex") + .HasColumnType("int"); + + b.Property("Sign") + .HasMaxLength(30) + .HasColumnType("varchar(30)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AppUserChatCards", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatFriend", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("Black") + .HasColumnType("tinyint(1)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Description") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("DontDisturb") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("FrientId") + .HasColumnType("char(36)"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("RemarkName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("SpecialFocus") + .HasColumnType("tinyint(1)"); + + b.Property("Status") + .HasColumnType("tinyint unsigned"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId", "FrientId"); + + b.ToTable("AppUserChatFriends", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("AllowAddFriend") + .HasColumnType("tinyint(1)"); + + b.Property("AllowAnonymous") + .HasColumnType("tinyint(1)"); + + b.Property("AllowReceiveMessage") + .HasColumnType("tinyint(1)"); + + b.Property("AllowSendMessage") + .HasColumnType("tinyint(1)"); + + b.Property("RequireAddFriendValition") + .HasColumnType("tinyint(1)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AppUserChatSettings", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Content") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("longtext"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("MessageId") + .HasColumnType("bigint"); + + b.Property("ReceiveUserId") + .HasColumnType("char(36)"); + + b.Property("SendUserName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Source") + .HasColumnType("int"); + + b.Property("State") + .HasColumnType("tinyint"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ReceiveUserId"); + + b.ToTable("AppUserMessages", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Groups.ChatGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("Address") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("AdminUserId") + .HasColumnType("char(36)"); + + b.Property("AllowAnonymous") + .HasColumnType("tinyint(1)"); + + b.Property("AllowSendMessage") + .HasColumnType("tinyint(1)"); + + b.Property("AvatarUrl") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Description") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("GroupId") + .HasColumnType("bigint"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("MaxUserCount") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)"); + + b.Property("Notice") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Tag") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name"); + + b.ToTable("AppChatGroups", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Groups.GroupChatBlack", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("GroupId") + .HasColumnType("bigint"); + + b.Property("ShieldUserId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "GroupId"); + + b.ToTable("AppGroupChatBlacks", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Groups.GroupMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Content") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("longtext"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("GroupId") + .HasColumnType("bigint"); + + b.Property("MessageId") + .HasColumnType("bigint"); + + b.Property("SendUserName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Source") + .HasColumnType("int"); + + b.Property("State") + .HasColumnType("tinyint"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "GroupId"); + + b.ToTable("AppGroupMessages", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Groups.UserChatGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("GroupId") + .HasColumnType("bigint"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "GroupId", "UserId"); + + b.ToTable("AppUserChatGroups", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Groups.UserGroupCard", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsAdmin") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("NickName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("SilenceEnd") + .HasColumnType("datetime(6)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AppUserGroupCards", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Notifications.Notification", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("ExpirationTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("NotificationId") + .HasColumnType("bigint"); + + b.Property("NotificationName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("NotificationTypeName") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("Severity") + .HasColumnType("tinyint"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "NotificationName"); + + b.ToTable("AppNotifications", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Notifications.NotificationDefinitionGroupRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowSubscriptionToClients") + .HasColumnType("tinyint(1)"); + + b.Property("Description") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("DisplayName") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.ToTable("AppNotificationDefinitionGroups", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Notifications.NotificationDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowSubscriptionToClients") + .HasColumnType("tinyint(1)"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("Description") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("DisplayName") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("NotificationLifetime") + .HasColumnType("int"); + + b.Property("NotificationType") + .HasColumnType("int"); + + b.Property("Providers") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Template") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.ToTable("AppNotificationDefinitions", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Notifications.UserNotification", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("NotificationId") + .HasColumnType("bigint"); + + b.Property("ReadStatus") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId", "NotificationId") + .HasDatabaseName("IX_Tenant_User_Notification_Id"); + + b.ToTable("AppUserNotifications", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Notifications.UserSubscribe", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("NotificationName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasDefaultValue("/"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId", "NotificationName") + .IsUnique() + .HasDatabaseName("IX_Tenant_User_Notification_Name"); + + b.ToTable("AppUserSubscribes", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Saas.Editions.Edition", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.HasKey("Id"); + + b.HasIndex("DisplayName"); + + b.ToTable("AbpEditions", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisableTime") + .HasColumnType("datetime(6)"); + + b.Property("EditionId") + .HasColumnType("char(36)"); + + b.Property("EnableTime") + .HasColumnType("datetime(6)"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("NormalizedName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("EditionId"); + + b.HasIndex("Name"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpTenants", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.TaskManagement.BackgroundJobAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("JobId") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("JobId"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("Name"); + + b.Property("Paramters") + .HasColumnType("longtext") + .HasColumnName("Paramters"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("TK_BackgroundJobActions", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.TaskManagement.BackgroundJobInfo", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("Args") + .HasColumnType("longtext") + .HasColumnName("Args"); + + b.Property("BeginTime") + .HasColumnType("datetime(6)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Cron") + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasColumnName("Cron"); + + b.Property("Description") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Description"); + + b.Property("EndTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Group") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("Group"); + + b.Property("Interval") + .HasColumnType("int"); + + b.Property("IsAbandoned") + .HasColumnType("tinyint(1)"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("JobType") + .HasColumnType("int"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LastRunTime") + .HasColumnType("datetime(6)"); + + b.Property("LockTimeOut") + .HasColumnType("int"); + + b.Property("MaxCount") + .HasColumnType("int"); + + b.Property("MaxTryCount") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("Name"); + + b.Property("NextRunTime") + .HasColumnType("datetime(6)"); + + b.Property("NodeName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("NodeName"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Result") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasColumnName("Result"); + + b.Property("Source") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TriggerCount") + .HasColumnType("int"); + + b.Property("TryCount") + .HasColumnType("int"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasColumnName("Type"); + + b.HasKey("Id"); + + b.HasIndex("Name", "Group"); + + b.ToTable("TK_BackgroundJobs", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.TaskManagement.BackgroundJobLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("Exception") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)") + .HasColumnName("Exception"); + + b.Property("JobGroup") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("JobGroup"); + + b.Property("JobId") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("JobId"); + + b.Property("JobName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("JobName"); + + b.Property("JobType") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasColumnName("JobType"); + + b.Property("Message") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasColumnName("Message"); + + b.Property("RunTime") + .HasColumnType("datetime(6)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("JobGroup", "JobName"); + + b.ToTable("TK_BackgroundJobLogs", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.TextTemplating.TextTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Content") + .HasMaxLength(1048576) + .HasColumnType("longtext") + .HasColumnName("Content"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Culture") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("Culture"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("DisplayName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("Name"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .HasDatabaseName("IX_Tenant_Text_Template_Name"); + + b.ToTable("AbpTextTemplates", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.TextTemplating.TextTemplateDefinition", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("DefaultCultureName") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("DefaultCultureName"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsInlineLocalized") + .HasColumnType("tinyint(1)"); + + b.Property("IsLayout") + .HasColumnType("tinyint(1)"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("Layout") + .HasMaxLength(60) + .HasColumnType("varchar(60)") + .HasColumnName("Layout"); + + b.Property("LocalizationResourceName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("LocalizationResourceName"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("Name"); + + b.Property("RenderEngine") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("RenderEngine"); + + b.HasKey("Id"); + + b.ToTable("AbpTextTemplateDefinitions", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.WebhooksManagement.WebhookDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("RequiredFeatures") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpWebhooksWebhooks", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.WebhooksManagement.WebhookEventRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("Data") + .HasMaxLength(2147483647) + .HasColumnType("longtext") + .HasColumnName("Data"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("WebhookName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("WebhookName"); + + b.HasKey("Id"); + + b.ToTable("AbpWebhooksEvents", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.WebhooksManagement.WebhookGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpWebhooksWebhookGroups", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.WebhooksManagement.WebhookSendRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("RequestHeaders") + .HasMaxLength(2147483647) + .HasColumnType("longtext") + .HasColumnName("RequestHeaders"); + + b.Property("Response") + .HasMaxLength(2147483647) + .HasColumnType("longtext") + .HasColumnName("Response"); + + b.Property("ResponseHeaders") + .HasMaxLength(2147483647) + .HasColumnType("longtext") + .HasColumnName("ResponseHeaders"); + + b.Property("ResponseStatusCode") + .HasColumnType("int"); + + b.Property("SendExactSameData") + .HasColumnType("tinyint(1)"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("WebhookEventId") + .HasColumnType("char(36)"); + + b.Property("WebhookSubscriptionId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("WebhookEventId"); + + b.ToTable("AbpWebhooksSendAttempts", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.WebhooksManagement.WebhookSubscription", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Description") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("Description"); + + b.Property("Headers") + .HasMaxLength(2147483647) + .HasColumnType("longtext") + .HasColumnName("Headers"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("Secret") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("Secret"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("TimeoutDuration") + .HasColumnType("int"); + + b.Property("WebhookUri") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("WebhookUri"); + + b.Property("Webhooks") + .HasMaxLength(2147483647) + .HasColumnType("longtext") + .HasColumnName("Webhooks"); + + b.HasKey("Id"); + + b.ToTable("AbpWebhooksSubscriptions", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Datas.Data", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)") + .HasColumnName("Description"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("Name"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AppPlatformDatas", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Datas.DataItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowBeNull") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DataId") + .HasColumnType("char(36)"); + + b.Property("DefaultValue") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DefaultValue"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)") + .HasColumnName("Description"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("Name"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("DataId"); + + b.HasIndex("Name"); + + b.ToTable("AppPlatformDataItems", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Layouts.Layout", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DataId") + .HasColumnType("char(36)"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Framework") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Framework"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("Path") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Path"); + + b.Property("Redirect") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Redirect"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("AppPlatformLayouts", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Menus.Menu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(23) + .HasColumnType("varchar(23)") + .HasColumnName("Code"); + + b.Property("Component") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Component"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Framework") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Framework"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LayoutId") + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("Path") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Path"); + + b.Property("Redirect") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Redirect"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("AppPlatformMenus", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Menus.RoleMenu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("MenuId") + .HasColumnType("char(36)"); + + b.Property("RoleName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("RoleName"); + + b.Property("Startup") + .HasColumnType("tinyint(1)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleName", "MenuId"); + + b.ToTable("AppPlatformRoleMenus", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Menus.UserFavoriteMenu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AliasName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("AliasName"); + + b.Property("Color") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("Color"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("Framework") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Framework"); + + b.Property("Icon") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("Icon"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("MenuId") + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("Path") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Path"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId", "MenuId"); + + b.ToTable("AppPlatformUserFavoriteMenus", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Menus.UserMenu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("MenuId") + .HasColumnType("char(36)"); + + b.Property("Startup") + .HasColumnType("tinyint(1)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId", "MenuId"); + + b.ToTable("AppPlatformUserMenus", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Packages.Package", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Authors") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("Authors"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Description"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("ForceUpdate") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Name"); + + b.Property("Note") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)") + .HasColumnName("Note"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("Version"); + + b.HasKey("Id"); + + b.HasIndex("Name", "Version"); + + b.ToTable("AppPlatformPackages", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Packages.PackageBlob", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Authors") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("Authors"); + + b.Property("ContentType") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ContentType"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DownloadCount") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("License") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)") + .HasColumnName("License"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Name"); + + b.Property("PackageId") + .HasColumnType("char(36)"); + + b.Property("SHA256") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("SHA256"); + + b.Property("Size") + .HasColumnType("bigint"); + + b.Property("Summary") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)") + .HasColumnName("Summary"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UpdatedAt") + .HasColumnType("datetime(6)"); + + b.Property("Url") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("Url"); + + b.HasKey("Id"); + + b.HasIndex("PackageId", "Name"); + + b.ToTable("AppPlatformPackageBlobs", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Portal.Enterprise", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Address") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Address"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("EnglishName") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("EnglishName"); + + b.Property("ExpirationDate") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LegalMan") + .HasMaxLength(60) + .HasColumnType("varchar(60)") + .HasColumnName("LegalMan"); + + b.Property("Logo") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("Logo"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Name"); + + b.Property("OrganizationCode") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("OrganizationCode"); + + b.Property("RegistrationCode") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("RegistrationCode"); + + b.Property("RegistrationDate") + .HasColumnType("datetime(6)"); + + b.Property("TaxCode") + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("TaxCode"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.ToTable("AppPlatformEnterprises", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("longtext"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("int") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ImpersonatorTenantName"); + + b.Property("ImpersonatorUserId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorUserId"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ImpersonatorUserName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("TenantName"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("char(36)") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("datetime(6)") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("tinyint unsigned") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("char(36)"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("EntityChangeId") + .HasColumnType("char(36)"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("tinyint(1)"); + + b.Property("IsVisibleToClients") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatureGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpFeatureValues", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("SourceTenantId") + .HasColumnType("char(36)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("TargetTenantId") + .HasColumnType("char(36)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique(); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("tinyint(1)") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnName("IsActive"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LastPasswordChangeTime") + .HasColumnType("datetime(6)"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("datetime(6)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("SecurityStamp"); + + b.Property("ShouldChangePasswordOnNextLogin") + .HasColumnType("tinyint(1)"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserDelegation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("EndTime") + .HasColumnType("datetime(6)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("StartTime") + .HasColumnType("datetime(6)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("AbpUserDelegations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("varchar(196)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("varchar(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowedAccessTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiResourceId", "Type"); + + b.ToTable("IdentityServerApiResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ApiResourceId", "Key", "Value"); + + b.ToTable("IdentityServerApiResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiResourceId", "Scope"); + + b.ToTable("IdentityServerApiResourceScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiResourceSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiScopeId", "Type"); + + b.ToTable("IdentityServerApiScopeClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ApiScopeId", "Key", "Value"); + + b.ToTable("IdentityServerApiScopeProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AbsoluteRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenType") + .HasColumnType("int"); + + b.Property("AllowAccessTokensViaBrowser") + .HasColumnType("tinyint(1)"); + + b.Property("AllowOfflineAccess") + .HasColumnType("tinyint(1)"); + + b.Property("AllowPlainTextPkce") + .HasColumnType("tinyint(1)"); + + b.Property("AllowRememberConsent") + .HasColumnType("tinyint(1)"); + + b.Property("AllowedIdentityTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("AlwaysIncludeUserClaimsInIdToken") + .HasColumnType("tinyint(1)"); + + b.Property("AlwaysSendClientClaims") + .HasColumnType("tinyint(1)"); + + b.Property("AuthorizationCodeLifetime") + .HasColumnType("int"); + + b.Property("BackChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("BackChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ClientClaimsPrefix") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentLifetime") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DeviceCodeLifetime") + .HasColumnType("int"); + + b.Property("EnableLocalLogin") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("FrontChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("FrontChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("IdentityTokenLifetime") + .HasColumnType("int"); + + b.Property("IncludeJwtId") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("PairWiseSubjectSalt") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ProtocolType") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("RefreshTokenExpiration") + .HasColumnType("int"); + + b.Property("RefreshTokenUsage") + .HasColumnType("int"); + + b.Property("RequireClientSecret") + .HasColumnType("tinyint(1)"); + + b.Property("RequireConsent") + .HasColumnType("tinyint(1)"); + + b.Property("RequirePkce") + .HasColumnType("tinyint(1)"); + + b.Property("RequireRequestObject") + .HasColumnType("tinyint(1)"); + + b.Property("SlidingRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("UpdateAccessTokenClaimsOnRefresh") + .HasColumnType("tinyint(1)"); + + b.Property("UserCodeType") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("UserSsoLifetime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("IdentityServerClients", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Origin") + .HasMaxLength(150) + .HasColumnType("varchar(150)"); + + b.HasKey("ClientId", "Origin"); + + b.ToTable("IdentityServerClientCorsOrigins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("GrantType") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.HasKey("ClientId", "GrantType"); + + b.ToTable("IdentityServerClientGrantTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Provider") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ClientId", "Provider"); + + b.ToTable("IdentityServerClientIdPRestrictions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("PostLogoutRedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "PostLogoutRedirectUri"); + + b.ToTable("IdentityServerClientPostLogoutRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "Key", "Value"); + + b.ToTable("IdentityServerClientProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("RedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "RedirectUri"); + + b.ToTable("IdentityServerClientRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ClientId", "Scope"); + + b.ToTable("IdentityServerClientScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Description") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("varchar(10000)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("DeviceCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("UserCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode"); + + b.ToTable("IdentityServerDeviceFlowCodes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => + { + b.Property("Key") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsumedTime") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("varchar(10000)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Key"); + + b.HasIndex("Expiration"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.HasIndex("SubjectId", "SessionId", "Type"); + + b.ToTable("IdentityServerPersistedGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerIdentityResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("IdentityResourceId", "Type"); + + b.ToTable("IdentityServerIdentityResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("IdentityResourceId", "Key", "Value"); + + b.ToTable("IdentityServerIdentityResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationType") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ClientId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("ClientSecret") + .HasColumnType("longtext"); + + b.Property("ClientType") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ClientUri") + .HasColumnType("longtext"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentType") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .HasColumnType("longtext"); + + b.Property("DisplayNames") + .HasColumnType("longtext"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("JsonWebKeySet") + .HasColumnType("longtext"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasColumnType("longtext"); + + b.Property("Permissions") + .HasColumnType("longtext"); + + b.Property("PostLogoutRedirectUris") + .HasColumnType("longtext"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("RedirectUris") + .HasColumnType("longtext"); + + b.Property("Requirements") + .HasColumnType("longtext"); + + b.Property("Settings") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("OpenIddictApplications", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationId") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("Scopes") + .HasColumnType("longtext"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("varchar(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictAuthorizations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Scopes.OpenIddictScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("Descriptions") + .HasColumnType("longtext"); + + b.Property("DisplayName") + .HasColumnType("longtext"); + + b.Property("DisplayNames") + .HasColumnType("longtext"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("Resources") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("OpenIddictScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationId") + .HasColumnType("char(36)"); + + b.Property("AuthorizationId") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExpirationDate") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Payload") + .HasColumnType("longtext"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("RedemptionDate") + .HasColumnType("datetime(6)"); + + b.Property("ReferenceId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("varchar(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("AuthorizationId"); + + b.HasIndex("ReferenceId"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("MultiTenancySide") + .HasColumnType("tinyint unsigned"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.SettingDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DefaultValue") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.Property("Description") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsEncrypted") + .HasColumnType("tinyint(1)"); + + b.Property("IsInherited") + .HasColumnType("tinyint(1)"); + + b.Property("IsVisibleToClients") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Providers") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpSettingDefinitions", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => + { + b.HasOne("LINGYUN.Abp.Saas.Editions.Edition", "Edition") + .WithMany() + .HasForeignKey("EditionId"); + + b.Navigation("Edition"); + }); + + modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.TenantConnectionString", b => + { + b.HasOne("LINGYUN.Abp.Saas.Tenants.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("LINGYUN.Abp.WebhooksManagement.WebhookSendRecord", b => + { + b.HasOne("LINGYUN.Abp.WebhooksManagement.WebhookEventRecord", "WebhookEvent") + .WithOne() + .HasForeignKey("LINGYUN.Abp.WebhooksManagement.WebhookSendRecord", "WebhookEventId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("WebhookEvent"); + }); + + modelBuilder.Entity("LINGYUN.Platform.Datas.DataItem", b => + { + b.HasOne("LINGYUN.Platform.Datas.Data", null) + .WithMany("Items") + .HasForeignKey("DataId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("LINGYUN.Platform.Packages.PackageBlob", b => + { + b.HasOne("LINGYUN.Platform.Packages.Package", "Package") + .WithMany("Blobs") + .HasForeignKey("PackageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Package"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Properties") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("UserClaims") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("Properties") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Claims") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedCorsOrigins") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedGrantTypes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("IdentityProviderRestrictions") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("PostLogoutRedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Properties") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("RedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedScopes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("ClientSecrets") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("UserClaims") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("Properties") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + + b.HasOne("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", null) + .WithMany() + .HasForeignKey("AuthorizationId"); + }); + + modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); + + modelBuilder.Entity("LINGYUN.Platform.Datas.Data", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("LINGYUN.Platform.Packages.Package", b => + { + b.Navigation("Blobs"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Navigation("Properties"); + + b.Navigation("Scopes"); + + b.Navigation("Secrets"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Navigation("AllowedCorsOrigins"); + + b.Navigation("AllowedGrantTypes"); + + b.Navigation("AllowedScopes"); + + b.Navigation("Claims"); + + b.Navigation("ClientSecrets"); + + b.Navigation("IdentityProviderRestrictions"); + + b.Navigation("PostLogoutRedirectUris"); + + b.Navigation("Properties"); + + b.Navigation("RedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/Migrations/20240624002940_Upgrade-Abp-Framework-To-8.1.3.cs b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/Migrations/20240624002940_Upgrade-Abp-Framework-To-8.1.3.cs new file mode 100644 index 000000000..073e61c36 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/Migrations/20240624002940_Upgrade-Abp-Framework-To-8.1.3.cs @@ -0,0 +1,79 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace LY.MicroService.Applications.Single.EntityFrameworkCore.Migrations +{ + /// + public partial class UpgradeAbpFrameworkTo813 : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropIndex( + name: "IX_Tenant_Text_Template_Name", + table: "AbpTextTemplates"); + + migrationBuilder.DropColumn( + name: "TenantId", + table: "AbpTextTemplates"); + + migrationBuilder.AddColumn( + name: "TimeoutDuration", + table: "AbpWebhooksSubscriptions", + type: "int", + nullable: true); + + migrationBuilder.AddColumn( + name: "NormalizedName", + table: "AbpTenants", + type: "varchar(64)", + maxLength: 64, + nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_Tenant_Text_Template_Name", + table: "AbpTextTemplates", + column: "Name"); + + migrationBuilder.CreateIndex( + name: "IX_AbpTenants_NormalizedName", + table: "AbpTenants", + column: "NormalizedName"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropIndex( + name: "IX_Tenant_Text_Template_Name", + table: "AbpTextTemplates"); + + migrationBuilder.DropIndex( + name: "IX_AbpTenants_NormalizedName", + table: "AbpTenants"); + + migrationBuilder.DropColumn( + name: "TimeoutDuration", + table: "AbpWebhooksSubscriptions"); + + migrationBuilder.DropColumn( + name: "NormalizedName", + table: "AbpTenants"); + + migrationBuilder.AddColumn( + name: "TenantId", + table: "AbpTextTemplates", + type: "char(36)", + nullable: true, + collation: "ascii_general_ci"); + + migrationBuilder.CreateIndex( + name: "IX_Tenant_Text_Template_Name", + table: "AbpTextTemplates", + columns: new[] { "TenantId", "Name" }); + } + } +} diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/Migrations/20240729102008_Upgrade-Abp-Framework-To-8-2-0.Designer.cs b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/Migrations/20240729102008_Upgrade-Abp-Framework-To-8-2-0.Designer.cs new file mode 100644 index 000000000..3bd2486d3 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/Migrations/20240729102008_Upgrade-Abp-Framework-To-8-2-0.Designer.cs @@ -0,0 +1,5406 @@ +// +using System; +using LY.MicroService.Applications.Single.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace LY.MicroService.Applications.Single.EntityFrameworkCore.Migrations +{ + [DbContext(typeof(SingleMigrationsDbContext))] + [Migration("20240729102008_Upgrade-Abp-Framework-To-8-2-0")] + partial class UpgradeAbpFrameworkTo820 + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) + .HasAnnotation("ProductVersion", "8.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + + modelBuilder.Entity("LINGYUN.Abp.LocalizationManagement.Language", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("CultureName") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasColumnName("CultureName"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("DisplayName"); + + b.Property("Enable") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("TwoLetterISOLanguageName") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("TwoLetterISOLanguageName"); + + b.Property("UiCultureName") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasColumnName("UiCultureName"); + + b.HasKey("Id"); + + b.HasIndex("CultureName"); + + b.ToTable("AbpLocalizationLanguages", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.LocalizationManagement.Resource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DefaultCultureName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("DefaultCultureName"); + + b.Property("Description") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Description"); + + b.Property("DisplayName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("DisplayName"); + + b.Property("Enable") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasColumnName("Name"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AbpLocalizationResources", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.LocalizationManagement.Text", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CultureName") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasColumnName("CultureName"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("Key"); + + b.Property("ResourceName") + .HasColumnType("longtext"); + + b.Property("Value") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)") + .HasColumnName("Value"); + + b.HasKey("Id"); + + b.HasIndex("Key"); + + b.ToTable("AbpLocalizationTexts", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatCard", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Age") + .HasColumnType("int"); + + b.Property("AvatarUrl") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("Birthday") + .HasColumnType("datetime(6)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Description") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LastOnlineTime") + .HasColumnType("datetime(6)"); + + b.Property("NickName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Sex") + .HasColumnType("int"); + + b.Property("Sign") + .HasMaxLength(30) + .HasColumnType("varchar(30)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AppUserChatCards", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatFriend", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Black") + .HasColumnType("tinyint(1)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Description") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("DontDisturb") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("FrientId") + .HasColumnType("char(36)"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("RemarkName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("SpecialFocus") + .HasColumnType("tinyint(1)"); + + b.Property("Status") + .HasColumnType("tinyint unsigned"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId", "FrientId"); + + b.ToTable("AppUserChatFriends", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AllowAddFriend") + .HasColumnType("tinyint(1)"); + + b.Property("AllowAnonymous") + .HasColumnType("tinyint(1)"); + + b.Property("AllowReceiveMessage") + .HasColumnType("tinyint(1)"); + + b.Property("AllowSendMessage") + .HasColumnType("tinyint(1)"); + + b.Property("RequireAddFriendValition") + .HasColumnType("tinyint(1)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AppUserChatSettings", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Content") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("longtext"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("MessageId") + .HasColumnType("bigint"); + + b.Property("ReceiveUserId") + .HasColumnType("char(36)"); + + b.Property("SendUserName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Source") + .HasColumnType("int"); + + b.Property("State") + .HasColumnType("tinyint"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ReceiveUserId"); + + b.ToTable("AppUserMessages", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Groups.ChatGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Address") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("AdminUserId") + .HasColumnType("char(36)"); + + b.Property("AllowAnonymous") + .HasColumnType("tinyint(1)"); + + b.Property("AllowSendMessage") + .HasColumnType("tinyint(1)"); + + b.Property("AvatarUrl") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Description") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("GroupId") + .HasColumnType("bigint"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("MaxUserCount") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)"); + + b.Property("Notice") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Tag") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name"); + + b.ToTable("AppChatGroups", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Groups.GroupChatBlack", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("GroupId") + .HasColumnType("bigint"); + + b.Property("ShieldUserId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "GroupId"); + + b.ToTable("AppGroupChatBlacks", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Groups.GroupMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Content") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("longtext"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("GroupId") + .HasColumnType("bigint"); + + b.Property("MessageId") + .HasColumnType("bigint"); + + b.Property("SendUserName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Source") + .HasColumnType("int"); + + b.Property("State") + .HasColumnType("tinyint"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "GroupId"); + + b.ToTable("AppGroupMessages", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Groups.UserChatGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("GroupId") + .HasColumnType("bigint"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "GroupId", "UserId"); + + b.ToTable("AppUserChatGroups", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Groups.UserGroupCard", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsAdmin") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("NickName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("SilenceEnd") + .HasColumnType("datetime(6)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AppUserGroupCards", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Notifications.Notification", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("ExpirationTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("NotificationId") + .HasColumnType("bigint"); + + b.Property("NotificationName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("NotificationTypeName") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("Severity") + .HasColumnType("tinyint"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "NotificationName"); + + b.ToTable("AppNotifications", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Notifications.NotificationDefinitionGroupRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowSubscriptionToClients") + .HasColumnType("tinyint(1)"); + + b.Property("Description") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("DisplayName") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.ToTable("AppNotificationDefinitionGroups", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Notifications.NotificationDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowSubscriptionToClients") + .HasColumnType("tinyint(1)"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("Description") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("DisplayName") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("NotificationLifetime") + .HasColumnType("int"); + + b.Property("NotificationType") + .HasColumnType("int"); + + b.Property("Providers") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Template") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.ToTable("AppNotificationDefinitions", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Notifications.UserNotification", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("NotificationId") + .HasColumnType("bigint"); + + b.Property("ReadStatus") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId", "NotificationId") + .HasDatabaseName("IX_Tenant_User_Notification_Id"); + + b.ToTable("AppUserNotifications", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Notifications.UserSubscribe", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("NotificationName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasDefaultValue("/"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId", "NotificationName") + .IsUnique() + .HasDatabaseName("IX_Tenant_User_Notification_Name"); + + b.ToTable("AppUserSubscribes", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Saas.Editions.Edition", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.HasKey("Id"); + + b.HasIndex("DisplayName"); + + b.ToTable("AbpEditions", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisableTime") + .HasColumnType("datetime(6)"); + + b.Property("EditionId") + .HasColumnType("char(36)"); + + b.Property("EnableTime") + .HasColumnType("datetime(6)"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("NormalizedName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("EditionId"); + + b.HasIndex("Name"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpTenants", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.TaskManagement.BackgroundJobAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("JobId") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("JobId"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("Name"); + + b.Property("Paramters") + .HasColumnType("longtext") + .HasColumnName("Paramters"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("TK_BackgroundJobActions", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.TaskManagement.BackgroundJobInfo", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("Args") + .HasColumnType("longtext") + .HasColumnName("Args"); + + b.Property("BeginTime") + .HasColumnType("datetime(6)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Cron") + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasColumnName("Cron"); + + b.Property("Description") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Description"); + + b.Property("EndTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Group") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("Group"); + + b.Property("Interval") + .HasColumnType("int"); + + b.Property("IsAbandoned") + .HasColumnType("tinyint(1)"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("JobType") + .HasColumnType("int"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LastRunTime") + .HasColumnType("datetime(6)"); + + b.Property("LockTimeOut") + .HasColumnType("int"); + + b.Property("MaxCount") + .HasColumnType("int"); + + b.Property("MaxTryCount") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("Name"); + + b.Property("NextRunTime") + .HasColumnType("datetime(6)"); + + b.Property("NodeName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("NodeName"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Result") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasColumnName("Result"); + + b.Property("Source") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TriggerCount") + .HasColumnType("int"); + + b.Property("TryCount") + .HasColumnType("int"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasColumnName("Type"); + + b.HasKey("Id"); + + b.HasIndex("Name", "Group"); + + b.ToTable("TK_BackgroundJobs", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.TaskManagement.BackgroundJobLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Exception") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)") + .HasColumnName("Exception"); + + b.Property("JobGroup") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("JobGroup"); + + b.Property("JobId") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("JobId"); + + b.Property("JobName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("JobName"); + + b.Property("JobType") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasColumnName("JobType"); + + b.Property("Message") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasColumnName("Message"); + + b.Property("RunTime") + .HasColumnType("datetime(6)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("JobGroup", "JobName"); + + b.ToTable("TK_BackgroundJobLogs", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.TextTemplating.TextTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Content") + .HasMaxLength(1048576) + .HasColumnType("longtext") + .HasColumnName("Content"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Culture") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("Culture"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("DisplayName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("Name"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .HasDatabaseName("IX_Tenant_Text_Template_Name"); + + b.ToTable("AbpTextTemplates", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.TextTemplating.TextTemplateDefinition", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("DefaultCultureName") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("DefaultCultureName"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsInlineLocalized") + .HasColumnType("tinyint(1)"); + + b.Property("IsLayout") + .HasColumnType("tinyint(1)"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("Layout") + .HasMaxLength(60) + .HasColumnType("varchar(60)") + .HasColumnName("Layout"); + + b.Property("LocalizationResourceName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("LocalizationResourceName"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("Name"); + + b.Property("RenderEngine") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("RenderEngine"); + + b.HasKey("Id"); + + b.ToTable("AbpTextTemplateDefinitions", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.WebhooksManagement.WebhookDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("RequiredFeatures") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpWebhooksWebhooks", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.WebhooksManagement.WebhookEventRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("Data") + .HasMaxLength(2147483647) + .HasColumnType("longtext") + .HasColumnName("Data"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("WebhookName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("WebhookName"); + + b.HasKey("Id"); + + b.ToTable("AbpWebhooksEvents", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.WebhooksManagement.WebhookGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpWebhooksWebhookGroups", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.WebhooksManagement.WebhookSendRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("RequestHeaders") + .HasMaxLength(2147483647) + .HasColumnType("longtext") + .HasColumnName("RequestHeaders"); + + b.Property("Response") + .HasMaxLength(2147483647) + .HasColumnType("longtext") + .HasColumnName("Response"); + + b.Property("ResponseHeaders") + .HasMaxLength(2147483647) + .HasColumnType("longtext") + .HasColumnName("ResponseHeaders"); + + b.Property("ResponseStatusCode") + .HasColumnType("int"); + + b.Property("SendExactSameData") + .HasColumnType("tinyint(1)"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("WebhookEventId") + .HasColumnType("char(36)"); + + b.Property("WebhookSubscriptionId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("WebhookEventId"); + + b.ToTable("AbpWebhooksSendAttempts", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.WebhooksManagement.WebhookSubscription", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Description") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("Description"); + + b.Property("Headers") + .HasMaxLength(2147483647) + .HasColumnType("longtext") + .HasColumnName("Headers"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("Secret") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("Secret"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("TimeoutDuration") + .HasColumnType("int"); + + b.Property("WebhookUri") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("WebhookUri"); + + b.Property("Webhooks") + .HasMaxLength(2147483647) + .HasColumnType("longtext") + .HasColumnName("Webhooks"); + + b.HasKey("Id"); + + b.ToTable("AbpWebhooksSubscriptions", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Datas.Data", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)") + .HasColumnName("Description"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("Name"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AppPlatformDatas", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Datas.DataItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowBeNull") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DataId") + .HasColumnType("char(36)"); + + b.Property("DefaultValue") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DefaultValue"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)") + .HasColumnName("Description"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("Name"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("DataId"); + + b.HasIndex("Name"); + + b.ToTable("AppPlatformDataItems", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Layouts.Layout", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DataId") + .HasColumnType("char(36)"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Framework") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Framework"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("Path") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Path"); + + b.Property("Redirect") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Redirect"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("AppPlatformLayouts", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Menus.Menu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(23) + .HasColumnType("varchar(23)") + .HasColumnName("Code"); + + b.Property("Component") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Component"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Framework") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Framework"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LayoutId") + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("Path") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Path"); + + b.Property("Redirect") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Redirect"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("AppPlatformMenus", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Menus.RoleMenu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("MenuId") + .HasColumnType("char(36)"); + + b.Property("RoleName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("RoleName"); + + b.Property("Startup") + .HasColumnType("tinyint(1)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleName", "MenuId"); + + b.ToTable("AppPlatformRoleMenus", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Menus.UserFavoriteMenu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AliasName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("AliasName"); + + b.Property("Color") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("Color"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("Framework") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Framework"); + + b.Property("Icon") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("Icon"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("MenuId") + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("Path") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Path"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId", "MenuId"); + + b.ToTable("AppPlatformUserFavoriteMenus", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Menus.UserMenu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("MenuId") + .HasColumnType("char(36)"); + + b.Property("Startup") + .HasColumnType("tinyint(1)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId", "MenuId"); + + b.ToTable("AppPlatformUserMenus", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Packages.Package", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Authors") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("Authors"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Description"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("ForceUpdate") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Name"); + + b.Property("Note") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)") + .HasColumnName("Note"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("Version"); + + b.HasKey("Id"); + + b.HasIndex("Name", "Version"); + + b.ToTable("AppPlatformPackages", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Packages.PackageBlob", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Authors") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("Authors"); + + b.Property("ContentType") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ContentType"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DownloadCount") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("License") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)") + .HasColumnName("License"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Name"); + + b.Property("PackageId") + .HasColumnType("char(36)"); + + b.Property("SHA256") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("SHA256"); + + b.Property("Size") + .HasColumnType("bigint"); + + b.Property("Summary") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)") + .HasColumnName("Summary"); + + b.Property("UpdatedAt") + .HasColumnType("datetime(6)"); + + b.Property("Url") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("Url"); + + b.HasKey("Id"); + + b.HasIndex("PackageId", "Name"); + + b.ToTable("AppPlatformPackageBlobs", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Portal.Enterprise", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Address") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Address"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("EnglishName") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("EnglishName"); + + b.Property("ExpirationDate") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LegalMan") + .HasMaxLength(60) + .HasColumnType("varchar(60)") + .HasColumnName("LegalMan"); + + b.Property("Logo") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("Logo"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Name"); + + b.Property("OrganizationCode") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("OrganizationCode"); + + b.Property("RegistrationCode") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("RegistrationCode"); + + b.Property("RegistrationDate") + .HasColumnType("datetime(6)"); + + b.Property("TaxCode") + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("TaxCode"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.ToTable("AppPlatformEnterprises", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("longtext"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("int") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ImpersonatorTenantName"); + + b.Property("ImpersonatorUserId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorUserId"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ImpersonatorUserName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("TenantName"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("char(36)") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("datetime(6)") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("tinyint unsigned") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("char(36)"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("EntityChangeId") + .HasColumnType("char(36)"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("tinyint(1)"); + + b.Property("IsVisibleToClients") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatureGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpFeatureValues", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("SourceTenantId") + .HasColumnType("char(36)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("TargetTenantId") + .HasColumnType("char(36)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique(); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("tinyint(1)") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySession", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Device") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("DeviceInfo") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("IpAddresses") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("LastAccessed") + .HasColumnType("datetime(6)"); + + b.Property("SessionId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("SignedIn") + .HasColumnType("datetime(6)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("Device"); + + b.HasIndex("SessionId"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSessions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnName("IsActive"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LastPasswordChangeTime") + .HasColumnType("datetime(6)"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("datetime(6)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("SecurityStamp"); + + b.Property("ShouldChangePasswordOnNextLogin") + .HasColumnType("tinyint(1)"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserDelegation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("EndTime") + .HasColumnType("datetime(6)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("StartTime") + .HasColumnType("datetime(6)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("AbpUserDelegations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("varchar(196)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("varchar(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowedAccessTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiResourceId", "Type"); + + b.ToTable("IdentityServerApiResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ApiResourceId", "Key", "Value"); + + b.ToTable("IdentityServerApiResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiResourceId", "Scope"); + + b.ToTable("IdentityServerApiResourceScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiResourceSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiScopeId", "Type"); + + b.ToTable("IdentityServerApiScopeClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ApiScopeId", "Key", "Value"); + + b.ToTable("IdentityServerApiScopeProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AbsoluteRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenType") + .HasColumnType("int"); + + b.Property("AllowAccessTokensViaBrowser") + .HasColumnType("tinyint(1)"); + + b.Property("AllowOfflineAccess") + .HasColumnType("tinyint(1)"); + + b.Property("AllowPlainTextPkce") + .HasColumnType("tinyint(1)"); + + b.Property("AllowRememberConsent") + .HasColumnType("tinyint(1)"); + + b.Property("AllowedIdentityTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("AlwaysIncludeUserClaimsInIdToken") + .HasColumnType("tinyint(1)"); + + b.Property("AlwaysSendClientClaims") + .HasColumnType("tinyint(1)"); + + b.Property("AuthorizationCodeLifetime") + .HasColumnType("int"); + + b.Property("BackChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("BackChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ClientClaimsPrefix") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentLifetime") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DeviceCodeLifetime") + .HasColumnType("int"); + + b.Property("EnableLocalLogin") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("FrontChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("FrontChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("IdentityTokenLifetime") + .HasColumnType("int"); + + b.Property("IncludeJwtId") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("PairWiseSubjectSalt") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ProtocolType") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("RefreshTokenExpiration") + .HasColumnType("int"); + + b.Property("RefreshTokenUsage") + .HasColumnType("int"); + + b.Property("RequireClientSecret") + .HasColumnType("tinyint(1)"); + + b.Property("RequireConsent") + .HasColumnType("tinyint(1)"); + + b.Property("RequirePkce") + .HasColumnType("tinyint(1)"); + + b.Property("RequireRequestObject") + .HasColumnType("tinyint(1)"); + + b.Property("SlidingRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("UpdateAccessTokenClaimsOnRefresh") + .HasColumnType("tinyint(1)"); + + b.Property("UserCodeType") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("UserSsoLifetime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("IdentityServerClients", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Origin") + .HasMaxLength(150) + .HasColumnType("varchar(150)"); + + b.HasKey("ClientId", "Origin"); + + b.ToTable("IdentityServerClientCorsOrigins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("GrantType") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.HasKey("ClientId", "GrantType"); + + b.ToTable("IdentityServerClientGrantTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Provider") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ClientId", "Provider"); + + b.ToTable("IdentityServerClientIdPRestrictions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("PostLogoutRedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "PostLogoutRedirectUri"); + + b.ToTable("IdentityServerClientPostLogoutRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "Key", "Value"); + + b.ToTable("IdentityServerClientProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("RedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "RedirectUri"); + + b.ToTable("IdentityServerClientRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ClientId", "Scope"); + + b.ToTable("IdentityServerClientScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Description") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("varchar(10000)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("DeviceCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("UserCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode"); + + b.ToTable("IdentityServerDeviceFlowCodes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => + { + b.Property("Key") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsumedTime") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("varchar(10000)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Key"); + + b.HasIndex("Expiration"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.HasIndex("SubjectId", "SessionId", "Type"); + + b.ToTable("IdentityServerPersistedGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerIdentityResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("IdentityResourceId", "Type"); + + b.ToTable("IdentityServerIdentityResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("IdentityResourceId", "Key", "Value"); + + b.ToTable("IdentityServerIdentityResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationType") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ClientId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("ClientSecret") + .HasColumnType("longtext"); + + b.Property("ClientType") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ClientUri") + .HasColumnType("longtext"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentType") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .HasColumnType("longtext"); + + b.Property("DisplayNames") + .HasColumnType("longtext"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("JsonWebKeySet") + .HasColumnType("longtext"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasColumnType("longtext"); + + b.Property("Permissions") + .HasColumnType("longtext"); + + b.Property("PostLogoutRedirectUris") + .HasColumnType("longtext"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("RedirectUris") + .HasColumnType("longtext"); + + b.Property("Requirements") + .HasColumnType("longtext"); + + b.Property("Settings") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("OpenIddictApplications", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationId") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("Scopes") + .HasColumnType("longtext"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("varchar(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictAuthorizations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Scopes.OpenIddictScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("Descriptions") + .HasColumnType("longtext"); + + b.Property("DisplayName") + .HasColumnType("longtext"); + + b.Property("DisplayNames") + .HasColumnType("longtext"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("Resources") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("OpenIddictScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationId") + .HasColumnType("char(36)"); + + b.Property("AuthorizationId") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExpirationDate") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Payload") + .HasColumnType("longtext"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("RedemptionDate") + .HasColumnType("datetime(6)"); + + b.Property("ReferenceId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("varchar(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("AuthorizationId"); + + b.HasIndex("ReferenceId"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("MultiTenancySide") + .HasColumnType("tinyint unsigned"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.SettingDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DefaultValue") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.Property("Description") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsEncrypted") + .HasColumnType("tinyint(1)"); + + b.Property("IsInherited") + .HasColumnType("tinyint(1)"); + + b.Property("IsVisibleToClients") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Providers") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpSettingDefinitions", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => + { + b.HasOne("LINGYUN.Abp.Saas.Editions.Edition", "Edition") + .WithMany() + .HasForeignKey("EditionId"); + + b.Navigation("Edition"); + }); + + modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.TenantConnectionString", b => + { + b.HasOne("LINGYUN.Abp.Saas.Tenants.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("LINGYUN.Abp.WebhooksManagement.WebhookSendRecord", b => + { + b.HasOne("LINGYUN.Abp.WebhooksManagement.WebhookEventRecord", "WebhookEvent") + .WithOne() + .HasForeignKey("LINGYUN.Abp.WebhooksManagement.WebhookSendRecord", "WebhookEventId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("WebhookEvent"); + }); + + modelBuilder.Entity("LINGYUN.Platform.Datas.DataItem", b => + { + b.HasOne("LINGYUN.Platform.Datas.Data", null) + .WithMany("Items") + .HasForeignKey("DataId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("LINGYUN.Platform.Packages.PackageBlob", b => + { + b.HasOne("LINGYUN.Platform.Packages.Package", "Package") + .WithMany("Blobs") + .HasForeignKey("PackageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Package"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Properties") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("UserClaims") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("Properties") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Claims") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedCorsOrigins") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedGrantTypes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("IdentityProviderRestrictions") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("PostLogoutRedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Properties") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("RedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedScopes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("ClientSecrets") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("UserClaims") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("Properties") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + + b.HasOne("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", null) + .WithMany() + .HasForeignKey("AuthorizationId"); + }); + + modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); + + modelBuilder.Entity("LINGYUN.Platform.Datas.Data", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("LINGYUN.Platform.Packages.Package", b => + { + b.Navigation("Blobs"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Navigation("Properties"); + + b.Navigation("Scopes"); + + b.Navigation("Secrets"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Navigation("AllowedCorsOrigins"); + + b.Navigation("AllowedGrantTypes"); + + b.Navigation("AllowedScopes"); + + b.Navigation("Claims"); + + b.Navigation("ClientSecrets"); + + b.Navigation("IdentityProviderRestrictions"); + + b.Navigation("PostLogoutRedirectUris"); + + b.Navigation("Properties"); + + b.Navigation("RedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/Migrations/20240729102008_Upgrade-Abp-Framework-To-8-2-0.cs b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/Migrations/20240729102008_Upgrade-Abp-Framework-To-8-2-0.cs new file mode 100644 index 000000000..161528722 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/Migrations/20240729102008_Upgrade-Abp-Framework-To-8-2-0.cs @@ -0,0 +1,366 @@ +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace LY.MicroService.Applications.Single.EntityFrameworkCore.Migrations +{ + /// + public partial class UpgradeAbpFrameworkTo820 : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "TenantId", + table: "AppPlatformPackages"); + + migrationBuilder.DropColumn( + name: "TenantId", + table: "AppPlatformPackageBlobs"); + + migrationBuilder.RenameColumn( + name: "FlagIcon", + table: "AbpLocalizationLanguages", + newName: "TwoLetterISOLanguageName"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "TK_BackgroundJobLogs", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppUserSubscribes", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppUserNotifications", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppUserMessages", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppUserGroupCards", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppUserChatSettings", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppUserChatGroups", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppUserChatFriends", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppUserChatCards", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppPlatformPackageBlobs", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppNotifications", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppGroupMessages", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppGroupChatBlacks", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppChatGroups", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AbpLocalizationTexts", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.CreateTable( + name: "AbpSessions", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + SessionId = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Device = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + DeviceInfo = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ClientId = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + IpAddresses = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + SignedIn = table.Column(type: "datetime(6)", nullable: false), + LastAccessed = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpSessions", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_AbpSessions_Device", + table: "AbpSessions", + column: "Device"); + + migrationBuilder.CreateIndex( + name: "IX_AbpSessions_SessionId", + table: "AbpSessions", + column: "SessionId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpSessions_TenantId_UserId", + table: "AbpSessions", + columns: new[] { "TenantId", "UserId" }); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "AbpSessions"); + + migrationBuilder.RenameColumn( + name: "TwoLetterISOLanguageName", + table: "AbpLocalizationLanguages", + newName: "FlagIcon"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "TK_BackgroundJobLogs", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppUserSubscribes", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppUserNotifications", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppUserMessages", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppUserGroupCards", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppUserChatSettings", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppUserChatGroups", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppUserChatFriends", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppUserChatCards", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AddColumn( + name: "TenantId", + table: "AppPlatformPackages", + type: "char(36)", + nullable: true, + collation: "ascii_general_ci"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppPlatformPackageBlobs", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AddColumn( + name: "TenantId", + table: "AppPlatformPackageBlobs", + type: "char(36)", + nullable: true, + collation: "ascii_general_ci"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppNotifications", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppGroupMessages", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppGroupChatBlacks", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppChatGroups", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AbpLocalizationTexts", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + } + } +} diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/Migrations/SingleMigrationsDbContextModelSnapshot.cs b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/Migrations/SingleMigrationsDbContextModelSnapshot.cs index d8b27fdad..f97a6912d 100644 --- a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/Migrations/SingleMigrationsDbContextModelSnapshot.cs +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/Migrations/SingleMigrationsDbContextModelSnapshot.cs @@ -3,6 +3,7 @@ using LY.MicroService.Applications.Single.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Volo.Abp.EntityFrameworkCore; @@ -18,9 +19,11 @@ protected override void BuildModel(ModelBuilder modelBuilder) #pragma warning disable 612, 618 modelBuilder .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) - .HasAnnotation("ProductVersion", "8.0.0") + .HasAnnotation("ProductVersion", "8.0.4") .HasAnnotation("Relational:MaxIdentifierLength", 64); + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + modelBuilder.Entity("LINGYUN.Abp.LocalizationManagement.Language", b => { b.Property("Id") @@ -52,11 +55,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("tinyint(1)") .HasDefaultValue(true); - b.Property("FlagIcon") - .HasMaxLength(30) - .HasColumnType("varchar(30)") - .HasColumnName("FlagIcon"); - b.Property("LastModificationTime") .HasColumnType("datetime(6)") .HasColumnName("LastModificationTime"); @@ -65,6 +63,11 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("char(36)") .HasColumnName("LastModifierId"); + b.Property("TwoLetterISOLanguageName") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("TwoLetterISOLanguageName"); + b.Property("UiCultureName") .IsRequired() .HasMaxLength(20) @@ -139,6 +142,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("CultureName") .IsRequired() .HasMaxLength(20) @@ -172,6 +177,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("bigint"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("Age") .HasColumnType("int"); @@ -256,6 +263,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("bigint"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("Black") .HasColumnType("tinyint(1)"); @@ -322,6 +331,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("bigint"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("AllowAddFriend") .HasColumnType("tinyint(1)"); @@ -357,6 +368,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("bigint"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("ConcurrencyStamp") .IsConcurrencyToken() .IsRequired() @@ -419,6 +432,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("bigint"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("Address") .HasMaxLength(256) .HasColumnType("varchar(256)"); @@ -492,6 +507,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("bigint"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("CreationTime") .HasColumnType("datetime(6)") .HasColumnName("CreationTime"); @@ -523,6 +540,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("bigint"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("ConcurrencyStamp") .IsConcurrencyToken() .IsRequired() @@ -585,6 +604,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("bigint"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("CreationTime") .HasColumnType("datetime(6)") .HasColumnName("CreationTime"); @@ -616,6 +637,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("bigint"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("ConcurrencyStamp") .IsConcurrencyToken() .IsRequired() @@ -674,6 +697,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("bigint"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("ContentType") .ValueGeneratedOnAdd() .HasColumnType("int") @@ -812,6 +837,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("bigint"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("NotificationId") .HasColumnType("bigint"); @@ -839,6 +866,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("bigint"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("CreationTime") .HasColumnType("datetime(6)") .HasColumnName("CreationTime"); @@ -1002,12 +1031,18 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasMaxLength(64) .HasColumnType("varchar(64)"); + b.Property("NormalizedName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + b.HasKey("Id"); b.HasIndex("EditionId"); b.HasIndex("Name"); + b.HasIndex("NormalizedName"); + b.ToTable("AbpTenants", (string)null); }); @@ -1234,6 +1269,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("bigint"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("Exception") .HasMaxLength(2000) .HasColumnType("varchar(2000)") @@ -1322,13 +1359,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("varchar(100)") .HasColumnName("Name"); - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - b.HasKey("Id"); - b.HasIndex("TenantId", "Name") + b.HasIndex("Name") .HasDatabaseName("IX_Tenant_Text_Template_Name"); b.ToTable("AbpTextTemplates", (string)null); @@ -1603,6 +1636,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("TenantId") .HasColumnType("char(36)"); + b.Property("TimeoutDuration") + .HasColumnType("int"); + b.Property("WebhookUri") .IsRequired() .HasMaxLength(255) @@ -2245,10 +2281,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("varchar(1024)") .HasColumnName("Note"); - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - b.Property("Version") .IsRequired() .HasMaxLength(30) @@ -2268,6 +2300,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("Authors") .HasMaxLength(100) .HasColumnType("varchar(100)") @@ -2323,10 +2357,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("varchar(1024)") .HasColumnName("Summary"); - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - b.Property("UpdatedAt") .HasColumnType("datetime(6)"); @@ -3063,6 +3093,58 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("AbpSecurityLogs", (string)null); }); + modelBuilder.Entity("Volo.Abp.Identity.IdentitySession", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Device") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("DeviceInfo") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("IpAddresses") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("LastAccessed") + .HasColumnType("datetime(6)"); + + b.Property("SessionId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("SignedIn") + .HasColumnType("datetime(6)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("Device"); + + b.HasIndex("SessionId"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSessions", (string)null); + }); + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => { b.Property("Id") diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleDbMigrationEventHandler.cs b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleDbMigrationEventHandler.cs index d5d366551..cccd2122b 100644 --- a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleDbMigrationEventHandler.cs +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleDbMigrationEventHandler.cs @@ -1,16 +1,25 @@ using LINGYUN.Abp.BackgroundTasks; using LINGYUN.Abp.BackgroundTasks.Internal; using LINGYUN.Abp.Saas.Tenants; +using Microsoft.AspNetCore.Identity; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; using System.Threading.Tasks; +using Volo.Abp.Authorization.Permissions; +using Volo.Abp.DistributedLocking; using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.EntityFrameworkCore.Migrations; using Volo.Abp.EventBus.Distributed; +using Volo.Abp.Guids; +using Volo.Abp.Identity; using Volo.Abp.MultiTenancy; +using Volo.Abp.PermissionManagement; using Volo.Abp.Uow; +using IdentityRole = Volo.Abp.Identity.IdentityRole; +using IdentityUser = Volo.Abp.Identity.IdentityUser; + namespace LY.MicroService.Applications.Single.EntityFrameworkCore; public class SingleDbMigrationEventHandler : EfCoreDatabaseMigrationEventHandlerBase, @@ -19,15 +28,28 @@ public class SingleDbMigrationEventHandler : protected AbpBackgroundTasksOptions Options { get; } protected IJobStore JobStore { get; } protected IJobScheduler JobScheduler { get; } + protected IGuidGenerator GuidGenerator { get; } + protected IdentityUserManager IdentityUserManager { get; } + protected IdentityRoleManager IdentityRoleManager { get; } + protected IPermissionDataSeeder PermissionDataSeeder { get; } public SingleDbMigrationEventHandler( ICurrentTenant currentTenant, IUnitOfWorkManager unitOfWorkManager, ITenantStore tenantStore, + IAbpDistributedLock abpDistributedLock, IDistributedEventBus distributedEventBus, - ILoggerFactory loggerFactory) - : base("SingleDbMigrator", currentTenant, unitOfWorkManager, tenantStore, distributedEventBus, loggerFactory) + ILoggerFactory loggerFactory, + IGuidGenerator guidGenerator, + IdentityUserManager identityUserManager, + IdentityRoleManager identityRoleManager, + IPermissionDataSeeder permissionDataSeeder) + : base("SingleDbMigrator", currentTenant, unitOfWorkManager, tenantStore, abpDistributedLock, distributedEventBus, loggerFactory) { + GuidGenerator = guidGenerator; + IdentityUserManager = identityUserManager; + IdentityRoleManager = identityRoleManager; + PermissionDataSeeder = permissionDataSeeder; } public async virtual Task HandleEventAsync(EntityDeletedEto eventData) { @@ -51,7 +73,14 @@ protected async override Task AfterTenantCreated(TenantCreatedEto eventData, boo { return; } - await QueueBackgroundJobAsync(eventData); + + using (CurrentTenant.Change(eventData.Id)) + { + await QueueBackgroundJobAsync(eventData); + + await SeedTenantDefaultRoleAsync(eventData); + await SeedTenantAdminAsync(eventData); + } } protected async virtual Task QueueBackgroundJobAsync(TenantCreatedEto eventData) @@ -133,4 +162,75 @@ protected virtual JobInfo BuildCheckingJobInfo(Guid tenantId, string tenantName) Type = typeof(BackgroundCheckingJob).AssemblyQualifiedName, }; } + + protected async virtual Task SeedTenantDefaultRoleAsync(TenantCreatedEto eventData) + { + // 默认用户 + var roleId = GuidGenerator.Create(); + var defaultRole = new IdentityRole(roleId, "Users", eventData.Id) + { + IsStatic = true, + IsPublic = true, + IsDefault = true, + }; + (await IdentityRoleManager.CreateAsync(defaultRole)).CheckErrors(); + + // 所有用户都应该具有查询用户权限, 用于IM场景 + await PermissionDataSeeder.SeedAsync( + RolePermissionValueProvider.ProviderName, + defaultRole.Name, + new string[] + { + IdentityPermissions.UserLookup.Default, + IdentityPermissions.Users.Default + }, + tenantId: eventData.Id); + } + + protected async virtual Task SeedTenantAdminAsync(TenantCreatedEto eventData) + { + const string tenantAdminUserName = "admin"; + const string tenantAdminRoleName = "admin"; + Guid tenantAdminRoleId; + if (!await IdentityRoleManager.RoleExistsAsync(tenantAdminRoleName)) + { + tenantAdminRoleId = GuidGenerator.Create(); + var tenantAdminRole = new IdentityRole(tenantAdminRoleId, tenantAdminRoleName, eventData.Id) + { + IsStatic = true, + IsPublic = true + }; + (await IdentityRoleManager.CreateAsync(tenantAdminRole)).CheckErrors(); + } + else + { + var tenantAdminRole = await IdentityRoleManager.FindByNameAsync(tenantAdminRoleName); + tenantAdminRoleId = tenantAdminRole.Id; + } + + var adminUserId = GuidGenerator.Create(); + if (eventData.Properties.TryGetValue("AdminUserId", out var userIdString) && + Guid.TryParse(userIdString, out var adminUserGuid)) + { + adminUserId = adminUserGuid; + } + var adminEmailAddress = eventData.Properties.GetOrDefault("AdminEmail") ?? "admin@abp.io"; + var adminPassword = eventData.Properties.GetOrDefault("AdminPassword") ?? "1q2w3E*"; + + var tenantAdminUser = await IdentityUserManager.FindByNameAsync(adminEmailAddress); + if (tenantAdminUser == null) + { + tenantAdminUser = new IdentityUser( + adminUserId, + tenantAdminUserName, + adminEmailAddress, + eventData.Id); + + tenantAdminUser.AddRole(tenantAdminRoleId); + + // 创建租户管理用户 + (await IdentityUserManager.CreateAsync(tenantAdminUser)).CheckErrors(); + (await IdentityUserManager.AddPasswordAsync(tenantAdminUser, adminPassword)).CheckErrors(); + } + } } diff --git a/aspnet-core/migrations/LY.MicroService.AuthServer.EntityFrameworkCore/AuthServerDbMigrationEventHandler.cs b/aspnet-core/migrations/LY.MicroService.AuthServer.EntityFrameworkCore/AuthServerDbMigrationEventHandler.cs index 85a15ded8..3f4837beb 100644 --- a/aspnet-core/migrations/LY.MicroService.AuthServer.EntityFrameworkCore/AuthServerDbMigrationEventHandler.cs +++ b/aspnet-core/migrations/LY.MicroService.AuthServer.EntityFrameworkCore/AuthServerDbMigrationEventHandler.cs @@ -6,6 +6,7 @@ using System.Threading.Tasks; using Volo.Abp.Authorization.Permissions; using Volo.Abp.Data; +using Volo.Abp.DistributedLocking; using Volo.Abp.EntityFrameworkCore.Migrations; using Volo.Abp.EventBus.Distributed; using Volo.Abp.Guids; @@ -28,6 +29,7 @@ public AuthServerDbMigrationEventHandler( ICurrentTenant currentTenant, IUnitOfWorkManager unitOfWorkManager, ITenantStore tenantStore, + IAbpDistributedLock abpDistributedLock, IDistributedEventBus distributedEventBus, ILoggerFactory loggerFactory, IGuidGenerator guidGenerator, @@ -36,7 +38,7 @@ public AuthServerDbMigrationEventHandler( IPermissionDataSeeder permissionDataSeeder) : base( ConnectionStringNameAttribute.GetConnStringName(), - currentTenant, unitOfWorkManager, tenantStore, distributedEventBus, loggerFactory) + currentTenant, unitOfWorkManager, tenantStore, abpDistributedLock, distributedEventBus, loggerFactory) { GuidGenerator = guidGenerator; IdentityUserManager = identityUserManager; diff --git a/aspnet-core/migrations/LY.MicroService.AuthServer.EntityFrameworkCore/Migrations/20240729101555_Upgrade-Abp-Framework-To-8-2-0.Designer.cs b/aspnet-core/migrations/LY.MicroService.AuthServer.EntityFrameworkCore/Migrations/20240729101555_Upgrade-Abp-Framework-To-8-2-0.Designer.cs new file mode 100644 index 000000000..b94da540d --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.AuthServer.EntityFrameworkCore/Migrations/20240729101555_Upgrade-Abp-Framework-To-8-2-0.Designer.cs @@ -0,0 +1,1234 @@ +// +using System; +using LY.MicroService.AuthServer.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace LY.MicroService.AuthServer.EntityFrameworkCore.Migrations +{ + [DbContext(typeof(AuthServerMigrationsDbContext))] + [Migration("20240729101555_Upgrade-Abp-Framework-To-8-2-0")] + partial class UpgradeAbpFrameworkTo820 + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) + .HasAnnotation("ProductVersion", "8.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("SourceTenantId") + .HasColumnType("char(36)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("TargetTenantId") + .HasColumnType("char(36)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique(); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("tinyint(1)") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySession", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Device") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("DeviceInfo") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("IpAddresses") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("LastAccessed") + .HasColumnType("datetime(6)"); + + b.Property("SessionId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("SignedIn") + .HasColumnType("datetime(6)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("Device"); + + b.HasIndex("SessionId"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSessions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnName("IsActive"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LastPasswordChangeTime") + .HasColumnType("datetime(6)"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("datetime(6)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("SecurityStamp"); + + b.Property("ShouldChangePasswordOnNextLogin") + .HasColumnType("tinyint(1)"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserDelegation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("EndTime") + .HasColumnType("datetime(6)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("StartTime") + .HasColumnType("datetime(6)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("AbpUserDelegations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("varchar(196)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("varchar(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationType") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ClientId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("ClientSecret") + .HasColumnType("longtext"); + + b.Property("ClientType") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ClientUri") + .HasColumnType("longtext"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentType") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .HasColumnType("longtext"); + + b.Property("DisplayNames") + .HasColumnType("longtext"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("JsonWebKeySet") + .HasColumnType("longtext"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasColumnType("longtext"); + + b.Property("Permissions") + .HasColumnType("longtext"); + + b.Property("PostLogoutRedirectUris") + .HasColumnType("longtext"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("RedirectUris") + .HasColumnType("longtext"); + + b.Property("Requirements") + .HasColumnType("longtext"); + + b.Property("Settings") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("OpenIddictApplications", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationId") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("Scopes") + .HasColumnType("longtext"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("varchar(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictAuthorizations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Scopes.OpenIddictScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("Descriptions") + .HasColumnType("longtext"); + + b.Property("DisplayName") + .HasColumnType("longtext"); + + b.Property("DisplayNames") + .HasColumnType("longtext"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("Resources") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("OpenIddictScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationId") + .HasColumnType("char(36)"); + + b.Property("AuthorizationId") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExpirationDate") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Payload") + .HasColumnType("longtext"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("RedemptionDate") + .HasColumnType("datetime(6)"); + + b.Property("ReferenceId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("varchar(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("AuthorizationId"); + + b.HasIndex("ReferenceId"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + + b.HasOne("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", null) + .WithMany() + .HasForeignKey("AuthorizationId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/aspnet-core/migrations/LY.MicroService.AuthServer.EntityFrameworkCore/Migrations/20240729101555_Upgrade-Abp-Framework-To-8-2-0.cs b/aspnet-core/migrations/LY.MicroService.AuthServer.EntityFrameworkCore/Migrations/20240729101555_Upgrade-Abp-Framework-To-8-2-0.cs new file mode 100644 index 000000000..b7f53cb56 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.AuthServer.EntityFrameworkCore/Migrations/20240729101555_Upgrade-Abp-Framework-To-8-2-0.cs @@ -0,0 +1,63 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace LY.MicroService.AuthServer.EntityFrameworkCore.Migrations +{ + /// + public partial class UpgradeAbpFrameworkTo820 : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "AbpSessions", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + SessionId = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Device = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + DeviceInfo = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ClientId = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + IpAddresses = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + SignedIn = table.Column(type: "datetime(6)", nullable: false), + LastAccessed = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpSessions", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_AbpSessions_Device", + table: "AbpSessions", + column: "Device"); + + migrationBuilder.CreateIndex( + name: "IX_AbpSessions_SessionId", + table: "AbpSessions", + column: "SessionId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpSessions_TenantId_UserId", + table: "AbpSessions", + columns: new[] { "TenantId", "UserId" }); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "AbpSessions"); + } + } +} diff --git a/aspnet-core/migrations/LY.MicroService.AuthServer.EntityFrameworkCore/Migrations/AuthServerMigrationsDbContextModelSnapshot.cs b/aspnet-core/migrations/LY.MicroService.AuthServer.EntityFrameworkCore/Migrations/AuthServerMigrationsDbContextModelSnapshot.cs index ac0dc50eb..cc8a5f1a8 100644 --- a/aspnet-core/migrations/LY.MicroService.AuthServer.EntityFrameworkCore/Migrations/AuthServerMigrationsDbContextModelSnapshot.cs +++ b/aspnet-core/migrations/LY.MicroService.AuthServer.EntityFrameworkCore/Migrations/AuthServerMigrationsDbContextModelSnapshot.cs @@ -3,6 +3,7 @@ using LY.MicroService.AuthServer.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Volo.Abp.EntityFrameworkCore; @@ -18,9 +19,11 @@ protected override void BuildModel(ModelBuilder modelBuilder) #pragma warning disable 612, 618 modelBuilder .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) - .HasAnnotation("ProductVersion", "8.0.0") + .HasAnnotation("ProductVersion", "8.0.4") .HasAnnotation("Relational:MaxIdentifierLength", 64); + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => { b.Property("Id") @@ -255,6 +258,58 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("AbpSecurityLogs", (string)null); }); + modelBuilder.Entity("Volo.Abp.Identity.IdentitySession", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Device") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("DeviceInfo") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("IpAddresses") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("LastAccessed") + .HasColumnType("datetime(6)"); + + b.Property("SessionId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("SignedIn") + .HasColumnType("datetime(6)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("Device"); + + b.HasIndex("SessionId"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSessions", (string)null); + }); + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => { b.Property("Id") diff --git a/aspnet-core/migrations/LY.MicroService.BackendAdmin.EntityFrameworkCore/BackendAdminDbMigrationEventHandler.cs b/aspnet-core/migrations/LY.MicroService.BackendAdmin.EntityFrameworkCore/BackendAdminDbMigrationEventHandler.cs index 60437990c..96fe11958 100644 --- a/aspnet-core/migrations/LY.MicroService.BackendAdmin.EntityFrameworkCore/BackendAdminDbMigrationEventHandler.cs +++ b/aspnet-core/migrations/LY.MicroService.BackendAdmin.EntityFrameworkCore/BackendAdminDbMigrationEventHandler.cs @@ -2,6 +2,7 @@ using System; using System.Threading.Tasks; using Volo.Abp.Data; +using Volo.Abp.DistributedLocking; using Volo.Abp.EntityFrameworkCore.Migrations; using Volo.Abp.EventBus.Distributed; using Volo.Abp.MultiTenancy; @@ -17,12 +18,13 @@ public BackendAdminDbMigrationEventHandler( ICurrentTenant currentTenant, IUnitOfWorkManager unitOfWorkManager, ITenantStore tenantStore, + IAbpDistributedLock abpDistributedLock, IDistributedEventBus distributedEventBus, ILoggerFactory loggerFactory, IDataSeeder dataSeeder) : base( ConnectionStringNameAttribute.GetConnStringName(), - currentTenant, unitOfWorkManager, tenantStore, distributedEventBus, loggerFactory) + currentTenant, unitOfWorkManager, tenantStore, abpDistributedLock, distributedEventBus, loggerFactory) { DataSeeder = dataSeeder; } diff --git a/aspnet-core/migrations/LY.MicroService.IdentityServer.EntityFrameworkCore/IdentityServerDbMigrationEventHandler.cs b/aspnet-core/migrations/LY.MicroService.IdentityServer.EntityFrameworkCore/IdentityServerDbMigrationEventHandler.cs index ac81f9e6e..8f8dc17df 100644 --- a/aspnet-core/migrations/LY.MicroService.IdentityServer.EntityFrameworkCore/IdentityServerDbMigrationEventHandler.cs +++ b/aspnet-core/migrations/LY.MicroService.IdentityServer.EntityFrameworkCore/IdentityServerDbMigrationEventHandler.cs @@ -5,6 +5,7 @@ using System.Threading.Tasks; using Volo.Abp.Authorization.Permissions; using Volo.Abp.Data; +using Volo.Abp.DistributedLocking; using Volo.Abp.EntityFrameworkCore.Migrations; using Volo.Abp.EventBus.Distributed; using Volo.Abp.Guids; @@ -27,7 +28,8 @@ public class IdentityServerDbMigrationEventHandler : EfCoreDatabaseMigrationEven public IdentityServerDbMigrationEventHandler( ICurrentTenant currentTenant, IUnitOfWorkManager unitOfWorkManager, - ITenantStore tenantStore, + ITenantStore tenantStore, + IAbpDistributedLock abpDistributedLock, IDistributedEventBus distributedEventBus, ILoggerFactory loggerFactory, IGuidGenerator guidGenerator, @@ -36,7 +38,7 @@ public IdentityServerDbMigrationEventHandler( IPermissionDataSeeder permissionDataSeeder) : base( ConnectionStringNameAttribute.GetConnStringName(), - currentTenant, unitOfWorkManager, tenantStore, distributedEventBus, loggerFactory) + currentTenant, unitOfWorkManager, tenantStore, abpDistributedLock, distributedEventBus, loggerFactory) { GuidGenerator = guidGenerator; IdentityUserManager = identityUserManager; diff --git a/aspnet-core/migrations/LY.MicroService.IdentityServer.EntityFrameworkCore/Migrations/20240729101518_Upgrade-Abp-Framework-To-8-2-0.Designer.cs b/aspnet-core/migrations/LY.MicroService.IdentityServer.EntityFrameworkCore/Migrations/20240729101518_Upgrade-Abp-Framework-To-8-2-0.Designer.cs new file mode 100644 index 000000000..e682aecf7 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.IdentityServer.EntityFrameworkCore/Migrations/20240729101518_Upgrade-Abp-Framework-To-8-2-0.Designer.cs @@ -0,0 +1,1896 @@ +// +using System; +using LY.MicroService.IdentityServer.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace LY.MicroService.IdentityServer.EntityFrameworkCore.Migrations +{ + [DbContext(typeof(IdentityServerMigrationsDbContext))] + [Migration("20240729101518_Upgrade-Abp-Framework-To-8-2-0")] + partial class UpgradeAbpFrameworkTo820 + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) + .HasAnnotation("ProductVersion", "8.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("SourceTenantId") + .HasColumnType("char(36)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("TargetTenantId") + .HasColumnType("char(36)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique(); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("tinyint(1)") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySession", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Device") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("DeviceInfo") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("IpAddresses") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("LastAccessed") + .HasColumnType("datetime(6)"); + + b.Property("SessionId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("SignedIn") + .HasColumnType("datetime(6)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("Device"); + + b.HasIndex("SessionId"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSessions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnName("IsActive"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LastPasswordChangeTime") + .HasColumnType("datetime(6)"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("datetime(6)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("SecurityStamp"); + + b.Property("ShouldChangePasswordOnNextLogin") + .HasColumnType("tinyint(1)"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserDelegation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("EndTime") + .HasColumnType("datetime(6)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("StartTime") + .HasColumnType("datetime(6)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("AbpUserDelegations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("varchar(196)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("varchar(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowedAccessTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiResourceId", "Type"); + + b.ToTable("IdentityServerApiResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ApiResourceId", "Key", "Value"); + + b.ToTable("IdentityServerApiResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiResourceId", "Scope"); + + b.ToTable("IdentityServerApiResourceScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiResourceSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiScopeId", "Type"); + + b.ToTable("IdentityServerApiScopeClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ApiScopeId", "Key", "Value"); + + b.ToTable("IdentityServerApiScopeProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AbsoluteRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenType") + .HasColumnType("int"); + + b.Property("AllowAccessTokensViaBrowser") + .HasColumnType("tinyint(1)"); + + b.Property("AllowOfflineAccess") + .HasColumnType("tinyint(1)"); + + b.Property("AllowPlainTextPkce") + .HasColumnType("tinyint(1)"); + + b.Property("AllowRememberConsent") + .HasColumnType("tinyint(1)"); + + b.Property("AllowedIdentityTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("AlwaysIncludeUserClaimsInIdToken") + .HasColumnType("tinyint(1)"); + + b.Property("AlwaysSendClientClaims") + .HasColumnType("tinyint(1)"); + + b.Property("AuthorizationCodeLifetime") + .HasColumnType("int"); + + b.Property("BackChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("BackChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ClientClaimsPrefix") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentLifetime") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DeviceCodeLifetime") + .HasColumnType("int"); + + b.Property("EnableLocalLogin") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("FrontChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("FrontChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("IdentityTokenLifetime") + .HasColumnType("int"); + + b.Property("IncludeJwtId") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("PairWiseSubjectSalt") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ProtocolType") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("RefreshTokenExpiration") + .HasColumnType("int"); + + b.Property("RefreshTokenUsage") + .HasColumnType("int"); + + b.Property("RequireClientSecret") + .HasColumnType("tinyint(1)"); + + b.Property("RequireConsent") + .HasColumnType("tinyint(1)"); + + b.Property("RequirePkce") + .HasColumnType("tinyint(1)"); + + b.Property("RequireRequestObject") + .HasColumnType("tinyint(1)"); + + b.Property("SlidingRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("UpdateAccessTokenClaimsOnRefresh") + .HasColumnType("tinyint(1)"); + + b.Property("UserCodeType") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("UserSsoLifetime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("IdentityServerClients", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Origin") + .HasMaxLength(150) + .HasColumnType("varchar(150)"); + + b.HasKey("ClientId", "Origin"); + + b.ToTable("IdentityServerClientCorsOrigins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("GrantType") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.HasKey("ClientId", "GrantType"); + + b.ToTable("IdentityServerClientGrantTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Provider") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ClientId", "Provider"); + + b.ToTable("IdentityServerClientIdPRestrictions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("PostLogoutRedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "PostLogoutRedirectUri"); + + b.ToTable("IdentityServerClientPostLogoutRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "Key", "Value"); + + b.ToTable("IdentityServerClientProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("RedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "RedirectUri"); + + b.ToTable("IdentityServerClientRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ClientId", "Scope"); + + b.ToTable("IdentityServerClientScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Description") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("varchar(10000)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("DeviceCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("UserCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode"); + + b.ToTable("IdentityServerDeviceFlowCodes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => + { + b.Property("Key") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsumedTime") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("varchar(10000)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Key"); + + b.HasIndex("Expiration"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.HasIndex("SubjectId", "SessionId", "Type"); + + b.ToTable("IdentityServerPersistedGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerIdentityResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("IdentityResourceId", "Type"); + + b.ToTable("IdentityServerIdentityResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("IdentityResourceId", "Key", "Value"); + + b.ToTable("IdentityServerIdentityResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Properties") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("UserClaims") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("Properties") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Claims") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedCorsOrigins") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedGrantTypes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("IdentityProviderRestrictions") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("PostLogoutRedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Properties") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("RedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedScopes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("ClientSecrets") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("UserClaims") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("Properties") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Navigation("Properties"); + + b.Navigation("Scopes"); + + b.Navigation("Secrets"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Navigation("AllowedCorsOrigins"); + + b.Navigation("AllowedGrantTypes"); + + b.Navigation("AllowedScopes"); + + b.Navigation("Claims"); + + b.Navigation("ClientSecrets"); + + b.Navigation("IdentityProviderRestrictions"); + + b.Navigation("PostLogoutRedirectUris"); + + b.Navigation("Properties"); + + b.Navigation("RedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/aspnet-core/migrations/LY.MicroService.IdentityServer.EntityFrameworkCore/Migrations/20240729101518_Upgrade-Abp-Framework-To-8-2-0.cs b/aspnet-core/migrations/LY.MicroService.IdentityServer.EntityFrameworkCore/Migrations/20240729101518_Upgrade-Abp-Framework-To-8-2-0.cs new file mode 100644 index 000000000..04d53cb0d --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.IdentityServer.EntityFrameworkCore/Migrations/20240729101518_Upgrade-Abp-Framework-To-8-2-0.cs @@ -0,0 +1,63 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace LY.MicroService.IdentityServer.EntityFrameworkCore.Migrations +{ + /// + public partial class UpgradeAbpFrameworkTo820 : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "AbpSessions", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + SessionId = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Device = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + DeviceInfo = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ClientId = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + IpAddresses = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + SignedIn = table.Column(type: "datetime(6)", nullable: false), + LastAccessed = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpSessions", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_AbpSessions_Device", + table: "AbpSessions", + column: "Device"); + + migrationBuilder.CreateIndex( + name: "IX_AbpSessions_SessionId", + table: "AbpSessions", + column: "SessionId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpSessions_TenantId_UserId", + table: "AbpSessions", + columns: new[] { "TenantId", "UserId" }); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "AbpSessions"); + } + } +} diff --git a/aspnet-core/migrations/LY.MicroService.IdentityServer.EntityFrameworkCore/Migrations/IdentityServerMigrationsDbContextModelSnapshot.cs b/aspnet-core/migrations/LY.MicroService.IdentityServer.EntityFrameworkCore/Migrations/IdentityServerMigrationsDbContextModelSnapshot.cs index 90b9c56f4..e503045b8 100644 --- a/aspnet-core/migrations/LY.MicroService.IdentityServer.EntityFrameworkCore/Migrations/IdentityServerMigrationsDbContextModelSnapshot.cs +++ b/aspnet-core/migrations/LY.MicroService.IdentityServer.EntityFrameworkCore/Migrations/IdentityServerMigrationsDbContextModelSnapshot.cs @@ -3,6 +3,7 @@ using LY.MicroService.IdentityServer.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Volo.Abp.EntityFrameworkCore; @@ -18,9 +19,11 @@ protected override void BuildModel(ModelBuilder modelBuilder) #pragma warning disable 612, 618 modelBuilder .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) - .HasAnnotation("ProductVersion", "7.0.10") + .HasAnnotation("ProductVersion", "8.0.4") .HasAnnotation("Relational:MaxIdentifierLength", 64); + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => { b.Property("Id") @@ -255,6 +258,58 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("AbpSecurityLogs", (string)null); }); + modelBuilder.Entity("Volo.Abp.Identity.IdentitySession", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Device") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("DeviceInfo") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("IpAddresses") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("LastAccessed") + .HasColumnType("datetime(6)"); + + b.Property("SessionId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("SignedIn") + .HasColumnType("datetime(6)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("Device"); + + b.HasIndex("SessionId"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSessions", (string)null); + }); + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => { b.Property("Id") diff --git a/aspnet-core/migrations/LY.MicroService.LocalizationManagement.EntityFrameworkCore/LocalizationManagementDbMigrationEventHandler.cs b/aspnet-core/migrations/LY.MicroService.LocalizationManagement.EntityFrameworkCore/LocalizationManagementDbMigrationEventHandler.cs index 4651441a8..06f3ac46b 100644 --- a/aspnet-core/migrations/LY.MicroService.LocalizationManagement.EntityFrameworkCore/LocalizationManagementDbMigrationEventHandler.cs +++ b/aspnet-core/migrations/LY.MicroService.LocalizationManagement.EntityFrameworkCore/LocalizationManagementDbMigrationEventHandler.cs @@ -1,5 +1,6 @@ using Microsoft.Extensions.Logging; using Volo.Abp.Data; +using Volo.Abp.DistributedLocking; using Volo.Abp.EntityFrameworkCore.Migrations; using Volo.Abp.EventBus.Distributed; using Volo.Abp.MultiTenancy; @@ -12,11 +13,12 @@ public LocalizationManagementDbMigrationEventHandler( ICurrentTenant currentTenant, IUnitOfWorkManager unitOfWorkManager, ITenantStore tenantStore, + IAbpDistributedLock abpDistributedLock, IDistributedEventBus distributedEventBus, ILoggerFactory loggerFactory) : base( ConnectionStringNameAttribute.GetConnStringName(), - currentTenant, unitOfWorkManager, tenantStore, distributedEventBus, loggerFactory) + currentTenant, unitOfWorkManager, tenantStore, abpDistributedLock, distributedEventBus, loggerFactory) { } } diff --git a/aspnet-core/migrations/LY.MicroService.LocalizationManagement.EntityFrameworkCore/Migrations/20240729101616_Upgrade-Abp-Framework-To-8-2-0.Designer.cs b/aspnet-core/migrations/LY.MicroService.LocalizationManagement.EntityFrameworkCore/Migrations/20240729101616_Upgrade-Abp-Framework-To-8-2-0.Designer.cs new file mode 100644 index 000000000..c5a625cfa --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.LocalizationManagement.EntityFrameworkCore/Migrations/20240729101616_Upgrade-Abp-Framework-To-8-2-0.Designer.cs @@ -0,0 +1,179 @@ +// +using System; +using LY.MicroService.LocalizationManagement.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace LY.MicroService.LocalizationManagement.EntityFrameworkCore.Migrations +{ + [DbContext(typeof(LocalizationManagementMigrationsDbContext))] + [Migration("20240729101616_Upgrade-Abp-Framework-To-8-2-0")] + partial class UpgradeAbpFrameworkTo820 + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) + .HasAnnotation("ProductVersion", "8.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + + modelBuilder.Entity("LINGYUN.Abp.LocalizationManagement.Language", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("CultureName") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasColumnName("CultureName"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("DisplayName"); + + b.Property("Enable") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("TwoLetterISOLanguageName") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("TwoLetterISOLanguageName"); + + b.Property("UiCultureName") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasColumnName("UiCultureName"); + + b.HasKey("Id"); + + b.HasIndex("CultureName"); + + b.ToTable("AbpLocalizationLanguages", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.LocalizationManagement.Resource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DefaultCultureName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("DefaultCultureName"); + + b.Property("Description") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Description"); + + b.Property("DisplayName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("DisplayName"); + + b.Property("Enable") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasColumnName("Name"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AbpLocalizationResources", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.LocalizationManagement.Text", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CultureName") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasColumnName("CultureName"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("Key"); + + b.Property("ResourceName") + .HasColumnType("longtext"); + + b.Property("Value") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)") + .HasColumnName("Value"); + + b.HasKey("Id"); + + b.HasIndex("Key"); + + b.ToTable("AbpLocalizationTexts", (string)null); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/aspnet-core/migrations/LY.MicroService.LocalizationManagement.EntityFrameworkCore/Migrations/20240729101616_Upgrade-Abp-Framework-To-8-2-0.cs b/aspnet-core/migrations/LY.MicroService.LocalizationManagement.EntityFrameworkCore/Migrations/20240729101616_Upgrade-Abp-Framework-To-8-2-0.cs new file mode 100644 index 000000000..3512dc511 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.LocalizationManagement.EntityFrameworkCore/Migrations/20240729101616_Upgrade-Abp-Framework-To-8-2-0.cs @@ -0,0 +1,47 @@ +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace LY.MicroService.LocalizationManagement.EntityFrameworkCore.Migrations +{ + /// + public partial class UpgradeAbpFrameworkTo820 : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.RenameColumn( + name: "FlagIcon", + table: "AbpLocalizationLanguages", + newName: "TwoLetterISOLanguageName"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AbpLocalizationTexts", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.RenameColumn( + name: "TwoLetterISOLanguageName", + table: "AbpLocalizationLanguages", + newName: "FlagIcon"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AbpLocalizationTexts", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + } + } +} diff --git a/aspnet-core/migrations/LY.MicroService.LocalizationManagement.EntityFrameworkCore/Migrations/LocalizationManagementMigrationsDbContextModelSnapshot.cs b/aspnet-core/migrations/LY.MicroService.LocalizationManagement.EntityFrameworkCore/Migrations/LocalizationManagementMigrationsDbContextModelSnapshot.cs index 8d1be8086..bf856c44d 100644 --- a/aspnet-core/migrations/LY.MicroService.LocalizationManagement.EntityFrameworkCore/Migrations/LocalizationManagementMigrationsDbContextModelSnapshot.cs +++ b/aspnet-core/migrations/LY.MicroService.LocalizationManagement.EntityFrameworkCore/Migrations/LocalizationManagementMigrationsDbContextModelSnapshot.cs @@ -3,6 +3,7 @@ using LY.MicroService.LocalizationManagement.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Volo.Abp.EntityFrameworkCore; @@ -18,9 +19,11 @@ protected override void BuildModel(ModelBuilder modelBuilder) #pragma warning disable 612, 618 modelBuilder .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) - .HasAnnotation("ProductVersion", "7.0.1") + .HasAnnotation("ProductVersion", "8.0.4") .HasAnnotation("Relational:MaxIdentifierLength", 64); + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + modelBuilder.Entity("LINGYUN.Abp.LocalizationManagement.Language", b => { b.Property("Id") @@ -52,11 +55,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("tinyint(1)") .HasDefaultValue(true); - b.Property("FlagIcon") - .HasMaxLength(30) - .HasColumnType("varchar(30)") - .HasColumnName("FlagIcon"); - b.Property("LastModificationTime") .HasColumnType("datetime(6)") .HasColumnName("LastModificationTime"); @@ -65,6 +63,11 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("char(36)") .HasColumnName("LastModifierId"); + b.Property("TwoLetterISOLanguageName") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("TwoLetterISOLanguageName"); + b.Property("UiCultureName") .IsRequired() .HasMaxLength(20) @@ -139,6 +142,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("CultureName") .IsRequired() .HasMaxLength(20) diff --git a/aspnet-core/migrations/LY.MicroService.Platform.EntityFrameworkCore/Migrations/20240729101742_Upgrade-Abp-Framework-To-8-2-0.Designer.cs b/aspnet-core/migrations/LY.MicroService.Platform.EntityFrameworkCore/Migrations/20240729101742_Upgrade-Abp-Framework-To-8-2-0.Designer.cs new file mode 100644 index 000000000..2fe946571 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.Platform.EntityFrameworkCore/Migrations/20240729101742_Upgrade-Abp-Framework-To-8-2-0.Designer.cs @@ -0,0 +1,882 @@ +// +using System; +using LY.MicroService.Platform.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace LY.MicroService.Platform.EntityFrameworkCore.Migrations +{ + [DbContext(typeof(PlatformMigrationsDbContext))] + [Migration("20240729101742_Upgrade-Abp-Framework-To-8-2-0")] + partial class UpgradeAbpFrameworkTo820 + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) + .HasAnnotation("ProductVersion", "8.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + + modelBuilder.Entity("LINGYUN.Platform.Datas.Data", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)") + .HasColumnName("Description"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("Name"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AppPlatformDatas", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Datas.DataItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowBeNull") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DataId") + .HasColumnType("char(36)"); + + b.Property("DefaultValue") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DefaultValue"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)") + .HasColumnName("Description"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("Name"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("DataId"); + + b.HasIndex("Name"); + + b.ToTable("AppPlatformDataItems", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Layouts.Layout", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DataId") + .HasColumnType("char(36)"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Framework") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Framework"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("Path") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Path"); + + b.Property("Redirect") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Redirect"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("AppPlatformLayouts", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Menus.Menu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(23) + .HasColumnType("varchar(23)") + .HasColumnName("Code"); + + b.Property("Component") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Component"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Framework") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Framework"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LayoutId") + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("Path") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Path"); + + b.Property("Redirect") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Redirect"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("AppPlatformMenus", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Menus.RoleMenu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("MenuId") + .HasColumnType("char(36)"); + + b.Property("RoleName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("RoleName"); + + b.Property("Startup") + .HasColumnType("tinyint(1)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleName", "MenuId"); + + b.ToTable("AppPlatformRoleMenus", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Menus.UserFavoriteMenu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AliasName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("AliasName"); + + b.Property("Color") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("Color"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("Framework") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Framework"); + + b.Property("Icon") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("Icon"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("MenuId") + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("Path") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Path"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId", "MenuId"); + + b.ToTable("AppPlatformUserFavoriteMenus", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Menus.UserMenu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("MenuId") + .HasColumnType("char(36)"); + + b.Property("Startup") + .HasColumnType("tinyint(1)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId", "MenuId"); + + b.ToTable("AppPlatformUserMenus", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Packages.Package", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Authors") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("Authors"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Description"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("ForceUpdate") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Name"); + + b.Property("Note") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)") + .HasColumnName("Note"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("Version"); + + b.HasKey("Id"); + + b.HasIndex("Name", "Version"); + + b.ToTable("AppPlatformPackages", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Packages.PackageBlob", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Authors") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("Authors"); + + b.Property("ContentType") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ContentType"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DownloadCount") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("License") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)") + .HasColumnName("License"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Name"); + + b.Property("PackageId") + .HasColumnType("char(36)"); + + b.Property("SHA256") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("SHA256"); + + b.Property("Size") + .HasColumnType("bigint"); + + b.Property("Summary") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)") + .HasColumnName("Summary"); + + b.Property("UpdatedAt") + .HasColumnType("datetime(6)"); + + b.Property("Url") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("Url"); + + b.HasKey("Id"); + + b.HasIndex("PackageId", "Name"); + + b.ToTable("AppPlatformPackageBlobs", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Portal.Enterprise", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Address") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Address"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("EnglishName") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("EnglishName"); + + b.Property("ExpirationDate") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LegalMan") + .HasMaxLength(60) + .HasColumnType("varchar(60)") + .HasColumnName("LegalMan"); + + b.Property("Logo") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("Logo"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Name"); + + b.Property("OrganizationCode") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("OrganizationCode"); + + b.Property("RegistrationCode") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("RegistrationCode"); + + b.Property("RegistrationDate") + .HasColumnType("datetime(6)"); + + b.Property("TaxCode") + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("TaxCode"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.ToTable("AppPlatformEnterprises", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Datas.DataItem", b => + { + b.HasOne("LINGYUN.Platform.Datas.Data", null) + .WithMany("Items") + .HasForeignKey("DataId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("LINGYUN.Platform.Packages.PackageBlob", b => + { + b.HasOne("LINGYUN.Platform.Packages.Package", "Package") + .WithMany("Blobs") + .HasForeignKey("PackageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Package"); + }); + + modelBuilder.Entity("LINGYUN.Platform.Datas.Data", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("LINGYUN.Platform.Packages.Package", b => + { + b.Navigation("Blobs"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/aspnet-core/migrations/LY.MicroService.Platform.EntityFrameworkCore/Migrations/20240729101742_Upgrade-Abp-Framework-To-8-2-0.cs b/aspnet-core/migrations/LY.MicroService.Platform.EntityFrameworkCore/Migrations/20240729101742_Upgrade-Abp-Framework-To-8-2-0.cs new file mode 100644 index 000000000..c412c8f66 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.Platform.EntityFrameworkCore/Migrations/20240729101742_Upgrade-Abp-Framework-To-8-2-0.cs @@ -0,0 +1,60 @@ +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace LY.MicroService.Platform.EntityFrameworkCore.Migrations +{ + /// + public partial class UpgradeAbpFrameworkTo820 : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "TenantId", + table: "AppPlatformPackages"); + + migrationBuilder.DropColumn( + name: "TenantId", + table: "AppPlatformPackageBlobs"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppPlatformPackageBlobs", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "TenantId", + table: "AppPlatformPackages", + type: "char(36)", + nullable: true, + collation: "ascii_general_ci"); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppPlatformPackageBlobs", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AddColumn( + name: "TenantId", + table: "AppPlatformPackageBlobs", + type: "char(36)", + nullable: true, + collation: "ascii_general_ci"); + } + } +} diff --git a/aspnet-core/migrations/LY.MicroService.Platform.EntityFrameworkCore/Migrations/PlatformMigrationsDbContextModelSnapshot.cs b/aspnet-core/migrations/LY.MicroService.Platform.EntityFrameworkCore/Migrations/PlatformMigrationsDbContextModelSnapshot.cs index ae2fc3055..5f5e78da1 100644 --- a/aspnet-core/migrations/LY.MicroService.Platform.EntityFrameworkCore/Migrations/PlatformMigrationsDbContextModelSnapshot.cs +++ b/aspnet-core/migrations/LY.MicroService.Platform.EntityFrameworkCore/Migrations/PlatformMigrationsDbContextModelSnapshot.cs @@ -3,6 +3,7 @@ using LY.MicroService.Platform.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Volo.Abp.EntityFrameworkCore; @@ -18,9 +19,11 @@ protected override void BuildModel(ModelBuilder modelBuilder) #pragma warning disable 612, 618 modelBuilder .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) - .HasAnnotation("ProductVersion", "7.0.10") + .HasAnnotation("ProductVersion", "8.0.4") .HasAnnotation("Relational:MaxIdentifierLength", 64); + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + modelBuilder.Entity("LINGYUN.Platform.Datas.Data", b => { b.Property("Id") @@ -647,10 +650,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("varchar(1024)") .HasColumnName("Note"); - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - b.Property("Version") .IsRequired() .HasMaxLength(30) @@ -670,6 +669,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("Authors") .HasMaxLength(100) .HasColumnType("varchar(100)") @@ -725,10 +726,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("varchar(1024)") .HasColumnName("Summary"); - b.Property("TenantId") - .HasColumnType("char(36)") - .HasColumnName("TenantId"); - b.Property("UpdatedAt") .HasColumnType("datetime(6)"); diff --git a/aspnet-core/migrations/LY.MicroService.Platform.EntityFrameworkCore/PlatformDbMigrationEventHandler.cs b/aspnet-core/migrations/LY.MicroService.Platform.EntityFrameworkCore/PlatformDbMigrationEventHandler.cs index a1381495c..600cd5278 100644 --- a/aspnet-core/migrations/LY.MicroService.Platform.EntityFrameworkCore/PlatformDbMigrationEventHandler.cs +++ b/aspnet-core/migrations/LY.MicroService.Platform.EntityFrameworkCore/PlatformDbMigrationEventHandler.cs @@ -7,6 +7,7 @@ using System.Linq; using System.Threading.Tasks; using Volo.Abp.Data; +using Volo.Abp.DistributedLocking; using Volo.Abp.EntityFrameworkCore.Migrations; using Volo.Abp.EventBus.Distributed; using Volo.Abp.Features; @@ -25,6 +26,7 @@ public PlatformDbMigrationEventHandler( ICurrentTenant currentTenant, IUnitOfWorkManager unitOfWorkManager, ITenantStore tenantStore, + IAbpDistributedLock abpDistributedLock, IDistributedEventBus distributedEventBus, ILoggerFactory loggerFactory, IDataSeeder dataSeeder, @@ -32,7 +34,7 @@ public PlatformDbMigrationEventHandler( IConfiguration configuration) : base( ConnectionStringNameAttribute.GetConnStringName(), - currentTenant, unitOfWorkManager, tenantStore, distributedEventBus, loggerFactory) + currentTenant, unitOfWorkManager, tenantStore, abpDistributedLock, distributedEventBus, loggerFactory) { DataSeeder = dataSeeder; FeatureChecker = featureChecker; diff --git a/aspnet-core/migrations/LY.MicroService.RealtimeMessage.EntityFrameworkCore/Migrations/20240729101817_Upgrade-Abp-Framework-To-8-2-0.Designer.cs b/aspnet-core/migrations/LY.MicroService.RealtimeMessage.EntityFrameworkCore/Migrations/20240729101817_Upgrade-Abp-Framework-To-8-2-0.Designer.cs new file mode 100644 index 000000000..5f968d4cd --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.RealtimeMessage.EntityFrameworkCore/Migrations/20240729101817_Upgrade-Abp-Framework-To-8-2-0.Designer.cs @@ -0,0 +1,761 @@ +// +using System; +using LY.MicroService.RealtimeMessage.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace LY.MicroService.RealtimeMessage.EntityFrameworkCore.Migrations +{ + [DbContext(typeof(RealtimeMessageMigrationsDbContext))] + [Migration("20240729101817_Upgrade-Abp-Framework-To-8-2-0")] + partial class UpgradeAbpFrameworkTo820 + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) + .HasAnnotation("ProductVersion", "8.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatCard", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Age") + .HasColumnType("int"); + + b.Property("AvatarUrl") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("Birthday") + .HasColumnType("datetime(6)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Description") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LastOnlineTime") + .HasColumnType("datetime(6)"); + + b.Property("NickName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Sex") + .HasColumnType("int"); + + b.Property("Sign") + .HasMaxLength(30) + .HasColumnType("varchar(30)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AppUserChatCards", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatFriend", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Black") + .HasColumnType("tinyint(1)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Description") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("DontDisturb") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("FrientId") + .HasColumnType("char(36)"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("RemarkName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("SpecialFocus") + .HasColumnType("tinyint(1)"); + + b.Property("Status") + .HasColumnType("tinyint unsigned"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId", "FrientId"); + + b.ToTable("AppUserChatFriends", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AllowAddFriend") + .HasColumnType("tinyint(1)"); + + b.Property("AllowAnonymous") + .HasColumnType("tinyint(1)"); + + b.Property("AllowReceiveMessage") + .HasColumnType("tinyint(1)"); + + b.Property("AllowSendMessage") + .HasColumnType("tinyint(1)"); + + b.Property("RequireAddFriendValition") + .HasColumnType("tinyint(1)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AppUserChatSettings", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Content") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("longtext"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("MessageId") + .HasColumnType("bigint"); + + b.Property("ReceiveUserId") + .HasColumnType("char(36)"); + + b.Property("SendUserName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Source") + .HasColumnType("int"); + + b.Property("State") + .HasColumnType("tinyint"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ReceiveUserId"); + + b.ToTable("AppUserMessages", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Groups.ChatGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Address") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("AdminUserId") + .HasColumnType("char(36)"); + + b.Property("AllowAnonymous") + .HasColumnType("tinyint(1)"); + + b.Property("AllowSendMessage") + .HasColumnType("tinyint(1)"); + + b.Property("AvatarUrl") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Description") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("GroupId") + .HasColumnType("bigint"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("MaxUserCount") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)"); + + b.Property("Notice") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Tag") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name"); + + b.ToTable("AppChatGroups", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Groups.GroupChatBlack", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("GroupId") + .HasColumnType("bigint"); + + b.Property("ShieldUserId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "GroupId"); + + b.ToTable("AppGroupChatBlacks", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Groups.GroupMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Content") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("longtext"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("GroupId") + .HasColumnType("bigint"); + + b.Property("MessageId") + .HasColumnType("bigint"); + + b.Property("SendUserName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Source") + .HasColumnType("int"); + + b.Property("State") + .HasColumnType("tinyint"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "GroupId"); + + b.ToTable("AppGroupMessages", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Groups.UserChatGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("GroupId") + .HasColumnType("bigint"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "GroupId", "UserId"); + + b.ToTable("AppUserChatGroups", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Groups.UserGroupCard", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsAdmin") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("NickName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("SilenceEnd") + .HasColumnType("datetime(6)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AppUserGroupCards", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Notifications.Notification", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("ExpirationTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("NotificationId") + .HasColumnType("bigint"); + + b.Property("NotificationName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("NotificationTypeName") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("Severity") + .HasColumnType("tinyint"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "NotificationName"); + + b.ToTable("AppNotifications", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Notifications.NotificationDefinitionGroupRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowSubscriptionToClients") + .HasColumnType("tinyint(1)"); + + b.Property("Description") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("DisplayName") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.ToTable("AppNotificationDefinitionGroups", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Notifications.NotificationDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowSubscriptionToClients") + .HasColumnType("tinyint(1)"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("Description") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("DisplayName") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("NotificationLifetime") + .HasColumnType("int"); + + b.Property("NotificationType") + .HasColumnType("int"); + + b.Property("Providers") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Template") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.ToTable("AppNotificationDefinitions", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Notifications.UserNotification", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("NotificationId") + .HasColumnType("bigint"); + + b.Property("ReadStatus") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId", "NotificationId") + .HasDatabaseName("IX_Tenant_User_Notification_Id"); + + b.ToTable("AppUserNotifications", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Notifications.UserSubscribe", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("NotificationName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasDefaultValue("/"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId", "NotificationName") + .IsUnique() + .HasDatabaseName("IX_Tenant_User_Notification_Name"); + + b.ToTable("AppUserSubscribes", (string)null); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/aspnet-core/migrations/LY.MicroService.RealtimeMessage.EntityFrameworkCore/Migrations/20240729101817_Upgrade-Abp-Framework-To-8-2-0.cs b/aspnet-core/migrations/LY.MicroService.RealtimeMessage.EntityFrameworkCore/Migrations/20240729101817_Upgrade-Abp-Framework-To-8-2-0.cs new file mode 100644 index 000000000..aab4feb07 --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.RealtimeMessage.EntityFrameworkCore/Migrations/20240729101817_Upgrade-Abp-Framework-To-8-2-0.cs @@ -0,0 +1,235 @@ +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace LY.MicroService.RealtimeMessage.EntityFrameworkCore.Migrations +{ + /// + public partial class UpgradeAbpFrameworkTo820 : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "Id", + table: "AppUserSubscribes", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppUserNotifications", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppUserMessages", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppUserGroupCards", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppUserChatSettings", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppUserChatGroups", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppUserChatFriends", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppUserChatCards", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppNotifications", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppGroupMessages", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppGroupChatBlacks", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppChatGroups", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "Id", + table: "AppUserSubscribes", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppUserNotifications", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppUserMessages", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppUserGroupCards", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppUserChatSettings", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppUserChatGroups", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppUserChatFriends", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppUserChatCards", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppNotifications", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppGroupMessages", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppGroupChatBlacks", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AppChatGroups", + type: "bigint", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + } + } +} diff --git a/aspnet-core/migrations/LY.MicroService.RealtimeMessage.EntityFrameworkCore/Migrations/RealtimeMessageMigrationsDbContextModelSnapshot.cs b/aspnet-core/migrations/LY.MicroService.RealtimeMessage.EntityFrameworkCore/Migrations/RealtimeMessageMigrationsDbContextModelSnapshot.cs index 613612237..921e1ec64 100644 --- a/aspnet-core/migrations/LY.MicroService.RealtimeMessage.EntityFrameworkCore/Migrations/RealtimeMessageMigrationsDbContextModelSnapshot.cs +++ b/aspnet-core/migrations/LY.MicroService.RealtimeMessage.EntityFrameworkCore/Migrations/RealtimeMessageMigrationsDbContextModelSnapshot.cs @@ -3,6 +3,7 @@ using LY.MicroService.RealtimeMessage.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Volo.Abp.EntityFrameworkCore; @@ -18,15 +19,19 @@ protected override void BuildModel(ModelBuilder modelBuilder) #pragma warning disable 612, 618 modelBuilder .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) - .HasAnnotation("ProductVersion", "8.0.0") + .HasAnnotation("ProductVersion", "8.0.4") .HasAnnotation("Relational:MaxIdentifierLength", 64); + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatCard", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("Age") .HasColumnType("int"); @@ -111,6 +116,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("bigint"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("Black") .HasColumnType("tinyint(1)"); @@ -177,6 +184,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("bigint"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("AllowAddFriend") .HasColumnType("tinyint(1)"); @@ -212,6 +221,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("bigint"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("ConcurrencyStamp") .IsConcurrencyToken() .IsRequired() @@ -274,6 +285,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("bigint"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("Address") .HasMaxLength(256) .HasColumnType("varchar(256)"); @@ -347,6 +360,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("bigint"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("CreationTime") .HasColumnType("datetime(6)") .HasColumnName("CreationTime"); @@ -378,6 +393,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("bigint"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("ConcurrencyStamp") .IsConcurrencyToken() .IsRequired() @@ -440,6 +457,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("bigint"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("CreationTime") .HasColumnType("datetime(6)") .HasColumnName("CreationTime"); @@ -471,6 +490,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("bigint"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("ConcurrencyStamp") .IsConcurrencyToken() .IsRequired() @@ -529,6 +550,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("bigint"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("ContentType") .ValueGeneratedOnAdd() .HasColumnType("int") @@ -667,6 +690,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("bigint"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("NotificationId") .HasColumnType("bigint"); @@ -694,6 +719,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("bigint"); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("CreationTime") .HasColumnType("datetime(6)") .HasColumnName("CreationTime"); diff --git a/aspnet-core/migrations/LY.MicroService.RealtimeMessage.EntityFrameworkCore/RealtimeMessageDbMigrationEventHandler.cs b/aspnet-core/migrations/LY.MicroService.RealtimeMessage.EntityFrameworkCore/RealtimeMessageDbMigrationEventHandler.cs index 2e9524a55..afde668d5 100644 --- a/aspnet-core/migrations/LY.MicroService.RealtimeMessage.EntityFrameworkCore/RealtimeMessageDbMigrationEventHandler.cs +++ b/aspnet-core/migrations/LY.MicroService.RealtimeMessage.EntityFrameworkCore/RealtimeMessageDbMigrationEventHandler.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Threading.Tasks; using Volo.Abp.Data; +using Volo.Abp.DistributedLocking; using Volo.Abp.EntityFrameworkCore.Migrations; using Volo.Abp.EventBus.Distributed; using Volo.Abp.MultiTenancy; @@ -20,13 +21,14 @@ public RealtimeMessageDbMigrationEventHandler( ICurrentTenant currentTenant, IUnitOfWorkManager unitOfWorkManager, ITenantStore tenantStore, + IAbpDistributedLock abpDistributedLock, IDistributedEventBus distributedEventBus, ILoggerFactory loggerFactory, INotificationSender notificationSender, INotificationSubscriptionManager notificationSubscriptionManager) : base( ConnectionStringNameAttribute.GetConnStringName(), - currentTenant, unitOfWorkManager, tenantStore, distributedEventBus, loggerFactory) + currentTenant, unitOfWorkManager, tenantStore, abpDistributedLock, distributedEventBus, loggerFactory) { NotificationSender = notificationSender; NotificationSubscriptionManager = notificationSubscriptionManager; diff --git a/aspnet-core/migrations/LY.MicroService.TaskManagement.EntityFrameworkCore/TaskManagementDbMigrationEventHandler.cs b/aspnet-core/migrations/LY.MicroService.TaskManagement.EntityFrameworkCore/TaskManagementDbMigrationEventHandler.cs index 214137d45..234c3c788 100644 --- a/aspnet-core/migrations/LY.MicroService.TaskManagement.EntityFrameworkCore/TaskManagementDbMigrationEventHandler.cs +++ b/aspnet-core/migrations/LY.MicroService.TaskManagement.EntityFrameworkCore/TaskManagementDbMigrationEventHandler.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; +using Volo.Abp.DistributedLocking; using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.EntityFrameworkCore.Migrations; using Volo.Abp.EventBus.Distributed; @@ -26,12 +27,13 @@ public TaskManagementDbMigrationEventHandler( ICurrentTenant currentTenant, IUnitOfWorkManager unitOfWorkManager, ITenantStore tenantStore, + IAbpDistributedLock abpDistributedLock, IDistributedEventBus distributedEventBus, ILoggerFactory loggerFactory, IJobStore jobStore, IJobScheduler jobScheduler, IOptions options) - : base("TaskManagementDbMigrator", currentTenant, unitOfWorkManager, tenantStore, distributedEventBus, loggerFactory) + : base("TaskManagementDbMigrator", currentTenant, unitOfWorkManager, tenantStore, abpDistributedLock, distributedEventBus, loggerFactory) { JobStore = jobStore; JobScheduler = jobScheduler; diff --git a/aspnet-core/migrations/LY.MicroService.WebhooksManagement.EntityFrameworkCore/WebhooksManagementDbMigrationEventHandler.cs b/aspnet-core/migrations/LY.MicroService.WebhooksManagement.EntityFrameworkCore/WebhooksManagementDbMigrationEventHandler.cs index 5def3e0d2..748dd7a4d 100644 --- a/aspnet-core/migrations/LY.MicroService.WebhooksManagement.EntityFrameworkCore/WebhooksManagementDbMigrationEventHandler.cs +++ b/aspnet-core/migrations/LY.MicroService.WebhooksManagement.EntityFrameworkCore/WebhooksManagementDbMigrationEventHandler.cs @@ -1,6 +1,7 @@ using Microsoft.Extensions.Logging; using System.Threading.Tasks; using Volo.Abp.Data; +using Volo.Abp.DistributedLocking; using Volo.Abp.EntityFrameworkCore.Migrations; using Volo.Abp.EventBus.Distributed; using Volo.Abp.MultiTenancy; @@ -16,10 +17,11 @@ public WebhooksManagementDbMigrationEventHandler( ICurrentTenant currentTenant, IUnitOfWorkManager unitOfWorkManager, ITenantStore tenantStore, + IAbpDistributedLock abpDistributedLock, IDistributedEventBus distributedEventBus, ILoggerFactory loggerFactory, IDataSeeder dataSeeder) - : base("WebhooksManagementDbMigrator", currentTenant, unitOfWorkManager, tenantStore, distributedEventBus, loggerFactory) + : base("WebhooksManagementDbMigrator", currentTenant, unitOfWorkManager, tenantStore, abpDistributedLock, distributedEventBus, loggerFactory) { DataSeeder = dataSeeder; } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN.Abp.Account.Application.Contracts.csproj b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN.Abp.Account.Application.Contracts.csproj index 96086e976..912bcacd5 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN.Abp.Account.Application.Contracts.csproj +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN.Abp.Account.Application.Contracts.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Account.Application.Contracts + LINGYUN.Abp.Account.Application.Contracts + false + false + false diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/AbpAccountApplicationContractsModule.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/AbpAccountApplicationContractsModule.cs index 2eca54a66..d78983c51 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/AbpAccountApplicationContractsModule.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/AbpAccountApplicationContractsModule.cs @@ -3,25 +3,24 @@ using Volo.Abp.Modularity; using Volo.Abp.VirtualFileSystem; -namespace LINGYUN.Abp.Account +namespace LINGYUN.Abp.Account; + +[DependsOn( + typeof(Volo.Abp.Account.AbpAccountApplicationContractsModule))] +public class AbpAccountApplicationContractsModule : AbpModule { - [DependsOn( - typeof(Volo.Abp.Account.AbpAccountApplicationContractsModule))] - public class AbpAccountApplicationContractsModule : AbpModule - { - public override void ConfigureServices(ServiceConfigurationContext context) + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => { - Configure(options => - { - options.FileSets.AddEmbedded(); - }); + options.FileSets.AddEmbedded(); + }); - Configure(options => - { - options.Resources - .Get() - .AddVirtualJson("/LINGYUN/Abp/Account/Localization/Resources"); - }); - } + Configure(options => + { + options.Resources + .Get() + .AddVirtualJson("/LINGYUN/Abp/Account/Localization/Resources"); + }); } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/ChangeAvatarInput.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/ChangeAvatarInput.cs index 872bfe081..6ecd90872 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/ChangeAvatarInput.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/ChangeAvatarInput.cs @@ -1,11 +1,10 @@ using Volo.Abp.Identity; using Volo.Abp.Validation; -namespace LINGYUN.Abp.Account +namespace LINGYUN.Abp.Account; + +public class ChangeAvatarInput { - public class ChangeAvatarInput - { - [DynamicMaxLength(typeof(IdentityUserClaimConsts), nameof(IdentityUserClaimConsts.MaxClaimValueLength))] - public string AvatarUrl { get; set; } - } + [DynamicMaxLength(typeof(IdentityUserClaimConsts), nameof(IdentityUserClaimConsts.MaxClaimValueLength))] + public string AvatarUrl { get; set; } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/ChangePhoneNumberInput.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/ChangePhoneNumberInput.cs index d98446477..ef92f1f92 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/ChangePhoneNumberInput.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/ChangePhoneNumberInput.cs @@ -3,25 +3,24 @@ using Volo.Abp.Identity; using Volo.Abp.Validation; -namespace LINGYUN.Abp.Account +namespace LINGYUN.Abp.Account; + +public class ChangePhoneNumberInput { - public class ChangePhoneNumberInput - { - /// - /// 新手机号 - /// - [Required] - [Phone] - [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPhoneNumberLength))] - [Display(Name = "PhoneNumber")] - public string NewPhoneNumber { get; set; } - /// - /// 安全验证码 - /// - [Required] - [DisableAuditing] - [StringLength(6, MinimumLength = 6)] - [Display(Name = "SmsVerifyCode")] - public string Code { get; set; } - } + /// + /// 新手机号 + /// + [Required] + [Phone] + [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPhoneNumberLength))] + [Display(Name = "PhoneNumber")] + public string NewPhoneNumber { get; set; } + /// + /// 安全验证码 + /// + [Required] + [DisableAuditing] + [StringLength(6, MinimumLength = 6)] + [Display(Name = "SmsVerifyCode")] + public string Code { get; set; } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/ChangeUserClaimInput.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/ChangeUserClaimInput.cs index 5f62dcb8f..ce39c0223 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/ChangeUserClaimInput.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/ChangeUserClaimInput.cs @@ -2,15 +2,14 @@ using Volo.Abp.Identity; using Volo.Abp.Validation; -namespace LINGYUN.Abp.Account +namespace LINGYUN.Abp.Account; + +public class ChangeUserClaimInput { - public class ChangeUserClaimInput - { - [Required] - [DynamicMaxLength(typeof(IdentityUserClaimConsts), nameof(IdentityUserClaimConsts.MaxClaimTypeLength))] - public string ClaimType { get; set; } + [Required] + [DynamicMaxLength(typeof(IdentityUserClaimConsts), nameof(IdentityUserClaimConsts.MaxClaimTypeLength))] + public string ClaimType { get; set; } - [DynamicMaxLength(typeof(IdentityUserClaimConsts), nameof(IdentityUserClaimConsts.MaxClaimValueLength))] - public string ClaimValue { get; set; } - } + [DynamicMaxLength(typeof(IdentityUserClaimConsts), nameof(IdentityUserClaimConsts.MaxClaimValueLength))] + public string ClaimValue { get; set; } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/GetMySessionsInput.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/GetMySessionsInput.cs new file mode 100644 index 000000000..c50ce9313 --- /dev/null +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/GetMySessionsInput.cs @@ -0,0 +1,14 @@ +using Volo.Abp.Application.Dtos; + +namespace LINGYUN.Abp.Identity; +public class GetMySessionsInput : PagedAndSortedResultRequestDto +{ + /// + /// 设备 + /// + public string Device { get; set; } + /// + /// 客户端id + /// + public string ClientId { get; set; } +} diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/IdentitySessionDto.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/IdentitySessionDto.cs new file mode 100644 index 000000000..0562964ed --- /dev/null +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/IdentitySessionDto.cs @@ -0,0 +1,20 @@ +using System; +using Volo.Abp.Application.Dtos; + +namespace LINGYUN.Abp.Account; +public class IdentitySessionDto : EntityDto +{ + public string SessionId { get; set; } + + public string Device { get; set; } + + public string DeviceInfo { get; set; } + + public string ClientId { get; set; } + + public string IpAddresses { get; set; } + + public DateTime SignedIn { get; set; } + + public DateTime? LastAccessed { get; set; } +} diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/PhoneRegisterDto.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/PhoneRegisterDto.cs index 3f11ff3b4..65fdc22f6 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/PhoneRegisterDto.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/PhoneRegisterDto.cs @@ -4,40 +4,39 @@ using Volo.Abp.Identity; using Volo.Abp.Validation; -namespace LINGYUN.Abp.Account +namespace LINGYUN.Abp.Account; + +public class PhoneRegisterDto { - public class PhoneRegisterDto - { - [Required] - [Phone] - [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPhoneNumberLength))] - [Display(Name = "PhoneNumber")] - public string PhoneNumber { get; set; } + [Required] + [Phone] + [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPhoneNumberLength))] + [Display(Name = "PhoneNumber")] + public string PhoneNumber { get; set; } - [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxNameLength))] - [DisplayName("Name")] - public string Name { get; set; } + [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxNameLength))] + [DisplayName("Name")] + public string Name { get; set; } - [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxUserNameLength))] - [DisplayName("UserName")] - public string UserName { get; set; } + [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxUserNameLength))] + [DisplayName("UserName")] + public string UserName { get; set; } - [EmailAddress] - [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxEmailLength))] - [DisplayName("EmailAddress")] - public string EmailAddress { get; set; } + [EmailAddress] + [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxEmailLength))] + [DisplayName("EmailAddress")] + public string EmailAddress { get; set; } - [Required] - [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPasswordLength))] - [DataType(DataType.Password)] - [DisplayName("Password")] - [DisableAuditing] - public string Password { get; set; } + [Required] + [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPasswordLength))] + [DataType(DataType.Password)] + [DisplayName("Password")] + [DisableAuditing] + public string Password { get; set; } - [Required] - [StringLength(6,MinimumLength = 6)] - [DisableAuditing] - [DisplayName("DisplayName:SmsVerifyCode")] - public string Code { get; set; } - } + [Required] + [StringLength(6,MinimumLength = 6)] + [DisableAuditing] + [DisplayName("DisplayName:SmsVerifyCode")] + public string Code { get; set; } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/PhoneResetPasswordDto.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/PhoneResetPasswordDto.cs index b698d7492..3bfbfb88d 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/PhoneResetPasswordDto.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/PhoneResetPasswordDto.cs @@ -3,31 +3,30 @@ using Volo.Abp.Identity; using Volo.Abp.Validation; -namespace LINGYUN.Abp.Account +namespace LINGYUN.Abp.Account; + +public class PhoneResetPasswordDto { - public class PhoneResetPasswordDto - { - [Required] - [Phone] - [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPhoneNumberLength))] + [Required] + [Phone] + [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPhoneNumberLength))] - // 如果Dto属性和本地化内容不一致,需要指定本地化名称如下 - // [Display(Name = "DisplayName:RequiredPhoneNumber")] //json本地化文件中必须有相同的格式: DisplayName:RequiredPhoneNumber - //[DisplayName("DisplayName:RequiredPhoneNumber")] //两种方法都可以 + // 如果Dto属性和本地化内容不一致,需要指定本地化名称如下 + // [Display(Name = "DisplayName:RequiredPhoneNumber")] //json本地化文件中必须有相同的格式: DisplayName:RequiredPhoneNumber + //[DisplayName("DisplayName:RequiredPhoneNumber")] //两种方法都可以 - // 如果Dto属性与本地化内容一致,不需要显示指定名称,但是本地化文件必须存在对应格式的文本: DisplayName:PhoneNumber - public string PhoneNumber { get; set; } + // 如果Dto属性与本地化内容一致,不需要显示指定名称,但是本地化文件必须存在对应格式的文本: DisplayName:PhoneNumber + public string PhoneNumber { get; set; } - [Required] - [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPasswordLength))] - [DataType(DataType.Password)] - [DisableAuditing] - public string NewPassword { get; set; } + [Required] + [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPasswordLength))] + [DataType(DataType.Password)] + [DisableAuditing] + public string NewPassword { get; set; } - [Required] - [StringLength(6)] - [DisableAuditing] - [Display(Name = "DisplayName:SmsVerifyCode")] - public string Code { get; set; } - } + [Required] + [StringLength(6)] + [DisableAuditing] + [Display(Name = "DisplayName:SmsVerifyCode")] + public string Code { get; set; } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendChangePhoneNumberCodeInput.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendChangePhoneNumberCodeInput.cs index b75b65f6a..7f6cb910a 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendChangePhoneNumberCodeInput.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendChangePhoneNumberCodeInput.cs @@ -2,17 +2,16 @@ using Volo.Abp.Identity; using Volo.Abp.Validation; -namespace LINGYUN.Abp.Account +namespace LINGYUN.Abp.Account; + +public class SendChangePhoneNumberCodeInput { - public class SendChangePhoneNumberCodeInput - { - /// - /// 新手机号 - /// - [Required] - [Phone] - [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPhoneNumberLength))] - [Display(Name = "PhoneNumber")] - public string NewPhoneNumber { get; set; } - } + /// + /// 新手机号 + /// + [Required] + [Phone] + [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPhoneNumberLength))] + [Display(Name = "PhoneNumber")] + public string NewPhoneNumber { get; set; } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendPhoneRegisterCodeDto.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendPhoneRegisterCodeDto.cs index 29411035f..15701fcc5 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendPhoneRegisterCodeDto.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendPhoneRegisterCodeDto.cs @@ -2,14 +2,13 @@ using Volo.Abp.Identity; using Volo.Abp.Validation; -namespace LINGYUN.Abp.Account +namespace LINGYUN.Abp.Account; + +public class SendPhoneRegisterCodeDto { - public class SendPhoneRegisterCodeDto - { - [Required] - [Phone] - [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPhoneNumberLength))] - [Display(Name = "PhoneNumber")] - public string PhoneNumber { get; set; } - } + [Required] + [Phone] + [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPhoneNumberLength))] + [Display(Name = "PhoneNumber")] + public string PhoneNumber { get; set; } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendPhoneResetPasswordCodeDto.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendPhoneResetPasswordCodeDto.cs index f91daef98..837a351f2 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendPhoneResetPasswordCodeDto.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendPhoneResetPasswordCodeDto.cs @@ -2,14 +2,13 @@ using Volo.Abp.Identity; using Volo.Abp.Validation; -namespace LINGYUN.Abp.Account +namespace LINGYUN.Abp.Account; + +public class SendPhoneResetPasswordCodeDto { - public class SendPhoneResetPasswordCodeDto - { - [Required] - [Phone] - [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPhoneNumberLength))] - [Display(Name = "PhoneNumber")] - public string PhoneNumber { get; set; } - } + [Required] + [Phone] + [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPhoneNumberLength))] + [Display(Name = "PhoneNumber")] + public string PhoneNumber { get; set; } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendPhoneSigninCodeDto.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendPhoneSigninCodeDto.cs index a5113755f..81ed4e8b1 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendPhoneSigninCodeDto.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/SendPhoneSigninCodeDto.cs @@ -2,14 +2,13 @@ using Volo.Abp.Identity; using Volo.Abp.Validation; -namespace LINGYUN.Abp.Account +namespace LINGYUN.Abp.Account; + +public class SendPhoneSigninCodeDto { - public class SendPhoneSigninCodeDto - { - [Required] - [Phone] - [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPhoneNumberLength))] - [Display(Name = "PhoneNumber")] - public string PhoneNumber { get; set; } - } + [Required] + [Phone] + [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPhoneNumberLength))] + [Display(Name = "PhoneNumber")] + public string PhoneNumber { get; set; } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/TwoFactorEnabledDto.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/TwoFactorEnabledDto.cs index b911e1641..02dcedfff 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/TwoFactorEnabledDto.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/TwoFactorEnabledDto.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.Account +namespace LINGYUN.Abp.Account; + +public class TwoFactorEnabledDto { - public class TwoFactorEnabledDto - { - public bool Enabled { get; set; } - } + public bool Enabled { get; set; } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/WeChatRegisterDto.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/WeChatRegisterDto.cs index 9911d49ff..f146c3cad 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/WeChatRegisterDto.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Dto/WeChatRegisterDto.cs @@ -3,28 +3,27 @@ using Volo.Abp.Identity; using Volo.Abp.Validation; -namespace LINGYUN.Abp.Account +namespace LINGYUN.Abp.Account; + +public class WeChatRegisterDto { - public class WeChatRegisterDto - { - [Required] - [DisableAuditing] - [Display(Name = "DisplayName:WeChatCode")] - public string Code { get; set; } + [Required] + [DisableAuditing] + [Display(Name = "DisplayName:WeChatCode")] + public string Code { get; set; } - [DataType(DataType.Password)] - [Required] - [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPasswordLength))] - [DisableAuditing] - [Display(Name = "Password")] - public string Password { get; set; } + [DataType(DataType.Password)] + [Required] + [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPasswordLength))] + [DisableAuditing] + [Display(Name = "Password")] + public string Password { get; set; } - [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxUserNameLength))] - [Display(Name = "UserName")] - public string UserName { get; set; } + [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxUserNameLength))] + [Display(Name = "UserName")] + public string UserName { get; set; } - [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxEmailLength))] - [Display(Name = "EmailAddress")] - public string EmailAddress { get; set; } - } + [DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxEmailLength))] + [Display(Name = "EmailAddress")] + public string EmailAddress { get; set; } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/IAccountAppService.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/IAccountAppService.cs index 102c0cf32..2ebe2b1ea 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/IAccountAppService.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/IAccountAppService.cs @@ -3,57 +3,56 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; -namespace LINGYUN.Abp.Account +namespace LINGYUN.Abp.Account; + +public interface IAccountAppService : IApplicationService { - public interface IAccountAppService : IApplicationService - { - /// - /// 通过手机号注册用户账户 - /// - /// - /// - Task RegisterAsync(PhoneRegisterDto input); - /// - /// 通过微信小程序注册用户账户 - /// - /// - /// - Task RegisterAsync(WeChatRegisterDto input); - /// - /// 通过手机号重置用户密码 - /// - /// - /// - Task ResetPasswordAsync(PhoneResetPasswordDto input); - /// - /// 发送手机注册验证码短信 - /// - /// - /// - Task SendPhoneRegisterCodeAsync(SendPhoneRegisterCodeDto input); - /// - /// 发送手机登录验证码短信 - /// - /// - /// - Task SendPhoneSigninCodeAsync(SendPhoneSigninCodeDto input); - /// - /// 发送邮件登录验证码 - /// - /// - /// - Task SendEmailSigninCodeAsync(SendEmailSigninCodeDto input); - /// - /// 发送手机重置密码验证码短信 - /// - /// - /// - Task SendPhoneResetPasswordCodeAsync(SendPhoneResetPasswordCodeDto input); - /// - /// 获取用户二次认证提供者列表 - /// - /// - /// - Task> GetTwoFactorProvidersAsync(GetTwoFactorProvidersInput input); - } + /// + /// 通过手机号注册用户账户 + /// + /// + /// + Task RegisterAsync(PhoneRegisterDto input); + /// + /// 通过微信小程序注册用户账户 + /// + /// + /// + Task RegisterAsync(WeChatRegisterDto input); + /// + /// 通过手机号重置用户密码 + /// + /// + /// + Task ResetPasswordAsync(PhoneResetPasswordDto input); + /// + /// 发送手机注册验证码短信 + /// + /// + /// + Task SendPhoneRegisterCodeAsync(SendPhoneRegisterCodeDto input); + /// + /// 发送手机登录验证码短信 + /// + /// + /// + Task SendPhoneSigninCodeAsync(SendPhoneSigninCodeDto input); + /// + /// 发送邮件登录验证码 + /// + /// + /// + Task SendEmailSigninCodeAsync(SendEmailSigninCodeDto input); + /// + /// 发送手机重置密码验证码短信 + /// + /// + /// + Task SendPhoneResetPasswordCodeAsync(SendPhoneResetPasswordCodeDto input); + /// + /// 获取用户二次认证提供者列表 + /// + /// + /// + Task> GetTwoFactorProvidersAsync(GetTwoFactorProvidersInput input); } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/IMyClaimAppService.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/IMyClaimAppService.cs index c1fa258d2..3141e954c 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/IMyClaimAppService.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/IMyClaimAppService.cs @@ -1,10 +1,9 @@ using System.Threading.Tasks; using Volo.Abp.Application.Services; -namespace LINGYUN.Abp.Account +namespace LINGYUN.Abp.Account; + +public interface IMyClaimAppService : IApplicationService { - public interface IMyClaimAppService : IApplicationService - { - Task ChangeAvatarAsync(ChangeAvatarInput input); - } + Task ChangeAvatarAsync(ChangeAvatarInput input); } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/IMyProfileAppService.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/IMyProfileAppService.cs index 669670b5b..84905cae0 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/IMyProfileAppService.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/IMyProfileAppService.cs @@ -1,63 +1,76 @@ -using System.Threading.Tasks; +using LINGYUN.Abp.Identity; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; -namespace LINGYUN.Abp.Account +namespace LINGYUN.Abp.Account; + +public interface IMyProfileAppService : IApplicationService { - public interface IMyProfileAppService : IApplicationService - { - /// - /// 获取验证器信息 - /// - /// - Task GetAuthenticator(); - /// - /// 验证验证器代码 - /// - /// - /// - Task VerifyAuthenticatorCode(VerifyAuthenticatorCodeInput input); - /// - /// 重置验证器 - /// - /// - Task ResetAuthenticator(); - /// - /// 获取二次认证状态 - /// - /// - Task GetTwoFactorEnabledAsync(); - /// - /// 改变二次认证 - /// - /// - /// - Task ChangeTwoFactorEnabledAsync(TwoFactorEnabledDto input); - /// - /// 发送改变手机号验证码 - /// - /// - /// - Task SendChangePhoneNumberCodeAsync(SendChangePhoneNumberCodeInput input); - /// - /// 改变手机绑定 - /// - /// - /// - /// - /// 需二次认证,主要是为了无法用到重定向页面修改相关信息的地方(点名微信小程序) - /// - Task ChangePhoneNumberAsync(ChangePhoneNumberInput input); - /// - /// 发送确认邮件验证码 - /// - /// - /// - Task SendEmailConfirmLinkAsync(SendEmailConfirmCodeDto input); - /// - /// 确认邮件地址 - /// - /// - /// - Task ConfirmEmailAsync(ConfirmEmailInput input); - } + /// + /// 获取验证器信息 + /// + /// + Task GetAuthenticator(); + /// + /// 验证验证器代码 + /// + /// + /// + Task VerifyAuthenticatorCode(VerifyAuthenticatorCodeInput input); + /// + /// 获取会话列表 + /// + /// + /// + Task> GetSessionsAsync(GetMySessionsInput input); + /// + /// 撤销会话 + /// + /// 会话id + /// + Task RevokeSessionAsync(string sessionId); + /// + /// 重置验证器 + /// + /// + Task ResetAuthenticator(); + /// + /// 获取二次认证状态 + /// + /// + Task GetTwoFactorEnabledAsync(); + /// + /// 改变二次认证 + /// + /// + /// + Task ChangeTwoFactorEnabledAsync(TwoFactorEnabledDto input); + /// + /// 发送改变手机号验证码 + /// + /// + /// + Task SendChangePhoneNumberCodeAsync(SendChangePhoneNumberCodeInput input); + /// + /// 改变手机绑定 + /// + /// + /// + /// + /// 需二次认证,主要是为了无法用到重定向页面修改相关信息的地方(点名微信小程序) + /// + Task ChangePhoneNumberAsync(ChangePhoneNumberInput input); + /// + /// 发送确认邮件验证码 + /// + /// + /// + Task SendEmailConfirmLinkAsync(SendEmailConfirmCodeDto input); + /// + /// 确认邮件地址 + /// + /// + /// + Task ConfirmEmailAsync(ConfirmEmailInput input); } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN.Abp.Account.Application.csproj b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN.Abp.Account.Application.csproj index db4325143..e4d6d8f54 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN.Abp.Account.Application.csproj +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN.Abp.Account.Application.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.Account.Application + LINGYUN.Abp.Account.Application + false + false + false diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/AbpAccountApplicationModule.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/AbpAccountApplicationModule.cs index ffc9998b0..30425c87a 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/AbpAccountApplicationModule.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/AbpAccountApplicationModule.cs @@ -5,27 +5,26 @@ using Volo.Abp.UI.Navigation.Urls; using Volo.Abp.VirtualFileSystem; -namespace LINGYUN.Abp.Account +namespace LINGYUN.Abp.Account; + +[DependsOn( + typeof(Volo.Abp.Account.AbpAccountApplicationModule), + typeof(AbpAccountApplicationContractsModule), + typeof(AbpAccountTemplatesModule), + typeof(AbpIdentityDomainModule), + typeof(AbpWeChatMiniProgramModule))] +public class AbpAccountApplicationModule : AbpModule { - [DependsOn( - typeof(Volo.Abp.Account.AbpAccountApplicationModule), - typeof(AbpAccountApplicationContractsModule), - typeof(AbpAccountTemplatesModule), - typeof(AbpIdentityDomainModule), - typeof(AbpWeChatMiniProgramModule))] - public class AbpAccountApplicationModule : AbpModule - { - public override void ConfigureServices(ServiceConfigurationContext context) + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => { - Configure(options => - { - options.FileSets.AddEmbedded(); - }); + options.FileSets.AddEmbedded(); + }); - Configure(options => - { - options.Applications["MVC"].Urls[AccountUrlNames.EmailConfirm] = "Account/EmailConfirm"; - }); - } + Configure(options => + { + options.Applications["MVC"].Urls[AccountUrlNames.EmailConfirm] = "Account/EmailConfirm"; + }); } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/AccountAppService.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/AccountAppService.cs index 662b1297d..a22c0e07a 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/AccountAppService.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/AccountAppService.cs @@ -24,366 +24,365 @@ using Volo.Abp.Validation; using IIdentityUserRepository = LINGYUN.Abp.Identity.IIdentityUserRepository; -namespace LINGYUN.Abp.Account +namespace LINGYUN.Abp.Account; + +public class AccountAppService : AccountApplicationServiceBase, IAccountAppService { - public class AccountAppService : AccountApplicationServiceBase, IAccountAppService + protected ITotpService TotpService { get; } + protected IIdentityUserRepository UserRepository { get; } + protected IAccountSmsSecurityCodeSender SecurityCodeSender { get; } + protected IWeChatOpenIdFinder WeChatOpenIdFinder { get; } + protected IdentitySecurityLogManager IdentitySecurityLogManager { get; } + protected AbpWeChatMiniProgramOptionsFactory MiniProgramOptionsFactory { get; } + protected IDistributedCache SecurityTokenCache { get; } + + public AccountAppService( + ITotpService totpService, + IWeChatOpenIdFinder weChatOpenIdFinder, + IIdentityUserRepository userRepository, + IAccountSmsSecurityCodeSender securityCodeSender, + IDistributedCache securityTokenCache, + AbpWeChatMiniProgramOptionsFactory miniProgramOptionsFactory, + IdentitySecurityLogManager identitySecurityLogManager) + { + TotpService = totpService; + UserRepository = userRepository; + WeChatOpenIdFinder = weChatOpenIdFinder; + SecurityCodeSender = securityCodeSender; + SecurityTokenCache = securityTokenCache; + MiniProgramOptionsFactory = miniProgramOptionsFactory; + IdentitySecurityLogManager = identitySecurityLogManager; + } + + public async virtual Task RegisterAsync(WeChatRegisterDto input) { - protected ITotpService TotpService { get; } - protected IIdentityUserRepository UserRepository { get; } - protected IAccountSmsSecurityCodeSender SecurityCodeSender { get; } - protected IWeChatOpenIdFinder WeChatOpenIdFinder { get; } - protected IdentitySecurityLogManager IdentitySecurityLogManager { get; } - protected AbpWeChatMiniProgramOptionsFactory MiniProgramOptionsFactory { get; } - protected IDistributedCache SecurityTokenCache { get; } - - public AccountAppService( - ITotpService totpService, - IWeChatOpenIdFinder weChatOpenIdFinder, - IIdentityUserRepository userRepository, - IAccountSmsSecurityCodeSender securityCodeSender, - IDistributedCache securityTokenCache, - AbpWeChatMiniProgramOptionsFactory miniProgramOptionsFactory, - IdentitySecurityLogManager identitySecurityLogManager) + ThowIfInvalidEmailAddress(input.EmailAddress); + + await CheckSelfRegistrationAsync(); + await IdentityOptions.SetAsync(); + + var options = await MiniProgramOptionsFactory.CreateAsync(); + + var wehchatOpenId = await WeChatOpenIdFinder.FindAsync(input.Code, options.AppId, options.AppSecret); + + var user = await UserManager.FindByLoginAsync(AbpWeChatMiniProgramConsts.ProviderName, wehchatOpenId.OpenId); + if (user != null) { - TotpService = totpService; - UserRepository = userRepository; - WeChatOpenIdFinder = weChatOpenIdFinder; - SecurityCodeSender = securityCodeSender; - SecurityTokenCache = securityTokenCache; - MiniProgramOptionsFactory = miniProgramOptionsFactory; - IdentitySecurityLogManager = identitySecurityLogManager; + // 应该要抛出微信号已注册异常,而不是直接返回注册用户数据,否则造成用户信息泄露 + throw new UserFriendlyException(L["DuplicateWeChat"]); } - - public async virtual Task RegisterAsync(WeChatRegisterDto input) + var userName = input.UserName; + if (userName.IsNullOrWhiteSpace()) + { + userName = "wxid-" + wehchatOpenId.OpenId.ToMd5().ToLower(); + } + + var userEmail = input.EmailAddress;//如果邮件地址不验证,随意写入一个 + if (userEmail.IsNullOrWhiteSpace()) { - ThowIfInvalidEmailAddress(input.EmailAddress); + userEmail = $"{userName}@{CurrentTenant.Name ?? "default"}.io"; + } - await CheckSelfRegistrationAsync(); - await IdentityOptions.SetAsync(); + user = new IdentityUser(GuidGenerator.Create(), userName, userEmail, CurrentTenant.Id); + (await UserManager.CreateAsync(user, input.Password)).CheckErrors(); - var options = await MiniProgramOptionsFactory.CreateAsync(); + (await UserManager.AddDefaultRolesAsync(user)).CheckErrors(); - var wehchatOpenId = await WeChatOpenIdFinder.FindAsync(input.Code, options.AppId, options.AppSecret); + var userLogin = new UserLoginInfo(AbpWeChatMiniProgramConsts.ProviderName, wehchatOpenId.OpenId, AbpWeChatGlobalConsts.DisplayName); + (await UserManager.AddLoginAsync(user, userLogin)).CheckErrors(); - var user = await UserManager.FindByLoginAsync(AbpWeChatMiniProgramConsts.ProviderName, wehchatOpenId.OpenId); - if (user != null) - { - // 应该要抛出微信号已注册异常,而不是直接返回注册用户数据,否则造成用户信息泄露 - throw new UserFriendlyException(L["DuplicateWeChat"]); - } - var userName = input.UserName; - if (userName.IsNullOrWhiteSpace()) - { - userName = "wxid-" + wehchatOpenId.OpenId.ToMd5().ToLower(); - } - - var userEmail = input.EmailAddress;//如果邮件地址不验证,随意写入一个 - if (userEmail.IsNullOrWhiteSpace()) + await IdentitySecurityLogManager.SaveAsync( + new IdentitySecurityLogContext { - userEmail = $"{userName}@{CurrentTenant.Name ?? "default"}.io"; - } - - user = new IdentityUser(GuidGenerator.Create(), userName, userEmail, CurrentTenant.Id); - (await UserManager.CreateAsync(user, input.Password)).CheckErrors(); + Action = "WeChatRegister", + ClientId = await FindClientIdAsync(), + Identity = "Account", + UserName = user.UserName + }); - (await UserManager.AddDefaultRolesAsync(user)).CheckErrors(); - - var userLogin = new UserLoginInfo(AbpWeChatMiniProgramConsts.ProviderName, wehchatOpenId.OpenId, AbpWeChatGlobalConsts.DisplayName); - (await UserManager.AddLoginAsync(user, userLogin)).CheckErrors(); + await CurrentUnitOfWork.SaveChangesAsync(); + } - await IdentitySecurityLogManager.SaveAsync( - new IdentitySecurityLogContext - { - Action = "WeChatRegister", - ClientId = await FindClientIdAsync(), - Identity = "Account", - UserName = user.UserName - }); + public async virtual Task SendPhoneRegisterCodeAsync(SendPhoneRegisterCodeDto input) + { + await CheckSelfRegistrationAsync(); + await CheckNewUserPhoneNumberNotBeUsedAsync(input.PhoneNumber); - await CurrentUnitOfWork.SaveChangesAsync(); - } + var securityTokenCacheKey = SecurityTokenCacheItem.CalculateSmsCacheKey(input.PhoneNumber, "SmsVerifyCode"); + var securityTokenCacheItem = await SecurityTokenCache.GetAsync(securityTokenCacheKey); + var interval = await SettingProvider.GetAsync(IdentitySettingNames.User.SmsRepetInterval, 1); - public async virtual Task SendPhoneRegisterCodeAsync(SendPhoneRegisterCodeDto input) + if (securityTokenCacheItem != null) { - await CheckSelfRegistrationAsync(); - await CheckNewUserPhoneNumberNotBeUsedAsync(input.PhoneNumber); + throw new UserFriendlyException(L["SendRepeatSmsVerifyCode", interval]); + } - var securityTokenCacheKey = SecurityTokenCacheItem.CalculateSmsCacheKey(input.PhoneNumber, "SmsVerifyCode"); - var securityTokenCacheItem = await SecurityTokenCache.GetAsync(securityTokenCacheKey); - var interval = await SettingProvider.GetAsync(IdentitySettingNames.User.SmsRepetInterval, 1); + var template = await SettingProvider.GetOrNullAsync(IdentitySettingNames.User.SmsNewUserRegister); - if (securityTokenCacheItem != null) - { - throw new UserFriendlyException(L["SendRepeatSmsVerifyCode", interval]); - } + // 安全令牌 + var securityToken = GuidGenerator.Create().ToString("N"); - var template = await SettingProvider.GetOrNullAsync(IdentitySettingNames.User.SmsNewUserRegister); + var code = TotpService.GenerateCode(Encoding.Unicode.GetBytes(securityToken), securityTokenCacheKey); + securityTokenCacheItem = new SecurityTokenCacheItem(code.ToString(), securityToken); - // 安全令牌 - var securityToken = GuidGenerator.Create().ToString("N"); + await SecurityCodeSender.SendSmsCodeAsync( + input.PhoneNumber, securityTokenCacheItem.Token, template); - var code = TotpService.GenerateCode(Encoding.Unicode.GetBytes(securityToken), securityTokenCacheKey); - securityTokenCacheItem = new SecurityTokenCacheItem(code.ToString(), securityToken); + await SecurityTokenCache + .SetAsync(securityTokenCacheKey, securityTokenCacheItem, + new DistributedCacheEntryOptions + { + AbsoluteExpiration = DateTimeOffset.Now.AddMinutes(interval) + }); + } - await SecurityCodeSender.SendSmsCodeAsync( - input.PhoneNumber, securityTokenCacheItem.Token, template); + public async virtual Task RegisterAsync(PhoneRegisterDto input) + { + await CheckSelfRegistrationAsync(); + await IdentityOptions.SetAsync(); + await CheckNewUserPhoneNumberNotBeUsedAsync(input.PhoneNumber); - await SecurityTokenCache - .SetAsync(securityTokenCacheKey, securityTokenCacheItem, - new DistributedCacheEntryOptions - { - AbsoluteExpiration = DateTimeOffset.Now.AddMinutes(interval) - }); + var securityTokenCacheKey = SecurityTokenCacheItem.CalculateSmsCacheKey(input.PhoneNumber, "SmsVerifyCode"); + var securityTokenCacheItem = await SecurityTokenCache.GetAsync(securityTokenCacheKey); + if (securityTokenCacheItem == null) + { + // 验证码过期 + throw new UserFriendlyException(L["InvalidVerifyCode"]); } - public async virtual Task RegisterAsync(PhoneRegisterDto input) + // 验证码是否有效 + if (input.Code.Equals(securityTokenCacheItem.Token) && int.TryParse(input.Code, out int token)) { - await CheckSelfRegistrationAsync(); - await IdentityOptions.SetAsync(); - await CheckNewUserPhoneNumberNotBeUsedAsync(input.PhoneNumber); - - var securityTokenCacheKey = SecurityTokenCacheItem.CalculateSmsCacheKey(input.PhoneNumber, "SmsVerifyCode"); - var securityTokenCacheItem = await SecurityTokenCache.GetAsync(securityTokenCacheKey); - if (securityTokenCacheItem == null) - { - // 验证码过期 - throw new UserFriendlyException(L["InvalidVerifyCode"]); - } - - // 验证码是否有效 - if (input.Code.Equals(securityTokenCacheItem.Token) && int.TryParse(input.Code, out int token)) + var securityToken = Encoding.Unicode.GetBytes(securityTokenCacheItem.SecurityToken); + // 校验totp验证码 + if (TotpService.ValidateCode(securityToken, token, securityTokenCacheKey)) { - var securityToken = Encoding.Unicode.GetBytes(securityTokenCacheItem.SecurityToken); - // 校验totp验证码 - if (TotpService.ValidateCode(securityToken, token, securityTokenCacheKey)) + var userEmail = input.EmailAddress ?? $"{input.PhoneNumber}@{CurrentTenant.Name ?? "default"}.io";//如果邮件地址不验证,随意写入一个 + var userName = input.UserName ?? input.PhoneNumber; + var user = new IdentityUser(GuidGenerator.Create(), userName, userEmail, CurrentTenant.Id) { - var userEmail = input.EmailAddress ?? $"{input.PhoneNumber}@{CurrentTenant.Name ?? "default"}.io";//如果邮件地址不验证,随意写入一个 - var userName = input.UserName ?? input.PhoneNumber; - var user = new IdentityUser(GuidGenerator.Create(), userName, userEmail, CurrentTenant.Id) - { - Name = input.Name ?? input.PhoneNumber - }; + Name = input.Name ?? input.PhoneNumber + }; - await UserStore.SetPhoneNumberAsync(user, input.PhoneNumber); - await UserStore.SetPhoneNumberConfirmedAsync(user, true); + await UserStore.SetPhoneNumberAsync(user, input.PhoneNumber); + await UserStore.SetPhoneNumberConfirmedAsync(user, true); - (await UserManager.CreateAsync(user, input.Password)).CheckErrors(); + (await UserManager.CreateAsync(user, input.Password)).CheckErrors(); - (await UserManager.AddDefaultRolesAsync(user)).CheckErrors(); + (await UserManager.AddDefaultRolesAsync(user)).CheckErrors(); - await SecurityTokenCache.RemoveAsync(securityTokenCacheKey); + await SecurityTokenCache.RemoveAsync(securityTokenCacheKey); - await IdentitySecurityLogManager.SaveAsync( - new IdentitySecurityLogContext - { - Action = "PhoneNumberRegister", - ClientId = await FindClientIdAsync(), - Identity = "Account", - UserName = user.UserName - }); + await IdentitySecurityLogManager.SaveAsync( + new IdentitySecurityLogContext + { + Action = "PhoneNumberRegister", + ClientId = await FindClientIdAsync(), + Identity = "Account", + UserName = user.UserName + }); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork.SaveChangesAsync(); - return; - } + return; } - // 验证码无效 - throw new UserFriendlyException(L["InvalidVerifyCode"]); } + // 验证码无效 + throw new UserFriendlyException(L["InvalidVerifyCode"]); + } - public async virtual Task SendPhoneResetPasswordCodeAsync(SendPhoneResetPasswordCodeDto input) + public async virtual Task SendPhoneResetPasswordCodeAsync(SendPhoneResetPasswordCodeDto input) + { + /* + * 注解: 微软的重置密码方法通过 UserManager.GeneratePasswordResetTokenAsync 接口生成密码重置Token + * 而这个Token设计的意义就是用户通过链接来重置密码,所以不适合短信验证 + * 某些企业是把链接生成一个短链发送短信的,不过这种方式不是很推荐,因为现在是真没几个人敢随便点短信链接的 + * + * 此处设计方式为: + * + * step1: 例行检查是否重复发送,这一点是很有必要的 + * step2: 通过已确认的手机号来查询用户,如果用户未确认手机号,那就不能发送,这一点也是很有必要的 + * step3(重点): 通过 UserManager.GenerateTwoFactorTokenAsync 接口来生成二次认证码,这就相当于伪验证码,只是用于确认用户传递的验证码是否通过 + * 比起自己生成随机数,这个验证码利用了TOTP算法,有时间限制的 + * step4(重点): 用户传递验证码后,通过 UserManager.VerifyTwoFactorTokenAsync 接口来校验验证码 + * 验证通过后,再利用 UserManager.GeneratePasswordResetTokenAsync 接口来生成真正的用于重置密码的Token + */ + + // 传递 isConfirmed 用户必须是已确认过手机号的 + var user = await GetUserByPhoneNumberAsync(input.PhoneNumber, isConfirmed: true); + // 外部认证用户不允许修改密码 + if (user.IsExternal) { - /* - * 注解: 微软的重置密码方法通过 UserManager.GeneratePasswordResetTokenAsync 接口生成密码重置Token - * 而这个Token设计的意义就是用户通过链接来重置密码,所以不适合短信验证 - * 某些企业是把链接生成一个短链发送短信的,不过这种方式不是很推荐,因为现在是真没几个人敢随便点短信链接的 - * - * 此处设计方式为: - * - * step1: 例行检查是否重复发送,这一点是很有必要的 - * step2: 通过已确认的手机号来查询用户,如果用户未确认手机号,那就不能发送,这一点也是很有必要的 - * step3(重点): 通过 UserManager.GenerateTwoFactorTokenAsync 接口来生成二次认证码,这就相当于伪验证码,只是用于确认用户传递的验证码是否通过 - * 比起自己生成随机数,这个验证码利用了TOTP算法,有时间限制的 - * step4(重点): 用户传递验证码后,通过 UserManager.VerifyTwoFactorTokenAsync 接口来校验验证码 - * 验证通过后,再利用 UserManager.GeneratePasswordResetTokenAsync 接口来生成真正的用于重置密码的Token - */ - - // 传递 isConfirmed 用户必须是已确认过手机号的 - var user = await GetUserByPhoneNumberAsync(input.PhoneNumber, isConfirmed: true); - // 外部认证用户不允许修改密码 - if (user.IsExternal) - { - throw new BusinessException(code: Volo.Abp.Identity.IdentityErrorCodes.ExternalUserPasswordChange); - } - - var securityTokenCacheKey = SecurityTokenCacheItem.CalculateSmsCacheKey(input.PhoneNumber, "SmsVerifyCode"); - var securityTokenCacheItem = await SecurityTokenCache.GetAsync(securityTokenCacheKey); - var interval = await SettingProvider.GetAsync(IdentitySettingNames.User.SmsRepetInterval, 1); - // 能查询到缓存就是重复发送 - if (securityTokenCacheItem != null) - { - throw new UserFriendlyException(L["SendRepeatSmsVerifyCode", interval]); - } - - var template = await SettingProvider.GetOrNullAsync(IdentitySettingNames.User.SmsResetPassword); - // 生成二次认证码 - var code = await UserManager.GenerateTwoFactorTokenAsync(user, TokenOptions.DefaultPhoneProvider); - // 发送短信验证码 - await SecurityCodeSender.SendSmsCodeAsync(input.PhoneNumber, code, template); - // 缓存这个手机号的记录,防重复 - securityTokenCacheItem = new SecurityTokenCacheItem(code, user.SecurityStamp); - await SecurityTokenCache - .SetAsync(securityTokenCacheKey, securityTokenCacheItem, - new DistributedCacheEntryOptions - { - AbsoluteExpiration = DateTimeOffset.Now.AddMinutes(interval) - }); + throw new BusinessException(code: Volo.Abp.Identity.IdentityErrorCodes.ExternalUserPasswordChange); } - public async virtual Task ResetPasswordAsync(PhoneResetPasswordDto input) + var securityTokenCacheKey = SecurityTokenCacheItem.CalculateSmsCacheKey(input.PhoneNumber, "SmsVerifyCode"); + var securityTokenCacheItem = await SecurityTokenCache.GetAsync(securityTokenCacheKey); + var interval = await SettingProvider.GetAsync(IdentitySettingNames.User.SmsRepetInterval, 1); + // 能查询到缓存就是重复发送 + if (securityTokenCacheItem != null) { - var securityTokenCacheKey = SecurityTokenCacheItem.CalculateSmsCacheKey(input.PhoneNumber, "SmsVerifyCode"); - var securityTokenCacheItem = await SecurityTokenCache.GetAsync(securityTokenCacheKey); - if (securityTokenCacheItem == null) - { - throw new UserFriendlyException(L["InvalidVerifyCode"]); - } - await IdentityOptions.SetAsync(); - // 传递 isConfirmed 用户必须是已确认过手机号的 - var user = await GetUserByPhoneNumberAsync(input.PhoneNumber, isConfirmed: true); - // 外部认证用户不允许修改密码 - if (user.IsExternal) - { - throw new BusinessException(code: Volo.Abp.Identity.IdentityErrorCodes.ExternalUserPasswordChange); - } - // 验证二次认证码 - if (!await UserManager.VerifyTwoFactorTokenAsync(user, TokenOptions.DefaultPhoneProvider, input.Code)) - { - // 验证码无效 - throw new UserFriendlyException(L["InvalidVerifyCode"]); - } - // 生成真正的重置密码Token - var resetPwdToken = await UserManager.GeneratePasswordResetTokenAsync(user); - // 重置密码 - (await UserManager.ResetPasswordAsync(user, resetPwdToken, input.NewPassword)).CheckErrors(); - // 移除缓存项 - await SecurityTokenCache.RemoveAsync(securityTokenCacheKey); - - await IdentitySecurityLogManager.SaveAsync( - new IdentitySecurityLogContext + throw new UserFriendlyException(L["SendRepeatSmsVerifyCode", interval]); + } + + var template = await SettingProvider.GetOrNullAsync(IdentitySettingNames.User.SmsResetPassword); + // 生成二次认证码 + var code = await UserManager.GenerateTwoFactorTokenAsync(user, TokenOptions.DefaultPhoneProvider); + // 发送短信验证码 + await SecurityCodeSender.SendSmsCodeAsync(input.PhoneNumber, code, template); + // 缓存这个手机号的记录,防重复 + securityTokenCacheItem = new SecurityTokenCacheItem(code, user.SecurityStamp); + await SecurityTokenCache + .SetAsync(securityTokenCacheKey, securityTokenCacheItem, + new DistributedCacheEntryOptions { - Action = "ResetPassword", - ClientId = await FindClientIdAsync(), - Identity = "Account", - UserName = user.UserName + AbsoluteExpiration = DateTimeOffset.Now.AddMinutes(interval) }); + } - await CurrentUnitOfWork.SaveChangesAsync(); + public async virtual Task ResetPasswordAsync(PhoneResetPasswordDto input) + { + var securityTokenCacheKey = SecurityTokenCacheItem.CalculateSmsCacheKey(input.PhoneNumber, "SmsVerifyCode"); + var securityTokenCacheItem = await SecurityTokenCache.GetAsync(securityTokenCacheKey); + if (securityTokenCacheItem == null) + { + throw new UserFriendlyException(L["InvalidVerifyCode"]); } - - public async virtual Task SendPhoneSigninCodeAsync(SendPhoneSigninCodeDto input) + await IdentityOptions.SetAsync(); + // 传递 isConfirmed 用户必须是已确认过手机号的 + var user = await GetUserByPhoneNumberAsync(input.PhoneNumber, isConfirmed: true); + // 外部认证用户不允许修改密码 + if (user.IsExternal) { - var securityTokenCacheKey = SecurityTokenCacheItem.CalculateSmsCacheKey(input.PhoneNumber, "SmsVerifyCode"); - var securityTokenCacheItem = await SecurityTokenCache.GetAsync(securityTokenCacheKey); - var interval = await SettingProvider.GetAsync(IdentitySettingNames.User.SmsRepetInterval, 1); - if (securityTokenCacheItem != null) - { - throw new UserFriendlyException(L["SendRepeatSmsVerifyCode", interval]); - } - // 传递 isConfirmed 验证过的用户才允许通过手机登录 - var user = await GetUserByPhoneNumberAsync(input.PhoneNumber, isConfirmed: true); - var code = await UserManager.GenerateTwoFactorTokenAsync(user, TokenOptions.DefaultPhoneProvider); - var template = await SettingProvider.GetOrNullAsync(IdentitySettingNames.User.SmsUserSignin); - - // 发送登录验证码短信 - await SecurityCodeSender.SendSmsCodeAsync(input.PhoneNumber, code, template); - // 缓存登录验证码状态,防止同一手机号重复发送 - securityTokenCacheItem = new SecurityTokenCacheItem(code, user.SecurityStamp); - await SecurityTokenCache - .SetAsync(securityTokenCacheKey, securityTokenCacheItem, - new DistributedCacheEntryOptions - { - AbsoluteExpiration = DateTimeOffset.Now.AddMinutes(interval) - }); + throw new BusinessException(code: Volo.Abp.Identity.IdentityErrorCodes.ExternalUserPasswordChange); } - - public async virtual Task SendEmailSigninCodeAsync(SendEmailSigninCodeDto input) + // 验证二次认证码 + if (!await UserManager.VerifyTwoFactorTokenAsync(user, TokenOptions.DefaultPhoneProvider, input.Code)) { - var sender = LazyServiceProvider.LazyGetRequiredService(); - - var user = await UserManager.FindByEmailAsync(input.EmailAddress); - - if (user == null) - { - throw new UserFriendlyException(L["UserNotRegisterd"]); - } - if (!user.EmailConfirmed) + // 验证码无效 + throw new UserFriendlyException(L["InvalidVerifyCode"]); + } + // 生成真正的重置密码Token + var resetPwdToken = await UserManager.GeneratePasswordResetTokenAsync(user); + // 重置密码 + (await UserManager.ResetPasswordAsync(user, resetPwdToken, input.NewPassword)).CheckErrors(); + // 移除缓存项 + await SecurityTokenCache.RemoveAsync(securityTokenCacheKey); + + await IdentitySecurityLogManager.SaveAsync( + new IdentitySecurityLogContext { - throw new UserFriendlyException(L["UserEmailNotConfirmed"]); - } + Action = "ResetPassword", + ClientId = await FindClientIdAsync(), + Identity = "Account", + UserName = user.UserName + }); - var code = await UserManager.GenerateTwoFactorTokenAsync(user, TokenOptions.DefaultEmailProvider); + await CurrentUnitOfWork.SaveChangesAsync(); + } - await sender.SendMailLoginVerifyCodeAsync(code, user.UserName, user.Email); + public async virtual Task SendPhoneSigninCodeAsync(SendPhoneSigninCodeDto input) + { + var securityTokenCacheKey = SecurityTokenCacheItem.CalculateSmsCacheKey(input.PhoneNumber, "SmsVerifyCode"); + var securityTokenCacheItem = await SecurityTokenCache.GetAsync(securityTokenCacheKey); + var interval = await SettingProvider.GetAsync(IdentitySettingNames.User.SmsRepetInterval, 1); + if (securityTokenCacheItem != null) + { + throw new UserFriendlyException(L["SendRepeatSmsVerifyCode", interval]); } + // 传递 isConfirmed 验证过的用户才允许通过手机登录 + var user = await GetUserByPhoneNumberAsync(input.PhoneNumber, isConfirmed: true); + var code = await UserManager.GenerateTwoFactorTokenAsync(user, TokenOptions.DefaultPhoneProvider); + var template = await SettingProvider.GetOrNullAsync(IdentitySettingNames.User.SmsUserSignin); + + // 发送登录验证码短信 + await SecurityCodeSender.SendSmsCodeAsync(input.PhoneNumber, code, template); + // 缓存登录验证码状态,防止同一手机号重复发送 + securityTokenCacheItem = new SecurityTokenCacheItem(code, user.SecurityStamp); + await SecurityTokenCache + .SetAsync(securityTokenCacheKey, securityTokenCacheItem, + new DistributedCacheEntryOptions + { + AbsoluteExpiration = DateTimeOffset.Now.AddMinutes(interval) + }); + } - public async virtual Task> GetTwoFactorProvidersAsync(GetTwoFactorProvidersInput input) - { - var user = await UserManager.GetByIdAsync(input.UserId); + public async virtual Task SendEmailSigninCodeAsync(SendEmailSigninCodeDto input) + { + var sender = LazyServiceProvider.LazyGetRequiredService(); - var userFactors = await UserManager.GetValidTwoFactorProvidersAsync(user); - return new ListResultDto( - userFactors.Select(key => new NameValue(L[$"TwoFactor:{key}"].Value, key)).ToList()); - } + var user = await UserManager.FindByEmailAsync(input.EmailAddress); - protected async virtual Task GetUserByPhoneNumberAsync(string phoneNumber, bool isConfirmed = true) + if (user == null) { - var user = await UserRepository.FindByPhoneNumberAsync(phoneNumber, isConfirmed, true); - if (user == null) - { - throw new UserFriendlyException(L["PhoneNumberNotRegisterd"]); - } - return user; + throw new UserFriendlyException(L["UserNotRegisterd"]); } - - /// - /// 检查是否允许用户注册 - /// - /// - protected async virtual Task CheckSelfRegistrationAsync() + if (!user.EmailConfirmed) { - if (!await SettingProvider.IsTrueAsync(Volo.Abp.Account.Settings.AccountSettingNames.IsSelfRegistrationEnabled)) - { - throw new UserFriendlyException(L["SelfRegistrationDisabledMessage"]); - } + throw new UserFriendlyException(L["UserEmailNotConfirmed"]); } - protected async virtual Task CheckNewUserPhoneNumberNotBeUsedAsync(string phoneNumber) + var code = await UserManager.GenerateTwoFactorTokenAsync(user, TokenOptions.DefaultEmailProvider); + + await sender.SendMailLoginVerifyCodeAsync(code, user.UserName, user.Email); + } + + public async virtual Task> GetTwoFactorProvidersAsync(GetTwoFactorProvidersInput input) + { + var user = await UserManager.GetByIdAsync(input.UserId); + + var userFactors = await UserManager.GetValidTwoFactorProvidersAsync(user); + return new ListResultDto( + userFactors.Select(key => new NameValue(L[$"TwoFactor:{key}"].Value, key)).ToList()); + } + + protected async virtual Task GetUserByPhoneNumberAsync(string phoneNumber, bool isConfirmed = true) + { + var user = await UserRepository.FindByPhoneNumberAsync(phoneNumber, isConfirmed, true); + if (user == null) { - if (await UserRepository.IsPhoneNumberUedAsync(phoneNumber)) - { - throw new UserFriendlyException(L["DuplicatePhoneNumber"]); - } + throw new UserFriendlyException(L["PhoneNumberNotRegisterd"]); } + return user; + } - protected virtual Task FindClientIdAsync() + /// + /// 检查是否允许用户注册 + /// + /// + protected async virtual Task CheckSelfRegistrationAsync() + { + if (!await SettingProvider.IsTrueAsync(Volo.Abp.Account.Settings.AccountSettingNames.IsSelfRegistrationEnabled)) { - var client = LazyServiceProvider.LazyGetRequiredService(); + throw new UserFriendlyException(L["SelfRegistrationDisabledMessage"]); + } + } - return Task.FromResult(client.Id); + protected async virtual Task CheckNewUserPhoneNumberNotBeUsedAsync(string phoneNumber) + { + if (await UserRepository.IsPhoneNumberUedAsync(phoneNumber)) + { + throw new UserFriendlyException(L["DuplicatePhoneNumber"]); } + } + + protected virtual Task FindClientIdAsync() + { + var client = LazyServiceProvider.LazyGetRequiredService(); + + return Task.FromResult(client.Id); + } - private void ThowIfInvalidEmailAddress(string inputEmail) + private void ThowIfInvalidEmailAddress(string inputEmail) + { + if (!inputEmail.IsNullOrWhiteSpace() && + !ValidationHelper.IsValidEmailAddress(inputEmail)) { - if (!inputEmail.IsNullOrWhiteSpace() && - !ValidationHelper.IsValidEmailAddress(inputEmail)) - { - throw new AbpValidationException( - new ValidationResult[] - { - new ValidationResult(L["The {0} field is not a valid e-mail address.", L["DisplayName:EmailAddress"]], new string[]{ "EmailAddress" }) - }); - } + throw new AbpValidationException( + new ValidationResult[] + { + new ValidationResult(L["The {0} field is not a valid e-mail address.", L["DisplayName:EmailAddress"]], new string[]{ "EmailAddress" }) + }); } } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/AccountApplicationServiceBase.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/AccountApplicationServiceBase.cs index a094887cf..73b94a953 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/AccountApplicationServiceBase.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/AccountApplicationServiceBase.cs @@ -6,24 +6,23 @@ using Volo.Abp.Identity; using Volo.Abp.Users; -namespace LINGYUN.Abp.Account +namespace LINGYUN.Abp.Account; + +public abstract class AccountApplicationServiceBase : ApplicationService { - public abstract class AccountApplicationServiceBase : ApplicationService - { - protected IOptions IdentityOptions => LazyServiceProvider.LazyGetRequiredService>(); - protected IdentityUserStore UserStore => LazyServiceProvider.LazyGetRequiredService(); - protected IdentityUserManager UserManager => LazyServiceProvider.LazyGetRequiredService(); + protected IOptions IdentityOptions => LazyServiceProvider.LazyGetRequiredService>(); + protected IdentityUserStore UserStore => LazyServiceProvider.LazyGetRequiredService(); + protected IdentityUserManager UserManager => LazyServiceProvider.LazyGetRequiredService(); - protected AccountApplicationServiceBase() - { - LocalizationResource = typeof(AccountResource); - } + protected AccountApplicationServiceBase() + { + LocalizationResource = typeof(AccountResource); + } - protected async virtual Task GetCurrentUserAsync() - { - await IdentityOptions.SetAsync(); + protected async virtual Task GetCurrentUserAsync() + { + await IdentityOptions.SetAsync(); - return await UserManager.GetByIdAsync(CurrentUser.GetId()); - } + return await UserManager.GetByIdAsync(CurrentUser.GetId()); } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/IAccountSmsSecurityCodeSender.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/IAccountSmsSecurityCodeSender.cs index e4b31e783..d5c89d474 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/IAccountSmsSecurityCodeSender.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/IAccountSmsSecurityCodeSender.cs @@ -1,14 +1,13 @@ using System.Threading; using System.Threading.Tasks; -namespace LINGYUN.Abp.Account +namespace LINGYUN.Abp.Account; + +public interface IAccountSmsSecurityCodeSender { - public interface IAccountSmsSecurityCodeSender - { - Task SendSmsCodeAsync( - string phone, - string token, - string template, // 传递模板号 - CancellationToken cancellation = default); - } + Task SendSmsCodeAsync( + string phone, + string token, + string template, // 传递模板号 + CancellationToken cancellation = default); } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/MyClaimAppService.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/MyClaimAppService.cs index 06665eb59..1c47aeb37 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/MyClaimAppService.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/MyClaimAppService.cs @@ -7,57 +7,56 @@ using System.Threading.Tasks; using Volo.Abp.Security.Claims; -namespace LINGYUN.Abp.Account +namespace LINGYUN.Abp.Account; + +[Authorize] +public class MyClaimAppService : AccountApplicationServiceBase, IMyClaimAppService { - [Authorize] - public class MyClaimAppService : AccountApplicationServiceBase, IMyClaimAppService + public MyClaimAppService() { - public MyClaimAppService() - { - } + } - public async virtual Task ChangeAvatarAsync(ChangeAvatarInput input) - { - var user = await GetCurrentUserAsync(); + public async virtual Task ChangeAvatarAsync(ChangeAvatarInput input) + { + var user = await GetCurrentUserAsync(); - // TODO: Use AbpClaimTypes.Picture - user.Claims.RemoveAll(x => x.ClaimType.Equals(IdentityConsts.ClaimType.Avatar.Name)); - user.AddClaim(GuidGenerator, new Claim(IdentityConsts.ClaimType.Avatar.Name, input.AvatarUrl)); + // TODO: Use AbpClaimTypes.Picture + user.Claims.RemoveAll(x => x.ClaimType.Equals(IdentityConsts.ClaimType.Avatar.Name)); + user.AddClaim(GuidGenerator, new Claim(IdentityConsts.ClaimType.Avatar.Name, input.AvatarUrl)); - var avatarClaims = user.Claims.Where(x => x.ClaimType.StartsWith(AbpClaimTypes.Picture)) - .Select(x => x.ToClaim()) - .Skip(0) - .Take(3) - .ToList(); - if (avatarClaims.Any()) - { - // 保留最多3个头像 - if (avatarClaims.Count >= 3) - { - user.RemoveClaim(avatarClaims.First()); - avatarClaims.RemoveAt(0); - } + var avatarClaims = user.Claims.Where(x => x.ClaimType.StartsWith(AbpClaimTypes.Picture)) + .Select(x => x.ToClaim()) + .Skip(0) + .Take(3) + .ToList(); + if (avatarClaims.Any()) + { + // 保留最多3个头像 + if (avatarClaims.Count >= 3) + { + user.RemoveClaim(avatarClaims.First()); + avatarClaims.RemoveAt(0); + } - // 历史头像加数字标识 - for (var index = 1; index <= avatarClaims.Count; index++) + // 历史头像加数字标识 + for (var index = 1; index <= avatarClaims.Count; index++) + { + var avatarClaim = avatarClaims[index - 1]; + var findClaim = user.FindClaim(avatarClaim); + if (findClaim != null) { - var avatarClaim = avatarClaims[index - 1]; - var findClaim = user.FindClaim(avatarClaim); - if (findClaim != null) - { - findClaim.SetClaim(new Claim( - AbpClaimTypes.Picture + index.ToString(), - findClaim.ClaimValue)); - } + findClaim.SetClaim(new Claim( + AbpClaimTypes.Picture + index.ToString(), + findClaim.ClaimValue)); } } + } - user.AddClaim(GuidGenerator, new Claim(AbpClaimTypes.Picture, input.AvatarUrl)); + user.AddClaim(GuidGenerator, new Claim(AbpClaimTypes.Picture, input.AvatarUrl)); - (await UserManager.UpdateAsync(user)).CheckErrors(); + (await UserManager.UpdateAsync(user)).CheckErrors(); - await CurrentUnitOfWork.SaveChangesAsync(); - } + await CurrentUnitOfWork.SaveChangesAsync(); } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/MyProfileAppService.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/MyProfileAppService.cs index 95fdef851..fc9e32a5f 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/MyProfileAppService.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/MyProfileAppService.cs @@ -1,261 +1,295 @@ using LINGYUN.Abp.Account.Emailing; using LINGYUN.Abp.Identity; using LINGYUN.Abp.Identity.Security; +using LINGYUN.Abp.Identity.Session; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Identity; using Microsoft.Extensions.Caching.Distributed; using Microsoft.Extensions.Options; using System; +using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Volo.Abp; using Volo.Abp.Account.Localization; +using Volo.Abp.Application.Dtos; using Volo.Abp.Caching; using Volo.Abp.Data; using Volo.Abp.Identity; using Volo.Abp.Settings; using Volo.Abp.Users; +using IIdentitySessionRepository = LINGYUN.Abp.Identity.IIdentitySessionRepository; -namespace LINGYUN.Abp.Account +namespace LINGYUN.Abp.Account; + +[Authorize] +public class MyProfileAppService : AccountApplicationServiceBase, IMyProfileAppService { - [Authorize] - public class MyProfileAppService : AccountApplicationServiceBase, IMyProfileAppService + protected IDistributedCache SecurityTokenCache { get; } + protected IAccountSmsSecurityCodeSender SecurityCodeSender { get; } + protected Identity.IIdentityUserRepository UserRepository { get; } + protected IdentitySecurityLogManager IdentitySecurityLogManager { get; } + protected IAuthenticatorUriGenerator AuthenticatorUriGenerator => LazyServiceProvider.LazyGetRequiredService(); + + protected IIdentitySessionManager IdentitySessionManager => LazyServiceProvider.LazyGetRequiredService(); + protected IIdentitySessionRepository IdentitySessionRepository => LazyServiceProvider.LazyGetRequiredService(); + + public MyProfileAppService( + Identity.IIdentityUserRepository userRepository, + IAccountSmsSecurityCodeSender securityCodeSender, + IdentitySecurityLogManager identitySecurityLogManager, + IDistributedCache securityTokenCache) { - protected IDistributedCache SecurityTokenCache { get; } - protected IAccountSmsSecurityCodeSender SecurityCodeSender { get; } - protected Identity.IIdentityUserRepository UserRepository { get; } - protected IdentitySecurityLogManager IdentitySecurityLogManager { get; } - protected IAuthenticatorUriGenerator AuthenticatorUriGenerator => LazyServiceProvider.LazyGetRequiredService(); - - public MyProfileAppService( - Identity.IIdentityUserRepository userRepository, - IAccountSmsSecurityCodeSender securityCodeSender, - IdentitySecurityLogManager identitySecurityLogManager, - IDistributedCache securityTokenCache) - { - UserRepository = userRepository; - SecurityCodeSender = securityCodeSender; - IdentitySecurityLogManager = identitySecurityLogManager; - SecurityTokenCache = securityTokenCache; + UserRepository = userRepository; + SecurityCodeSender = securityCodeSender; + IdentitySecurityLogManager = identitySecurityLogManager; + SecurityTokenCache = securityTokenCache; - LocalizationResource = typeof(AccountResource); - } - - public async virtual Task GetTwoFactorEnabledAsync() - { - var user = await GetCurrentUserAsync(); + LocalizationResource = typeof(AccountResource); + } - return new TwoFactorEnabledDto + public async virtual Task> GetSessionsAsync(GetMySessionsInput input) + { + var user = await GetCurrentUserAsync(); + var totalCount = await IdentitySessionRepository.GetCountAsync( + user.Id, input.Device, input.ClientId); + var identitySessions = await IdentitySessionRepository.GetListAsync( + input.Sorting, input.MaxResultCount, input.SkipCount, + user.Id, input.Device, input.ClientId); + + return new PagedResultDto(totalCount, + identitySessions.Select(session => new IdentitySessionDto { - Enabled = await UserManager.GetTwoFactorEnabledAsync(user), - }; - } + Id = session.Id, + SessionId = session.SessionId, + SignedIn = session.SignedIn, + ClientId = session.ClientId, + Device = session.Device, + DeviceInfo = session.DeviceInfo, + IpAddresses = session.IpAddresses, + LastAccessed = session.LastAccessed, + }).ToList()); + } - public async virtual Task ChangeTwoFactorEnabledAsync(TwoFactorEnabledDto input) + public async virtual Task RevokeSessionAsync(string sessionId) + { + await IdentitySessionManager.RevokeSessionAsync(sessionId); + } + + public async virtual Task GetTwoFactorEnabledAsync() + { + var user = await GetCurrentUserAsync(); + + return new TwoFactorEnabledDto { - // Removed See: https://github.com/abpframework/abp/pull/7719 - //if (!await SettingProvider.IsTrueAsync(IdentitySettingNames.TwoFactor.UsersCanChange)) - //{ - // throw new BusinessException(Volo.Abp.Identity.IdentityErrorCodes.CanNotChangeTwoFactor); - //} - // TODO: Abp官方移除了双因素的设置,不排除以后会增加,如果在用户接口中启用了双因素认证,可能造成登录失败! - var user = await GetCurrentUserAsync(); + Enabled = await UserManager.GetTwoFactorEnabledAsync(user), + }; + } - (await UserManager.SetTwoFactorEnabledWithAccountConfirmedAsync(user, input.Enabled)).CheckErrors(); + public async virtual Task ChangeTwoFactorEnabledAsync(TwoFactorEnabledDto input) + { + // Removed See: https://github.com/abpframework/abp/pull/7719 + //if (!await SettingProvider.IsTrueAsync(IdentitySettingNames.TwoFactor.UsersCanChange)) + //{ + // throw new BusinessException(Volo.Abp.Identity.IdentityErrorCodes.CanNotChangeTwoFactor); + //} + // TODO: Abp官方移除了双因素的设置,不排除以后会增加,如果在用户接口中启用了双因素认证,可能造成登录失败! + var user = await GetCurrentUserAsync(); - await CurrentUnitOfWork.SaveChangesAsync(); - } + (await UserManager.SetTwoFactorEnabledWithAccountConfirmedAsync(user, input.Enabled)).CheckErrors(); - public async virtual Task SendChangePhoneNumberCodeAsync(SendChangePhoneNumberCodeInput input) - { - var securityTokenCacheKey = SecurityTokenCacheItem.CalculateSmsCacheKey(input.NewPhoneNumber, "SmsChangePhoneNumber"); - var securityTokenCacheItem = await SecurityTokenCache.GetAsync(securityTokenCacheKey); - var interval = await SettingProvider.GetAsync(Identity.Settings.IdentitySettingNames.User.SmsRepetInterval, 1); - if (securityTokenCacheItem != null) - { - throw new UserFriendlyException(L["SendRepeatPhoneVerifyCode", interval]); - } + await CurrentUnitOfWork.SaveChangesAsync(); + } - // 是否已有用户使用手机号绑定 - if (await UserRepository.IsPhoneNumberConfirmedAsync(input.NewPhoneNumber)) - { - throw new BusinessException(Identity.IdentityErrorCodes.DuplicatePhoneNumber); - } - var user = await GetCurrentUserAsync(); - - var template = await SettingProvider.GetOrNullAsync(Identity.Settings.IdentitySettingNames.User.SmsPhoneNumberConfirmed); - var token = await UserManager.GenerateChangePhoneNumberTokenAsync(user, input.NewPhoneNumber); - // 发送验证码 - await SecurityCodeSender.SendSmsCodeAsync(input.NewPhoneNumber, token, template); - - securityTokenCacheItem = new SecurityTokenCacheItem(token, user.ConcurrencyStamp); - await SecurityTokenCache - .SetAsync(securityTokenCacheKey, securityTokenCacheItem, - new DistributedCacheEntryOptions - { - AbsoluteExpiration = DateTimeOffset.Now.AddMinutes(interval) - }); + public async virtual Task SendChangePhoneNumberCodeAsync(SendChangePhoneNumberCodeInput input) + { + var securityTokenCacheKey = SecurityTokenCacheItem.CalculateSmsCacheKey(input.NewPhoneNumber, "SmsChangePhoneNumber"); + var securityTokenCacheItem = await SecurityTokenCache.GetAsync(securityTokenCacheKey); + var interval = await SettingProvider.GetAsync(Identity.Settings.IdentitySettingNames.User.SmsRepetInterval, 1); + if (securityTokenCacheItem != null) + { + throw new UserFriendlyException(L["SendRepeatPhoneVerifyCode", interval]); } - public async virtual Task ChangePhoneNumberAsync(ChangePhoneNumberInput input) + // 是否已有用户使用手机号绑定 + if (await UserRepository.IsPhoneNumberConfirmedAsync(input.NewPhoneNumber)) { - // 是否已有用户使用手机号绑定 - if (await UserRepository.IsPhoneNumberConfirmedAsync(input.NewPhoneNumber)) - { - throw new BusinessException(Identity.IdentityErrorCodes.DuplicatePhoneNumber); - } - var user = await GetCurrentUserAsync(); - // 更换手机号 - (await UserManager.ChangePhoneNumberAsync(user, input.NewPhoneNumber, input.Code)).CheckErrors(); + throw new BusinessException(Identity.IdentityErrorCodes.DuplicatePhoneNumber); + } + var user = await GetCurrentUserAsync(); - await CurrentUnitOfWork.SaveChangesAsync(); + var template = await SettingProvider.GetOrNullAsync(Identity.Settings.IdentitySettingNames.User.SmsPhoneNumberConfirmed); + var token = await UserManager.GenerateChangePhoneNumberTokenAsync(user, input.NewPhoneNumber); + // 发送验证码 + await SecurityCodeSender.SendSmsCodeAsync(input.NewPhoneNumber, token, template); - var securityTokenCacheKey = SecurityTokenCacheItem.CalculateSmsCacheKey(input.NewPhoneNumber, "SmsChangePhoneNumber"); - await SecurityTokenCache.RemoveAsync(securityTokenCacheKey); - } + securityTokenCacheItem = new SecurityTokenCacheItem(token, user.ConcurrencyStamp); + await SecurityTokenCache + .SetAsync(securityTokenCacheKey, securityTokenCacheItem, + new DistributedCacheEntryOptions + { + AbsoluteExpiration = DateTimeOffset.Now.AddMinutes(interval) + }); + } - public async virtual Task SendEmailConfirmLinkAsync(SendEmailConfirmCodeDto input) + public async virtual Task ChangePhoneNumberAsync(ChangePhoneNumberInput input) + { + // 是否已有用户使用手机号绑定 + if (await UserRepository.IsPhoneNumberConfirmedAsync(input.NewPhoneNumber)) { - var user = await UserManager.FindByEmailAsync(input.Email); + throw new BusinessException(Identity.IdentityErrorCodes.DuplicatePhoneNumber); + } + var user = await GetCurrentUserAsync(); + // 更换手机号 + (await UserManager.ChangePhoneNumberAsync(user, input.NewPhoneNumber, input.Code)).CheckErrors(); - if (user == null) - { - throw new UserFriendlyException(L["Volo.Account:InvalidEmailAddress", input.Email]); - } + await CurrentUnitOfWork.SaveChangesAsync(); - if (user.EmailConfirmed) - { - throw new BusinessException(Identity.IdentityErrorCodes.DuplicateConfirmEmailAddress); - } - - var token = await UserManager.GenerateEmailConfirmationTokenAsync(user); - var sender = LazyServiceProvider.LazyGetRequiredService(); - - await sender.SendEmailConfirmLinkAsync( - user, - token, - input.AppName, - input.ReturnUrl, - input.ReturnUrlHash); + var securityTokenCacheKey = SecurityTokenCacheItem.CalculateSmsCacheKey(input.NewPhoneNumber, "SmsChangePhoneNumber"); + await SecurityTokenCache.RemoveAsync(securityTokenCacheKey); + } + + public async virtual Task SendEmailConfirmLinkAsync(SendEmailConfirmCodeDto input) + { + var user = await UserManager.FindByEmailAsync(input.Email); + + if (user == null) + { + throw new UserFriendlyException(L["Volo.Account:InvalidEmailAddress", input.Email]); } - public async virtual Task ConfirmEmailAsync(ConfirmEmailInput input) + if (user.EmailConfirmed) { - await IdentityOptions.SetAsync(); + throw new BusinessException(Identity.IdentityErrorCodes.DuplicateConfirmEmailAddress); + } - var user = await UserManager.GetByIdAsync(CurrentUser.GetId()); + var token = await UserManager.GenerateEmailConfirmationTokenAsync(user); + var sender = LazyServiceProvider.LazyGetRequiredService(); - (await UserManager.ConfirmEmailAsync(user, input.ConfirmToken)).CheckErrors(); + await sender.SendEmailConfirmLinkAsync( + user, + token, + input.AppName, + input.ReturnUrl, + input.ReturnUrlHash); + } - await IdentitySecurityLogManager.SaveAsync(new IdentitySecurityLogContext - { - Identity = IdentitySecurityLogIdentityConsts.Identity, - Action = "ConfirmEmail" - }); - } + public async virtual Task ConfirmEmailAsync(ConfirmEmailInput input) + { + await IdentityOptions.SetAsync(); - public async virtual Task GetAuthenticator() - { - await IdentityOptions.SetAsync(); + var user = await UserManager.GetByIdAsync(CurrentUser.GetId()); - var user = await UserManager.GetByIdAsync(CurrentUser.GetId()); + (await UserManager.ConfirmEmailAsync(user, input.ConfirmToken)).CheckErrors(); - var hasAuthenticatorEnabled = user.GetProperty(UserManager.Options.Tokens.AuthenticatorTokenProvider, false); - if (hasAuthenticatorEnabled) - { - return new AuthenticatorDto - { - IsAuthenticated = true, - }; - } + await IdentitySecurityLogManager.SaveAsync(new IdentitySecurityLogContext + { + Identity = IdentitySecurityLogIdentityConsts.Identity, + Action = "ConfirmEmail" + }); + } - var userEmail = await UserManager.GetEmailAsync(user); - var unformattedKey = await UserManager.GetAuthenticatorKeyAsync(user); - if (string.IsNullOrEmpty(unformattedKey)) - { - await UserManager.ResetAuthenticatorKeyAsync(user); - unformattedKey = await UserManager.GetAuthenticatorKeyAsync(user); - } + public async virtual Task GetAuthenticator() + { + await IdentityOptions.SetAsync(); - var authenticatorUri = AuthenticatorUriGenerator.Generate(userEmail, unformattedKey); + var user = await UserManager.GetByIdAsync(CurrentUser.GetId()); + var hasAuthenticatorEnabled = user.GetProperty(UserManager.Options.Tokens.AuthenticatorTokenProvider, false); + if (hasAuthenticatorEnabled) + { return new AuthenticatorDto { - SharedKey = FormatKey(unformattedKey), - AuthenticatorUri = authenticatorUri, + IsAuthenticated = true, }; } - public async virtual Task VerifyAuthenticatorCode(VerifyAuthenticatorCodeInput input) + var userEmail = await UserManager.GetEmailAsync(user); + var unformattedKey = await UserManager.GetAuthenticatorKeyAsync(user); + if (string.IsNullOrEmpty(unformattedKey)) { - await IdentityOptions.SetAsync(); + await UserManager.ResetAuthenticatorKeyAsync(user); + unformattedKey = await UserManager.GetAuthenticatorKeyAsync(user); + } - var user = await UserManager.GetByIdAsync(CurrentUser.GetId()); + var authenticatorUri = AuthenticatorUriGenerator.Generate(userEmail, unformattedKey); - var tokenValid = await UserManager.VerifyTwoFactorTokenAsync(user, - UserManager.Options.Tokens.AuthenticatorTokenProvider, input.AuthenticatorCode); - if (!tokenValid) - { - throw new BusinessException(Identity.IdentityErrorCodes.AuthenticatorTokenInValid); - } + return new AuthenticatorDto + { + SharedKey = FormatKey(unformattedKey), + AuthenticatorUri = authenticatorUri, + }; + } - var recoveryCodes = await UserManager.GenerateNewTwoFactorRecoveryCodesAsync(user, 10); + public async virtual Task VerifyAuthenticatorCode(VerifyAuthenticatorCodeInput input) + { + await IdentityOptions.SetAsync(); - user.SetProperty(UserManager.Options.Tokens.AuthenticatorTokenProvider, true); + var user = await UserManager.GetByIdAsync(CurrentUser.GetId()); - await UserStore.ReplaceCodesAsync(user, recoveryCodes); + var tokenValid = await UserManager.VerifyTwoFactorTokenAsync(user, + UserManager.Options.Tokens.AuthenticatorTokenProvider, input.AuthenticatorCode); + if (!tokenValid) + { + throw new BusinessException(Identity.IdentityErrorCodes.AuthenticatorTokenInValid); + } - (await UserManager.UpdateAsync(user)).CheckErrors(); + var recoveryCodes = await UserManager.GenerateNewTwoFactorRecoveryCodesAsync(user, 10); - await CurrentUnitOfWork.SaveChangesAsync(); + user.SetProperty(UserManager.Options.Tokens.AuthenticatorTokenProvider, true); - return new AuthenticatorRecoveryCodeDto - { - RecoveryCodes = recoveryCodes.ToList(), - }; - } + await UserStore.ReplaceCodesAsync(user, recoveryCodes); - public async virtual Task ResetAuthenticator() - { - await IdentityOptions.SetAsync(); + (await UserManager.UpdateAsync(user)).CheckErrors(); - var user = await UserManager.GetByIdAsync(CurrentUser.GetId()); + await CurrentUnitOfWork.SaveChangesAsync(); - user.RemoveProperty(UserManager.Options.Tokens.AuthenticatorTokenProvider); + return new AuthenticatorRecoveryCodeDto + { + RecoveryCodes = recoveryCodes.ToList(), + }; + } - await UserManager.ResetAuthenticatorKeyAsync(user); - await UserStore.ReplaceCodesAsync(user, new string[0]); + public async virtual Task ResetAuthenticator() + { + await IdentityOptions.SetAsync(); - var validTwoFactorProviders = await UserManager.GetValidTwoFactorProvidersAsync(user); - if (!validTwoFactorProviders - .Where(provider => provider != UserManager.Options.Tokens.AuthenticatorTokenProvider) - .Any()) - { - // 如果用户没有任何双因素认证提供程序,则禁用二次认证,否则将造成无法登录 - await UserManager.SetTwoFactorEnabledAsync(user, false); - } + var user = await UserManager.GetByIdAsync(CurrentUser.GetId()); - (await UserManager.UpdateAsync(user)).CheckErrors(); + user.RemoveProperty(UserManager.Options.Tokens.AuthenticatorTokenProvider); - await CurrentUnitOfWork.SaveChangesAsync(); - } + await UserManager.ResetAuthenticatorKeyAsync(user); + await UserStore.ReplaceCodesAsync(user, new string[0]); - private static string FormatKey(string unformattedKey) + var validTwoFactorProviders = await UserManager.GetValidTwoFactorProvidersAsync(user); + if (!validTwoFactorProviders + .Where(provider => provider != UserManager.Options.Tokens.AuthenticatorTokenProvider) + .Any()) { - var result = new StringBuilder(); - var currentPosition = 0; - while (currentPosition + 4 < unformattedKey.Length) - { - result.Append(unformattedKey.AsSpan(currentPosition, 4)).Append(' '); - currentPosition += 4; - } - if (currentPosition < unformattedKey.Length) - { - result.Append(unformattedKey.AsSpan(currentPosition)); - } + // 如果用户没有任何双因素认证提供程序,则禁用二次认证,否则将造成无法登录 + await UserManager.SetTwoFactorEnabledAsync(user, false); + } + + (await UserManager.UpdateAsync(user)).CheckErrors(); + + await CurrentUnitOfWork.SaveChangesAsync(); + } - return result.ToString().ToLowerInvariant(); + private static string FormatKey(string unformattedKey) + { + var result = new StringBuilder(); + var currentPosition = 0; + while (currentPosition + 4 < unformattedKey.Length) + { + result.Append(unformattedKey.AsSpan(currentPosition, 4)).Append(' '); + currentPosition += 4; } + if (currentPosition < unformattedKey.Length) + { + result.Append(unformattedKey.AsSpan(currentPosition)); + } + + return result.ToString().ToLowerInvariant(); } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN.Abp.Account.HttpApi.csproj b/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN.Abp.Account.HttpApi.csproj index b78757b8e..e611dc7a6 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN.Abp.Account.HttpApi.csproj +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN.Abp.Account.HttpApi.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.Account.HttpApi + LINGYUN.Abp.Account.HttpApi + false + false + false diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN/Abp/Account/AbpAccountHttpApiModule.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN/Abp/Account/AbpAccountHttpApiModule.cs index 66ae75ed2..89b6e45cb 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN/Abp/Account/AbpAccountHttpApiModule.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN/Abp/Account/AbpAccountHttpApiModule.cs @@ -3,26 +3,25 @@ using Volo.Abp.AspNetCore.Mvc.Localization; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.Account +namespace LINGYUN.Abp.Account; + +[DependsOn( + typeof(AbpAccountApplicationContractsModule), + typeof(Volo.Abp.Account.AbpAccountHttpApiModule))] +public class AbpAccountHttpApiModule : AbpModule { - [DependsOn( - typeof(AbpAccountApplicationContractsModule), - typeof(Volo.Abp.Account.AbpAccountHttpApiModule))] - public class AbpAccountHttpApiModule : AbpModule + public override void PreConfigureServices(ServiceConfigurationContext context) { - public override void PreConfigureServices(ServiceConfigurationContext context) + PreConfigure(options => { - PreConfigure(options => - { - options.AddAssemblyResource(typeof(AccountResource), typeof(AbpAccountApplicationContractsModule).Assembly); - // 原生的在Web项目指定,不没有引用Web项目的情况下需要它 - options.AddAssemblyResource(typeof(AccountResource), typeof(Volo.Abp.Account.AbpAccountApplicationContractsModule).Assembly); - }); + options.AddAssemblyResource(typeof(AccountResource), typeof(AbpAccountApplicationContractsModule).Assembly); + // 原生的在Web项目指定,不没有引用Web项目的情况下需要它 + options.AddAssemblyResource(typeof(AccountResource), typeof(Volo.Abp.Account.AbpAccountApplicationContractsModule).Assembly); + }); - PreConfigure(mvcBuilder => - { - mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpAccountHttpApiModule).Assembly); - }); - } + PreConfigure(mvcBuilder => + { + mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpAccountHttpApiModule).Assembly); + }); } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN/Abp/Account/AccountController.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN/Abp/Account/AccountController.cs index bb992283f..39b222546 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN/Abp/Account/AccountController.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN/Abp/Account/AccountController.cs @@ -5,74 +5,73 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.AspNetCore.Mvc; -namespace LINGYUN.Abp.Account +namespace LINGYUN.Abp.Account; + +[RemoteService(Name = AccountRemoteServiceConsts.RemoteServiceName)] +[Area("account")] +[Route("api/account")] +public class AccountController : AbpControllerBase, IAccountAppService { - [RemoteService(Name = AccountRemoteServiceConsts.RemoteServiceName)] - [Area("account")] - [Route("api/account")] - public class AccountController : AbpControllerBase, IAccountAppService + protected IAccountAppService AccountAppService { get; } + public AccountController( + IAccountAppService accountAppService) { - protected IAccountAppService AccountAppService { get; } - public AccountController( - IAccountAppService accountAppService) - { - AccountAppService = accountAppService; - } + AccountAppService = accountAppService; + } - [HttpPost] - [Route("wechat/register")] - public async virtual Task RegisterAsync(WeChatRegisterDto input) - { - await AccountAppService.RegisterAsync(input); - } + [HttpPost] + [Route("wechat/register")] + public async virtual Task RegisterAsync(WeChatRegisterDto input) + { + await AccountAppService.RegisterAsync(input); + } - [HttpPost] - [Route("phone/register")] - public async virtual Task RegisterAsync(PhoneRegisterDto input) - { - await AccountAppService.RegisterAsync(input); - } + [HttpPost] + [Route("phone/register")] + public async virtual Task RegisterAsync(PhoneRegisterDto input) + { + await AccountAppService.RegisterAsync(input); + } - [HttpPut] - [Route("phone/reset-password")] - public async virtual Task ResetPasswordAsync(PhoneResetPasswordDto input) - { - await AccountAppService.ResetPasswordAsync(input); - } + [HttpPut] + [Route("phone/reset-password")] + public async virtual Task ResetPasswordAsync(PhoneResetPasswordDto input) + { + await AccountAppService.ResetPasswordAsync(input); + } - [HttpPost] - [Route("phone/send-signin-code")] - public async virtual Task SendPhoneSigninCodeAsync(SendPhoneSigninCodeDto input) - { - await AccountAppService.SendPhoneSigninCodeAsync(input); - } + [HttpPost] + [Route("phone/send-signin-code")] + public async virtual Task SendPhoneSigninCodeAsync(SendPhoneSigninCodeDto input) + { + await AccountAppService.SendPhoneSigninCodeAsync(input); + } - [HttpPost] - [Route("email/send-signin-code")] - public async virtual Task SendEmailSigninCodeAsync(SendEmailSigninCodeDto input) - { - await AccountAppService.SendEmailSigninCodeAsync(input); - } + [HttpPost] + [Route("email/send-signin-code")] + public async virtual Task SendEmailSigninCodeAsync(SendEmailSigninCodeDto input) + { + await AccountAppService.SendEmailSigninCodeAsync(input); + } - [HttpPost] - [Route("phone/send-register-code")] - public async virtual Task SendPhoneRegisterCodeAsync(SendPhoneRegisterCodeDto input) - { - await AccountAppService.SendPhoneRegisterCodeAsync(input); - } + [HttpPost] + [Route("phone/send-register-code")] + public async virtual Task SendPhoneRegisterCodeAsync(SendPhoneRegisterCodeDto input) + { + await AccountAppService.SendPhoneRegisterCodeAsync(input); + } - [HttpPost] - [Route("phone/send-password-reset-code")] - public async virtual Task SendPhoneResetPasswordCodeAsync(SendPhoneResetPasswordCodeDto input) - { - await AccountAppService.SendPhoneResetPasswordCodeAsync(input); - } + [HttpPost] + [Route("phone/send-password-reset-code")] + public async virtual Task SendPhoneResetPasswordCodeAsync(SendPhoneResetPasswordCodeDto input) + { + await AccountAppService.SendPhoneResetPasswordCodeAsync(input); + } - [HttpGet] - [Route("two-factor-providers")] - public async virtual Task> GetTwoFactorProvidersAsync(GetTwoFactorProvidersInput input) - { - return await AccountAppService.GetTwoFactorProvidersAsync(input); - } + [HttpGet] + [Route("two-factor-providers")] + public async virtual Task> GetTwoFactorProvidersAsync(GetTwoFactorProvidersInput input) + { + return await AccountAppService.GetTwoFactorProvidersAsync(input); } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN/Abp/Account/MyClaimController.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN/Abp/Account/MyClaimController.cs index f3b95ab97..dde75b6d1 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN/Abp/Account/MyClaimController.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN/Abp/Account/MyClaimController.cs @@ -5,27 +5,26 @@ using Volo.Abp.Account; using Volo.Abp.AspNetCore.Mvc; -namespace LINGYUN.Abp.Account +namespace LINGYUN.Abp.Account; + +[RemoteService(Name = AccountRemoteServiceConsts.RemoteServiceName)] +[Area("account")] +[ControllerName("Claim")] +[Route("/api/account/my-claim")] +public class MyClaimController : AbpControllerBase, IMyClaimAppService { - [RemoteService(Name = AccountRemoteServiceConsts.RemoteServiceName)] - [Area("account")] - [ControllerName("Claim")] - [Route("/api/account/my-claim")] - public class MyClaimController : AbpControllerBase, IMyClaimAppService - { - private readonly IMyClaimAppService _service; + private readonly IMyClaimAppService _service; - public MyClaimController( - IMyClaimAppService service) - { - _service = service; - } + public MyClaimController( + IMyClaimAppService service) + { + _service = service; + } - [HttpPost] - [Route("change-avatar")] - public async virtual Task ChangeAvatarAsync(ChangeAvatarInput input) - { - await _service.ChangeAvatarAsync(input); - } + [HttpPost] + [Route("change-avatar")] + public async virtual Task ChangeAvatarAsync(ChangeAvatarInput input) + { + await _service.ChangeAvatarAsync(input); } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN/Abp/Account/MyProfileController.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN/Abp/Account/MyProfileController.cs index 23d8a212d..aa444c402 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN/Abp/Account/MyProfileController.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.HttpApi/LINGYUN/Abp/Account/MyProfileController.cs @@ -1,87 +1,102 @@ using Asp.Versioning; +using LINGYUN.Abp.Identity; using Microsoft.AspNetCore.Mvc; using System.Threading.Tasks; using Volo.Abp; using Volo.Abp.Account; +using Volo.Abp.Application.Dtos; using Volo.Abp.AspNetCore.Mvc; -namespace LINGYUN.Abp.Account +namespace LINGYUN.Abp.Account; + +[RemoteService(Name = AccountRemoteServiceConsts.RemoteServiceName)] +[Area("account")] +[ControllerName("Profile")] +[Route("/api/account/my-profile")] +public class MyProfileController : AbpControllerBase, IMyProfileAppService { - [RemoteService(Name = AccountRemoteServiceConsts.RemoteServiceName)] - [Area("account")] - [ControllerName("Profile")] - [Route("/api/account/my-profile")] - public class MyProfileController : AbpControllerBase, IMyProfileAppService + protected IMyProfileAppService MyProfileAppService { get; } + + public MyProfileController( + IMyProfileAppService myProfileAppService) { - protected IMyProfileAppService MyProfileAppService { get; } + MyProfileAppService = myProfileAppService; + } - public MyProfileController( - IMyProfileAppService myProfileAppService) - { - MyProfileAppService = myProfileAppService; - } + [HttpGet] + [Route("sessions")] + public virtual Task> GetSessionsAsync(GetMySessionsInput input) + { + return MyProfileAppService.GetSessionsAsync(input); + } - [HttpGet] - [Route("two-factor")] - public async virtual Task GetTwoFactorEnabledAsync() - { - return await MyProfileAppService.GetTwoFactorEnabledAsync(); - } + [HttpDelete] + [Route("sessions/{sessionId}/revoke")] + public virtual Task RevokeSessionAsync(string sessionId) + { + return MyProfileAppService.RevokeSessionAsync(sessionId); + } - [HttpPut] - [Route("change-two-factor")] - public async virtual Task ChangeTwoFactorEnabledAsync(TwoFactorEnabledDto input) - { - await MyProfileAppService.ChangeTwoFactorEnabledAsync(input); - } + [HttpGet] + [Route("two-factor")] + public virtual Task GetTwoFactorEnabledAsync() + { + return MyProfileAppService.GetTwoFactorEnabledAsync(); + } - [HttpPost] - [Route("send-phone-number-change-code")] - public async virtual Task SendChangePhoneNumberCodeAsync(SendChangePhoneNumberCodeInput input) - { - await MyProfileAppService.SendChangePhoneNumberCodeAsync(input); - } + [HttpPut] + [Route("change-two-factor")] + public virtual Task ChangeTwoFactorEnabledAsync(TwoFactorEnabledDto input) + { + return MyProfileAppService.ChangeTwoFactorEnabledAsync(input); + } - [HttpPut] - [Route("change-phone-number")] - public async virtual Task ChangePhoneNumberAsync(ChangePhoneNumberInput input) - { - await MyProfileAppService.ChangePhoneNumberAsync(input); - } + [HttpPost] + [Route("send-phone-number-change-code")] + public virtual Task SendChangePhoneNumberCodeAsync(SendChangePhoneNumberCodeInput input) + { + return MyProfileAppService.SendChangePhoneNumberCodeAsync(input); + } - [HttpPost] - [Route("send-email-confirm-link")] - public async virtual Task SendEmailConfirmLinkAsync(SendEmailConfirmCodeDto input) - { - await MyProfileAppService.SendEmailConfirmLinkAsync(input); - } + [HttpPut] + [Route("change-phone-number")] + public virtual Task ChangePhoneNumberAsync(ChangePhoneNumberInput input) + { + return MyProfileAppService.ChangePhoneNumberAsync(input); + } + + [HttpPost] + [Route("send-email-confirm-link")] + public virtual Task SendEmailConfirmLinkAsync(SendEmailConfirmCodeDto input) + { + return MyProfileAppService.SendEmailConfirmLinkAsync(input); + } - [HttpPut] - [Route("confirm-email")] - public async virtual Task ConfirmEmailAsync(ConfirmEmailInput input) - { - await MyProfileAppService.ConfirmEmailAsync(input); - } + [HttpPut] + [Route("confirm-email")] + public virtual Task ConfirmEmailAsync(ConfirmEmailInput input) + { + return MyProfileAppService.ConfirmEmailAsync(input); + } - [HttpGet] - [Route("authenticator")] - public async virtual Task GetAuthenticator() - { - return await MyProfileAppService.GetAuthenticator(); - } + [HttpGet] + [Route("authenticator")] + public virtual Task GetAuthenticator() + { + return MyProfileAppService.GetAuthenticator(); + } - [HttpPost] - [Route("verify-authenticator-code")] - public async virtual Task VerifyAuthenticatorCode(VerifyAuthenticatorCodeInput input) - { - return await MyProfileAppService.VerifyAuthenticatorCode(input); - } + [HttpPost] + [Route("verify-authenticator-code")] + public virtual Task VerifyAuthenticatorCode(VerifyAuthenticatorCodeInput input) + { + return MyProfileAppService.VerifyAuthenticatorCode(input); + } - [HttpPost] - [Route("reset-authenticator")] - public async virtual Task ResetAuthenticator() - { - await MyProfileAppService.ResetAuthenticator(); - } + [HttpPost] + [Route("reset-authenticator")] + public virtual Task ResetAuthenticator() + { + return MyProfileAppService.ResetAuthenticator(); } } diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Templates/LINGYUN.Abp.Account.Templates.csproj b/aspnet-core/modules/account/LINGYUN.Abp.Account.Templates/LINGYUN.Abp.Account.Templates.csproj index dc5e8a399..50e221657 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Templates/LINGYUN.Abp.Account.Templates.csproj +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Templates/LINGYUN.Abp.Account.Templates.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Account.Templates + LINGYUN.Abp.Account.Templates + false + false + false diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Templates/LINGYUN/Abp/Account/Templates/AbpAccountTemplatesModule.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Templates/LINGYUN/Abp/Account/Templates/AbpAccountTemplatesModule.cs index f7fe45acb..5b4d97be5 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Templates/LINGYUN/Abp/Account/Templates/AbpAccountTemplatesModule.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Templates/LINGYUN/Abp/Account/Templates/AbpAccountTemplatesModule.cs @@ -4,26 +4,25 @@ using Volo.Abp.Modularity; using Volo.Abp.VirtualFileSystem; -namespace LINGYUN.Abp.Account.Templates +namespace LINGYUN.Abp.Account.Templates; + +[DependsOn( + typeof(AbpEmailingModule), + typeof(AbpAccountApplicationContractsModule))] +public class AbpAccountTemplatesModule : AbpModule { - [DependsOn( - typeof(AbpEmailingModule), - typeof(AbpAccountApplicationContractsModule))] - public class AbpAccountTemplatesModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + Configure(options => { - Configure(options => - { - options.FileSets.AddEmbedded(); - }); + options.FileSets.AddEmbedded(); + }); - Configure(options => - { - options.Resources - .Get() - .AddVirtualJson("/LINGYUN/Abp/Account/Templates/Localization/Resources"); - }); - } + Configure(options => + { + options.Resources + .Get() + .AddVirtualJson("/LINGYUN/Abp/Account/Templates/Localization/Resources"); + }); } } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN.Abp.Auditing.Application.Contracts.csproj b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN.Abp.Auditing.Application.Contracts.csproj index 3f0ca2163..ad4246a99 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN.Abp.Auditing.Application.Contracts.csproj +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN.Abp.Auditing.Application.Contracts.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Auditing.Application.Contracts + LINGYUN.Abp.Auditing.Application.Contracts + false + false + false diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AbpAuditingApplicationContractsModule.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AbpAuditingApplicationContractsModule.cs index 907839e82..0a7c0f437 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AbpAuditingApplicationContractsModule.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AbpAuditingApplicationContractsModule.cs @@ -7,28 +7,27 @@ using Volo.Abp.Modularity; using Volo.Abp.VirtualFileSystem; -namespace LINGYUN.Abp.Auditing +namespace LINGYUN.Abp.Auditing; + +[DependsOn( + typeof(AbpFeaturesModule), + typeof(AbpAuthorizationModule), + typeof(AbpAuditLoggingDomainSharedModule), + typeof(AbpDddApplicationContractsModule))] +public class AbpAuditingApplicationContractsModule : AbpModule { - [DependsOn( - typeof(AbpFeaturesModule), - typeof(AbpAuthorizationModule), - typeof(AbpAuditLoggingDomainSharedModule), - typeof(AbpDddApplicationContractsModule))] - public class AbpAuditingApplicationContractsModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + Configure(options => { - Configure(options => - { - options.FileSets.AddEmbedded(); - }); + options.FileSets.AddEmbedded(); + }); - Configure(options => - { - options.Resources - .Get() - .AddVirtualJson("/LINGYUN/Abp/Auditing/Localization/Resources"); - }); - } + Configure(options => + { + options.Resources + .Get() + .AddVirtualJson("/LINGYUN/Abp/Auditing/Localization/Resources"); + }); } } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/AuditLogActionDto.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/AuditLogActionDto.cs index 667fa9455..44365705f 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/AuditLogActionDto.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/AuditLogActionDto.cs @@ -1,18 +1,17 @@ using System; using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.Auditing.AuditLogs +namespace LINGYUN.Abp.Auditing.AuditLogs; + +public class AuditLogActionDto : ExtensibleEntityDto { - public class AuditLogActionDto : ExtensibleEntityDto - { - public string ServiceName { get; set; } + public string ServiceName { get; set; } - public string MethodName { get; set; } + public string MethodName { get; set; } - public string Parameters { get; set; } + public string Parameters { get; set; } - public DateTime ExecutionTime { get; set; } + public DateTime ExecutionTime { get; set; } - public int ExecutionDuration { get; set; } - } + public int ExecutionDuration { get; set; } } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/AuditLogDto.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/AuditLogDto.cs index 5ea2c5ee4..491026163 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/AuditLogDto.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/AuditLogDto.cs @@ -2,54 +2,53 @@ using System.Collections.Generic; using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.Auditing.AuditLogs +namespace LINGYUN.Abp.Auditing.AuditLogs; + +public class AuditLogDto : ExtensibleEntityDto { - public class AuditLogDto : ExtensibleEntityDto - { - public string ApplicationName { get; set; } + public string ApplicationName { get; set; } - public Guid? UserId { get; set; } + public Guid? UserId { get; set; } - public string UserName { get; set; } + public string UserName { get; set; } - public Guid? TenantId { get; set; } + public Guid? TenantId { get; set; } - public string TenantName { get; set; } + public string TenantName { get; set; } - public Guid? ImpersonatorUserId { get; set; } + public Guid? ImpersonatorUserId { get; set; } - public Guid? ImpersonatorTenantId { get; set; } + public Guid? ImpersonatorTenantId { get; set; } - public DateTime ExecutionTime { get; set; } + public DateTime ExecutionTime { get; set; } - public int ExecutionDuration { get; set; } + public int ExecutionDuration { get; set; } - public string ClientIpAddress { get; set; } + public string ClientIpAddress { get; set; } - public string ClientName { get; set; } + public string ClientName { get; set; } - public string ClientId { get; set; } + public string ClientId { get; set; } - public string CorrelationId { get; set; } + public string CorrelationId { get; set; } - public string BrowserInfo { get; set; } + public string BrowserInfo { get; set; } - public string HttpMethod { get; set; } + public string HttpMethod { get; set; } - public string Url { get; set; } + public string Url { get; set; } - public string Exceptions { get; set; } + public string Exceptions { get; set; } - public string Comments { get; set; } + public string Comments { get; set; } - public int? HttpStatusCode { get; set; } - public List EntityChanges { get; set; } - public List Actions { get; set; } + public int? HttpStatusCode { get; set; } + public List EntityChanges { get; set; } + public List Actions { get; set; } - public AuditLogDto() - { - EntityChanges = new List(); - Actions = new List(); - } + public AuditLogDto() + { + EntityChanges = new List(); + Actions = new List(); } } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/AuditLogGetByPagedDto.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/AuditLogGetByPagedDto.cs index 18b8de1d2..c46830e27 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/AuditLogGetByPagedDto.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/AuditLogGetByPagedDto.cs @@ -2,23 +2,22 @@ using System.Net; using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.Auditing.AuditLogs +namespace LINGYUN.Abp.Auditing.AuditLogs; + +public class AuditLogGetByPagedDto : PagedAndSortedResultRequestDto { - public class AuditLogGetByPagedDto : PagedAndSortedResultRequestDto - { - public DateTime? StartTime { get; set; } - public DateTime? EndTime { get; set; } - public string HttpMethod { get; set; } - public string Url { get; set; } - public Guid? UserId { get; set; } - public string UserName { get; set; } - public string ApplicationName { get; set; } - public string CorrelationId { get; set; } - public string ClientId { get; set; } - public string ClientIpAddress { get; set; } - public int? MaxExecutionDuration { get; set; } - public int? MinExecutionDuration { get; set; } - public bool? HasException { get; set; } - public HttpStatusCode? HttpStatusCode { get; set; } - } + public DateTime? StartTime { get; set; } + public DateTime? EndTime { get; set; } + public string HttpMethod { get; set; } + public string Url { get; set; } + public Guid? UserId { get; set; } + public string UserName { get; set; } + public string ApplicationName { get; set; } + public string CorrelationId { get; set; } + public string ClientId { get; set; } + public string ClientIpAddress { get; set; } + public int? MaxExecutionDuration { get; set; } + public int? MinExecutionDuration { get; set; } + public bool? HasException { get; set; } + public HttpStatusCode? HttpStatusCode { get; set; } } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/EntityChangeDto.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/EntityChangeDto.cs index 35370d73b..12a54abb4 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/EntityChangeDto.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/EntityChangeDto.cs @@ -3,23 +3,22 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.Auditing; -namespace LINGYUN.Abp.Auditing.AuditLogs +namespace LINGYUN.Abp.Auditing.AuditLogs; + +public class EntityChangeDto : ExtensibleEntityDto { - public class EntityChangeDto : ExtensibleEntityDto - { - public DateTime ChangeTime { get; set; } + public DateTime ChangeTime { get; set; } - public EntityChangeType ChangeType { get; set; } + public EntityChangeType ChangeType { get; set; } - public Guid? EntityTenantId { get; set; } + public Guid? EntityTenantId { get; set; } - public string EntityId { get; set; } + public string EntityId { get; set; } - public string EntityTypeFullName { get; set; } - public List PropertyChanges { get; set; } - public EntityChangeDto() - { - PropertyChanges = new List(); - } + public string EntityTypeFullName { get; set; } + public List PropertyChanges { get; set; } + public EntityChangeDto() + { + PropertyChanges = new List(); } } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/EntityPropertyChangeDto.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/EntityPropertyChangeDto.cs index ef451c8d3..2c625710d 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/EntityPropertyChangeDto.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/EntityPropertyChangeDto.cs @@ -1,16 +1,15 @@ using System; using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.Auditing.AuditLogs +namespace LINGYUN.Abp.Auditing.AuditLogs; + +public class EntityPropertyChangeDto : EntityDto { - public class EntityPropertyChangeDto : EntityDto - { - public string NewValue { get; set; } + public string NewValue { get; set; } - public string OriginalValue { get; set; } + public string OriginalValue { get; set; } - public string PropertyName { get; set; } + public string PropertyName { get; set; } - public string PropertyTypeFullName { get; set; } - } + public string PropertyTypeFullName { get; set; } } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/IAuditLogAppService.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/IAuditLogAppService.cs index 75a691af6..f5d204aac 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/IAuditLogAppService.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditLogs/IAuditLogAppService.cs @@ -3,14 +3,13 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; -namespace LINGYUN.Abp.Auditing.AuditLogs +namespace LINGYUN.Abp.Auditing.AuditLogs; + +public interface IAuditLogAppService : IApplicationService { - public interface IAuditLogAppService : IApplicationService - { - Task> GetListAsync(AuditLogGetByPagedDto input); + Task> GetListAsync(AuditLogGetByPagedDto input); - Task GetAsync(Guid id); + Task GetAsync(Guid id); - Task DeleteAsync(Guid id); - } + Task DeleteAsync(Guid id); } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditingRemoteServiceConsts.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditingRemoteServiceConsts.cs index 85d9b1a3e..7c1a01f7d 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditingRemoteServiceConsts.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/AuditingRemoteServiceConsts.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.Auditing +namespace LINGYUN.Abp.Auditing; + +public static class AuditingRemoteServiceConsts { - public static class AuditingRemoteServiceConsts - { - public const string RemoteServiceName = "AbpAuditing"; - } + public const string RemoteServiceName = "AbpAuditing"; } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Features/AuditingFeatureDefinitionProvider.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Features/AuditingFeatureDefinitionProvider.cs index 020cd0bb7..0c4ef71c5 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Features/AuditingFeatureDefinitionProvider.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Features/AuditingFeatureDefinitionProvider.cs @@ -3,48 +3,47 @@ using Volo.Abp.Localization; using Volo.Abp.Validation.StringValues; -namespace LINGYUN.Abp.Auditing.Features +namespace LINGYUN.Abp.Auditing.Features; + +public class AuditingFeatureDefinitionProvider : FeatureDefinitionProvider { - public class AuditingFeatureDefinitionProvider : FeatureDefinitionProvider + public override void Define(IFeatureDefinitionContext context) { - public override void Define(IFeatureDefinitionContext context) - { - var auditingGroup = context.AddGroup( - name: AuditingFeatureNames.GroupName, - displayName: L("Features:Auditing")); + var auditingGroup = context.AddGroup( + name: AuditingFeatureNames.GroupName, + displayName: L("Features:Auditing")); - var loggingEnableFeature = auditingGroup.AddFeature( - name: AuditingFeatureNames.Logging.Enable, - displayName: L("Features:Auditing"), - description: L("Features:AuditingDesc") - ); + var loggingEnableFeature = auditingGroup.AddFeature( + name: AuditingFeatureNames.Logging.Enable, + displayName: L("Features:Auditing"), + description: L("Features:AuditingDesc") + ); - loggingEnableFeature.CreateChild( - name: AuditingFeatureNames.Logging.AuditLog, - defaultValue: true.ToString(), - displayName: L("Features:DisplayName:AuditLog"), - description: L("Features:Description:AuditLog"), - valueType: new ToggleStringValueType(new BooleanValueValidator()) - ); - loggingEnableFeature.CreateChild( - name: AuditingFeatureNames.Logging.SecurityLog, - defaultValue: true.ToString(), - displayName: L("Features:DisplayName:SecurityLog"), - description: L("Features:Description:SecurityLog"), - valueType: new ToggleStringValueType(new BooleanValueValidator()) - ); - loggingEnableFeature.CreateChild( - name: AuditingFeatureNames.Logging.SystemLog, - defaultValue: true.ToString(), - displayName: L("Features:DisplayName:SystemLog"), - description: L("Features:Description:SystemLog"), - valueType: new ToggleStringValueType(new BooleanValueValidator()) - ); - } + loggingEnableFeature.CreateChild( + name: AuditingFeatureNames.Logging.AuditLog, + defaultValue: true.ToString(), + displayName: L("Features:DisplayName:AuditLog"), + description: L("Features:Description:AuditLog"), + valueType: new ToggleStringValueType(new BooleanValueValidator()) + ); + loggingEnableFeature.CreateChild( + name: AuditingFeatureNames.Logging.SecurityLog, + defaultValue: true.ToString(), + displayName: L("Features:DisplayName:SecurityLog"), + description: L("Features:Description:SecurityLog"), + valueType: new ToggleStringValueType(new BooleanValueValidator()) + ); + loggingEnableFeature.CreateChild( + name: AuditingFeatureNames.Logging.SystemLog, + defaultValue: true.ToString(), + displayName: L("Features:DisplayName:SystemLog"), + description: L("Features:Description:SystemLog"), + valueType: new ToggleStringValueType(new BooleanValueValidator()) + ); + } - protected LocalizableString L(string name) - { - return LocalizableString.Create(name); - } + protected LocalizableString L(string name) + { + return LocalizableString.Create(name); } } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Features/AuditingFeatureNames.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Features/AuditingFeatureNames.cs index 6a923e8a5..315bb6997 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Features/AuditingFeatureNames.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Features/AuditingFeatureNames.cs @@ -1,19 +1,18 @@ -namespace LINGYUN.Abp.Auditing.Features +namespace LINGYUN.Abp.Auditing.Features; + +public static class AuditingFeatureNames { - public static class AuditingFeatureNames + public const string GroupName = "AbpAuditing"; + public class Logging { - public const string GroupName = "AbpAuditing"; - public class Logging - { - public const string Default = GroupName + ".Logging"; + public const string Default = GroupName + ".Logging"; - public const string Enable = Default + ".Enable"; + public const string Enable = Default + ".Enable"; - public const string AuditLog = Default + ".AuditLog"; + public const string AuditLog = Default + ".AuditLog"; - public const string SecurityLog = Default + ".SecurityLog"; + public const string SecurityLog = Default + ".SecurityLog"; - public const string SystemLog = Default + ".SystemLog"; - } + public const string SystemLog = Default + ".SystemLog"; } } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/Dto/LogDto.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/Dto/LogDto.cs index c3ed23ca3..f33f23385 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/Dto/LogDto.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/Dto/LogDto.cs @@ -2,14 +2,13 @@ using System; using System.Collections.Generic; -namespace LINGYUN.Abp.Auditing.Logging +namespace LINGYUN.Abp.Auditing.Logging; + +public class LogDto { - public class LogDto - { - public DateTime TimeStamp { get; set; } - public LogLevel Level { get; set; } - public string Message { get; set; } - public LogFieldDto Fields { get; set; } - public List Exceptions { get; set; } - } + public DateTime TimeStamp { get; set; } + public LogLevel Level { get; set; } + public string Message { get; set; } + public LogFieldDto Fields { get; set; } + public List Exceptions { get; set; } } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/Dto/LogExceptionDto.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/Dto/LogExceptionDto.cs index 7bf1e92a5..ab42da4cc 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/Dto/LogExceptionDto.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/Dto/LogExceptionDto.cs @@ -1,13 +1,12 @@ -namespace LINGYUN.Abp.Auditing.Logging +namespace LINGYUN.Abp.Auditing.Logging; + +public class LogExceptionDto { - public class LogExceptionDto - { - public int Depth { get; set; } - public string Class { get; set; } - public string Message { get; set; } - public string Source { get; set; } - public string StackTrace { get; set; } - public int HResult { get; set; } - public string HelpURL { get; set; } - } + public int Depth { get; set; } + public string Class { get; set; } + public string Message { get; set; } + public string Source { get; set; } + public string StackTrace { get; set; } + public int HResult { get; set; } + public string HelpURL { get; set; } } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/Dto/LogFieldDto.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/Dto/LogFieldDto.cs index b18b30d9f..da9c73a68 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/Dto/LogFieldDto.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/Dto/LogFieldDto.cs @@ -1,21 +1,20 @@ -namespace LINGYUN.Abp.Auditing.Logging +namespace LINGYUN.Abp.Auditing.Logging; + +public class LogFieldDto { - public class LogFieldDto - { - public string Id { get; set; } - public string MachineName { get; set; } - public string Environment { get; set; } - public string Application { get; set; } - public string Context { get; set; } - public string ActionId { get; set; } - public string ActionName { get; set; } - public string RequestId { get; set; } - public string RequestPath { get; set; } - public string ConnectionId { get; set; } - public string CorrelationId { get; set; } - public string ClientId { get; set; } - public string UserId { get; set; } - public int ProcessId { get; set; } - public int ThreadId { get; set; } - } + public string Id { get; set; } + public string MachineName { get; set; } + public string Environment { get; set; } + public string Application { get; set; } + public string Context { get; set; } + public string ActionId { get; set; } + public string ActionName { get; set; } + public string RequestId { get; set; } + public string RequestPath { get; set; } + public string ConnectionId { get; set; } + public string CorrelationId { get; set; } + public string ClientId { get; set; } + public string UserId { get; set; } + public int ProcessId { get; set; } + public int ThreadId { get; set; } } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/Dto/LogGetByPagedDto.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/Dto/LogGetByPagedDto.cs index 022704baa..3464cc51d 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/Dto/LogGetByPagedDto.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/Dto/LogGetByPagedDto.cs @@ -2,22 +2,21 @@ using System; using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.Auditing.Logging +namespace LINGYUN.Abp.Auditing.Logging; + +public class LogGetByPagedDto : PagedAndSortedResultRequestDto { - public class LogGetByPagedDto : PagedAndSortedResultRequestDto - { - public DateTime? StartTime { get; set; } - public DateTime? EndTime { get; set; } - public LogLevel? Level { get; set; } - public string MachineName { get; set; } - public string Environment { get; set; } - public string Application { get; set; } - public string Context { get; set; } - public string RequestId { get; set; } - public string RequestPath { get; set; } - public string CorrelationId { get; set; } - public int? ProcessId { get; set; } - public int? ThreadId { get; set; } - public bool? HasException { get; set; } - } + public DateTime? StartTime { get; set; } + public DateTime? EndTime { get; set; } + public LogLevel? Level { get; set; } + public string MachineName { get; set; } + public string Environment { get; set; } + public string Application { get; set; } + public string Context { get; set; } + public string RequestId { get; set; } + public string RequestPath { get; set; } + public string CorrelationId { get; set; } + public int? ProcessId { get; set; } + public int? ThreadId { get; set; } + public bool? HasException { get; set; } } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/ILogAppService.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/ILogAppService.cs index 0a5682354..090fcaf04 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/ILogAppService.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/ILogAppService.cs @@ -3,12 +3,11 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; -namespace LINGYUN.Abp.Auditing.Logging +namespace LINGYUN.Abp.Auditing.Logging; + +public interface ILogAppService : IApplicationService { - public interface ILogAppService : IApplicationService - { - Task GetAsync(string id); + Task GetAsync(string id); - Task> GetListAsync(LogGetByPagedDto input); - } + Task> GetListAsync(LogGetByPagedDto input); } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Permissions/AuditingPermissionDefinitionProvider.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Permissions/AuditingPermissionDefinitionProvider.cs index 550ae8b04..46fd6ab1b 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Permissions/AuditingPermissionDefinitionProvider.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Permissions/AuditingPermissionDefinitionProvider.cs @@ -3,39 +3,38 @@ using Volo.Abp.Localization; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.Auditing.Permissions +namespace LINGYUN.Abp.Auditing.Permissions; + +public class AuditingPermissionDefinitionProvider : PermissionDefinitionProvider { - public class AuditingPermissionDefinitionProvider : PermissionDefinitionProvider + public override void Define(IPermissionDefinitionContext context) { - public override void Define(IPermissionDefinitionContext context) - { - var auditingGroup = context.AddGroup( - name: AuditingPermissionNames.GroupName, - displayName: L("Permissions:Auditing")); + var auditingGroup = context.AddGroup( + name: AuditingPermissionNames.GroupName, + displayName: L("Permissions:Auditing")); - var auditLogPermission= auditingGroup.AddPermission( - name: AuditingPermissionNames.AuditLog.Default, - displayName: L("Permissions:AuditLog")); - auditLogPermission.AddChild( - name: AuditingPermissionNames.AuditLog.Delete, - displayName: L("Permissions:DeleteLog")); + var auditLogPermission= auditingGroup.AddPermission( + name: AuditingPermissionNames.AuditLog.Default, + displayName: L("Permissions:AuditLog")); + auditLogPermission.AddChild( + name: AuditingPermissionNames.AuditLog.Delete, + displayName: L("Permissions:DeleteLog")); - var sysLogPermission = auditingGroup.AddPermission( - name: AuditingPermissionNames.SystemLog.Default, - displayName: L("Permissions:SystemLog"), - multiTenancySide: MultiTenancySides.Host); + var sysLogPermission = auditingGroup.AddPermission( + name: AuditingPermissionNames.SystemLog.Default, + displayName: L("Permissions:SystemLog"), + multiTenancySide: MultiTenancySides.Host); - var securityLogPermission = auditingGroup.AddPermission( - name: AuditingPermissionNames.SecurityLog.Default, - displayName: L("Permissions:SecurityLog")); - securityLogPermission.AddChild( - name: AuditingPermissionNames.SecurityLog.Delete, - displayName: L("Permissions:DeleteLog")); - } + var securityLogPermission = auditingGroup.AddPermission( + name: AuditingPermissionNames.SecurityLog.Default, + displayName: L("Permissions:SecurityLog")); + securityLogPermission.AddChild( + name: AuditingPermissionNames.SecurityLog.Delete, + displayName: L("Permissions:DeleteLog")); + } - protected LocalizableString L(string name) - { - return LocalizableString.Create(name); - } + protected LocalizableString L(string name) + { + return LocalizableString.Create(name); } } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Permissions/AuditingPermissionNames.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Permissions/AuditingPermissionNames.cs index b4f7724f7..2e1f0a101 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Permissions/AuditingPermissionNames.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Permissions/AuditingPermissionNames.cs @@ -1,23 +1,22 @@ -namespace LINGYUN.Abp.Auditing.Permissions +namespace LINGYUN.Abp.Auditing.Permissions; + +public class AuditingPermissionNames { - public class AuditingPermissionNames + public const string GroupName = "AbpAuditing"; + public class AuditLog { - public const string GroupName = "AbpAuditing"; - public class AuditLog - { - public const string Default = GroupName + ".AuditLog"; - public const string Delete = Default + ".Delete"; - } + public const string Default = GroupName + ".AuditLog"; + public const string Delete = Default + ".Delete"; + } - public class SecurityLog - { - public const string Default = GroupName + ".SecurityLog"; - public const string Delete = Default + ".Delete"; - } + public class SecurityLog + { + public const string Default = GroupName + ".SecurityLog"; + public const string Delete = Default + ".Delete"; + } - public class SystemLog - { - public const string Default = GroupName + ".SystemLog"; - } + public class SystemLog + { + public const string Default = GroupName + ".SystemLog"; } } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/SecurityLogs/ISecurityLogAppService.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/SecurityLogs/ISecurityLogAppService.cs index 1a92bbc1a..e1f979563 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/SecurityLogs/ISecurityLogAppService.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/SecurityLogs/ISecurityLogAppService.cs @@ -3,14 +3,13 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; -namespace LINGYUN.Abp.Auditing.SecurityLogs +namespace LINGYUN.Abp.Auditing.SecurityLogs; + +public interface ISecurityLogAppService : IApplicationService { - public interface ISecurityLogAppService : IApplicationService - { - Task> GetListAsync(SecurityLogGetByPagedDto input); + Task> GetListAsync(SecurityLogGetByPagedDto input); - Task GetAsync(Guid id); + Task GetAsync(Guid id); - Task DeleteAsync(Guid id); - } + Task DeleteAsync(Guid id); } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogDto.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogDto.cs index f572a1e90..a86440fb7 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogDto.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogDto.cs @@ -1,30 +1,29 @@ using System; using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.Auditing.SecurityLogs +namespace LINGYUN.Abp.Auditing.SecurityLogs; + +public class SecurityLogDto : ExtensibleEntityDto { - public class SecurityLogDto : ExtensibleEntityDto - { - public string ApplicationName { get; set; } + public string ApplicationName { get; set; } - public string Identity { get; set; } + public string Identity { get; set; } - public string Action { get; set; } + public string Action { get; set; } - public Guid? UserId { get; set; } + public Guid? UserId { get; set; } - public string UserName { get; set; } + public string UserName { get; set; } - public string TenantName { get; set; } + public string TenantName { get; set; } - public string ClientId { get; set; } + public string ClientId { get; set; } - public string CorrelationId { get; set; } + public string CorrelationId { get; set; } - public string ClientIpAddress { get; set; } + public string ClientIpAddress { get; set; } - public string BrowserInfo { get; set; } + public string BrowserInfo { get; set; } - public DateTime CreationTime { get; set; } - } + public DateTime CreationTime { get; set; } } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogGetByPagedDto.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogGetByPagedDto.cs index 3e9c754cf..4cfe6e547 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogGetByPagedDto.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogGetByPagedDto.cs @@ -1,18 +1,17 @@ using System; using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.Auditing.SecurityLogs +namespace LINGYUN.Abp.Auditing.SecurityLogs; + +public class SecurityLogGetByPagedDto : PagedAndSortedResultRequestDto { - public class SecurityLogGetByPagedDto : PagedAndSortedResultRequestDto - { - public DateTime? StartTime { get; set; } - public DateTime? EndTime { get; set; } - public string ApplicationName { get; set; } - public string Identity { get; set; } - public string ActionName { get; set; } - public Guid? UserId { get; set; } - public string UserName { get; set; } - public string ClientId { get; set; } - public string CorrelationId { get; set; } - } + public DateTime? StartTime { get; set; } + public DateTime? EndTime { get; set; } + public string ApplicationName { get; set; } + public string Identity { get; set; } + public string ActionName { get; set; } + public Guid? UserId { get; set; } + public string UserName { get; set; } + public string ClientId { get; set; } + public string CorrelationId { get; set; } } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN.Abp.Auditing.Application.csproj b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN.Abp.Auditing.Application.csproj index 183ad3ba8..f7f141b7e 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN.Abp.Auditing.Application.csproj +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN.Abp.Auditing.Application.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.Auditing.Application + LINGYUN.Abp.Auditing.Application + false + false + false diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/AbpAuditingApplicationModule.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/AbpAuditingApplicationModule.cs index f8d6c6fbd..f10dd4836 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/AbpAuditingApplicationModule.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/AbpAuditingApplicationModule.cs @@ -4,23 +4,22 @@ using Volo.Abp.AutoMapper; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.Auditing +namespace LINGYUN.Abp.Auditing; + +[DependsOn( + typeof(AbpAutoMapperModule), + typeof(AbpLoggingModule), + typeof(AbpAuditLoggingModule), + typeof(AbpAuditingApplicationContractsModule))] +public class AbpAuditingApplicationModule : AbpModule { - [DependsOn( - typeof(AbpAutoMapperModule), - typeof(AbpLoggingModule), - typeof(AbpAuditLoggingModule), - typeof(AbpAuditingApplicationContractsModule))] - public class AbpAuditingApplicationModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddAutoMapperObjectMapper(); + context.Services.AddAutoMapperObjectMapper(); - Configure(options => - { - options.AddProfile(validate: true); - }); - } + Configure(options => + { + options.AddProfile(validate: true); + }); } } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/AbpAuditingMapperProfile.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/AbpAuditingMapperProfile.cs index d328041ef..e9cad8398 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/AbpAuditingMapperProfile.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/AbpAuditingMapperProfile.cs @@ -5,27 +5,26 @@ using LINGYUN.Abp.AuditLogging; using LINGYUN.Abp.Logging; -namespace LINGYUN.Abp.Auditing +namespace LINGYUN.Abp.Auditing; + +public class AbpAuditingMapperProfile : Profile { - public class AbpAuditingMapperProfile : Profile + public AbpAuditingMapperProfile() { - public AbpAuditingMapperProfile() - { - CreateMap() - .MapExtraProperties(); - CreateMap(); - CreateMap(); - CreateMap() - .MapExtraProperties(); - CreateMap() - .MapExtraProperties(); + CreateMap() + .MapExtraProperties(); + CreateMap(); + CreateMap(); + CreateMap() + .MapExtraProperties(); + CreateMap() + .MapExtraProperties(); - CreateMap() - .MapExtraProperties(); + CreateMap() + .MapExtraProperties(); - CreateMap(); - CreateMap(); - CreateMap(); - } + CreateMap(); + CreateMap(); + CreateMap(); } } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/AuditLogs/AuditLogAppService.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/AuditLogs/AuditLogAppService.cs index 1c2f5c38c..d7f01cc95 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/AuditLogs/AuditLogAppService.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/AuditLogs/AuditLogAppService.cs @@ -9,55 +9,54 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.Features; -namespace LINGYUN.Abp.Auditing.AuditLogs +namespace LINGYUN.Abp.Auditing.AuditLogs; + +[Authorize(AuditingPermissionNames.AuditLog.Default)] +[RequiresFeature(AuditingFeatureNames.Logging.AuditLog)] +public class AuditLogAppService : AuditingApplicationServiceBase, IAuditLogAppService { - [Authorize(AuditingPermissionNames.AuditLog.Default)] - [RequiresFeature(AuditingFeatureNames.Logging.AuditLog)] - public class AuditLogAppService : AuditingApplicationServiceBase, IAuditLogAppService + protected IAuditLogManager AuditLogManager { get; } + + public AuditLogAppService(IAuditLogManager auditLogManager) + { + AuditLogManager = auditLogManager; + } + + public async virtual Task GetAsync(Guid id) + { + var auditLog = await AuditLogManager.GetAsync(id, includeDetails: true); + + return ObjectMapper.Map(auditLog); + } + + public async virtual Task> GetListAsync(AuditLogGetByPagedDto input) + { + var auditLogCount = await AuditLogManager + .GetCountAsync(input.StartTime, input.EndTime, + input.HttpMethod, input.Url, + input.UserId, input.UserName, + input.ApplicationName, input.CorrelationId, + input.ClientId, input.ClientIpAddress, + input.MaxExecutionDuration, input.MinExecutionDuration, + input.HasException, input.HttpStatusCode); + + var auditLogs = await AuditLogManager + .GetListAsync(input.Sorting, input.MaxResultCount, input.SkipCount, + input.StartTime, input.EndTime, + input.HttpMethod, input.Url, + input.UserId, input.UserName, + input.ApplicationName, input.CorrelationId, + input.ClientId, input.ClientIpAddress, + input.MaxExecutionDuration, input.MinExecutionDuration, + input.HasException, input.HttpStatusCode, includeDetails: false); + + return new PagedResultDto(auditLogCount, + ObjectMapper.Map, List>(auditLogs)); + } + + [Authorize(AuditingPermissionNames.AuditLog.Delete)] + public async virtual Task DeleteAsync([Required] Guid id) { - protected IAuditLogManager AuditLogManager { get; } - - public AuditLogAppService(IAuditLogManager auditLogManager) - { - AuditLogManager = auditLogManager; - } - - public async virtual Task GetAsync(Guid id) - { - var auditLog = await AuditLogManager.GetAsync(id, includeDetails: true); - - return ObjectMapper.Map(auditLog); - } - - public async virtual Task> GetListAsync(AuditLogGetByPagedDto input) - { - var auditLogCount = await AuditLogManager - .GetCountAsync(input.StartTime, input.EndTime, - input.HttpMethod, input.Url, - input.UserId, input.UserName, - input.ApplicationName, input.CorrelationId, - input.ClientId, input.ClientIpAddress, - input.MaxExecutionDuration, input.MinExecutionDuration, - input.HasException, input.HttpStatusCode); - - var auditLogs = await AuditLogManager - .GetListAsync(input.Sorting, input.MaxResultCount, input.SkipCount, - input.StartTime, input.EndTime, - input.HttpMethod, input.Url, - input.UserId, input.UserName, - input.ApplicationName, input.CorrelationId, - input.ClientId, input.ClientIpAddress, - input.MaxExecutionDuration, input.MinExecutionDuration, - input.HasException, input.HttpStatusCode, includeDetails: false); - - return new PagedResultDto(auditLogCount, - ObjectMapper.Map, List>(auditLogs)); - } - - [Authorize(AuditingPermissionNames.AuditLog.Delete)] - public async virtual Task DeleteAsync([Required] Guid id) - { - await AuditLogManager.DeleteAsync(id); - } + await AuditLogManager.DeleteAsync(id); } } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/AuditingApplicationServiceBase.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/AuditingApplicationServiceBase.cs index edc58cd32..77f7b41ae 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/AuditingApplicationServiceBase.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/AuditingApplicationServiceBase.cs @@ -1,14 +1,13 @@ using Volo.Abp.Application.Services; using Volo.Abp.AuditLogging.Localization; -namespace LINGYUN.Abp.Auditing +namespace LINGYUN.Abp.Auditing; + +public abstract class AuditingApplicationServiceBase : ApplicationService { - public abstract class AuditingApplicationServiceBase : ApplicationService + protected AuditingApplicationServiceBase() { - protected AuditingApplicationServiceBase() - { - LocalizationResource = typeof(AuditLoggingResource); - ObjectMapperContext = typeof(AbpAuditingApplicationModule); - } + LocalizationResource = typeof(AuditLoggingResource); + ObjectMapperContext = typeof(AbpAuditingApplicationModule); } } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/Logging/LogAppService.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/Logging/LogAppService.cs index 0959b4cb1..e036227c9 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/Logging/LogAppService.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/Logging/LogAppService.cs @@ -7,48 +7,47 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.Features; -namespace LINGYUN.Abp.Auditing.Logging +namespace LINGYUN.Abp.Auditing.Logging; + +[Authorize(AuditingPermissionNames.SystemLog.Default)] +[RequiresFeature(AuditingFeatureNames.Logging.SystemLog)] +public class LogAppService : AuditingApplicationServiceBase, ILogAppService { - [Authorize(AuditingPermissionNames.SystemLog.Default)] - [RequiresFeature(AuditingFeatureNames.Logging.SystemLog)] - public class LogAppService : AuditingApplicationServiceBase, ILogAppService + private readonly ILoggingManager _manager; + + public LogAppService(ILoggingManager manager) + { + _manager = manager; + } + + public async virtual Task GetAsync(string id) { - private readonly ILoggingManager _manager; - - public LogAppService(ILoggingManager manager) - { - _manager = manager; - } - - public async virtual Task GetAsync(string id) - { - var log = await _manager.GetAsync(id); - - return ObjectMapper.Map(log); - } - - public async virtual Task> GetListAsync(LogGetByPagedDto input) - { - var count = await _manager.GetCountAsync( - input.StartTime, input.EndTime, input.Level, - input.MachineName, input.Environment, - input.Application, input.Context, - input.RequestId, input.RequestPath, - input.CorrelationId, input.ProcessId, - input.ThreadId, input.HasException); - - var logs = await _manager.GetListAsync( - input.Sorting, input.MaxResultCount, input.SkipCount, - input.StartTime, input.EndTime, input.Level, - input.MachineName, input.Environment, - input.Application, input.Context, - input.RequestId, input.RequestPath, - input.CorrelationId, input.ProcessId, - input.ThreadId, input.HasException, - includeDetails: false); - - return new PagedResultDto(count, - ObjectMapper.Map, List>(logs)); - } + var log = await _manager.GetAsync(id); + + return ObjectMapper.Map(log); + } + + public async virtual Task> GetListAsync(LogGetByPagedDto input) + { + var count = await _manager.GetCountAsync( + input.StartTime, input.EndTime, input.Level, + input.MachineName, input.Environment, + input.Application, input.Context, + input.RequestId, input.RequestPath, + input.CorrelationId, input.ProcessId, + input.ThreadId, input.HasException); + + var logs = await _manager.GetListAsync( + input.Sorting, input.MaxResultCount, input.SkipCount, + input.StartTime, input.EndTime, input.Level, + input.MachineName, input.Environment, + input.Application, input.Context, + input.RequestId, input.RequestPath, + input.CorrelationId, input.ProcessId, + input.ThreadId, input.HasException, + includeDetails: false); + + return new PagedResultDto(count, + ObjectMapper.Map, List>(logs)); } } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogAppService.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogAppService.cs index 183c8cd04..f1837cff5 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogAppService.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogAppService.cs @@ -8,49 +8,48 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.Features; -namespace LINGYUN.Abp.Auditing.SecurityLogs +namespace LINGYUN.Abp.Auditing.SecurityLogs; + +[Authorize(AuditingPermissionNames.SecurityLog.Default)] +[RequiresFeature(AuditingFeatureNames.Logging.SecurityLog)] +public class SecurityLogAppService : AuditingApplicationServiceBase, ISecurityLogAppService { - [Authorize(AuditingPermissionNames.SecurityLog.Default)] - [RequiresFeature(AuditingFeatureNames.Logging.SecurityLog)] - public class SecurityLogAppService : AuditingApplicationServiceBase, ISecurityLogAppService + protected ISecurityLogManager SecurityLogManager { get; } + public SecurityLogAppService(ISecurityLogManager securityLogManager) + { + SecurityLogManager = securityLogManager; + } + + public async virtual Task GetAsync(Guid id) + { + var securityLog = await SecurityLogManager.GetAsync(id, includeDetails: true); + + return ObjectMapper.Map(securityLog); + } + + public async virtual Task> GetListAsync(SecurityLogGetByPagedDto input) + { + var securityLogCount = await SecurityLogManager + .GetCountAsync(input.StartTime, input.EndTime, + input.ApplicationName, input.Identity, input.ActionName, + input.UserId, input.UserName, input.ClientId, input.CorrelationId + ); + + var securityLogs = await SecurityLogManager + .GetListAsync(input.Sorting, input.MaxResultCount, input.SkipCount, + input.StartTime, input.EndTime, + input.ApplicationName, input.Identity, input.ActionName, + input.UserId, input.UserName, input.ClientId, input.CorrelationId, + includeDetails: false + ); + + return new PagedResultDto(securityLogCount, + ObjectMapper.Map, List>(securityLogs)); + } + + [Authorize(AuditingPermissionNames.SecurityLog.Delete)] + public async virtual Task DeleteAsync(Guid id) { - protected ISecurityLogManager SecurityLogManager { get; } - public SecurityLogAppService(ISecurityLogManager securityLogManager) - { - SecurityLogManager = securityLogManager; - } - - public async virtual Task GetAsync(Guid id) - { - var securityLog = await SecurityLogManager.GetAsync(id, includeDetails: true); - - return ObjectMapper.Map(securityLog); - } - - public async virtual Task> GetListAsync(SecurityLogGetByPagedDto input) - { - var securityLogCount = await SecurityLogManager - .GetCountAsync(input.StartTime, input.EndTime, - input.ApplicationName, input.Identity, input.ActionName, - input.UserId, input.UserName, input.ClientId, input.CorrelationId - ); - - var securityLogs = await SecurityLogManager - .GetListAsync(input.Sorting, input.MaxResultCount, input.SkipCount, - input.StartTime, input.EndTime, - input.ApplicationName, input.Identity, input.ActionName, - input.UserId, input.UserName, input.ClientId, input.CorrelationId, - includeDetails: false - ); - - return new PagedResultDto(securityLogCount, - ObjectMapper.Map, List>(securityLogs)); - } - - [Authorize(AuditingPermissionNames.SecurityLog.Delete)] - public async virtual Task DeleteAsync(Guid id) - { - await SecurityLogManager.DeleteAsync(id); - } + await SecurityLogManager.DeleteAsync(id); } } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN.Abp.Auditing.HttpApi.csproj b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN.Abp.Auditing.HttpApi.csproj index 9c8291708..5823ece30 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN.Abp.Auditing.HttpApi.csproj +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN.Abp.Auditing.HttpApi.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.Auditing.HttpApi + LINGYUN.Abp.Auditing.HttpApi + false + false + false diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN/Abp/Auditing/AbpAuditingHttpApiModule.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN/Abp/Auditing/AbpAuditingHttpApiModule.cs index 8361aab0d..6425c94a3 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN/Abp/Auditing/AbpAuditingHttpApiModule.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN/Abp/Auditing/AbpAuditingHttpApiModule.cs @@ -6,36 +6,35 @@ using Volo.Abp.Localization; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.Auditing +namespace LINGYUN.Abp.Auditing; + +[DependsOn( + typeof(AbpAspNetCoreMvcModule), + typeof(AbpAuditingApplicationContractsModule))] +public class AbpAuditingHttpApiModule : AbpModule { - [DependsOn( - typeof(AbpAspNetCoreMvcModule), - typeof(AbpAuditingApplicationContractsModule))] - public class AbpAuditingHttpApiModule : AbpModule + public override void PreConfigureServices(ServiceConfigurationContext context) { - public override void PreConfigureServices(ServiceConfigurationContext context) + PreConfigure(mvcBuilder => { - PreConfigure(mvcBuilder => - { - mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpAuditingHttpApiModule).Assembly); - }); + mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpAuditingHttpApiModule).Assembly); + }); - PreConfigure(options => - { - options.AddAssemblyResource(typeof(AuditLoggingResource), typeof(AbpAuditingApplicationContractsModule).Assembly); - }); - } + PreConfigure(options => + { + options.AddAssemblyResource(typeof(AuditLoggingResource), typeof(AbpAuditingApplicationContractsModule).Assembly); + }); + } - public override void ConfigureServices(ServiceConfigurationContext context) + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => { - Configure(options => - { - options.Resources - .Get() - .AddBaseTypes( - typeof(AbpUiResource) - ); - }); - } + options.Resources + .Get() + .AddBaseTypes( + typeof(AbpUiResource) + ); + }); } } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN/Abp/Auditing/AuditLogs/AuditLogController.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN/Abp/Auditing/AuditLogs/AuditLogController.cs index 45c6bbe07..56bbc6c8e 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN/Abp/Auditing/AuditLogs/AuditLogController.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN/Abp/Auditing/AuditLogs/AuditLogController.cs @@ -8,41 +8,40 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.AspNetCore.Mvc; -namespace LINGYUN.Abp.Auditing.AuditLogs +namespace LINGYUN.Abp.Auditing.AuditLogs; + +[RemoteService(Name = AuditingRemoteServiceConsts.RemoteServiceName)] +[Area("auditing")] +[ControllerName("audit-log")] +[Route("api/auditing/audit-log")] +[Authorize(AuditingPermissionNames.AuditLog.Default)] +public class AuditLogController : AbpControllerBase, IAuditLogAppService { - [RemoteService(Name = AuditingRemoteServiceConsts.RemoteServiceName)] - [Area("auditing")] - [ControllerName("audit-log")] - [Route("api/auditing/audit-log")] - [Authorize(AuditingPermissionNames.AuditLog.Default)] - public class AuditLogController : AbpControllerBase, IAuditLogAppService - { - protected IAuditLogAppService AuditLogAppService { get; } + protected IAuditLogAppService AuditLogAppService { get; } - public AuditLogController(IAuditLogAppService auditLogAppService) - { - AuditLogAppService = auditLogAppService; - } + public AuditLogController(IAuditLogAppService auditLogAppService) + { + AuditLogAppService = auditLogAppService; + } - [HttpDelete] - [Route("{id}")] - [Authorize(AuditingPermissionNames.AuditLog.Delete)] - public async virtual Task DeleteAsync(Guid id) - { - await AuditLogAppService.DeleteAsync(id); - } + [HttpDelete] + [Route("{id}")] + [Authorize(AuditingPermissionNames.AuditLog.Delete)] + public async virtual Task DeleteAsync(Guid id) + { + await AuditLogAppService.DeleteAsync(id); + } - [HttpGet] - [Route("{id}")] - public async virtual Task GetAsync(Guid id) - { - return await AuditLogAppService.GetAsync(id); - } + [HttpGet] + [Route("{id}")] + public async virtual Task GetAsync(Guid id) + { + return await AuditLogAppService.GetAsync(id); + } - [HttpGet] - public async virtual Task> GetListAsync(AuditLogGetByPagedDto input) - { - return await AuditLogAppService.GetListAsync(input); - } + [HttpGet] + public async virtual Task> GetListAsync(AuditLogGetByPagedDto input) + { + return await AuditLogAppService.GetListAsync(input); } } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN/Abp/Auditing/Logging/LogController.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN/Abp/Auditing/Logging/LogController.cs index 035455930..bbdfe0dd9 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN/Abp/Auditing/Logging/LogController.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN/Abp/Auditing/Logging/LogController.cs @@ -7,33 +7,32 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.AspNetCore.Mvc; -namespace LINGYUN.Abp.Auditing.Logging +namespace LINGYUN.Abp.Auditing.Logging; + +[RemoteService(Name = AuditingRemoteServiceConsts.RemoteServiceName)] +[Area("auditing")] +[ControllerName("logging")] +[Route("api/auditing/logging")] +[Authorize(AuditingPermissionNames.SystemLog.Default)] +public class LogController : AbpControllerBase, ILogAppService { - [RemoteService(Name = AuditingRemoteServiceConsts.RemoteServiceName)] - [Area("auditing")] - [ControllerName("logging")] - [Route("api/auditing/logging")] - [Authorize(AuditingPermissionNames.SystemLog.Default)] - public class LogController : AbpControllerBase, ILogAppService - { - private readonly ILogAppService _service; + private readonly ILogAppService _service; - public LogController(ILogAppService service) - { - _service = service; - } + public LogController(ILogAppService service) + { + _service = service; + } - [HttpGet] - [Route("{id}")] - public async virtual Task GetAsync(string id) - { - return await _service.GetAsync(id); - } + [HttpGet] + [Route("{id}")] + public async virtual Task GetAsync(string id) + { + return await _service.GetAsync(id); + } - [HttpGet] - public async virtual Task> GetListAsync(LogGetByPagedDto input) - { - return await _service.GetListAsync(input); - } + [HttpGet] + public async virtual Task> GetListAsync(LogGetByPagedDto input) + { + return await _service.GetListAsync(input); } } diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogController.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogController.cs index c4500293e..aaf5b2284 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogController.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.HttpApi/LINGYUN/Abp/Auditing/SecurityLogs/SecurityLogController.cs @@ -8,41 +8,40 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.AspNetCore.Mvc; -namespace LINGYUN.Abp.Auditing.SecurityLogs +namespace LINGYUN.Abp.Auditing.SecurityLogs; + +[RemoteService(Name = AuditingRemoteServiceConsts.RemoteServiceName)] +[Area("auditing")] +[ControllerName("security-log")] +[Route("api/auditing/security-log")] +[Authorize(AuditingPermissionNames.SecurityLog.Default)] +public class SecurityLogController : AbpControllerBase, ISecurityLogAppService { - [RemoteService(Name = AuditingRemoteServiceConsts.RemoteServiceName)] - [Area("auditing")] - [ControllerName("security-log")] - [Route("api/auditing/security-log")] - [Authorize(AuditingPermissionNames.SecurityLog.Default)] - public class SecurityLogController : AbpControllerBase, ISecurityLogAppService - { - protected ISecurityLogAppService SecurityLogAppService { get; } + protected ISecurityLogAppService SecurityLogAppService { get; } - public SecurityLogController(ISecurityLogAppService securityLogAppService) - { - SecurityLogAppService = securityLogAppService; - } + public SecurityLogController(ISecurityLogAppService securityLogAppService) + { + SecurityLogAppService = securityLogAppService; + } - [HttpDelete] - [Route("{id}")] - [Authorize(AuditingPermissionNames.SecurityLog.Delete)] - public async virtual Task DeleteAsync(Guid id) - { - await SecurityLogAppService.DeleteAsync(id); - } + [HttpDelete] + [Route("{id}")] + [Authorize(AuditingPermissionNames.SecurityLog.Delete)] + public async virtual Task DeleteAsync(Guid id) + { + await SecurityLogAppService.DeleteAsync(id); + } - [HttpGet] - [Route("{id}")] - public async virtual Task GetAsync(Guid id) - { - return await SecurityLogAppService.GetAsync(id); - } + [HttpGet] + [Route("{id}")] + public async virtual Task GetAsync(Guid id) + { + return await SecurityLogAppService.GetAsync(id); + } - [HttpGet] - public async virtual Task> GetListAsync(SecurityLogGetByPagedDto input) - { - return await SecurityLogAppService.GetListAsync(input); - } + [HttpGet] + public async virtual Task> GetListAsync(SecurityLogGetByPagedDto input) + { + return await SecurityLogAppService.GetListAsync(input); } } diff --git a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN.Abp.CachingManagement.Application.Contracts.csproj b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN.Abp.CachingManagement.Application.Contracts.csproj index 6181fd6b3..dc5c4c3cc 100644 --- a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN.Abp.CachingManagement.Application.Contracts.csproj +++ b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application.Contracts/LINGYUN.Abp.CachingManagement.Application.Contracts.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.CachingManagement.Application.Contracts + LINGYUN.Abp.CachingManagement.Application.Contracts + false + false + false diff --git a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application/LINGYUN.Abp.CachingManagement.Application.csproj b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application/LINGYUN.Abp.CachingManagement.Application.csproj index 8f50fd6a0..7b93ecde8 100644 --- a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application/LINGYUN.Abp.CachingManagement.Application.csproj +++ b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Application/LINGYUN.Abp.CachingManagement.Application.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.CachingManagement.Application + LINGYUN.Abp.CachingManagement.Application + false + false + false diff --git a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Domain/LINGYUN.Abp.CachingManagement.Domain.csproj b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Domain/LINGYUN.Abp.CachingManagement.Domain.csproj index 202302bd9..4fad3900f 100644 --- a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Domain/LINGYUN.Abp.CachingManagement.Domain.csproj +++ b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.Domain/LINGYUN.Abp.CachingManagement.Domain.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.CachingManagement.Domain + LINGYUN.Abp.CachingManagement.Domain + false + false + false diff --git a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.HttpApi/LINGYUN.Abp.CachingManagement.HttpApi.csproj b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.HttpApi/LINGYUN.Abp.CachingManagement.HttpApi.csproj index 0b5678345..5b41152f7 100644 --- a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.HttpApi/LINGYUN.Abp.CachingManagement.HttpApi.csproj +++ b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.HttpApi/LINGYUN.Abp.CachingManagement.HttpApi.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.CachingManagement.HttpApi + LINGYUN.Abp.CachingManagement.HttpApi + false + false + false diff --git a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.StackExchangeRedis/LINGYUN.Abp.CachingManagement.StackExchangeRedis.csproj b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.StackExchangeRedis/LINGYUN.Abp.CachingManagement.StackExchangeRedis.csproj index c20f0d27b..688e3015c 100644 --- a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.StackExchangeRedis/LINGYUN.Abp.CachingManagement.StackExchangeRedis.csproj +++ b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.StackExchangeRedis/LINGYUN.Abp.CachingManagement.StackExchangeRedis.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.CachingManagement.StackExchangeRedis + LINGYUN.Abp.CachingManagement.StackExchangeRedis + false + false + false diff --git a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.StackExchangeRedis/LINGYUN/Abp/CachingManagement/StackExchangeRedis/StackExchangeRedisCacheManager.cs b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.StackExchangeRedis/LINGYUN/Abp/CachingManagement/StackExchangeRedis/StackExchangeRedisCacheManager.cs index 97c8cb546..28049b23d 100644 --- a/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.StackExchangeRedis/LINGYUN/Abp/CachingManagement/StackExchangeRedis/StackExchangeRedisCacheManager.cs +++ b/aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.StackExchangeRedis/LINGYUN/Abp/CachingManagement/StackExchangeRedis/StackExchangeRedisCacheManager.cs @@ -226,14 +226,14 @@ public async virtual Task RemoveAsync(string key, CancellationToken cancellation await RedisCache.RemoveAsync(cacheKey, cancellationToken); } - protected virtual Task ConnectAsync(CancellationToken token = default) + protected virtual ValueTask ConnectAsync(CancellationToken token = default) { if (_redisDatabase != null) { - return Task.CompletedTask; + return default; } - return (Task)ConnectAsyncMethod.Invoke(RedisCache, new object[] { token }); + return (ValueTask)ConnectAsyncMethod.Invoke(RedisCache, new object[] { token }); } private IDatabase GetRedisDatabase() diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN.Abp.DataProtectionManagement.Application.Contracts.csproj b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN.Abp.DataProtectionManagement.Application.Contracts.csproj index b626759b0..2bae34244 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN.Abp.DataProtectionManagement.Application.Contracts.csproj +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application.Contracts/LINGYUN.Abp.DataProtectionManagement.Application.Contracts.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.DataProtectionManagement.Application.Contracts + LINGYUN.Abp.DataProtectionManagement.Application.Contracts + false + false + false diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/LINGYUN.Abp.DataProtectionManagement.Application.csproj b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/LINGYUN.Abp.DataProtectionManagement.Application.csproj index 097d686a1..b80986174 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/LINGYUN.Abp.DataProtectionManagement.Application.csproj +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/LINGYUN.Abp.DataProtectionManagement.Application.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.DataProtectionManagement.Application + LINGYUN.Abp.DataProtectionManagement.Application + false + false + false diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/LINGYUN.Abp.DataProtectionManagement.Domain.Shared.csproj b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/LINGYUN.Abp.DataProtectionManagement.Domain.Shared.csproj index f54d1b24b..8abcfdc0c 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/LINGYUN.Abp.DataProtectionManagement.Domain.Shared.csproj +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/LINGYUN.Abp.DataProtectionManagement.Domain.Shared.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.DataProtectionManagement.Domain.Shared + LINGYUN.Abp.DataProtectionManagement.Domain.Shared + false + false + false diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN.Abp.DataProtectionManagement.Domain.csproj b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN.Abp.DataProtectionManagement.Domain.csproj index 6278ebd29..c3e510525 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN.Abp.DataProtectionManagement.Domain.csproj +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN.Abp.DataProtectionManagement.Domain.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.DataProtectionManagement.Domain + LINGYUN.Abp.DataProtectionManagement.Domain + false + false + false diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore.csproj b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore.csproj index f5dfad05b..65c4807d2 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore.csproj +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore + LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore + false + false + false diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.HttpApi/LINGYUN.Abp.DataProtectionManagement.HttpApi.csproj b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.HttpApi/LINGYUN.Abp.DataProtectionManagement.HttpApi.csproj index 60d2f931b..dab30c861 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.HttpApi/LINGYUN.Abp.DataProtectionManagement.HttpApi.csproj +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.HttpApi/LINGYUN.Abp.DataProtectionManagement.HttpApi.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.DataProtectionManagement.HttpApi + LINGYUN.Abp.DataProtectionManagement.HttpApi + false + false + false diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.BlobStoring/LINGYUN.Abp.Elsa.Activities.BlobStoring.csproj b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.BlobStoring/LINGYUN.Abp.Elsa.Activities.BlobStoring.csproj index 961c17cb4..8d41d041b 100644 --- a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.BlobStoring/LINGYUN.Abp.Elsa.Activities.BlobStoring.csproj +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.BlobStoring/LINGYUN.Abp.Elsa.Activities.BlobStoring.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.Elsa.Activities.BlobStoring + LINGYUN.Abp.Elsa.Activities.BlobStoring + false + false + false Enable diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Emailing/LINGYUN.Abp.Elsa.Activities.Emailing.csproj b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Emailing/LINGYUN.Abp.Elsa.Activities.Emailing.csproj index 1a9a174fa..f30017e62 100644 --- a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Emailing/LINGYUN.Abp.Elsa.Activities.Emailing.csproj +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Emailing/LINGYUN.Abp.Elsa.Activities.Emailing.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.Elsa.Activities.Emailing + LINGYUN.Abp.Elsa.Activities.Emailing + false + false + false enable diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.IM/LINGYUN.Abp.Elsa.Activities.IM.csproj b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.IM/LINGYUN.Abp.Elsa.Activities.IM.csproj index 3b1f099e2..8e7dff6e0 100644 --- a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.IM/LINGYUN.Abp.Elsa.Activities.IM.csproj +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.IM/LINGYUN.Abp.Elsa.Activities.IM.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.Elsa.Activities.IM + LINGYUN.Abp.Elsa.Activities.IM + false + false + false enable diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Notifications/LINGYUN.Abp.Elsa.Activities.Notifications.csproj b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Notifications/LINGYUN.Abp.Elsa.Activities.Notifications.csproj index 4184b0a1e..928ff2f76 100644 --- a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Notifications/LINGYUN.Abp.Elsa.Activities.Notifications.csproj +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Notifications/LINGYUN.Abp.Elsa.Activities.Notifications.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.Elsa.Activities.Notifications + LINGYUN.Abp.Elsa.Activities.Notifications + false + false + false enable diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Sms/LINGYUN.Abp.Elsa.Activities.Sms.csproj b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Sms/LINGYUN.Abp.Elsa.Activities.Sms.csproj index 7563d5866..1076c9af1 100644 --- a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Sms/LINGYUN.Abp.Elsa.Activities.Sms.csproj +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Sms/LINGYUN.Abp.Elsa.Activities.Sms.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.Elsa.Activities.Sms + LINGYUN.Abp.Elsa.Activities.Sms + false + false + false enable diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Webhooks/LINGYUN.Abp.Elsa.Activities.Webhooks.csproj b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Webhooks/LINGYUN.Abp.Elsa.Activities.Webhooks.csproj index cafafa357..72b3a595e 100644 --- a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Webhooks/LINGYUN.Abp.Elsa.Activities.Webhooks.csproj +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Webhooks/LINGYUN.Abp.Elsa.Activities.Webhooks.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.Elsa.Activities.Webhooks + LINGYUN.Abp.Elsa.Activities.Webhooks + false + false + false enable diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities/LINGYUN.Abp.Elsa.Activities.csproj b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities/LINGYUN.Abp.Elsa.Activities.csproj index 2b438913d..30b079f77 100644 --- a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities/LINGYUN.Abp.Elsa.Activities.csproj +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities/LINGYUN.Abp.Elsa.Activities.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.Elsa.Activities + LINGYUN.Abp.Elsa.Activities + false + false + false Enable diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.MySql/LINGYUN.Abp.Elsa.EntityFrameworkCore.MySql.csproj b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.MySql/LINGYUN.Abp.Elsa.EntityFrameworkCore.MySql.csproj index a6b77f8ba..284f97c04 100644 --- a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.MySql/LINGYUN.Abp.Elsa.EntityFrameworkCore.MySql.csproj +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore.MySql/LINGYUN.Abp.Elsa.EntityFrameworkCore.MySql.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.Elsa.EntityFrameworkCore.MySql + LINGYUN.Abp.Elsa.EntityFrameworkCore.MySql + false + false + false diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore/LINGYUN.Abp.Elsa.EntityFrameworkCore.csproj b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore/LINGYUN.Abp.Elsa.EntityFrameworkCore.csproj index 7f45402a7..73370c9f0 100644 --- a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore/LINGYUN.Abp.Elsa.EntityFrameworkCore.csproj +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.EntityFrameworkCore/LINGYUN.Abp.Elsa.EntityFrameworkCore.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.Elsa.EntityFrameworkCore + LINGYUN.Abp.Elsa.EntityFrameworkCore + false + false + false diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Notifications/LINGYUN.Abp.Elsa.Notifications.csproj b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Notifications/LINGYUN.Abp.Elsa.Notifications.csproj index b818ac93a..3a20b6795 100644 --- a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Notifications/LINGYUN.Abp.Elsa.Notifications.csproj +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Notifications/LINGYUN.Abp.Elsa.Notifications.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.Elsa.Notifications + LINGYUN.Abp.Elsa.Notifications + false + false + false diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Server/LINGYUN.Abp.Elsa.Server.csproj b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Server/LINGYUN.Abp.Elsa.Server.csproj index bcb1f05ca..4d043265e 100644 --- a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Server/LINGYUN.Abp.Elsa.Server.csproj +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Server/LINGYUN.Abp.Elsa.Server.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.Elsa.Server + LINGYUN.Abp.Elsa.Server + false + false + false diff --git a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa/LINGYUN.Abp.Elsa.csproj b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa/LINGYUN.Abp.Elsa.csproj index c54f54b37..9e9c9842a 100644 --- a/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa/LINGYUN.Abp.Elsa.csproj +++ b/aspnet-core/modules/elsa/LINGYUN.Abp.Elsa/LINGYUN.Abp.Elsa.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.Elsa + LINGYUN.Abp.Elsa + false + false + false Enable diff --git a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN.Abp.FeatureManagement.Application.Contracts.csproj b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN.Abp.FeatureManagement.Application.Contracts.csproj index 190c317d1..ad374531a 100644 --- a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN.Abp.FeatureManagement.Application.Contracts.csproj +++ b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application.Contracts/LINGYUN.Abp.FeatureManagement.Application.Contracts.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.FeatureManagement.Application.Contracts + LINGYUN.Abp.FeatureManagement.Application.Contracts + false + false + false diff --git a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/LINGYUN.Abp.FeatureManagement.Application.csproj b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/LINGYUN.Abp.FeatureManagement.Application.csproj index 8e0dc6ad2..b71cfe61e 100644 --- a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/LINGYUN.Abp.FeatureManagement.Application.csproj +++ b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.Application/LINGYUN.Abp.FeatureManagement.Application.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.FeatureManagement.Application + LINGYUN.Abp.FeatureManagement.Application + false + false + false diff --git a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.HttpApi/LINGYUN.Abp.FeatureManagement.HttpApi.csproj b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.HttpApi/LINGYUN.Abp.FeatureManagement.HttpApi.csproj index 137a245eb..d03699e85 100644 --- a/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.HttpApi/LINGYUN.Abp.FeatureManagement.HttpApi.csproj +++ b/aspnet-core/modules/feature-management/LINGYUN.Abp.FeatureManagement.HttpApi/LINGYUN.Abp.FeatureManagement.HttpApi.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.FeatureManagement.HttpApi + LINGYUN.Abp.FeatureManagement.HttpApi + false + false + false diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN.Abp.Identity.Application.Contracts.csproj b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN.Abp.Identity.Application.Contracts.csproj index df9f404a4..98f01acc6 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN.Abp.Identity.Application.Contracts.csproj +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN.Abp.Identity.Application.Contracts.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Identity.Application.Contracts + LINGYUN.Abp.Identity.Application.Contracts + false + false + false diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/AbpIdentityApplicationContractsModule.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/AbpIdentityApplicationContractsModule.cs index 2af49dbb6..9f11d79cf 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/AbpIdentityApplicationContractsModule.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/AbpIdentityApplicationContractsModule.cs @@ -1,14 +1,13 @@ using Volo.Abp.Authorization; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +[DependsOn( + typeof(Volo.Abp.Identity.AbpIdentityApplicationContractsModule), + typeof(AbpIdentityDomainSharedModule), + typeof(AbpAuthorizationModule) + )] +public class AbpIdentityApplicationContractsModule : AbpModule { - [DependsOn( - typeof(Volo.Abp.Identity.AbpIdentityApplicationContractsModule), - typeof(AbpIdentityDomainSharedModule), - typeof(AbpAuthorizationModule) - )] - public class AbpIdentityApplicationContractsModule : AbpModule - { - } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/GetUserSessionsInput.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/GetUserSessionsInput.cs new file mode 100644 index 000000000..c595dfd43 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/GetUserSessionsInput.cs @@ -0,0 +1,19 @@ +using System; +using Volo.Abp.Application.Dtos; + +namespace LINGYUN.Abp.Identity; +public class GetUserSessionsInput : PagedAndSortedResultRequestDto +{ + /// + /// 用户id + /// + public Guid? UserId { get; set; } + /// + /// 设备 + /// + public string Device { get; set; } + /// + /// 客户端id + /// + public string ClientId { get; set; } +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimDto.cs index 830d0257c..b82dccf36 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimDto.cs @@ -1,12 +1,11 @@ using System; using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public class IdentityClaimDto : EntityDto { - public class IdentityClaimDto : EntityDto - { - public string ClaimType { get; set; } + public string ClaimType { get; set; } - public string ClaimValue { get; set; } - } + public string ClaimValue { get; set; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeCreateDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeCreateDto.cs index db10e20ac..a3566f72b 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeCreateDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeCreateDto.cs @@ -2,16 +2,15 @@ using Volo.Abp.Identity; using Volo.Abp.Validation; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public class IdentityClaimTypeCreateDto : IdentityClaimTypeCreateOrUpdateBaseDto { - public class IdentityClaimTypeCreateDto : IdentityClaimTypeCreateOrUpdateBaseDto - { - [Required] - [DynamicStringLength(typeof(IdentityClaimTypeConsts), nameof(IdentityClaimTypeConsts.MaxNameLength))] - public string Name { get; set; } + [Required] + [DynamicStringLength(typeof(IdentityClaimTypeConsts), nameof(IdentityClaimTypeConsts.MaxNameLength))] + public string Name { get; set; } - public bool IsStatic { get; set; } + public bool IsStatic { get; set; } - public IdentityClaimValueType ValueType { get; set; } - } + public IdentityClaimValueType ValueType { get; set; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeCreateOrUpdateBaseDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeCreateOrUpdateBaseDto.cs index 2ecbbc451..b6113c930 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeCreateOrUpdateBaseDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeCreateOrUpdateBaseDto.cs @@ -2,21 +2,20 @@ using Volo.Abp.ObjectExtending; using Volo.Abp.Validation; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public class IdentityClaimTypeCreateOrUpdateBaseDto : ExtensibleObject { - public class IdentityClaimTypeCreateOrUpdateBaseDto : ExtensibleObject - { - public bool Required { get; set; } + public bool Required { get; set; } - [DynamicStringLength(typeof(IdentityClaimTypeConsts), nameof(IdentityClaimTypeConsts.MaxRegexLength))] - public string Regex { get; set; } + [DynamicStringLength(typeof(IdentityClaimTypeConsts), nameof(IdentityClaimTypeConsts.MaxRegexLength))] + public string Regex { get; set; } - [DynamicStringLength(typeof(IdentityClaimTypeConsts), nameof(IdentityClaimTypeConsts.MaxRegexDescriptionLength))] - public string RegexDescription { get; set; } + [DynamicStringLength(typeof(IdentityClaimTypeConsts), nameof(IdentityClaimTypeConsts.MaxRegexDescriptionLength))] + public string RegexDescription { get; set; } - [DynamicStringLength(typeof(IdentityClaimTypeConsts), nameof(IdentityClaimTypeConsts.MaxDescriptionLength))] - public string Description { get; set; } + [DynamicStringLength(typeof(IdentityClaimTypeConsts), nameof(IdentityClaimTypeConsts.MaxDescriptionLength))] + public string Description { get; set; } - - } + } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeDto.cs index 232f100f2..467e72f51 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeDto.cs @@ -2,22 +2,21 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.Identity; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public class IdentityClaimTypeDto : ExtensibleEntityDto { - public class IdentityClaimTypeDto : ExtensibleEntityDto - { - public string Name { get; set; } + public string Name { get; set; } - public bool Required { get; set; } + public bool Required { get; set; } - public bool IsStatic { get; set; } + public bool IsStatic { get; set; } - public string Regex { get; set; } + public string Regex { get; set; } - public string RegexDescription { get; set; } + public string RegexDescription { get; set; } - public string Description { get; set; } + public string Description { get; set; } - public IdentityClaimValueType ValueType { get; set; } - } + public IdentityClaimValueType ValueType { get; set; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeGetByPagedDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeGetByPagedDto.cs index fa01326f3..66e788f11 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeGetByPagedDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeGetByPagedDto.cs @@ -1,9 +1,8 @@ using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public class IdentityClaimTypeGetByPagedDto : PagedAndSortedResultRequestDto { - public class IdentityClaimTypeGetByPagedDto : PagedAndSortedResultRequestDto - { - public string Filter { get; set; } - } + public string Filter { get; set; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeUpdateDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeUpdateDto.cs index 12b4767da..889a0b1fc 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeUpdateDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityClaimTypeUpdateDto.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public class IdentityClaimTypeUpdateDto : IdentityClaimTypeCreateOrUpdateBaseDto { - public class IdentityClaimTypeUpdateDto : IdentityClaimTypeCreateOrUpdateBaseDto - { - } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityRoleAddOrRemoveOrganizationUnitDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityRoleAddOrRemoveOrganizationUnitDto.cs index 195331e60..bda085d14 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityRoleAddOrRemoveOrganizationUnitDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityRoleAddOrRemoveOrganizationUnitDto.cs @@ -1,11 +1,10 @@ using System; using System.ComponentModel.DataAnnotations; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public class IdentityRoleAddOrRemoveOrganizationUnitDto { - public class IdentityRoleAddOrRemoveOrganizationUnitDto - { - [Required] - public Guid[] OrganizationUnitIds { get; set; } - } + [Required] + public Guid[] OrganizationUnitIds { get; set; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityRoleClaimCreateDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityRoleClaimCreateDto.cs index 5ea86218c..639d0cc04 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityRoleClaimCreateDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityRoleClaimCreateDto.cs @@ -2,16 +2,15 @@ using Volo.Abp.Identity; using Volo.Abp.Validation; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public class IdentityRoleClaimCreateDto { - public class IdentityRoleClaimCreateDto - { - [Required] - [DynamicMaxLength(typeof(IdentityRoleClaimConsts), nameof(IdentityRoleClaimConsts.MaxClaimTypeLength))] - public string ClaimType { get; set; } + [Required] + [DynamicMaxLength(typeof(IdentityRoleClaimConsts), nameof(IdentityRoleClaimConsts.MaxClaimTypeLength))] + public string ClaimType { get; set; } - [Required] - [DynamicMaxLength(typeof(IdentityRoleClaimConsts), nameof(IdentityRoleClaimConsts.MaxClaimValueLength))] - public string ClaimValue { get; set; } - } + [Required] + [DynamicMaxLength(typeof(IdentityRoleClaimConsts), nameof(IdentityRoleClaimConsts.MaxClaimValueLength))] + public string ClaimValue { get; set; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityRoleClaimDeleteDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityRoleClaimDeleteDto.cs index 0039311a3..022607f03 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityRoleClaimDeleteDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityRoleClaimDeleteDto.cs @@ -1,6 +1,5 @@ -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public class IdentityRoleClaimDeleteDto : IdentityRoleClaimCreateDto { - public class IdentityRoleClaimDeleteDto : IdentityRoleClaimCreateDto - { - } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityRoleClaimUpdateDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityRoleClaimUpdateDto.cs index 4d3aa00da..60f1754e0 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityRoleClaimUpdateDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityRoleClaimUpdateDto.cs @@ -2,12 +2,11 @@ using Volo.Abp.Identity; using Volo.Abp.Validation; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public class IdentityRoleClaimUpdateDto : IdentityRoleClaimCreateDto { - public class IdentityRoleClaimUpdateDto : IdentityRoleClaimCreateDto - { - [Required] - [DynamicMaxLength(typeof(IdentityRoleClaimConsts), nameof(IdentityRoleClaimConsts.MaxClaimValueLength))] - public string NewClaimValue { get; set; } - } + [Required] + [DynamicMaxLength(typeof(IdentityRoleClaimConsts), nameof(IdentityRoleClaimConsts.MaxClaimValueLength))] + public string NewClaimValue { get; set; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentitySessionDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentitySessionDto.cs new file mode 100644 index 000000000..77f8b7d63 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentitySessionDto.cs @@ -0,0 +1,22 @@ +using System; +using Volo.Abp.Application.Dtos; + +namespace LINGYUN.Abp.Identity; +public class IdentitySessionDto : EntityDto +{ + public string SessionId { get; set; } + + public string Device { get; set; } + + public string DeviceInfo { get; set; } + + public Guid UserId { get; set; } + + public string ClientId { get; set; } + + public string IpAddresses { get; set; } + + public DateTime SignedIn { get; set; } + + public DateTime? LastAccessed { get; set; } +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserClaimCreateDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserClaimCreateDto.cs index c8ecd8204..10d4d8aff 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserClaimCreateDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserClaimCreateDto.cs @@ -1,6 +1,5 @@ -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public class IdentityUserClaimCreateDto: IdentityUserClaimCreateOrUpdateDto { - public class IdentityUserClaimCreateDto: IdentityUserClaimCreateOrUpdateDto - { - } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserClaimCreateOrUpdateDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserClaimCreateOrUpdateDto.cs index 363bed550..ded7a71be 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserClaimCreateOrUpdateDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserClaimCreateOrUpdateDto.cs @@ -2,15 +2,14 @@ using Volo.Abp.Identity; using Volo.Abp.Validation; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public abstract class IdentityUserClaimCreateOrUpdateDto { - public abstract class IdentityUserClaimCreateOrUpdateDto - { - [Required] - [DynamicMaxLength(typeof(IdentityUserClaimConsts), nameof(IdentityUserClaimConsts.MaxClaimTypeLength))] - public string ClaimType { get; set; } + [Required] + [DynamicMaxLength(typeof(IdentityUserClaimConsts), nameof(IdentityUserClaimConsts.MaxClaimTypeLength))] + public string ClaimType { get; set; } - [DynamicMaxLength(typeof(IdentityUserClaimConsts), nameof(IdentityUserClaimConsts.MaxClaimValueLength))] - public string ClaimValue { get; set; } - } + [DynamicMaxLength(typeof(IdentityUserClaimConsts), nameof(IdentityUserClaimConsts.MaxClaimValueLength))] + public string ClaimValue { get; set; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserClaimDeleteDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserClaimDeleteDto.cs index 2f9851f85..54fdf8460 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserClaimDeleteDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserClaimDeleteDto.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public class IdentityUserClaimDeleteDto : IdentityUserClaimCreateDto { - public class IdentityUserClaimDeleteDto : IdentityUserClaimCreateDto - { - } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserClaimUpdateDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserClaimUpdateDto.cs index 78125b595..9210b103d 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserClaimUpdateDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserClaimUpdateDto.cs @@ -1,11 +1,10 @@ using Volo.Abp.Identity; using Volo.Abp.Validation; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public class IdentityUserClaimUpdateDto : IdentityUserClaimCreateOrUpdateDto { - public class IdentityUserClaimUpdateDto : IdentityUserClaimCreateOrUpdateDto - { - [DynamicMaxLength(typeof(IdentityUserClaimConsts), nameof(IdentityUserClaimConsts.MaxClaimValueLength))] - public string NewClaimValue { get; set; } - } + [DynamicMaxLength(typeof(IdentityUserClaimConsts), nameof(IdentityUserClaimConsts.MaxClaimValueLength))] + public string NewClaimValue { get; set; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserOrganizationUnitUpdateDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserOrganizationUnitUpdateDto.cs index f04c8cb36..57118f7d8 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserOrganizationUnitUpdateDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/IdentityUserOrganizationUnitUpdateDto.cs @@ -1,11 +1,10 @@ using System; using System.ComponentModel.DataAnnotations; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public class IdentityUserOrganizationUnitUpdateDto { - public class IdentityUserOrganizationUnitUpdateDto - { - [Required] - public Guid[] OrganizationUnitIds { get; set; } - } + [Required] + public Guid[] OrganizationUnitIds { get; set; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitAddRoleDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitAddRoleDto.cs index 8f569d831..dfc5590a6 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitAddRoleDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitAddRoleDto.cs @@ -2,11 +2,10 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public class OrganizationUnitAddRoleDto { - public class OrganizationUnitAddRoleDto - { - [Required] - public List RoleIds { get; set; } - } + [Required] + public List RoleIds { get; set; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitAddUserDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitAddUserDto.cs index 25e8627d6..829b177ce 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitAddUserDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitAddUserDto.cs @@ -2,11 +2,10 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public class OrganizationUnitAddUserDto { - public class OrganizationUnitAddUserDto - { - [Required] - public List UserIds { get; set; } - } + [Required] + public List UserIds { get; set; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitCreateDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitCreateDto.cs index a67e088f3..fb95f7f59 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitCreateDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitCreateDto.cs @@ -4,14 +4,13 @@ using Volo.Abp.ObjectExtending; using Volo.Abp.Validation; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public class OrganizationUnitCreateDto : ExtensibleObject { - public class OrganizationUnitCreateDto : ExtensibleObject - { - [Required] - [DynamicStringLength(typeof(OrganizationUnitConsts), nameof(OrganizationUnitConsts.MaxDisplayNameLength))] - public string DisplayName { get; set; } + [Required] + [DynamicStringLength(typeof(OrganizationUnitConsts), nameof(OrganizationUnitConsts.MaxDisplayNameLength))] + public string DisplayName { get; set; } - public Guid? ParentId { get; set; } - } + public Guid? ParentId { get; set; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitDto.cs index 8ee2a8fb4..d0257bf28 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitDto.cs @@ -1,12 +1,11 @@ using System; using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public class OrganizationUnitDto : ExtensibleAuditedEntityDto { - public class OrganizationUnitDto : ExtensibleAuditedEntityDto - { - public Guid? ParentId { get; set; } - public string Code { get; set; } - public string DisplayName { get; set; } - } + public Guid? ParentId { get; set; } + public string Code { get; set; } + public string DisplayName { get; set; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetByPagedDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetByPagedDto.cs index ebe951dd3..f41dff98a 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetByPagedDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetByPagedDto.cs @@ -1,9 +1,8 @@ using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public class OrganizationUnitGetByPagedDto : PagedAndSortedResultRequestDto { - public class OrganizationUnitGetByPagedDto : PagedAndSortedResultRequestDto - { - public string Filter { get; set; } - } + public string Filter { get; set; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetChildrenDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetChildrenDto.cs index 36c68a5cc..3b5039eda 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetChildrenDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetChildrenDto.cs @@ -2,12 +2,11 @@ using System.ComponentModel.DataAnnotations; using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public class OrganizationUnitGetChildrenDto : IEntityDto { - public class OrganizationUnitGetChildrenDto : IEntityDto - { - [Required] - public Guid Id { get; set; } - public bool Recursive { get; set; } - } + [Required] + public Guid Id { get; set; } + public bool Recursive { get; set; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetUnaddedRoleByPagedDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetUnaddedRoleByPagedDto.cs index ea676f21a..d030b9e8a 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetUnaddedRoleByPagedDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetUnaddedRoleByPagedDto.cs @@ -1,10 +1,9 @@ using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public class OrganizationUnitGetUnaddedRoleByPagedDto : PagedAndSortedResultRequestDto { - public class OrganizationUnitGetUnaddedRoleByPagedDto : PagedAndSortedResultRequestDto - { - public string Filter { get; set; } - } + public string Filter { get; set; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetUnaddedUserByPagedDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetUnaddedUserByPagedDto.cs index b64a13e36..3c77c9754 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetUnaddedUserByPagedDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitGetUnaddedUserByPagedDto.cs @@ -1,9 +1,8 @@ using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public class OrganizationUnitGetUnaddedUserByPagedDto : PagedAndSortedResultRequestDto { - public class OrganizationUnitGetUnaddedUserByPagedDto : PagedAndSortedResultRequestDto - { - public string Filter { get; set; } - } + public string Filter { get; set; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitMoveDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitMoveDto.cs index 0ef51015d..d2b57430a 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitMoveDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitMoveDto.cs @@ -1,9 +1,8 @@ using System; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public class OrganizationUnitMoveDto { - public class OrganizationUnitMoveDto - { - public Guid? ParentId { get; set; } - } + public Guid? ParentId { get; set; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitUpdateDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitUpdateDto.cs index 1c48b6191..6c55186dd 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitUpdateDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/OrganizationUnitUpdateDto.cs @@ -1,9 +1,8 @@ using Volo.Abp.ObjectExtending; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public class OrganizationUnitUpdateDto : ExtensibleObject { - public class OrganizationUnitUpdateDto : ExtensibleObject - { - public string DisplayName { get; set; } - } + public string DisplayName { get; set; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/TwoFactorEnabledDto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/TwoFactorEnabledDto.cs index e1dd97dd9..baed1af2c 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/TwoFactorEnabledDto.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/Dto/TwoFactorEnabledDto.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public class TwoFactorEnabledDto { - public class TwoFactorEnabledDto - { - public bool Enabled { get; set; } - } + public bool Enabled { get; set; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IIdentityClaimTypeAppService.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IIdentityClaimTypeAppService.cs index 5bfb1e53b..0ba96a310 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IIdentityClaimTypeAppService.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IIdentityClaimTypeAppService.cs @@ -3,16 +3,15 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public interface IIdentityClaimTypeAppService : + ICrudAppService< + IdentityClaimTypeDto, + Guid, + IdentityClaimTypeGetByPagedDto, + IdentityClaimTypeCreateDto, + IdentityClaimTypeUpdateDto> { - public interface IIdentityClaimTypeAppService : - ICrudAppService< - IdentityClaimTypeDto, - Guid, - IdentityClaimTypeGetByPagedDto, - IdentityClaimTypeCreateDto, - IdentityClaimTypeUpdateDto> - { - Task> GetAllListAsync(); - } + Task> GetAllListAsync(); } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IIdentityRoleAppService.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IIdentityRoleAppService.cs index 51b3f955a..040aaea3e 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IIdentityRoleAppService.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IIdentityRoleAppService.cs @@ -3,30 +3,29 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public interface IIdentityRoleAppService : IApplicationService { - public interface IIdentityRoleAppService : IApplicationService - { - #region OrganizationUnit + #region OrganizationUnit - Task> GetOrganizationUnitsAsync(Guid id); + Task> GetOrganizationUnitsAsync(Guid id); - Task SetOrganizationUnitsAsync(Guid id, IdentityRoleAddOrRemoveOrganizationUnitDto input); + Task SetOrganizationUnitsAsync(Guid id, IdentityRoleAddOrRemoveOrganizationUnitDto input); - Task RemoveOrganizationUnitsAsync(Guid id, Guid ouId); + Task RemoveOrganizationUnitsAsync(Guid id, Guid ouId); - #endregion + #endregion - #region ClaimType + #region ClaimType - Task> GetClaimsAsync(Guid id); + Task> GetClaimsAsync(Guid id); - Task AddClaimAsync(Guid id, IdentityRoleClaimCreateDto input); + Task AddClaimAsync(Guid id, IdentityRoleClaimCreateDto input); - Task UpdateClaimAsync(Guid id, IdentityRoleClaimUpdateDto input); + Task UpdateClaimAsync(Guid id, IdentityRoleClaimUpdateDto input); - Task DeleteClaimAsync(Guid id, IdentityRoleClaimDeleteDto input); + Task DeleteClaimAsync(Guid id, IdentityRoleClaimDeleteDto input); - #endregion - } + #endregion } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IIdentitySessionAppService.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IIdentitySessionAppService.cs new file mode 100644 index 000000000..0e3255c6d --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IIdentitySessionAppService.cs @@ -0,0 +1,19 @@ +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; + +namespace LINGYUN.Abp.Identity; +public interface IIdentitySessionAppService +{ + /// + /// 获取用户会话列表 + /// + /// + /// + Task> GetSessionsAsync(GetUserSessionsInput input); + /// + /// 撤销用户会话 + /// + /// 会话id + /// + Task RevokeSessionAsync(string sessionId); +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IIdentityUserAppService.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IIdentityUserAppService.cs index 682e2653d..d64998662 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IIdentityUserAppService.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IIdentityUserAppService.cs @@ -2,61 +2,59 @@ using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; -using Volo.Abp.Identity; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public interface IIdentityUserAppService : IApplicationService { - public interface IIdentityUserAppService : IApplicationService - { - - #region OrganizationUnit - - Task> GetOrganizationUnitsAsync(Guid id); - - Task SetOrganizationUnitsAsync(Guid id, IdentityUserOrganizationUnitUpdateDto input); - - Task RemoveOrganizationUnitsAsync(Guid id, Guid ouId); - - #endregion - - #region ClaimType - - Task> GetClaimsAsync(Guid id); - - Task AddClaimAsync(Guid id, IdentityUserClaimCreateDto input); - - Task UpdateClaimAsync(Guid id, IdentityUserClaimUpdateDto input); - - Task DeleteClaimAsync(Guid id, IdentityUserClaimDeleteDto input); - - #endregion - - /// - /// 变更用户双因素验证选项 - /// - /// - /// - /// - Task ChangeTwoFactorEnabledAsync(Guid id, TwoFactorEnabledDto input); - /// - /// 变更用户密码 - /// - /// - /// - /// - Task ChangePasswordAsync(Guid id, IdentityUserSetPasswordInput input); - /// - /// 锁定 - /// - /// - /// 锁定时长 - /// - Task LockAsync(Guid id, int seconds); - /// - /// 解除锁定 - /// - /// - /// - Task UnLockAsync(Guid id); - } + + #region OrganizationUnit + + Task> GetOrganizationUnitsAsync(Guid id); + + Task SetOrganizationUnitsAsync(Guid id, IdentityUserOrganizationUnitUpdateDto input); + + Task RemoveOrganizationUnitsAsync(Guid id, Guid ouId); + + #endregion + + #region ClaimType + + Task> GetClaimsAsync(Guid id); + + Task AddClaimAsync(Guid id, IdentityUserClaimCreateDto input); + + Task UpdateClaimAsync(Guid id, IdentityUserClaimUpdateDto input); + + Task DeleteClaimAsync(Guid id, IdentityUserClaimDeleteDto input); + + #endregion + + /// + /// 变更用户双因素验证选项 + /// + /// + /// + /// + Task ChangeTwoFactorEnabledAsync(Guid id, TwoFactorEnabledDto input); + /// + /// 变更用户密码 + /// + /// + /// + /// + Task ChangePasswordAsync(Guid id, IdentityUserSetPasswordInput input); + /// + /// 锁定 + /// + /// + /// 锁定时长 + /// + Task LockAsync(Guid id, int seconds); + /// + /// 解除锁定 + /// + /// + /// + Task UnLockAsync(Guid id); } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IOrganizationUnitAppService.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IOrganizationUnitAppService.cs index 7e0c43fa2..089ecbb39 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IOrganizationUnitAppService.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IOrganizationUnitAppService.cs @@ -4,37 +4,36 @@ using Volo.Abp.Application.Services; using Volo.Abp.Identity; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public interface IOrganizationUnitAppService : + ICrudAppService { - public interface IOrganizationUnitAppService : - ICrudAppService - { - Task> GetAllListAsync(); + Task> GetAllListAsync(); - Task GetLastChildOrNullAsync(Guid? parentId); + Task GetLastChildOrNullAsync(Guid? parentId); - Task MoveAsync(Guid id, OrganizationUnitMoveDto input); + Task MoveAsync(Guid id, OrganizationUnitMoveDto input); - Task> GetRootAsync(); + Task> GetRootAsync(); - Task> FindChildrenAsync(OrganizationUnitGetChildrenDto input); + Task> FindChildrenAsync(OrganizationUnitGetChildrenDto input); - Task> GetRoleNamesAsync(Guid id); + Task> GetRoleNamesAsync(Guid id); - Task> GetUnaddedRolesAsync(Guid id, OrganizationUnitGetUnaddedRoleByPagedDto input); + Task> GetUnaddedRolesAsync(Guid id, OrganizationUnitGetUnaddedRoleByPagedDto input); - Task> GetRolesAsync(Guid id, PagedAndSortedResultRequestDto input); + Task> GetRolesAsync(Guid id, PagedAndSortedResultRequestDto input); - Task AddRolesAsync(Guid id, OrganizationUnitAddRoleDto input); + Task AddRolesAsync(Guid id, OrganizationUnitAddRoleDto input); - Task> GetUnaddedUsersAsync(Guid id, OrganizationUnitGetUnaddedUserByPagedDto input); + Task> GetUnaddedUsersAsync(Guid id, OrganizationUnitGetUnaddedUserByPagedDto input); - Task> GetUsersAsync(Guid id, GetIdentityUsersInput input); + Task> GetUsersAsync(Guid id, GetIdentityUsersInput input); - Task AddUsersAsync(Guid id, OrganizationUnitAddUserDto input); - } + Task AddUsersAsync(Guid id, OrganizationUnitAddUserDto input); } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IdentityPermissionDefinitionProvider.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IdentityPermissionDefinitionProvider.cs index a4df4cab1..562b8c7b5 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IdentityPermissionDefinitionProvider.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IdentityPermissionDefinitionProvider.cs @@ -3,49 +3,51 @@ using Volo.Abp.Localization; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public class IdentityPermissionDefinitionProvider : PermissionDefinitionProvider { - public class IdentityPermissionDefinitionProvider : PermissionDefinitionProvider + public override void Define(IPermissionDefinitionContext context) { - public override void Define(IPermissionDefinitionContext context) + var identityGroup = context.GetGroupOrNull(Volo.Abp.Identity.IdentityPermissions.GroupName); + if (identityGroup != null) { - var identityGroup = context.GetGroupOrNull(Volo.Abp.Identity.IdentityPermissions.GroupName); - if (identityGroup != null) + var userPermission = identityGroup.GetPermissionOrNull(Volo.Abp.Identity.IdentityPermissions.Users.Default); + if (userPermission != null) { - var userPermission = identityGroup.GetPermissionOrNull(Volo.Abp.Identity.IdentityPermissions.Users.Default); - if (userPermission != null) - { - userPermission.AddChild(IdentityPermissions.Users.ResetPassword, L("Permission:ResetPassword")); - userPermission.AddChild(IdentityPermissions.Users.ManageClaims, L("Permission:ManageClaims")); - userPermission.AddChild(IdentityPermissions.Users.ManageOrganizationUnits, L("Permission:ManageOrganizationUnits")); - } + userPermission.AddChild(IdentityPermissions.Users.ResetPassword, L("Permission:ResetPassword")); + userPermission.AddChild(IdentityPermissions.Users.ManageClaims, L("Permission:ManageClaims")); + userPermission.AddChild(IdentityPermissions.Users.ManageOrganizationUnits, L("Permission:ManageOrganizationUnits")); + } - var rolePermission = identityGroup.GetPermissionOrNull(Volo.Abp.Identity.IdentityPermissions.Roles.Default); - if (rolePermission != null) - { - rolePermission.AddChild(IdentityPermissions.Roles.ManageClaims, L("Permission:ManageClaims")); - rolePermission.AddChild(IdentityPermissions.Roles.ManageOrganizationUnits, L("Permission:ManageOrganizationUnits")); - } + var rolePermission = identityGroup.GetPermissionOrNull(Volo.Abp.Identity.IdentityPermissions.Roles.Default); + if (rolePermission != null) + { + rolePermission.AddChild(IdentityPermissions.Roles.ManageClaims, L("Permission:ManageClaims")); + rolePermission.AddChild(IdentityPermissions.Roles.ManageOrganizationUnits, L("Permission:ManageOrganizationUnits")); + } - var origanizationUnitPermission = identityGroup.AddPermission(IdentityPermissions.OrganizationUnits.Default, L("Permission:OrganizationUnitManagement")); - origanizationUnitPermission.AddChild(IdentityPermissions.OrganizationUnits.Create, L("Permission:Create")); - origanizationUnitPermission.AddChild(IdentityPermissions.OrganizationUnits.Update, L("Permission:Edit")); - origanizationUnitPermission.AddChild(IdentityPermissions.OrganizationUnits.Delete, L("Permission:Delete")); - origanizationUnitPermission.AddChild(IdentityPermissions.OrganizationUnits.ManageRoles, L("Permission:ManageRoles")); - origanizationUnitPermission.AddChild(IdentityPermissions.OrganizationUnits.ManageUsers, L("Permission:ManageUsers")); - origanizationUnitPermission.AddChild(IdentityPermissions.OrganizationUnits.ManagePermissions, L("Permission:ChangePermissions")); + var sessionPermission = identityGroup.AddPermission(IdentityPermissions.IdentitySession.Default, L("Permission:IdentitySessions")); + sessionPermission.AddChild(IdentityPermissions.IdentitySession.Revoke, L("Permission:RevokeSession")); - // 2020-10-23 修复Bug 租户用户也必须能查询自定义的声明, 管理权限只能为主机 - var identityClaimType = identityGroup.AddPermission(IdentityPermissions.IdentityClaimType.Default, L("Permission:IdentityClaimTypeManagement")); - identityClaimType.AddChild(IdentityPermissions.IdentityClaimType.Create, L("Permission:Create"), MultiTenancySides.Host); - identityClaimType.AddChild(IdentityPermissions.IdentityClaimType.Update, L("Permission:Edit"), MultiTenancySides.Host); - identityClaimType.AddChild(IdentityPermissions.IdentityClaimType.Delete, L("Permission:Delete"), MultiTenancySides.Host); - } - } + var origanizationUnitPermission = identityGroup.AddPermission(IdentityPermissions.OrganizationUnits.Default, L("Permission:OrganizationUnitManagement")); + origanizationUnitPermission.AddChild(IdentityPermissions.OrganizationUnits.Create, L("Permission:Create")); + origanizationUnitPermission.AddChild(IdentityPermissions.OrganizationUnits.Update, L("Permission:Edit")); + origanizationUnitPermission.AddChild(IdentityPermissions.OrganizationUnits.Delete, L("Permission:Delete")); + origanizationUnitPermission.AddChild(IdentityPermissions.OrganizationUnits.ManageRoles, L("Permission:ManageRoles")); + origanizationUnitPermission.AddChild(IdentityPermissions.OrganizationUnits.ManageUsers, L("Permission:ManageUsers")); + origanizationUnitPermission.AddChild(IdentityPermissions.OrganizationUnits.ManagePermissions, L("Permission:ChangePermissions")); - private static LocalizableString L(string name) - { - return LocalizableString.Create(name); + // 2020-10-23 修复Bug 租户用户也必须能查询自定义的声明, 管理权限只能为主机 + var identityClaimType = identityGroup.AddPermission(IdentityPermissions.IdentityClaimType.Default, L("Permission:IdentityClaimTypeManagement")); + identityClaimType.AddChild(IdentityPermissions.IdentityClaimType.Create, L("Permission:Create"), MultiTenancySides.Host); + identityClaimType.AddChild(IdentityPermissions.IdentityClaimType.Update, L("Permission:Edit"), MultiTenancySides.Host); + identityClaimType.AddChild(IdentityPermissions.IdentityClaimType.Delete, L("Permission:Delete"), MultiTenancySides.Host); } } + + private static LocalizableString L(string name) + { + return LocalizableString.Create(name); + } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IdentityPermissions.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IdentityPermissions.cs index c7d34cf8d..0bb2ec123 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IdentityPermissions.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application.Contracts/LINGYUN/Abp/Identity/IdentityPermissions.cs @@ -1,44 +1,50 @@ using Volo.Abp.Reflection; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public class IdentityPermissions { - public class IdentityPermissions + public static class Roles + { + public const string ManageClaims = Volo.Abp.Identity.IdentityPermissions.Roles.Default + ".ManageClaims"; + public const string ManageOrganizationUnits = Volo.Abp.Identity.IdentityPermissions.Roles.Default + ".ManageOrganizationUnits"; + } + + public static class Users + { + public const string ResetPassword = Volo.Abp.Identity.IdentityPermissions.Users.Default + ".ResetPassword"; + public const string ManageClaims = Volo.Abp.Identity.IdentityPermissions.Users.Default + ".ManageClaims"; + public const string ManageOrganizationUnits = Volo.Abp.Identity.IdentityPermissions.Users.Default + ".ManageOrganizationUnits"; + } + + public static class OrganizationUnits + { + public const string Default = Volo.Abp.Identity.IdentityPermissions.GroupName + ".OrganizationUnits"; + public const string Create = Default + ".Create"; + public const string Update = Default + ".Update"; + public const string Delete = Default + ".Delete"; + public const string ManageUsers = Default + ".ManageUsers"; + public const string ManageRoles = Default + ".ManageRoles"; + public const string ManagePermissions = Default + ".ManagePermissions"; + } + + public static class IdentityClaimType + { + public const string Default = Volo.Abp.Identity.IdentityPermissions.GroupName + ".IdentityClaimTypes"; + public const string Create = Default + ".Create"; + public const string Update = Default + ".Update"; + public const string Delete = Default + ".Delete"; + } + + public static class IdentitySession + { + public const string Default = Volo.Abp.Identity.IdentityPermissions.GroupName + ".IdentitySessions"; + + public const string Revoke = Default + ".Revoke"; + } + + public static string[] GetAll() { - public static class Roles - { - public const string ManageClaims = Volo.Abp.Identity.IdentityPermissions.Roles.Default + ".ManageClaims"; - public const string ManageOrganizationUnits = Volo.Abp.Identity.IdentityPermissions.Roles.Default + ".ManageOrganizationUnits"; - } - - public static class Users - { - public const string ResetPassword = Volo.Abp.Identity.IdentityPermissions.Users.Default + ".ResetPassword"; - public const string ManageClaims = Volo.Abp.Identity.IdentityPermissions.Users.Default + ".ManageClaims"; - public const string ManageOrganizationUnits = Volo.Abp.Identity.IdentityPermissions.Users.Default + ".ManageOrganizationUnits"; - } - - public static class OrganizationUnits - { - public const string Default = Volo.Abp.Identity.IdentityPermissions.GroupName + ".OrganizationUnits"; - public const string Create = Default + ".Create"; - public const string Update = Default + ".Update"; - public const string Delete = Default + ".Delete"; - public const string ManageUsers = Default + ".ManageUsers"; - public const string ManageRoles = Default + ".ManageRoles"; - public const string ManagePermissions = Default + ".ManagePermissions"; - } - - public static class IdentityClaimType - { - public const string Default = Volo.Abp.Identity.IdentityPermissions.GroupName + ".IdentityClaimTypes"; - public const string Create = Default + ".Create"; - public const string Update = Default + ".Update"; - public const string Delete = Default + ".Delete"; - } - - public static string[] GetAll() - { - return ReflectionHelper.GetPublicConstantsRecursively(typeof(IdentityPermissions)); - } + return ReflectionHelper.GetPublicConstantsRecursively(typeof(IdentityPermissions)); } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN.Abp.Identity.Application.csproj b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN.Abp.Identity.Application.csproj index 320c73e11..d5f5e0445 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN.Abp.Identity.Application.csproj +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN.Abp.Identity.Application.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.Identity.Application + LINGYUN.Abp.Identity.Application + false + false + false diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/AbpIdentityApplicationModule.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/AbpIdentityApplicationModule.cs index 6741bf79d..cb6485410 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/AbpIdentityApplicationModule.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/AbpIdentityApplicationModule.cs @@ -2,41 +2,40 @@ using Volo.Abp.AutoMapper; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +[DependsOn( + typeof(Volo.Abp.Identity.AbpIdentityApplicationModule), + typeof(AbpIdentityApplicationContractsModule), + typeof(AbpIdentityDomainModule))] +public class AbpIdentityApplicationModule : AbpModule { - [DependsOn( - typeof(Volo.Abp.Identity.AbpIdentityApplicationModule), - typeof(AbpIdentityApplicationContractsModule), - typeof(AbpIdentityDomainModule))] - public class AbpIdentityApplicationModule : AbpModule + // private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); + public override void ConfigureServices(ServiceConfigurationContext context) { - // private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddAutoMapperObjectMapper(); - - Configure(options => - { - options.AddProfile(validate: true); - }); - } + context.Services.AddAutoMapperObjectMapper(); - //public override void PostConfigureServices(ServiceConfigurationContext context) - //{ - // OneTimeRunner.Run(() => - // { - // ObjectExtensionManager.Instance - // .AddOrUpdateProperty( - // new[] - // { - // typeof(IdentityUserDto), - // typeof(IdentityUserCreateDto), - // typeof(IdentityUserUpdateDto), - // typeof(ProfileDto), - // typeof(UpdateProfileDto) - // }, - // ExtensionIdentityUserConsts.AvatarUrlField); - // }); - //} + Configure(options => + { + options.AddProfile(validate: true); + }); } + + //public override void PostConfigureServices(ServiceConfigurationContext context) + //{ + // OneTimeRunner.Run(() => + // { + // ObjectExtensionManager.Instance + // .AddOrUpdateProperty( + // new[] + // { + // typeof(IdentityUserDto), + // typeof(IdentityUserCreateDto), + // typeof(IdentityUserUpdateDto), + // typeof(ProfileDto), + // typeof(UpdateProfileDto) + // }, + // ExtensionIdentityUserConsts.AvatarUrlField); + // }); + //} } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/AbpIdentityApplicationModuleAutoMapperProfile.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/AbpIdentityApplicationModuleAutoMapperProfile.cs index 221c5ab69..8fc74af91 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/AbpIdentityApplicationModuleAutoMapperProfile.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/AbpIdentityApplicationModuleAutoMapperProfile.cs @@ -1,25 +1,26 @@ using AutoMapper; using Volo.Abp.Identity; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public class AbpIdentityApplicationModuleAutoMapperProfile : Profile { - public class AbpIdentityApplicationModuleAutoMapperProfile : Profile + public AbpIdentityApplicationModuleAutoMapperProfile() { - public AbpIdentityApplicationModuleAutoMapperProfile() - { - CreateMap() - .MapExtraProperties(); - CreateMap(); - CreateMap(); + CreateMap() + .MapExtraProperties(); + CreateMap(); + CreateMap(); + + CreateMap() + .MapExtraProperties(); - CreateMap() - .MapExtraProperties(); + CreateMap(); - CreateMap() - .MapExtraProperties(); + CreateMap() + .MapExtraProperties(); - CreateMap() - .MapExtraProperties(); - } + CreateMap() + .MapExtraProperties(); } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/IdentityClaimTypeAppService.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/IdentityClaimTypeAppService.cs index 920d37789..5504bd531 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/IdentityClaimTypeAppService.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/IdentityClaimTypeAppService.cs @@ -6,124 +6,123 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.Identity; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +[Authorize(IdentityPermissions.IdentityClaimType.Default)] +public class IdentityClaimTypeAppService : IdentityAppServiceBase, IIdentityClaimTypeAppService { - [Authorize(IdentityPermissions.IdentityClaimType.Default)] - public class IdentityClaimTypeAppService : IdentityAppServiceBase, IIdentityClaimTypeAppService - { - protected IdentityClaimTypeManager IdentityClaimTypeManager { get; } + protected IdentityClaimTypeManager IdentityClaimTypeManager { get; } - protected IIdentityClaimTypeRepository IdentityClaimTypeRepository { get; } + protected IIdentityClaimTypeRepository IdentityClaimTypeRepository { get; } - public IdentityClaimTypeAppService( - IdentityClaimTypeManager identityClaimTypeManager, - IIdentityClaimTypeRepository identityClaimTypeRepository) - { - IdentityClaimTypeManager = identityClaimTypeManager; - IdentityClaimTypeRepository = identityClaimTypeRepository; - } + public IdentityClaimTypeAppService( + IdentityClaimTypeManager identityClaimTypeManager, + IIdentityClaimTypeRepository identityClaimTypeRepository) + { + IdentityClaimTypeManager = identityClaimTypeManager; + IdentityClaimTypeRepository = identityClaimTypeRepository; + } - [Authorize(IdentityPermissions.IdentityClaimType.Create)] - public async virtual Task CreateAsync(IdentityClaimTypeCreateDto input) + [Authorize(IdentityPermissions.IdentityClaimType.Create)] + public async virtual Task CreateAsync(IdentityClaimTypeCreateDto input) + { + if (await IdentityClaimTypeRepository.AnyAsync(input.Name)) { - if (await IdentityClaimTypeRepository.AnyAsync(input.Name)) - { - throw new UserFriendlyException(L["IdentityClaimTypeAlreadyExists", input.Name]); - } - var identityClaimType = new IdentityClaimType( - GuidGenerator.Create(), - input.Name, - input.Required, - input.IsStatic, - input.Regex, - input.RegexDescription, - input.Description, - input.ValueType - ); - identityClaimType = await IdentityClaimTypeManager.CreateAsync(identityClaimType); - await CurrentUnitOfWork.SaveChangesAsync(); - - return ObjectMapper.Map(identityClaimType); + throw new UserFriendlyException(L["IdentityClaimTypeAlreadyExists", input.Name]); } + var identityClaimType = new IdentityClaimType( + GuidGenerator.Create(), + input.Name, + input.Required, + input.IsStatic, + input.Regex, + input.RegexDescription, + input.Description, + input.ValueType + ); + identityClaimType = await IdentityClaimTypeManager.CreateAsync(identityClaimType); + await CurrentUnitOfWork.SaveChangesAsync(); + + return ObjectMapper.Map(identityClaimType); + } - [Authorize(IdentityPermissions.IdentityClaimType.Delete)] - public async virtual Task DeleteAsync(Guid id) + [Authorize(IdentityPermissions.IdentityClaimType.Delete)] + public async virtual Task DeleteAsync(Guid id) + { + var identityClaimType = await IdentityClaimTypeRepository.FindAsync(id); + if (identityClaimType == null) { - var identityClaimType = await IdentityClaimTypeRepository.FindAsync(id); - if (identityClaimType == null) - { - return; - } - CheckDeletionClaimType(identityClaimType); - await IdentityClaimTypeRepository.DeleteAsync(identityClaimType); + return; } + CheckDeletionClaimType(identityClaimType); + await IdentityClaimTypeRepository.DeleteAsync(identityClaimType); + } - public async virtual Task GetAsync(Guid id) - { - var identityClaimType = await IdentityClaimTypeRepository.FindAsync(id); + public async virtual Task GetAsync(Guid id) + { + var identityClaimType = await IdentityClaimTypeRepository.FindAsync(id); - return ObjectMapper.Map(identityClaimType); - } + return ObjectMapper.Map(identityClaimType); + } - public async virtual Task> GetAllListAsync() - { - var identityClaimTypes = await IdentityClaimTypeRepository - .GetListAsync(); + public async virtual Task> GetAllListAsync() + { + var identityClaimTypes = await IdentityClaimTypeRepository + .GetListAsync(); - return new ListResultDto( - ObjectMapper.Map, List>(identityClaimTypes)); - } + return new ListResultDto( + ObjectMapper.Map, List>(identityClaimTypes)); + } - public async virtual Task> GetListAsync(IdentityClaimTypeGetByPagedDto input) - { - var identityClaimTypeCount = await IdentityClaimTypeRepository.GetCountAsync(input.Filter); + public async virtual Task> GetListAsync(IdentityClaimTypeGetByPagedDto input) + { + var identityClaimTypeCount = await IdentityClaimTypeRepository.GetCountAsync(input.Filter); - var identityClaimTypes = await IdentityClaimTypeRepository - .GetListAsync(input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter); + var identityClaimTypes = await IdentityClaimTypeRepository + .GetListAsync(input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter); - return new PagedResultDto(identityClaimTypeCount, - ObjectMapper.Map, List>(identityClaimTypes)); - } + return new PagedResultDto(identityClaimTypeCount, + ObjectMapper.Map, List>(identityClaimTypes)); + } - [Authorize(IdentityPermissions.IdentityClaimType.Update)] - public async virtual Task UpdateAsync(Guid id, IdentityClaimTypeUpdateDto input) + [Authorize(IdentityPermissions.IdentityClaimType.Update)] + public async virtual Task UpdateAsync(Guid id, IdentityClaimTypeUpdateDto input) + { + var identityClaimType = await IdentityClaimTypeRepository.GetAsync(id); + CheckChangingClaimType(identityClaimType); + identityClaimType.Required = input.Required; + if (!string.Equals(identityClaimType.Regex, input.Regex, StringComparison.InvariantCultureIgnoreCase)) + { + identityClaimType.Regex = input.Regex; + } + if (!string.Equals(identityClaimType.RegexDescription, input.RegexDescription, StringComparison.InvariantCultureIgnoreCase)) { - var identityClaimType = await IdentityClaimTypeRepository.GetAsync(id); - CheckChangingClaimType(identityClaimType); - identityClaimType.Required = input.Required; - if (!string.Equals(identityClaimType.Regex, input.Regex, StringComparison.InvariantCultureIgnoreCase)) - { - identityClaimType.Regex = input.Regex; - } - if (!string.Equals(identityClaimType.RegexDescription, input.RegexDescription, StringComparison.InvariantCultureIgnoreCase)) - { - identityClaimType.RegexDescription = input.RegexDescription; - } - if (!string.Equals(identityClaimType.Description, input.Description, StringComparison.InvariantCultureIgnoreCase)) - { - identityClaimType.Description = input.Description; - } - - identityClaimType = await IdentityClaimTypeManager.UpdateAsync(identityClaimType); - await CurrentUnitOfWork.SaveChangesAsync(); - - return ObjectMapper.Map(identityClaimType); + identityClaimType.RegexDescription = input.RegexDescription; } + if (!string.Equals(identityClaimType.Description, input.Description, StringComparison.InvariantCultureIgnoreCase)) + { + identityClaimType.Description = input.Description; + } + + identityClaimType = await IdentityClaimTypeManager.UpdateAsync(identityClaimType); + await CurrentUnitOfWork.SaveChangesAsync(); + + return ObjectMapper.Map(identityClaimType); + } - protected virtual void CheckChangingClaimType(IdentityClaimType claimType) + protected virtual void CheckChangingClaimType(IdentityClaimType claimType) + { + if (claimType.IsStatic) { - if (claimType.IsStatic) - { - throw new BusinessException(IdentityErrorCodes.StaticClaimTypeChange); - } + throw new BusinessException(IdentityErrorCodes.StaticClaimTypeChange); } + } - protected virtual void CheckDeletionClaimType(IdentityClaimType claimType) + protected virtual void CheckDeletionClaimType(IdentityClaimType claimType) + { + if (claimType.IsStatic) { - if (claimType.IsStatic) - { - throw new BusinessException(IdentityErrorCodes.StaticClaimTypeDeletion); - } + throw new BusinessException(IdentityErrorCodes.StaticClaimTypeDeletion); } } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/IdentityRoleAppService.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/IdentityRoleAppService.cs index 06946697b..620ba57bd 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/IdentityRoleAppService.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/IdentityRoleAppService.cs @@ -8,116 +8,115 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.Identity; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +[Authorize(Volo.Abp.Identity.IdentityPermissions.Roles.Default)] +public class IdentityRoleAppService : IdentityAppServiceBase, IIdentityRoleAppService { - [Authorize(Volo.Abp.Identity.IdentityPermissions.Roles.Default)] - public class IdentityRoleAppService : IdentityAppServiceBase, IIdentityRoleAppService + protected IIdentityRoleRepository IdentityRoleRepository { get; } + protected OrganizationUnitManager OrganizationUnitManager { get; } + protected IOrganizationUnitRepository OrganizationUnitRepository { get; } + public IdentityRoleAppService( + IIdentityRoleRepository roleRepository, + OrganizationUnitManager organizationUnitManager) { - protected IIdentityRoleRepository IdentityRoleRepository { get; } - protected OrganizationUnitManager OrganizationUnitManager { get; } - protected IOrganizationUnitRepository OrganizationUnitRepository { get; } - public IdentityRoleAppService( - IIdentityRoleRepository roleRepository, - OrganizationUnitManager organizationUnitManager) - { - OrganizationUnitManager = organizationUnitManager; - IdentityRoleRepository = roleRepository; - } - - #region OrganizationUnit - - [Authorize(IdentityPermissions.Roles.ManageOrganizationUnits)] - public async virtual Task> GetOrganizationUnitsAsync(Guid id) - { - var origanizationUnits = await IdentityRoleRepository.GetOrganizationUnitsAsync(id); + OrganizationUnitManager = organizationUnitManager; + IdentityRoleRepository = roleRepository; + } - return new ListResultDto( - ObjectMapper.Map, List>(origanizationUnits)); - } + #region OrganizationUnit - [Authorize(IdentityPermissions.Roles.ManageOrganizationUnits)] - public async virtual Task SetOrganizationUnitsAsync(Guid id, IdentityRoleAddOrRemoveOrganizationUnitDto input) - { - var origanizationUnits = await IdentityRoleRepository.GetOrganizationUnitsAsync(id, true); + [Authorize(IdentityPermissions.Roles.ManageOrganizationUnits)] + public async virtual Task> GetOrganizationUnitsAsync(Guid id) + { + var origanizationUnits = await IdentityRoleRepository.GetOrganizationUnitsAsync(id); - var notInRoleOuIds = input.OrganizationUnitIds.Where(ouid => !origanizationUnits.Any(ou => ou.Id.Equals(ouid))); + return new ListResultDto( + ObjectMapper.Map, List>(origanizationUnits)); + } - foreach (var ouId in notInRoleOuIds) - { - await OrganizationUnitManager.AddRoleToOrganizationUnitAsync(id, ouId); - } + [Authorize(IdentityPermissions.Roles.ManageOrganizationUnits)] + public async virtual Task SetOrganizationUnitsAsync(Guid id, IdentityRoleAddOrRemoveOrganizationUnitDto input) + { + var origanizationUnits = await IdentityRoleRepository.GetOrganizationUnitsAsync(id, true); - var removeRoleOriganzationUnits = origanizationUnits.Where(ou => !input.OrganizationUnitIds.Contains(ou.Id)); - foreach (var origanzationUnit in removeRoleOriganzationUnits) - { - origanzationUnit.RemoveRole(id); - } + var notInRoleOuIds = input.OrganizationUnitIds.Where(ouid => !origanizationUnits.Any(ou => ou.Id.Equals(ouid))); - await CurrentUnitOfWork.SaveChangesAsync(); + foreach (var ouId in notInRoleOuIds) + { + await OrganizationUnitManager.AddRoleToOrganizationUnitAsync(id, ouId); } - [Authorize(IdentityPermissions.Roles.ManageOrganizationUnits)] - public async virtual Task RemoveOrganizationUnitsAsync(Guid id, Guid ouId) + var removeRoleOriganzationUnits = origanizationUnits.Where(ou => !input.OrganizationUnitIds.Contains(ou.Id)); + foreach (var origanzationUnit in removeRoleOriganzationUnits) { - await OrganizationUnitManager.RemoveRoleFromOrganizationUnitAsync(id, ouId); - - await CurrentUnitOfWork.SaveChangesAsync(); + origanzationUnit.RemoveRole(id); } - #endregion + await CurrentUnitOfWork.SaveChangesAsync(); + } - #region ClaimType + [Authorize(IdentityPermissions.Roles.ManageOrganizationUnits)] + public async virtual Task RemoveOrganizationUnitsAsync(Guid id, Guid ouId) + { + await OrganizationUnitManager.RemoveRoleFromOrganizationUnitAsync(id, ouId); - public async virtual Task> GetClaimsAsync(Guid id) - { - var role = await IdentityRoleRepository.GetAsync(id); + await CurrentUnitOfWork.SaveChangesAsync(); + } - return new ListResultDto(ObjectMapper.Map, List>(role.Claims)); - } + #endregion - [Authorize(IdentityPermissions.Roles.ManageClaims)] - public async virtual Task AddClaimAsync(Guid id, IdentityRoleClaimCreateDto input) - { - var role = await IdentityRoleRepository.GetAsync(id); - var claim = new Claim(input.ClaimType, input.ClaimValue); - if (role.FindClaim(claim) != null) - { - throw new UserFriendlyException(L["RoleClaimAlreadyExists"]); - } - - role.AddClaim(GuidGenerator, claim); - await IdentityRoleRepository.UpdateAsync(role); + #region ClaimType - await CurrentUnitOfWork.SaveChangesAsync(); - } + public async virtual Task> GetClaimsAsync(Guid id) + { + var role = await IdentityRoleRepository.GetAsync(id); - [Authorize(IdentityPermissions.Roles.ManageClaims)] - public async virtual Task UpdateClaimAsync(Guid id, IdentityRoleClaimUpdateDto input) + return new ListResultDto(ObjectMapper.Map, List>(role.Claims)); + } + + [Authorize(IdentityPermissions.Roles.ManageClaims)] + public async virtual Task AddClaimAsync(Guid id, IdentityRoleClaimCreateDto input) + { + var role = await IdentityRoleRepository.GetAsync(id); + var claim = new Claim(input.ClaimType, input.ClaimValue); + if (role.FindClaim(claim) != null) { - var role = await IdentityRoleRepository.GetAsync(id); - var oldClaim = role.FindClaim(new Claim(input.ClaimType, input.ClaimValue)); - if (oldClaim != null) - { - role.RemoveClaim(oldClaim.ToClaim()); - role.AddClaim(GuidGenerator, new Claim(input.ClaimType, input.NewClaimValue)); + throw new UserFriendlyException(L["RoleClaimAlreadyExists"]); + } - await IdentityRoleRepository.UpdateAsync(role); + role.AddClaim(GuidGenerator, claim); + await IdentityRoleRepository.UpdateAsync(role); - await CurrentUnitOfWork.SaveChangesAsync(); - } - } + await CurrentUnitOfWork.SaveChangesAsync(); + } - [Authorize(IdentityPermissions.Roles.ManageClaims)] - public async virtual Task DeleteClaimAsync(Guid id, IdentityRoleClaimDeleteDto input) + [Authorize(IdentityPermissions.Roles.ManageClaims)] + public async virtual Task UpdateClaimAsync(Guid id, IdentityRoleClaimUpdateDto input) + { + var role = await IdentityRoleRepository.GetAsync(id); + var oldClaim = role.FindClaim(new Claim(input.ClaimType, input.ClaimValue)); + if (oldClaim != null) { - var role = await IdentityRoleRepository.GetAsync(id); - role.RemoveClaim(new Claim(input.ClaimType, input.ClaimValue)); + role.RemoveClaim(oldClaim.ToClaim()); + role.AddClaim(GuidGenerator, new Claim(input.ClaimType, input.NewClaimValue)); await IdentityRoleRepository.UpdateAsync(role); await CurrentUnitOfWork.SaveChangesAsync(); } + } - #endregion + [Authorize(IdentityPermissions.Roles.ManageClaims)] + public async virtual Task DeleteClaimAsync(Guid id, IdentityRoleClaimDeleteDto input) + { + var role = await IdentityRoleRepository.GetAsync(id); + role.RemoveClaim(new Claim(input.ClaimType, input.ClaimValue)); + + await IdentityRoleRepository.UpdateAsync(role); + + await CurrentUnitOfWork.SaveChangesAsync(); } + + #endregion } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/IdentitySessionAppService.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/IdentitySessionAppService.cs new file mode 100644 index 000000000..a1dbf52bd --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/IdentitySessionAppService.cs @@ -0,0 +1,41 @@ +using LINGYUN.Abp.Identity.Session; +using Microsoft.AspNetCore.Authorization; +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Identity; + +namespace LINGYUN.Abp.Identity; + +[Authorize(IdentityPermissions.IdentitySession.Default)] +public class IdentitySessionAppService : IdentityAppServiceBase, IIdentitySessionAppService +{ + private readonly IIdentitySessionManager _identitySessionManager; + private readonly IIdentitySessionRepository _identitySessionRepository; + + public IdentitySessionAppService( + IIdentitySessionManager identitySessionManager, + IIdentitySessionRepository identitySessionRepository) + { + _identitySessionManager = identitySessionManager; + _identitySessionRepository = identitySessionRepository; + } + + public async virtual Task> GetSessionsAsync(GetUserSessionsInput input) + { + var totalCount = await _identitySessionRepository.GetCountAsync( + input.UserId, input.Device, input.ClientId); + var identitySessions = await _identitySessionRepository.GetListAsync( + input.Sorting, input.MaxResultCount, input.SkipCount, + input.UserId, input.Device, input.ClientId); + + return new PagedResultDto(totalCount, + ObjectMapper.Map, List>(identitySessions)); + } + + [Authorize(IdentityPermissions.IdentitySession.Revoke)] + public async virtual Task RevokeSessionAsync(string sessionId) + { + await _identitySessionManager.RevokeSessionAsync(sessionId); + } +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/IdentityUserAppService.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/IdentityUserAppService.cs index 34bd5ec03..621b28471 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/IdentityUserAppService.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/IdentityUserAppService.cs @@ -9,166 +9,163 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.Identity; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +[Authorize(Volo.Abp.Identity.IdentityPermissions.Users.Default)] +public class IdentityUserAppService : IdentityAppServiceBase, IIdentityUserAppService { - [Authorize(Volo.Abp.Identity.IdentityPermissions.Users.Default)] - public class IdentityUserAppService : IdentityAppServiceBase, IIdentityUserAppService + protected IdentityUserManager UserManager { get; } + protected IOptions IdentityOptions { get; } + public IdentityUserAppService( + IdentityUserManager userManager, + IOptions identityOptions) { - protected IdentityUserManager UserManager { get; } - protected IOptions IdentityOptions { get; } - public IdentityUserAppService( - IdentityUserManager userManager, - IOptions identityOptions) - { - UserManager = userManager; - IdentityOptions = identityOptions; - } - - #region OrganizationUnit + UserManager = userManager; + IdentityOptions = identityOptions; + } + #region OrganizationUnit - [Authorize(IdentityPermissions.Users.ManageOrganizationUnits)] - public async virtual Task> GetOrganizationUnitsAsync(Guid id) - { - var user = await UserManager.GetByIdAsync(id); + public async virtual Task> GetOrganizationUnitsAsync(Guid id) + { + var user = await UserManager.GetByIdAsync(id); - var origanizationUnits = await UserManager.GetOrganizationUnitsAsync(user); + var origanizationUnits = await UserManager.GetOrganizationUnitsAsync(user); - return new ListResultDto( - ObjectMapper.Map, List>(origanizationUnits)); - } + return new ListResultDto( + ObjectMapper.Map, List>(origanizationUnits)); + } - [Authorize(IdentityPermissions.Users.ManageOrganizationUnits)] - public async virtual Task SetOrganizationUnitsAsync(Guid id, IdentityUserOrganizationUnitUpdateDto input) - { - var user = await UserManager.GetByIdAsync(id); + [Authorize(IdentityPermissions.Users.ManageOrganizationUnits)] + public async virtual Task SetOrganizationUnitsAsync(Guid id, IdentityUserOrganizationUnitUpdateDto input) + { + var user = await UserManager.GetByIdAsync(id); - await UserManager.SetOrganizationUnitsAsync(user, input.OrganizationUnitIds); + await UserManager.SetOrganizationUnitsAsync(user, input.OrganizationUnitIds); - await CurrentUnitOfWork.SaveChangesAsync(); - } + await CurrentUnitOfWork.SaveChangesAsync(); + } - [Authorize(IdentityPermissions.Users.ManageOrganizationUnits)] - public async virtual Task RemoveOrganizationUnitsAsync(Guid id, Guid ouId) - { - await UserManager.RemoveFromOrganizationUnitAsync(id, ouId); + [Authorize(IdentityPermissions.Users.ManageOrganizationUnits)] + public async virtual Task RemoveOrganizationUnitsAsync(Guid id, Guid ouId) + { + await UserManager.RemoveFromOrganizationUnitAsync(id, ouId); - await CurrentUnitOfWork.SaveChangesAsync(); - } + await CurrentUnitOfWork.SaveChangesAsync(); + } - #endregion + #endregion - #region Claim + #region Claim - public async virtual Task> GetClaimsAsync(Guid id) - { - var user = await UserManager.GetByIdAsync(id); + public async virtual Task> GetClaimsAsync(Guid id) + { + var user = await UserManager.GetByIdAsync(id); - return new ListResultDto(ObjectMapper.Map, List>(user.Claims)); - } + return new ListResultDto(ObjectMapper.Map, List>(user.Claims)); + } - [Authorize(IdentityPermissions.Users.ManageClaims)] - public async virtual Task AddClaimAsync(Guid id, IdentityUserClaimCreateDto input) + [Authorize(IdentityPermissions.Users.ManageClaims)] + public async virtual Task AddClaimAsync(Guid id, IdentityUserClaimCreateDto input) + { + var user = await UserManager.GetByIdAsync(id); + var claim = new Claim(input.ClaimType, input.ClaimValue); + if (user.FindClaim(claim) != null) { - var user = await UserManager.GetByIdAsync(id); - var claim = new Claim(input.ClaimType, input.ClaimValue); - if (user.FindClaim(claim) != null) - { - throw new UserFriendlyException(L["UserClaimAlreadyExists"]); - } - user.AddClaim(GuidGenerator, claim); - (await UserManager.UpdateAsync(user)).CheckErrors(); - - await CurrentUnitOfWork.SaveChangesAsync(); + throw new UserFriendlyException(L["UserClaimAlreadyExists"]); } + user.AddClaim(GuidGenerator, claim); + (await UserManager.UpdateAsync(user)).CheckErrors(); - [Authorize(IdentityPermissions.Users.ManageClaims)] - public async virtual Task UpdateClaimAsync(Guid id, IdentityUserClaimUpdateDto input) - { - var user = await UserManager.GetByIdAsync(id); - var oldClaim = new Claim(input.ClaimType, input.ClaimValue); - var newClaim = new Claim(input.ClaimType, input.NewClaimValue); - user.ReplaceClaim(oldClaim, newClaim); - (await UserManager.UpdateAsync(user)).CheckErrors(); + await CurrentUnitOfWork.SaveChangesAsync(); + } - await CurrentUnitOfWork.SaveChangesAsync(); - } + [Authorize(IdentityPermissions.Users.ManageClaims)] + public async virtual Task UpdateClaimAsync(Guid id, IdentityUserClaimUpdateDto input) + { + var user = await UserManager.GetByIdAsync(id); + var oldClaim = new Claim(input.ClaimType, input.ClaimValue); + var newClaim = new Claim(input.ClaimType, input.NewClaimValue); + user.ReplaceClaim(oldClaim, newClaim); + (await UserManager.UpdateAsync(user)).CheckErrors(); - [Authorize(IdentityPermissions.Users.ManageClaims)] - public async virtual Task DeleteClaimAsync(Guid id, IdentityUserClaimDeleteDto input) - { - var user = await UserManager.GetByIdAsync(id); - user.RemoveClaim(new Claim(input.ClaimType, input.ClaimValue)); - (await UserManager.UpdateAsync(user)).CheckErrors(); + await CurrentUnitOfWork.SaveChangesAsync(); + } - await CurrentUnitOfWork.SaveChangesAsync(); - } + [Authorize(IdentityPermissions.Users.ManageClaims)] + public async virtual Task DeleteClaimAsync(Guid id, IdentityUserClaimDeleteDto input) + { + var user = await UserManager.GetByIdAsync(id); + user.RemoveClaim(new Claim(input.ClaimType, input.ClaimValue)); + (await UserManager.UpdateAsync(user)).CheckErrors(); - #endregion + await CurrentUnitOfWork.SaveChangesAsync(); + } - [Authorize(IdentityPermissions.Users.ResetPassword)] - public async virtual Task ChangePasswordAsync(Guid id, IdentityUserSetPasswordInput input) - { - var user = await GetUserAsync(id); + #endregion - if (user.IsExternal) - { - throw new BusinessException(code: Volo.Abp.Identity.IdentityErrorCodes.ExternalUserPasswordChange); - } + [Authorize(IdentityPermissions.Users.ResetPassword)] + public async virtual Task ChangePasswordAsync(Guid id, IdentityUserSetPasswordInput input) + { + var user = await GetUserAsync(id); - if (user.PasswordHash == null) - { - (await UserManager.AddPasswordAsync(user, input.Password)).CheckErrors(); - } - else - { - var token = await UserManager.GeneratePasswordResetTokenAsync(user); + if (user.IsExternal) + { + throw new BusinessException(code: Volo.Abp.Identity.IdentityErrorCodes.ExternalUserPasswordChange); + } - (await UserManager.ResetPasswordAsync(user, token, input.Password)).CheckErrors(); - } + if (user.PasswordHash == null) + { + (await UserManager.AddPasswordAsync(user, input.Password)).CheckErrors(); + } + else + { + var token = await UserManager.GeneratePasswordResetTokenAsync(user); - await CurrentUnitOfWork.SaveChangesAsync(); + (await UserManager.ResetPasswordAsync(user, token, input.Password)).CheckErrors(); } - [Authorize(Volo.Abp.Identity.IdentityPermissions.Users.Update)] - public async virtual Task ChangeTwoFactorEnabledAsync(Guid id, TwoFactorEnabledDto input) - { - var user = await GetUserAsync(id); + await CurrentUnitOfWork.SaveChangesAsync(); + } - (await UserManager.SetTwoFactorEnabledWithAccountConfirmedAsync(user, input.Enabled)).CheckErrors(); + [Authorize(Volo.Abp.Identity.IdentityPermissions.Users.Update)] + public async virtual Task ChangeTwoFactorEnabledAsync(Guid id, TwoFactorEnabledDto input) + { + var user = await GetUserAsync(id); - await CurrentUnitOfWork.SaveChangesAsync(); - } + (await UserManager.SetTwoFactorEnabledWithAccountConfirmedAsync(user, input.Enabled)).CheckErrors(); - [Authorize(Volo.Abp.Identity.IdentityPermissions.Users.Update)] - public async virtual Task LockAsync(Guid id, int seconds) - { - var user = await GetUserAsync(id); - //if (!UserManager.SupportsUserLockout) - //{ - // throw new UserFriendlyException(L["Volo.Abp.Identity:UserLockoutNotEnabled"]); - //} - var endDate = new DateTimeOffset(Clock.Now).AddSeconds(seconds); - (await UserManager.SetLockoutEndDateAsync(user, endDate)).CheckErrors(); - - await CurrentUnitOfWork.SaveChangesAsync(); - } + await CurrentUnitOfWork.SaveChangesAsync(); + } - [Authorize(Volo.Abp.Identity.IdentityPermissions.Users.Update)] - public async virtual Task UnLockAsync(Guid id) - { - var user = await GetUserAsync(id); - (await UserManager.SetLockoutEndDateAsync(user, null)).CheckErrors(); + [Authorize(Volo.Abp.Identity.IdentityPermissions.Users.Update)] + public async virtual Task LockAsync(Guid id, int seconds) + { + var user = await GetUserAsync(id); + //if (!UserManager.SupportsUserLockout) + //{ + // throw new UserFriendlyException(L["Volo.Abp.Identity:UserLockoutNotEnabled"]); + //} + var endDate = new DateTimeOffset(Clock.Now).AddSeconds(seconds); + (await UserManager.SetLockoutEndDateAsync(user, endDate)).CheckErrors(); + + await CurrentUnitOfWork.SaveChangesAsync(); + } - await CurrentUnitOfWork.SaveChangesAsync(); - } + [Authorize(Volo.Abp.Identity.IdentityPermissions.Users.Update)] + public async virtual Task UnLockAsync(Guid id) + { + var user = await GetUserAsync(id); + (await UserManager.SetLockoutEndDateAsync(user, null)).CheckErrors(); - protected async virtual Task GetUserAsync(Guid id) - { - await IdentityOptions.SetAsync(); - var user = await UserManager.GetByIdAsync(id); + await CurrentUnitOfWork.SaveChangesAsync(); + } - return user; - } + protected async virtual Task GetUserAsync(Guid id) + { + await IdentityOptions.SetAsync(); + var user = await UserManager.GetByIdAsync(id); + + return user; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/OrganizationUnitAppService.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/OrganizationUnitAppService.cs index 86318b537..6a5882e3e 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/OrganizationUnitAppService.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Application/LINGYUN/Abp/Identity/OrganizationUnitAppService.cs @@ -7,233 +7,226 @@ using Volo.Abp.Identity; using Volo.Abp.ObjectExtending; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +[Authorize(IdentityPermissions.OrganizationUnits.Default)] +public class OrganizationUnitAppService : IdentityAppServiceBase, IOrganizationUnitAppService { - [Authorize(IdentityPermissions.OrganizationUnits.Default)] - public class OrganizationUnitAppService : IdentityAppServiceBase, IOrganizationUnitAppService - { - protected OrganizationUnitManager OrganizationUnitManager { get; } - protected IOrganizationUnitRepository OrganizationUnitRepository { get; } - - protected IdentityUserManager UserManager { get; } - protected IIdentityRoleRepository RoleRepository { get; } - protected IIdentityUserRepository UserRepository { get; } - - public OrganizationUnitAppService( - IdentityUserManager userManager, - IIdentityRoleRepository roleRepository, - IIdentityUserRepository userRepository, - OrganizationUnitManager organizationUnitManager, - IOrganizationUnitRepository organizationUnitRepository) - { - UserManager = userManager; - RoleRepository = roleRepository; - UserRepository = userRepository; - OrganizationUnitManager = organizationUnitManager; - OrganizationUnitRepository = organizationUnitRepository; + protected OrganizationUnitManager OrganizationUnitManager { get; } + protected IOrganizationUnitRepository OrganizationUnitRepository { get; } + + protected IdentityUserManager UserManager { get; } + protected IIdentityRoleRepository RoleRepository { get; } + protected IIdentityUserRepository UserRepository { get; } + + public OrganizationUnitAppService( + IdentityUserManager userManager, + IIdentityRoleRepository roleRepository, + IIdentityUserRepository userRepository, + OrganizationUnitManager organizationUnitManager, + IOrganizationUnitRepository organizationUnitRepository) + { + UserManager = userManager; + RoleRepository = roleRepository; + UserRepository = userRepository; + OrganizationUnitManager = organizationUnitManager; + OrganizationUnitRepository = organizationUnitRepository; - ObjectMapperContext = typeof(AbpIdentityApplicationModule); - } + ObjectMapperContext = typeof(AbpIdentityApplicationModule); + } - [Authorize(IdentityPermissions.OrganizationUnits.Create)] - public async virtual Task CreateAsync(OrganizationUnitCreateDto input) + [Authorize(IdentityPermissions.OrganizationUnits.Create)] + public async virtual Task CreateAsync(OrganizationUnitCreateDto input) + { + var origanizationUnit = new OrganizationUnit( + GuidGenerator.Create(), input.DisplayName, input.ParentId, CurrentTenant.Id) { - var origanizationUnit = new OrganizationUnit( - GuidGenerator.Create(), input.DisplayName, input.ParentId, CurrentTenant.Id) - { - CreationTime = Clock.Now - }; - input.MapExtraPropertiesTo(origanizationUnit); + CreationTime = Clock.Now + }; + input.MapExtraPropertiesTo(origanizationUnit); - await OrganizationUnitManager.CreateAsync(origanizationUnit); - await CurrentUnitOfWork.SaveChangesAsync(); + await OrganizationUnitManager.CreateAsync(origanizationUnit); + await CurrentUnitOfWork.SaveChangesAsync(); - return ObjectMapper.Map(origanizationUnit); - } + return ObjectMapper.Map(origanizationUnit); + } - [Authorize(IdentityPermissions.OrganizationUnits.Delete)] - public async virtual Task DeleteAsync(Guid id) + [Authorize(IdentityPermissions.OrganizationUnits.Delete)] + public async virtual Task DeleteAsync(Guid id) + { + var origanizationUnit = await OrganizationUnitRepository.FindAsync(id); + if (origanizationUnit == null) { - var origanizationUnit = await OrganizationUnitRepository.FindAsync(id); - if (origanizationUnit == null) - { - return; - } - await OrganizationUnitManager.DeleteAsync(id); + return; } + await OrganizationUnitManager.DeleteAsync(id); + } - public async virtual Task> GetRootAsync() - { - var rootOriganizationUnits = await OrganizationUnitManager.FindChildrenAsync(null, recursive: false); + public async virtual Task> GetRootAsync() + { + var rootOriganizationUnits = await OrganizationUnitManager.FindChildrenAsync(null, recursive: false); - return new ListResultDto( - ObjectMapper.Map, List>(rootOriganizationUnits)); - } + return new ListResultDto( + ObjectMapper.Map, List>(rootOriganizationUnits)); + } - public async virtual Task> FindChildrenAsync(OrganizationUnitGetChildrenDto input) - { - var origanizationUnitChildren = await OrganizationUnitManager.FindChildrenAsync(input.Id, input.Recursive); + public async virtual Task> FindChildrenAsync(OrganizationUnitGetChildrenDto input) + { + var origanizationUnitChildren = await OrganizationUnitManager.FindChildrenAsync(input.Id, input.Recursive); - return new ListResultDto( - ObjectMapper.Map, List>(origanizationUnitChildren)); - } + return new ListResultDto( + ObjectMapper.Map, List>(origanizationUnitChildren)); + } - public async virtual Task GetAsync(Guid id) - { - var origanizationUnit = await OrganizationUnitRepository.FindAsync(id); + public async virtual Task GetAsync(Guid id) + { + var origanizationUnit = await OrganizationUnitRepository.FindAsync(id); - return ObjectMapper.Map(origanizationUnit); - } + return ObjectMapper.Map(origanizationUnit); + } - public async virtual Task GetLastChildOrNullAsync(Guid? parentId) - { - var origanizationUnitLastChildren = await OrganizationUnitManager.GetLastChildOrNullAsync(parentId); + public async virtual Task GetLastChildOrNullAsync(Guid? parentId) + { + var origanizationUnitLastChildren = await OrganizationUnitManager.GetLastChildOrNullAsync(parentId); - return ObjectMapper.Map(origanizationUnitLastChildren); - } + return ObjectMapper.Map(origanizationUnitLastChildren); + } - public async virtual Task> GetAllListAsync() - { - var origanizationUnits = await OrganizationUnitRepository.GetListAsync(false); + public async virtual Task> GetAllListAsync() + { + var origanizationUnits = await OrganizationUnitRepository.GetListAsync(false); - return new ListResultDto( - ObjectMapper.Map, List>(origanizationUnits)); - } + return new ListResultDto( + ObjectMapper.Map, List>(origanizationUnits)); + } - public async virtual Task> GetListAsync(OrganizationUnitGetByPagedDto input) - { - var specification = new OrganizationUnitGetListSpecification(input); + public async virtual Task> GetListAsync(OrganizationUnitGetByPagedDto input) + { + var specification = new OrganizationUnitGetListSpecification(input); - var origanizationUnitCount = await OrganizationUnitRepository.GetCountAsync(specification); + var origanizationUnitCount = await OrganizationUnitRepository.GetCountAsync(specification); - var origanizationUnits = await OrganizationUnitRepository - .GetListAsync(specification, input.Sorting, input.MaxResultCount, input.SkipCount, false); + var origanizationUnits = await OrganizationUnitRepository + .GetListAsync(specification, input.Sorting, input.MaxResultCount, input.SkipCount, false); - return new PagedResultDto(origanizationUnitCount, - ObjectMapper.Map, List>(origanizationUnits)); - } + return new PagedResultDto(origanizationUnitCount, + ObjectMapper.Map, List>(origanizationUnits)); + } - [Authorize(IdentityPermissions.OrganizationUnits.ManageRoles)] - public async virtual Task> GetRoleNamesAsync(Guid id) - { - var inOrignizationUnitRoleNames = await UserRepository.GetRoleNamesInOrganizationUnitAsync(id); - return new ListResultDto(inOrignizationUnitRoleNames); - } + public async virtual Task> GetRoleNamesAsync(Guid id) + { + var inOrignizationUnitRoleNames = await UserRepository.GetRoleNamesInOrganizationUnitAsync(id); + return new ListResultDto(inOrignizationUnitRoleNames); + } - [Authorize(IdentityPermissions.OrganizationUnits.ManageRoles)] - public async virtual Task> GetUnaddedRolesAsync(Guid id, OrganizationUnitGetUnaddedRoleByPagedDto input) - { - var origanizationUnit = await OrganizationUnitRepository.GetAsync(id); + public async virtual Task> GetUnaddedRolesAsync(Guid id, OrganizationUnitGetUnaddedRoleByPagedDto input) + { + var origanizationUnit = await OrganizationUnitRepository.GetAsync(id); - var origanizationUnitRoleCount = await OrganizationUnitRepository - .GetUnaddedRolesCountAsync(origanizationUnit, input.Filter); + var origanizationUnitRoleCount = await OrganizationUnitRepository + .GetUnaddedRolesCountAsync(origanizationUnit, input.Filter); - var origanizationUnitRoles = await OrganizationUnitRepository - .GetUnaddedRolesAsync(origanizationUnit, - input.Sorting, input.MaxResultCount, - input.SkipCount, input.Filter); + var origanizationUnitRoles = await OrganizationUnitRepository + .GetUnaddedRolesAsync(origanizationUnit, + input.Sorting, input.MaxResultCount, + input.SkipCount, input.Filter); - return new PagedResultDto(origanizationUnitRoleCount, - ObjectMapper.Map, List>(origanizationUnitRoles)); - } + return new PagedResultDto(origanizationUnitRoleCount, + ObjectMapper.Map, List>(origanizationUnitRoles)); + } - [Authorize(IdentityPermissions.OrganizationUnits.ManageRoles)] - public async virtual Task> GetRolesAsync(Guid id, PagedAndSortedResultRequestDto input) - { - var origanizationUnit = await OrganizationUnitRepository.GetAsync(id); + public async virtual Task> GetRolesAsync(Guid id, PagedAndSortedResultRequestDto input) + { + var origanizationUnit = await OrganizationUnitRepository.GetAsync(id); - var origanizationUnitRoleCount = await OrganizationUnitRepository - .GetRolesCountAsync(origanizationUnit); + var origanizationUnitRoleCount = await OrganizationUnitRepository + .GetRolesCountAsync(origanizationUnit); - var origanizationUnitRoles = await OrganizationUnitRepository - .GetRolesAsync(origanizationUnit, - input.Sorting, input.MaxResultCount, - input.SkipCount); + var origanizationUnitRoles = await OrganizationUnitRepository + .GetRolesAsync(origanizationUnit, + input.Sorting, input.MaxResultCount, + input.SkipCount); - return new PagedResultDto(origanizationUnitRoleCount, - ObjectMapper.Map, List>(origanizationUnitRoles)); - } + return new PagedResultDto(origanizationUnitRoleCount, + ObjectMapper.Map, List>(origanizationUnitRoles)); + } + public async virtual Task> GetUnaddedUsersAsync(Guid id, OrganizationUnitGetUnaddedUserByPagedDto input) + { + var origanizationUnit = await OrganizationUnitRepository.GetAsync(id); - [Authorize(IdentityPermissions.OrganizationUnits.ManageUsers)] - public async virtual Task> GetUnaddedUsersAsync(Guid id, OrganizationUnitGetUnaddedUserByPagedDto input) - { - var origanizationUnit = await OrganizationUnitRepository.GetAsync(id); + var origanizationUnitUserCount = await OrganizationUnitRepository + .GetUnaddedUsersCountAsync(origanizationUnit, input.Filter); + var origanizationUnitUsers = await OrganizationUnitRepository + .GetUnaddedUsersAsync(origanizationUnit, + input.Sorting, input.MaxResultCount, + input.SkipCount, input.Filter); - var origanizationUnitUserCount = await OrganizationUnitRepository - .GetUnaddedUsersCountAsync(origanizationUnit, input.Filter); - var origanizationUnitUsers = await OrganizationUnitRepository - .GetUnaddedUsersAsync(origanizationUnit, - input.Sorting, input.MaxResultCount, - input.SkipCount, input.Filter); + return new PagedResultDto(origanizationUnitUserCount, + ObjectMapper.Map, List>(origanizationUnitUsers)); + } - return new PagedResultDto(origanizationUnitUserCount, - ObjectMapper.Map, List>(origanizationUnitUsers)); - } + public async virtual Task> GetUsersAsync(Guid id, GetIdentityUsersInput input) + { + var origanizationUnit = await OrganizationUnitRepository.GetAsync(id); - [Authorize(IdentityPermissions.OrganizationUnits.ManageUsers)] - public async virtual Task> GetUsersAsync(Guid id, GetIdentityUsersInput input) - { - var origanizationUnit = await OrganizationUnitRepository.GetAsync(id); + var origanizationUnitUserCount = await OrganizationUnitRepository + .GetMembersCountAsync(origanizationUnit, input.Filter); + var origanizationUnitUsers = await OrganizationUnitRepository + .GetMembersAsync(origanizationUnit, + input.Sorting, input.MaxResultCount, + input.SkipCount, input.Filter); - var origanizationUnitUserCount = await OrganizationUnitRepository - .GetMembersCountAsync(origanizationUnit, input.Filter); - var origanizationUnitUsers = await OrganizationUnitRepository - .GetMembersAsync(origanizationUnit, - input.Sorting, input.MaxResultCount, - input.SkipCount, input.Filter); + return new PagedResultDto(origanizationUnitUserCount, + ObjectMapper.Map, List>(origanizationUnitUsers)); + } - return new PagedResultDto(origanizationUnitUserCount, - ObjectMapper.Map, List>(origanizationUnitUsers)); - } + [Authorize(IdentityPermissions.OrganizationUnits.Update)] + public async virtual Task MoveAsync(Guid id, OrganizationUnitMoveDto input) + { + await OrganizationUnitManager.MoveAsync(id, input.ParentId); + } - [Authorize(IdentityPermissions.OrganizationUnits.Update)] - public async virtual Task MoveAsync(Guid id, OrganizationUnitMoveDto input) - { - await OrganizationUnitManager.MoveAsync(id, input.ParentId); - } + [Authorize(IdentityPermissions.OrganizationUnits.Update)] + public async virtual Task UpdateAsync(Guid id, OrganizationUnitUpdateDto input) + { + var origanizationUnit = await OrganizationUnitRepository.GetAsync(id); + origanizationUnit.DisplayName = input.DisplayName; + input.MapExtraPropertiesTo(origanizationUnit); - [Authorize(IdentityPermissions.OrganizationUnits.Update)] - public async virtual Task UpdateAsync(Guid id, OrganizationUnitUpdateDto input) - { - var origanizationUnit = await OrganizationUnitRepository.GetAsync(id); - origanizationUnit.DisplayName = input.DisplayName; - input.MapExtraPropertiesTo(origanizationUnit); + await OrganizationUnitManager.UpdateAsync(origanizationUnit); + await CurrentUnitOfWork.SaveChangesAsync(); - await OrganizationUnitManager.UpdateAsync(origanizationUnit); - await CurrentUnitOfWork.SaveChangesAsync(); + return ObjectMapper.Map(origanizationUnit); + } - return ObjectMapper.Map(origanizationUnit); - } + [Authorize(IdentityPermissions.OrganizationUnits.ManageUsers)] + public async virtual Task AddUsersAsync(Guid id, OrganizationUnitAddUserDto input) + { + var origanizationUnit = await OrganizationUnitRepository.GetAsync(id); + var users = await UserRepository.GetListByIdListAsync(input.UserIds, includeDetails: true); - [Authorize(IdentityPermissions.OrganizationUnits.ManageUsers)] - public async virtual Task AddUsersAsync(Guid id, OrganizationUnitAddUserDto input) + // 调用内部方法设置用户组织机构 + foreach (var user in users) { - var origanizationUnit = await OrganizationUnitRepository.GetAsync(id); - var users = await UserRepository.GetListByIdListAsync(input.UserIds, includeDetails: true); - - // 调用内部方法设置用户组织机构 - foreach (var user in users) - { - await UserManager.AddToOrganizationUnitAsync(user, origanizationUnit); - } - - await CurrentUnitOfWork.SaveChangesAsync(); + await UserManager.AddToOrganizationUnitAsync(user, origanizationUnit); } - [Authorize(IdentityPermissions.OrganizationUnits.ManageRoles)] - public async virtual Task AddRolesAsync(Guid id, OrganizationUnitAddRoleDto input) - { - var origanizationUnit = await OrganizationUnitRepository.GetAsync(id); + await CurrentUnitOfWork.SaveChangesAsync(); + } - var roles = await RoleRepository.GetListByIdListAsync(input.RoleIds, includeDetails: true); + [Authorize(IdentityPermissions.OrganizationUnits.ManageRoles)] + public async virtual Task AddRolesAsync(Guid id, OrganizationUnitAddRoleDto input) + { + var origanizationUnit = await OrganizationUnitRepository.GetAsync(id); - foreach (var role in roles) - { - await OrganizationUnitManager.AddRoleToOrganizationUnitAsync(role, origanizationUnit); - } + var roles = await RoleRepository.GetListByIdListAsync(input.RoleIds, includeDetails: true); - await CurrentUnitOfWork.SaveChangesAsync(); + foreach (var role in roles) + { + await OrganizationUnitManager.AddRoleToOrganizationUnitAsync(role, origanizationUnit); } + + await CurrentUnitOfWork.SaveChangesAsync(); } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.AspNetCore.Session/FodyWeavers.xml b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.AspNetCore.Session/FodyWeavers.xml new file mode 100644 index 000000000..1715698cc --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.AspNetCore.Session/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.AspNetCore.Session/FodyWeavers.xsd b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.AspNetCore.Session/FodyWeavers.xsd new file mode 100644 index 000000000..3f3946e28 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.AspNetCore.Session/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.AspNetCore.Session/LINGYUN.Abp.Identity.AspNetCore.Session.csproj b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.AspNetCore.Session/LINGYUN.Abp.Identity.AspNetCore.Session.csproj new file mode 100644 index 000000000..d5bb36c3c --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.AspNetCore.Session/LINGYUN.Abp.Identity.AspNetCore.Session.csproj @@ -0,0 +1,24 @@ + + + + + + + net8.0 + LINGYUN.Abp.Identity.AspNetCore.Session + LINGYUN.Abp.Identity.AspNetCore.Session + false + false + false + + + + + + + + + + + + diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.AspNetCore.Session/LINGYUN/Abp/Identity/AspNetCore/Session/AbpIdentityAspNetCoreSessionModule.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.AspNetCore.Session/LINGYUN/Abp/Identity/AspNetCore/Session/AbpIdentityAspNetCoreSessionModule.cs new file mode 100644 index 000000000..e420791f6 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.AspNetCore.Session/LINGYUN/Abp/Identity/AspNetCore/Session/AbpIdentityAspNetCoreSessionModule.cs @@ -0,0 +1,26 @@ +using Microsoft.AspNetCore.Authentication; +using Microsoft.AspNetCore.Identity; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Identity.AspNetCore; +using Volo.Abp.Modularity; + +namespace LINGYUN.Abp.Identity.AspNetCore.Session; + +[DependsOn( + typeof(AbpIdentityAspNetCoreModule), + typeof(AbpIdentityDomainModule))] +public class AbpIdentityAspNetCoreSessionModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + PreConfigure(builder => + { + // builder.AddSignInManager(); + }); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddTransient(); + } +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.AspNetCore.Session/LINGYUN/Abp/Identity/AspNetCore/Session/AbpIdentitySessionAuthenticationService.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.AspNetCore.Session/LINGYUN/Abp/Identity/AspNetCore/Session/AbpIdentitySessionAuthenticationService.cs new file mode 100644 index 000000000..6141f7859 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.AspNetCore.Session/LINGYUN/Abp/Identity/AspNetCore/Session/AbpIdentitySessionAuthenticationService.cs @@ -0,0 +1,55 @@ +using LINGYUN.Abp.Identity.Session; +using Microsoft.AspNetCore.Authentication; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Options; +using System; +using System.Security.Claims; +using System.Security.Principal; +using System.Threading.Tasks; + +namespace LINGYUN.Abp.Identity.AspNetCore.Session; + +public class AbpIdentitySessionAuthenticationService : AuthenticationService +{ + protected IdentitySessionSignInOptions SessionSignInOptions { get; } + protected IIdentitySessionManager IdentitySessionManager { get; } + + public AbpIdentitySessionAuthenticationService( + IAuthenticationSchemeProvider schemes, + IAuthenticationHandlerProvider handlers, + IClaimsTransformation transform, + IOptions options, + IIdentitySessionManager identitySessionManager, + IOptions sessionSignInOptions) : base(schemes, handlers, transform, options) + { + SessionSignInOptions = sessionSignInOptions.Value; + IdentitySessionManager = identitySessionManager; + } + + public async override Task SignInAsync(HttpContext context, string scheme, ClaimsPrincipal principal, AuthenticationProperties properties) + { + await base.SignInAsync(context, scheme, principal, properties); + + if (SessionSignInOptions.SignInSessionEnabled && SessionSignInOptions.AuthenticationSchemes.Contains(scheme)) + { + // Save the user session. + await IdentitySessionManager.SaveSessionAsync(principal); + } + } + + public async override Task SignOutAsync(HttpContext context, string scheme, AuthenticationProperties properties) + { + if (SessionSignInOptions.SignOutSessionEnabled && + SessionSignInOptions.AuthenticationSchemes.Contains(scheme)) + { + var sessionId = context.User?.FindSessionId(); + if (!sessionId.IsNullOrWhiteSpace()) + { + // Revoke the user session. + await IdentitySessionManager.RevokeSessionAsync(sessionId); + } + } + + await base.SignOutAsync(context, scheme, properties); + } +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.AspNetCore.Session/README.md b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.AspNetCore.Session/README.md new file mode 100644 index 000000000..3fed616a4 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.AspNetCore.Session/README.md @@ -0,0 +1,15 @@ +# LINGYUN.Abp.Identity.AspNetCore.Session + +用户会话登录扩展模块,主要处理 *AspNetCore.Identity* 提供的登录/登出事件来管理会话 + +出于模块职责分离原则, 请勿与 *LINGYUN.Abp.Identity.Session.AspNetCore* 模块混淆 + +## 配置使用 + +```csharp +[DependsOn(typeof(AbpIdentityAspNetCoreSessionModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN.Abp.Identity.Domain.Shared.csproj b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN.Abp.Identity.Domain.Shared.csproj index bdbbeef93..94aa1eecd 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN.Abp.Identity.Domain.Shared.csproj +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN.Abp.Identity.Domain.Shared.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Identity.Domain.Shared + LINGYUN.Abp.Identity.Domain.Shared + false + false + false diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/AbpIdentityDomainSharedModule.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/AbpIdentityDomainSharedModule.cs index 2cd968b9c..9e6df0c96 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/AbpIdentityDomainSharedModule.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/AbpIdentityDomainSharedModule.cs @@ -3,24 +3,23 @@ using Volo.Abp.Modularity; using Volo.Abp.VirtualFileSystem; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +[DependsOn(typeof(Volo.Abp.Identity.AbpIdentityDomainSharedModule))] +public class AbpIdentityDomainSharedModule : AbpModule { - [DependsOn(typeof(Volo.Abp.Identity.AbpIdentityDomainSharedModule))] - public class AbpIdentityDomainSharedModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + Configure(options => { - Configure(options => - { - options.FileSets.AddEmbedded(); - }); + options.FileSets.AddEmbedded(); + }); - Configure(options => - { - options.Resources - .Get() - .AddVirtualJson("/LINGYUN/Abp/Identity/Localization"); - }); - } + Configure(options => + { + options.Resources + .Get() + .AddVirtualJson("/LINGYUN/Abp/Identity/Localization"); + }); } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/ConcurrentLoginStrategy.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/ConcurrentLoginStrategy.cs new file mode 100644 index 000000000..90aeecd17 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/ConcurrentLoginStrategy.cs @@ -0,0 +1,23 @@ +namespace LINGYUN.Abp.Identity; +/// +/// 重复登录策略 +/// +public enum ConcurrentLoginStrategy +{ + /// + /// 未定义 + /// + None, + /// + /// 限制相同设备登录数量 + /// + LogoutFromSameTypeDevicesLimit, + /// + /// 其他相同设备端退出 + /// + LogoutFromSameTypeDevices, + /// + /// 其他所有设备退出 + /// + LogoutFromAllDevices +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/IdentityConsts.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/IdentityConsts.cs index e0e3fd083..543e3b28f 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/IdentityConsts.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/IdentityConsts.cs @@ -1,15 +1,14 @@ -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public static class IdentityConsts { - public static class IdentityConsts + public static class ClaimType { - public static class ClaimType + public static class Avatar { - public static class Avatar - { - public static string Name { get; set; } = "avatarUrl"; - public static string DisplayName { get; set; } = "Your avatar url"; - public static string Description { get; set; } = "Your avatar url"; - } + public static string Name { get; set; } = "avatarUrl"; + public static string DisplayName { get; set; } = "Your avatar url"; + public static string Description { get; set; } = "Your avatar url"; } } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/IdentityErrorCodes.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/IdentityErrorCodes.cs index 3c798a061..ab60c20ba 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/IdentityErrorCodes.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/IdentityErrorCodes.cs @@ -1,38 +1,37 @@ -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public class IdentityErrorCodes { - public class IdentityErrorCodes - { - /// - /// 无法变更静态声明类型 - /// - public const string StaticClaimTypeChange = "Volo.Abp.Identity:020005"; - /// - /// 无法删除静态声明类型 - /// - public const string StaticClaimTypeDeletion = "Volo.Abp.Identity:020006"; - /// - /// 手机号码已被使用 - /// - public const string DuplicatePhoneNumber = "Volo.Abp.Identity:020007"; - /// - /// 你不能修改你的手机绑定信息 - /// - public const string UsersCanNotChangePhoneNumber = "Volo.Abp.Identity:020008"; - /// - /// 你不能修改你的邮件绑定信息 - /// - public const string UsersCanNotChangeEmailAddress = "Volo.Abp.Identity:020009"; - /// - /// 重复确认的邮件地址 - /// - public const string DuplicateConfirmEmailAddress = "Volo.Abp.Identity:020010"; - /// - /// 尝试在未绑定MFA设备时启用二次认证 - /// - public const string ChangeTwoFactorWithMFANotBound = "Volo.Abp.Identity:020011"; - /// - /// 验证器验证无效 - /// - public const string AuthenticatorTokenInValid = "Volo.Abp.Identity:020012"; - } + /// + /// 无法变更静态声明类型 + /// + public const string StaticClaimTypeChange = "Volo.Abp.Identity:020005"; + /// + /// 无法删除静态声明类型 + /// + public const string StaticClaimTypeDeletion = "Volo.Abp.Identity:020006"; + /// + /// 手机号码已被使用 + /// + public const string DuplicatePhoneNumber = "Volo.Abp.Identity:020007"; + /// + /// 你不能修改你的手机绑定信息 + /// + public const string UsersCanNotChangePhoneNumber = "Volo.Abp.Identity:020008"; + /// + /// 你不能修改你的邮件绑定信息 + /// + public const string UsersCanNotChangeEmailAddress = "Volo.Abp.Identity:020009"; + /// + /// 重复确认的邮件地址 + /// + public const string DuplicateConfirmEmailAddress = "Volo.Abp.Identity:020010"; + /// + /// 尝试在未绑定MFA设备时启用二次认证 + /// + public const string ChangeTwoFactorWithMFANotBound = "Volo.Abp.Identity:020011"; + /// + /// 验证器验证无效 + /// + public const string AuthenticatorTokenInValid = "Volo.Abp.Identity:020012"; } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/IdentityException.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/IdentityException.cs index 97df568a1..f0cb99a9f 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/IdentityException.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/IdentityException.cs @@ -4,35 +4,27 @@ using Volo.Abp; using Volo.Abp.Logging; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public class IdentityException : BusinessException, IExceptionWithSelfLogging { - public class IdentityException : BusinessException, IExceptionWithSelfLogging + public IdentityException( + string code = null, + string message = null, + string details = null, + Exception innerException = null, + LogLevel logLevel = LogLevel.Warning) + : base(code, message, details, innerException, logLevel) { - public IdentityException( - SerializationInfo serializationInfo, - StreamingContext context) - : base(serializationInfo, context) - { - } - - public IdentityException( - string code = null, - string message = null, - string details = null, - Exception innerException = null, - LogLevel logLevel = LogLevel.Warning) - : base(code, message, details, innerException, logLevel) - { - } + } - public virtual void Log(ILogger logger) - { - logger.Log( - LogLevel, - "An id error occurred,code: {0}, Message: {1}, Details: {2}", - Code, - Message, - Details); - } + public virtual void Log(ILogger logger) + { + logger.Log( + LogLevel, + "An id error occurred,code: {0}, Message: {1}, Details: {2}", + Code, + Message, + Details); } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/IdentitySessionEto.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/IdentitySessionEto.cs new file mode 100644 index 000000000..a748b6ed9 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/IdentitySessionEto.cs @@ -0,0 +1,55 @@ +using System; +using Volo.Abp.MultiTenancy; + +namespace LINGYUN.Abp.Identity; + +[Serializable] +public class IdentitySessionEto : IMultiTenant +{ + public Guid Id { get; set; } + + public Guid? TenantId { get; set; } + + public string SessionId { get; set; } + + public string Device { get; set; } + + public string DeviceInfo { get; set; } + + public Guid UserId { get; set; } + + public string ClientId { get; set; } + + public string IpAddresses { get; set; } + + public DateTime SignedIn { get; set; } + + public DateTime? LastAccessed { get; set; } + public IdentitySessionEto() + { + + } + public IdentitySessionEto( + Guid id, + string sessionId, + string device, + string deviceInfo, + Guid userId, + string clientId, + string ipAddresses, + DateTime signedIn, + DateTime? lastAccessed, + Guid? tenantId = null) + { + Id = id; + TenantId = tenantId; + SessionId = sessionId; + Device = device; + DeviceInfo = deviceInfo; + UserId = userId; + ClientId = clientId; + IpAddresses = ipAddresses; + SignedIn = signedIn; + LastAccessed = lastAccessed; + } +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/Localization/en.json b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/Localization/en.json index b95cbbdcc..f2361868a 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/Localization/en.json +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/Localization/en.json @@ -8,6 +8,8 @@ "Permission:ManageClaims": "Management claims", "Permission:ManageOrganizationUnits": "Management organization units", "Permission:IdentityClaimTypeManagement": "Management claim types", + "Permission:IdentitySessions": "Management sessions", + "Permission:RevokeSession": "Revoke session", "OrganizationUnit:Tree": "Organization tree", "OrganizationUnit:New": "Add New", "OrganizationUnit:Members": "Organization Members", @@ -60,10 +62,22 @@ "Description:Abp.Identity.User.SmsPhoneNumberConfirmed": "The user confirms the mobile phone verification code template", "DisplayName:Abp.Identity.User.SmsRepetInterval": "SMS verification code validity(min)", "Description:Abp.Identity.User.SmsRepetInterval": "The valid time for the user to send SMS verification code, unit m, default 3min", + "DisplayName:Abp.Identity.Session.ConcurrentLoginStrategy": "Concurrent login strategy", + "Description:Abp.Identity.Session.ConcurrentLoginStrategy": "There is a setting in the identity section to prevent concurrent login.", + "DisplayName:Abp.Identity.Session.LogoutFromSameTypeDevicesLimit": "Same Type Devices Login Limit", + "Description:Abp.Identity.Session.LogoutFromSameTypeDevicesLimit": "Limit the login times of devices of the same type. The sessions that exceed the limit will be deregistered.", "DisplayName:NewPhoneNumber": "New Phone Number", "DisplayName:SmsVerifyCode": "SMS verification code", "DisplayName:EmailVerifyCode": "Mail verification code", "DisplayName:WeChatCode": "Wechat login code", + "DisplayName:SessionId": "SessionId", + "DisplayName:Device": "Device", + "DisplayName:DeviceInfo": "DeviceInfo", + "DisplayName:UserId": "UserId", + "DisplayName:ClientId": "ClientId", + "DisplayName:IpAddresses": "IpAddresses", + "DisplayName:SignedIn": "SignedIn", + "DisplayName:LastAccessed": "LastAccessed", "SendRepeatSmsVerifyCode": "Phone verification code cannot be sent repeatedly within {0} minutes!", "LockTime": "Lock Time", "LockType": "Lock Type", @@ -72,6 +86,18 @@ "UnActived": "UnActived", "LockoutEnd": "Lockout End", "Public": "Public", - "Static": "Static" + "Static": "Static", + "ConcurrentLoginStrategy:None": "None", + "ConcurrentLoginStrategy:LogoutFromSameTypeDevicesLimit": "Logout From SameType Devices Limit", + "ConcurrentLoginStrategy:LogoutFromSameTypeDevices": "Logout From Same Type Devices", + "ConcurrentLoginStrategy:LogoutFromAllDevices": "Logout From AllDevices", + "Notifications:AbpIdentity": "Identity", + "Notifications:SessionExpiration": "Session Expiration", + "Notifications:SessionExpirationMessage": "Your Device {Device} session has expired or is logged in elsewhere, please log in again if necessary.", + "IdentitySessions": "Sessions", + "CurrentSession": "Current Session", + "RevokeSession": "Revoke Session", + "SessionWillBeRevokedMessage": "The selected session will be revoked, which will invalidate the user's login!", + "SuccessfullyRevoked": "Successful session revoked" } } \ No newline at end of file diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/Localization/zh-Hans.json b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/Localization/zh-Hans.json index 4f0faa017..773c2029f 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/Localization/zh-Hans.json +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/Localization/zh-Hans.json @@ -8,6 +8,8 @@ "Permission:ManageClaims": "管理声明", "Permission:ManageOrganizationUnits": "管理组织机构", "Permission:IdentityClaimTypeManagement": "管理声明类型", + "Permission:IdentitySessions": "管理会话", + "Permission:RevokeSession": "撤销会话", "OrganizationUnit:Tree": "组织机构树", "OrganizationUnit:New": "新组织结构", "OrganizationUnit:Members": "机构成员", @@ -60,10 +62,22 @@ "Description:Abp.Identity.User.SmsPhoneNumberConfirmed": "用户确认手机号验证码模板", "DisplayName:Abp.Identity.User.SmsRepetInterval": "短信验证码重复发送间隔时间(min)", "Description:Abp.Identity.User.SmsRepetInterval": "短信验证码验证码重复发送的最小时间差,单位为分", + "DisplayName:Abp.Identity.Session.ConcurrentLoginStrategy": "重复登录策略", + "Description:Abp.Identity.Session.ConcurrentLoginStrategy": "用户重复登录会话策略", + "DisplayName:Abp.Identity.Session.LogoutFromSameTypeDevicesLimit": "允许相同类型设备登录次数", + "Description:Abp.Identity.Session.LogoutFromSameTypeDevicesLimit": "限制相同类型设备登录次数,超出限制的会话将被注销.", "DisplayName:NewPhoneNumber": "新手机号码", "DisplayName:SmsVerifyCode": "短信验证码", "DisplayName:EmailVerifyCode": "邮件验证码", "DisplayName:WeChatCode": "微信登录凭证", + "DisplayName:SessionId": "会话标识", + "DisplayName:Device": "设备", + "DisplayName:DeviceInfo": "设备信息", + "DisplayName:UserId": "用户标识", + "DisplayName:ClientId": "客户端标识", + "DisplayName:IpAddresses": "Ip地址", + "DisplayName:SignedIn": "登录时间", + "DisplayName:LastAccessed": "上次访问时间", "SendRepeatSmsVerifyCode": "手机验证码不能在 {0} 分钟内重复发送!", "LockTime": "锁定时间", "LockType": "锁定类型", @@ -72,6 +86,18 @@ "UnActived": "未启用", "LockoutEnd": "锁定截止期", "Public": "公用", - "Static": "内置" + "Static": "内置", + "ConcurrentLoginStrategy:None": "没有限制", + "ConcurrentLoginStrategy:LogoutFromSameTypeDevicesLimit": "限制相同类型设备登录次数", + "ConcurrentLoginStrategy:LogoutFromSameTypeDevices": "不允许相同类型设备重复登录", + "ConcurrentLoginStrategy:LogoutFromAllDevices": "不允许重复登录", + "Notifications:AbpIdentity": "身份认证", + "Notifications:SessionExpiration": "会话过期通知", + "Notifications:SessionExpirationMessage": "你的设备 {Device} 会话已过期或在其他地方登录,如有需要请重新登录.", + "IdentitySessions": "用户会话", + "CurrentSession": "当前会话", + "RevokeSession": "撤销会话", + "SessionWillBeRevokedMessage": "选择的会话将被撤销,此操作使目标登录失效!", + "SuccessfullyRevoked": "撤销会话成功" } } \ No newline at end of file diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/Settings/IdentitySettingDefinitionProvider.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/Settings/IdentitySettingDefinitionProvider.cs index 4accf3743..124a0b944 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/Settings/IdentitySettingDefinitionProvider.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/Settings/IdentitySettingDefinitionProvider.cs @@ -2,74 +2,95 @@ using Volo.Abp.Localization; using Volo.Abp.Settings; -namespace LINGYUN.Abp.Identity.Settings +namespace LINGYUN.Abp.Identity.Settings; + +public class IdentitySettingDefinitionProvider : SettingDefinitionProvider { - public class IdentitySettingDefinitionProvider : SettingDefinitionProvider + public override void Define(ISettingDefinitionContext context) { - public override void Define(ISettingDefinitionContext context) - { - context.Add( - new SettingDefinition( - name: IdentitySettingNames.User.SmsNewUserRegister, - defaultValue: "", - displayName: L("DisplayName:Abp.Identity.User.SmsNewUserRegister"), - description: L("Description:Abp.Identity.User.SmsNewUserRegister"), - isVisibleToClients: true) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName), - new SettingDefinition( - name: IdentitySettingNames.User.SmsUserSignin, - defaultValue: "", - displayName: L("DisplayName:Abp.Identity.User.SmsUserSignin"), - description: L("Description:Abp.Identity.User.SmsUserSignin"), - isVisibleToClients: true) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName), - new SettingDefinition( - name: IdentitySettingNames.User.SmsResetPassword, - defaultValue: "", - displayName: L("DisplayName:Abp.Identity.User.SmsResetPassword"), - description: L("Description:Abp.Identity.User.SmsResetPassword"), - isVisibleToClients: true) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName), - new SettingDefinition( - name: IdentitySettingNames.User.SmsPhoneNumberConfirmed, - defaultValue: "", - displayName: L("DisplayName:Abp.Identity.User.SmsPhoneNumberConfirmed"), - description: L("Description:Abp.Identity.User.SmsPhoneNumberConfirmed"), - isVisibleToClients: true) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName), - new SettingDefinition( - name: IdentitySettingNames.User.SmsRepetInterval, - defaultValue: "5", - displayName: L("DisplayName:Abp.Identity.User.SmsRepetInterval"), - description: L("Description:Abp.Identity.User.SmsRepetInterval"), - isVisibleToClients: true) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName) - ); - } + context.Add( + new SettingDefinition( + name: IdentitySettingNames.User.SmsNewUserRegister, + defaultValue: "", + displayName: L("DisplayName:Abp.Identity.User.SmsNewUserRegister"), + description: L("Description:Abp.Identity.User.SmsNewUserRegister"), + isVisibleToClients: true) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName), + new SettingDefinition( + name: IdentitySettingNames.User.SmsUserSignin, + defaultValue: "", + displayName: L("DisplayName:Abp.Identity.User.SmsUserSignin"), + description: L("Description:Abp.Identity.User.SmsUserSignin"), + isVisibleToClients: true) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName), + new SettingDefinition( + name: IdentitySettingNames.User.SmsResetPassword, + defaultValue: "", + displayName: L("DisplayName:Abp.Identity.User.SmsResetPassword"), + description: L("Description:Abp.Identity.User.SmsResetPassword"), + isVisibleToClients: true) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName), + new SettingDefinition( + name: IdentitySettingNames.User.SmsPhoneNumberConfirmed, + defaultValue: "", + displayName: L("DisplayName:Abp.Identity.User.SmsPhoneNumberConfirmed"), + description: L("Description:Abp.Identity.User.SmsPhoneNumberConfirmed"), + isVisibleToClients: true) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName), + new SettingDefinition( + name: IdentitySettingNames.User.SmsRepetInterval, + defaultValue: "5", + displayName: L("DisplayName:Abp.Identity.User.SmsRepetInterval"), + description: L("Description:Abp.Identity.User.SmsRepetInterval"), + isVisibleToClients: true) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName), + new SettingDefinition( + name: IdentitySettingNames.Session.ConcurrentLoginStrategy, + defaultValue: ConcurrentLoginStrategy.None.ToString(), + displayName: L("DisplayName:Abp.Identity.Session.ConcurrentLoginStrategy"), + description: L("Description:Abp.Identity.Session.ConcurrentLoginStrategy"), + isVisibleToClients: true) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName), + new SettingDefinition( + name: IdentitySettingNames.Session.LogoutFromSameTypeDevicesLimit, + defaultValue: "1", + displayName: L("DisplayName:Abp.Identity.Session.LogoutFromSameTypeDevicesLimit"), + description: L("Description:Abp.Identity.Session.LogoutFromSameTypeDevicesLimit"), + isVisibleToClients: true) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName) + ); + } - private static LocalizableString L(string name) - { - return LocalizableString.Create(name); - } + private static LocalizableString L(string name) + { + return LocalizableString.Create(name); } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/Settings/IdentitySettingNames.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/Settings/IdentitySettingNames.cs index e2ab5405b..ab47a2548 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/Settings/IdentitySettingNames.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain.Shared/LINGYUN/Abp/Identity/Settings/IdentitySettingNames.cs @@ -1,31 +1,44 @@ -namespace LINGYUN.Abp.Identity.Settings +namespace LINGYUN.Abp.Identity.Settings; + +public static class IdentitySettingNames { - public static class IdentitySettingNames + private const string Prefix = "Abp.Identity"; + public static class User { - private const string Prefix = "Abp.Identity"; - public static class User - { - private const string UserPrefix = Prefix + ".User"; - /// - /// 用户手机验证短信模板 - /// - public const string SmsPhoneNumberConfirmed = UserPrefix + ".SmsPhoneNumberConfirmed"; - /// - /// 用户注册短信验证码模板号 - /// - public const string SmsNewUserRegister = UserPrefix + ".SmsNewUserRegister"; - /// - /// 用户登录短信验证码模板号 - /// - public const string SmsUserSignin = UserPrefix + ".SmsUserSignin"; - /// - /// 用户重置密码短信验证码模板号 - /// - public const string SmsResetPassword = UserPrefix + ".SmsResetPassword"; - /// - /// 短信验证码重复间隔时间 - /// - public const string SmsRepetInterval = UserPrefix + ".SmsRepetInterval"; - } + private const string UserPrefix = Prefix + ".User"; + /// + /// 用户手机验证短信模板 + /// + public const string SmsPhoneNumberConfirmed = UserPrefix + ".SmsPhoneNumberConfirmed"; + /// + /// 用户注册短信验证码模板号 + /// + public const string SmsNewUserRegister = UserPrefix + ".SmsNewUserRegister"; + /// + /// 用户登录短信验证码模板号 + /// + public const string SmsUserSignin = UserPrefix + ".SmsUserSignin"; + /// + /// 用户重置密码短信验证码模板号 + /// + public const string SmsResetPassword = UserPrefix + ".SmsResetPassword"; + /// + /// 短信验证码重复间隔时间 + /// + public const string SmsRepetInterval = UserPrefix + ".SmsRepetInterval"; + } + + public static class Session + { + private const string SessionPrefix = Prefix + ".Session"; + /// + /// 并发登录策略 + /// see: https://github.com/abpio/abp-commercial-docs/blob/dev/en/modules/identity/session-management.md#prevent-concurrent-login + /// + public const string ConcurrentLoginStrategy = SessionPrefix + ".ConcurrentLoginStrategy"; + /// + /// 限制相同设备登录数量 + /// + public const string LogoutFromSameTypeDevicesLimit = SessionPrefix + ".LogoutFromSameTypeDevicesLimit"; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN.Abp.Identity.Domain.csproj b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN.Abp.Identity.Domain.csproj index 5b6f13fc7..8fe974baa 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN.Abp.Identity.Domain.csproj +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN.Abp.Identity.Domain.csproj @@ -1,10 +1,15 @@ - + - netstandard2.1 + net8.0 + LINGYUN.Abp.Identity.Domain + LINGYUN.Abp.Identity.Domain + false + false + false @@ -14,6 +19,7 @@ + diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/AbpIdentityDomainModule.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/AbpIdentityDomainModule.cs index c5e114d30..cfbe9870b 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/AbpIdentityDomainModule.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/AbpIdentityDomainModule.cs @@ -1,11 +1,55 @@ -using Volo.Abp.Modularity; +using LINGYUN.Abp.Identity.Session; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; +using System.Threading.Tasks; +using Volo.Abp; +using Volo.Abp.AutoMapper; +using Volo.Abp.BackgroundWorkers; +using Volo.Abp.Domain.Entities.Events.Distributed; +using Volo.Abp.Identity; +using Volo.Abp.Modularity; +using Volo.Abp.Threading; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +[DependsOn( + typeof(AbpIdentityDomainSharedModule), + typeof(Volo.Abp.Identity.AbpIdentityDomainModule))] +public class AbpIdentityDomainModule : AbpModule { - [DependsOn( - typeof(AbpIdentityDomainSharedModule), - typeof(Volo.Abp.Identity.AbpIdentityDomainModule))] - public class AbpIdentityDomainModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAutoMapperObjectMapper(); + + Configure(options => + { + options.AddProfile(validate: true); + }); + + Configure(options => + { + options.EtoMappings.Add(typeof(AbpIdentityDomainModule)); + + options.AutoEventSelectors.Add(); + }); + } + + public async override Task OnApplicationInitializationAsync(ApplicationInitializationContext context) + { + var options = context.ServiceProvider.GetRequiredService>().Value; + if (options.IsCleanupEnabled) + { + await context.ServiceProvider + .GetRequiredService() + .AddAsync( + context.ServiceProvider + .GetRequiredService() + ); + } + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) { + AsyncHelper.RunSync(() => OnApplicationInitializationAsync(context)); } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IIdentityRoleRepository.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IIdentityRoleRepository.cs index 2a132c9d6..a8de727c4 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IIdentityRoleRepository.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IIdentityRoleRepository.cs @@ -4,38 +4,37 @@ using System.Threading.Tasks; using Volo.Abp.Identity; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public interface IIdentityRoleRepository : Volo.Abp.Identity.IIdentityRoleRepository { - public interface IIdentityRoleRepository : Volo.Abp.Identity.IIdentityRoleRepository - { - Task> GetListByIdListAsync( - List roleIds, - bool includeDetails = false, - CancellationToken cancellationToken = default - ); + Task> GetListByIdListAsync( + List roleIds, + bool includeDetails = false, + CancellationToken cancellationToken = default + ); - Task> GetOrganizationUnitsAsync( - Guid id, - bool includeDetails = false, - CancellationToken cancellationToken = default); + Task> GetOrganizationUnitsAsync( + Guid id, + bool includeDetails = false, + CancellationToken cancellationToken = default); - Task> GetOrganizationUnitsAsync( - IEnumerable roleNames, - bool includeDetails = false, - CancellationToken cancellationToken = default); + Task> GetOrganizationUnitsAsync( + IEnumerable roleNames, + bool includeDetails = false, + CancellationToken cancellationToken = default); - Task> GetRolesInOrganizationUnitAsync( - Guid organizationUnitId, - CancellationToken cancellationToken = default - ); - Task> GetRolesInOrganizationsListAsync( - List organizationUnitIds, - CancellationToken cancellationToken = default - ); + Task> GetRolesInOrganizationUnitAsync( + Guid organizationUnitId, + CancellationToken cancellationToken = default + ); + Task> GetRolesInOrganizationsListAsync( + List organizationUnitIds, + CancellationToken cancellationToken = default + ); - Task> GetRolesInOrganizationUnitWithChildrenAsync( - string code, - CancellationToken cancellationToken = default - ); - } + Task> GetRolesInOrganizationUnitWithChildrenAsync( + string code, + CancellationToken cancellationToken = default + ); } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IIdentitySessionRepository.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IIdentitySessionRepository.cs new file mode 100644 index 000000000..77bc7cd75 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IIdentitySessionRepository.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Volo.Abp.Identity; + +namespace LINGYUN.Abp.Identity; +public interface IIdentitySessionRepository : Volo.Abp.Identity.IIdentitySessionRepository +{ + Task FindLastAsync( + Guid userId, + string device = null, + CancellationToken cancellationToken = default); + + Task> GetListAsync( + Guid userId, + string device, + Guid? exceptSessionId = null, + int maxResultCount = 0, + CancellationToken cancellationToken = default); + + Task> GetListAsync(Guid userId, CancellationToken cancellationToken = default); + + Task DeleteAllAsync(string sessionId, Guid? exceptSessionId = null, CancellationToken cancellationToken = default); +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IIdentityUserRepository.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IIdentityUserRepository.cs index ffe9f2db4..25adb8f15 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IIdentityUserRepository.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IIdentityUserRepository.cs @@ -4,127 +4,126 @@ using System.Threading.Tasks; using Volo.Abp.Identity; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +public interface IIdentityUserRepository : Volo.Abp.Identity.IIdentityUserRepository { - public interface IIdentityUserRepository : Volo.Abp.Identity.IIdentityUserRepository - { - /// - /// 手机号是否已被使用 - /// - /// - /// - /// - Task IsPhoneNumberUedAsync( - string phoneNumber, - CancellationToken cancellationToken = default); - /// - /// 手机号是否已确认(绑定) - /// - /// - /// - /// - Task IsPhoneNumberConfirmedAsync( - string phoneNumber, - CancellationToken cancellationToken = default); - /// - /// 邮件地址是否已确认(绑定) - /// - /// - /// - /// - Task IsNormalizedEmailConfirmedAsync( - string normalizedEmail, - CancellationToken cancellationToken = default); - /// - /// 通过手机号查询用户 - /// - /// 手机号码 - /// 是否已确认过 - /// - /// - /// - Task FindByPhoneNumberAsync( - string phoneNumber, - bool isConfirmed = true, - bool includeDetails = false, - CancellationToken cancellationToken = default); - /// - /// 通过用户主键列表获取用户 - /// - /// - /// - /// - /// - Task> GetListByIdListAsync( - List userIds, - bool includeDetails = false, - CancellationToken cancellationToken = default - ); - /// - /// 获取用户所有的组织机构列表 - /// - /// - /// - /// - /// - /// - /// - /// - Task> GetOrganizationUnitsAsync( - Guid userId, - string filter = null, - bool includeDetails = false, - int skipCount = 1, - int maxResultCount = 10, - CancellationToken cancellationToken = default - ); - /// - /// - /// - /// - /// - /// - /// - Task GetUsersInOrganizationUnitCountAsync( - Guid organizationUnitId, - string filter = null, - CancellationToken cancellationToken = default + /// + /// 手机号是否已被使用 + /// + /// + /// + /// + Task IsPhoneNumberUedAsync( + string phoneNumber, + CancellationToken cancellationToken = default); + /// + /// 手机号是否已确认(绑定) + /// + /// + /// + /// + Task IsPhoneNumberConfirmedAsync( + string phoneNumber, + CancellationToken cancellationToken = default); + /// + /// 邮件地址是否已确认(绑定) + /// + /// + /// + /// + Task IsNormalizedEmailConfirmedAsync( + string normalizedEmail, + CancellationToken cancellationToken = default); + /// + /// 通过手机号查询用户 + /// + /// 手机号码 + /// 是否已确认过 + /// + /// + /// + Task FindByPhoneNumberAsync( + string phoneNumber, + bool isConfirmed = true, + bool includeDetails = false, + CancellationToken cancellationToken = default); + /// + /// 通过用户主键列表获取用户 + /// + /// + /// + /// + /// + Task> GetListByIdListAsync( + List userIds, + bool includeDetails = false, + CancellationToken cancellationToken = default ); + /// + /// 获取用户所有的组织机构列表 + /// + /// + /// + /// + /// + /// + /// + /// + Task> GetOrganizationUnitsAsync( + Guid userId, + string filter = null, + bool includeDetails = false, + int skipCount = 1, + int maxResultCount = 10, + CancellationToken cancellationToken = default + ); + /// + /// + /// + /// + /// + /// + /// + Task GetUsersInOrganizationUnitCountAsync( + Guid organizationUnitId, + string filter = null, + CancellationToken cancellationToken = default + ); - Task> GetUsersInOrganizationUnitAsync( - Guid organizationUnitId, - string filter = null, - int skipCount = 1, - int maxResultCount = 10, - CancellationToken cancellationToken = default - ); + Task> GetUsersInOrganizationUnitAsync( + Guid organizationUnitId, + string filter = null, + int skipCount = 1, + int maxResultCount = 10, + CancellationToken cancellationToken = default + ); - Task GetUsersInOrganizationsListCountAsync( - List organizationUnitIds, - string filter = null, - CancellationToken cancellationToken = default - ); + Task GetUsersInOrganizationsListCountAsync( + List organizationUnitIds, + string filter = null, + CancellationToken cancellationToken = default + ); - Task> GetUsersInOrganizationsListAsync( - List organizationUnitIds, - string filter = null, - int skipCount = 1, - int maxResultCount = 10, - CancellationToken cancellationToken = default - ); + Task> GetUsersInOrganizationsListAsync( + List organizationUnitIds, + string filter = null, + int skipCount = 1, + int maxResultCount = 10, + CancellationToken cancellationToken = default + ); - Task GetUsersInOrganizationUnitWithChildrenCountAsync( - string code, - string filter = null, - CancellationToken cancellationToken = default - ); + Task GetUsersInOrganizationUnitWithChildrenCountAsync( + string code, + string filter = null, + CancellationToken cancellationToken = default + ); - Task> GetUsersInOrganizationUnitWithChildrenAsync( - string code, - string filter = null, - int skipCount = 1, - int maxResultCount = 10, - CancellationToken cancellationToken = default - ); - } + Task> GetUsersInOrganizationUnitWithChildrenAsync( + string code, + string filter = null, + int skipCount = 1, + int maxResultCount = 10, + CancellationToken cancellationToken = default + ); } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IdentityDomainMappingProfile.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IdentityDomainMappingProfile.cs new file mode 100644 index 000000000..7a8e62e02 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IdentityDomainMappingProfile.cs @@ -0,0 +1,12 @@ +using AutoMapper; +using Volo.Abp.Identity; + +namespace LINGYUN.Abp.Identity; + +public class IdentityDomainMappingProfile : Profile +{ + public IdentityDomainMappingProfile() + { + CreateMap(); + } +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Security/DefaultTotpService.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Security/DefaultTotpService.cs index 3892cc35c..60f3f0cbf 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Security/DefaultTotpService.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Security/DefaultTotpService.cs @@ -5,117 +5,116 @@ using System.Text; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.Identity.Security +namespace LINGYUN.Abp.Identity.Security; + +/// +/// 微软的实现 +/// See: Microsoft.AspNetCore.Identity.Rfc6238AuthenticationService +/// +internal class DefaultTotpService : ITotpService, ISingletonDependency { - /// - /// 微软的实现 - /// See: Microsoft.AspNetCore.Identity.Rfc6238AuthenticationService - /// - internal class DefaultTotpService : ITotpService, ISingletonDependency - { - private static readonly TimeSpan _timestep = TimeSpan.FromMinutes(3); - private static readonly Encoding _encoding = new UTF8Encoding(false, true); + private static readonly TimeSpan _timestep = TimeSpan.FromMinutes(3); + private static readonly Encoding _encoding = new UTF8Encoding(false, true); #if NETSTANDARD2_0 - private static readonly DateTime _unixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); - private static readonly RandomNumberGenerator _rng = RandomNumberGenerator.Create(); + private static readonly DateTime _unixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); + private static readonly RandomNumberGenerator _rng = RandomNumberGenerator.Create(); #endif - // Generates a new 80-bit security token - public static byte[] GenerateRandomKey() - { - byte[] bytes = new byte[20]; + // Generates a new 80-bit security token + public static byte[] GenerateRandomKey() + { + byte[] bytes = new byte[20]; #if NETSTANDARD2_0 - _rng.GetBytes(bytes); + _rng.GetBytes(bytes); #else - RandomNumberGenerator.Fill(bytes); + RandomNumberGenerator.Fill(bytes); #endif - return bytes; - } + return bytes; + } - internal static int ComputeTotp(HashAlgorithm hashAlgorithm, ulong timestepNumber, string modifier) - { - // # of 0's = length of pin - const int Mod = 1000000; + internal static int ComputeTotp(HashAlgorithm hashAlgorithm, ulong timestepNumber, string modifier) + { + // # of 0's = length of pin + const int Mod = 1000000; - // See https://tools.ietf.org/html/rfc4226 - // We can add an optional modifier - var timestepAsBytes = BitConverter.GetBytes(IPAddress.HostToNetworkOrder((long)timestepNumber)); - var hash = hashAlgorithm.ComputeHash(ApplyModifier(timestepAsBytes, modifier)); + // See https://tools.ietf.org/html/rfc4226 + // We can add an optional modifier + var timestepAsBytes = BitConverter.GetBytes(IPAddress.HostToNetworkOrder((long)timestepNumber)); + var hash = hashAlgorithm.ComputeHash(ApplyModifier(timestepAsBytes, modifier)); - // Generate DT string - var offset = hash[hash.Length - 1] & 0xf; - Debug.Assert(offset + 4 < hash.Length); - var binaryCode = (hash[offset] & 0x7f) << 24 - | (hash[offset + 1] & 0xff) << 16 - | (hash[offset + 2] & 0xff) << 8 - | (hash[offset + 3] & 0xff); + // Generate DT string + var offset = hash[hash.Length - 1] & 0xf; + Debug.Assert(offset + 4 < hash.Length); + var binaryCode = (hash[offset] & 0x7f) << 24 + | (hash[offset + 1] & 0xff) << 16 + | (hash[offset + 2] & 0xff) << 8 + | (hash[offset + 3] & 0xff); - return binaryCode % Mod; - } + return binaryCode % Mod; + } - private static byte[] ApplyModifier(byte[] input, string modifier) + private static byte[] ApplyModifier(byte[] input, string modifier) + { + if (String.IsNullOrEmpty(modifier)) { - if (String.IsNullOrEmpty(modifier)) - { - return input; - } - - var modifierBytes = _encoding.GetBytes(modifier); - var combined = new byte[checked(input.Length + modifierBytes.Length)]; - Buffer.BlockCopy(input, 0, combined, 0, input.Length); - Buffer.BlockCopy(modifierBytes, 0, combined, input.Length, modifierBytes.Length); - return combined; + return input; } - // More info: https://tools.ietf.org/html/rfc6238#section-4 - private static ulong GetCurrentTimeStepNumber() - { + var modifierBytes = _encoding.GetBytes(modifier); + var combined = new byte[checked(input.Length + modifierBytes.Length)]; + Buffer.BlockCopy(input, 0, combined, 0, input.Length); + Buffer.BlockCopy(modifierBytes, 0, combined, input.Length, modifierBytes.Length); + return combined; + } + + // More info: https://tools.ietf.org/html/rfc6238#section-4 + private static ulong GetCurrentTimeStepNumber() + { #if NETSTANDARD2_0 - var delta = DateTime.UtcNow - _unixEpoch; + var delta = DateTime.UtcNow - _unixEpoch; #else - var delta = DateTimeOffset.UtcNow - DateTimeOffset.UnixEpoch; + var delta = DateTimeOffset.UtcNow - DateTimeOffset.UnixEpoch; #endif - return (ulong)(delta.Ticks / _timestep.Ticks); - } + return (ulong)(delta.Ticks / _timestep.Ticks); + } - public int GenerateCode(byte[] securityToken, string modifier = null) + public int GenerateCode(byte[] securityToken, string modifier = null) + { + if (securityToken == null) { - if (securityToken == null) - { - throw new ArgumentNullException(nameof(securityToken)); - } + throw new ArgumentNullException(nameof(securityToken)); + } - // Allow a variance of no greater than 9 minutes in either direction - var currentTimeStep = GetCurrentTimeStepNumber(); - using (var hashAlgorithm = new HMACSHA1(securityToken)) - { - return ComputeTotp(hashAlgorithm, currentTimeStep, modifier); - } + // Allow a variance of no greater than 9 minutes in either direction + var currentTimeStep = GetCurrentTimeStepNumber(); + using (var hashAlgorithm = new HMACSHA1(securityToken)) + { + return ComputeTotp(hashAlgorithm, currentTimeStep, modifier); } + } - public bool ValidateCode(byte[] securityToken, int code, string modifier = null) + public bool ValidateCode(byte[] securityToken, int code, string modifier = null) + { + if (securityToken == null) { - if (securityToken == null) - { - throw new ArgumentNullException(nameof(securityToken)); - } + throw new ArgumentNullException(nameof(securityToken)); + } - // Allow a variance of no greater than 9 minutes in either direction - var currentTimeStep = GetCurrentTimeStepNumber(); - using (var hashAlgorithm = new HMACSHA1(securityToken)) + // Allow a variance of no greater than 9 minutes in either direction + var currentTimeStep = GetCurrentTimeStepNumber(); + using (var hashAlgorithm = new HMACSHA1(securityToken)) + { + for (var i = -2; i <= 2; i++) { - for (var i = -2; i <= 2; i++) + var computedTotp = ComputeTotp(hashAlgorithm, (ulong)((long)currentTimeStep + i), modifier); + if (computedTotp == code) { - var computedTotp = ComputeTotp(hashAlgorithm, (ulong)((long)currentTimeStep + i), modifier); - if (computedTotp == code) - { - return true; - } + return true; } } - - // No match - return false; } + + // No match + return false; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Security/ITotpService.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Security/ITotpService.cs index 557edc7bc..3b124616d 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Security/ITotpService.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Security/ITotpService.cs @@ -1,12 +1,11 @@ -namespace LINGYUN.Abp.Identity.Security +namespace LINGYUN.Abp.Identity.Security; + +/// +/// totp算法服务 +/// +public interface ITotpService { - /// - /// totp算法服务 - /// - public interface ITotpService - { - int GenerateCode(byte[] securityToken, string modifier = null); + int GenerateCode(byte[] securityToken, string modifier = null); - bool ValidateCode(byte[] securityToken, int code, string modifier = null); - } + bool ValidateCode(byte[] securityToken, int code, string modifier = null); } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/SecurityTokenCacheItem.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/SecurityTokenCacheItem.cs index 8cc8f747e..eaf5bb57f 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/SecurityTokenCacheItem.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/SecurityTokenCacheItem.cs @@ -1,50 +1,49 @@ -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +/// +/// 安全令牌验证缓存 +/// +public class SecurityTokenCacheItem { /// - /// 安全令牌验证缓存 + /// 用于验证的Token /// - public class SecurityTokenCacheItem - { - /// - /// 用于验证的Token - /// - public string Token { get; set; } - /// - /// 用于验证的安全令牌 - /// - public string SecurityToken { get; set; } + public string Token { get; set; } + /// + /// 用于验证的安全令牌 + /// + public string SecurityToken { get; set; } - public SecurityTokenCacheItem() - { + public SecurityTokenCacheItem() + { - } + } - public SecurityTokenCacheItem(string token, string securityToken) - { - Token = token; - SecurityToken = securityToken; - } + public SecurityTokenCacheItem(string token, string securityToken) + { + Token = token; + SecurityToken = securityToken; + } - /// - /// 生成查询Key - /// - /// 手机号 - /// 安全令牌用途 - /// - public static string CalculateSmsCacheKey(string phoneNumber, string purpose) - { - return "Totp:" + purpose + ";p:" + phoneNumber; - } + /// + /// 生成查询Key + /// + /// 手机号 + /// 安全令牌用途 + /// + public static string CalculateSmsCacheKey(string phoneNumber, string purpose) + { + return "Totp:" + purpose + ";p:" + phoneNumber; + } - /// - /// 生成查询Key - /// - /// 邮件地址 - /// 安全令牌用途 - /// - public static string CalculateEmailCacheKey(string email, string purpose) - { - return "Totp:" + purpose + ";e:" + email; - } + /// + /// 生成查询Key + /// + /// 邮件地址 + /// 安全令牌用途 + /// + public static string CalculateEmailCacheKey(string email, string purpose) + { + return "Totp:" + purpose + ";e:" + email; } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IIdentitySessionManager.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IIdentitySessionManager.cs new file mode 100644 index 000000000..faabf8d19 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IIdentitySessionManager.cs @@ -0,0 +1,29 @@ +using System.Security.Claims; +using System.Threading; +using System.Threading.Tasks; + +namespace LINGYUN.Abp.Identity.Session; +/// +/// 管理用户会话 +/// +public interface IIdentitySessionManager +{ + /// + /// 保存会话 + /// + /// 用户身份主体 + /// + /// + Task SaveSessionAsync( + ClaimsPrincipal claimsPrincipal, + CancellationToken cancellationToken = default); + /// + /// 撤销用户会话 + /// + /// 会话id + /// + /// + Task RevokeSessionAsync( + string sessionId, + CancellationToken cancellation = default); +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IIdentitySessionStore.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IIdentitySessionStore.cs new file mode 100644 index 000000000..01c3fdfcd --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IIdentitySessionStore.cs @@ -0,0 +1,176 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Volo.Abp.Identity; + +namespace LINGYUN.Abp.Identity.Session; +/// +/// 用户会话持久化 +/// +public interface IIdentitySessionStore +{ + /// + /// 创建用户会话 + /// + /// 会话id + /// 设备 + /// 设备信息 + /// 用户id + /// 客户端id + /// ip地址 + /// 租户id + /// + /// 创建完成的 + Task CreateAsync( + string sessionId, + string device, + string deviceInfo, + Guid userId, + string clientId, + string ipAddresses, + Guid? tenantId = null, + CancellationToken cancellationToken = default); + /// + /// 更新用户会话 + /// + /// 用户会话实体 + /// + /// a completed task. + Task UpdateAsync( + IdentitySession session, + CancellationToken cancellationToken = default); + /// + /// 查询用户会话 + /// + /// 会话key + /// + /// 查询到的 + /// + Task GetAsync( + Guid id, + CancellationToken cancellationToken = default); + /// + /// 查询用户会话 + /// + /// 会话key + /// + /// 如果存在返回 的实例, 否则返回 null. + Task FindAsync( + Guid id, + CancellationToken cancellationToken = default); + /// + /// 查询用户会话 + /// + /// 会话id + /// + /// 查询到的 + /// + Task GetAsync( + string sessionId, + CancellationToken cancellationToken = default); + /// + /// 查询用户会话 + /// + /// 会话id + /// + /// 如果存在返回 的实例, 否则返回 null. + Task FindAsync( + string sessionId, + CancellationToken cancellationToken = default); + /// + /// 查询用户最后一次会话 + /// + /// 用户id + /// 设备 + /// + /// 如果存在返回 的实例, 否则返回 null. + Task FindLastAsync( + Guid userId, + string device, + CancellationToken cancellationToken = default); + /// + /// 会话是否已存在 + /// + /// 会话id + /// + /// 如果存在,返回true, 否则返回false. + Task ExistAsync( + string sessionId, + CancellationToken cancellationToken = default); + /// + /// 撤销用户会话 + /// + /// 会话key + /// + /// + Task RevokeAsync( + Guid id, + CancellationToken cancellationToken = default); + /// + /// 撤销用户会话 + /// + /// 会话id + /// + /// + Task RevokeAsync( + string sessionId, + CancellationToken cancellationToken = default); + /// + /// 撤销全部会话 + /// + /// 用户id + /// 排除会话key + /// + /// + Task RevokeAllAsync( + Guid userId, + Guid? exceptSessionId = null, + CancellationToken cancellationToken = default); + /// + /// 撤销全部会话 + /// + /// 用户id + /// 设备 + /// 排除会话key + /// + /// + Task RevokeAllAsync( + Guid userId, + string device, + Guid? exceptSessionId = null, + CancellationToken cancellationToken = default); + /// + /// 撤销不活跃会话 + /// + /// 不活跃的时间间隔 + /// + /// + Task RevokeAllAsync( + TimeSpan inactiveTimeSpan, + CancellationToken cancellationToken = default); + /// + /// 撤销指定的会话 + /// + /// 用户id + /// 设备 + /// 排除会话id + /// 最大数量 + /// + /// + Task RevokeWithAsync( + Guid userId, + string device = null, + Guid? exceptSessionId = null, + int maxCount = 0, + CancellationToken cancellationToken = default); + /// + /// 撤销会话列表 + /// + /// 会话列表 + /// + /// + Task RevokeManyAsync( + IEnumerable identitySessions, + CancellationToken cancellationToken = default); +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionCacheItemSynchronizer.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionCacheItemSynchronizer.cs new file mode 100644 index 000000000..091466287 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionCacheItemSynchronizer.cs @@ -0,0 +1,66 @@ +using System; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Entities.Events.Distributed; +using Volo.Abp.EventBus.Distributed; + +namespace LINGYUN.Abp.Identity.Session; +public class IdentitySessionCacheItemSynchronizer : + IDistributedEventHandler>, + IDistributedEventHandler>, + IDistributedEventHandler, + ITransientDependency +{ + protected IIdentitySessionCache IdentitySessionCache { get; } + protected IIdentitySessionStore IdentitySessionStore { get; } + + public IdentitySessionCacheItemSynchronizer( + IIdentitySessionCache identitySessionCache, + IIdentitySessionStore identitySessionStore) + { + IdentitySessionCache = identitySessionCache; + IdentitySessionStore = identitySessionStore; + } + + public async virtual Task HandleEventAsync(EntityDeletedEto eventData) + { + await IdentitySessionCache.RemoveAsync(eventData.Entity.SessionId); + } + + public async virtual Task HandleEventAsync(EntityCreatedEto eventData) + { + var identitySessionCacheItem = new IdentitySessionCacheItem( + eventData.Entity.Device, + eventData.Entity.DeviceInfo, + eventData.Entity.UserId, + eventData.Entity.SessionId, + eventData.Entity.ClientId, + eventData.Entity.IpAddresses, + eventData.Entity.SignedIn, + eventData.Entity.LastAccessed); + + await IdentitySessionCache.RefreshAsync( + eventData.Entity.SessionId, + identitySessionCacheItem); + } + + public async virtual Task HandleEventAsync(IdentitySessionChangeAccessedEvent eventData) + { + var idetitySession = await IdentitySessionStore.FindAsync(eventData.SessionId); + if (idetitySession != null) + { + if (!eventData.IpAddresses.IsNullOrWhiteSpace()) + { + idetitySession.SetIpAddresses(eventData.IpAddresses.Split(",")); + } + idetitySession.UpdateLastAccessedTime(eventData.LastAccessed); + + await IdentitySessionStore.UpdateAsync(idetitySession); + } + else + { + // 数据库中不存在会话, 清理缓存, 后续请求会话失效 + await IdentitySessionCache.RemoveAsync(eventData.SessionId); + } + } +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionClaimsPrincipalContributor.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionClaimsPrincipalContributor.cs new file mode 100644 index 000000000..0c9f27e10 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionClaimsPrincipalContributor.cs @@ -0,0 +1,37 @@ +using System; +using System.Linq; +using System.Security.Claims; +using System.Security.Principal; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Security.Claims; + +namespace LINGYUN.Abp.Identity.Session.AspNetCore; +public class IdentitySessionClaimsPrincipalContributor : IAbpClaimsPrincipalContributor, ITransientDependency +{ + public virtual Task ContributeAsync(AbpClaimsPrincipalContributorContext context) + { + var claimsIdentity = context.ClaimsPrincipal.Identities.First(); + if (claimsIdentity.HasClaim(x => x.Type == AbpClaimTypes.SessionId)) + { + return Task.CompletedTask; + } + var sessionId = claimsIdentity.FindSessionId(); + if (!sessionId.IsNullOrWhiteSpace()) + { + claimsIdentity.AddOrReplace(new Claim(AbpClaimTypes.SessionId, sessionId)); + context.ClaimsPrincipal.AddIdentityIfNotContains(claimsIdentity); + return Task.CompletedTask; + } + + var userId = claimsIdentity.FindUserId(); + if (userId.HasValue) + { + sessionId = Guid.NewGuid().ToString("N"); + + claimsIdentity.AddOrReplace(new Claim(AbpClaimTypes.SessionId, sessionId)); + context.ClaimsPrincipal.AddIdentityIfNotContains(claimsIdentity); + } + return Task.CompletedTask; + } +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionCleanupBackgroundWorker.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionCleanupBackgroundWorker.cs new file mode 100644 index 000000000..7abbaaccd --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionCleanupBackgroundWorker.cs @@ -0,0 +1,34 @@ +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; +using System.Threading.Tasks; +using Volo.Abp.BackgroundWorkers; +using Volo.Abp.Threading; + +namespace LINGYUN.Abp.Identity.Session; + +public class IdentitySessionCleanupBackgroundWorker : AsyncPeriodicBackgroundWorkerBase +{ + protected IdentitySessionCleanupOptions Options { get; } + public IdentitySessionCleanupBackgroundWorker( + AbpAsyncTimer timer, + IServiceScopeFactory serviceScopeFactory, + IOptions options) + : base(timer, serviceScopeFactory) + { + Options = options.Value; + timer.Period = Options.CleanupPeriod; + } + + protected async override Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) + { + if (!Options.IsCleanupEnabled) + { + return; + } + + await workerContext + .ServiceProvider + .GetRequiredService() + .CleanAsync(); + } +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionCleanupOptions.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionCleanupOptions.cs new file mode 100644 index 000000000..93e49503d --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionCleanupOptions.cs @@ -0,0 +1,26 @@ +using System; + +namespace LINGYUN.Abp.Identity.Session; +public class IdentitySessionCleanupOptions +{ + /// + /// 是否启用会话清理 + /// 默认: false + /// + public bool IsCleanupEnabled { get; set; } + /// + /// 会话清理间隔(ms) + /// 默认: 1小时 + /// + public int CleanupPeriod { get; set; } + /// + /// 不活跃会话保持时长 + /// 默认: 30天 + /// + public TimeSpan InactiveTimeSpan { get; set; } + public IdentitySessionCleanupOptions() + { + CleanupPeriod = 3_600_000; + InactiveTimeSpan = TimeSpan.FromDays(30); + } +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionCleanupService.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionCleanupService.cs new file mode 100644 index 000000000..8857e1a16 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionCleanupService.cs @@ -0,0 +1,37 @@ +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; +using Microsoft.Extensions.Options; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Uow; + +namespace LINGYUN.Abp.Identity.Session; +/// +/// 用户会话清理服务 +/// +public class IdentitySessionCleanupService : ITransientDependency +{ + public ILogger Logger { protected get; set; } + + protected IdentitySessionCleanupOptions Options { get; } + protected IIdentitySessionStore IdentitySessionStore { get; } + public IdentitySessionCleanupService( + IOptions options, + IIdentitySessionStore identitySessionStore) + { + Options = options.Value; + IdentitySessionStore = identitySessionStore; + + Logger = NullLogger.Instance; + } + + [UnitOfWork] + public async virtual Task CleanAsync() + { + Logger.LogDebug($"Cleaning inactive user session."); + + await IdentitySessionStore.RevokeAllAsync(Options.InactiveTimeSpan); + + Logger.LogDebug($"Cleaned inactive user session."); + } +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionEntityCreatedEventHandler.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionEntityCreatedEventHandler.cs new file mode 100644 index 000000000..d34cd4a39 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionEntityCreatedEventHandler.cs @@ -0,0 +1,75 @@ +using LINGYUN.Abp.Identity.Settings; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; +using System; +using System.Threading.Tasks; +using Volo.Abp.Caching; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Entities.Events; +using Volo.Abp.EventBus; +using Volo.Abp.Identity; +using Volo.Abp.Settings; + +namespace LINGYUN.Abp.Identity.Session; +public class IdentitySessionEntityCreatedEventHandler : + ILocalEventHandler>, + ITransientDependency +{ + public ILogger Logger { protected get; set; } + + private readonly ISettingProvider _settingProvider; + private readonly IIdentitySessionStore _identitySessionStore; + private readonly IDistributedCache _identitySessionCache; + + public IdentitySessionEntityCreatedEventHandler( + ISettingProvider settingProvider, + IIdentitySessionStore identitySessionStore, + IDistributedCache identitySessionCache) + { + _settingProvider = settingProvider; + _identitySessionStore = identitySessionStore; + _identitySessionCache = identitySessionCache; + + Logger = NullLogger.Instance; + } + + public async virtual Task HandleEventAsync(EntityCreatedEventData eventData) + { + // 创建一个会话后根据策略使其他会话失效 + var strategySet = await _settingProvider.GetOrNullAsync(IdentitySettingNames.Session.ConcurrentLoginStrategy); + + Logger.LogDebug($"The concurrent login strategy is: {strategySet}"); + + if (!strategySet.IsNullOrWhiteSpace() && Enum.TryParse(strategySet, true, out var strategy)) + { + switch (strategy) + { + // 限制用户相同设备 + case ConcurrentLoginStrategy.LogoutFromSameTypeDevicesLimit: + var sameTypeDevicesCountSet = await _settingProvider.GetAsync(IdentitySettingNames.Session.LogoutFromSameTypeDevicesLimit, 1); + Logger.LogDebug($"Clear other sessions on the device {eventData.Entity.Device} and save only {sameTypeDevicesCountSet} sessions."); + await _identitySessionStore.RevokeWithAsync( + eventData.Entity.UserId, + eventData.Entity.Device, + eventData.Entity.Id, + sameTypeDevicesCountSet); + break; + // 限制登录设备 + case ConcurrentLoginStrategy.LogoutFromSameTypeDevices: + Logger.LogDebug($"Clear all other sessions on the device {eventData.Entity.Device}."); + await _identitySessionStore.RevokeAllAsync( + eventData.Entity.UserId, + eventData.Entity.Device, + eventData.Entity.Id); + break; + // 限制多端登录 + case ConcurrentLoginStrategy.LogoutFromAllDevices: + Logger.LogDebug($"Clear all other user sessions."); + await _identitySessionStore.RevokeAllAsync( + eventData.Entity.UserId, + eventData.Entity.Id); + break; + } + } + } +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionManager.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionManager.cs new file mode 100644 index 000000000..cc3ee30f0 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionManager.cs @@ -0,0 +1,78 @@ +using Microsoft.Extensions.Logging; +using System; +using System.Security.Claims; +using System.Security.Principal; +using System.Threading; +using System.Threading.Tasks; +using Volo.Abp.Auditing; +using Volo.Abp.Domain.Services; +using Volo.Abp.Identity; + +namespace LINGYUN.Abp.Identity.Session; +public class IdentitySessionManager : DomainService, IIdentitySessionManager +{ + protected IDeviceInfoProvider DeviceInfoProvider { get; } + protected IIdentitySessionStore IdentitySessionStore { get; } + protected IdentityDynamicClaimsPrincipalContributorCache IdentityDynamicClaimsPrincipalContributorCache { get; } + + public IdentitySessionManager( + IDeviceInfoProvider deviceInfoProvider, + IIdentitySessionStore identitySessionStore, + IdentityDynamicClaimsPrincipalContributorCache identityDynamicClaimsPrincipalContributorCache) + { + DeviceInfoProvider = deviceInfoProvider; + IdentitySessionStore = identitySessionStore; + IdentityDynamicClaimsPrincipalContributorCache = identityDynamicClaimsPrincipalContributorCache; + } + + [DisableAuditing] + public async virtual Task SaveSessionAsync( + ClaimsPrincipal claimsPrincipal, + CancellationToken cancellationToken = default) + { + if (claimsPrincipal != null) + { + var userId = claimsPrincipal.FindUserId(); + var sessionId = claimsPrincipal.FindSessionId(); + if (!userId.HasValue || sessionId.IsNullOrWhiteSpace()) + { + return; + } + if (await IdentitySessionStore.ExistAsync(sessionId, cancellationToken)) + { + return; + } + var deviceInfo = DeviceInfoProvider.DeviceInfo; + + var device = deviceInfo.Device ?? IdentitySessionDevices.OAuth; + var deviceDesc = deviceInfo.Description; + var clientIpAddress = deviceInfo.ClientIpAddress; + + var tenantId = claimsPrincipal.FindTenantId(); + var clientId = claimsPrincipal.FindClientId(); + + Logger.LogDebug($"Save user session for user: {userId}, session: {sessionId}"); + + await IdentitySessionStore.CreateAsync( + sessionId, + device, + deviceDesc, + userId.Value, + clientId, + clientIpAddress, + tenantId, + cancellationToken); + + Logger.LogDebug($"Remove dynamic claims cache for user: {userId}"); + await IdentityDynamicClaimsPrincipalContributorCache.ClearAsync(userId.Value, tenantId); + } + } + + public async virtual Task RevokeSessionAsync( + string sessionId, + CancellationToken cancellation = default) + { + Logger.LogDebug($"Revoke user session for: {sessionId}"); + await IdentitySessionStore.RevokeAsync(sessionId, cancellation); + } +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionSignInOptions.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionSignInOptions.cs new file mode 100644 index 000000000..a8b84fca1 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionSignInOptions.cs @@ -0,0 +1,31 @@ +using System.Collections.Generic; + +namespace LINGYUN.Abp.Identity.Session; +/// +/// 用于会话管理的配置 +/// +public class IdentitySessionSignInOptions +{ + /// + /// 用于处理的身份认证方案 + /// + public List AuthenticationSchemes { get; set; } + /// + /// 是否启用SignInManager登录会话 + /// 默认: false + /// + public bool SignInSessionEnabled { get; set; } + /// + /// 是否启用SignInManager登出会话 + /// 默认: false + /// + public bool SignOutSessionEnabled { get; set; } + + public IdentitySessionSignInOptions() + { + AuthenticationSchemes = new List + { + "Identity.Application" + }; + } +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionStore.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionStore.cs new file mode 100644 index 000000000..d4090952f --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionStore.cs @@ -0,0 +1,176 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Volo.Abp; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Guids; +using Volo.Abp.Identity; +using Volo.Abp.Timing; +using Volo.Abp.Users; + +namespace LINGYUN.Abp.Identity.Session; +public class IdentitySessionStore : IIdentitySessionStore, ITransientDependency +{ + protected IClock Clock { get; } + protected ICurrentUser CurrentUser { get; } + protected IGuidGenerator GuidGenerator { get; } + protected IIdentitySessionRepository IdentitySessionRepository { get; } + + public IdentitySessionStore( + IClock clock, + ICurrentUser currentUser, + IGuidGenerator guidGenerator, + IIdentitySessionRepository identitySessionRepository) + { + Clock = clock; + CurrentUser = currentUser; + GuidGenerator = guidGenerator; + IdentitySessionRepository = identitySessionRepository; + } + + public async virtual Task CreateAsync( + string sessionId, + string device, + string deviceInfo, + Guid userId, + string clientId, + string ipAddresses, + Guid? tenantId = null, + CancellationToken cancellationToken = default) + { + Check.NotNullOrWhiteSpace(sessionId, nameof(sessionId)); + Check.NotNullOrWhiteSpace(device, nameof(device)); + + var identitySession = new IdentitySession( + GuidGenerator.Create(), + sessionId, + device, + deviceInfo, + userId, + tenantId, + clientId, + ipAddresses, + Clock.Now, + Clock.Now + ); + + identitySession = await IdentitySessionRepository.InsertAsync(identitySession, cancellationToken: cancellationToken); + + return identitySession; + } + + public async virtual Task UpdateAsync( + IdentitySession session, + CancellationToken cancellationToken = default) + { + await IdentitySessionRepository.UpdateAsync(session, cancellationToken: cancellationToken); + } + + public async virtual Task GetAsync( + Guid id, + CancellationToken cancellationToken = default) + { + return await IdentitySessionRepository.GetAsync(id, cancellationToken: cancellationToken); + } + + public async virtual Task FindAsync( + Guid id, + CancellationToken cancellationToken = default) + { + return await IdentitySessionRepository.FindAsync(id, cancellationToken: cancellationToken); + } + + public async virtual Task GetAsync( + string sessionId, + CancellationToken cancellationToken = default) + { + return await IdentitySessionRepository.GetAsync(sessionId, cancellationToken: cancellationToken); + } + + public async virtual Task FindAsync( + string sessionId, + CancellationToken cancellationToken = default) + { + return await IdentitySessionRepository.FindAsync(sessionId, cancellationToken: cancellationToken); + } + + public async virtual Task FindLastAsync( + Guid userId, + string device, + CancellationToken cancellationToken = default) + { + return await IdentitySessionRepository.FindLastAsync(userId, device, cancellationToken: cancellationToken); + } + + public async virtual Task ExistAsync( + string sessionId, + CancellationToken cancellationToken = default) + { + return await IdentitySessionRepository.ExistAsync(sessionId, cancellationToken: cancellationToken); + } + + public async virtual Task RevokeAsync( + Guid id, + CancellationToken cancellationToken = default) + { + await IdentitySessionRepository.DeleteAsync(id, cancellationToken: cancellationToken); + } + + public async virtual Task RevokeAsync( + string sessionId, + CancellationToken cancellationToken = default) + { + await IdentitySessionRepository.DeleteAllAsync(sessionId, cancellationToken: cancellationToken); + } + + public async virtual Task RevokeAllAsync( + Guid userId, + Guid? exceptSessionId = null, + CancellationToken cancellationToken = default) + { + await IdentitySessionRepository.DeleteAllAsync(userId, exceptSessionId, cancellationToken: cancellationToken); + } + + public async virtual Task RevokeAllAsync( + Guid userId, + string device, + Guid? exceptSessionId = null, + CancellationToken cancellationToken = default) + { + await IdentitySessionRepository.DeleteAllAsync(userId, device, exceptSessionId, cancellationToken: cancellationToken); + } + + public async virtual Task RevokeAllAsync( + TimeSpan inactiveTimeSpan, + CancellationToken cancellationToken = default) + { + await IdentitySessionRepository.DeleteAllAsync(inactiveTimeSpan, cancellationToken); + } + + public async virtual Task RevokeWithAsync( + Guid userId, + string device = null, + Guid? exceptSessionId = null, + int maxCount = 0, + CancellationToken cancellationToken = default) + { + var revokeSelessions = await IdentitySessionRepository.GetListAsync(userId, device, exceptSessionId, maxCount, cancellationToken: cancellationToken); + if (revokeSelessions.Count < maxCount) + { + return; + } + + await IdentitySessionRepository.DeleteManyAsync( + revokeSelessions.Skip(0).Take(revokeSelessions.Count - maxCount + 1), + cancellationToken: cancellationToken); + } + + public async virtual Task RevokeManyAsync( + IEnumerable identitySessions, + CancellationToken cancellationToken = default) + { + await IdentitySessionRepository.DeleteManyAsync(identitySessions, cancellationToken: cancellationToken); + } +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/Microsoft/AspNetCore/Identity/IdentityUserManagerExtensions.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/Microsoft/AspNetCore/Identity/IdentityUserManagerExtensions.cs index f08a84d17..6b380a891 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/Microsoft/AspNetCore/Identity/IdentityUserManagerExtensions.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/Microsoft/AspNetCore/Identity/IdentityUserManagerExtensions.cs @@ -5,39 +5,38 @@ using Volo.Abp.Data; using Volo.Abp.Identity; -namespace Microsoft.AspNetCore.Identity +namespace Microsoft.AspNetCore.Identity; + +public static class IdentityUserManagerExtensions { - public static class IdentityUserManagerExtensions + public static async Task SetTwoFactorEnabledWithAccountConfirmedAsync( + [NotNull] this UserManager userManager, + [NotNull] TUser user, + bool enabled) + where TUser : IdentityUser { - public static async Task SetTwoFactorEnabledWithAccountConfirmedAsync( - [NotNull] this UserManager userManager, - [NotNull] TUser user, - bool enabled) - where TUser : IdentityUser + Check.NotNull(userManager, nameof(userManager)); + Check.NotNull(user, nameof(user)); + + if (enabled) { - Check.NotNull(userManager, nameof(userManager)); - Check.NotNull(user, nameof(user)); - - if (enabled) + var hasAuthenticatorEnabled = user.GetProperty(userManager.Options.Tokens.AuthenticatorTokenProvider, false); + var phoneNumberConfirmed = await userManager.IsPhoneNumberConfirmedAsync(user); + var emailAddressConfirmed = await userManager.IsEmailConfirmedAsync(user); + // 如果其中一个安全选项未确认,无法启用双因素验证 + if (!hasAuthenticatorEnabled && !phoneNumberConfirmed && !emailAddressConfirmed) { - var hasAuthenticatorEnabled = user.GetProperty(userManager.Options.Tokens.AuthenticatorTokenProvider, false); - var phoneNumberConfirmed = await userManager.IsPhoneNumberConfirmedAsync(user); - var emailAddressConfirmed = await userManager.IsEmailConfirmedAsync(user); - // 如果其中一个安全选项未确认,无法启用双因素验证 - if (!hasAuthenticatorEnabled && !phoneNumberConfirmed && !emailAddressConfirmed) - { - // TODO: 返回标准的 IdentityResult - //var error = new IdentityError(); - //return IdentityResult.Failed(error); + // TODO: 返回标准的 IdentityResult + //var error = new IdentityError(); + //return IdentityResult.Failed(error); - throw new IdentityException( - LINGYUN.Abp.Identity.IdentityErrorCodes.ChangeTwoFactorWithMFANotBound, - details: phoneNumberConfirmed ? "phone number not confirmed" : "email address not confirmed"); - } + throw new IdentityException( + LINGYUN.Abp.Identity.IdentityErrorCodes.ChangeTwoFactorWithMFANotBound, + details: phoneNumberConfirmed ? "phone number not confirmed" : "email address not confirmed"); } - - return await userManager.SetTwoFactorEnabledAsync(user, enabled); } + + return await userManager.SetTwoFactorEnabledAsync(user, enabled); } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/Microsoft/AspNetCore/Identity/PhoneNumberUserValidator.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/Microsoft/AspNetCore/Identity/PhoneNumberUserValidator.cs index 96c3b7852..aaa4e6a65 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/Microsoft/AspNetCore/Identity/PhoneNumberUserValidator.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/Microsoft/AspNetCore/Identity/PhoneNumberUserValidator.cs @@ -9,49 +9,48 @@ using Volo.Abp.Identity.Localization; using IIdentityUserRepository = LINGYUN.Abp.Identity.IIdentityUserRepository; -namespace Microsoft.AspNetCore.Identity +namespace Microsoft.AspNetCore.Identity; + +[Dependency(ServiceLifetime.Scoped, ReplaceServices = true)] +[ExposeServices(typeof(IUserValidator))] +public class PhoneNumberUserValidator : UserValidator { - [Dependency(ServiceLifetime.Scoped, ReplaceServices = true)] - [ExposeServices(typeof(IUserValidator))] - public class PhoneNumberUserValidator : UserValidator + private readonly IStringLocalizer _stringLocalizer; + private readonly IIdentityUserRepository _userRepository; + + public PhoneNumberUserValidator( + IIdentityUserRepository userRepository, + IStringLocalizer stringLocalizer) + { + _userRepository = userRepository; + _stringLocalizer = stringLocalizer; + } + public override async Task ValidateAsync(UserManager manager, IdentityUser user) { - private readonly IStringLocalizer _stringLocalizer; - private readonly IIdentityUserRepository _userRepository; + var errors = new List(); + await ValidatePhoneNumberAsync(manager, user, errors); - public PhoneNumberUserValidator( - IIdentityUserRepository userRepository, - IStringLocalizer stringLocalizer) - { - _userRepository = userRepository; - _stringLocalizer = stringLocalizer; - } - public override async Task ValidateAsync(UserManager manager, IdentityUser user) - { - var errors = new List(); - await ValidatePhoneNumberAsync(manager, user, errors); + return (errors.Count > 0) + ? IdentityResult.Failed(errors.ToArray()) + : await base.ValidateAsync(manager, user); + } - return (errors.Count > 0) - ? IdentityResult.Failed(errors.ToArray()) - : await base.ValidateAsync(manager, user); + protected async virtual Task ValidatePhoneNumberAsync(UserManager manager, IdentityUser user, ICollection errors) + { + var phoneNumber = await manager.GetPhoneNumberAsync(user); + if (phoneNumber.IsNullOrWhiteSpace()) + { + return; } - - protected async virtual Task ValidatePhoneNumberAsync(UserManager manager, IdentityUser user, ICollection errors) + var findUser = await _userRepository.FindByPhoneNumberAsync(phoneNumber, false); + if (findUser != null && !findUser.Id.Equals(user.Id)) { - var phoneNumber = await manager.GetPhoneNumberAsync(user); - if (phoneNumber.IsNullOrWhiteSpace()) - { - return; - } - var findUser = await _userRepository.FindByPhoneNumberAsync(phoneNumber, false); - if (findUser != null && !findUser.Id.Equals(user.Id)) - { - //errors.Add(new IdentityError - //{ - // Code = "DuplicatePhoneNumber", - // Description = _stringLocalizer["DuplicatePhoneNumber", phoneNumber] - //}); - throw new UserFriendlyException(_stringLocalizer["Volo.Abp.Identity:DuplicatePhoneNumber", phoneNumber]); - } + //errors.Add(new IdentityError + //{ + // Code = "DuplicatePhoneNumber", + // Description = _stringLocalizer["DuplicatePhoneNumber", phoneNumber] + //}); + throw new UserFriendlyException(_stringLocalizer["Volo.Abp.Identity:DuplicatePhoneNumber", phoneNumber]); } } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN.Abp.Identity.EntityFrameworkCore.csproj b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN.Abp.Identity.EntityFrameworkCore.csproj index 28bc68d96..eb72ed61c 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN.Abp.Identity.EntityFrameworkCore.csproj +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN.Abp.Identity.EntityFrameworkCore.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.Identity.EntityFrameworkCore + LINGYUN.Abp.Identity.EntityFrameworkCore + false + false + false diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/AbpIdentityEntityFrameworkCoreModule.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/AbpIdentityEntityFrameworkCoreModule.cs index c907fa58c..e0c915521 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/AbpIdentityEntityFrameworkCoreModule.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/AbpIdentityEntityFrameworkCoreModule.cs @@ -3,36 +3,36 @@ using Volo.Abp.Identity.EntityFrameworkCore; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.Identity.EntityFrameworkCore +namespace LINGYUN.Abp.Identity.EntityFrameworkCore; + +[DependsOn(typeof(LINGYUN.Abp.Identity.AbpIdentityDomainModule))] +[DependsOn(typeof(Volo.Abp.Identity.EntityFrameworkCore.AbpIdentityEntityFrameworkCoreModule))] +public class AbpIdentityEntityFrameworkCoreModule : AbpModule { - [DependsOn(typeof(LINGYUN.Abp.Identity.AbpIdentityDomainModule))] - [DependsOn(typeof(Volo.Abp.Identity.EntityFrameworkCore.AbpIdentityEntityFrameworkCoreModule))] - public class AbpIdentityEntityFrameworkCoreModule : AbpModule - { - // private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); + // private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); - public override void ConfigureServices(ServiceConfigurationContext context) + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAbpDbContext(options => { - context.Services.AddAbpDbContext(options => - { - options.AddRepository(); - options.AddRepository(); - options.AddRepository(); - }); - } - - //public override void PostConfigureServices(ServiceConfigurationContext context) - //{ - // OneTimeRunner.Run(() => - // { - // ObjectExtensionManager.Instance - // .MapEfCoreProperty( - // ExtensionIdentityUserConsts.AvatarUrlField, - // (etb, prop) => - // { - // prop.HasMaxLength(ExtensionIdentityUserConsts.MaxAvatarUrlLength); - // }); - // }); - //} + options.AddRepository(); + options.AddRepository(); + options.AddRepository(); + options.AddRepository(); + }); } + + //public override void PostConfigureServices(ServiceConfigurationContext context) + //{ + // OneTimeRunner.Run(() => + // { + // ObjectExtensionManager.Instance + // .MapEfCoreProperty( + // ExtensionIdentityUserConsts.AvatarUrlField, + // (etb, prop) => + // { + // prop.HasMaxLength(ExtensionIdentityUserConsts.MaxAvatarUrlLength); + // }); + // }); + //} } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/EfCoreIdentityRoleRepository.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/EfCoreIdentityRoleRepository.cs index f34d036d0..1b2b00f4c 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/EfCoreIdentityRoleRepository.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/EfCoreIdentityRoleRepository.cs @@ -9,89 +9,88 @@ using Volo.Abp.Identity; using Volo.Abp.Identity.EntityFrameworkCore; -namespace LINGYUN.Abp.Identity.EntityFrameworkCore +namespace LINGYUN.Abp.Identity.EntityFrameworkCore; + +public class EfCoreIdentityRoleRepository : Volo.Abp.Identity.EntityFrameworkCore.EfCoreIdentityRoleRepository, IIdentityRoleRepository { - public class EfCoreIdentityRoleRepository : Volo.Abp.Identity.EntityFrameworkCore.EfCoreIdentityRoleRepository, IIdentityRoleRepository + public EfCoreIdentityRoleRepository( + IDbContextProvider dbContextProvider) + : base(dbContextProvider) { - public EfCoreIdentityRoleRepository( - IDbContextProvider dbContextProvider) - : base(dbContextProvider) - { - } + } - public async virtual Task> GetListByIdListAsync( - List roleIds, - bool includeDetails = false, - CancellationToken cancellationToken = default - ) - { - return await (await GetDbSetAsync()).IncludeDetails(includeDetails) - .Where(role => roleIds.Contains(role.Id)) - .ToListAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task> GetListByIdListAsync( + List roleIds, + bool includeDetails = false, + CancellationToken cancellationToken = default + ) + { + return await (await GetDbSetAsync()).IncludeDetails(includeDetails) + .Where(role => roleIds.Contains(role.Id)) + .ToListAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task> GetOrganizationUnitsAsync( - Guid id, - bool includeDetails = false, - CancellationToken cancellationToken = default) - { - var dbContext = await GetDbContextAsync(); - var query = from roleOU in dbContext.Set() - join ou in dbContext.OrganizationUnits.IncludeDetails(includeDetails) on roleOU.OrganizationUnitId equals ou.Id - where roleOU.RoleId == id - select ou; + public async virtual Task> GetOrganizationUnitsAsync( + Guid id, + bool includeDetails = false, + CancellationToken cancellationToken = default) + { + var dbContext = await GetDbContextAsync(); + var query = from roleOU in dbContext.Set() + join ou in dbContext.OrganizationUnits.IncludeDetails(includeDetails) on roleOU.OrganizationUnitId equals ou.Id + where roleOU.RoleId == id + select ou; - return await query.ToListAsync(GetCancellationToken(cancellationToken)); - } + return await query.ToListAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task> GetOrganizationUnitsAsync( - IEnumerable roleNames, - bool includeDetails = false, - CancellationToken cancellationToken = default) - { - var dbContext = await GetDbContextAsync(); - var query = from roleOU in dbContext.Set() - join role in dbContext.Roles on roleOU.RoleId equals role.Id - join ou in dbContext.OrganizationUnits.IncludeDetails(includeDetails) on roleOU.OrganizationUnitId equals ou.Id - where roleNames.Contains(role.Name) - select ou; + public async virtual Task> GetOrganizationUnitsAsync( + IEnumerable roleNames, + bool includeDetails = false, + CancellationToken cancellationToken = default) + { + var dbContext = await GetDbContextAsync(); + var query = from roleOU in dbContext.Set() + join role in dbContext.Roles on roleOU.RoleId equals role.Id + join ou in dbContext.OrganizationUnits.IncludeDetails(includeDetails) on roleOU.OrganizationUnitId equals ou.Id + where roleNames.Contains(role.Name) + select ou; - return await query.ToListAsync(GetCancellationToken(cancellationToken)); - } + return await query.ToListAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task> GetRolesInOrganizationsListAsync( - List organizationUnitIds, - CancellationToken cancellationToken = default) - { - var query = from roleOu in (await GetDbContextAsync()).Set() - join user in (await GetDbSetAsync()) on roleOu.RoleId equals user.Id - where organizationUnitIds.Contains(roleOu.OrganizationUnitId) - select user; - return await query.ToListAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task> GetRolesInOrganizationsListAsync( + List organizationUnitIds, + CancellationToken cancellationToken = default) + { + var query = from roleOu in (await GetDbContextAsync()).Set() + join user in (await GetDbSetAsync()) on roleOu.RoleId equals user.Id + where organizationUnitIds.Contains(roleOu.OrganizationUnitId) + select user; + return await query.ToListAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task> GetRolesInOrganizationUnitAsync( - Guid organizationUnitId, - CancellationToken cancellationToken = default) - { - var query = from roleOu in (await GetDbContextAsync()).Set() - join user in (await GetDbSetAsync()) on roleOu.RoleId equals user.Id - where roleOu.OrganizationUnitId == organizationUnitId - select user; - return await query.ToListAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task> GetRolesInOrganizationUnitAsync( + Guid organizationUnitId, + CancellationToken cancellationToken = default) + { + var query = from roleOu in (await GetDbContextAsync()).Set() + join user in (await GetDbSetAsync()) on roleOu.RoleId equals user.Id + where roleOu.OrganizationUnitId == organizationUnitId + select user; + return await query.ToListAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task> GetRolesInOrganizationUnitWithChildrenAsync( - string code, - CancellationToken cancellationToken = default) - { - var dbContext = await GetDbContextAsync(); - var query = from roleOU in dbContext.Set() - join user in (await GetDbSetAsync()) on roleOU.RoleId equals user.Id - join ou in dbContext.Set() on roleOU.OrganizationUnitId equals ou.Id - where ou.Code.StartsWith(code) - select user; - return await query.ToListAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task> GetRolesInOrganizationUnitWithChildrenAsync( + string code, + CancellationToken cancellationToken = default) + { + var dbContext = await GetDbContextAsync(); + var query = from roleOU in dbContext.Set() + join user in (await GetDbSetAsync()) on roleOU.RoleId equals user.Id + join ou in dbContext.Set() on roleOU.OrganizationUnitId equals ou.Id + where ou.Code.StartsWith(code) + select user; + return await query.ToListAsync(GetCancellationToken(cancellationToken)); } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/EfCoreIdentitySessionRepository.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/EfCoreIdentitySessionRepository.cs new file mode 100644 index 000000000..c94fbec3f --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/EfCoreIdentitySessionRepository.cs @@ -0,0 +1,62 @@ +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Dynamic.Core; +using System.Threading; +using System.Threading.Tasks; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.Identity; +using Volo.Abp.Identity.EntityFrameworkCore; + +namespace LINGYUN.Abp.Identity.EntityFrameworkCore; + +public class EfCoreIdentitySessionRepository : Volo.Abp.Identity.EntityFrameworkCore.EfCoreIdentitySessionRepository, IIdentitySessionRepository +{ + public EfCoreIdentitySessionRepository( + IDbContextProvider dbContextProvider) : base(dbContextProvider) + { + } + + public async virtual Task FindLastAsync( + Guid userId, + string device = null, + CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()) + .Where(x => x.UserId == userId) + .WhereIf(!device.IsNullOrWhiteSpace(), x => x.Device == device) + .OrderByDescending(x => x.SignedIn) + .FirstOrDefaultAsync(); + } + + public async virtual Task> GetListAsync( + Guid userId, + CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()) + .Where(x => x.UserId == userId) + .ToListAsync(GetCancellationToken(cancellationToken)); + } + + public async virtual Task> GetListAsync( + Guid userId, + string device, + Guid? exceptSessionId = null, + int maxResultCount = 0, + CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()) + .Where(x => x.UserId == userId && x.Device == device && x.Id != exceptSessionId) + .OrderBy(x => x.SignedIn) + .ToListAsync(GetCancellationToken(cancellationToken)); + } + + public async virtual Task DeleteAllAsync( + string sessionId, + Guid? exceptSessionId = null, + CancellationToken cancellationToken = default) + { + await DeleteAsync(x => x.SessionId == sessionId && x.Id != exceptSessionId, cancellationToken: cancellationToken); + } +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/EfCoreIdentityUserRepository.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/EfCoreIdentityUserRepository.cs index a033f55ac..27894634d 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/EfCoreIdentityUserRepository.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/EfCoreIdentityUserRepository.cs @@ -10,230 +10,229 @@ using Volo.Abp.Identity; using Volo.Abp.Identity.EntityFrameworkCore; -namespace LINGYUN.Abp.Identity.EntityFrameworkCore +namespace LINGYUN.Abp.Identity.EntityFrameworkCore; + +public class EfCoreIdentityUserRepository : Volo.Abp.Identity.EntityFrameworkCore.EfCoreIdentityUserRepository, IIdentityUserRepository { - public class EfCoreIdentityUserRepository : Volo.Abp.Identity.EntityFrameworkCore.EfCoreIdentityUserRepository, IIdentityUserRepository + public EfCoreIdentityUserRepository( + IDbContextProvider dbContextProvider) + : base(dbContextProvider) { - public EfCoreIdentityUserRepository( - IDbContextProvider dbContextProvider) - : base(dbContextProvider) - { - } - - public async virtual Task IsPhoneNumberUedAsync( - string phoneNumber, - CancellationToken cancellationToken = default) - { - return await (await GetDbSetAsync()).IncludeDetails(false) - .AnyAsync(user => user.PhoneNumber == phoneNumber, - GetCancellationToken(cancellationToken)); - } + } - public async virtual Task IsPhoneNumberConfirmedAsync( - string phoneNumber, - CancellationToken cancellationToken = default) - { - return await (await GetDbSetAsync()).IncludeDetails(false) - .AnyAsync(user => user.PhoneNumber == phoneNumber && user.PhoneNumberConfirmed, - GetCancellationToken(cancellationToken)); - } + public async virtual Task IsPhoneNumberUedAsync( + string phoneNumber, + CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()).IncludeDetails(false) + .AnyAsync(user => user.PhoneNumber == phoneNumber, + GetCancellationToken(cancellationToken)); + } - public async virtual Task IsNormalizedEmailConfirmedAsync( - string normalizedEmail, - CancellationToken cancellationToken = default) - { - return await (await GetDbSetAsync()).IncludeDetails(false) - .AnyAsync(user => user.NormalizedEmail == normalizedEmail && user.EmailConfirmed, - GetCancellationToken(cancellationToken)); - } + public async virtual Task IsPhoneNumberConfirmedAsync( + string phoneNumber, + CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()).IncludeDetails(false) + .AnyAsync(user => user.PhoneNumber == phoneNumber && user.PhoneNumberConfirmed, + GetCancellationToken(cancellationToken)); + } - public async virtual Task FindByPhoneNumberAsync( - string phoneNumber, - bool isConfirmed = true, - bool includeDetails = false, - CancellationToken cancellationToken = default) - { - return await (await GetDbSetAsync()).IncludeDetails(includeDetails) - .Where(user => user.PhoneNumber == phoneNumber && user.PhoneNumberConfirmed == isConfirmed) - .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task IsNormalizedEmailConfirmedAsync( + string normalizedEmail, + CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()).IncludeDetails(false) + .AnyAsync(user => user.NormalizedEmail == normalizedEmail && user.EmailConfirmed, + GetCancellationToken(cancellationToken)); + } - public async virtual Task> GetListByIdListAsync( - List userIds, - bool includeDetails = false, - CancellationToken cancellationToken = default - ) - { - return await (await GetDbSetAsync()).IncludeDetails(includeDetails) - .Where(user => userIds.Contains(user.Id)) - .ToListAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task FindByPhoneNumberAsync( + string phoneNumber, + bool isConfirmed = true, + bool includeDetails = false, + CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()).IncludeDetails(includeDetails) + .Where(user => user.PhoneNumber == phoneNumber && user.PhoneNumberConfirmed == isConfirmed) + .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task> GetOrganizationUnitsAsync( - Guid id, - string filter = null, - bool includeDetails = false, - int skipCount = 1, - int maxResultCount = 10, - CancellationToken cancellationToken = default + public async virtual Task> GetListByIdListAsync( + List userIds, + bool includeDetails = false, + CancellationToken cancellationToken = default ) - { - var dbContext = await GetDbContextAsync(); - //var userUoDbSet = dbContext.Set(); - //var roleUoDbSet = dbContext.Set(); - //var userRoleDbSet = dbContext.Set(); + { + return await (await GetDbSetAsync()).IncludeDetails(includeDetails) + .Where(user => userIds.Contains(user.Id)) + .ToListAsync(GetCancellationToken(cancellationToken)); + } + + public async virtual Task> GetOrganizationUnitsAsync( + Guid id, + string filter = null, + bool includeDetails = false, + int skipCount = 1, + int maxResultCount = 10, + CancellationToken cancellationToken = default + ) + { + var dbContext = await GetDbContextAsync(); + //var userUoDbSet = dbContext.Set(); + //var roleUoDbSet = dbContext.Set(); + //var userRoleDbSet = dbContext.Set(); - //var userUo = from usrUo in userUoDbSet - // join usr in dbContext.Users on usrUo.UserId equals usr.Id - // join ou in dbContext.OrganizationUnits.IncludeDetails(includeDetails) - // on usrUo.OrganizationUnitId equals ou.Id - // where usr.Id == id - // select ou; + //var userUo = from usrUo in userUoDbSet + // join usr in dbContext.Users on usrUo.UserId equals usr.Id + // join ou in dbContext.OrganizationUnits.IncludeDetails(includeDetails) + // on usrUo.OrganizationUnitId equals ou.Id + // where usr.Id == id + // select ou; - //var roleUo = from urol in userRoleDbSet - // join rol in dbContext.Roles on urol.RoleId equals rol.Id - // join rolUo in roleUoDbSet on rol.Id equals rolUo.RoleId - // join ou in dbContext.OrganizationUnits.IncludeDetails(includeDetails) - // on rolUo.OrganizationUnitId equals ou.Id - // where urol.UserId == id - // select ou; + //var roleUo = from urol in userRoleDbSet + // join rol in dbContext.Roles on urol.RoleId equals rol.Id + // join rolUo in roleUoDbSet on rol.Id equals rolUo.RoleId + // join ou in dbContext.OrganizationUnits.IncludeDetails(includeDetails) + // on rolUo.OrganizationUnitId equals ou.Id + // where urol.UserId == id + // select ou; - var query = from userOU in dbContext.Set() - join ro in dbContext.Set() on userOU.UserId equals ro.UserId - join ou in dbContext.OrganizationUnits.IncludeDetails(includeDetails) - on userOU.OrganizationUnitId equals ou.Id - where userOU.UserId == id - select ou; + var query = from userOU in dbContext.Set() + join ro in dbContext.Set() on userOU.UserId equals ro.UserId + join ou in dbContext.OrganizationUnits.IncludeDetails(includeDetails) + on userOU.OrganizationUnitId equals ou.Id + where userOU.UserId == id + select ou; - return await query - .WhereIf(!filter.IsNullOrWhiteSpace(), ou => ou.Code.Contains(filter) || ou.DisplayName.Contains(filter)) - .PageBy(skipCount, maxResultCount) - .ToListAsync(GetCancellationToken(cancellationToken)); - } + return await query + .WhereIf(!filter.IsNullOrWhiteSpace(), ou => ou.Code.Contains(filter) || ou.DisplayName.Contains(filter)) + .PageBy(skipCount, maxResultCount) + .ToListAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task GetUsersInOrganizationUnitCountAsync( - Guid organizationUnitId, - string filter = null, - CancellationToken cancellationToken = default - ) - { - var dbContext = await GetDbContextAsync(); - var query = from userOu in dbContext.Set() - join user in (await GetDbSetAsync()) on userOu.UserId equals user.Id - where userOu.OrganizationUnitId == organizationUnitId - select user; - return await query - .WhereIf(!filter.IsNullOrWhiteSpace(), - user => user.Name.Contains(filter) || user.UserName.Contains(filter) || - user.Surname.Contains(filter) || user.Email.Contains(filter) || - user.PhoneNumber.Contains(filter)) - .LongCountAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task GetUsersInOrganizationUnitCountAsync( + Guid organizationUnitId, + string filter = null, + CancellationToken cancellationToken = default + ) + { + var dbContext = await GetDbContextAsync(); + var query = from userOu in dbContext.Set() + join user in (await GetDbSetAsync()) on userOu.UserId equals user.Id + where userOu.OrganizationUnitId == organizationUnitId + select user; + return await query + .WhereIf(!filter.IsNullOrWhiteSpace(), + user => user.Name.Contains(filter) || user.UserName.Contains(filter) || + user.Surname.Contains(filter) || user.Email.Contains(filter) || + user.PhoneNumber.Contains(filter)) + .LongCountAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task> GetUsersInOrganizationUnitAsync( - Guid organizationUnitId, - string filter = null, - int skipCount = 1, - int maxResultCount = 10, - CancellationToken cancellationToken = default - ) - { - var dbContext = await GetDbContextAsync(); - var query = from userOu in dbContext.Set() - join user in (await GetDbSetAsync()) on userOu.UserId equals user.Id - where userOu.OrganizationUnitId == organizationUnitId - select user; - return await query - .WhereIf(!filter.IsNullOrWhiteSpace(), - user => user.Name.Contains(filter) || user.UserName.Contains(filter) || - user.Surname.Contains(filter) || user.Email.Contains(filter) || - user.PhoneNumber.Contains(filter)) - .PageBy(skipCount, maxResultCount) - .ToListAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task> GetUsersInOrganizationUnitAsync( + Guid organizationUnitId, + string filter = null, + int skipCount = 1, + int maxResultCount = 10, + CancellationToken cancellationToken = default + ) + { + var dbContext = await GetDbContextAsync(); + var query = from userOu in dbContext.Set() + join user in (await GetDbSetAsync()) on userOu.UserId equals user.Id + where userOu.OrganizationUnitId == organizationUnitId + select user; + return await query + .WhereIf(!filter.IsNullOrWhiteSpace(), + user => user.Name.Contains(filter) || user.UserName.Contains(filter) || + user.Surname.Contains(filter) || user.Email.Contains(filter) || + user.PhoneNumber.Contains(filter)) + .PageBy(skipCount, maxResultCount) + .ToListAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task GetUsersInOrganizationsListCountAsync( - List organizationUnitIds, - string filter = null, - CancellationToken cancellationToken = default - ) - { - var dbContext = await GetDbContextAsync(); - var query = from userOu in dbContext.Set() - join user in (await GetDbSetAsync()) on userOu.UserId equals user.Id - where organizationUnitIds.Contains(userOu.OrganizationUnitId) - select user; - return await query - .WhereIf(!filter.IsNullOrWhiteSpace(), - user => user.Name.Contains(filter) || user.UserName.Contains(filter) || - user.Surname.Contains(filter) || user.Email.Contains(filter) || - user.PhoneNumber.Contains(filter)) - .LongCountAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task GetUsersInOrganizationsListCountAsync( + List organizationUnitIds, + string filter = null, + CancellationToken cancellationToken = default + ) + { + var dbContext = await GetDbContextAsync(); + var query = from userOu in dbContext.Set() + join user in (await GetDbSetAsync()) on userOu.UserId equals user.Id + where organizationUnitIds.Contains(userOu.OrganizationUnitId) + select user; + return await query + .WhereIf(!filter.IsNullOrWhiteSpace(), + user => user.Name.Contains(filter) || user.UserName.Contains(filter) || + user.Surname.Contains(filter) || user.Email.Contains(filter) || + user.PhoneNumber.Contains(filter)) + .LongCountAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task> GetUsersInOrganizationsListAsync( - List organizationUnitIds, - string filter = null, - int skipCount = 1, - int maxResultCount = 10, - CancellationToken cancellationToken = default - ) - { - var dbContext = await GetDbContextAsync(); - var query = from userOu in dbContext.Set() - join user in (await GetDbSetAsync()) on userOu.UserId equals user.Id - where organizationUnitIds.Contains(userOu.OrganizationUnitId) - select user; - return await query - .WhereIf(!filter.IsNullOrWhiteSpace(), - user => user.Name.Contains(filter) || user.UserName.Contains(filter) || - user.Surname.Contains(filter) || user.Email.Contains(filter) || - user.PhoneNumber.Contains(filter)) - .PageBy(skipCount, maxResultCount) - .ToListAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task> GetUsersInOrganizationsListAsync( + List organizationUnitIds, + string filter = null, + int skipCount = 1, + int maxResultCount = 10, + CancellationToken cancellationToken = default + ) + { + var dbContext = await GetDbContextAsync(); + var query = from userOu in dbContext.Set() + join user in (await GetDbSetAsync()) on userOu.UserId equals user.Id + where organizationUnitIds.Contains(userOu.OrganizationUnitId) + select user; + return await query + .WhereIf(!filter.IsNullOrWhiteSpace(), + user => user.Name.Contains(filter) || user.UserName.Contains(filter) || + user.Surname.Contains(filter) || user.Email.Contains(filter) || + user.PhoneNumber.Contains(filter)) + .PageBy(skipCount, maxResultCount) + .ToListAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task GetUsersInOrganizationUnitWithChildrenCountAsync( - string code, - string filter = null, - CancellationToken cancellationToken = default - ) - { - var dbContext = await GetDbContextAsync(); - var query = from userOu in dbContext.Set() - join user in (await GetDbSetAsync()) on userOu.UserId equals user.Id - join ou in dbContext.Set() on userOu.OrganizationUnitId equals ou.Id - where ou.Code.StartsWith(code) - select user; - return await query - .WhereIf(!filter.IsNullOrWhiteSpace(), - user => user.Name.Contains(filter) || user.UserName.Contains(filter) || - user.Surname.Contains(filter) || user.Email.Contains(filter) || - user.PhoneNumber.Contains(filter)) - .LongCountAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task GetUsersInOrganizationUnitWithChildrenCountAsync( + string code, + string filter = null, + CancellationToken cancellationToken = default + ) + { + var dbContext = await GetDbContextAsync(); + var query = from userOu in dbContext.Set() + join user in (await GetDbSetAsync()) on userOu.UserId equals user.Id + join ou in dbContext.Set() on userOu.OrganizationUnitId equals ou.Id + where ou.Code.StartsWith(code) + select user; + return await query + .WhereIf(!filter.IsNullOrWhiteSpace(), + user => user.Name.Contains(filter) || user.UserName.Contains(filter) || + user.Surname.Contains(filter) || user.Email.Contains(filter) || + user.PhoneNumber.Contains(filter)) + .LongCountAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task> GetUsersInOrganizationUnitWithChildrenAsync( - string code, - string filter = null, - int skipCount = 1, - int maxResultCount = 10, - CancellationToken cancellationToken = default - ) - { - var dbContext = await GetDbContextAsync(); - var query = from userOu in dbContext.Set() - join user in (await GetDbSetAsync()) on userOu.UserId equals user.Id - join ou in dbContext.Set() on userOu.OrganizationUnitId equals ou.Id - where ou.Code.StartsWith(code) - select user; - return await query - .WhereIf(!filter.IsNullOrWhiteSpace(), - user => user.Name.Contains(filter) || user.UserName.Contains(filter) || - user.Surname.Contains(filter) || user.Email.Contains(filter) || - user.PhoneNumber.Contains(filter)) - .PageBy(skipCount, maxResultCount) - .ToListAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task> GetUsersInOrganizationUnitWithChildrenAsync( + string code, + string filter = null, + int skipCount = 1, + int maxResultCount = 10, + CancellationToken cancellationToken = default + ) + { + var dbContext = await GetDbContextAsync(); + var query = from userOu in dbContext.Set() + join user in (await GetDbSetAsync()) on userOu.UserId equals user.Id + join ou in dbContext.Set() on userOu.OrganizationUnitId equals ou.Id + where ou.Code.StartsWith(code) + select user; + return await query + .WhereIf(!filter.IsNullOrWhiteSpace(), + user => user.Name.Contains(filter) || user.UserName.Contains(filter) || + user.Surname.Contains(filter) || user.Email.Contains(filter) || + user.PhoneNumber.Contains(filter)) + .PageBy(skipCount, maxResultCount) + .ToListAsync(GetCancellationToken(cancellationToken)); } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi.Client/LINGYUN.Abp.Identity.HttpApi.Client.csproj b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi.Client/LINGYUN.Abp.Identity.HttpApi.Client.csproj index 42d581c4b..a0047d961 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi.Client/LINGYUN.Abp.Identity.HttpApi.Client.csproj +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi.Client/LINGYUN.Abp.Identity.HttpApi.Client.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Identity.HttpApi.Client + LINGYUN.Abp.Identity.HttpApi.Client + false + false + false diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi.Client/LINGYUN/Abp/Identity/AbpIdentityHttpApiClientModule.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi.Client/LINGYUN/Abp/Identity/AbpIdentityHttpApiClientModule.cs index bf5590325..066013105 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi.Client/LINGYUN/Abp/Identity/AbpIdentityHttpApiClientModule.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi.Client/LINGYUN/Abp/Identity/AbpIdentityHttpApiClientModule.cs @@ -2,19 +2,18 @@ using Volo.Abp.Identity; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.Identity.HttpApi.Client +namespace LINGYUN.Abp.Identity.HttpApi.Client; + +[DependsOn( + typeof(Volo.Abp.Identity.AbpIdentityHttpApiClientModule), + typeof(AbpIdentityApplicationContractsModule))] +public class AbpIdentityHttpApiClientModule : AbpModule { - [DependsOn( - typeof(Volo.Abp.Identity.AbpIdentityHttpApiClientModule), - typeof(AbpIdentityApplicationContractsModule))] - public class AbpIdentityHttpApiClientModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddHttpClientProxies( - typeof(AbpIdentityApplicationContractsModule).Assembly, - IdentityRemoteServiceConsts.RemoteServiceName - ); - } + context.Services.AddHttpClientProxies( + typeof(AbpIdentityApplicationContractsModule).Assembly, + IdentityRemoteServiceConsts.RemoteServiceName + ); } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN.Abp.Identity.HttpApi.csproj b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN.Abp.Identity.HttpApi.csproj index 9a1048682..d7880807c 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN.Abp.Identity.HttpApi.csproj +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN.Abp.Identity.HttpApi.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.Identity.HttpApi + LINGYUN.Abp.Identity.HttpApi + false + false + false diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN/Abp/Identity/AbpIdentityHttpApiModule.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN/Abp/Identity/AbpIdentityHttpApiModule.cs index a70740de7..1cf3fa97d 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN/Abp/Identity/AbpIdentityHttpApiModule.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN/Abp/Identity/AbpIdentityHttpApiModule.cs @@ -3,25 +3,24 @@ using Volo.Abp.Identity.Localization; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +[DependsOn( + typeof(Volo.Abp.Identity.AbpIdentityHttpApiModule), + typeof(AbpIdentityApplicationContractsModule))] +public class AbpIdentityHttpApiModule : AbpModule { - [DependsOn( - typeof(Volo.Abp.Identity.AbpIdentityHttpApiModule), - typeof(AbpIdentityApplicationContractsModule))] - public class AbpIdentityHttpApiModule : AbpModule + public override void PreConfigureServices(ServiceConfigurationContext context) { - public override void PreConfigureServices(ServiceConfigurationContext context) + PreConfigure(options => { - PreConfigure(options => - { - options.AddAssemblyResource(typeof(IdentityResource), typeof(AbpIdentityApplicationContractsModule).Assembly); - options.AddAssemblyResource(typeof(IdentityResource), typeof(Volo.Abp.Identity.AbpIdentityApplicationContractsModule).Assembly); - }); + options.AddAssemblyResource(typeof(IdentityResource), typeof(AbpIdentityApplicationContractsModule).Assembly); + options.AddAssemblyResource(typeof(IdentityResource), typeof(Volo.Abp.Identity.AbpIdentityApplicationContractsModule).Assembly); + }); - PreConfigure(mvcBuilder => - { - mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpIdentityHttpApiModule).Assembly); - }); - } + PreConfigure(mvcBuilder => + { + mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpIdentityHttpApiModule).Assembly); + }); } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN/Abp/Identity/IdentityClaimTypeController.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN/Abp/Identity/IdentityClaimTypeController.cs index 59d52f492..ae3041e11 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN/Abp/Identity/IdentityClaimTypeController.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN/Abp/Identity/IdentityClaimTypeController.cs @@ -1,4 +1,5 @@ using Asp.Versioning; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System; using System.Threading.Tasks; @@ -7,58 +8,61 @@ using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.Identity; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +[RemoteService(true, Name = IdentityRemoteServiceConsts.RemoteServiceName)] +[Area("identity")] +[ControllerName("ClaimType")] +[Route("api/identity/claim-types")] +[Authorize(IdentityPermissions.IdentityClaimType.Default)] +public class IdentityClaimTypeController : AbpControllerBase, IIdentityClaimTypeAppService { - [RemoteService(true, Name = IdentityRemoteServiceConsts.RemoteServiceName)] - [Area("identity")] - [ControllerName("ClaimType")] - [Route("api/identity/claim-types")] - public class IdentityClaimTypeController : AbpControllerBase, IIdentityClaimTypeAppService + protected IIdentityClaimTypeAppService IdentityClaimTypeAppService { get; } + public IdentityClaimTypeController(IIdentityClaimTypeAppService identityClaimTypeAppService) { - protected IIdentityClaimTypeAppService IdentityClaimTypeAppService { get; } - public IdentityClaimTypeController(IIdentityClaimTypeAppService identityClaimTypeAppService) - { - IdentityClaimTypeAppService = identityClaimTypeAppService; - } + IdentityClaimTypeAppService = identityClaimTypeAppService; + } - [HttpPost] - public async virtual Task CreateAsync(IdentityClaimTypeCreateDto input) - { - return await IdentityClaimTypeAppService.CreateAsync(input); - } + [HttpPost] + [Authorize(IdentityPermissions.IdentityClaimType.Create)] + public async virtual Task CreateAsync(IdentityClaimTypeCreateDto input) + { + return await IdentityClaimTypeAppService.CreateAsync(input); + } - [HttpDelete] - [Route("{id}")] - public async virtual Task DeleteAsync(Guid id) - { - await IdentityClaimTypeAppService.DeleteAsync(id); - } + [HttpDelete] + [Route("{id}")] + [Authorize(IdentityPermissions.IdentityClaimType.Delete)] + public async virtual Task DeleteAsync(Guid id) + { + await IdentityClaimTypeAppService.DeleteAsync(id); + } - [HttpGet] - [Route("actived-list")] - public async virtual Task> GetAllListAsync() - { - return await IdentityClaimTypeAppService.GetAllListAsync(); - } + [HttpGet] + [Route("actived-list")] + public async virtual Task> GetAllListAsync() + { + return await IdentityClaimTypeAppService.GetAllListAsync(); + } - [HttpGet] - [Route("{id}")] - public async virtual Task GetAsync(Guid id) - { - return await IdentityClaimTypeAppService.GetAsync(id); - } + [HttpGet] + [Route("{id}")] + public async virtual Task GetAsync(Guid id) + { + return await IdentityClaimTypeAppService.GetAsync(id); + } - [HttpGet] - public async virtual Task> GetListAsync(IdentityClaimTypeGetByPagedDto input) - { - return await IdentityClaimTypeAppService.GetListAsync(input); - } + [HttpGet] + public async virtual Task> GetListAsync(IdentityClaimTypeGetByPagedDto input) + { + return await IdentityClaimTypeAppService.GetListAsync(input); + } - [HttpPut] - [Route("{id}")] - public async virtual Task UpdateAsync(Guid id, IdentityClaimTypeUpdateDto input) - { - return await IdentityClaimTypeAppService.UpdateAsync(id, input); - } + [HttpPut] + [Route("{id}")] + [Authorize(IdentityPermissions.IdentityClaimType.Update)] + public async virtual Task UpdateAsync(Guid id, IdentityClaimTypeUpdateDto input) + { + return await IdentityClaimTypeAppService.UpdateAsync(id, input); } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN/Abp/Identity/IdentityRoleController.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN/Abp/Identity/IdentityRoleController.cs index 6ffba7de7..2aa068e0c 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN/Abp/Identity/IdentityRoleController.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN/Abp/Identity/IdentityRoleController.cs @@ -1,4 +1,5 @@ using Asp.Versioning; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System; using System.Threading.Tasks; @@ -7,76 +8,82 @@ using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.Identity; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +[RemoteService(true, Name = IdentityRemoteServiceConsts.RemoteServiceName)] +[Area("identity")] +[ControllerName("Role")] +[Route("api/identity/roles")] +[Authorize(Volo.Abp.Identity.IdentityPermissions.Roles.Default)] +public class IdentityRoleController : AbpControllerBase, IIdentityRoleAppService { - [RemoteService(true, Name = IdentityRemoteServiceConsts.RemoteServiceName)] - [Area("identity")] - [ControllerName("Role")] - [Route("api/identity/roles")] - public class IdentityRoleController : AbpControllerBase, IIdentityRoleAppService + protected IIdentityRoleAppService RoleAppService { get; } + public IdentityRoleController( + IIdentityRoleAppService roleAppService) { - protected IIdentityRoleAppService RoleAppService { get; } - public IdentityRoleController( - IIdentityRoleAppService roleAppService) - { - RoleAppService = roleAppService; - } - - #region OrganizationUnit + RoleAppService = roleAppService; + } - [HttpGet] - [Route("{id}/organization-units")] - public async virtual Task> GetOrganizationUnitsAsync(Guid id) - { - return await RoleAppService.GetOrganizationUnitsAsync(id); - } + #region OrganizationUnit - [HttpPut] - [Route("{id}/organization-units")] - public async virtual Task SetOrganizationUnitsAsync(Guid id, IdentityRoleAddOrRemoveOrganizationUnitDto input) - { - await RoleAppService.SetOrganizationUnitsAsync(id, input); - } + [HttpGet] + [Route("{id}/organization-units")] + [Authorize(IdentityPermissions.Roles.ManageOrganizationUnits)] + public async virtual Task> GetOrganizationUnitsAsync(Guid id) + { + return await RoleAppService.GetOrganizationUnitsAsync(id); + } - [HttpDelete] - [Route("{id}/organization-units/{ouId}")] - public async virtual Task RemoveOrganizationUnitsAsync(Guid id, Guid ouId) - { - await RoleAppService.RemoveOrganizationUnitsAsync(id, ouId); - } + [HttpPut] + [Route("{id}/organization-units")] + [Authorize(IdentityPermissions.Roles.ManageOrganizationUnits)] + public async virtual Task SetOrganizationUnitsAsync(Guid id, IdentityRoleAddOrRemoveOrganizationUnitDto input) + { + await RoleAppService.SetOrganizationUnitsAsync(id, input); + } - #endregion + [HttpDelete] + [Route("{id}/organization-units/{ouId}")] + [Authorize(IdentityPermissions.Roles.ManageOrganizationUnits)] + public async virtual Task RemoveOrganizationUnitsAsync(Guid id, Guid ouId) + { + await RoleAppService.RemoveOrganizationUnitsAsync(id, ouId); + } - #region Claim + #endregion - [HttpGet] - [Route("{id}/claims")] - public async virtual Task> GetClaimsAsync(Guid id) - { - return await RoleAppService.GetClaimsAsync(id); - } + #region Claim - [HttpPost] - [Route("{id}/claims")] - public async virtual Task AddClaimAsync(Guid id, IdentityRoleClaimCreateDto input) - { - await RoleAppService.AddClaimAsync(id, input); - } + [HttpGet] + [Route("{id}/claims")] + public async virtual Task> GetClaimsAsync(Guid id) + { + return await RoleAppService.GetClaimsAsync(id); + } - [HttpPut] - [Route("{id}/claims")] - public async virtual Task UpdateClaimAsync(Guid id, IdentityRoleClaimUpdateDto input) - { - await RoleAppService.UpdateClaimAsync(id, input); - } + [HttpPost] + [Route("{id}/claims")] + [Authorize(IdentityPermissions.Roles.ManageClaims)] + public async virtual Task AddClaimAsync(Guid id, IdentityRoleClaimCreateDto input) + { + await RoleAppService.AddClaimAsync(id, input); + } - [HttpDelete] - [Route("{id}/claims")] - public async virtual Task DeleteClaimAsync(Guid id, IdentityRoleClaimDeleteDto input) - { - await RoleAppService.DeleteClaimAsync(id, input); - } + [HttpPut] + [Route("{id}/claims")] + [Authorize(IdentityPermissions.Roles.ManageClaims)] + public async virtual Task UpdateClaimAsync(Guid id, IdentityRoleClaimUpdateDto input) + { + await RoleAppService.UpdateClaimAsync(id, input); + } - #endregion + [HttpDelete] + [Route("{id}/claims")] + [Authorize(IdentityPermissions.Roles.ManageClaims)] + public async virtual Task DeleteClaimAsync(Guid id, IdentityRoleClaimDeleteDto input) + { + await RoleAppService.DeleteClaimAsync(id, input); } + + #endregion } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN/Abp/Identity/IdentitySessionController.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN/Abp/Identity/IdentitySessionController.cs new file mode 100644 index 000000000..cb8ddba6d --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN/Abp/Identity/IdentitySessionController.cs @@ -0,0 +1,39 @@ +using Asp.Versioning; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using System.Threading.Tasks; +using Volo.Abp; +using Volo.Abp.Application.Dtos; +using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.Identity; + +namespace LINGYUN.Abp.Identity; + +[Area("identity")] +[ControllerName("identity-sessions")] +[Route("api/identity/sessions")] +[RemoteService(Name = IdentityRemoteServiceConsts.RemoteServiceName)] +[Authorize(IdentityPermissions.IdentitySession.Default)] +public class IdentitySessionController : AbpControllerBase, IIdentitySessionAppService +{ + private readonly IIdentitySessionAppService _servcie; + + public IdentitySessionController(IIdentitySessionAppService servcie) + { + _servcie = servcie; + } + + [HttpGet] + public virtual Task> GetSessionsAsync(GetUserSessionsInput input) + { + return _servcie.GetSessionsAsync(input); + } + + [Authorize(IdentityPermissions.IdentitySession.Revoke)] + [HttpDelete] + [Route("{sessionId}/revoke")] + public virtual Task RevokeSessionAsync(string sessionId) + { + return _servcie.RevokeSessionAsync(sessionId); + } +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN/Abp/Identity/IdentityUserController.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN/Abp/Identity/IdentityUserController.cs index 39b308156..ddf5d75c1 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN/Abp/Identity/IdentityUserController.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN/Abp/Identity/IdentityUserController.cs @@ -1,4 +1,5 @@ using Asp.Versioning; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System; using System.Threading.Tasks; @@ -7,104 +8,113 @@ using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.Identity; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +[RemoteService(true, Name = IdentityRemoteServiceConsts.RemoteServiceName)] +[Area("identity")] +[ControllerName("User")] +[Route("api/identity/users")] +[Authorize(Volo.Abp.Identity.IdentityPermissions.Users.Default)] +public class IdentityUserController : AbpControllerBase, IIdentityUserAppService { - [RemoteService(true, Name = IdentityRemoteServiceConsts.RemoteServiceName)] - [Area("identity")] - [ControllerName("User")] - [Route("api/identity/users")] - public class IdentityUserController : AbpControllerBase, IIdentityUserAppService + protected IIdentityUserAppService UserAppService { get; } + public IdentityUserController( + IIdentityUserAppService userAppService) + { + UserAppService = userAppService; + } + + #region OrganizationUnit + + [HttpGet] + [Route("{id}/organization-units")] + public async virtual Task> GetOrganizationUnitsAsync(Guid id) + { + return await UserAppService.GetOrganizationUnitsAsync(id); + } + + [HttpPut] + [Route("{id}/organization-units")] + [Authorize(IdentityPermissions.Users.ManageOrganizationUnits)] + public async virtual Task SetOrganizationUnitsAsync(Guid id, IdentityUserOrganizationUnitUpdateDto input) + { + await UserAppService.SetOrganizationUnitsAsync(id, input); + } + + [HttpDelete] + [Route("{id}/organization-units/{ouId}")] + [Authorize(IdentityPermissions.Users.ManageOrganizationUnits)] + public async virtual Task RemoveOrganizationUnitsAsync(Guid id, Guid ouId) + { + await UserAppService.RemoveOrganizationUnitsAsync(id, ouId); + } + + #endregion + + #region Claim + + [HttpGet] + [Route("{id}/claims")] + public async virtual Task> GetClaimsAsync(Guid id) + { + return await UserAppService.GetClaimsAsync(id); + } + + [HttpPost] + [Route("{id}/claims")] + [Authorize(IdentityPermissions.Users.ManageClaims)] + public async virtual Task AddClaimAsync(Guid id, IdentityUserClaimCreateDto input) + { + await UserAppService.AddClaimAsync(id, input); + } + + [HttpPut] + [Route("{id}/claims")] + [Authorize(IdentityPermissions.Users.ManageClaims)] + public async virtual Task UpdateClaimAsync(Guid id, IdentityUserClaimUpdateDto input) + { + await UserAppService.UpdateClaimAsync(id, input); + } + + [HttpDelete] + [Route("{id}/claims")] + [Authorize(IdentityPermissions.Users.ManageClaims)] + public async virtual Task DeleteClaimAsync(Guid id, IdentityUserClaimDeleteDto input) + { + await UserAppService.DeleteClaimAsync(id, input); + } + + #endregion + + [HttpPut] + [Route("change-password")] + [Authorize(IdentityPermissions.Users.ResetPassword)] + public async virtual Task ChangePasswordAsync(Guid id, IdentityUserSetPasswordInput input) + { + await UserAppService.ChangePasswordAsync(id, input); + } + + [HttpPut] + [Route("change-two-factor")] + [Authorize(Volo.Abp.Identity.IdentityPermissions.Users.Update)] + public async virtual Task ChangeTwoFactorEnabledAsync(Guid id, TwoFactorEnabledDto input) + { + await UserAppService.ChangeTwoFactorEnabledAsync(id, input); + } + + [HttpPut] + [Route("{id}/lock/{seconds}")] + [Authorize(Volo.Abp.Identity.IdentityPermissions.Users.Update)] + public async virtual Task LockAsync(Guid id, int seconds) + { + await UserAppService.LockAsync(id, seconds); + } + + [HttpPut] + [Route("{id}/unlock")] + [Authorize(Volo.Abp.Identity.IdentityPermissions.Users.Update)] + public async virtual Task UnLockAsync(Guid id) { - protected IIdentityUserAppService UserAppService { get; } - public IdentityUserController( - IIdentityUserAppService userAppService) - { - UserAppService = userAppService; - } - - #region OrganizationUnit - - [HttpGet] - [Route("{id}/organization-units")] - public async virtual Task> GetOrganizationUnitsAsync(Guid id) - { - return await UserAppService.GetOrganizationUnitsAsync(id); - } - - [HttpPut] - [Route("{id}/organization-units")] - public async virtual Task SetOrganizationUnitsAsync(Guid id, IdentityUserOrganizationUnitUpdateDto input) - { - await UserAppService.SetOrganizationUnitsAsync(id, input); - } - - [HttpDelete] - [Route("{id}/organization-units/{ouId}")] - public async virtual Task RemoveOrganizationUnitsAsync(Guid id, Guid ouId) - { - await UserAppService.RemoveOrganizationUnitsAsync(id, ouId); - } - - #endregion - - #region Claim - - [HttpGet] - [Route("{id}/claims")] - public async virtual Task> GetClaimsAsync(Guid id) - { - return await UserAppService.GetClaimsAsync(id); - } - - [HttpPost] - [Route("{id}/claims")] - public async virtual Task AddClaimAsync(Guid id, IdentityUserClaimCreateDto input) - { - await UserAppService.AddClaimAsync(id, input); - } - - [HttpPut] - [Route("{id}/claims")] - public async virtual Task UpdateClaimAsync(Guid id, IdentityUserClaimUpdateDto input) - { - await UserAppService.UpdateClaimAsync(id, input); - } - - [HttpDelete] - [Route("{id}/claims")] - public async virtual Task DeleteClaimAsync(Guid id, IdentityUserClaimDeleteDto input) - { - await UserAppService.DeleteClaimAsync(id, input); - } - - #endregion - - [HttpPut] - [Route("change-password")] - public async virtual Task ChangePasswordAsync(Guid id, IdentityUserSetPasswordInput input) - { - await UserAppService.ChangePasswordAsync(id, input); - } - - [HttpPut] - [Route("change-two-factor")] - public async virtual Task ChangeTwoFactorEnabledAsync(Guid id, TwoFactorEnabledDto input) - { - await UserAppService.ChangeTwoFactorEnabledAsync(id, input); - } - - [HttpPut] - [Route("{id}/lock/{seconds}")] - public async virtual Task LockAsync(Guid id, int seconds) - { - await UserAppService.LockAsync(id, seconds); - } - - [HttpPut] - [Route("{id}/unlock")] - public async virtual Task UnLockAsync(Guid id) - { - await UserAppService.UnLockAsync(id); - } + await UserAppService.UnLockAsync(id); } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN/Abp/Identity/OrganizationUnitController.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN/Abp/Identity/OrganizationUnitController.cs index 6b9aa62f3..ab1546300 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN/Abp/Identity/OrganizationUnitController.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.HttpApi/LINGYUN/Abp/Identity/OrganizationUnitController.cs @@ -1,4 +1,5 @@ using Asp.Versioning; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System; using System.Threading.Tasks; @@ -7,137 +8,143 @@ using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.Identity; -namespace LINGYUN.Abp.Identity +namespace LINGYUN.Abp.Identity; + +[RemoteService(Name = IdentityRemoteServiceConsts.RemoteServiceName)] +[Area("identity")] +[ControllerName("organization-units")] +[Route("api/identity/organization-units")] +[Authorize(IdentityPermissions.OrganizationUnits.Default)] +public class OrganizationUnitController : AbpControllerBase, IOrganizationUnitAppService { - [RemoteService(Name = IdentityRemoteServiceConsts.RemoteServiceName)] - [Area("identity")] - [ControllerName("organization-units")] - [Route("api/identity/organization-units")] - public class OrganizationUnitController : AbpControllerBase, IOrganizationUnitAppService - { - protected IOrganizationUnitAppService OrganizationUnitAppService { get; } - - public OrganizationUnitController( - IOrganizationUnitAppService organizationUnitAppService) - { - OrganizationUnitAppService = organizationUnitAppService; - } - - [HttpPost] - public async virtual Task CreateAsync(OrganizationUnitCreateDto input) - { - return await OrganizationUnitAppService.CreateAsync(input); - } - - [HttpDelete] - [Route("{id}")] - public async virtual Task DeleteAsync(Guid id) - { - await OrganizationUnitAppService.DeleteAsync(id); - } - - [HttpGet] - [Route("find-children")] - public async virtual Task> FindChildrenAsync(OrganizationUnitGetChildrenDto input) - { - return await OrganizationUnitAppService.FindChildrenAsync(input); - } - - [HttpGet] - [Route("{id}")] - public async virtual Task GetAsync(Guid id) - { - return await OrganizationUnitAppService.GetAsync(id); - } - - [HttpGet] - [Route("root-node")] - public async virtual Task> GetRootAsync() - { - return await OrganizationUnitAppService.GetRootAsync(); - } - - [HttpGet] - [Route("last-children")] - public async virtual Task GetLastChildOrNullAsync(Guid? parentId) - { - return await OrganizationUnitAppService.GetLastChildOrNullAsync(parentId); - } - - [HttpGet] - [Route("all")] - public async virtual Task> GetAllListAsync() - { - return await OrganizationUnitAppService.GetAllListAsync(); - } - - [HttpGet] - public async virtual Task> GetListAsync(OrganizationUnitGetByPagedDto input) - { - return await OrganizationUnitAppService.GetListAsync(input); - } - - [HttpGet] - [Route("{id}/role-names")] - public async virtual Task> GetRoleNamesAsync(Guid id) - { - return await OrganizationUnitAppService.GetRoleNamesAsync(id); - } - - [HttpGet] - [Route("{id}/unadded-roles")] - public async virtual Task> GetUnaddedRolesAsync(Guid id, OrganizationUnitGetUnaddedRoleByPagedDto input) - { - return await OrganizationUnitAppService.GetUnaddedRolesAsync(id, input); - } - - [HttpGet] - [Route("{id}/roles")] - public async virtual Task> GetRolesAsync(Guid id, PagedAndSortedResultRequestDto input) - { - return await OrganizationUnitAppService.GetRolesAsync(id, input); - } - - [HttpGet] - [Route("{id}/unadded-users")] - public async virtual Task> GetUnaddedUsersAsync(Guid id, OrganizationUnitGetUnaddedUserByPagedDto input) - { - return await OrganizationUnitAppService.GetUnaddedUsersAsync(id, input); - } - - [HttpGet] - [Route("{id}/users")] - public async virtual Task> GetUsersAsync(Guid id, GetIdentityUsersInput input) - { - return await OrganizationUnitAppService.GetUsersAsync(id, input); - } - - [HttpPost] - [Route("{id}/users")] - public async virtual Task AddUsersAsync(Guid id, OrganizationUnitAddUserDto input) - { - await OrganizationUnitAppService.AddUsersAsync(id, input); - } - - [HttpPost] - [Route("{id}/roles")] - public async virtual Task AddRolesAsync(Guid id, OrganizationUnitAddRoleDto input) - { - await OrganizationUnitAppService.AddRolesAsync(id, input); - } - - [HttpPut] - [Route("{id}/move")] - public async virtual Task MoveAsync(Guid id, OrganizationUnitMoveDto input) - { - await OrganizationUnitAppService.MoveAsync(id, input); - } - - [HttpPut] - [Route("{id}")] - public async virtual Task UpdateAsync(Guid id, OrganizationUnitUpdateDto input) - { - return await OrganizationUnitAppService.UpdateAsync(id, input); - } + protected IOrganizationUnitAppService OrganizationUnitAppService { get; } + + public OrganizationUnitController( + IOrganizationUnitAppService organizationUnitAppService) + { + OrganizationUnitAppService = organizationUnitAppService; + } + + [HttpPost] + [Authorize(IdentityPermissions.OrganizationUnits.Create)] + public async virtual Task CreateAsync(OrganizationUnitCreateDto input) + { + return await OrganizationUnitAppService.CreateAsync(input); + } + + [HttpDelete] + [Route("{id}")] + [Authorize(IdentityPermissions.OrganizationUnits.Delete)] + public async virtual Task DeleteAsync(Guid id) + { + await OrganizationUnitAppService.DeleteAsync(id); + } + + [HttpGet] + [Route("find-children")] + public async virtual Task> FindChildrenAsync(OrganizationUnitGetChildrenDto input) + { + return await OrganizationUnitAppService.FindChildrenAsync(input); + } + + [HttpGet] + [Route("{id}")] + public async virtual Task GetAsync(Guid id) + { + return await OrganizationUnitAppService.GetAsync(id); + } + + [HttpGet] + [Route("root-node")] + public async virtual Task> GetRootAsync() + { + return await OrganizationUnitAppService.GetRootAsync(); + } + + [HttpGet] + [Route("last-children")] + public async virtual Task GetLastChildOrNullAsync(Guid? parentId) + { + return await OrganizationUnitAppService.GetLastChildOrNullAsync(parentId); + } + + [HttpGet] + [Route("all")] + public async virtual Task> GetAllListAsync() + { + return await OrganizationUnitAppService.GetAllListAsync(); + } + + [HttpGet] + public async virtual Task> GetListAsync(OrganizationUnitGetByPagedDto input) + { + return await OrganizationUnitAppService.GetListAsync(input); + } + + [HttpGet] + [Route("{id}/role-names")] + public async virtual Task> GetRoleNamesAsync(Guid id) + { + return await OrganizationUnitAppService.GetRoleNamesAsync(id); + } + + [HttpGet] + [Route("{id}/unadded-roles")] + public async virtual Task> GetUnaddedRolesAsync(Guid id, OrganizationUnitGetUnaddedRoleByPagedDto input) + { + return await OrganizationUnitAppService.GetUnaddedRolesAsync(id, input); + } + + [HttpGet] + [Route("{id}/roles")] + public async virtual Task> GetRolesAsync(Guid id, PagedAndSortedResultRequestDto input) + { + return await OrganizationUnitAppService.GetRolesAsync(id, input); + } + + [HttpGet] + [Route("{id}/unadded-users")] + public async virtual Task> GetUnaddedUsersAsync(Guid id, OrganizationUnitGetUnaddedUserByPagedDto input) + { + return await OrganizationUnitAppService.GetUnaddedUsersAsync(id, input); + } + + [HttpGet] + [Route("{id}/users")] + public async virtual Task> GetUsersAsync(Guid id, GetIdentityUsersInput input) + { + return await OrganizationUnitAppService.GetUsersAsync(id, input); + } + + [HttpPost] + [Route("{id}/users")] + [Authorize(IdentityPermissions.OrganizationUnits.ManageUsers)] + public async virtual Task AddUsersAsync(Guid id, OrganizationUnitAddUserDto input) + { + await OrganizationUnitAppService.AddUsersAsync(id, input); + } + + [HttpPost] + [Route("{id}/roles")] + [Authorize(IdentityPermissions.OrganizationUnits.ManageRoles)] + public async virtual Task AddRolesAsync(Guid id, OrganizationUnitAddRoleDto input) + { + await OrganizationUnitAppService.AddRolesAsync(id, input); + } + + [HttpPut] + [Route("{id}/move")] + [Authorize(IdentityPermissions.OrganizationUnits.Update)] + public async virtual Task MoveAsync(Guid id, OrganizationUnitMoveDto input) + { + await OrganizationUnitAppService.MoveAsync(id, input); + } + + [HttpPut] + [Route("{id}")] + [Authorize(IdentityPermissions.OrganizationUnits.Update)] + public async virtual Task UpdateAsync(Guid id, OrganizationUnitUpdateDto input) + { + return await OrganizationUnitAppService.UpdateAsync(id, input); } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Notifications/FodyWeavers.xml b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Notifications/FodyWeavers.xml new file mode 100644 index 000000000..1715698cc --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Notifications/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Notifications/FodyWeavers.xsd b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Notifications/FodyWeavers.xsd new file mode 100644 index 000000000..3f3946e28 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Notifications/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Notifications/LINGYUN.Abp.Identity.Notifications.csproj b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Notifications/LINGYUN.Abp.Identity.Notifications.csproj new file mode 100644 index 000000000..a1a1b59c8 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Notifications/LINGYUN.Abp.Identity.Notifications.csproj @@ -0,0 +1,25 @@ + + + + + + + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Identity.Notifications + LINGYUN.Abp.Identity.Notifications + false + false + false + + + + + + + + + + + + + diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Notifications/LINGYUN/Abp/Identity/Notifications/AbpIdentityNotificationsModule.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Notifications/LINGYUN/Abp/Identity/Notifications/AbpIdentityNotificationsModule.cs new file mode 100644 index 000000000..da3d7c73b --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Notifications/LINGYUN/Abp/Identity/Notifications/AbpIdentityNotificationsModule.cs @@ -0,0 +1,14 @@ +using LINGYUN.Abp.Notifications; +using Volo.Abp.Domain; +using Volo.Abp.Modularity; + +namespace LINGYUN.Abp.Identity.Notifications; + +[DependsOn( + typeof(AbpNotificationsModule), + typeof(AbpDddDomainSharedModule), + typeof(AbpIdentityDomainSharedModule))] +public class AbpIdentityNotificationsModule : AbpModule +{ + +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Notifications/LINGYUN/Abp/Identity/Notifications/IdentityNotificationDefinitionProvider.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Notifications/LINGYUN/Abp/Identity/Notifications/IdentityNotificationDefinitionProvider.cs new file mode 100644 index 000000000..0d905cad6 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Notifications/LINGYUN/Abp/Identity/Notifications/IdentityNotificationDefinitionProvider.cs @@ -0,0 +1,29 @@ +using LINGYUN.Abp.Notifications; +using Volo.Abp.Identity.Localization; +using Volo.Abp.Localization; + +namespace LINGYUN.Abp.Identity.Notifications; +public class IdentityNotificationDefinitionProvider : NotificationDefinitionProvider +{ + public override void Define(INotificationDefinitionContext context) + { + var group = context.AddGroup( + IdentityNotificationNames.GroupName, + L("Notifications:AbpIdentity"), + L("Notifications:AbpIdentity")); + + group.AddNotification( + IdentityNotificationNames.Session.ExpirationSession, + L("Notifications:SessionExpiration"), + L("Notifications:SessionExpiration"), + NotificationType.ServiceCallback, + NotificationLifetime.Persistent, + NotificationContentType.Json, + allowSubscriptionToClients: true); + } + + private static ILocalizableString L(string name) + { + return LocalizableString.Create(name); + } +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Notifications/LINGYUN/Abp/Identity/Notifications/IdentityNotificationNames.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Notifications/LINGYUN/Abp/Identity/Notifications/IdentityNotificationNames.cs new file mode 100644 index 000000000..3614c4935 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Notifications/LINGYUN/Abp/Identity/Notifications/IdentityNotificationNames.cs @@ -0,0 +1,14 @@ +namespace LINGYUN.Abp.Identity.Notifications; +public static class IdentityNotificationNames +{ + public const string GroupName = "AbpIdentity"; + + public static class Session + { + public const string Prefix = GroupName + ".Session"; + /// + /// 会话过期通知 + /// + public const string ExpirationSession = Prefix + ".Expiration"; + } +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Notifications/LINGYUN/Abp/Identity/Notifications/IdentitySessionRevokeEventHandler.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Notifications/LINGYUN/Abp/Identity/Notifications/IdentitySessionRevokeEventHandler.cs new file mode 100644 index 000000000..33bb76622 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Notifications/LINGYUN/Abp/Identity/Notifications/IdentitySessionRevokeEventHandler.cs @@ -0,0 +1,60 @@ +using LINGYUN.Abp.Notifications; +using LINGYUN.Abp.RealTime.Localization; +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Entities.Events.Distributed; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.Identity; +using Volo.Abp.Identity.Localization; +using Volo.Abp.Localization; +using Volo.Abp.Timing; + +namespace LINGYUN.Abp.Identity.Notifications; +public class IdentitySessionRevokeEventHandler : + IDistributedEventHandler>, + ITransientDependency +{ + private readonly IClock _clock; + private readonly INotificationSender _notificationSender; + + public IdentitySessionRevokeEventHandler(IClock clock, INotificationSender notificationSender) + { + _clock = clock; + _notificationSender = notificationSender; + } + + public async virtual Task HandleEventAsync(EntityDeletedEto eventData) + { + var notificationData = new NotificationData(); + notificationData.WriteLocalizedData( + new LocalizableStringInfo( + LocalizationResourceNameAttribute.GetName(typeof(IdentityResource)), + "Notifications:SessionExpiration"), + new LocalizableStringInfo( + LocalizationResourceNameAttribute.GetName(typeof(IdentityResource)), + "Notifications:SessionExpirationMessage", + new Dictionary + { + { "Device", eventData.Entity.Device } + }), + _clock.Now, + eventData.Entity.UserId.ToString()); + notificationData.TrySetData("SessionId", eventData.Entity.SessionId); + notificationData.TrySetData("ClientId", eventData.Entity.ClientId); + notificationData.TrySetData("Device", eventData.Entity.Device); + notificationData.TrySetData("IpAddresses", eventData.Entity.IpAddresses); + notificationData.TrySetData("UserId", eventData.Entity.UserId.ToString()); + notificationData.TrySetData("SignedIn", eventData.Entity.SignedIn.ToString("yyyy-MM-dd HH:mm:ss")); + if (eventData.Entity.LastAccessed.HasValue) + { + notificationData.TrySetData("SessionId", eventData.Entity.LastAccessed.Value.ToString("yyyy-MM-dd HH:mm:ss")); + } + + await _notificationSender.SendNofiterAsync( + IdentityNotificationNames.Session.ExpirationSession, + notificationData, + new UserIdentifier(eventData.Entity.UserId, eventData.Entity.SessionId), + eventData.Entity.TenantId); + } +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.OrganizaztionUnits/LINGYUN.Abp.Identity.OrganizaztionUnits.csproj b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.OrganizaztionUnits/LINGYUN.Abp.Identity.OrganizaztionUnits.csproj index e8dd596d2..ca83d2ead 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.OrganizaztionUnits/LINGYUN.Abp.Identity.OrganizaztionUnits.csproj +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.OrganizaztionUnits/LINGYUN.Abp.Identity.OrganizaztionUnits.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.Identity.OrganizaztionUnits + LINGYUN.Abp.Identity.OrganizaztionUnits + false + false + false diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.OrganizaztionUnits/LINGYUN/Abp/Identity/OrganizaztionUnits/AbpIdentityOrganizaztionUnitsModule.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.OrganizaztionUnits/LINGYUN/Abp/Identity/OrganizaztionUnits/AbpIdentityOrganizaztionUnitsModule.cs index 082aa98e0..7aed2da8d 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.OrganizaztionUnits/LINGYUN/Abp/Identity/OrganizaztionUnits/AbpIdentityOrganizaztionUnitsModule.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.OrganizaztionUnits/LINGYUN/Abp/Identity/OrganizaztionUnits/AbpIdentityOrganizaztionUnitsModule.cs @@ -1,5 +1,6 @@ using LINGYUN.Abp.Authorization.OrganizationUnits; using Volo.Abp.Modularity; +using Volo.Abp.Security.Claims; namespace LINGYUN.Abp.Identity.OrganizaztionUnits; @@ -7,5 +8,11 @@ namespace LINGYUN.Abp.Identity.OrganizaztionUnits; [DependsOn(typeof(AbpAuthorizationOrganizationUnitsModule))] public class AbpIdentityOrganizaztionUnitsModule : AbpModule { - + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.DynamicClaims.Add(AbpOrganizationUnitClaimTypes.OrganizationUnit); + }); + } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.OrganizaztionUnits/LINGYUN/Abp/Identity/OrganizaztionUnits/OrganizationUnitClaimsPrincipalContributor.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.OrganizaztionUnits/LINGYUN/Abp/Identity/OrganizaztionUnits/OrganizationUnitClaimsPrincipalContributor.cs deleted file mode 100644 index cfacb09e3..000000000 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.OrganizaztionUnits/LINGYUN/Abp/Identity/OrganizaztionUnits/OrganizationUnitClaimsPrincipalContributor.cs +++ /dev/null @@ -1,70 +0,0 @@ -using LINGYUN.Abp.Authorization.OrganizationUnits; -using System.Linq; -using System.Security.Claims; -using System.Security.Principal; -using System.Threading.Tasks; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Security.Claims; - -namespace LINGYUN.Abp.Identity.OrganizationUnits; - -public class OrganizationUnitClaimsPrincipalContributor : IAbpClaimsPrincipalContributor, ITransientDependency -{ - // https://github.com/dotnet/aspnetcore/blob/main/src/Identity/Extensions.Core/src/UserClaimsPrincipalFactory.cs#L74 - // private static string IdentityAuthenticationType => "Identity.Application"; - - private readonly IIdentityUserRepository _identityUserRepository; - private readonly IIdentityRoleRepository _identityRoleRepository; - - public OrganizationUnitClaimsPrincipalContributor( - IIdentityUserRepository identityUserRepository, - IIdentityRoleRepository identityRoleRepository) - { - _identityUserRepository = identityUserRepository; - _identityRoleRepository = identityRoleRepository; - } - - public async virtual Task ContributeAsync(AbpClaimsPrincipalContributorContext context) - { - var claimsIdentity = context.ClaimsPrincipal.Identities.FirstOrDefault(); - if (claimsIdentity == null) - { - return; - } - if (claimsIdentity.FindAll(x => x.Type == AbpOrganizationUnitClaimTypes.OrganizationUnit).Any()) - { - return; - } - var userId = claimsIdentity.FindUserId(); - if (!userId.HasValue) - { - return; - } - - var userOus = await _identityUserRepository.GetOrganizationUnitsAsync(id: userId.Value); - - foreach (var userOu in userOus) - { - if (!claimsIdentity.HasClaim(AbpOrganizationUnitClaimTypes.OrganizationUnit, userOu.Code)) - { - claimsIdentity.AddClaim(new Claim(AbpOrganizationUnitClaimTypes.OrganizationUnit, userOu.Code)); - } - } - - var userRoles = claimsIdentity - .FindAll(x => x.Type == AbpClaimTypes.Role) - .Select(x => x.Value) - .Distinct(); - - var roleOus = await _identityRoleRepository.GetOrganizationUnitsAsync(userRoles); - foreach (var roleOu in roleOus) - { - if (!claimsIdentity.HasClaim(AbpOrganizationUnitClaimTypes.OrganizationUnit, roleOu.Code)) - { - claimsIdentity.AddClaim(new Claim(AbpOrganizationUnitClaimTypes.OrganizationUnit, roleOu.Code)); - } - } - - context.ClaimsPrincipal.AddIdentityIfNotContains(claimsIdentity); - } -} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.OrganizaztionUnits/LINGYUN/Abp/Identity/OrganizaztionUnits/OrganizaztionUnitDynamicClaimsPrincipalContributorCache.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.OrganizaztionUnits/LINGYUN/Abp/Identity/OrganizaztionUnits/OrganizaztionUnitDynamicClaimsPrincipalContributorCache.cs new file mode 100644 index 000000000..5975b0a7b --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.OrganizaztionUnits/LINGYUN/Abp/Identity/OrganizaztionUnits/OrganizaztionUnitDynamicClaimsPrincipalContributorCache.cs @@ -0,0 +1,85 @@ +using LINGYUN.Abp.Authorization.OrganizationUnits; +using Microsoft.AspNetCore.Identity; +using Microsoft.Extensions.Caching.Distributed; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; +using System; +using System.Linq; +using System.Threading.Tasks; +using Volo.Abp.Caching; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.ChangeTracking; +using Volo.Abp.Identity; +using Volo.Abp.MultiTenancy; +using Volo.Abp.Security.Claims; + +namespace LINGYUN.Abp.Identity.OrganizaztionUnits; + +[Dependency(ServiceLifetime.Transient, ReplaceServices = true)] +[ExposeServices( + typeof(IdentityDynamicClaimsPrincipalContributorCache), + typeof(OrganizaztionUnitDynamicClaimsPrincipalContributorCache))] +public class OrganizaztionUnitDynamicClaimsPrincipalContributorCache : IdentityDynamicClaimsPrincipalContributorCache +{ + protected IIdentityUserRepository IdentityUserRepository { get; } + protected IIdentityRoleRepository IdentityRoleRepository { get; } + + public OrganizaztionUnitDynamicClaimsPrincipalContributorCache( + IDistributedCache dynamicClaimCache, + ICurrentTenant currentTenant, + IdentityUserManager userManager, + IIdentityUserRepository identityUserRepository, + IIdentityRoleRepository identityRoleRepository, + IUserClaimsPrincipalFactory userClaimsPrincipalFactory, + IOptions abpClaimsPrincipalFactoryOptions, + IOptions cacheOptions) + : base(dynamicClaimCache, currentTenant, userManager, userClaimsPrincipalFactory, abpClaimsPrincipalFactoryOptions, cacheOptions) + { + IdentityUserRepository = identityUserRepository; + IdentityRoleRepository = identityRoleRepository; + } + + [DisableEntityChangeTracking] + public async override Task GetAsync(Guid userId, Guid? tenantId = null) + { + var cacheItems = await base.GetAsync(userId, tenantId); + if (cacheItems.Claims.Any(x => x.Type == AbpOrganizationUnitClaimTypes.OrganizationUnit && x.Value.IsNullOrWhiteSpace())) + { + cacheItems.Claims.RemoveAll(x => x.Type == AbpOrganizationUnitClaimTypes.OrganizationUnit); + + var userOus = await IdentityUserRepository.GetOrganizationUnitsAsync(id: userId); + + foreach (var userOu in userOus) + { + if (!cacheItems.Claims.Any(x => x.Type == AbpOrganizationUnitClaimTypes.OrganizationUnit && x.Value == userOu.Code)) + { + cacheItems.Claims.Add(new AbpDynamicClaim(AbpOrganizationUnitClaimTypes.OrganizationUnit, userOu.Code)); + } + } + + var userRoles = cacheItems.Claims + .FindAll(x => x.Type == AbpClaimTypes.Role) + .Select(x => x.Value) + .Distinct(); + + var roleOus = await IdentityRoleRepository.GetOrganizationUnitsAsync(userRoles); + foreach (var roleOu in roleOus) + { + if (!cacheItems.Claims.Any(x => x.Type == AbpOrganizationUnitClaimTypes.OrganizationUnit && x.Value == roleOu.Code)) + { + cacheItems.Claims.Add(new AbpDynamicClaim(AbpOrganizationUnitClaimTypes.OrganizationUnit, roleOu.Code)); + } + } + + await DynamicClaimCache.SetAsync( + AbpDynamicClaimCacheItem.CalculateCacheKey(userId, tenantId), + cacheItems, + new DistributedCacheEntryOptions + { + AbsoluteExpirationRelativeToNow = CacheOptions.Value.CacheAbsoluteExpiration + }); + } + + return cacheItems; + } +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/FodyWeavers.xml b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/FodyWeavers.xml new file mode 100644 index 000000000..1715698cc --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/FodyWeavers.xsd b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/FodyWeavers.xsd new file mode 100644 index 000000000..3f3946e28 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/LINGYUN.Abp.Identity.Session.AspNetCore.csproj b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/LINGYUN.Abp.Identity.Session.AspNetCore.csproj new file mode 100644 index 000000000..22dbf46b1 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/LINGYUN.Abp.Identity.Session.AspNetCore.csproj @@ -0,0 +1,24 @@ + + + + + + + net8.0 + LINGYUN.Abp.Identity.Session.AspNetCore + LINGYUN.Abp.Identity.Session.AspNetCore + false + false + false + + + + + + + + + + + + diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/LINGYUN/Abp/Identity/Session/AspNetCore/AbpIdentitySessionAspNetCoreModule.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/LINGYUN/Abp/Identity/Session/AspNetCore/AbpIdentitySessionAspNetCoreModule.cs new file mode 100644 index 000000000..0d4f3afdb --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/LINGYUN/Abp/Identity/Session/AspNetCore/AbpIdentitySessionAspNetCoreModule.cs @@ -0,0 +1,10 @@ +using Volo.Abp.AspNetCore; +using Volo.Abp.Modularity; + +namespace LINGYUN.Abp.Identity.Session.AspNetCore; + +[DependsOn(typeof(AbpAspNetCoreModule))] +[DependsOn(typeof(AbpIdentitySessionModule))] +public class AbpIdentitySessionAspNetCoreModule : AbpModule +{ +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/LINGYUN/Abp/Identity/Session/AspNetCore/AbpIdentitySessionDynamicClaimsPrincipalContributor.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/LINGYUN/Abp/Identity/Session/AspNetCore/AbpIdentitySessionDynamicClaimsPrincipalContributor.cs new file mode 100644 index 000000000..2f8146ed7 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/LINGYUN/Abp/Identity/Session/AspNetCore/AbpIdentitySessionDynamicClaimsPrincipalContributor.cs @@ -0,0 +1,34 @@ +using System; +using System.Linq; +using System.Security.Claims; +using System.Security.Principal; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; +using Volo.Abp.MultiTenancy; +using Volo.Abp.Security.Claims; + +namespace LINGYUN.Abp.Identity.Session.AspNetCore; +public class AbpIdentitySessionDynamicClaimsPrincipalContributor : IAbpDynamicClaimsPrincipalContributor, ITransientDependency +{ + public async virtual Task ContributeAsync(AbpClaimsPrincipalContributorContext context) + { + var claimsIdentity = context.ClaimsPrincipal.Identities.First(); + var sessionId = claimsIdentity.FindSessionId(); + var userId = claimsIdentity.FindUserId(); + if (!userId.HasValue && sessionId.IsNullOrWhiteSpace()) + { + return; + } + var tenantId = claimsIdentity.FindTenantId(); + var currentTenant = context.GetRequiredService(); + using (currentTenant.Change(tenantId)) + { + var identitySessionChecker = context.GetRequiredService(); + if (!await identitySessionChecker.ValidateSessionAsync(sessionId)) + { + // 用户会话已过期 + context.ClaimsPrincipal = new ClaimsPrincipal(new ClaimsIdentity()); + } + } + } +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/LINGYUN/Abp/Identity/Session/AspNetCore/AbpSessionApplicationBuilderExtensions.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/LINGYUN/Abp/Identity/Session/AspNetCore/AbpSessionApplicationBuilderExtensions.cs new file mode 100644 index 000000000..01746cc08 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/LINGYUN/Abp/Identity/Session/AspNetCore/AbpSessionApplicationBuilderExtensions.cs @@ -0,0 +1,22 @@ +using Microsoft.AspNetCore.Builder; + +namespace LINGYUN.Abp.Identity.Session.AspNetCore; +public static class AbpSessionApplicationBuilderExtensions +{ + /// + /// 会话管理中间件 + /// + /// + /// 建议顺序:
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// + /// + public static IApplicationBuilder UseAbpSession(this IApplicationBuilder app) + { + return app.UseMiddleware(); + } +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/LINGYUN/Abp/Identity/Session/AspNetCore/AbpSessionMiddleware.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/LINGYUN/Abp/Identity/Session/AspNetCore/AbpSessionMiddleware.cs new file mode 100644 index 000000000..615f73654 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/LINGYUN/Abp/Identity/Session/AspNetCore/AbpSessionMiddleware.cs @@ -0,0 +1,41 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; +using System.Security.Principal; +using System.Threading.Tasks; +using Volo.Abp.AspNetCore.Middleware; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Security.Claims; +using Volo.Abp.Tracing; + +namespace LINGYUN.Abp.Identity.Session.AspNetCore; +public class AbpSessionMiddleware : AbpMiddlewareBase, ITransientDependency +{ + private readonly ISessionInfoProvider _sessionInfoProvider; + private readonly ICorrelationIdProvider _correlationIdProvider; + + public AbpSessionMiddleware( + ISessionInfoProvider sessionInfoProvider, + ICorrelationIdProvider correlationIdProvider) + { + _sessionInfoProvider = sessionInfoProvider; + _correlationIdProvider = correlationIdProvider; + } + + public override Task InvokeAsync(HttpContext context, RequestDelegate next) + { + if (context.User.Identity?.IsAuthenticated == true) + { + if (context.RequestServices.GetRequiredService>().Value.IsDynamicClaimsEnabled) + { + // 在处理动态声明前保留全局会话用于验证 + var sessionId = context.User.FindSessionId(); + using (_sessionInfoProvider.Change(sessionId)) + { + return next(context); + } + } + } + return next(context); + } +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/LINGYUN/Abp/Identity/Session/AspNetCore/HttpContextDeviceInfoProvider.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/LINGYUN/Abp/Identity/Session/AspNetCore/HttpContextDeviceInfoProvider.cs new file mode 100644 index 000000000..c12e9617f --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/LINGYUN/Abp/Identity/Session/AspNetCore/HttpContextDeviceInfoProvider.cs @@ -0,0 +1,84 @@ +using DeviceDetectorNET; +using System; +using Volo.Abp.AspNetCore.WebClientInfo; +using Volo.Abp.DependencyInjection; + +namespace LINGYUN.Abp.Identity.Session.AspNetCore; +public class HttpContextDeviceInfoProvider : IDeviceInfoProvider, ITransientDependency +{ + protected IWebClientInfoProvider WebClientInfoProvider { get; } + + public HttpContextDeviceInfoProvider( + IWebClientInfoProvider webClientInfoProvider) + { + WebClientInfoProvider = webClientInfoProvider; + } + + public DeviceInfo DeviceInfo => GetDeviceInfo(); + + public string ClientIpAddress => WebClientInfoProvider.ClientIpAddress; + + protected virtual DeviceInfo GetDeviceInfo() + { + var deviceInfo = BrowserDeviceInfo.Parse(WebClientInfoProvider.BrowserInfo); + + return new DeviceInfo( + deviceInfo.Device, + deviceInfo.Description, + WebClientInfoProvider.ClientIpAddress); + } + + private class BrowserDeviceInfo + { + public string Device { get; } + public string Description { get; } + + public BrowserDeviceInfo(string device, string description) + { + Device = device; + Description = description; + } + + public static BrowserDeviceInfo Parse(string browserInfo) + { + string device = null; + string deviceInfo = null; + if (!browserInfo.IsNullOrWhiteSpace()) + { + var deviceDetector = new DeviceDetector(browserInfo); + deviceDetector.Parse(); + if (deviceDetector.IsParsed()) + { + var osInfo = deviceDetector.GetOs(); + if (deviceDetector.IsMobile()) + { + // IdentitySessionDevices.Mobile + device = osInfo.Success ? osInfo.Match.Name : "Mobile"; + } + else if (deviceDetector.IsBrowser()) + { + // IdentitySessionDevices.Web + device = "Web"; + } + else if (deviceDetector.IsDesktop()) + { + // TODO: PC + device = "Desktop"; + } + + if (osInfo.Success) + { + deviceInfo = osInfo.Match.Name + " " + osInfo.Match.Version; + } + + var clientInfo = deviceDetector.GetClient(); + if (clientInfo.Success) + { + deviceInfo = deviceInfo.IsNullOrWhiteSpace() ? clientInfo.Match.Name : deviceInfo + " " + clientInfo.Match.Name; + } + } + } + return new BrowserDeviceInfo(device, deviceInfo); + } + } +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/README.md b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/README.md new file mode 100644 index 000000000..f75c5002f --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session.AspNetCore/README.md @@ -0,0 +1,23 @@ +# LINGYUN.Abp.Identity.Session.AspNetCore + +身份服务用户会话扩展模块 + +## 接口描述 + +### AbpSessionMiddleware 在请求管道中从用户令牌提取 *sessionId* 作为全局会话标识, 可用于注销会话 + 注意: 当匿名用户访问时, 以请求 *CorrelationId* 作为标识; + 当 *CorrelationId* 不存在时, 使用随机 *Guid.NewGuid()*. + +### HttpContextDeviceInfoProvider 从请求参数中提取设备标识 + +出于模块职责分离原则, 请勿与 *LINGYUN.Abp.Identity.AspNetCore.Session* 模块混淆 + +## 配置使用 + +```csharp +[DependsOn(typeof(AbpIdentitySessionAspNetCoreModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/FodyWeavers.xml b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/FodyWeavers.xml new file mode 100644 index 000000000..1715698cc --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/FodyWeavers.xsd b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/FodyWeavers.xsd new file mode 100644 index 000000000..3f3946e28 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN.Abp.Identity.Session.csproj b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN.Abp.Identity.Session.csproj new file mode 100644 index 000000000..5e8e19807 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN.Abp.Identity.Session.csproj @@ -0,0 +1,20 @@ + + + + + + + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Identity.Session + LINGYUN.Abp.Identity.Session + false + false + false + + + + + + + + diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/AbpIdentitySessionModule.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/AbpIdentitySessionModule.cs new file mode 100644 index 000000000..651671b73 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/AbpIdentitySessionModule.cs @@ -0,0 +1,9 @@ +using Volo.Abp.Caching; +using Volo.Abp.Modularity; + +namespace LINGYUN.Abp.Identity.Session; + +[DependsOn(typeof(AbpCachingModule))] +public class AbpIdentitySessionModule : AbpModule +{ +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/DefaultIdentitySessionCache.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/DefaultIdentitySessionCache.cs new file mode 100644 index 000000000..3104b2d00 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/DefaultIdentitySessionCache.cs @@ -0,0 +1,46 @@ +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; +using System.Threading; +using System.Threading.Tasks; +using Volo.Abp.Caching; +using Volo.Abp.DependencyInjection; + +namespace LINGYUN.Abp.Identity.Session; +public class DefaultIdentitySessionCache : IIdentitySessionCache, ITransientDependency +{ + public ILogger Logger { protected get; set; } + protected IDistributedCache Cache { get; } + + public DefaultIdentitySessionCache(IDistributedCache cache) + { + Cache = cache; + + Logger = NullLogger.Instance; + } + + public async virtual Task GetAsync(string sessionId, CancellationToken cancellationToken = default) + { + Logger.LogDebug($"Get user session cache for: {sessionId}"); + var cacheKey = IdentitySessionCacheItem.CalculateCacheKey(sessionId); + + return await Cache.GetAsync(cacheKey, token: cancellationToken); + } + + public async virtual Task RefreshAsync(string sessionId, IdentitySessionCacheItem cacheItem, CancellationToken cancellationToken = default) + { + Logger.LogDebug($"Refresh user session cache for: {sessionId}"); + + var cacheKey = IdentitySessionCacheItem.CalculateCacheKey(sessionId); + + await Cache.SetAsync(cacheKey, cacheItem, token: cancellationToken); + } + + public async virtual Task RemoveAsync(string sessionId, CancellationToken cancellationToken = default) + { + Logger.LogDebug($"Remove user session cache for: {sessionId}"); + + var cacheKey = IdentitySessionCacheItem.CalculateCacheKey(sessionId); + + await Cache.RemoveAsync(cacheKey, token: cancellationToken); + } +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/DefaultIdentitySessionChecker.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/DefaultIdentitySessionChecker.cs new file mode 100644 index 000000000..9fc016392 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/DefaultIdentitySessionChecker.cs @@ -0,0 +1,91 @@ +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; +using Microsoft.Extensions.Options; +using System; +using System.Threading; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.MultiTenancy; +using Volo.Abp.Timing; + +namespace LINGYUN.Abp.Identity.Session; + +public class DefaultIdentitySessionChecker : IIdentitySessionChecker, ITransientDependency +{ + public ILogger Logger { protected get; set; } + + protected IClock Clock { get; } + protected ICurrentTenant CurrentTenant { get; } + protected IDeviceInfoProvider DeviceInfoProvider { get; } + protected IDistributedEventBus DistributedEventBus { get; } + protected IIdentitySessionCache IdentitySessionCache { get; } + protected IdentitySessionCheckOptions SessionCheckOptions { get; } + + public DefaultIdentitySessionChecker( + IClock clock, + ICurrentTenant currentTenant, + IDeviceInfoProvider deviceInfoProvider, + IDistributedEventBus distributedEventBus, + IIdentitySessionCache identitySessionCache, + IOptions sessionCheckOptions) + { + Clock = clock; + CurrentTenant = currentTenant; + DeviceInfoProvider = deviceInfoProvider; + DistributedEventBus = distributedEventBus; + IdentitySessionCache = identitySessionCache; + SessionCheckOptions = sessionCheckOptions.Value; + + Logger = NullLogger.Instance; + } + + public async virtual Task ValidateSessionAsync(string sessionId, CancellationToken cancellationToken = default) + { + if (sessionId.IsNullOrWhiteSpace()) + { + Logger.LogDebug("No user session id found."); + return false; + } + + var identitySessionCacheItem = await IdentitySessionCache.GetAsync(sessionId, cancellationToken); + if (identitySessionCacheItem == null) + { + Logger.LogDebug($"No user session cache found for: {sessionId}."); + return false; + } + + // Implementation https://github.com/abpio/abp-commercial-docs/blob/dev/en/modules/identity/session-management.md#how-it-works + + var lastAccressedTime = identitySessionCacheItem.LastAccessed; + var accressedTime = Clock.Now; + + if (lastAccressedTime.HasValue && + lastAccressedTime.Value < accressedTime.Subtract(SessionCheckOptions.KeepAccessTimeSpan)) + { + // 更新缓存中的访问地址以及客户端Ip地址 + identitySessionCacheItem.LastAccessed = accressedTime; + identitySessionCacheItem.IpAddresses = DeviceInfoProvider.ClientIpAddress; + + Logger.LogDebug($"Refresh the user access info in the cache from {sessionId}."); + await IdentitySessionCache.RefreshAsync(sessionId, identitySessionCacheItem, cancellationToken); + } + + // 避免某些场景频繁去刷新持久化设施 + if (lastAccressedTime.HasValue && + lastAccressedTime.Value < accressedTime.Subtract(SessionCheckOptions.SessionSyncTimeSpan)) + { + Logger.LogDebug($"Publishes the cache synchronization user session event from {sessionId}."); + // 发布事件, 使持久化设施从缓存同步 + var eventData = new IdentitySessionChangeAccessedEvent( + identitySessionCacheItem.SessionId, + identitySessionCacheItem.IpAddresses, + accressedTime, + CurrentTenant.Id); + + await DistributedEventBus.PublishAsync(eventData); + } + + return true; + } +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/DefaultSessionInfoProvider.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/DefaultSessionInfoProvider.cs new file mode 100644 index 000000000..b49e756ed --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/DefaultSessionInfoProvider.cs @@ -0,0 +1,25 @@ +using Microsoft.Extensions.DependencyInjection; +using System; +using System.Threading; +using Volo.Abp; +using Volo.Abp.DependencyInjection; + +namespace LINGYUN.Abp.Identity.Session; + +[Dependency(ServiceLifetime.Singleton, TryRegister = true)] +public class DefaultSessionInfoProvider : ISessionInfoProvider +{ + private readonly AsyncLocal _currentSessionId = new AsyncLocal(); + + public string SessionId => _currentSessionId.Value; + + public virtual IDisposable Change(string sessionId) + { + var parent = SessionId; + _currentSessionId.Value = sessionId; + return new DisposeAction(() => + { + _currentSessionId.Value = parent; + }); + } +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/DeviceInfo.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/DeviceInfo.cs new file mode 100644 index 000000000..2cb8a04ef --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/DeviceInfo.cs @@ -0,0 +1,13 @@ +namespace LINGYUN.Abp.Identity.Session; +public class DeviceInfo +{ + public string Device { get; } + public string Description { get; } + public string ClientIpAddress { get; } + public DeviceInfo(string device, string description, string clientIpAddress) + { + Device = device; + Description = description; + ClientIpAddress = clientIpAddress; + } +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/IDeviceInfoProvider.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/IDeviceInfoProvider.cs new file mode 100644 index 000000000..f60371ee1 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/IDeviceInfoProvider.cs @@ -0,0 +1,7 @@ +namespace LINGYUN.Abp.Identity.Session; +public interface IDeviceInfoProvider +{ + DeviceInfo DeviceInfo { get; } + + string ClientIpAddress { get; } +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/IIdentitySessionCache.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/IIdentitySessionCache.cs new file mode 100644 index 000000000..13f6f5db9 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/IIdentitySessionCache.cs @@ -0,0 +1,12 @@ +using System.Threading; +using System.Threading.Tasks; + +namespace LINGYUN.Abp.Identity.Session; +public interface IIdentitySessionCache +{ + Task RefreshAsync(string sessionId, IdentitySessionCacheItem cacheItem, CancellationToken cancellationToken = default); + + Task GetAsync(string sessionId, CancellationToken cancellationToken = default); + + Task RemoveAsync(string sessionId, CancellationToken cancellationToken = default); +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/IIdentitySessionChecker.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/IIdentitySessionChecker.cs new file mode 100644 index 000000000..d21dae5f5 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/IIdentitySessionChecker.cs @@ -0,0 +1,8 @@ +using System.Threading; +using System.Threading.Tasks; + +namespace LINGYUN.Abp.Identity.Session; +public interface IIdentitySessionChecker +{ + Task ValidateSessionAsync(string sessionId, CancellationToken cancellationToken = default); +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/ISessionInfoProvider.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/ISessionInfoProvider.cs new file mode 100644 index 000000000..6ae517cf0 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/ISessionInfoProvider.cs @@ -0,0 +1,9 @@ +using System; + +namespace LINGYUN.Abp.Identity.Session; +public interface ISessionInfoProvider +{ + string SessionId { get; } + + IDisposable Change(string sessionId); +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/IdentitySessionCacheItem.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/IdentitySessionCacheItem.cs new file mode 100644 index 000000000..123a74f98 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/IdentitySessionCacheItem.cs @@ -0,0 +1,54 @@ +using System; + +namespace LINGYUN.Abp.Identity.Session; + +[Serializable] +public class IdentitySessionCacheItem +{ + private const string CacheKeyFormat = "s:{0}"; + + public string Device { get; set; } + + public string DeviceInfo { get; set; } + + public Guid UserId { get; set; } + + public string SessionId { get; set; } + + public string ClientId { get; set; } + + public string IpAddresses { get; set; } + + public DateTime SignedIn { get; set; } + + public DateTime? LastAccessed { get; set; } + + public IdentitySessionCacheItem() + { + } + + public IdentitySessionCacheItem( + string device, + string deviceInfo, + Guid userId, + string sessionId, + string clientId, + string ipAddresses, + DateTime signedIn, + DateTime? lastAccessed = null) + { + Device = device; + DeviceInfo = deviceInfo; + UserId = userId; + SessionId = sessionId; + ClientId = clientId; + IpAddresses = ipAddresses; + SignedIn = signedIn; + LastAccessed = lastAccessed; + } + + public static string CalculateCacheKey(string sessionId) + { + return string.Format(CacheKeyFormat, sessionId); + } +} \ No newline at end of file diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/IdentitySessionChangeAccessedEvent.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/IdentitySessionChangeAccessedEvent.cs new file mode 100644 index 000000000..8d182da0a --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/IdentitySessionChangeAccessedEvent.cs @@ -0,0 +1,29 @@ +using System; +using Volo.Abp.EventBus; +using Volo.Abp.MultiTenancy; + +namespace LINGYUN.Abp.Identity.Session; + +[EventName("abp.identity.session.change_accessed")] +public class IdentitySessionChangeAccessedEvent : IMultiTenant +{ + public Guid? TenantId { get; set; } + public string SessionId { get; set; } + public string IpAddresses { get; set; } + public DateTime LastAccessed { get; set; } + public IdentitySessionChangeAccessedEvent() + { + + } + public IdentitySessionChangeAccessedEvent( + string sessionId, + string ipAddresses, + DateTime lastAccessed, + Guid? tenantId = null) + { + SessionId = sessionId; + IpAddresses = ipAddresses; + LastAccessed = lastAccessed; + TenantId = tenantId; + } +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/IdentitySessionCheckOptions.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/IdentitySessionCheckOptions.cs new file mode 100644 index 000000000..8f72e711d --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/IdentitySessionCheckOptions.cs @@ -0,0 +1,30 @@ +using System; + +namespace LINGYUN.Abp.Identity.Session; +/// +/// 用于会话管理的配置 +/// +public class IdentitySessionCheckOptions +{ + /// + /// 保持访问时长 + /// 默认: 1分钟 + /// + /// + /// 刷新缓存会话间隔时长 + /// + public TimeSpan KeepAccessTimeSpan { get; set; } + /// + /// 会话同步间隔(ms) + /// 默认: 10分钟 + /// + /// + /// 从缓存同步到持久化的间隔时长 + /// + public TimeSpan SessionSyncTimeSpan { get; set; } + public IdentitySessionCheckOptions() + { + KeepAccessTimeSpan = TimeSpan.FromMinutes(1); + SessionSyncTimeSpan = TimeSpan.FromMinutes(10); + } +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/NoneDeviceInfoProvider.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/NoneDeviceInfoProvider.cs new file mode 100644 index 000000000..906c1c2b4 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/LINGYUN/Abp/Identity/Session/NoneDeviceInfoProvider.cs @@ -0,0 +1,12 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.DependencyInjection; + +namespace LINGYUN.Abp.Identity.Session; + +[Dependency(ServiceLifetime.Singleton, TryRegister = true)] +public class NoneDeviceInfoProvider : IDeviceInfoProvider +{ + public DeviceInfo DeviceInfo => new DeviceInfo("unknown", "unknown", "unknown"); + + public string ClientIpAddress => "::1"; +} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/README.md b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/README.md new file mode 100644 index 000000000..b92ea9da2 --- /dev/null +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Session/README.md @@ -0,0 +1,21 @@ +# LINGYUN.Abp.Identity.Session + +用户会话基础模块,提供相关的通用接口 + + +## 配置使用 + +```csharp +[DependsOn(typeof(AbpIdentitySessionModule))] +public class YouProjectModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + // 设置会话缓存与数据库刷新间隔为10分钟 + options.KeepAccessTimeSpan = TimeSpan.FromMinutes(10); + }); + } +} +``` diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN.Abp.IdentityServer.Application.Contracts.csproj b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN.Abp.IdentityServer.Application.Contracts.csproj index 2068fdcb6..4fd48ea8c 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN.Abp.IdentityServer.Application.Contracts.csproj +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN.Abp.IdentityServer.Application.Contracts.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.IdentityServer.Application.Contracts + LINGYUN.Abp.IdentityServer.Application.Contracts + false + false + false diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerApplicationContractsModule.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerApplicationContractsModule.cs index d4fa229be..2467f6e8f 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerApplicationContractsModule.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerApplicationContractsModule.cs @@ -6,27 +6,26 @@ using Volo.Abp.Modularity; using Volo.Abp.VirtualFileSystem; -namespace LINGYUN.Abp.IdentityServer +namespace LINGYUN.Abp.IdentityServer; + +[DependsOn( + typeof(AbpAuthorizationModule), + typeof(AbpDddApplicationContractsModule), + typeof(AbpIdentityServerDomainSharedModule))] +public class AbpIdentityServerApplicationContractsModule : AbpModule { - [DependsOn( - typeof(AbpAuthorizationModule), - typeof(AbpDddApplicationContractsModule), - typeof(AbpIdentityServerDomainSharedModule))] - public class AbpIdentityServerApplicationContractsModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + Configure(options => { - Configure(options => - { - options.FileSets.AddEmbedded(); - }); + options.FileSets.AddEmbedded(); + }); - Configure(options => - { - options.Resources - .Get() - .AddVirtualJson("/LINGYUN/Abp/IdentityServer/Localization/Resources"); - }); - } + Configure(options => + { + options.Resources + .Get() + .AddVirtualJson("/LINGYUN/Abp/IdentityServer/Localization/Resources"); + }); } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerConsts.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerConsts.cs index c326101c0..4b93b2758 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerConsts.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerConsts.cs @@ -1,10 +1,9 @@ -namespace LINGYUN.Abp.IdentityServer +namespace LINGYUN.Abp.IdentityServer; + +public class AbpIdentityServerConsts { - public class AbpIdentityServerConsts - { - /// - /// 远程服务名称 - /// - public const string RemoteServiceName = "IdentityServer"; - } + /// + /// 远程服务名称 + /// + public const string RemoteServiceName = "IdentityServer"; } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerErrorConsts.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerErrorConsts.cs index 6c107be83..2717d3e86 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerErrorConsts.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerErrorConsts.cs @@ -1,50 +1,49 @@ -namespace LINGYUN.Abp.IdentityServer +namespace LINGYUN.Abp.IdentityServer; + +public class AbpIdentityServerErrorConsts { - public class AbpIdentityServerErrorConsts - { - /// - /// 客户端标识已经存在 - /// - public const string ClientIdExisted = "ClientIdExisted"; - - /// - /// Api资源已经存在 - /// - public const string ApiResourceNameExisted = "ApiResourceNameExisted"; - - /// - /// Api范围已经存在 - /// - public const string ApiScopeNameExisted = "ApiScopeNameExisted"; - - /// - /// 身份资源已经存在 - /// - public const string IdentityResourceNameExisted = "IdentityResourceNameExisted"; - - /// - /// 身份资源属性已经存在 - /// - public const string IdentityResourcePropertyExisted = "IdentityResourcePropertyExisted"; - - /// - /// 客户端声明不存在 - /// - public const string ClientClaimNotFound = "ClientClaimNotFound"; - - /// - /// 客户端密钥不存在 - /// - public const string ClientSecretNotFound = "ClientSecretNotFound"; - - /// - /// 客户端属性不存在 - /// - public const string ClientPropertyNotFound = "ClientPropertyNotFound"; - - /// - /// 身份资源属性不存在 - /// - public const string IdentityResourcePropertyNotFound = "IdentityResourcePropertyNotFound"; - } + /// + /// 客户端标识已经存在 + /// + public const string ClientIdExisted = "ClientIdExisted"; + + /// + /// Api资源已经存在 + /// + public const string ApiResourceNameExisted = "ApiResourceNameExisted"; + + /// + /// Api范围已经存在 + /// + public const string ApiScopeNameExisted = "ApiScopeNameExisted"; + + /// + /// 身份资源已经存在 + /// + public const string IdentityResourceNameExisted = "IdentityResourceNameExisted"; + + /// + /// 身份资源属性已经存在 + /// + public const string IdentityResourcePropertyExisted = "IdentityResourcePropertyExisted"; + + /// + /// 客户端声明不存在 + /// + public const string ClientClaimNotFound = "ClientClaimNotFound"; + + /// + /// 客户端密钥不存在 + /// + public const string ClientSecretNotFound = "ClientSecretNotFound"; + + /// + /// 客户端属性不存在 + /// + public const string ClientPropertyNotFound = "ClientPropertyNotFound"; + + /// + /// 身份资源属性不存在 + /// + public const string IdentityResourcePropertyNotFound = "IdentityResourcePropertyNotFound"; } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerPermissionDefinitionProvider.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerPermissionDefinitionProvider.cs index 9bbc68503..befdb1ff6 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerPermissionDefinitionProvider.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerPermissionDefinitionProvider.cs @@ -3,70 +3,69 @@ using Volo.Abp.Localization; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.IdentityServer +namespace LINGYUN.Abp.IdentityServer; + +public class AbpIdentityServerPermissionDefinitionProvider : PermissionDefinitionProvider { - public class AbpIdentityServerPermissionDefinitionProvider : PermissionDefinitionProvider + public override void Define(IPermissionDefinitionContext context) { - public override void Define(IPermissionDefinitionContext context) - { - // TODO: 身份认证服务器应该只能主机管辖 - // 增加 MultiTenancySides.Host - // var identityServerGroup = context.AddGroup(AbpIdentityServerPermissions.GroupName, L("Permissions:IdentityServer"), MultiTenancySides.Host); + // TODO: 身份认证服务器应该只能主机管辖 + // 增加 MultiTenancySides.Host + // var identityServerGroup = context.AddGroup(AbpIdentityServerPermissions.GroupName, L("Permissions:IdentityServer"), MultiTenancySides.Host); - // 与 LINGYUN.Abp.FeatureManagement.Client 模块搭配,这样干可以不依赖于模块优先级 - var identityServerGroup = context.GetGroupOrNull(AbpIdentityServerPermissions.GroupName); - if (identityServerGroup == null) - { - identityServerGroup = context - .AddGroup( - name: AbpIdentityServerPermissions.GroupName, - displayName: L("Permissions:IdentityServer")); - } - // 客户端权限 - var clientPermissions = identityServerGroup.AddPermission(AbpIdentityServerPermissions.Clients.Default, L("Permissions:Clients"), MultiTenancySides.Host); - clientPermissions.AddChild(AbpIdentityServerPermissions.Clients.Create, L("Permissions:Create"), MultiTenancySides.Host); - clientPermissions.AddChild(AbpIdentityServerPermissions.Clients.Update, L("Permissions:Update"), MultiTenancySides.Host); - clientPermissions.AddChild(AbpIdentityServerPermissions.Clients.Clone, L("Permissions:Clone"), MultiTenancySides.Host); - clientPermissions.AddChild(AbpIdentityServerPermissions.Clients.Delete, L("Permissions:Delete"), MultiTenancySides.Host); - clientPermissions.AddChild(AbpIdentityServerPermissions.Clients.ManagePermissions, L("Permissions:ManagePermissions"), MultiTenancySides.Host); - clientPermissions.AddChild(AbpIdentityServerPermissions.Clients.ManageClaims, L("Permissions:ManageClaims"), MultiTenancySides.Host); - clientPermissions.AddChild(AbpIdentityServerPermissions.Clients.ManageSecrets, L("Permissions:ManageSecrets"), MultiTenancySides.Host); - clientPermissions.AddChild(AbpIdentityServerPermissions.Clients.ManageProperties, L("Permissions:ManageProperties"), MultiTenancySides.Host); + // 与 LINGYUN.Abp.FeatureManagement.Client 模块搭配,这样干可以不依赖于模块优先级 + var identityServerGroup = context.GetGroupOrNull(AbpIdentityServerPermissions.GroupName); + if (identityServerGroup == null) + { + identityServerGroup = context + .AddGroup( + name: AbpIdentityServerPermissions.GroupName, + displayName: L("Permissions:IdentityServer")); + } + // 客户端权限 + var clientPermissions = identityServerGroup.AddPermission(AbpIdentityServerPermissions.Clients.Default, L("Permissions:Clients"), MultiTenancySides.Host); + clientPermissions.AddChild(AbpIdentityServerPermissions.Clients.Create, L("Permissions:Create"), MultiTenancySides.Host); + clientPermissions.AddChild(AbpIdentityServerPermissions.Clients.Update, L("Permissions:Update"), MultiTenancySides.Host); + clientPermissions.AddChild(AbpIdentityServerPermissions.Clients.Clone, L("Permissions:Clone"), MultiTenancySides.Host); + clientPermissions.AddChild(AbpIdentityServerPermissions.Clients.Delete, L("Permissions:Delete"), MultiTenancySides.Host); + clientPermissions.AddChild(AbpIdentityServerPermissions.Clients.ManagePermissions, L("Permissions:ManagePermissions"), MultiTenancySides.Host); + clientPermissions.AddChild(AbpIdentityServerPermissions.Clients.ManageClaims, L("Permissions:ManageClaims"), MultiTenancySides.Host); + clientPermissions.AddChild(AbpIdentityServerPermissions.Clients.ManageSecrets, L("Permissions:ManageSecrets"), MultiTenancySides.Host); + clientPermissions.AddChild(AbpIdentityServerPermissions.Clients.ManageProperties, L("Permissions:ManageProperties"), MultiTenancySides.Host); - // Api资源权限 - var apiResourcePermissions = identityServerGroup.AddPermission(AbpIdentityServerPermissions.ApiResources.Default, L("Permissions:ApiResources"), MultiTenancySides.Host); - apiResourcePermissions.AddChild(AbpIdentityServerPermissions.ApiResources.Create, L("Permissions:Create"), MultiTenancySides.Host); - apiResourcePermissions.AddChild(AbpIdentityServerPermissions.ApiResources.Update, L("Permissions:Update"), MultiTenancySides.Host); - apiResourcePermissions.AddChild(AbpIdentityServerPermissions.ApiResources.Delete, L("Permissions:Delete"), MultiTenancySides.Host); - apiResourcePermissions.AddChild(AbpIdentityServerPermissions.ApiResources.ManageClaims, L("Permissions:ManageClaims"), MultiTenancySides.Host); - apiResourcePermissions.AddChild(AbpIdentityServerPermissions.ApiResources.ManageSecrets, L("Permissions:ManageSecrets"), MultiTenancySides.Host); - apiResourcePermissions.AddChild(AbpIdentityServerPermissions.ApiResources.ManageScopes, L("Permissions:ManageScopes"), MultiTenancySides.Host); - apiResourcePermissions.AddChild(AbpIdentityServerPermissions.ApiResources.ManageProperties, L("Permissions:ManageProperties"), MultiTenancySides.Host); + // Api资源权限 + var apiResourcePermissions = identityServerGroup.AddPermission(AbpIdentityServerPermissions.ApiResources.Default, L("Permissions:ApiResources"), MultiTenancySides.Host); + apiResourcePermissions.AddChild(AbpIdentityServerPermissions.ApiResources.Create, L("Permissions:Create"), MultiTenancySides.Host); + apiResourcePermissions.AddChild(AbpIdentityServerPermissions.ApiResources.Update, L("Permissions:Update"), MultiTenancySides.Host); + apiResourcePermissions.AddChild(AbpIdentityServerPermissions.ApiResources.Delete, L("Permissions:Delete"), MultiTenancySides.Host); + apiResourcePermissions.AddChild(AbpIdentityServerPermissions.ApiResources.ManageClaims, L("Permissions:ManageClaims"), MultiTenancySides.Host); + apiResourcePermissions.AddChild(AbpIdentityServerPermissions.ApiResources.ManageSecrets, L("Permissions:ManageSecrets"), MultiTenancySides.Host); + apiResourcePermissions.AddChild(AbpIdentityServerPermissions.ApiResources.ManageScopes, L("Permissions:ManageScopes"), MultiTenancySides.Host); + apiResourcePermissions.AddChild(AbpIdentityServerPermissions.ApiResources.ManageProperties, L("Permissions:ManageProperties"), MultiTenancySides.Host); - // Api范围权限 - var apiScopePermissions = identityServerGroup.AddPermission(AbpIdentityServerPermissions.ApiScopes.Default, L("Permissions:ApiScopes"), MultiTenancySides.Host); - apiScopePermissions.AddChild(AbpIdentityServerPermissions.ApiScopes.Create, L("Permissions:Create"), MultiTenancySides.Host); - apiScopePermissions.AddChild(AbpIdentityServerPermissions.ApiScopes.Update, L("Permissions:Update"), MultiTenancySides.Host); - apiScopePermissions.AddChild(AbpIdentityServerPermissions.ApiScopes.Delete, L("Permissions:Delete"), MultiTenancySides.Host); - apiScopePermissions.AddChild(AbpIdentityServerPermissions.ApiScopes.ManageClaims, L("Permissions:ManageClaims"), MultiTenancySides.Host); - apiScopePermissions.AddChild(AbpIdentityServerPermissions.ApiScopes.ManageProperties, L("Permissions:ManageProperties"), MultiTenancySides.Host); + // Api范围权限 + var apiScopePermissions = identityServerGroup.AddPermission(AbpIdentityServerPermissions.ApiScopes.Default, L("Permissions:ApiScopes"), MultiTenancySides.Host); + apiScopePermissions.AddChild(AbpIdentityServerPermissions.ApiScopes.Create, L("Permissions:Create"), MultiTenancySides.Host); + apiScopePermissions.AddChild(AbpIdentityServerPermissions.ApiScopes.Update, L("Permissions:Update"), MultiTenancySides.Host); + apiScopePermissions.AddChild(AbpIdentityServerPermissions.ApiScopes.Delete, L("Permissions:Delete"), MultiTenancySides.Host); + apiScopePermissions.AddChild(AbpIdentityServerPermissions.ApiScopes.ManageClaims, L("Permissions:ManageClaims"), MultiTenancySides.Host); + apiScopePermissions.AddChild(AbpIdentityServerPermissions.ApiScopes.ManageProperties, L("Permissions:ManageProperties"), MultiTenancySides.Host); - // 身份资源权限 - var identityResourcePermissions = identityServerGroup.AddPermission(AbpIdentityServerPermissions.IdentityResources.Default, L("Permissions:IdentityResources"), MultiTenancySides.Host); - identityResourcePermissions.AddChild(AbpIdentityServerPermissions.IdentityResources.Create, L("Permissions:Create"), MultiTenancySides.Host); - identityResourcePermissions.AddChild(AbpIdentityServerPermissions.IdentityResources.Update, L("Permissions:Update"), MultiTenancySides.Host); - identityResourcePermissions.AddChild(AbpIdentityServerPermissions.IdentityResources.Delete, L("Permissions:Delete"), MultiTenancySides.Host); - identityResourcePermissions.AddChild(AbpIdentityServerPermissions.IdentityResources.ManageClaims, L("Permissions:ManageClaims"), MultiTenancySides.Host); - identityResourcePermissions.AddChild(AbpIdentityServerPermissions.IdentityResources.ManageProperties, L("Permissions:ManageProperties"), MultiTenancySides.Host); + // 身份资源权限 + var identityResourcePermissions = identityServerGroup.AddPermission(AbpIdentityServerPermissions.IdentityResources.Default, L("Permissions:IdentityResources"), MultiTenancySides.Host); + identityResourcePermissions.AddChild(AbpIdentityServerPermissions.IdentityResources.Create, L("Permissions:Create"), MultiTenancySides.Host); + identityResourcePermissions.AddChild(AbpIdentityServerPermissions.IdentityResources.Update, L("Permissions:Update"), MultiTenancySides.Host); + identityResourcePermissions.AddChild(AbpIdentityServerPermissions.IdentityResources.Delete, L("Permissions:Delete"), MultiTenancySides.Host); + identityResourcePermissions.AddChild(AbpIdentityServerPermissions.IdentityResources.ManageClaims, L("Permissions:ManageClaims"), MultiTenancySides.Host); + identityResourcePermissions.AddChild(AbpIdentityServerPermissions.IdentityResources.ManageProperties, L("Permissions:ManageProperties"), MultiTenancySides.Host); - // 持久授权 - var persistedGrantPermissions = identityServerGroup.AddPermission(AbpIdentityServerPermissions.Grants.Default, L("Permissions:Grants"), MultiTenancySides.Host); - persistedGrantPermissions.AddChild(AbpIdentityServerPermissions.Grants.Delete, L("Permissions:Delete"), MultiTenancySides.Host); - } + // 持久授权 + var persistedGrantPermissions = identityServerGroup.AddPermission(AbpIdentityServerPermissions.Grants.Default, L("Permissions:Grants"), MultiTenancySides.Host); + persistedGrantPermissions.AddChild(AbpIdentityServerPermissions.Grants.Delete, L("Permissions:Delete"), MultiTenancySides.Host); + } - protected virtual LocalizableString L(string name) - { - return LocalizableString.Create(name); - } + protected virtual LocalizableString L(string name) + { + return LocalizableString.Create(name); } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerPermissions.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerPermissions.cs index a8a677af4..674d65597 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerPermissions.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/AbpIdentityServerPermissions.cs @@ -1,58 +1,57 @@ -namespace LINGYUN.Abp.IdentityServer +namespace LINGYUN.Abp.IdentityServer; + +public class AbpIdentityServerPermissions { - public class AbpIdentityServerPermissions - { - public const string GroupName = "AbpIdentityServer"; + public const string GroupName = "AbpIdentityServer"; - public static class Clients - { - public const string Default = GroupName + ".Clients"; - public const string Create = Default + ".Create"; - public const string Update = Default + ".Update"; - public const string Delete = Default + ".Delete"; - public const string Clone = Default + ".Clone"; - public const string ManagePermissions = Default + ".ManagePermissions"; - public const string ManageClaims = Default + ".ManageClaims"; - public const string ManageSecrets = Default + ".ManageSecrets"; - public const string ManageProperties = Default + ".ManageProperties"; - } + public static class Clients + { + public const string Default = GroupName + ".Clients"; + public const string Create = Default + ".Create"; + public const string Update = Default + ".Update"; + public const string Delete = Default + ".Delete"; + public const string Clone = Default + ".Clone"; + public const string ManagePermissions = Default + ".ManagePermissions"; + public const string ManageClaims = Default + ".ManageClaims"; + public const string ManageSecrets = Default + ".ManageSecrets"; + public const string ManageProperties = Default + ".ManageProperties"; + } - public static class ApiResources - { - public const string Default = GroupName + ".ApiResources"; - public const string Create = Default + ".Create"; - public const string Update = Default + ".Update"; - public const string Delete = Default + ".Delete"; - public const string ManageClaims = Default + ".ManageClaims"; - public const string ManageSecrets = Default + ".ManageSecrets"; - public const string ManageScopes = Default + ".ManageScopes"; - public const string ManageProperties = Default + ".ManageProperties"; - } + public static class ApiResources + { + public const string Default = GroupName + ".ApiResources"; + public const string Create = Default + ".Create"; + public const string Update = Default + ".Update"; + public const string Delete = Default + ".Delete"; + public const string ManageClaims = Default + ".ManageClaims"; + public const string ManageSecrets = Default + ".ManageSecrets"; + public const string ManageScopes = Default + ".ManageScopes"; + public const string ManageProperties = Default + ".ManageProperties"; + } - public static class ApiScopes - { - public const string Default = GroupName + ".ApiScopes"; - public const string Create = Default + ".Create"; - public const string Update = Default + ".Update"; - public const string Delete = Default + ".Delete"; - public const string ManageClaims = Default + ".ManageClaims"; - public const string ManageProperties = Default + ".ManageProperties"; - } + public static class ApiScopes + { + public const string Default = GroupName + ".ApiScopes"; + public const string Create = Default + ".Create"; + public const string Update = Default + ".Update"; + public const string Delete = Default + ".Delete"; + public const string ManageClaims = Default + ".ManageClaims"; + public const string ManageProperties = Default + ".ManageProperties"; + } - public static class IdentityResources - { - public const string Default = GroupName + ".IdentityResources"; - public const string Create = Default + ".Create"; - public const string Update = Default + ".Update"; - public const string Delete = Default + ".Delete"; - public const string ManageClaims = Default + ".ManageClaims"; - public const string ManageProperties = Default + ".ManageProperties"; - } + public static class IdentityResources + { + public const string Default = GroupName + ".IdentityResources"; + public const string Create = Default + ".Create"; + public const string Update = Default + ".Update"; + public const string Delete = Default + ".Delete"; + public const string ManageClaims = Default + ".ManageClaims"; + public const string ManageProperties = Default + ".ManageProperties"; + } - public static class Grants - { - public const string Default = GroupName + ".Grants"; - public const string Delete = Default + ".Delete"; - } + public static class Grants + { + public const string Default = GroupName + ".Grants"; + public const string Delete = Default + ".Delete"; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceClaimDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceClaimDto.cs index 551333d0e..8b6653c96 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceClaimDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceClaimDto.cs @@ -1,6 +1,5 @@ -namespace LINGYUN.Abp.IdentityServer.ApiResources +namespace LINGYUN.Abp.IdentityServer.ApiResources; + +public class ApiResourceClaimDto : UserClaimDto { - public class ApiResourceClaimDto : UserClaimDto - { - } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceCreateDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceCreateDto.cs index 419a0fc92..ef3ea6c36 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceCreateDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceCreateDto.cs @@ -2,12 +2,11 @@ using Volo.Abp.IdentityServer.ApiResources; using Volo.Abp.Validation; -namespace LINGYUN.Abp.IdentityServer.ApiResources +namespace LINGYUN.Abp.IdentityServer.ApiResources; + +public class ApiResourceCreateDto : ApiResourceCreateOrUpdateDto { - public class ApiResourceCreateDto : ApiResourceCreateOrUpdateDto - { - [Required] - [DynamicStringLength(typeof(ApiResourceConsts), nameof(ApiResourceConsts.NameMaxLength))] - public string Name { get; set; } - } + [Required] + [DynamicStringLength(typeof(ApiResourceConsts), nameof(ApiResourceConsts.NameMaxLength))] + public string Name { get; set; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceCreateOrUpdateDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceCreateOrUpdateDto.cs index 5aee330c1..73701e5ca 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceCreateOrUpdateDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceCreateOrUpdateDto.cs @@ -2,36 +2,35 @@ using Volo.Abp.IdentityServer.ApiResources; using Volo.Abp.Validation; -namespace LINGYUN.Abp.IdentityServer.ApiResources +namespace LINGYUN.Abp.IdentityServer.ApiResources; + +public class ApiResourceCreateOrUpdateDto { - public class ApiResourceCreateOrUpdateDto - { - [DynamicStringLength(typeof(ApiResourceConsts), nameof(ApiResourceConsts.DisplayNameMaxLength))] - public string DisplayName { get; set; } + [DynamicStringLength(typeof(ApiResourceConsts), nameof(ApiResourceConsts.DisplayNameMaxLength))] + public string DisplayName { get; set; } - [DynamicStringLength(typeof(ApiResourceConsts), nameof(ApiResourceConsts.DescriptionMaxLength))] - public string Description { get; set; } + [DynamicStringLength(typeof(ApiResourceConsts), nameof(ApiResourceConsts.DescriptionMaxLength))] + public string Description { get; set; } - public bool Enabled { get; set; } + public bool Enabled { get; set; } - public string AllowedAccessTokenSigningAlgorithms { get; set; } + public string AllowedAccessTokenSigningAlgorithms { get; set; } - public bool ShowInDiscoveryDocument { get; set; } + public bool ShowInDiscoveryDocument { get; set; } - public List Secrets { get; set; } + public List Secrets { get; set; } - public List Scopes { get; set; } + public List Scopes { get; set; } - public List UserClaims { get; set; } + public List UserClaims { get; set; } - public List Properties { get; set; } + public List Properties { get; set; } - protected ApiResourceCreateOrUpdateDto() - { - UserClaims = new List(); - Scopes = new List(); - Secrets = new List(); - Properties = new List(); - } + protected ApiResourceCreateOrUpdateDto() + { + UserClaims = new List(); + Scopes = new List(); + Secrets = new List(); + Properties = new List(); } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceDto.cs index 806cd6ff1..b0a798136 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceDto.cs @@ -2,36 +2,35 @@ using System.Collections.Generic; using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.IdentityServer.ApiResources +namespace LINGYUN.Abp.IdentityServer.ApiResources; + +public class ApiResourceDto : ExtensibleAuditedEntityDto { - public class ApiResourceDto : ExtensibleAuditedEntityDto - { - public string Name { get; set; } + public string Name { get; set; } - public string DisplayName { get; set; } + public string DisplayName { get; set; } - public string Description { get; set; } + public string Description { get; set; } - public bool Enabled { get; set; } + public bool Enabled { get; set; } - public string AllowedAccessTokenSigningAlgorithms { get; set; } + public string AllowedAccessTokenSigningAlgorithms { get; set; } - public bool ShowInDiscoveryDocument { get; set; } + public bool ShowInDiscoveryDocument { get; set; } - public List Secrets { get; set; } + public List Secrets { get; set; } - public List Scopes { get; set; } + public List Scopes { get; set; } - public List UserClaims { get; set; } + public List UserClaims { get; set; } - public List Properties { get; set; } + public List Properties { get; set; } - public ApiResourceDto() - { - UserClaims = new List(); - Scopes = new List(); - Secrets = new List(); - Properties = new List(); - } + public ApiResourceDto() + { + UserClaims = new List(); + Scopes = new List(); + Secrets = new List(); + Properties = new List(); } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceGetByPagedInputDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceGetByPagedInputDto.cs index b961408af..400b36c9c 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceGetByPagedInputDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceGetByPagedInputDto.cs @@ -1,9 +1,8 @@ using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.IdentityServer.ApiResources +namespace LINGYUN.Abp.IdentityServer.ApiResources; + +public class ApiResourceGetByPagedInputDto : PagedAndSortedResultRequestDto { - public class ApiResourceGetByPagedInputDto : PagedAndSortedResultRequestDto - { - public string Filter { get; set; } - } + public string Filter { get; set; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourcePropertyDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourcePropertyDto.cs index 0df343528..051d21075 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourcePropertyDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourcePropertyDto.cs @@ -1,6 +1,5 @@ -namespace LINGYUN.Abp.IdentityServer.ApiResources +namespace LINGYUN.Abp.IdentityServer.ApiResources; + +public class ApiResourcePropertyDto : PropertyDto { - public class ApiResourcePropertyDto : PropertyDto - { - } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceScopeCreateDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceScopeCreateDto.cs index 03e617120..a2510440c 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceScopeCreateDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceScopeCreateDto.cs @@ -4,34 +4,33 @@ using Volo.Abp.IdentityServer.ApiScopes; using Volo.Abp.Validation; -namespace LINGYUN.Abp.IdentityServer.ApiResources +namespace LINGYUN.Abp.IdentityServer.ApiResources; + +public class ApiResourceScopeCreateDto { - public class ApiResourceScopeCreateDto - { - [Required] - public Guid ApiResourceId { get; set; } + [Required] + public Guid ApiResourceId { get; set; } - [Required] - [DynamicStringLength(typeof(ApiScopeConsts), nameof(ApiScopeConsts.NameMaxLength))] - public string Name { get; set; } + [Required] + [DynamicStringLength(typeof(ApiScopeConsts), nameof(ApiScopeConsts.NameMaxLength))] + public string Name { get; set; } - [DynamicStringLength(typeof(ApiScopeConsts), nameof(ApiScopeConsts.DisplayNameMaxLength))] - public string DisplayName { get; set; } + [DynamicStringLength(typeof(ApiScopeConsts), nameof(ApiScopeConsts.DisplayNameMaxLength))] + public string DisplayName { get; set; } - [DynamicStringLength(typeof(ApiScopeConsts), nameof(ApiScopeConsts.DescriptionMaxLength))] - public string Description { get; set; } + [DynamicStringLength(typeof(ApiScopeConsts), nameof(ApiScopeConsts.DescriptionMaxLength))] + public string Description { get; set; } - public bool Required { get; set; } + public bool Required { get; set; } - public bool Emphasize { get; set; } + public bool Emphasize { get; set; } - public bool ShowInDiscoveryDocument { get; set; } + public bool ShowInDiscoveryDocument { get; set; } - public List UserClaims { get; set; } + public List UserClaims { get; set; } - public ApiResourceScopeCreateDto() - { - UserClaims = new List(); - } + public ApiResourceScopeCreateDto() + { + UserClaims = new List(); } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceScopeDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceScopeDto.cs index 23438c1b1..84b3c1a13 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceScopeDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceScopeDto.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.IdentityServer.ApiResources +namespace LINGYUN.Abp.IdentityServer.ApiResources; + +public class ApiResourceScopeDto { - public class ApiResourceScopeDto - { - public string Scope { get; set; } - } + public string Scope { get; set; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceSecretCreateOrUpdateDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceSecretCreateOrUpdateDto.cs index f4bd29504..3b447b4ce 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceSecretCreateOrUpdateDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceSecretCreateOrUpdateDto.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.IdentityServer.ApiResources +namespace LINGYUN.Abp.IdentityServer.ApiResources; + +public class ApiResourceSecretCreateOrUpdateDto : SecretDto { - public class ApiResourceSecretCreateOrUpdateDto : SecretDto - { - public HashType HashType { get; set; } - } + public HashType HashType { get; set; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceSecretDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceSecretDto.cs index f0abcf862..f3bc10166 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceSecretDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceSecretDto.cs @@ -1,6 +1,5 @@ -namespace LINGYUN.Abp.IdentityServer.ApiResources +namespace LINGYUN.Abp.IdentityServer.ApiResources; + +public class ApiResourceSecretDto : SecretDto { - public class ApiResourceSecretDto : SecretDto - { - } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceUpdateDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceUpdateDto.cs index 1a30104cd..35c81bfaf 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceUpdateDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/Dto/ApiResourceUpdateDto.cs @@ -1,6 +1,5 @@ -namespace LINGYUN.Abp.IdentityServer.ApiResources +namespace LINGYUN.Abp.IdentityServer.ApiResources; + +public class ApiResourceUpdateDto : ApiResourceCreateOrUpdateDto { - public class ApiResourceUpdateDto : ApiResourceCreateOrUpdateDto - { - } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/IApiResourceAppService.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/IApiResourceAppService.cs index 3f34ba2a3..e47f3484d 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/IApiResourceAppService.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiResources/IApiResourceAppService.cs @@ -1,15 +1,14 @@ using System; using Volo.Abp.Application.Services; -namespace LINGYUN.Abp.IdentityServer.ApiResources +namespace LINGYUN.Abp.IdentityServer.ApiResources; + +public interface IApiResourceAppService : + ICrudAppService< + ApiResourceDto, + Guid, + ApiResourceGetByPagedInputDto, + ApiResourceCreateDto, + ApiResourceUpdateDto> { - public interface IApiResourceAppService : - ICrudAppService< - ApiResourceDto, - Guid, - ApiResourceGetByPagedInputDto, - ApiResourceCreateDto, - ApiResourceUpdateDto> - { - } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeClaimDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeClaimDto.cs index 40856b369..0e557e80f 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeClaimDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeClaimDto.cs @@ -1,6 +1,5 @@ -namespace LINGYUN.Abp.IdentityServer.ApiScopes +namespace LINGYUN.Abp.IdentityServer.ApiScopes; + +public class ApiScopeClaimDto : UserClaimDto { - public class ApiScopeClaimDto : UserClaimDto - { - } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeCreateDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeCreateDto.cs index eede72554..9925cd3b6 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeCreateDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeCreateDto.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.IdentityServer.ApiScopes +namespace LINGYUN.Abp.IdentityServer.ApiScopes; + +public class ApiScopeCreateDto : ApiScopeCreateOrUpdateDto { - public class ApiScopeCreateDto : ApiScopeCreateOrUpdateDto - { - public string Name { get; set; } - } + public string Name { get; set; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeCreateOrUpdateDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeCreateOrUpdateDto.cs index bd0945d03..43f25d202 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeCreateOrUpdateDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeCreateOrUpdateDto.cs @@ -1,29 +1,28 @@ using System.Collections.Generic; -namespace LINGYUN.Abp.IdentityServer.ApiScopes +namespace LINGYUN.Abp.IdentityServer.ApiScopes; + +public class ApiScopeCreateOrUpdateDto { - public class ApiScopeCreateOrUpdateDto - { - public bool Enabled { get; set; } + public bool Enabled { get; set; } - public string DisplayName { get; set; } + public string DisplayName { get; set; } - public string Description { get; set; } + public string Description { get; set; } - public bool Required { get; set; } + public bool Required { get; set; } - public bool Emphasize { get; set; } + public bool Emphasize { get; set; } - public bool ShowInDiscoveryDocument { get; set; } + public bool ShowInDiscoveryDocument { get; set; } - public List UserClaims { get; set; } + public List UserClaims { get; set; } - public List Properties { get; set; } + public List Properties { get; set; } - public ApiScopeCreateOrUpdateDto() - { - UserClaims = new List(); - Properties = new List(); - } + public ApiScopeCreateOrUpdateDto() + { + UserClaims = new List(); + Properties = new List(); } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeDto.cs index 8dcac419e..e1560e82d 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeDto.cs @@ -2,32 +2,31 @@ using System.Collections.Generic; using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.IdentityServer.ApiScopes +namespace LINGYUN.Abp.IdentityServer.ApiScopes; + +public class ApiScopeDto : ExtensibleAuditedEntityDto { - public class ApiScopeDto : ExtensibleAuditedEntityDto - { - public bool Enabled { get; set; } + public bool Enabled { get; set; } - public string Name { get; set; } + public string Name { get; set; } - public string DisplayName { get; set; } + public string DisplayName { get; set; } - public string Description { get; set; } + public string Description { get; set; } - public bool Required { get; set; } + public bool Required { get; set; } - public bool Emphasize { get; set; } + public bool Emphasize { get; set; } - public bool ShowInDiscoveryDocument { get; set; } + public bool ShowInDiscoveryDocument { get; set; } - public List UserClaims { get; set; } + public List UserClaims { get; set; } - public List Properties { get; set; } + public List Properties { get; set; } - public ApiScopeDto() - { - UserClaims = new List(); - Properties = new List(); - } + public ApiScopeDto() + { + UserClaims = new List(); + Properties = new List(); } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopePropertyDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopePropertyDto.cs index ace198500..d30efc97a 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopePropertyDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopePropertyDto.cs @@ -1,12 +1,11 @@ using System; using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.IdentityServer.ApiScopes +namespace LINGYUN.Abp.IdentityServer.ApiScopes; + +public class ApiScopePropertyDto : EntityDto { - public class ApiScopePropertyDto : EntityDto - { - public string Key { get; set; } + public string Key { get; set; } - public string Value { get; set; } - } + public string Value { get; set; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeUpdateDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeUpdateDto.cs index 837f117c3..4a7b7968a 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeUpdateDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/ApiScopeUpdateDto.cs @@ -1,6 +1,5 @@ -namespace LINGYUN.Abp.IdentityServer.ApiScopes +namespace LINGYUN.Abp.IdentityServer.ApiScopes; + +public class ApiScopeUpdateDto : ApiScopeCreateOrUpdateDto { - public class ApiScopeUpdateDto : ApiScopeCreateOrUpdateDto - { - } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/GetApiScopeInput.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/GetApiScopeInput.cs index 68e7ead07..466124733 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/GetApiScopeInput.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/Dto/GetApiScopeInput.cs @@ -1,9 +1,8 @@ using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.IdentityServer.ApiScopes +namespace LINGYUN.Abp.IdentityServer.ApiScopes; + +public class GetApiScopeInput : PagedAndSortedResultRequestDto { - public class GetApiScopeInput : PagedAndSortedResultRequestDto - { - public string Filter { get; set; } - } + public string Filter { get; set; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/IApiScopeAppService.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/IApiScopeAppService.cs index 03bdd02e2..58b18b19b 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/IApiScopeAppService.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ApiScopes/IApiScopeAppService.cs @@ -1,15 +1,14 @@ using System; using Volo.Abp.Application.Services; -namespace LINGYUN.Abp.IdentityServer.ApiScopes +namespace LINGYUN.Abp.IdentityServer.ApiScopes; + +public interface IApiScopeAppService : + ICrudAppService< + ApiScopeDto, + Guid, + GetApiScopeInput, + ApiScopeCreateDto, + ApiScopeUpdateDto> { - public interface IApiScopeAppService : - ICrudAppService< - ApiScopeDto, - Guid, - GetApiScopeInput, - ApiScopeCreateDto, - ApiScopeUpdateDto> - { - } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientClaimDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientClaimDto.cs index e25e67164..0cbab909e 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientClaimDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientClaimDto.cs @@ -1,9 +1,8 @@ -namespace LINGYUN.Abp.IdentityServer.Clients +namespace LINGYUN.Abp.IdentityServer.Clients; + +public class ClientClaimDto { - public class ClientClaimDto - { - public string Type { get; set; } + public string Type { get; set; } - public string Value { get; set; } - } + public string Value { get; set; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCloneDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCloneDto.cs index d152779e3..d92aab6df 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCloneDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCloneDto.cs @@ -2,74 +2,73 @@ using Volo.Abp.IdentityServer.Clients; using Volo.Abp.Validation; -namespace LINGYUN.Abp.IdentityServer.Clients +namespace LINGYUN.Abp.IdentityServer.Clients; + +public class ClientCloneDto { - public class ClientCloneDto + /// + /// 客户端标识 + /// + [Required] + [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.ClientIdMaxLength))] + public string ClientId { get; set; } + /// + /// 客户端名称 + /// + [Required] + [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.ClientNameMaxLength))] + public string ClientName { get; set; } + /// + /// 说明 + /// + [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.DescriptionMaxLength))] + public string Description { get; set; } + /// + /// 复制客户端授权类型 + /// + public bool CopyAllowedGrantType { get; set; } + /// + /// 复制客户端重定向 Uri + /// + public bool CopyRedirectUri { get; set; } + /// + /// 复制客户端作用域 + /// + public bool CopyAllowedScope { get; set; } + /// + /// 复制客户端声明 + /// + public bool CopyClaim { get; set; } + /// + /// 复制客户端密钥 + /// + public bool CopySecret { get; set; } + /// + /// 复制客户端跨域来源 + /// + public bool CopyAllowedCorsOrigin { get; set; } + /// + /// 复制客户端注销重定向 Uri + /// + public bool CopyPostLogoutRedirectUri { get; set; } + /// + /// 复制客户端属性 + /// + public bool CopyPropertie { get; set; } + /// + /// 复制客户端 IdP 限制 + /// + public bool CopyIdentityProviderRestriction { get; set; } + public ClientCloneDto() { - /// - /// 客户端标识 - /// - [Required] - [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.ClientIdMaxLength))] - public string ClientId { get; set; } - /// - /// 客户端名称 - /// - [Required] - [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.ClientNameMaxLength))] - public string ClientName { get; set; } - /// - /// 说明 - /// - [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.DescriptionMaxLength))] - public string Description { get; set; } - /// - /// 复制客户端授权类型 - /// - public bool CopyAllowedGrantType { get; set; } - /// - /// 复制客户端重定向 Uri - /// - public bool CopyRedirectUri { get; set; } - /// - /// 复制客户端作用域 - /// - public bool CopyAllowedScope { get; set; } - /// - /// 复制客户端声明 - /// - public bool CopyClaim { get; set; } - /// - /// 复制客户端密钥 - /// - public bool CopySecret { get; set; } - /// - /// 复制客户端跨域来源 - /// - public bool CopyAllowedCorsOrigin { get; set; } - /// - /// 复制客户端注销重定向 Uri - /// - public bool CopyPostLogoutRedirectUri { get; set; } - /// - /// 复制客户端属性 - /// - public bool CopyPropertie { get; set; } - /// - /// 复制客户端 IdP 限制 - /// - public bool CopyIdentityProviderRestriction { get; set; } - public ClientCloneDto() - { - CopyAllowedCorsOrigin = true; - CopyAllowedGrantType = true; - CopyAllowedScope = true; - CopyClaim = true; - CopyIdentityProviderRestriction = true; - CopyPostLogoutRedirectUri = true; - CopyPropertie = true; - CopyRedirectUri = true; - CopySecret = true; - } + CopyAllowedCorsOrigin = true; + CopyAllowedGrantType = true; + CopyAllowedScope = true; + CopyClaim = true; + CopyIdentityProviderRestriction = true; + CopyPostLogoutRedirectUri = true; + CopyPropertie = true; + CopyRedirectUri = true; + CopySecret = true; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCorsOriginDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCorsOriginDto.cs index 68e485d0a..50ed454bb 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCorsOriginDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCorsOriginDto.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.IdentityServer.Clients +namespace LINGYUN.Abp.IdentityServer.Clients; + +public class ClientCorsOriginDto { - public class ClientCorsOriginDto - { - public string Origin { get; set; } - } + public string Origin { get; set; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCreateDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCreateDto.cs index 271ee41b0..5f8c03b35 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCreateDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCreateDto.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.IdentityServer.Clients +namespace LINGYUN.Abp.IdentityServer.Clients; + +public class ClientCreateDto : ClientCreateOrUpdateDto { - public class ClientCreateDto : ClientCreateOrUpdateDto - { - } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCreateOrUpdateDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCreateOrUpdateDto.cs index 6526e8bfb..6b4db72b3 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCreateOrUpdateDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientCreateOrUpdateDto.cs @@ -3,26 +3,25 @@ using Volo.Abp.IdentityServer.Clients; using Volo.Abp.Validation; -namespace LINGYUN.Abp.IdentityServer.Clients +namespace LINGYUN.Abp.IdentityServer.Clients; + +public class ClientCreateOrUpdateDto { - public class ClientCreateOrUpdateDto - { - [Required] - [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.ClientIdMaxLength))] - public string ClientId { get; set; } + [Required] + [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.ClientIdMaxLength))] + public string ClientId { get; set; } - [Required] - [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.ClientNameMaxLength))] - public string ClientName { get; set; } + [Required] + [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.ClientNameMaxLength))] + public string ClientName { get; set; } - [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.DescriptionMaxLength))] - public string Description { get; set; } + [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.DescriptionMaxLength))] + public string Description { get; set; } - public List AllowedGrantTypes { get; set; } + public List AllowedGrantTypes { get; set; } - protected ClientCreateOrUpdateDto() - { - AllowedGrantTypes = new List(); - } + protected ClientCreateOrUpdateDto() + { + AllowedGrantTypes = new List(); } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientDto.cs index ea418b33e..71ed2656e 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientDto.cs @@ -2,118 +2,117 @@ using System.Collections.Generic; using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.IdentityServer.Clients +namespace LINGYUN.Abp.IdentityServer.Clients; + +public class ClientDto : FullAuditedEntityDto { - public class ClientDto : FullAuditedEntityDto - { - public string ClientId { get; set; } + public string ClientId { get; set; } - public string ClientName { get; set; } + public string ClientName { get; set; } - public string Description { get; set; } + public string Description { get; set; } - public string ClientUri { get; set; } + public string ClientUri { get; set; } - public string LogoUri { get; set; } + public string LogoUri { get; set; } - public bool Enabled { get; set; } + public bool Enabled { get; set; } - public string ProtocolType { get; set; } + public string ProtocolType { get; set; } - public bool RequireClientSecret { get; set; } + public bool RequireClientSecret { get; set; } - public bool RequireConsent { get; set; } + public bool RequireConsent { get; set; } - public bool AllowRememberConsent { get; set; } + public bool AllowRememberConsent { get; set; } - public bool RequireRequestObject { get; set; } + public bool RequireRequestObject { get; set; } - public string AllowedIdentityTokenSigningAlgorithms { get; set; } + public string AllowedIdentityTokenSigningAlgorithms { get; set; } - public bool AlwaysIncludeUserClaimsInIdToken { get; set; } + public bool AlwaysIncludeUserClaimsInIdToken { get; set; } - public bool RequirePkce { get; set; } + public bool RequirePkce { get; set; } - public bool AllowPlainTextPkce { get; set; } + public bool AllowPlainTextPkce { get; set; } - public bool AllowAccessTokensViaBrowser { get; set; } + public bool AllowAccessTokensViaBrowser { get; set; } - public string FrontChannelLogoutUri { get; set; } + public string FrontChannelLogoutUri { get; set; } - public bool FrontChannelLogoutSessionRequired { get; set; } + public bool FrontChannelLogoutSessionRequired { get; set; } - public string BackChannelLogoutUri { get; set; } + public string BackChannelLogoutUri { get; set; } - public bool BackChannelLogoutSessionRequired { get; set; } + public bool BackChannelLogoutSessionRequired { get; set; } - public bool AllowOfflineAccess { get; set; } + public bool AllowOfflineAccess { get; set; } - public int IdentityTokenLifetime { get; set; } + public int IdentityTokenLifetime { get; set; } - public int AccessTokenLifetime { get; set; } + public int AccessTokenLifetime { get; set; } - public int AuthorizationCodeLifetime { get; set; } + public int AuthorizationCodeLifetime { get; set; } - public int? ConsentLifetime { get; set; } + public int? ConsentLifetime { get; set; } - public int AbsoluteRefreshTokenLifetime { get; set; } + public int AbsoluteRefreshTokenLifetime { get; set; } - public int SlidingRefreshTokenLifetime { get; set; } + public int SlidingRefreshTokenLifetime { get; set; } - public int RefreshTokenUsage { get; set; } + public int RefreshTokenUsage { get; set; } - public bool UpdateAccessTokenClaimsOnRefresh { get; set; } + public bool UpdateAccessTokenClaimsOnRefresh { get; set; } - public int RefreshTokenExpiration { get; set; } + public int RefreshTokenExpiration { get; set; } - public int AccessTokenType { get; set; } + public int AccessTokenType { get; set; } - public bool EnableLocalLogin { get; set; } + public bool EnableLocalLogin { get; set; } - public bool IncludeJwtId { get; set; } + public bool IncludeJwtId { get; set; } - public bool AlwaysSendClientClaims { get; set; } + public bool AlwaysSendClientClaims { get; set; } - public string ClientClaimsPrefix { get; set; } + public string ClientClaimsPrefix { get; set; } - public string PairWiseSubjectSalt { get; set; } + public string PairWiseSubjectSalt { get; set; } - public int? UserSsoLifetime { get; set; } + public int? UserSsoLifetime { get; set; } - public string UserCodeType { get; set; } + public string UserCodeType { get; set; } - public int DeviceCodeLifetime { get; set; } + public int DeviceCodeLifetime { get; set; } - public string ConcurrencyStamp { get; set; } + public string ConcurrencyStamp { get; set; } - public List AllowedScopes { get; set; } + public List AllowedScopes { get; set; } - public List ClientSecrets { get; set; } + public List ClientSecrets { get; set; } - public List AllowedGrantTypes { get; set; } + public List AllowedGrantTypes { get; set; } - public List AllowedCorsOrigins { get; set; } + public List AllowedCorsOrigins { get; set; } - public List RedirectUris { get; set; } + public List RedirectUris { get; set; } - public List PostLogoutRedirectUris { get; set; } + public List PostLogoutRedirectUris { get; set; } - public List IdentityProviderRestrictions { get; set; } + public List IdentityProviderRestrictions { get; set; } - public List Claims { get; set; } + public List Claims { get; set; } - public List Properties { get; set; } - public ClientDto() - { - Claims = new List(); - Properties = new List(); - AllowedScopes = new List(); - ClientSecrets = new List(); - RedirectUris = new List(); - AllowedGrantTypes = new List(); - AllowedCorsOrigins = new List(); - PostLogoutRedirectUris = new List(); - IdentityProviderRestrictions = new List(); - } + public List Properties { get; set; } + public ClientDto() + { + Claims = new List(); + Properties = new List(); + AllowedScopes = new List(); + ClientSecrets = new List(); + RedirectUris = new List(); + AllowedGrantTypes = new List(); + AllowedCorsOrigins = new List(); + PostLogoutRedirectUris = new List(); + IdentityProviderRestrictions = new List(); } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientGetByPagedDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientGetByPagedDto.cs index 5ccc7c609..eeec7183b 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientGetByPagedDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientGetByPagedDto.cs @@ -1,9 +1,8 @@ using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.IdentityServer.Clients +namespace LINGYUN.Abp.IdentityServer.Clients; + +public class ClientGetByPagedDto : PagedAndSortedResultRequestDto { - public class ClientGetByPagedDto : PagedAndSortedResultRequestDto - { - public string Filter { get; set; } - } + public string Filter { get; set; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientGrantTypeDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientGrantTypeDto.cs index 23184cf93..f9b035a2b 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientGrantTypeDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientGrantTypeDto.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.IdentityServer.Clients +namespace LINGYUN.Abp.IdentityServer.Clients; + +public class ClientGrantTypeDto { - public class ClientGrantTypeDto - { - public string GrantType { get; set; } - } + public string GrantType { get; set; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientIdPRestrictionDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientIdPRestrictionDto.cs index 195c6a670..2edcdac21 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientIdPRestrictionDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientIdPRestrictionDto.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.IdentityServer.Clients +namespace LINGYUN.Abp.IdentityServer.Clients; + +public class ClientIdPRestrictionDto { - public class ClientIdPRestrictionDto - { - public string Provider { get; set; } - } + public string Provider { get; set; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientPostLogoutRedirectUriDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientPostLogoutRedirectUriDto.cs index dac89dc0a..2a9db2001 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientPostLogoutRedirectUriDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientPostLogoutRedirectUriDto.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.IdentityServer.Clients +namespace LINGYUN.Abp.IdentityServer.Clients; + +public class ClientPostLogoutRedirectUriDto { - public class ClientPostLogoutRedirectUriDto - { - public string PostLogoutRedirectUri { get; set; } - } + public string PostLogoutRedirectUri { get; set; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientPropertyDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientPropertyDto.cs index 5b7a44ba8..0b8a45036 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientPropertyDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientPropertyDto.cs @@ -1,6 +1,5 @@ -namespace LINGYUN.Abp.IdentityServer.Clients +namespace LINGYUN.Abp.IdentityServer.Clients; + +public class ClientPropertyDto : PropertyDto { - public class ClientPropertyDto : PropertyDto - { - } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientRedirectUriDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientRedirectUriDto.cs index 12e669182..3e555e678 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientRedirectUriDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientRedirectUriDto.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.IdentityServer.Clients +namespace LINGYUN.Abp.IdentityServer.Clients; + +public class ClientRedirectUriDto { - public class ClientRedirectUriDto - { - public string RedirectUri { get; set; } - } + public string RedirectUri { get; set; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientScopeDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientScopeDto.cs index f5d54f170..96fedff63 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientScopeDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientScopeDto.cs @@ -1,6 +1,5 @@ -namespace LINGYUN.Abp.IdentityServer.Clients +namespace LINGYUN.Abp.IdentityServer.Clients; + +public class ClientScopeDto : ScopeDto { - public class ClientScopeDto : ScopeDto - { - } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientSecretDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientSecretDto.cs index c43de47ea..92aa9a4bf 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientSecretDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientSecretDto.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.IdentityServer.Clients +namespace LINGYUN.Abp.IdentityServer.Clients; + +public class ClientSecretDto : SecretDto { - public class ClientSecretDto : SecretDto - { - } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientUpdateDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientUpdateDto.cs index 0f0523a86..1ba5d5ce8 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientUpdateDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/ClientUpdateDto.cs @@ -2,122 +2,121 @@ using Volo.Abp.IdentityServer.Clients; using Volo.Abp.Validation; -namespace LINGYUN.Abp.IdentityServer.Clients +namespace LINGYUN.Abp.IdentityServer.Clients; + +public class ClientUpdateDto : ClientCreateOrUpdateDto { - public class ClientUpdateDto : ClientCreateOrUpdateDto - { - [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.ClientUriMaxLength))] - public string ClientUri { get; set; } + [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.ClientUriMaxLength))] + public string ClientUri { get; set; } - [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.LogoUriMaxLength))] - public string LogoUri { get; set; } + [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.LogoUriMaxLength))] + public string LogoUri { get; set; } - public bool Enabled { get; set; } + public bool Enabled { get; set; } - [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.ProtocolTypeMaxLength))] - public string ProtocolType { get; set; } + [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.ProtocolTypeMaxLength))] + public string ProtocolType { get; set; } - public bool RequireClientSecret { get; set; } + public bool RequireClientSecret { get; set; } - [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.AllowedIdentityTokenSigningAlgorithms))] - public string AllowedIdentityTokenSigningAlgorithms { get; set; } + [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.AllowedIdentityTokenSigningAlgorithms))] + public string AllowedIdentityTokenSigningAlgorithms { get; set; } - public bool RequireConsent { get; set; } = false; + public bool RequireConsent { get; set; } = false; - public bool RequireRequestObject { get; set; } + public bool RequireRequestObject { get; set; } - public bool AllowRememberConsent { get; set; } + public bool AllowRememberConsent { get; set; } - public bool AlwaysIncludeUserClaimsInIdToken { get; set; } + public bool AlwaysIncludeUserClaimsInIdToken { get; set; } - public bool RequirePkce { get; set; } = true; + public bool RequirePkce { get; set; } = true; - public bool AllowPlainTextPkce { get; set; } + public bool AllowPlainTextPkce { get; set; } - public bool AllowAccessTokensViaBrowser { get; set; } + public bool AllowAccessTokensViaBrowser { get; set; } - [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.FrontChannelLogoutUriMaxLength))] - public string FrontChannelLogoutUri { get; set; } + [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.FrontChannelLogoutUriMaxLength))] + public string FrontChannelLogoutUri { get; set; } - public bool FrontChannelLogoutSessionRequired { get; set; } + public bool FrontChannelLogoutSessionRequired { get; set; } - [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.BackChannelLogoutUriMaxLength))] - public string BackChannelLogoutUri { get; set; } + [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.BackChannelLogoutUriMaxLength))] + public string BackChannelLogoutUri { get; set; } - public bool BackChannelLogoutSessionRequired { get; set; } + public bool BackChannelLogoutSessionRequired { get; set; } - public bool AllowOfflineAccess { get; set; } + public bool AllowOfflineAccess { get; set; } - public int IdentityTokenLifetime { get; set; } + public int IdentityTokenLifetime { get; set; } - public int AccessTokenLifetime { get; set; } + public int AccessTokenLifetime { get; set; } - public int AuthorizationCodeLifetime { get; set; } + public int AuthorizationCodeLifetime { get; set; } - public int? ConsentLifetime { get; set; } + public int? ConsentLifetime { get; set; } - public int AbsoluteRefreshTokenLifetime { get; set; } + public int AbsoluteRefreshTokenLifetime { get; set; } - public int SlidingRefreshTokenLifetime { get; set; } + public int SlidingRefreshTokenLifetime { get; set; } - public int RefreshTokenUsage { get; set; } + public int RefreshTokenUsage { get; set; } - public bool UpdateAccessTokenClaimsOnRefresh { get; set; } + public bool UpdateAccessTokenClaimsOnRefresh { get; set; } - public int RefreshTokenExpiration { get; set; } + public int RefreshTokenExpiration { get; set; } - public int AccessTokenType { get; set; } + public int AccessTokenType { get; set; } - public bool EnableLocalLogin { get; set; } + public bool EnableLocalLogin { get; set; } - public bool IncludeJwtId { get; set; } + public bool IncludeJwtId { get; set; } - public bool AlwaysSendClientClaims { get; set; } + public bool AlwaysSendClientClaims { get; set; } - [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.ClientClaimsPrefixMaxLength))] - public string ClientClaimsPrefix { get; set; } + [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.ClientClaimsPrefixMaxLength))] + public string ClientClaimsPrefix { get; set; } - [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.PairWiseSubjectSaltMaxLength))] - public string PairWiseSubjectSalt { get; set; } + [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.PairWiseSubjectSaltMaxLength))] + public string PairWiseSubjectSalt { get; set; } - public int? UserSsoLifetime { get; set; } + public int? UserSsoLifetime { get; set; } - [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.UserCodeTypeMaxLength))] - public string UserCodeType { get; set; } + [DynamicStringLength(typeof(ClientConsts), nameof(ClientConsts.UserCodeTypeMaxLength))] + public string UserCodeType { get; set; } - public int DeviceCodeLifetime { get; set; } + public int DeviceCodeLifetime { get; set; } - public List AllowedScopes { get; set; } + public List AllowedScopes { get; set; } - public List ClientSecrets { get; set; } + public List ClientSecrets { get; set; } - public List AllowedCorsOrigins { get; set; } + public List AllowedCorsOrigins { get; set; } - public List RedirectUris { get; set; } + public List RedirectUris { get; set; } - public List PostLogoutRedirectUris { get; set; } + public List PostLogoutRedirectUris { get; set; } - public List IdentityProviderRestrictions { get; set; } + public List IdentityProviderRestrictions { get; set; } - public List Properties { get; set; } - /// - /// 声明 - /// - public List Claims { get; set; } + public List Properties { get; set; } + /// + /// 声明 + /// + public List Claims { get; set; } - public ClientUpdateDto() - { - Enabled = true; - DeviceCodeLifetime = 300; - AllowedScopes = new List(); - RedirectUris = new List(); - AllowedCorsOrigins = new List(); - PostLogoutRedirectUris = new List(); - IdentityProviderRestrictions = new List(); - Properties = new List(); - ClientSecrets = new List(); - Claims = new List(); - } + public ClientUpdateDto() + { + Enabled = true; + DeviceCodeLifetime = 300; + AllowedScopes = new List(); + RedirectUris = new List(); + AllowedCorsOrigins = new List(); + PostLogoutRedirectUris = new List(); + IdentityProviderRestrictions = new List(); + Properties = new List(); + ClientSecrets = new List(); + Claims = new List(); } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/SecretCreateOrUpdateDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/SecretCreateOrUpdateDto.cs index 3afda584f..30341ae04 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/SecretCreateOrUpdateDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/Dto/SecretCreateOrUpdateDto.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.IdentityServer.Clients +namespace LINGYUN.Abp.IdentityServer.Clients; + +public class SecretCreateOrUpdateDto : SecretDto { - public class SecretCreateOrUpdateDto : SecretDto - { - public HashType HashType { get; set; } - } + public HashType HashType { get; set; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/IClientAppService.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/IClientAppService.cs index 48496ee74..4e7145db2 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/IClientAppService.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Clients/IClientAppService.cs @@ -3,22 +3,21 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; -namespace LINGYUN.Abp.IdentityServer.Clients +namespace LINGYUN.Abp.IdentityServer.Clients; + +public interface IClientAppService : + ICrudAppService< + ClientDto, + Guid, + ClientGetByPagedDto, + ClientCreateDto, + ClientUpdateDto> { - public interface IClientAppService : - ICrudAppService< - ClientDto, - Guid, - ClientGetByPagedDto, - ClientCreateDto, - ClientUpdateDto> - { - Task CloneAsync(Guid id, ClientCloneDto input); + Task CloneAsync(Guid id, ClientCloneDto input); - Task> GetAssignableApiResourcesAsync(); + Task> GetAssignableApiResourcesAsync(); - Task> GetAssignableIdentityResourcesAsync(); + Task> GetAssignableIdentityResourcesAsync(); - Task> GetAllDistinctAllowedCorsOriginsAsync(); - } + Task> GetAllDistinctAllowedCorsOriginsAsync(); } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Devices/Dto/DeviceFlowCodesDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Devices/Dto/DeviceFlowCodesDto.cs index b62f2ef46..456473a1d 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Devices/Dto/DeviceFlowCodesDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Devices/Dto/DeviceFlowCodesDto.cs @@ -1,24 +1,23 @@ using System; using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.IdentityServer.Devices +namespace LINGYUN.Abp.IdentityServer.Devices; + +public class DeviceFlowCodesDto : ExtensibleCreationAuditedEntityDto { - public class DeviceFlowCodesDto : ExtensibleCreationAuditedEntityDto - { - public string DeviceCode { get; set; } + public string DeviceCode { get; set; } - public string UserCode { get; set; } + public string UserCode { get; set; } - public string SubjectId { get; set; } + public string SubjectId { get; set; } - public string SessionId { get; set; } + public string SessionId { get; set; } - public string ClientId { get; set; } + public string ClientId { get; set; } - public string Description { get; set; } + public string Description { get; set; } - public DateTime? Expiration { get; set; } + public DateTime? Expiration { get; set; } - public string Data { get; set; } - } + public string Data { get; set; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Grants/Dto/GetPersistedGrantInput.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Grants/Dto/GetPersistedGrantInput.cs index a473f9770..d7e9ead8c 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Grants/Dto/GetPersistedGrantInput.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Grants/Dto/GetPersistedGrantInput.cs @@ -1,10 +1,9 @@ using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.IdentityServer.Grants +namespace LINGYUN.Abp.IdentityServer.Grants; + +public class GetPersistedGrantInput : PagedAndSortedResultRequestDto { - public class GetPersistedGrantInput : PagedAndSortedResultRequestDto - { - public string Filter { get; set; } - public string SubjectId { get; set; } - } + public string Filter { get; set; } + public string SubjectId { get; set; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Grants/Dto/PersistedGrantDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Grants/Dto/PersistedGrantDto.cs index 9b1352044..d17c2d661 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Grants/Dto/PersistedGrantDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Grants/Dto/PersistedGrantDto.cs @@ -1,28 +1,27 @@ using System; using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.IdentityServer.Grants +namespace LINGYUN.Abp.IdentityServer.Grants; + +public class PersistedGrantDto : ExtensibleEntityDto { - public class PersistedGrantDto : ExtensibleEntityDto - { - public string Key { get; set; } + public string Key { get; set; } - public string Type { get; set; } + public string Type { get; set; } - public string SubjectId { get; set; } + public string SubjectId { get; set; } - public string SessionId { get; set; } + public string SessionId { get; set; } - public string Description { get; set; } + public string Description { get; set; } - public DateTime? ConsumedTime { get; set; } + public DateTime? ConsumedTime { get; set; } - public string ClientId { get; set; } + public string ClientId { get; set; } - public DateTime CreationTime { get; set; } + public DateTime CreationTime { get; set; } - public DateTime? Expiration { get; set; } + public DateTime? Expiration { get; set; } - public string Data { get; set; } - } + public string Data { get; set; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Grants/IPersistedGrantAppService.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Grants/IPersistedGrantAppService.cs index 6343f9f61..7b62b882b 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Grants/IPersistedGrantAppService.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/Grants/IPersistedGrantAppService.cs @@ -1,12 +1,11 @@ using System; using Volo.Abp.Application.Services; -namespace LINGYUN.Abp.IdentityServer.Grants +namespace LINGYUN.Abp.IdentityServer.Grants; + +public interface IPersistedGrantAppService : + IReadOnlyAppService, + IDeleteAppService { - public interface IPersistedGrantAppService : - IReadOnlyAppService, - IDeleteAppService - { - } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/HashType.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/HashType.cs index b012beea2..6f8b7342d 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/HashType.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/HashType.cs @@ -1,8 +1,7 @@ -namespace LINGYUN.Abp.IdentityServer +namespace LINGYUN.Abp.IdentityServer; + +public enum HashType { - public enum HashType - { - Sha256, - Sha512 - } + Sha256, + Sha512 } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceClaimDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceClaimDto.cs index 1f37d1b91..7c11112d4 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceClaimDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceClaimDto.cs @@ -1,6 +1,5 @@ -namespace LINGYUN.Abp.IdentityServer.IdentityResources +namespace LINGYUN.Abp.IdentityServer.IdentityResources; + +public class IdentityResourceClaimDto : UserClaimDto { - public class IdentityResourceClaimDto : UserClaimDto - { - } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceCreateOrUpdateDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceCreateOrUpdateDto.cs index a53c7840b..1d87e0c3d 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceCreateOrUpdateDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceCreateOrUpdateDto.cs @@ -3,40 +3,39 @@ using Volo.Abp.IdentityServer.IdentityResources; using Volo.Abp.Validation; -namespace LINGYUN.Abp.IdentityServer.IdentityResources +namespace LINGYUN.Abp.IdentityServer.IdentityResources; + +public class IdentityResourceCreateOrUpdateDto { - public class IdentityResourceCreateOrUpdateDto - { - [Required] - [DynamicStringLength(typeof(IdentityResourceConsts), nameof(IdentityResourceConsts.NameMaxLength))] - public string Name { get; set; } + [Required] + [DynamicStringLength(typeof(IdentityResourceConsts), nameof(IdentityResourceConsts.NameMaxLength))] + public string Name { get; set; } - [DynamicStringLength(typeof(IdentityResourceConsts), nameof(IdentityResourceConsts.DisplayNameMaxLength))] - public string DisplayName { get; set; } + [DynamicStringLength(typeof(IdentityResourceConsts), nameof(IdentityResourceConsts.DisplayNameMaxLength))] + public string DisplayName { get; set; } - [DynamicStringLength(typeof(IdentityResourceConsts), nameof(IdentityResourceConsts.DescriptionMaxLength))] - public string Description { get; set; } + [DynamicStringLength(typeof(IdentityResourceConsts), nameof(IdentityResourceConsts.DescriptionMaxLength))] + public string Description { get; set; } - public bool Enabled { get; set; } + public bool Enabled { get; set; } - public bool Required { get; set; } + public bool Required { get; set; } - public bool Emphasize { get; set; } + public bool Emphasize { get; set; } - public bool ShowInDiscoveryDocument { get; set; } + public bool ShowInDiscoveryDocument { get; set; } - public List UserClaims { get; set; } + public List UserClaims { get; set; } - public List Properties { get; set; } + public List Properties { get; set; } - public IdentityResourceCreateOrUpdateDto() - { - UserClaims = new List(); - Properties = new List(); + public IdentityResourceCreateOrUpdateDto() + { + UserClaims = new List(); + Properties = new List(); - Enabled = true; - Required = false; - ShowInDiscoveryDocument = false; - } + Enabled = true; + Required = false; + ShowInDiscoveryDocument = false; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceDto.cs index 9b079e262..e6e5ca4f0 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceDto.cs @@ -2,32 +2,31 @@ using System.Collections.Generic; using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.IdentityServer.IdentityResources +namespace LINGYUN.Abp.IdentityServer.IdentityResources; + +public class IdentityResourceDto : ExtensibleAuditedEntityDto { - public class IdentityResourceDto : ExtensibleAuditedEntityDto - { - public string Name { get; set; } - - public string DisplayName { get; set; } - - public string Description { get; set; } + public string Name { get; set; } + + public string DisplayName { get; set; } + + public string Description { get; set; } - public bool Enabled { get; set; } + public bool Enabled { get; set; } - public bool Required { get; set; } + public bool Required { get; set; } - public bool Emphasize { get; set; } + public bool Emphasize { get; set; } - public bool ShowInDiscoveryDocument { get; set; } + public bool ShowInDiscoveryDocument { get; set; } - public List UserClaims { get; set; } + public List UserClaims { get; set; } - public List Properties { get; set; } + public List Properties { get; set; } - public IdentityResourceDto() - { - UserClaims = new List(); - Properties = new List(); - } + public IdentityResourceDto() + { + UserClaims = new List(); + Properties = new List(); } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceGetByPagedDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceGetByPagedDto.cs index 555e4fa01..e4409ff32 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceGetByPagedDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourceGetByPagedDto.cs @@ -1,9 +1,8 @@ using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.IdentityServer.IdentityResources +namespace LINGYUN.Abp.IdentityServer.IdentityResources; + +public class IdentityResourceGetByPagedDto : PagedAndSortedResultRequestDto { - public class IdentityResourceGetByPagedDto : PagedAndSortedResultRequestDto - { - public string Filter { get; set; } - } + public string Filter { get; set; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourcePropertyDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourcePropertyDto.cs index 142610026..c91456fb0 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourcePropertyDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/Dto/IdentityResourcePropertyDto.cs @@ -1,6 +1,5 @@ -namespace LINGYUN.Abp.IdentityServer.IdentityResources +namespace LINGYUN.Abp.IdentityServer.IdentityResources; + +public class IdentityResourcePropertyDto : PropertyDto { - public class IdentityResourcePropertyDto : PropertyDto - { - } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/IIdentityResourceAppService.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/IIdentityResourceAppService.cs index 1c8bc665e..ed05c48f5 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/IIdentityResourceAppService.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/IdentityResources/IIdentityResourceAppService.cs @@ -1,16 +1,15 @@ using System; using Volo.Abp.Application.Services; -namespace LINGYUN.Abp.IdentityServer.IdentityResources +namespace LINGYUN.Abp.IdentityServer.IdentityResources; + +public interface IIdentityResourceAppService : + ICrudAppService< + IdentityResourceDto, + Guid, + IdentityResourceGetByPagedDto, + IdentityResourceCreateOrUpdateDto, + IdentityResourceCreateOrUpdateDto + > { - public interface IIdentityResourceAppService : - ICrudAppService< - IdentityResourceDto, - Guid, - IdentityResourceGetByPagedDto, - IdentityResourceCreateOrUpdateDto, - IdentityResourceCreateOrUpdateDto - > - { - } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/PropertyDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/PropertyDto.cs index cbcae7426..604d34790 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/PropertyDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/PropertyDto.cs @@ -1,9 +1,8 @@ -namespace LINGYUN.Abp.IdentityServer +namespace LINGYUN.Abp.IdentityServer; + +public class PropertyDto { - public class PropertyDto - { - public string Key { get; set; } + public string Key { get; set; } - public string Value { get; set; } - } + public string Value { get; set; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ScopeDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ScopeDto.cs index e90e000b7..03e15c773 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ScopeDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/ScopeDto.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.IdentityServer +namespace LINGYUN.Abp.IdentityServer; + +public class ScopeDto { - public class ScopeDto - { - public string Scope { get; set; } - } + public string Scope { get; set; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/SecretDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/SecretDto.cs index 999213855..10135ea95 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/SecretDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/SecretDto.cs @@ -1,16 +1,15 @@ using System; using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.IdentityServer +namespace LINGYUN.Abp.IdentityServer; + +public class SecretDto { - public class SecretDto - { - public string Type { get; set; } + public string Type { get; set; } - public string Value { get; set; } + public string Value { get; set; } - public string Description { get; set; } + public string Description { get; set; } - public DateTime? Expiration { get; set; } - } + public DateTime? Expiration { get; set; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/UserClaimDto.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/UserClaimDto.cs index c94b5b012..b1f85ba14 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/UserClaimDto.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application.Contracts/LINGYUN/Abp/IdentityServer/UserClaimDto.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.IdentityServer +namespace LINGYUN.Abp.IdentityServer; + +public class UserClaimDto { - public class UserClaimDto - { - public string Type { get; set; } - } + public string Type { get; set; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN.Abp.IdentityServer.Application.csproj b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN.Abp.IdentityServer.Application.csproj index 778b7845e..2fc18f150 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN.Abp.IdentityServer.Application.csproj +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN.Abp.IdentityServer.Application.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.IdentityServer.Application + LINGYUN.Abp.IdentityServer.Application + false + false + false diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/AbpIdentityServerAppServiceBase.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/AbpIdentityServerAppServiceBase.cs index 5a88310e1..6c85941cd 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/AbpIdentityServerAppServiceBase.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/AbpIdentityServerAppServiceBase.cs @@ -3,19 +3,18 @@ using Volo.Abp.Authorization.Permissions; using Volo.Abp.IdentityServer.Localization; -namespace LINGYUN.Abp.IdentityServer +namespace LINGYUN.Abp.IdentityServer; + +public abstract class AbpIdentityServerAppServiceBase : ApplicationService { - public abstract class AbpIdentityServerAppServiceBase : ApplicationService + protected IPermissionChecker PermissionChecker => LazyServiceProvider.LazyGetRequiredService(); + protected AbpIdentityServerAppServiceBase() { - protected IPermissionChecker PermissionChecker => LazyServiceProvider.LazyGetRequiredService(); - protected AbpIdentityServerAppServiceBase() - { - LocalizationResource = typeof(AbpIdentityServerResource); - } + LocalizationResource = typeof(AbpIdentityServerResource); + } - protected async virtual Task IsGrantAsync(string policy) - { - return await PermissionChecker.IsGrantedAsync(policy); - } + protected async virtual Task IsGrantAsync(string policy) + { + return await PermissionChecker.IsGrantedAsync(policy); } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/AbpIdentityServerApplicationModule.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/AbpIdentityServerApplicationModule.cs index 2b920d423..7cf85ccfe 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/AbpIdentityServerApplicationModule.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/AbpIdentityServerApplicationModule.cs @@ -2,25 +2,24 @@ using Volo.Abp.AutoMapper; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.IdentityServer +namespace LINGYUN.Abp.IdentityServer; + +[DependsOn( + typeof(AbpIdentityServerApplicationContractsModule), + typeof(AbpIdentityServerDomainModule), + typeof(AbpDddApplicationModule), + typeof(AbpAutoMapperModule) + )] +public class AbpIdentityServerApplicationModule : AbpModule { - [DependsOn( - typeof(AbpIdentityServerApplicationContractsModule), - typeof(AbpIdentityServerDomainModule), - typeof(AbpDddApplicationModule), - typeof(AbpAutoMapperModule) - )] - public class AbpIdentityServerApplicationModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + Configure(options => { - Configure(options => + options.Configurators.Add(ctx => { - options.Configurators.Add(ctx => - { - ctx.MapperConfiguration.AddProfile(); - }); + ctx.MapperConfiguration.AddProfile(); }); - } + }); } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/AbpIdentityServerAutoMapperProfile.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/AbpIdentityServerAutoMapperProfile.cs index 9461f2e19..7839e78d7 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/AbpIdentityServerAutoMapperProfile.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/AbpIdentityServerAutoMapperProfile.cs @@ -10,48 +10,47 @@ using Volo.Abp.IdentityServer.Grants; using Volo.Abp.IdentityServer.IdentityResources; -namespace LINGYUN.Abp.IdentityServer +namespace LINGYUN.Abp.IdentityServer; + +public class AbpIdentityServerAutoMapperProfile : Profile { - public class AbpIdentityServerAutoMapperProfile : Profile + public AbpIdentityServerAutoMapperProfile() { - public AbpIdentityServerAutoMapperProfile() - { - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - //.ForMember(dto => dto.AllowedCorsOrigins, map => map.MapFrom(client => client.AllowedCorsOrigins.Select(origin => origin.Origin).ToList())) - //.ForMember(dto => dto.AllowedGrantTypes, map => map.MapFrom(client => client.AllowedGrantTypes.Select(grantType => grantType.GrantType).ToList())) - //.ForMember(dto => dto.AllowedScopes, map => map.MapFrom(client => client.AllowedScopes.Select(scope => scope.Scope).ToList())) - //.ForMember(dto => dto.IdentityProviderRestrictions, map => map.MapFrom(client => client.IdentityProviderRestrictions.Select(provider => provider.Provider).ToList())) - //.ForMember(dto => dto.PostLogoutRedirectUris, map => map.MapFrom(client => client.PostLogoutRedirectUris.Select(uri => uri.PostLogoutRedirectUri).ToList())) - //.ForMember(dto => dto.RedirectUris, map => map.MapFrom(client => client.RedirectUris.Select(uri => uri.RedirectUri).ToList())); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + //.ForMember(dto => dto.AllowedCorsOrigins, map => map.MapFrom(client => client.AllowedCorsOrigins.Select(origin => origin.Origin).ToList())) + //.ForMember(dto => dto.AllowedGrantTypes, map => map.MapFrom(client => client.AllowedGrantTypes.Select(grantType => grantType.GrantType).ToList())) + //.ForMember(dto => dto.AllowedScopes, map => map.MapFrom(client => client.AllowedScopes.Select(scope => scope.Scope).ToList())) + //.ForMember(dto => dto.IdentityProviderRestrictions, map => map.MapFrom(client => client.IdentityProviderRestrictions.Select(provider => provider.Provider).ToList())) + //.ForMember(dto => dto.PostLogoutRedirectUris, map => map.MapFrom(client => client.PostLogoutRedirectUris.Select(uri => uri.PostLogoutRedirectUri).ToList())) + //.ForMember(dto => dto.RedirectUris, map => map.MapFrom(client => client.RedirectUris.Select(uri => uri.RedirectUri).ToList())); - // CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); + // CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap() - .MapExtraProperties(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap() + .MapExtraProperties(); - CreateMap(); - CreateMap(); - CreateMap() - .MapExtraProperties(); + CreateMap(); + CreateMap(); + CreateMap() + .MapExtraProperties(); - CreateMap() - .MapExtraProperties(); - } + CreateMap() + .MapExtraProperties(); } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/ApiResources/ApiResourceAppService.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/ApiResources/ApiResourceAppService.cs index 5297b3348..211bfa942 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/ApiResources/ApiResourceAppService.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/ApiResources/ApiResourceAppService.cs @@ -9,177 +9,176 @@ using Volo.Abp.Application.Dtos; using ApiResource = Volo.Abp.IdentityServer.ApiResources.ApiResource; -namespace LINGYUN.Abp.IdentityServer.ApiResources +namespace LINGYUN.Abp.IdentityServer.ApiResources; + +[Authorize(AbpIdentityServerPermissions.ApiResources.Default)] +public class ApiResourceAppService : AbpIdentityServerAppServiceBase, IApiResourceAppService { - [Authorize(AbpIdentityServerPermissions.ApiResources.Default)] - public class ApiResourceAppService : AbpIdentityServerAppServiceBase, IApiResourceAppService + protected IApiResourceRepository ApiResourceRepository { get; } + + public ApiResourceAppService( + IApiResourceRepository apiResourceRepository) { - protected IApiResourceRepository ApiResourceRepository { get; } + ApiResourceRepository = apiResourceRepository; + } - public ApiResourceAppService( - IApiResourceRepository apiResourceRepository) - { - ApiResourceRepository = apiResourceRepository; - } + public async virtual Task GetAsync(Guid id) + { + var apiResource = await ApiResourceRepository.GetAsync(id); - public async virtual Task GetAsync(Guid id) - { - var apiResource = await ApiResourceRepository.GetAsync(id); + return ObjectMapper.Map(apiResource); + } - return ObjectMapper.Map(apiResource); - } + public async virtual Task> GetListAsync(ApiResourceGetByPagedInputDto input) + { + var apiResources = await ApiResourceRepository.GetListAsync(input.Sorting, + input.SkipCount, input.MaxResultCount, + input.Filter); + // 未加Filter过滤器? 结果数不准 + var apiResourceCount = await ApiResourceRepository.GetCountAsync(input.Filter); + + return new PagedResultDto(apiResourceCount, + ObjectMapper.Map, List>(apiResources)); + } - public async virtual Task> GetListAsync(ApiResourceGetByPagedInputDto input) + [Authorize(AbpIdentityServerPermissions.ApiResources.Create)] + public async virtual Task CreateAsync(ApiResourceCreateDto input) + { + var apiResourceExists = await ApiResourceRepository.CheckNameExistAsync(input.Name); + if (apiResourceExists) { - var apiResources = await ApiResourceRepository.GetListAsync(input.Sorting, - input.SkipCount, input.MaxResultCount, - input.Filter); - // 未加Filter过滤器? 结果数不准 - var apiResourceCount = await ApiResourceRepository.GetCountAsync(input.Filter); - - return new PagedResultDto(apiResourceCount, - ObjectMapper.Map, List>(apiResources)); + throw new UserFriendlyException(L[AbpIdentityServerErrorConsts.ApiResourceNameExisted, input.Name]); } + var apiResource = new ApiResource( + GuidGenerator.Create(), + input.Name, + input.DisplayName, + input.Description); - [Authorize(AbpIdentityServerPermissions.ApiResources.Create)] - public async virtual Task CreateAsync(ApiResourceCreateDto input) - { - var apiResourceExists = await ApiResourceRepository.CheckNameExistAsync(input.Name); - if (apiResourceExists) - { - throw new UserFriendlyException(L[AbpIdentityServerErrorConsts.ApiResourceNameExisted, input.Name]); - } - var apiResource = new ApiResource( - GuidGenerator.Create(), - input.Name, - input.DisplayName, - input.Description); + await UpdateApiResourceByInputAsync(apiResource, input); - await UpdateApiResourceByInputAsync(apiResource, input); + apiResource = await ApiResourceRepository.InsertAsync(apiResource); - apiResource = await ApiResourceRepository.InsertAsync(apiResource); + await CurrentUnitOfWork.SaveChangesAsync(); - await CurrentUnitOfWork.SaveChangesAsync(); + return ObjectMapper.Map(apiResource); + } - return ObjectMapper.Map(apiResource); - } + [Authorize(AbpIdentityServerPermissions.ApiResources.Update)] + public async virtual Task UpdateAsync(Guid id, ApiResourceUpdateDto input) + { + var apiResource = await ApiResourceRepository.GetAsync(id); - [Authorize(AbpIdentityServerPermissions.ApiResources.Update)] - public async virtual Task UpdateAsync(Guid id, ApiResourceUpdateDto input) - { - var apiResource = await ApiResourceRepository.GetAsync(id); + await UpdateApiResourceByInputAsync(apiResource, input); - await UpdateApiResourceByInputAsync(apiResource, input); + apiResource = await ApiResourceRepository.UpdateAsync(apiResource); - apiResource = await ApiResourceRepository.UpdateAsync(apiResource); + await CurrentUnitOfWork.SaveChangesAsync(); - await CurrentUnitOfWork.SaveChangesAsync(); + return ObjectMapper.Map(apiResource); + } - return ObjectMapper.Map(apiResource); - } + [Authorize(AbpIdentityServerPermissions.ApiResources.Delete)] + public async virtual Task DeleteAsync(Guid id) + { + var apiResource = await ApiResourceRepository.GetAsync(id); + await ApiResourceRepository.DeleteAsync(apiResource); - [Authorize(AbpIdentityServerPermissions.ApiResources.Delete)] - public async virtual Task DeleteAsync(Guid id) - { - var apiResource = await ApiResourceRepository.GetAsync(id); - await ApiResourceRepository.DeleteAsync(apiResource); + await CurrentUnitOfWork.SaveChangesAsync(); + } - await CurrentUnitOfWork.SaveChangesAsync(); - } + protected async virtual Task UpdateApiResourceByInputAsync(ApiResource apiResource, ApiResourceCreateOrUpdateDto input) + { + apiResource.ShowInDiscoveryDocument = input.ShowInDiscoveryDocument; + apiResource.Enabled = input.Enabled; - protected async virtual Task UpdateApiResourceByInputAsync(ApiResource apiResource, ApiResourceCreateOrUpdateDto input) + if (!string.Equals(apiResource.AllowedAccessTokenSigningAlgorithms, input.AllowedAccessTokenSigningAlgorithms, StringComparison.InvariantCultureIgnoreCase)) { - apiResource.ShowInDiscoveryDocument = input.ShowInDiscoveryDocument; - apiResource.Enabled = input.Enabled; - - if (!string.Equals(apiResource.AllowedAccessTokenSigningAlgorithms, input.AllowedAccessTokenSigningAlgorithms, StringComparison.InvariantCultureIgnoreCase)) - { - apiResource.AllowedAccessTokenSigningAlgorithms = input.AllowedAccessTokenSigningAlgorithms; - } - if (!string.Equals(apiResource.DisplayName, input.DisplayName, StringComparison.InvariantCultureIgnoreCase)) - { - apiResource.DisplayName = input.DisplayName; - } - if (apiResource.Description?.Equals(input.Description, StringComparison.InvariantCultureIgnoreCase) - == false) - { - apiResource.Description = input.Description; - } + apiResource.AllowedAccessTokenSigningAlgorithms = input.AllowedAccessTokenSigningAlgorithms; + } + if (!string.Equals(apiResource.DisplayName, input.DisplayName, StringComparison.InvariantCultureIgnoreCase)) + { + apiResource.DisplayName = input.DisplayName; + } + if (apiResource.Description?.Equals(input.Description, StringComparison.InvariantCultureIgnoreCase) + == false) + { + apiResource.Description = input.Description; + } - if (await IsGrantAsync(AbpIdentityServerPermissions.ApiResources.ManageClaims)) + if (await IsGrantAsync(AbpIdentityServerPermissions.ApiResources.ManageClaims)) + { + // 删除不存在的UserClaim + apiResource.UserClaims.RemoveAll(claim => !input.UserClaims.Any(inputClaim => claim.Type == inputClaim.Type)); + foreach (var inputClaim in input.UserClaims) { - // 删除不存在的UserClaim - apiResource.UserClaims.RemoveAll(claim => !input.UserClaims.Any(inputClaim => claim.Type == inputClaim.Type)); - foreach (var inputClaim in input.UserClaims) + var userClaim = apiResource.FindClaim(inputClaim.Type); + if (userClaim == null) { - var userClaim = apiResource.FindClaim(inputClaim.Type); - if (userClaim == null) - { - apiResource.AddUserClaim(inputClaim.Type); - } + apiResource.AddUserClaim(inputClaim.Type); } } + } - if (await IsGrantAsync(AbpIdentityServerPermissions.ApiResources.ManageScopes)) + if (await IsGrantAsync(AbpIdentityServerPermissions.ApiResources.ManageScopes)) + { + // 删除不存在的Scope + apiResource.Scopes.RemoveAll(scope => !input.Scopes.Any(inputScope => scope.Scope == inputScope.Scope)); + foreach (var inputScope in input.Scopes) { - // 删除不存在的Scope - apiResource.Scopes.RemoveAll(scope => !input.Scopes.Any(inputScope => scope.Scope == inputScope.Scope)); - foreach (var inputScope in input.Scopes) + var scope = apiResource.FindScope(inputScope.Scope); + if (scope == null) { - var scope = apiResource.FindScope(inputScope.Scope); - if (scope == null) - { - apiResource.AddScope(inputScope.Scope); - } + apiResource.AddScope(inputScope.Scope); } } + } - if (await IsGrantAsync(AbpIdentityServerPermissions.ApiResources.ManageSecrets)) + if (await IsGrantAsync(AbpIdentityServerPermissions.ApiResources.ManageSecrets)) + { + // 删除不存在的Secret + apiResource.Secrets.RemoveAll(secret => !input.Secrets.Any(inputSecret => secret.Type == inputSecret.Type && secret.Value == inputSecret.Value)); + foreach (var inputSecret in input.Secrets) { - // 删除不存在的Secret - apiResource.Secrets.RemoveAll(secret => !input.Secrets.Any(inputSecret => secret.Type == inputSecret.Type && secret.Value == inputSecret.Value)); - foreach (var inputSecret in input.Secrets) + // 第一次重复校验已经加密过的字符串 + if (apiResource.FindSecret(inputSecret.Value, inputSecret.Type) == null) { - // 第一次重复校验已经加密过的字符串 - if (apiResource.FindSecret(inputSecret.Value, inputSecret.Type) == null) + var apiSecretValue = inputSecret.Value; + if (IdentityServerConstants.SecretTypes.SharedSecret.Equals(inputSecret.Type)) { - var apiSecretValue = inputSecret.Value; - if (IdentityServerConstants.SecretTypes.SharedSecret.Equals(inputSecret.Type)) + if (inputSecret.HashType == HashType.Sha256) { - if (inputSecret.HashType == HashType.Sha256) - { - apiSecretValue = inputSecret.Value.Sha256(); - } - else if (inputSecret.HashType == HashType.Sha512) - { - apiSecretValue = inputSecret.Value.Sha512(); - } + apiSecretValue = inputSecret.Value.Sha256(); } - // 加密之后还需要做一次校验 避免出现重复值 - var secret = apiResource.FindSecret(apiSecretValue, inputSecret.Type); - if (secret == null) + else if (inputSecret.HashType == HashType.Sha512) { - apiResource.AddSecret(apiSecretValue, inputSecret.Expiration, inputSecret.Type, inputSecret.Description); + apiSecretValue = inputSecret.Value.Sha512(); } } + // 加密之后还需要做一次校验 避免出现重复值 + var secret = apiResource.FindSecret(apiSecretValue, inputSecret.Type); + if (secret == null) + { + apiResource.AddSecret(apiSecretValue, inputSecret.Expiration, inputSecret.Type, inputSecret.Description); + } } } + } - if (await IsGrantAsync(AbpIdentityServerPermissions.ApiResources.ManageProperties)) + if (await IsGrantAsync(AbpIdentityServerPermissions.ApiResources.ManageProperties)) + { + // 删除不存在的属性 + apiResource.Properties.RemoveAll(prop => !input.Properties.Any(inputProp => prop.Key == inputProp.Key)); + foreach (var inputProp in input.Properties) { - // 删除不存在的属性 - apiResource.Properties.RemoveAll(prop => !input.Properties.Any(inputProp => prop.Key == inputProp.Key)); - foreach (var inputProp in input.Properties) + var apiResourceProperty = apiResource.FindProperty(inputProp.Key); + if (apiResourceProperty == null) { - var apiResourceProperty = apiResource.FindProperty(inputProp.Key); - if (apiResourceProperty == null) - { - apiResource.AddProperty(inputProp.Key, inputProp.Value); - } - else - { - apiResourceProperty.Value = inputProp.Value; - } + apiResource.AddProperty(inputProp.Key, inputProp.Value); + } + else + { + apiResourceProperty.Value = inputProp.Value; } } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/ApiScopes/ApiScopeAppService.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/ApiScopes/ApiScopeAppService.cs index ef5ef56e6..a91d8223e 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/ApiScopes/ApiScopeAppService.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/ApiScopes/ApiScopeAppService.cs @@ -7,134 +7,133 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.IdentityServer.ApiScopes; -namespace LINGYUN.Abp.IdentityServer.ApiScopes +namespace LINGYUN.Abp.IdentityServer.ApiScopes; + +[Authorize(AbpIdentityServerPermissions.ApiScopes.Default)] +public class ApiScopeAppService : AbpIdentityServerAppServiceBase, IApiScopeAppService { - [Authorize(AbpIdentityServerPermissions.ApiScopes.Default)] - public class ApiScopeAppService : AbpIdentityServerAppServiceBase, IApiScopeAppService + protected IApiScopeRepository ApiScopeRepository { get; } + + public ApiScopeAppService( + IApiScopeRepository apiScopeRepository) { - protected IApiScopeRepository ApiScopeRepository { get; } + ApiScopeRepository = apiScopeRepository; + } - public ApiScopeAppService( - IApiScopeRepository apiScopeRepository) + [Authorize(AbpIdentityServerPermissions.ApiScopes.Create)] + public async virtual Task CreateAsync(ApiScopeCreateDto input) + { + if (await ApiScopeRepository.CheckNameExistAsync(input.Name)) { - ApiScopeRepository = apiScopeRepository; + throw new UserFriendlyException(L[AbpIdentityServerErrorConsts.ApiScopeNameExisted, input.Name]); } + var apiScope = new ApiScope( + GuidGenerator.Create(), + input.Name, + input.DisplayName, + input.Description, + input.Enabled, + input.Required, + input.Emphasize, + input.ShowInDiscoveryDocument); - [Authorize(AbpIdentityServerPermissions.ApiScopes.Create)] - public async virtual Task CreateAsync(ApiScopeCreateDto input) - { - if (await ApiScopeRepository.CheckNameExistAsync(input.Name)) - { - throw new UserFriendlyException(L[AbpIdentityServerErrorConsts.ApiScopeNameExisted, input.Name]); - } - var apiScope = new ApiScope( - GuidGenerator.Create(), - input.Name, - input.DisplayName, - input.Description, - input.Enabled, - input.Required, - input.Emphasize, - input.ShowInDiscoveryDocument); + await UpdateApiScopeByInputAsync(apiScope, input); - await UpdateApiScopeByInputAsync(apiScope, input); + await CurrentUnitOfWork.SaveChangesAsync(); - await CurrentUnitOfWork.SaveChangesAsync(); + apiScope = await ApiScopeRepository.InsertAsync(apiScope); - apiScope = await ApiScopeRepository.InsertAsync(apiScope); + return ObjectMapper.Map(apiScope); + } - return ObjectMapper.Map(apiScope); - } + [Authorize(AbpIdentityServerPermissions.ApiScopes.Delete)] + public async virtual Task DeleteAsync(Guid id) + { + var apiScope = await ApiScopeRepository.GetAsync(id); - [Authorize(AbpIdentityServerPermissions.ApiScopes.Delete)] - public async virtual Task DeleteAsync(Guid id) - { - var apiScope = await ApiScopeRepository.GetAsync(id); + await ApiScopeRepository.DeleteAsync(apiScope); - await ApiScopeRepository.DeleteAsync(apiScope); + await CurrentUnitOfWork.SaveChangesAsync(); + } - await CurrentUnitOfWork.SaveChangesAsync(); - } + public async virtual Task GetAsync(Guid id) + { + var apiScope = await ApiScopeRepository.GetAsync(id); - public async virtual Task GetAsync(Guid id) - { - var apiScope = await ApiScopeRepository.GetAsync(id); + return ObjectMapper.Map(apiScope); + } - return ObjectMapper.Map(apiScope); - } + public async virtual Task> GetListAsync(GetApiScopeInput input) + { + var totalCount = await ApiScopeRepository + .GetCountAsync(input.Filter); - public async virtual Task> GetListAsync(GetApiScopeInput input) - { - var totalCount = await ApiScopeRepository - .GetCountAsync(input.Filter); + var apiScopes = await ApiScopeRepository + .GetListAsync( + input.Sorting, + input.SkipCount, input.MaxResultCount, + input.Filter); - var apiScopes = await ApiScopeRepository - .GetListAsync( - input.Sorting, - input.SkipCount, input.MaxResultCount, - input.Filter); + return new PagedResultDto(totalCount, + ObjectMapper.Map, List>(apiScopes)); + } - return new PagedResultDto(totalCount, - ObjectMapper.Map, List>(apiScopes)); - } + [Authorize(AbpIdentityServerPermissions.ApiScopes.Update)] + public async virtual Task UpdateAsync(Guid id, ApiScopeUpdateDto input) + { + var apiScope = await ApiScopeRepository.GetAsync(id); - [Authorize(AbpIdentityServerPermissions.ApiScopes.Update)] - public async virtual Task UpdateAsync(Guid id, ApiScopeUpdateDto input) - { - var apiScope = await ApiScopeRepository.GetAsync(id); + await UpdateApiScopeByInputAsync(apiScope, input); + apiScope = await ApiScopeRepository.UpdateAsync(apiScope); - await UpdateApiScopeByInputAsync(apiScope, input); - apiScope = await ApiScopeRepository.UpdateAsync(apiScope); + await CurrentUnitOfWork.SaveChangesAsync(); - await CurrentUnitOfWork.SaveChangesAsync(); + return ObjectMapper.Map(apiScope); + } - return ObjectMapper.Map(apiScope); + protected async virtual Task UpdateApiScopeByInputAsync(ApiScope apiScope, ApiScopeCreateOrUpdateDto input) + { + if (!string.Equals(apiScope.Description, input.Description, StringComparison.InvariantCultureIgnoreCase)) + { + apiScope.Description = input.Description; } - - protected async virtual Task UpdateApiScopeByInputAsync(ApiScope apiScope, ApiScopeCreateOrUpdateDto input) + if (!string.Equals(apiScope.DisplayName, input.DisplayName, StringComparison.InvariantCultureIgnoreCase)) { - if (!string.Equals(apiScope.Description, input.Description, StringComparison.InvariantCultureIgnoreCase)) - { - apiScope.Description = input.Description; - } - if (!string.Equals(apiScope.DisplayName, input.DisplayName, StringComparison.InvariantCultureIgnoreCase)) - { - apiScope.DisplayName = input.DisplayName; - } - apiScope.Emphasize = input.Emphasize; - apiScope.Enabled = input.Enabled; - apiScope.Required = input.Required; - apiScope.ShowInDiscoveryDocument = input.ShowInDiscoveryDocument; + apiScope.DisplayName = input.DisplayName; + } + apiScope.Emphasize = input.Emphasize; + apiScope.Enabled = input.Enabled; + apiScope.Required = input.Required; + apiScope.ShowInDiscoveryDocument = input.ShowInDiscoveryDocument; - if (await IsGrantAsync(AbpIdentityServerPermissions.ApiScopes.ManageClaims)) + if (await IsGrantAsync(AbpIdentityServerPermissions.ApiScopes.ManageClaims)) + { + // 删除不存在的UserClaim + apiScope.UserClaims.RemoveAll(claim => !input.UserClaims.Any(inputClaim => claim.Type == inputClaim.Type)); + foreach (var inputClaim in input.UserClaims) { - // 删除不存在的UserClaim - apiScope.UserClaims.RemoveAll(claim => !input.UserClaims.Any(inputClaim => claim.Type == inputClaim.Type)); - foreach (var inputClaim in input.UserClaims) + var userClaim = apiScope.FindClaim(inputClaim.Type); + if (userClaim == null) { - var userClaim = apiScope.FindClaim(inputClaim.Type); - if (userClaim == null) - { - apiScope.AddUserClaim(inputClaim.Type); - } + apiScope.AddUserClaim(inputClaim.Type); } } + } - if (await IsGrantAsync(AbpIdentityServerPermissions.ApiScopes.ManageProperties)) + if (await IsGrantAsync(AbpIdentityServerPermissions.ApiScopes.ManageProperties)) + { + // 删除不存在的Property + apiScope.Properties.RemoveAll(prop => !input.Properties.Any(inputProp => prop.Key == inputProp.Key)); + foreach (var inputProp in input.Properties) { - // 删除不存在的Property - apiScope.Properties.RemoveAll(prop => !input.Properties.Any(inputProp => prop.Key == inputProp.Key)); - foreach (var inputProp in input.Properties) + var identityResourceProperty = apiScope.FindProperty(inputProp.Key); + if (identityResourceProperty == null) + { + apiScope.AddProperty(inputProp.Key, inputProp.Value); + } + else { - var identityResourceProperty = apiScope.FindProperty(inputProp.Key); - if (identityResourceProperty == null) - { - apiScope.AddProperty(inputProp.Key, inputProp.Value); - } - else - { - identityResourceProperty.Value = inputProp.Value; - } + identityResourceProperty.Value = inputProp.Value; } } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/Clients/ClientAppService.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/Clients/ClientAppService.cs index 9cd5d344a..ca4fca282 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/Clients/ClientAppService.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/Clients/ClientAppService.cs @@ -12,477 +12,476 @@ using Volo.Abp.IdentityServer.Clients; using Client = Volo.Abp.IdentityServer.Clients.Client; -namespace LINGYUN.Abp.IdentityServer.Clients +namespace LINGYUN.Abp.IdentityServer.Clients; + +[Authorize(AbpIdentityServerPermissions.Clients.Default)] +public class ClientAppService : AbpIdentityServerAppServiceBase, IClientAppService { - [Authorize(AbpIdentityServerPermissions.Clients.Default)] - public class ClientAppService : AbpIdentityServerAppServiceBase, IClientAppService + protected IClientRepository ClientRepository { get; } + protected IApiResourceRepository ApiResourceRepository { get; } + protected IIdentityResourceRepository IdentityResourceRepository { get; } + + public ClientAppService( + IClientRepository clientRepository, + IApiResourceRepository apiResourceRepository, + IIdentityResourceRepository identityResourceRepository) { - protected IClientRepository ClientRepository { get; } - protected IApiResourceRepository ApiResourceRepository { get; } - protected IIdentityResourceRepository IdentityResourceRepository { get; } + ClientRepository = clientRepository; + ApiResourceRepository = apiResourceRepository; + IdentityResourceRepository = identityResourceRepository; + } - public ClientAppService( - IClientRepository clientRepository, - IApiResourceRepository apiResourceRepository, - IIdentityResourceRepository identityResourceRepository) + [Authorize(AbpIdentityServerPermissions.Clients.Create)] + public async virtual Task CreateAsync(ClientCreateDto clientCreate) + { + var clientIdExists = await ClientRepository.CheckClientIdExistAsync(clientCreate.ClientId); + if(clientIdExists) { - ClientRepository = clientRepository; - ApiResourceRepository = apiResourceRepository; - IdentityResourceRepository = identityResourceRepository; + throw new UserFriendlyException(L[AbpIdentityServerErrorConsts.ClientIdExisted, clientCreate.ClientId]); } - - [Authorize(AbpIdentityServerPermissions.Clients.Create)] - public async virtual Task CreateAsync(ClientCreateDto clientCreate) + var client = new Client(GuidGenerator.Create(), clientCreate.ClientId) { - var clientIdExists = await ClientRepository.CheckClientIdExistAsync(clientCreate.ClientId); - if(clientIdExists) - { - throw new UserFriendlyException(L[AbpIdentityServerErrorConsts.ClientIdExisted, clientCreate.ClientId]); - } - var client = new Client(GuidGenerator.Create(), clientCreate.ClientId) - { - ClientName = clientCreate.ClientName, - Description = clientCreate.Description - }; - foreach (var inputGrantType in clientCreate.AllowedGrantTypes) - { - client.AddGrantType(inputGrantType.GrantType); - } + ClientName = clientCreate.ClientName, + Description = clientCreate.Description + }; + foreach (var inputGrantType in clientCreate.AllowedGrantTypes) + { + client.AddGrantType(inputGrantType.GrantType); + } - client = await ClientRepository.InsertAsync(client); + client = await ClientRepository.InsertAsync(client); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork.SaveChangesAsync(); - return ObjectMapper.Map(client); - } + return ObjectMapper.Map(client); + } - [Authorize(AbpIdentityServerPermissions.Clients.Delete)] - public async virtual Task DeleteAsync(Guid id) - { - var client = await ClientRepository.GetAsync(id); - await ClientRepository.DeleteAsync(client); + [Authorize(AbpIdentityServerPermissions.Clients.Delete)] + public async virtual Task DeleteAsync(Guid id) + { + var client = await ClientRepository.GetAsync(id); + await ClientRepository.DeleteAsync(client); - await CurrentUnitOfWork.SaveChangesAsync(); - } + await CurrentUnitOfWork.SaveChangesAsync(); + } - public async virtual Task GetAsync(Guid id) - { - var client = await ClientRepository.GetAsync(id); + public async virtual Task GetAsync(Guid id) + { + var client = await ClientRepository.GetAsync(id); - return ObjectMapper.Map(client); - } + return ObjectMapper.Map(client); + } - public async virtual Task> GetListAsync(ClientGetByPagedDto input) - { - var clients = await ClientRepository.GetListAsync(input.Sorting, - input.SkipCount, input.MaxResultCount, - input.Filter); + public async virtual Task> GetListAsync(ClientGetByPagedDto input) + { + var clients = await ClientRepository.GetListAsync(input.Sorting, + input.SkipCount, input.MaxResultCount, + input.Filter); - var clientCount = await ClientRepository.GetCountAsync(); + var clientCount = await ClientRepository.GetCountAsync(); - return new PagedResultDto(clientCount, - ObjectMapper.Map, List>(clients)); - } + return new PagedResultDto(clientCount, + ObjectMapper.Map, List>(clients)); + } - [Authorize(AbpIdentityServerPermissions.Clients.Update)] - public async virtual Task UpdateAsync(Guid id, ClientUpdateDto input) + [Authorize(AbpIdentityServerPermissions.Clients.Update)] + public async virtual Task UpdateAsync(Guid id, ClientUpdateDto input) + { + var client = await ClientRepository.GetAsync(id); + + #region Basic + if (!string.Equals(client.ClientId, input.ClientId, StringComparison.InvariantCultureIgnoreCase)) + { + client.ClientId = input.ClientId; + } + if (!string.Equals(client.ClientUri, input.ClientUri, StringComparison.InvariantCultureIgnoreCase)) + { + client.ClientUri = input.ClientUri; + } + if (!string.Equals(client.ClientName, input.ClientName, StringComparison.InvariantCultureIgnoreCase)) + { + client.ClientName = input.ClientName; + } + if (!string.Equals(client.BackChannelLogoutUri, input.BackChannelLogoutUri, StringComparison.InvariantCultureIgnoreCase)) + { + client.BackChannelLogoutUri = input.BackChannelLogoutUri; + } + if (!string.Equals(client.FrontChannelLogoutUri, input.FrontChannelLogoutUri, StringComparison.InvariantCultureIgnoreCase)) + { + client.FrontChannelLogoutUri = input.FrontChannelLogoutUri; + } + if (!string.Equals(client.ClientClaimsPrefix, input.ClientClaimsPrefix, StringComparison.InvariantCultureIgnoreCase)) + { + client.ClientClaimsPrefix = input.ClientClaimsPrefix; + } + if (!string.Equals(client.Description, input.Description, StringComparison.InvariantCultureIgnoreCase)) + { + client.Description = input.Description; + } + if (!string.Equals(client.LogoUri, input.LogoUri, StringComparison.InvariantCultureIgnoreCase)) { - var client = await ClientRepository.GetAsync(id); + client.LogoUri = input.LogoUri; + } + if (!string.Equals(client.UserCodeType, input.UserCodeType, StringComparison.InvariantCultureIgnoreCase)) + { + client.UserCodeType = input.UserCodeType; + } + if (!string.Equals(client.PairWiseSubjectSalt, input.PairWiseSubjectSalt, StringComparison.InvariantCultureIgnoreCase)) + { + client.PairWiseSubjectSalt = input.PairWiseSubjectSalt; + } + if (!string.Equals(client.ProtocolType, input.ProtocolType, StringComparison.InvariantCultureIgnoreCase)) + { + client.ProtocolType = input.ProtocolType; + } + if (!string.Equals(client.AllowedIdentityTokenSigningAlgorithms, input.AllowedIdentityTokenSigningAlgorithms, StringComparison.InvariantCultureIgnoreCase)) + { + client.AllowedIdentityTokenSigningAlgorithms = input.AllowedIdentityTokenSigningAlgorithms; + } - #region Basic - if (!string.Equals(client.ClientId, input.ClientId, StringComparison.InvariantCultureIgnoreCase)) - { - client.ClientId = input.ClientId; - } - if (!string.Equals(client.ClientUri, input.ClientUri, StringComparison.InvariantCultureIgnoreCase)) - { - client.ClientUri = input.ClientUri; - } - if (!string.Equals(client.ClientName, input.ClientName, StringComparison.InvariantCultureIgnoreCase)) - { - client.ClientName = input.ClientName; - } - if (!string.Equals(client.BackChannelLogoutUri, input.BackChannelLogoutUri, StringComparison.InvariantCultureIgnoreCase)) - { - client.BackChannelLogoutUri = input.BackChannelLogoutUri; - } - if (!string.Equals(client.FrontChannelLogoutUri, input.FrontChannelLogoutUri, StringComparison.InvariantCultureIgnoreCase)) - { - client.FrontChannelLogoutUri = input.FrontChannelLogoutUri; - } - if (!string.Equals(client.ClientClaimsPrefix, input.ClientClaimsPrefix, StringComparison.InvariantCultureIgnoreCase)) - { - client.ClientClaimsPrefix = input.ClientClaimsPrefix; - } - if (!string.Equals(client.Description, input.Description, StringComparison.InvariantCultureIgnoreCase)) - { - client.Description = input.Description; - } - if (!string.Equals(client.LogoUri, input.LogoUri, StringComparison.InvariantCultureIgnoreCase)) - { - client.LogoUri = input.LogoUri; - } - if (!string.Equals(client.UserCodeType, input.UserCodeType, StringComparison.InvariantCultureIgnoreCase)) - { - client.UserCodeType = input.UserCodeType; - } - if (!string.Equals(client.PairWiseSubjectSalt, input.PairWiseSubjectSalt, StringComparison.InvariantCultureIgnoreCase)) - { - client.PairWiseSubjectSalt = input.PairWiseSubjectSalt; - } - if (!string.Equals(client.ProtocolType, input.ProtocolType, StringComparison.InvariantCultureIgnoreCase)) - { - client.ProtocolType = input.ProtocolType; - } - if (!string.Equals(client.AllowedIdentityTokenSigningAlgorithms, input.AllowedIdentityTokenSigningAlgorithms, StringComparison.InvariantCultureIgnoreCase)) + client.AbsoluteRefreshTokenLifetime = input.AbsoluteRefreshTokenLifetime; + client.AccessTokenLifetime = input.AccessTokenLifetime; + client.AccessTokenType = input.AccessTokenType; + client.AllowAccessTokensViaBrowser = input.AllowAccessTokensViaBrowser; + client.AllowOfflineAccess = input.AllowOfflineAccess; + client.AllowPlainTextPkce = input.AllowPlainTextPkce; + client.AllowRememberConsent = input.AllowRememberConsent; + client.AlwaysIncludeUserClaimsInIdToken = input.AlwaysIncludeUserClaimsInIdToken; + client.AlwaysSendClientClaims = input.AlwaysSendClientClaims; + client.AuthorizationCodeLifetime = input.AuthorizationCodeLifetime; + client.BackChannelLogoutSessionRequired = input.BackChannelLogoutSessionRequired; + client.DeviceCodeLifetime = input.DeviceCodeLifetime; + client.ConsentLifetime = input.ConsentLifetime ?? client.ConsentLifetime; + client.Enabled = input.Enabled; + client.RequireRequestObject = input.RequireRequestObject; + client.EnableLocalLogin = input.EnableLocalLogin; + client.FrontChannelLogoutSessionRequired = input.FrontChannelLogoutSessionRequired; + client.IdentityTokenLifetime = input.IdentityTokenLifetime; + client.IncludeJwtId = input.IncludeJwtId; + client.RefreshTokenExpiration = input.RefreshTokenExpiration; + client.RefreshTokenUsage = input.RefreshTokenUsage; + client.RequireClientSecret = input.RequireClientSecret; + client.RequireConsent = input.RequireConsent; + client.RequirePkce = input.RequirePkce; + client.SlidingRefreshTokenLifetime = input.SlidingRefreshTokenLifetime; + client.UpdateAccessTokenClaimsOnRefresh = input.UpdateAccessTokenClaimsOnRefresh; + client.UserSsoLifetime = input.UserSsoLifetime ?? client.UserSsoLifetime; + #endregion + + #region AllowScope + // 删除未在身份资源和Api资源中的作用域 + client.AllowedScopes.RemoveAll(scope => !input.AllowedScopes.Any(inputScope => scope.Scope == inputScope.Scope)); + foreach (var inputScope in input.AllowedScopes) + { + if (client.FindScope(inputScope.Scope) == null) { - client.AllowedIdentityTokenSigningAlgorithms = input.AllowedIdentityTokenSigningAlgorithms; + client.AddScope(inputScope.Scope); } + } + + #endregion - client.AbsoluteRefreshTokenLifetime = input.AbsoluteRefreshTokenLifetime; - client.AccessTokenLifetime = input.AccessTokenLifetime; - client.AccessTokenType = input.AccessTokenType; - client.AllowAccessTokensViaBrowser = input.AllowAccessTokensViaBrowser; - client.AllowOfflineAccess = input.AllowOfflineAccess; - client.AllowPlainTextPkce = input.AllowPlainTextPkce; - client.AllowRememberConsent = input.AllowRememberConsent; - client.AlwaysIncludeUserClaimsInIdToken = input.AlwaysIncludeUserClaimsInIdToken; - client.AlwaysSendClientClaims = input.AlwaysSendClientClaims; - client.AuthorizationCodeLifetime = input.AuthorizationCodeLifetime; - client.BackChannelLogoutSessionRequired = input.BackChannelLogoutSessionRequired; - client.DeviceCodeLifetime = input.DeviceCodeLifetime; - client.ConsentLifetime = input.ConsentLifetime ?? client.ConsentLifetime; - client.Enabled = input.Enabled; - client.RequireRequestObject = input.RequireRequestObject; - client.EnableLocalLogin = input.EnableLocalLogin; - client.FrontChannelLogoutSessionRequired = input.FrontChannelLogoutSessionRequired; - client.IdentityTokenLifetime = input.IdentityTokenLifetime; - client.IncludeJwtId = input.IncludeJwtId; - client.RefreshTokenExpiration = input.RefreshTokenExpiration; - client.RefreshTokenUsage = input.RefreshTokenUsage; - client.RequireClientSecret = input.RequireClientSecret; - client.RequireConsent = input.RequireConsent; - client.RequirePkce = input.RequirePkce; - client.SlidingRefreshTokenLifetime = input.SlidingRefreshTokenLifetime; - client.UpdateAccessTokenClaimsOnRefresh = input.UpdateAccessTokenClaimsOnRefresh; - client.UserSsoLifetime = input.UserSsoLifetime ?? client.UserSsoLifetime; - #endregion - - #region AllowScope - // 删除未在身份资源和Api资源中的作用域 - client.AllowedScopes.RemoveAll(scope => !input.AllowedScopes.Any(inputScope => scope.Scope == inputScope.Scope)); - foreach (var inputScope in input.AllowedScopes) + #region RedirectUris + // 删除不存在的uri + client.RedirectUris.RemoveAll(uri => !input.RedirectUris.Any(inputRedirectUri => uri.RedirectUri == inputRedirectUri.RedirectUri)); + foreach (var inputRedirectUri in input.RedirectUris) + { + if (client.FindRedirectUri(inputRedirectUri.RedirectUri) == null) { - if (client.FindScope(inputScope.Scope) == null) - { - client.AddScope(inputScope.Scope); - } + client.AddRedirectUri(inputRedirectUri.RedirectUri); } + } - #endregion + #endregion - #region RedirectUris - // 删除不存在的uri - client.RedirectUris.RemoveAll(uri => !input.RedirectUris.Any(inputRedirectUri => uri.RedirectUri == inputRedirectUri.RedirectUri)); - foreach (var inputRedirectUri in input.RedirectUris) + #region AllowedGrantTypes + // 删除不存在的验证类型 + client.AllowedGrantTypes.RemoveAll(grantType => !input.AllowedGrantTypes.Any(inputGrantType => grantType.GrantType == inputGrantType.GrantType)); + foreach (var inputGrantType in input.AllowedGrantTypes) + { + if (client.FindGrantType(inputGrantType.GrantType) == null) { - if (client.FindRedirectUri(inputRedirectUri.RedirectUri) == null) - { - client.AddRedirectUri(inputRedirectUri.RedirectUri); - } + client.AddGrantType(inputGrantType.GrantType); } + } - #endregion + #endregion - #region AllowedGrantTypes - // 删除不存在的验证类型 - client.AllowedGrantTypes.RemoveAll(grantType => !input.AllowedGrantTypes.Any(inputGrantType => grantType.GrantType == inputGrantType.GrantType)); - foreach (var inputGrantType in input.AllowedGrantTypes) + #region AllowedCorsOrigins + // 删除不存在的同源域名 + client.AllowedCorsOrigins.RemoveAll(corsOrigin => !input.AllowedCorsOrigins.Any(inputCorsOrigin => corsOrigin.Origin == inputCorsOrigin.Origin)); + foreach (var inputCorsOrigin in input.AllowedCorsOrigins) + { + if (client.FindCorsOrigin(inputCorsOrigin.Origin) == null) { - if (client.FindGrantType(inputGrantType.GrantType) == null) - { - client.AddGrantType(inputGrantType.GrantType); - } + client.AddCorsOrigin(inputCorsOrigin.Origin); } + } + + #endregion - #endregion + #region PostLogoutRedirectUris - #region AllowedCorsOrigins - // 删除不存在的同源域名 - client.AllowedCorsOrigins.RemoveAll(corsOrigin => !input.AllowedCorsOrigins.Any(inputCorsOrigin => corsOrigin.Origin == inputCorsOrigin.Origin)); - foreach (var inputCorsOrigin in input.AllowedCorsOrigins) + // 删除不存在的登录重定向域名 + client.PostLogoutRedirectUris.RemoveAll(uri => + !input.PostLogoutRedirectUris.Any(inputLogoutRedirectUri => uri.PostLogoutRedirectUri == inputLogoutRedirectUri.PostLogoutRedirectUri)); + foreach (var inputLogoutRedirectUri in input.PostLogoutRedirectUris) + { + if (client.FindPostLogoutRedirectUri(inputLogoutRedirectUri.PostLogoutRedirectUri) == null) { - if (client.FindCorsOrigin(inputCorsOrigin.Origin) == null) - { - client.AddCorsOrigin(inputCorsOrigin.Origin); - } + client.AddPostLogoutRedirectUri(inputLogoutRedirectUri.PostLogoutRedirectUri); } + } - #endregion + #endregion - #region PostLogoutRedirectUris + #region IdentityProviderRestrictions - // 删除不存在的登录重定向域名 - client.PostLogoutRedirectUris.RemoveAll(uri => - !input.PostLogoutRedirectUris.Any(inputLogoutRedirectUri => uri.PostLogoutRedirectUri == inputLogoutRedirectUri.PostLogoutRedirectUri)); - foreach (var inputLogoutRedirectUri in input.PostLogoutRedirectUris) + // 删除身份认证限制提供商 + client.IdentityProviderRestrictions.RemoveAll(provider => + !input.IdentityProviderRestrictions.Any(inputProvider => provider.Provider == inputProvider.Provider)); + foreach (var inputProvider in input.IdentityProviderRestrictions) + { + if (client.FindIdentityProviderRestriction(inputProvider.Provider) == null) { - if (client.FindPostLogoutRedirectUri(inputLogoutRedirectUri.PostLogoutRedirectUri) == null) - { - client.AddPostLogoutRedirectUri(inputLogoutRedirectUri.PostLogoutRedirectUri); - } + client.AddIdentityProviderRestriction(inputProvider.Provider); } + } - #endregion + #endregion - #region IdentityProviderRestrictions + #region Secrets - // 删除身份认证限制提供商 - client.IdentityProviderRestrictions.RemoveAll(provider => - !input.IdentityProviderRestrictions.Any(inputProvider => provider.Provider == inputProvider.Provider)); - foreach (var inputProvider in input.IdentityProviderRestrictions) + if (await IsGrantAsync(AbpIdentityServerPermissions.Clients.ManageSecrets)) + { + // 移除已经不存在的客户端密钥 + client.ClientSecrets.RemoveAll(secret => !input.ClientSecrets.Any(inputSecret => secret.Value == inputSecret.Value && secret.Type == inputSecret.Type)); + foreach (var inputSecret in input.ClientSecrets) { - if (client.FindIdentityProviderRestriction(inputProvider.Provider) == null) + // 先对加密过的进行过滤 + if (client.FindSecret(inputSecret.Value, inputSecret.Type) != null) { - client.AddIdentityProviderRestriction(inputProvider.Provider); + continue; } - } + var inputSecretValue = inputSecret.Value.Sha256(); // TODO: 通过可选配置来加密 - #endregion - - #region Secrets - - if (await IsGrantAsync(AbpIdentityServerPermissions.Clients.ManageSecrets)) - { - // 移除已经不存在的客户端密钥 - client.ClientSecrets.RemoveAll(secret => !input.ClientSecrets.Any(inputSecret => secret.Value == inputSecret.Value && secret.Type == inputSecret.Type)); - foreach (var inputSecret in input.ClientSecrets) + var clientSecret = client.FindSecret(inputSecretValue, inputSecret.Type); + if (clientSecret == null) { - // 先对加密过的进行过滤 - if (client.FindSecret(inputSecret.Value, inputSecret.Type) != null) - { - continue; - } - var inputSecretValue = inputSecret.Value.Sha256(); // TODO: 通过可选配置来加密 - - var clientSecret = client.FindSecret(inputSecretValue, inputSecret.Type); - if (clientSecret == null) - { - client.AddSecret(inputSecretValue, inputSecret.Expiration, inputSecret.Type, inputSecret.Description); - } + client.AddSecret(inputSecretValue, inputSecret.Expiration, inputSecret.Type, inputSecret.Description); } } + } - #endregion + #endregion - #region Properties + #region Properties - if (await IsGrantAsync(AbpIdentityServerPermissions.Clients.ManageProperties)) + if (await IsGrantAsync(AbpIdentityServerPermissions.Clients.ManageProperties)) + { + // 移除不存在的属性 + client.Properties.RemoveAll(prop => !input.Properties.Any(inputProp => prop.Key == inputProp.Key)); + foreach (var inputProp in input.Properties) { - // 移除不存在的属性 - client.Properties.RemoveAll(prop => !input.Properties.Any(inputProp => prop.Key == inputProp.Key)); - foreach (var inputProp in input.Properties) + var findProp = client.FindProperty(inputProp.Key); + if (findProp == null) { - var findProp = client.FindProperty(inputProp.Key); - if (findProp == null) - { - client.AddProperty(inputProp.Key, inputProp.Value); - } - else - { - findProp.Value = inputProp.Value; - } + client.AddProperty(inputProp.Key, inputProp.Value); + } + else + { + findProp.Value = inputProp.Value; } } + } - #endregion + #endregion - #region Claims + #region Claims - if (await IsGrantAsync(AbpIdentityServerPermissions.Clients.ManageClaims)) + if (await IsGrantAsync(AbpIdentityServerPermissions.Clients.ManageClaims)) + { + // 移除已经不存在的客户端声明 + client.Claims.RemoveAll(secret => !input.Claims.Any(inputClaim => secret.Value == inputClaim.Value && secret.Type == inputClaim.Type)); + foreach (var inputClaim in input.Claims) { - // 移除已经不存在的客户端声明 - client.Claims.RemoveAll(secret => !input.Claims.Any(inputClaim => secret.Value == inputClaim.Value && secret.Type == inputClaim.Type)); - foreach (var inputClaim in input.Claims) + if (client.FindClaim(inputClaim.Value, inputClaim.Type) == null) { - if (client.FindClaim(inputClaim.Value, inputClaim.Type) == null) - { - client.AddClaim(inputClaim.Value, inputClaim.Type); - } + client.AddClaim(inputClaim.Value, inputClaim.Type); } } - - #endregion + } + + #endregion - client = await ClientRepository.UpdateAsync(client); + client = await ClientRepository.UpdateAsync(client); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork.SaveChangesAsync(); - return ObjectMapper.Map(client); - } + return ObjectMapper.Map(client); + } - /// - /// 克隆客户端 - /// - /// - /// 实现参考 Skoruba.IdentityServer4.Admin 项目 - /// https://github.com/skoruba/IdentityServer4.Admin.git - /// - /// - /// - /// - [Authorize(AbpIdentityServerPermissions.Clients.Clone)] - public async virtual Task CloneAsync(Guid id, ClientCloneDto input) + /// + /// 克隆客户端 + /// + /// + /// 实现参考 Skoruba.IdentityServer4.Admin 项目 + /// https://github.com/skoruba/IdentityServer4.Admin.git + /// + /// + /// + /// + [Authorize(AbpIdentityServerPermissions.Clients.Clone)] + public async virtual Task CloneAsync(Guid id, ClientCloneDto input) + { + var clientIdExists = await ClientRepository.CheckClientIdExistAsync(input.ClientId); + if (clientIdExists) { - var clientIdExists = await ClientRepository.CheckClientIdExistAsync(input.ClientId); - if (clientIdExists) - { - throw new UserFriendlyException(L[AbpIdentityServerErrorConsts.ClientIdExisted, input.ClientId]); - } - var srcClient = await ClientRepository.GetAsync(id); + throw new UserFriendlyException(L[AbpIdentityServerErrorConsts.ClientIdExisted, input.ClientId]); + } + var srcClient = await ClientRepository.GetAsync(id); - var client = new Client(GuidGenerator.Create(), input.ClientId) - { - ClientName = input.ClientName, - Description = input.Description, - AbsoluteRefreshTokenLifetime = srcClient.AbsoluteRefreshTokenLifetime, - AccessTokenLifetime = srcClient.AccessTokenLifetime, - AccessTokenType = srcClient.AccessTokenType, - AllowAccessTokensViaBrowser = srcClient.AllowAccessTokensViaBrowser, - AllowOfflineAccess = srcClient.AllowOfflineAccess, - AllowPlainTextPkce = srcClient.AllowPlainTextPkce, - AllowRememberConsent = srcClient.AllowRememberConsent, - AlwaysIncludeUserClaimsInIdToken = srcClient.AlwaysIncludeUserClaimsInIdToken, - AlwaysSendClientClaims = srcClient.AlwaysSendClientClaims, - AuthorizationCodeLifetime = srcClient.AuthorizationCodeLifetime, - BackChannelLogoutSessionRequired = srcClient.BackChannelLogoutSessionRequired, - - BackChannelLogoutUri = srcClient.BackChannelLogoutUri, - ClientClaimsPrefix = srcClient.ClientClaimsPrefix, - ConsentLifetime = srcClient.ConsentLifetime, - DeviceCodeLifetime = srcClient.DeviceCodeLifetime, - Enabled = srcClient.Enabled, - EnableLocalLogin = srcClient.EnableLocalLogin, - FrontChannelLogoutSessionRequired = srcClient.FrontChannelLogoutSessionRequired, - FrontChannelLogoutUri = srcClient.FrontChannelLogoutUri, - - IdentityTokenLifetime = srcClient.IdentityTokenLifetime, - IncludeJwtId = srcClient.IncludeJwtId, - LogoUri = srcClient.LogoUri, - PairWiseSubjectSalt = srcClient.PairWiseSubjectSalt, - ProtocolType = srcClient.ProtocolType, - RefreshTokenExpiration = srcClient.RefreshTokenExpiration, - RefreshTokenUsage = srcClient.RefreshTokenUsage, - RequireClientSecret = srcClient.RequireClientSecret, - RequireConsent = srcClient.RequireConsent, - - RequirePkce = srcClient.RequirePkce, - SlidingRefreshTokenLifetime = srcClient.SlidingRefreshTokenLifetime, - UpdateAccessTokenClaimsOnRefresh = srcClient.UpdateAccessTokenClaimsOnRefresh, - - UserCodeType = srcClient.UserCodeType, - UserSsoLifetime = srcClient.UserSsoLifetime - }; - - if (input.CopyAllowedCorsOrigin) + var client = new Client(GuidGenerator.Create(), input.ClientId) + { + ClientName = input.ClientName, + Description = input.Description, + AbsoluteRefreshTokenLifetime = srcClient.AbsoluteRefreshTokenLifetime, + AccessTokenLifetime = srcClient.AccessTokenLifetime, + AccessTokenType = srcClient.AccessTokenType, + AllowAccessTokensViaBrowser = srcClient.AllowAccessTokensViaBrowser, + AllowOfflineAccess = srcClient.AllowOfflineAccess, + AllowPlainTextPkce = srcClient.AllowPlainTextPkce, + AllowRememberConsent = srcClient.AllowRememberConsent, + AlwaysIncludeUserClaimsInIdToken = srcClient.AlwaysIncludeUserClaimsInIdToken, + AlwaysSendClientClaims = srcClient.AlwaysSendClientClaims, + AuthorizationCodeLifetime = srcClient.AuthorizationCodeLifetime, + BackChannelLogoutSessionRequired = srcClient.BackChannelLogoutSessionRequired, + + BackChannelLogoutUri = srcClient.BackChannelLogoutUri, + ClientClaimsPrefix = srcClient.ClientClaimsPrefix, + ConsentLifetime = srcClient.ConsentLifetime, + DeviceCodeLifetime = srcClient.DeviceCodeLifetime, + Enabled = srcClient.Enabled, + EnableLocalLogin = srcClient.EnableLocalLogin, + FrontChannelLogoutSessionRequired = srcClient.FrontChannelLogoutSessionRequired, + FrontChannelLogoutUri = srcClient.FrontChannelLogoutUri, + + IdentityTokenLifetime = srcClient.IdentityTokenLifetime, + IncludeJwtId = srcClient.IncludeJwtId, + LogoUri = srcClient.LogoUri, + PairWiseSubjectSalt = srcClient.PairWiseSubjectSalt, + ProtocolType = srcClient.ProtocolType, + RefreshTokenExpiration = srcClient.RefreshTokenExpiration, + RefreshTokenUsage = srcClient.RefreshTokenUsage, + RequireClientSecret = srcClient.RequireClientSecret, + RequireConsent = srcClient.RequireConsent, + + RequirePkce = srcClient.RequirePkce, + SlidingRefreshTokenLifetime = srcClient.SlidingRefreshTokenLifetime, + UpdateAccessTokenClaimsOnRefresh = srcClient.UpdateAccessTokenClaimsOnRefresh, + + UserCodeType = srcClient.UserCodeType, + UserSsoLifetime = srcClient.UserSsoLifetime + }; + + if (input.CopyAllowedCorsOrigin) + { + foreach(var corsOrigin in srcClient.AllowedCorsOrigins) { - foreach(var corsOrigin in srcClient.AllowedCorsOrigins) - { - client.AddCorsOrigin(corsOrigin.Origin); - } + client.AddCorsOrigin(corsOrigin.Origin); } - if (input.CopyAllowedGrantType) + } + if (input.CopyAllowedGrantType) + { + foreach (var grantType in srcClient.AllowedGrantTypes) { - foreach (var grantType in srcClient.AllowedGrantTypes) - { - client.AddGrantType(grantType.GrantType); - } + client.AddGrantType(grantType.GrantType); } - if (input.CopyAllowedScope) + } + if (input.CopyAllowedScope) + { + foreach (var scope in srcClient.AllowedScopes) { - foreach (var scope in srcClient.AllowedScopes) - { - client.AddScope(scope.Scope); - } + client.AddScope(scope.Scope); } - if (input.CopyClaim) + } + if (input.CopyClaim) + { + foreach (var claim in srcClient.Claims) { - foreach (var claim in srcClient.Claims) - { - client.AddClaim(claim.Value, claim.Type); - } + client.AddClaim(claim.Value, claim.Type); } - if (input.CopySecret) + } + if (input.CopySecret) + { + foreach (var secret in srcClient.ClientSecrets) { - foreach (var secret in srcClient.ClientSecrets) - { - client.AddSecret(secret.Value, secret.Expiration, secret.Type, secret.Description); - } + client.AddSecret(secret.Value, secret.Expiration, secret.Type, secret.Description); } - if (input.CopyIdentityProviderRestriction) + } + if (input.CopyIdentityProviderRestriction) + { + foreach (var provider in srcClient.IdentityProviderRestrictions) { - foreach (var provider in srcClient.IdentityProviderRestrictions) - { - client.AddIdentityProviderRestriction(provider.Provider); - } + client.AddIdentityProviderRestriction(provider.Provider); } - if (input.CopyPostLogoutRedirectUri) + } + if (input.CopyPostLogoutRedirectUri) + { + foreach (var uri in srcClient.PostLogoutRedirectUris) { - foreach (var uri in srcClient.PostLogoutRedirectUris) - { - client.AddPostLogoutRedirectUri(uri.PostLogoutRedirectUri); - } + client.AddPostLogoutRedirectUri(uri.PostLogoutRedirectUri); } - if (input.CopyPropertie) + } + if (input.CopyPropertie) + { + foreach (var property in srcClient.Properties) { - foreach (var property in srcClient.Properties) - { - client.AddProperty(property.Key, property.Value); - } + client.AddProperty(property.Key, property.Value); } - if (input.CopyRedirectUri) + } + if (input.CopyRedirectUri) + { + foreach (var uri in srcClient.RedirectUris) { - foreach (var uri in srcClient.RedirectUris) - { - client.AddRedirectUri(uri.RedirectUri); - } + client.AddRedirectUri(uri.RedirectUri); } - client = await ClientRepository.InsertAsync(client); + } + client = await ClientRepository.InsertAsync(client); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork.SaveChangesAsync(); - return ObjectMapper.Map(client); - } - /// - /// 查询可用的Api资源 - /// - /// - public async virtual Task> GetAssignableApiResourcesAsync() - { - var resourceNames = await ApiResourceRepository.GetNamesAsync(); + return ObjectMapper.Map(client); + } + /// + /// 查询可用的Api资源 + /// + /// + public async virtual Task> GetAssignableApiResourcesAsync() + { + var resourceNames = await ApiResourceRepository.GetNamesAsync(); - return new ListResultDto(resourceNames); - } - /// - /// 查询可用的身份资源 - /// - /// - public async virtual Task> GetAssignableIdentityResourcesAsync() - { - var resourceNames = await IdentityResourceRepository.GetNamesAsync(); + return new ListResultDto(resourceNames); + } + /// + /// 查询可用的身份资源 + /// + /// + public async virtual Task> GetAssignableIdentityResourcesAsync() + { + var resourceNames = await IdentityResourceRepository.GetNamesAsync(); - return new ListResultDto(resourceNames); - } - /// - /// 查询所有不重复的跨域地址 - /// - /// - public async virtual Task> GetAllDistinctAllowedCorsOriginsAsync() - { - var corsOrigins = await ClientRepository.GetAllDistinctAllowedCorsOriginsAsync(); + return new ListResultDto(resourceNames); + } + /// + /// 查询所有不重复的跨域地址 + /// + /// + public async virtual Task> GetAllDistinctAllowedCorsOriginsAsync() + { + var corsOrigins = await ClientRepository.GetAllDistinctAllowedCorsOriginsAsync(); - return new ListResultDto(corsOrigins); - } + return new ListResultDto(corsOrigins); } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/Grants/PersistedGrantAppService.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/Grants/PersistedGrantAppService.cs index d6d91f2d5..7f416d6dd 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/Grants/PersistedGrantAppService.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/Grants/PersistedGrantAppService.cs @@ -5,48 +5,47 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.IdentityServer.Grants; -namespace LINGYUN.Abp.IdentityServer.Grants +namespace LINGYUN.Abp.IdentityServer.Grants; + +[Authorize(AbpIdentityServerPermissions.Grants.Default)] +public class PersistedGrantAppService : AbpIdentityServerAppServiceBase, IPersistedGrantAppService { - [Authorize(AbpIdentityServerPermissions.Grants.Default)] - public class PersistedGrantAppService : AbpIdentityServerAppServiceBase, IPersistedGrantAppService + protected IPersistentGrantRepository PersistentGrantRepository { get; } + + public PersistedGrantAppService( + IPersistentGrantRepository persistentGrantRepository) + { + PersistentGrantRepository = persistentGrantRepository; + } + + [Authorize(AbpIdentityServerPermissions.Grants.Delete)] + public async virtual Task DeleteAsync(Guid id) { - protected IPersistentGrantRepository PersistentGrantRepository { get; } - - public PersistedGrantAppService( - IPersistentGrantRepository persistentGrantRepository) - { - PersistentGrantRepository = persistentGrantRepository; - } - - [Authorize(AbpIdentityServerPermissions.Grants.Delete)] - public async virtual Task DeleteAsync(Guid id) - { - var persistedGrant = await PersistentGrantRepository.GetAsync(id); - - await PersistentGrantRepository.DeleteAsync(persistedGrant); - await CurrentUnitOfWork.SaveChangesAsync(); - } - - public async virtual Task GetAsync(Guid id) - { - var persistedGrant = await PersistentGrantRepository.GetAsync(id); - - return ObjectMapper.Map(persistedGrant); - } - - public async virtual Task> GetListAsync(GetPersistedGrantInput input) - { - var persistenGrantCount = await PersistentGrantRepository - .GetCountAsync( - input.SubjectId, input.Filter); - - var persistenGrants = await PersistentGrantRepository - .GetListAsync( - input.SubjectId, input.Filter, input.Sorting, - input.SkipCount, input.MaxResultCount); - - return new PagedResultDto(persistenGrantCount, - ObjectMapper.Map, List>(persistenGrants)); - } + var persistedGrant = await PersistentGrantRepository.GetAsync(id); + + await PersistentGrantRepository.DeleteAsync(persistedGrant); + await CurrentUnitOfWork.SaveChangesAsync(); + } + + public async virtual Task GetAsync(Guid id) + { + var persistedGrant = await PersistentGrantRepository.GetAsync(id); + + return ObjectMapper.Map(persistedGrant); + } + + public async virtual Task> GetListAsync(GetPersistedGrantInput input) + { + var persistenGrantCount = await PersistentGrantRepository + .GetCountAsync( + input.SubjectId, input.Filter); + + var persistenGrants = await PersistentGrantRepository + .GetListAsync( + input.SubjectId, input.Filter, input.Sorting, + input.SkipCount, input.MaxResultCount); + + return new PagedResultDto(persistenGrantCount, + ObjectMapper.Map, List>(persistenGrants)); } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/IdentityResources/IdentityResourceAppService.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/IdentityResources/IdentityResourceAppService.cs index e7ab7d806..5b583732b 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/IdentityResources/IdentityResourceAppService.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Application/LINGYUN/Abp/IdentityServer/IdentityResources/IdentityResourceAppService.cs @@ -7,123 +7,122 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.IdentityServer.IdentityResources; -namespace LINGYUN.Abp.IdentityServer.IdentityResources +namespace LINGYUN.Abp.IdentityServer.IdentityResources; + +[Authorize(AbpIdentityServerPermissions.IdentityResources.Default)] +public class IdentityResourceAppService : AbpIdentityServerAppServiceBase, IIdentityResourceAppService { - [Authorize(AbpIdentityServerPermissions.IdentityResources.Default)] - public class IdentityResourceAppService : AbpIdentityServerAppServiceBase, IIdentityResourceAppService + protected IIdentityResourceRepository IdentityResourceRepository { get; } + + public IdentityResourceAppService( + IIdentityResourceRepository identityResourceRepository) { - protected IIdentityResourceRepository IdentityResourceRepository { get; } + IdentityResourceRepository = identityResourceRepository; + } - public IdentityResourceAppService( - IIdentityResourceRepository identityResourceRepository) - { - IdentityResourceRepository = identityResourceRepository; - } + public async virtual Task GetAsync(Guid id) + { + var identityResource = await IdentityResourceRepository.GetAsync(id); - public async virtual Task GetAsync(Guid id) - { - var identityResource = await IdentityResourceRepository.GetAsync(id); + return ObjectMapper.Map(identityResource); + } - return ObjectMapper.Map(identityResource); - } + public async virtual Task> GetListAsync(IdentityResourceGetByPagedDto input) + { + var identityResources = await IdentityResourceRepository.GetListAsync(input.Sorting, + input.SkipCount, input.MaxResultCount, + input.Filter); + var identityResourceCount = await IdentityResourceRepository.GetCountAsync(); - public async virtual Task> GetListAsync(IdentityResourceGetByPagedDto input) - { - var identityResources = await IdentityResourceRepository.GetListAsync(input.Sorting, - input.SkipCount, input.MaxResultCount, - input.Filter); - var identityResourceCount = await IdentityResourceRepository.GetCountAsync(); + return new PagedResultDto(identityResourceCount, + ObjectMapper.Map, List>(identityResources)); + } - return new PagedResultDto(identityResourceCount, - ObjectMapper.Map, List>(identityResources)); + [Authorize(AbpIdentityServerPermissions.IdentityResources.Create)] + public async virtual Task CreateAsync(IdentityResourceCreateOrUpdateDto input) + { + var identityResourceExists = await IdentityResourceRepository.CheckNameExistAsync(input.Name); + if (identityResourceExists) + { + throw new UserFriendlyException(L[AbpIdentityServerErrorConsts.IdentityResourceNameExisted, input.Name]); } + var identityResource = new IdentityResource(GuidGenerator.Create(), input.Name, input.DisplayName, + input.Description, input.Enabled, input.Required, input.Emphasize, + input.ShowInDiscoveryDocument); + await UpdateApiResourceByInputAsync(identityResource, input); - [Authorize(AbpIdentityServerPermissions.IdentityResources.Create)] - public async virtual Task CreateAsync(IdentityResourceCreateOrUpdateDto input) - { - var identityResourceExists = await IdentityResourceRepository.CheckNameExistAsync(input.Name); - if (identityResourceExists) - { - throw new UserFriendlyException(L[AbpIdentityServerErrorConsts.IdentityResourceNameExisted, input.Name]); - } - var identityResource = new IdentityResource(GuidGenerator.Create(), input.Name, input.DisplayName, - input.Description, input.Enabled, input.Required, input.Emphasize, - input.ShowInDiscoveryDocument); - await UpdateApiResourceByInputAsync(identityResource, input); + await CurrentUnitOfWork.SaveChangesAsync(); - await CurrentUnitOfWork.SaveChangesAsync(); + identityResource = await IdentityResourceRepository.InsertAsync(identityResource); - identityResource = await IdentityResourceRepository.InsertAsync(identityResource); + return ObjectMapper.Map(identityResource); + } - return ObjectMapper.Map(identityResource); - } + [Authorize(AbpIdentityServerPermissions.IdentityResources.Update)] + public async virtual Task UpdateAsync(Guid id, IdentityResourceCreateOrUpdateDto input) + { + var identityResource = await IdentityResourceRepository.GetAsync(id); + await UpdateApiResourceByInputAsync(identityResource, input); + identityResource = await IdentityResourceRepository.UpdateAsync(identityResource); - [Authorize(AbpIdentityServerPermissions.IdentityResources.Update)] - public async virtual Task UpdateAsync(Guid id, IdentityResourceCreateOrUpdateDto input) - { - var identityResource = await IdentityResourceRepository.GetAsync(id); - await UpdateApiResourceByInputAsync(identityResource, input); - identityResource = await IdentityResourceRepository.UpdateAsync(identityResource); + await CurrentUnitOfWork.SaveChangesAsync(); - await CurrentUnitOfWork.SaveChangesAsync(); + return ObjectMapper.Map(identityResource); + } - return ObjectMapper.Map(identityResource); - } + [Authorize(AbpIdentityServerPermissions.IdentityResources.Delete)] + public async virtual Task DeleteAsync(Guid id) + { + await IdentityResourceRepository.DeleteAsync(id); + } - [Authorize(AbpIdentityServerPermissions.IdentityResources.Delete)] - public async virtual Task DeleteAsync(Guid id) + protected async virtual Task UpdateApiResourceByInputAsync(IdentityResource identityResource, IdentityResourceCreateOrUpdateDto input) + { + if (!string.Equals(identityResource.Name, input.Name, StringComparison.InvariantCultureIgnoreCase)) { - await IdentityResourceRepository.DeleteAsync(id); + identityResource.Name = input.Name; } - - protected async virtual Task UpdateApiResourceByInputAsync(IdentityResource identityResource, IdentityResourceCreateOrUpdateDto input) + if (!string.Equals(identityResource.Description, input.Description, StringComparison.InvariantCultureIgnoreCase)) { - if (!string.Equals(identityResource.Name, input.Name, StringComparison.InvariantCultureIgnoreCase)) - { - identityResource.Name = input.Name; - } - if (!string.Equals(identityResource.Description, input.Description, StringComparison.InvariantCultureIgnoreCase)) - { - identityResource.Description = input.Description; - } - if (!string.Equals(identityResource.DisplayName, input.DisplayName, StringComparison.InvariantCultureIgnoreCase)) - { - identityResource.DisplayName = input.DisplayName; - } - identityResource.Emphasize = input.Emphasize; - identityResource.Enabled = input.Enabled; - identityResource.Required = input.Required; - identityResource.ShowInDiscoveryDocument = input.ShowInDiscoveryDocument; + identityResource.Description = input.Description; + } + if (!string.Equals(identityResource.DisplayName, input.DisplayName, StringComparison.InvariantCultureIgnoreCase)) + { + identityResource.DisplayName = input.DisplayName; + } + identityResource.Emphasize = input.Emphasize; + identityResource.Enabled = input.Enabled; + identityResource.Required = input.Required; + identityResource.ShowInDiscoveryDocument = input.ShowInDiscoveryDocument; - if (await IsGrantAsync(AbpIdentityServerPermissions.IdentityResources.ManageClaims)) + if (await IsGrantAsync(AbpIdentityServerPermissions.IdentityResources.ManageClaims)) + { + // 删除不存在的UserClaim + identityResource.UserClaims.RemoveAll(claim => input.UserClaims.Any(inputClaim => claim.Type == inputClaim.Type)); + foreach (var inputClaim in input.UserClaims) { - // 删除不存在的UserClaim - identityResource.UserClaims.RemoveAll(claim => input.UserClaims.Any(inputClaim => claim.Type == inputClaim.Type)); - foreach (var inputClaim in input.UserClaims) + var userClaim = identityResource.FindUserClaim(inputClaim.Type); + if (userClaim == null) { - var userClaim = identityResource.FindUserClaim(inputClaim.Type); - if (userClaim == null) - { - identityResource.AddUserClaim(inputClaim.Type); - } + identityResource.AddUserClaim(inputClaim.Type); } } + } - if (await IsGrantAsync(AbpIdentityServerPermissions.IdentityResources.ManageProperties)) + if (await IsGrantAsync(AbpIdentityServerPermissions.IdentityResources.ManageProperties)) + { + // 删除不存在的Property + identityResource.Properties.RemoveAll(prop => !input.Properties.Any(inputProp => prop.Key == inputProp.Key)); + foreach (var inputProp in input.Properties) { - // 删除不存在的Property - identityResource.Properties.RemoveAll(prop => !input.Properties.Any(inputProp => prop.Key == inputProp.Key)); - foreach (var inputProp in input.Properties) + var identityResourceProperty = identityResource.FindProperty(inputProp.Key); + if (identityResourceProperty == null) + { + identityResource.AddProperty(inputProp.Key, inputProp.Value); + } + else { - var identityResourceProperty = identityResource.FindProperty(inputProp.Key); - if (identityResourceProperty == null) - { - identityResource.AddProperty(inputProp.Key, inputProp.Value); - } - else - { - identityResourceProperty.Value = inputProp.Value; - } + identityResourceProperty.Value = inputProp.Value; } } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN.Abp.IdentityServer.Domain.csproj b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN.Abp.IdentityServer.Domain.csproj index 34e30b856..833b57e0a 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN.Abp.IdentityServer.Domain.csproj +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN.Abp.IdentityServer.Domain.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.IdentityServer.Domain + LINGYUN.Abp.IdentityServer.Domain + false + false + false diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/AbpEventService.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/AbpEventService.cs new file mode 100644 index 000000000..d4837b9c5 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/AbpEventService.cs @@ -0,0 +1,37 @@ +using IdentityServer4.Events; +using IdentityServer4.Services; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; +using System.Threading.Tasks; + +namespace LINGYUN.Abp.IdentityServer; +public class AbpEventService : IEventService +{ + protected IServiceScopeFactory ServiceScopeFactory { get; } + protected IOptions Options { get; } + + public AbpEventService( + IServiceScopeFactory serviceScopeFactory, + IOptions options) + { + ServiceScopeFactory = serviceScopeFactory; + Options = options; + } + + public virtual bool CanRaiseEventType(EventTypes evtType) + { + return true; + } + + public async virtual Task RaiseAsync(Event evt) + { + using (var scope = ServiceScopeFactory.CreateScope()) + { + foreach (var providerType in Options.Value.EventServiceHandlers) + { + var provider = (IAbpIdentityServerEventServiceHandler)scope.ServiceProvider.GetRequiredService(providerType); + await provider.RaiseAsync(evt); + } + } + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/AbpIdentityServerDomainModule.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/AbpIdentityServerDomainModule.cs index 75425eb96..b2b28a76a 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/AbpIdentityServerDomainModule.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/AbpIdentityServerDomainModule.cs @@ -1,9 +1,20 @@ -using Volo.Abp.Modularity; +using IdentityServer4.Services; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection.Extensions; +using Volo.Abp.Modularity; -namespace LINGYUN.Abp.IdentityServer +namespace LINGYUN.Abp.IdentityServer; + +[DependsOn(typeof(Volo.Abp.IdentityServer.AbpIdentityServerDomainModule))] +public class AbpIdentityServerDomainModule : AbpModule { - [DependsOn(typeof(Volo.Abp.IdentityServer.AbpIdentityServerDomainModule))] - public class AbpIdentityServerDomainModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { + Configure(options => + { + options.EventServiceHandlers.Add(); + }); + + context.Services.Replace(ServiceDescriptor.Transient()); } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/AbpIdentityServerEventOptions.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/AbpIdentityServerEventOptions.cs new file mode 100644 index 000000000..c9dee5d1e --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/AbpIdentityServerEventOptions.cs @@ -0,0 +1,11 @@ +using Volo.Abp.Collections; + +namespace LINGYUN.Abp.IdentityServer; +public class AbpIdentityServerEventOptions +{ + public ITypeList EventServiceHandlers { get; } + public AbpIdentityServerEventOptions() + { + EventServiceHandlers = new TypeList(); + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/AbpIdentityServerEventServiceHandler.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/AbpIdentityServerEventServiceHandler.cs new file mode 100644 index 000000000..9cafcf2f0 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/AbpIdentityServerEventServiceHandler.cs @@ -0,0 +1,135 @@ +using IdentityServer4.Configuration; +using IdentityServer4.Events; +using IdentityServer4.Services; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Internal; +using System; +using System.Diagnostics; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Timing; + +namespace LINGYUN.Abp.IdentityServer; + +/// +/// The default event service +/// +/// +public class AbpIdentityServerEventServiceHandler : IAbpIdentityServerEventServiceHandler, ITransientDependency +{ + /// + /// The options + /// + protected readonly IdentityServerOptions Options; + + /// + /// The context + /// + protected readonly IHttpContextAccessor Context; + + /// + /// The sink + /// + protected readonly IEventSink Sink; + + /// + /// The clock + /// + protected readonly IClock Clock; + + /// + /// Initializes a new instance of the class. + /// + /// The options. + /// The context. + /// The sink. + /// The clock. + public AbpIdentityServerEventServiceHandler(IdentityServerOptions options, IHttpContextAccessor context, IEventSink sink, IClock clock) + { + Options = options; + Context = context; + Sink = sink; + Clock = clock; + } + + /// + /// Raises the specified event. + /// + /// The event. + /// + /// evt + public async virtual Task RaiseAsync(Event evt) + { + if (evt == null) throw new ArgumentNullException(nameof(evt)); + + if (CanRaiseEvent(evt)) + { + await PrepareEventAsync(evt); + await Sink.PersistAsync(evt); + } + } + + /// + /// Indicates if the type of event will be persisted. + /// + /// + /// + /// + public virtual bool CanRaiseEventType(EventTypes evtType) + { + return evtType switch + { + EventTypes.Failure => Options.Events.RaiseFailureEvents, + EventTypes.Information => Options.Events.RaiseInformationEvents, + EventTypes.Success => Options.Events.RaiseSuccessEvents, + EventTypes.Error => Options.Events.RaiseErrorEvents, + _ => throw new ArgumentOutOfRangeException(nameof(evtType)), + }; + } + + /// + /// Determines whether this event would be persisted. + /// + /// The evt. + /// + /// true if this event would be persisted; otherwise, false. + /// + protected virtual bool CanRaiseEvent(Event evt) + { + return CanRaiseEventType(evt.EventType); + } + + /// + /// Prepares the event. + /// + /// The evt. + /// + protected virtual Task PrepareEventAsync(Event evt) + { + evt.ActivityId = Context.HttpContext.TraceIdentifier; + evt.TimeStamp = Clock.Now; + evt.ProcessId = Process.GetCurrentProcess().Id; + + if (Context.HttpContext.Connection.LocalIpAddress != null) + { + evt.LocalIpAddress = Context.HttpContext.Connection.LocalIpAddress.ToString() + ":" + Context.HttpContext.Connection.LocalPort; + } + else + { + evt.LocalIpAddress = "unknown"; + } + + if (Context.HttpContext.Connection.RemoteIpAddress != null) + { + evt.RemoteIpAddress = Context.HttpContext.Connection.RemoteIpAddress.ToString(); + } + else + { + evt.RemoteIpAddress = "unknown"; + } + // TODO: Event.PrepareAsync(); + // await evt.PrepareAsync(); + + return Task.CompletedTask; + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/ApiResources/IApiResourceRepository.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/ApiResources/IApiResourceRepository.cs index e35232afd..678857520 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/ApiResources/IApiResourceRepository.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/ApiResources/IApiResourceRepository.cs @@ -2,10 +2,9 @@ using System.Threading; using System.Threading.Tasks; -namespace LINGYUN.Abp.IdentityServer.ApiResources +namespace LINGYUN.Abp.IdentityServer.ApiResources; + +public interface IApiResourceRepository : Volo.Abp.IdentityServer.ApiResources.IApiResourceRepository { - public interface IApiResourceRepository : Volo.Abp.IdentityServer.ApiResources.IApiResourceRepository - { - Task> GetNamesAsync(CancellationToken cancellationToken = default); - } + Task> GetNamesAsync(CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/Grants/IPersistentGrantRepository.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/Grants/IPersistentGrantRepository.cs index b027523c5..340f47f1b 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/Grants/IPersistentGrantRepository.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/Grants/IPersistentGrantRepository.cs @@ -3,21 +3,20 @@ using System.Threading.Tasks; using Volo.Abp.IdentityServer.Grants; -namespace LINGYUN.Abp.IdentityServer.Grants +namespace LINGYUN.Abp.IdentityServer.Grants; + +public interface IPersistentGrantRepository : Volo.Abp.IdentityServer.Grants.IPersistentGrantRepository { - public interface IPersistentGrantRepository : Volo.Abp.IdentityServer.Grants.IPersistentGrantRepository - { - Task GetCountAsync( - string subjectId = null, - string filter = null, - CancellationToken cancellation = default); + Task GetCountAsync( + string subjectId = null, + string filter = null, + CancellationToken cancellation = default); - Task> GetListAsync( - string subjectId = null, - string filter = null, - string sorting = nameof(PersistedGrant.CreationTime), - int skipCount = 1, - int maxResultCount = 10, - CancellationToken cancellation = default); - } + Task> GetListAsync( + string subjectId = null, + string filter = null, + string sorting = nameof(PersistedGrant.CreationTime), + int skipCount = 1, + int maxResultCount = 10, + CancellationToken cancellation = default); } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/IAbpIdentityServerEventServiceHandler.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/IAbpIdentityServerEventServiceHandler.cs new file mode 100644 index 000000000..8e9413b80 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/IAbpIdentityServerEventServiceHandler.cs @@ -0,0 +1,10 @@ +using IdentityServer4.Events; +using System.Threading.Tasks; + +namespace LINGYUN.Abp.IdentityServer; +public interface IAbpIdentityServerEventServiceHandler +{ + Task RaiseAsync(Event evt); + + bool CanRaiseEventType(EventTypes evtType); +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/IdentityResources/CustomIdentityResourceDataSeeder.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/IdentityResources/CustomIdentityResourceDataSeeder.cs index ab75bdf54..f064ab276 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/IdentityResources/CustomIdentityResourceDataSeeder.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/IdentityResources/CustomIdentityResourceDataSeeder.cs @@ -5,69 +5,68 @@ using Volo.Abp.Identity; using Volo.Abp.IdentityServer.IdentityResources; -namespace LINGYUN.Abp.IdentityServer.IdentityResources +namespace LINGYUN.Abp.IdentityServer.IdentityResources; + +public class CustomIdentityResourceDataSeeder : ICustomIdentityResourceDataSeeder, ITransientDependency { - public class CustomIdentityResourceDataSeeder : ICustomIdentityResourceDataSeeder, ITransientDependency - { - protected IIdentityClaimTypeRepository ClaimTypeRepository { get; } - protected IIdentityResourceRepository IdentityResourceRepository { get; } - protected IGuidGenerator GuidGenerator { get; } - protected CustomIdentityResourceDataSeederOptions Options { get; } + protected IIdentityClaimTypeRepository ClaimTypeRepository { get; } + protected IIdentityResourceRepository IdentityResourceRepository { get; } + protected IGuidGenerator GuidGenerator { get; } + protected CustomIdentityResourceDataSeederOptions Options { get; } - public CustomIdentityResourceDataSeeder( - IIdentityResourceRepository identityResourceRepository, - IGuidGenerator guidGenerator, - IIdentityClaimTypeRepository claimTypeRepository, - IOptions options) - { - IdentityResourceRepository = identityResourceRepository; - GuidGenerator = guidGenerator; - ClaimTypeRepository = claimTypeRepository; - Options = options.Value; - } + public CustomIdentityResourceDataSeeder( + IIdentityResourceRepository identityResourceRepository, + IGuidGenerator guidGenerator, + IIdentityClaimTypeRepository claimTypeRepository, + IOptions options) + { + IdentityResourceRepository = identityResourceRepository; + GuidGenerator = guidGenerator; + ClaimTypeRepository = claimTypeRepository; + Options = options.Value; + } - public async virtual Task CreateCustomResourcesAsync() + public async virtual Task CreateCustomResourcesAsync() + { + foreach (var resource in Options.Resources) { - foreach (var resource in Options.Resources) + foreach (var claimType in resource.UserClaims) { - foreach (var claimType in resource.UserClaims) - { - await AddClaimTypeIfNotExistsAsync(claimType); - } - - await AddIdentityResourceIfNotExistsAsync(resource); + await AddClaimTypeIfNotExistsAsync(claimType); } + + await AddIdentityResourceIfNotExistsAsync(resource); } + } - protected async virtual Task AddIdentityResourceIfNotExistsAsync(IdentityServer4.Models.IdentityResource resource) + protected async virtual Task AddIdentityResourceIfNotExistsAsync(IdentityServer4.Models.IdentityResource resource) + { + if (await IdentityResourceRepository.CheckNameExistAsync(resource.Name)) { - if (await IdentityResourceRepository.CheckNameExistAsync(resource.Name)) - { - return; - } - - await IdentityResourceRepository.InsertAsync( - new IdentityResource( - GuidGenerator.Create(), - resource - ) - ); + return; } - protected async virtual Task AddClaimTypeIfNotExistsAsync(string claimType) - { - if (await ClaimTypeRepository.AnyAsync(claimType)) - { - return; - } + await IdentityResourceRepository.InsertAsync( + new IdentityResource( + GuidGenerator.Create(), + resource + ) + ); + } - await ClaimTypeRepository.InsertAsync( - new IdentityClaimType( - GuidGenerator.Create(), - claimType, - isStatic: true - ) - ); + protected async virtual Task AddClaimTypeIfNotExistsAsync(string claimType) + { + if (await ClaimTypeRepository.AnyAsync(claimType)) + { + return; } + + await ClaimTypeRepository.InsertAsync( + new IdentityClaimType( + GuidGenerator.Create(), + claimType, + isStatic: true + ) + ); } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/IdentityResources/CustomIdentityResourceDataSeederOptions.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/IdentityResources/CustomIdentityResourceDataSeederOptions.cs index 28dc48ea5..ec969d445 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/IdentityResources/CustomIdentityResourceDataSeederOptions.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/IdentityResources/CustomIdentityResourceDataSeederOptions.cs @@ -1,14 +1,13 @@ using IdentityServer4.Models; using System.Collections.Generic; -namespace LINGYUN.Abp.IdentityServer.IdentityResources +namespace LINGYUN.Abp.IdentityServer.IdentityResources; + +public class CustomIdentityResourceDataSeederOptions { - public class CustomIdentityResourceDataSeederOptions + public IList Resources { get; } + public CustomIdentityResourceDataSeederOptions() { - public IList Resources { get; } - public CustomIdentityResourceDataSeederOptions() - { - Resources = new List(); - } + Resources = new List(); } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/IdentityResources/ICustomIdentityResourceDataSeeder.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/IdentityResources/ICustomIdentityResourceDataSeeder.cs index e6b58a3c5..a7b022fca 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/IdentityResources/ICustomIdentityResourceDataSeeder.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/IdentityResources/ICustomIdentityResourceDataSeeder.cs @@ -1,9 +1,8 @@ using System.Threading.Tasks; -namespace LINGYUN.Abp.IdentityServer.IdentityResources +namespace LINGYUN.Abp.IdentityServer.IdentityResources; + +public interface ICustomIdentityResourceDataSeeder { - public interface ICustomIdentityResourceDataSeeder - { - Task CreateCustomResourcesAsync(); - } + Task CreateCustomResourcesAsync(); } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/IdentityResources/IIdentityResourceRepository.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/IdentityResources/IIdentityResourceRepository.cs index 2b7626469..9bb84367b 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/IdentityResources/IIdentityResourceRepository.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Domain/LINGYUN/Abp/IdentityServer/IdentityResources/IIdentityResourceRepository.cs @@ -2,10 +2,9 @@ using System.Threading; using System.Threading.Tasks; -namespace LINGYUN.Abp.IdentityServer.IdentityResources +namespace LINGYUN.Abp.IdentityServer.IdentityResources; + +public interface IIdentityResourceRepository : Volo.Abp.IdentityServer.IdentityResources.IIdentityResourceRepository { - public interface IIdentityResourceRepository : Volo.Abp.IdentityServer.IdentityResources.IIdentityResourceRepository - { - Task> GetNamesAsync(CancellationToken cancellationToken = default); - } + Task> GetNamesAsync(CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/LINGYUN.Abp.IdentityServer.EntityFrameworkCore.csproj b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/LINGYUN.Abp.IdentityServer.EntityFrameworkCore.csproj index 0187d6358..bdaf0ccd2 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/LINGYUN.Abp.IdentityServer.EntityFrameworkCore.csproj +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/LINGYUN.Abp.IdentityServer.EntityFrameworkCore.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.IdentityServer.EntityFrameworkCore + LINGYUN.Abp.IdentityServer.EntityFrameworkCore + false + false + false diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/LINGYUN/Abp/IdentityServer/ApiResources/EfCoreApiResourceRepository.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/LINGYUN/Abp/IdentityServer/ApiResources/EfCoreApiResourceRepository.cs index 473813a62..9a41a4dea 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/LINGYUN/Abp/IdentityServer/ApiResources/EfCoreApiResourceRepository.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/LINGYUN/Abp/IdentityServer/ApiResources/EfCoreApiResourceRepository.cs @@ -9,27 +9,26 @@ using Volo.Abp.IdentityServer.ApiResources; using Volo.Abp.IdentityServer.EntityFrameworkCore; -namespace LINGYUN.Abp.IdentityServer.ApiResources +namespace LINGYUN.Abp.IdentityServer.ApiResources; + +[Dependency(ServiceLifetime.Transient)] +[ExposeServices( + typeof(IApiResourceRepository), + typeof(ApiResourceRepository), + typeof(Volo.Abp.IdentityServer.ApiResources.IApiResourceRepository))] +public class EfCoreApiResourceRepository : ApiResourceRepository, IApiResourceRepository { - [Dependency(ServiceLifetime.Transient)] - [ExposeServices( - typeof(IApiResourceRepository), - typeof(ApiResourceRepository), - typeof(Volo.Abp.IdentityServer.ApiResources.IApiResourceRepository))] - public class EfCoreApiResourceRepository : ApiResourceRepository, IApiResourceRepository + public EfCoreApiResourceRepository( + IDbContextProvider dbContextProvider) + : base(dbContextProvider) { - public EfCoreApiResourceRepository( - IDbContextProvider dbContextProvider) - : base(dbContextProvider) - { - } + } - public async virtual Task> GetNamesAsync(CancellationToken cancellationToken = default) - { - return await (await GetDbSetAsync()) - .Select(x => x.Name) - .Distinct() - .ToListAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task> GetNamesAsync(CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()) + .Select(x => x.Name) + .Distinct() + .ToListAsync(GetCancellationToken(cancellationToken)); } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/LINGYUN/Abp/IdentityServer/EntityFrameworkCore/AbpIdentityServerEntityFrameworkCoreModule.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/LINGYUN/Abp/IdentityServer/EntityFrameworkCore/AbpIdentityServerEntityFrameworkCoreModule.cs index 77cea008d..209a68b3f 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/LINGYUN/Abp/IdentityServer/EntityFrameworkCore/AbpIdentityServerEntityFrameworkCoreModule.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/LINGYUN/Abp/IdentityServer/EntityFrameworkCore/AbpIdentityServerEntityFrameworkCoreModule.cs @@ -1,10 +1,9 @@ using Volo.Abp.Modularity; -namespace LINGYUN.Abp.IdentityServer.EntityFrameworkCore +namespace LINGYUN.Abp.IdentityServer.EntityFrameworkCore; + +[DependsOn(typeof(LINGYUN.Abp.IdentityServer.AbpIdentityServerDomainModule))] +[DependsOn(typeof(Volo.Abp.IdentityServer.EntityFrameworkCore.AbpIdentityServerEntityFrameworkCoreModule))] +public class AbpIdentityServerEntityFrameworkCoreModule : AbpModule { - [DependsOn(typeof(LINGYUN.Abp.IdentityServer.AbpIdentityServerDomainModule))] - [DependsOn(typeof(Volo.Abp.IdentityServer.EntityFrameworkCore.AbpIdentityServerEntityFrameworkCoreModule))] - public class AbpIdentityServerEntityFrameworkCoreModule : AbpModule - { - } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/LINGYUN/Abp/IdentityServer/Grants/EfCorePersistentGrantRepository.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/LINGYUN/Abp/IdentityServer/Grants/EfCorePersistentGrantRepository.cs index 47248469a..78572db67 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/LINGYUN/Abp/IdentityServer/Grants/EfCorePersistentGrantRepository.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/LINGYUN/Abp/IdentityServer/Grants/EfCorePersistentGrantRepository.cs @@ -10,42 +10,41 @@ using Volo.Abp.IdentityServer.EntityFrameworkCore; using Volo.Abp.IdentityServer.Grants; -namespace LINGYUN.Abp.IdentityServer.Grants +namespace LINGYUN.Abp.IdentityServer.Grants; + +[Dependency(ReplaceServices = true)] +[ExposeServices( + typeof(Volo.Abp.IdentityServer.Grants.IPersistentGrantRepository), + typeof(IPersistentGrantRepository), + typeof(PersistentGrantRepository))] +public class EfCorePersistentGrantRepository : PersistentGrantRepository, IPersistentGrantRepository { - [Dependency(ReplaceServices = true)] - [ExposeServices( - typeof(Volo.Abp.IdentityServer.Grants.IPersistentGrantRepository), - typeof(IPersistentGrantRepository), - typeof(PersistentGrantRepository))] - public class EfCorePersistentGrantRepository : PersistentGrantRepository, IPersistentGrantRepository + public EfCorePersistentGrantRepository( + IDbContextProvider dbContextProvider) + : base(dbContextProvider) { - public EfCorePersistentGrantRepository( - IDbContextProvider dbContextProvider) - : base(dbContextProvider) - { - } + } - public async virtual Task GetCountAsync(string subjectId = null, string filter = null, CancellationToken cancellation = default) - { - return await (await GetDbSetAsync()) - .WhereIf(!subjectId.IsNullOrWhiteSpace(), x => x.SubjectId.Equals(subjectId)) - .WhereIf(!filter.IsNullOrWhiteSpace(), x => - x.Type.Contains(filter) || x.ClientId.Contains(filter) || x.Key.Contains(filter)) - .LongCountAsync(GetCancellationToken(cancellation)); - } + public async virtual Task GetCountAsync(string subjectId = null, string filter = null, CancellationToken cancellation = default) + { + return await (await GetDbSetAsync()) + .WhereIf(!subjectId.IsNullOrWhiteSpace(), x => x.SubjectId.Equals(subjectId)) + .WhereIf(!filter.IsNullOrWhiteSpace(), x => + x.Type.Contains(filter) || x.ClientId.Contains(filter) || x.Key.Contains(filter)) + .LongCountAsync(GetCancellationToken(cancellation)); + } - public async virtual Task> GetListAsync(string subjectId = null, string filter = null, string sorting = "CreationTime", int skipCount = 1, int maxResultCount = 10, CancellationToken cancellation = default) + public async virtual Task> GetListAsync(string subjectId = null, string filter = null, string sorting = "CreationTime", int skipCount = 1, int maxResultCount = 10, CancellationToken cancellation = default) + { + if (sorting.IsNullOrWhiteSpace()) { - if (sorting.IsNullOrWhiteSpace()) - { - sorting = nameof(PersistedGrant.CreationTime); - } - return await (await GetDbSetAsync()) - .WhereIf(!subjectId.IsNullOrWhiteSpace(), x => x.SubjectId.Equals(subjectId)) - .WhereIf(!filter.IsNullOrWhiteSpace(), x => - x.Type.Contains(filter) || x.ClientId.Contains(filter) || x.Key.Contains(filter)) - .PageBy(skipCount, maxResultCount) - .ToListAsync(GetCancellationToken(cancellation)); + sorting = nameof(PersistedGrant.CreationTime); } + return await (await GetDbSetAsync()) + .WhereIf(!subjectId.IsNullOrWhiteSpace(), x => x.SubjectId.Equals(subjectId)) + .WhereIf(!filter.IsNullOrWhiteSpace(), x => + x.Type.Contains(filter) || x.ClientId.Contains(filter) || x.Key.Contains(filter)) + .PageBy(skipCount, maxResultCount) + .ToListAsync(GetCancellationToken(cancellation)); } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/LINGYUN/Abp/IdentityServer/IdentityResources/EfCoreIdentityResourceRepository.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/LINGYUN/Abp/IdentityServer/IdentityResources/EfCoreIdentityResourceRepository.cs index 7e4816803..dc1178ead 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/LINGYUN/Abp/IdentityServer/IdentityResources/EfCoreIdentityResourceRepository.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.EntityFrameworkCore/LINGYUN/Abp/IdentityServer/IdentityResources/EfCoreIdentityResourceRepository.cs @@ -9,27 +9,26 @@ using Volo.Abp.IdentityServer.EntityFrameworkCore; using Volo.Abp.IdentityServer.IdentityResources; -namespace LINGYUN.Abp.IdentityServer.IdentityResources +namespace LINGYUN.Abp.IdentityServer.IdentityResources; + +[Dependency(ServiceLifetime.Transient)] +[ExposeServices( + typeof(IIdentityResourceRepository), + typeof(IdentityResourceRepository), + typeof(Volo.Abp.IdentityServer.IdentityResources.IIdentityResourceRepository))] +public class EfCoreIdentityResourceRepository : IdentityResourceRepository, IIdentityResourceRepository { - [Dependency(ServiceLifetime.Transient)] - [ExposeServices( - typeof(IIdentityResourceRepository), - typeof(IdentityResourceRepository), - typeof(Volo.Abp.IdentityServer.IdentityResources.IIdentityResourceRepository))] - public class EfCoreIdentityResourceRepository : IdentityResourceRepository, IIdentityResourceRepository + public EfCoreIdentityResourceRepository( + IDbContextProvider dbContextProvider) + : base(dbContextProvider) { - public EfCoreIdentityResourceRepository( - IDbContextProvider dbContextProvider) - : base(dbContextProvider) - { - } + } - public async virtual Task> GetNamesAsync(CancellationToken cancellationToken = default) - { - return await (await GetDbSetAsync()) - .Select(x => x.Name) - .Distinct() - .ToListAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task> GetNamesAsync(CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()) + .Select(x => x.Name) + .Distinct() + .ToListAsync(GetCancellationToken(cancellationToken)); } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN.Abp.IdentityServer.HttpApi.csproj b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN.Abp.IdentityServer.HttpApi.csproj index cf9f68dee..e8e4045b1 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN.Abp.IdentityServer.HttpApi.csproj +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN.Abp.IdentityServer.HttpApi.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.IdentityServer.HttpApi + LINGYUN.Abp.IdentityServer.HttpApi + false + false + false diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN/Abp/IdentityServer/AbpIdentityServerHttpApiModule.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN/Abp/IdentityServer/AbpIdentityServerHttpApiModule.cs index 90e7c304d..891d852ca 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN/Abp/IdentityServer/AbpIdentityServerHttpApiModule.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN/Abp/IdentityServer/AbpIdentityServerHttpApiModule.cs @@ -6,35 +6,34 @@ using Volo.Abp.Localization; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.IdentityServer +namespace LINGYUN.Abp.IdentityServer; + +[DependsOn( + typeof(AbpIdentityServerApplicationContractsModule), + typeof(AbpAspNetCoreMvcModule) + )] +public class AbpIdentityServerHttpApiModule : AbpModule { - [DependsOn( - typeof(AbpIdentityServerApplicationContractsModule), - typeof(AbpAspNetCoreMvcModule) - )] - public class AbpIdentityServerHttpApiModule : AbpModule + public override void PreConfigureServices(ServiceConfigurationContext context) { - public override void PreConfigureServices(ServiceConfigurationContext context) + PreConfigure(options => { - PreConfigure(options => - { - options.AddAssemblyResource(typeof(AbpIdentityServerResource), typeof(AbpIdentityServerApplicationContractsModule).Assembly); - }); + options.AddAssemblyResource(typeof(AbpIdentityServerResource), typeof(AbpIdentityServerApplicationContractsModule).Assembly); + }); - PreConfigure(mvcBuilder => - { - mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpIdentityServerHttpApiModule).Assembly); - }); - } + PreConfigure(mvcBuilder => + { + mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpIdentityServerHttpApiModule).Assembly); + }); + } - public override void ConfigureServices(ServiceConfigurationContext context) + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => { - Configure(options => - { - options.Resources - .Get() - .AddBaseTypes(typeof(AbpUiResource)); - }); - } + options.Resources + .Get() + .AddBaseTypes(typeof(AbpUiResource)); + }); } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN/Abp/IdentityServer/ApiResources/ApiResourceController.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN/Abp/IdentityServer/ApiResources/ApiResourceController.cs index 9c899eec0..686e65578 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN/Abp/IdentityServer/ApiResources/ApiResourceController.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN/Abp/IdentityServer/ApiResources/ApiResourceController.cs @@ -5,51 +5,50 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.AspNetCore.Mvc; -namespace LINGYUN.Abp.IdentityServer.ApiResources +namespace LINGYUN.Abp.IdentityServer.ApiResources; + +[RemoteService(Name = AbpIdentityServerConsts.RemoteServiceName)] +[Area("identity-server")] +[Route("api/identity-server/api-resources")] +public class ApiResourceController : AbpControllerBase, IApiResourceAppService { - [RemoteService(Name = AbpIdentityServerConsts.RemoteServiceName)] - [Area("identity-server")] - [Route("api/identity-server/api-resources")] - public class ApiResourceController : AbpControllerBase, IApiResourceAppService + protected IApiResourceAppService ApiResourceAppService { get; } + public ApiResourceController( + IApiResourceAppService apiResourceAppService) { - protected IApiResourceAppService ApiResourceAppService { get; } - public ApiResourceController( - IApiResourceAppService apiResourceAppService) - { - ApiResourceAppService = apiResourceAppService; - } + ApiResourceAppService = apiResourceAppService; + } - [HttpGet] - [Route("{id}")] - public async virtual Task GetAsync(Guid id) - { - return await ApiResourceAppService.GetAsync(id); - } + [HttpGet] + [Route("{id}")] + public async virtual Task GetAsync(Guid id) + { + return await ApiResourceAppService.GetAsync(id); + } - [HttpGet] - public async virtual Task> GetListAsync(ApiResourceGetByPagedInputDto input) - { - return await ApiResourceAppService.GetListAsync(input); - } + [HttpGet] + public async virtual Task> GetListAsync(ApiResourceGetByPagedInputDto input) + { + return await ApiResourceAppService.GetListAsync(input); + } - [HttpPost] - public async virtual Task CreateAsync(ApiResourceCreateDto input) - { - return await ApiResourceAppService.CreateAsync(input); - } + [HttpPost] + public async virtual Task CreateAsync(ApiResourceCreateDto input) + { + return await ApiResourceAppService.CreateAsync(input); + } - [HttpPut] - [Route("{id}")] - public async virtual Task UpdateAsync(Guid id, ApiResourceUpdateDto input) - { - return await ApiResourceAppService.UpdateAsync(id, input); - } + [HttpPut] + [Route("{id}")] + public async virtual Task UpdateAsync(Guid id, ApiResourceUpdateDto input) + { + return await ApiResourceAppService.UpdateAsync(id, input); + } - [HttpDelete] - [Route("{id}")] - public async virtual Task DeleteAsync(Guid id) - { - await ApiResourceAppService.DeleteAsync(id); - } + [HttpDelete] + [Route("{id}")] + public async virtual Task DeleteAsync(Guid id) + { + await ApiResourceAppService.DeleteAsync(id); } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN/Abp/IdentityServer/ApiScopes/ApiScopeController.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN/Abp/IdentityServer/ApiScopes/ApiScopeController.cs index ee5ab6156..c8f181c8e 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN/Abp/IdentityServer/ApiScopes/ApiScopeController.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN/Abp/IdentityServer/ApiScopes/ApiScopeController.cs @@ -5,52 +5,51 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.AspNetCore.Mvc; -namespace LINGYUN.Abp.IdentityServer.ApiScopes +namespace LINGYUN.Abp.IdentityServer.ApiScopes; + +[RemoteService(Name = AbpIdentityServerConsts.RemoteServiceName)] +[Area("identity-server")] +[Route("api/identity-server/api-scopes")] +public class ApiScopeController : AbpControllerBase, IApiScopeAppService { - [RemoteService(Name = AbpIdentityServerConsts.RemoteServiceName)] - [Area("identity-server")] - [Route("api/identity-server/api-scopes")] - public class ApiScopeController : AbpControllerBase, IApiScopeAppService + protected IApiScopeAppService ApiScopeAppService { get; } + + public ApiScopeController( + IApiScopeAppService apiScopeAppService) + { + ApiScopeAppService = apiScopeAppService; + } + + [HttpPost] + public async virtual Task CreateAsync(ApiScopeCreateDto input) + { + return await ApiScopeAppService.CreateAsync(input); + } + + [HttpDelete] + [Route("{id}")] + public async virtual Task DeleteAsync(Guid id) + { + await ApiScopeAppService.DeleteAsync(id); + } + + [HttpGet] + [Route("{id}")] + public async virtual Task GetAsync(Guid id) + { + return await ApiScopeAppService.GetAsync(id); + } + + [HttpGet] + public async virtual Task> GetListAsync(GetApiScopeInput input) + { + return await ApiScopeAppService.GetListAsync(input); + } + + [HttpPut] + [Route("{id}")] + public async virtual Task UpdateAsync(Guid id, ApiScopeUpdateDto input) { - protected IApiScopeAppService ApiScopeAppService { get; } - - public ApiScopeController( - IApiScopeAppService apiScopeAppService) - { - ApiScopeAppService = apiScopeAppService; - } - - [HttpPost] - public async virtual Task CreateAsync(ApiScopeCreateDto input) - { - return await ApiScopeAppService.CreateAsync(input); - } - - [HttpDelete] - [Route("{id}")] - public async virtual Task DeleteAsync(Guid id) - { - await ApiScopeAppService.DeleteAsync(id); - } - - [HttpGet] - [Route("{id}")] - public async virtual Task GetAsync(Guid id) - { - return await ApiScopeAppService.GetAsync(id); - } - - [HttpGet] - public async virtual Task> GetListAsync(GetApiScopeInput input) - { - return await ApiScopeAppService.GetListAsync(input); - } - - [HttpPut] - [Route("{id}")] - public async virtual Task UpdateAsync(Guid id, ApiScopeUpdateDto input) - { - return await ApiScopeAppService.UpdateAsync(id, input); - } + return await ApiScopeAppService.UpdateAsync(id, input); } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN/Abp/IdentityServer/Clients/ClientController.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN/Abp/IdentityServer/Clients/ClientController.cs index 14885f6a5..0c9e077d5 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN/Abp/IdentityServer/Clients/ClientController.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN/Abp/IdentityServer/Clients/ClientController.cs @@ -5,78 +5,77 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.AspNetCore.Mvc; -namespace LINGYUN.Abp.IdentityServer.Clients +namespace LINGYUN.Abp.IdentityServer.Clients; + +[RemoteService(Name = AbpIdentityServerConsts.RemoteServiceName)] +[Area("identity-server")] +[Route("api/identity-server/clients")] +public class ClientController : AbpControllerBase, IClientAppService { - [RemoteService(Name = AbpIdentityServerConsts.RemoteServiceName)] - [Area("identity-server")] - [Route("api/identity-server/clients")] - public class ClientController : AbpControllerBase, IClientAppService + protected IClientAppService ClientAppService { get; } + public ClientController(IClientAppService clientAppService) { - protected IClientAppService ClientAppService { get; } - public ClientController(IClientAppService clientAppService) - { - ClientAppService = clientAppService; - } + ClientAppService = clientAppService; + } - [HttpPost] - public async virtual Task CreateAsync(ClientCreateDto input) - { - return await ClientAppService.CreateAsync(input); - } + [HttpPost] + public async virtual Task CreateAsync(ClientCreateDto input) + { + return await ClientAppService.CreateAsync(input); + } - [HttpDelete] - [Route("{id}")] - public async virtual Task DeleteAsync(Guid id) - { - await ClientAppService.DeleteAsync(id); - } + [HttpDelete] + [Route("{id}")] + public async virtual Task DeleteAsync(Guid id) + { + await ClientAppService.DeleteAsync(id); + } - [HttpGet] - [Route("{id}")] - public async virtual Task GetAsync(Guid id) - { - return await ClientAppService.GetAsync(id); - } + [HttpGet] + [Route("{id}")] + public async virtual Task GetAsync(Guid id) + { + return await ClientAppService.GetAsync(id); + } - [HttpGet] - public async virtual Task> GetListAsync(ClientGetByPagedDto input) - { - return await ClientAppService.GetListAsync(input); - } + [HttpGet] + public async virtual Task> GetListAsync(ClientGetByPagedDto input) + { + return await ClientAppService.GetListAsync(input); + } - [HttpPut] - [Route("{id}")] - public async virtual Task UpdateAsync(Guid id, ClientUpdateDto input) - { - return await ClientAppService.UpdateAsync(id, input); - } + [HttpPut] + [Route("{id}")] + public async virtual Task UpdateAsync(Guid id, ClientUpdateDto input) + { + return await ClientAppService.UpdateAsync(id, input); + } - [HttpPost] - [Route("{id}/clone")] - public async virtual Task CloneAsync(Guid id, ClientCloneDto input) - { - return await ClientAppService.CloneAsync(id, input); - } + [HttpPost] + [Route("{id}/clone")] + public async virtual Task CloneAsync(Guid id, ClientCloneDto input) + { + return await ClientAppService.CloneAsync(id, input); + } - [HttpGet] - [Route("assignable-api-resources")] - public async virtual Task> GetAssignableApiResourcesAsync() - { - return await ClientAppService.GetAssignableApiResourcesAsync(); - } + [HttpGet] + [Route("assignable-api-resources")] + public async virtual Task> GetAssignableApiResourcesAsync() + { + return await ClientAppService.GetAssignableApiResourcesAsync(); + } - [HttpGet] - [Route("assignable-identity-resources")] - public async virtual Task> GetAssignableIdentityResourcesAsync() - { - return await ClientAppService.GetAssignableIdentityResourcesAsync(); - } + [HttpGet] + [Route("assignable-identity-resources")] + public async virtual Task> GetAssignableIdentityResourcesAsync() + { + return await ClientAppService.GetAssignableIdentityResourcesAsync(); + } - [HttpGet] - [Route("distinct-cors-origins")] - public async virtual Task> GetAllDistinctAllowedCorsOriginsAsync() - { - return await ClientAppService.GetAllDistinctAllowedCorsOriginsAsync(); - } + [HttpGet] + [Route("distinct-cors-origins")] + public async virtual Task> GetAllDistinctAllowedCorsOriginsAsync() + { + return await ClientAppService.GetAllDistinctAllowedCorsOriginsAsync(); } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN/Abp/IdentityServer/Grants/PersistedGrantController.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN/Abp/IdentityServer/Grants/PersistedGrantController.cs index 31fdd30bb..1f19bc763 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN/Abp/IdentityServer/Grants/PersistedGrantController.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN/Abp/IdentityServer/Grants/PersistedGrantController.cs @@ -5,39 +5,38 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.AspNetCore.Mvc; -namespace LINGYUN.Abp.IdentityServer.Grants +namespace LINGYUN.Abp.IdentityServer.Grants; + +[RemoteService(Name = AbpIdentityServerConsts.RemoteServiceName)] +[Area("identity-server")] +[Route("api/identity-server/persisted-grants")] +public class PersistedGrantController : AbpControllerBase, IPersistedGrantAppService { - [RemoteService(Name = AbpIdentityServerConsts.RemoteServiceName)] - [Area("identity-server")] - [Route("api/identity-server/persisted-grants")] - public class PersistedGrantController : AbpControllerBase, IPersistedGrantAppService - { - protected IPersistedGrantAppService PersistedGrantAppService { get; } + protected IPersistedGrantAppService PersistedGrantAppService { get; } - public PersistedGrantController( - IPersistedGrantAppService persistedGrantAppService) - { - PersistedGrantAppService = persistedGrantAppService; - } + public PersistedGrantController( + IPersistedGrantAppService persistedGrantAppService) + { + PersistedGrantAppService = persistedGrantAppService; + } - [HttpDelete] - [Route("{id}")] - public async virtual Task DeleteAsync(Guid id) - { - await PersistedGrantAppService.DeleteAsync(id); - } + [HttpDelete] + [Route("{id}")] + public async virtual Task DeleteAsync(Guid id) + { + await PersistedGrantAppService.DeleteAsync(id); + } - [HttpGet] - [Route("{id}")] - public async virtual Task GetAsync(Guid id) - { - return await PersistedGrantAppService.GetAsync(id); - } + [HttpGet] + [Route("{id}")] + public async virtual Task GetAsync(Guid id) + { + return await PersistedGrantAppService.GetAsync(id); + } - [HttpGet] - public async virtual Task> GetListAsync(GetPersistedGrantInput input) - { - return await PersistedGrantAppService.GetListAsync(input); - } + [HttpGet] + public async virtual Task> GetListAsync(GetPersistedGrantInput input) + { + return await PersistedGrantAppService.GetListAsync(input); } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN/Abp/IdentityServer/IdentityResources/IdentityResourceController.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN/Abp/IdentityServer/IdentityResources/IdentityResourceController.cs index 0e47bc5f1..5c65792d1 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN/Abp/IdentityServer/IdentityResources/IdentityResourceController.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.HttpApi/LINGYUN/Abp/IdentityServer/IdentityResources/IdentityResourceController.cs @@ -5,51 +5,50 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.AspNetCore.Mvc; -namespace LINGYUN.Abp.IdentityServer.IdentityResources +namespace LINGYUN.Abp.IdentityServer.IdentityResources; + +[RemoteService(Name = AbpIdentityServerConsts.RemoteServiceName)] +[Area("identity-server")] +[Route("api/identity-server/identity-resources")] +public class IdentityResourceController : AbpControllerBase, IIdentityResourceAppService { - [RemoteService(Name = AbpIdentityServerConsts.RemoteServiceName)] - [Area("identity-server")] - [Route("api/identity-server/identity-resources")] - public class IdentityResourceController : AbpControllerBase, IIdentityResourceAppService + protected IIdentityResourceAppService IdentityResourceAppService { get; } + public IdentityResourceController( + IIdentityResourceAppService identityResourceAppService) { - protected IIdentityResourceAppService IdentityResourceAppService { get; } - public IdentityResourceController( - IIdentityResourceAppService identityResourceAppService) - { - IdentityResourceAppService = identityResourceAppService; - } + IdentityResourceAppService = identityResourceAppService; + } - [HttpGet] - [Route("{id}")] - public async virtual Task GetAsync(Guid id) - { - return await IdentityResourceAppService.GetAsync(id); - } + [HttpGet] + [Route("{id}")] + public async virtual Task GetAsync(Guid id) + { + return await IdentityResourceAppService.GetAsync(id); + } - [HttpGet] - public async virtual Task> GetListAsync(IdentityResourceGetByPagedDto input) - { - return await IdentityResourceAppService.GetListAsync(input); - } + [HttpGet] + public async virtual Task> GetListAsync(IdentityResourceGetByPagedDto input) + { + return await IdentityResourceAppService.GetListAsync(input); + } - [HttpPost] - public async virtual Task CreateAsync(IdentityResourceCreateOrUpdateDto input) - { - return await IdentityResourceAppService.CreateAsync(input); - } + [HttpPost] + public async virtual Task CreateAsync(IdentityResourceCreateOrUpdateDto input) + { + return await IdentityResourceAppService.CreateAsync(input); + } - [HttpPut] - [Route("{id}")] - public async virtual Task UpdateAsync(Guid id, IdentityResourceCreateOrUpdateDto input) - { - return await IdentityResourceAppService.UpdateAsync(id, input); - } + [HttpPut] + [Route("{id}")] + public async virtual Task UpdateAsync(Guid id, IdentityResourceCreateOrUpdateDto input) + { + return await IdentityResourceAppService.UpdateAsync(id, input); + } - [HttpDelete] - [Route("{id}")] - public async virtual Task DeleteAsync(Guid id) - { - await IdentityResourceAppService.DeleteAsync(id); - } + [HttpDelete] + [Route("{id}")] + public async virtual Task DeleteAsync(Guid id) + { + await IdentityResourceAppService.DeleteAsync(id); } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.LinkUser/LINGYUN.Abp.IdentityServer.LinkUser.csproj b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.LinkUser/LINGYUN.Abp.IdentityServer.LinkUser.csproj index bdd33732f..4e0092349 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.LinkUser/LINGYUN.Abp.IdentityServer.LinkUser.csproj +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.LinkUser/LINGYUN.Abp.IdentityServer.LinkUser.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.IdentityServer.LinkUser + LINGYUN.Abp.IdentityServer.LinkUser + false + false + false diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Portal/LINGYUN.Abp.IdentityServer.Portal.csproj b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Portal/LINGYUN.Abp.IdentityServer.Portal.csproj index 5d7f72177..107b4b3eb 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Portal/LINGYUN.Abp.IdentityServer.Portal.csproj +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Portal/LINGYUN.Abp.IdentityServer.Portal.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.IdentityServer.Portal + LINGYUN.Abp.IdentityServer.Portal + false + false + false diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Portal/LINGYUN/Abp/IdentityServer/Portal/PortalGrantValidator.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Portal/LINGYUN/Abp/IdentityServer/Portal/PortalGrantValidator.cs index e49e13bfc..9df9c0e19 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Portal/LINGYUN/Abp/IdentityServer/Portal/PortalGrantValidator.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Portal/LINGYUN/Abp/IdentityServer/Portal/PortalGrantValidator.cs @@ -197,7 +197,7 @@ public async virtual Task ValidateAsync(ExtensionGrantValidationContext context) var currentUser = await _userManager.GetUserAsync(resourceOwnerContext.Result.Subject); - await _events.RaiseAsync(new UserLoginSuccessEvent(userName, currentUser.Id.ToString(), currentUser.Name)); + await _events.RaiseAsync(new UserLoginSuccessEvent(userName, currentUser.Id.ToString(), currentUser.Name, clientId: resourceOwnerContext.Request.ClientId)); await SetSuccessResultAsync(context, currentUser); } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/FodyWeavers.xml b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/FodyWeavers.xml new file mode 100644 index 000000000..5d6962159 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/FodyWeavers.xsd b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/FodyWeavers.xsd new file mode 100644 index 000000000..3f3946e28 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/LINGYUN.Abp.IdentityServer.Session.csproj b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/LINGYUN.Abp.IdentityServer.Session.csproj new file mode 100644 index 000000000..7a9a5dbe9 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/LINGYUN.Abp.IdentityServer.Session.csproj @@ -0,0 +1,22 @@ + + + + + + + net8.0 + LINGYUN.Abp.IdentityServer.Session + LINGYUN.Abp.IdentityServer.Session + false + false + false + + + + + + + + + + diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/LINGYUN/Abp/IdentityServer/Session/AbpIdentityServerSessionModule.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/LINGYUN/Abp/IdentityServer/Session/AbpIdentityServerSessionModule.cs new file mode 100644 index 000000000..bd0abe656 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/LINGYUN/Abp/IdentityServer/Session/AbpIdentityServerSessionModule.cs @@ -0,0 +1,35 @@ +using IdentityServer4.Validation; +using LINGYUN.Abp.Identity; +using LINGYUN.Abp.Identity.Session; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection.Extensions; +using Volo.Abp.Modularity; + +namespace LINGYUN.Abp.IdentityServer.Session; + +[DependsOn( + typeof(AbpIdentityServerDomainModule), + typeof(AbpIdentityDomainModule), + typeof(AbpIdentitySessionModule))] +public class AbpIdentityServerSessionModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.EventServiceHandlers.Add(); + }); + + Configure(options => + { + // UserLoginSuccessEvent由IdentityServer发布, 无需显式保存会话 + options.SignInSessionEnabled = false; + // UserLoginSuccessEvent由用户发布, 需要显式注销会话 + options.SignOutSessionEnabled = true; + }); + + // 默认UserinfoEndpoint仅解密token + // 启用此模块需要验证会话有效性 + context.Services.Replace(ServiceDescriptor.Transient()); + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/LINGYUN/Abp/IdentityServer/Session/AbpIdentitySessionEventServiceHandler.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/LINGYUN/Abp/IdentityServer/Session/AbpIdentitySessionEventServiceHandler.cs new file mode 100644 index 000000000..38b6e1a03 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/LINGYUN/Abp/IdentityServer/Session/AbpIdentitySessionEventServiceHandler.cs @@ -0,0 +1,102 @@ +using IdentityServer4.Events; +using LINGYUN.Abp.Identity.Session; +using System; +using System.Security.Claims; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; +using Volo.Abp.MultiTenancy; +using Volo.Abp.Security.Claims; +using Volo.Abp.Uow; + +namespace LINGYUN.Abp.IdentityServer.Session; +/// +/// 持久化用户会话 +/// +public class AbpIdentitySessionEventServiceHandler : IAbpIdentityServerEventServiceHandler, ITransientDependency +{ + protected ICurrentTenant CurrentTenant { get; } + protected ISessionInfoProvider SessionInfoProvider { get; } + protected IIdentitySessionManager IdentitySessionManager { get; } + protected ICurrentPrincipalAccessor CurrentPrincipalAccessor { get; } + + public AbpIdentitySessionEventServiceHandler( + ICurrentTenant currentTenant, + ISessionInfoProvider sessionInfoProvider, + IIdentitySessionManager identitySessionManager, + ICurrentPrincipalAccessor currentPrincipalAccessor) + { + CurrentTenant = currentTenant; + SessionInfoProvider = sessionInfoProvider; + IdentitySessionManager = identitySessionManager; + CurrentPrincipalAccessor = currentPrincipalAccessor; + } + + public virtual bool CanRaiseEventType(EventTypes evtType) + { + return evtType == EventTypes.Success; + } + + [UnitOfWork] + public virtual Task RaiseAsync(Event evt) + { + if (evt is UserLoginSuccessEvent loginEvent) + { + // 用户登录事件 + return RaiseUserLoginSuccessEventAsync(loginEvent); + } + if (evt is UserLogoutSuccessEvent logoutEvent) + { + // 用户退出事件 + return RaiseUserLogoutSuccessEventAsync(logoutEvent); + } + if (evt is TokenRevokedSuccessEvent revokeEvent) + { + // 撤销令牌事件 + return RaiseTokenRevokedSuccessEventAsync(revokeEvent); + } + return Task.CompletedTask; + } + + protected async virtual Task RaiseUserLoginSuccessEventAsync(UserLoginSuccessEvent loginEvent) + { + var subjectId = loginEvent.SubjectId; + var sessionId = SessionInfoProvider.SessionId; + if (!sessionId.IsNullOrWhiteSpace() && + Guid.TryParse(subjectId, out var userId)) + { + var claimsIdentity = new ClaimsIdentity(); + claimsIdentity.AddClaim(new Claim(AbpClaimTypes.UserId, userId.ToString())); + claimsIdentity.AddClaim(new Claim(AbpClaimTypes.SessionId, sessionId)); + if (!loginEvent.ClientId.IsNullOrWhiteSpace()) + { + claimsIdentity.AddClaim(new Claim(AbpClaimTypes.ClientId, loginEvent.ClientId)); + } + if (CurrentTenant.IsAvailable) + { + claimsIdentity.AddClaim(new Claim(AbpClaimTypes.TenantId, CurrentTenant.Id.ToString())); + } + var claimsPrincipal = new ClaimsPrincipal(claimsIdentity); + using (CurrentPrincipalAccessor.Change(claimsPrincipal)) + { + await IdentitySessionManager.SaveSessionAsync(claimsPrincipal); + } + } + } + protected async virtual Task RaiseUserLogoutSuccessEventAsync(UserLogoutSuccessEvent logoutEvent) + { + var sessionId = SessionInfoProvider.SessionId; + if (!sessionId.IsNullOrWhiteSpace()) + { + await IdentitySessionManager.RevokeSessionAsync(sessionId); + } + } + + protected async virtual Task RaiseTokenRevokedSuccessEventAsync(TokenRevokedSuccessEvent revokeEvent) + { + var sessionId = SessionInfoProvider.SessionId; + if (!sessionId.IsNullOrWhiteSpace()) + { + await IdentitySessionManager.RevokeSessionAsync(sessionId); + } + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/LINGYUN/Abp/IdentityServer/Session/AbpIdentitySessionUserInfoRequestValidator.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/LINGYUN/Abp/IdentityServer/Session/AbpIdentitySessionUserInfoRequestValidator.cs new file mode 100644 index 000000000..c593536fd --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/LINGYUN/Abp/IdentityServer/Session/AbpIdentitySessionUserInfoRequestValidator.cs @@ -0,0 +1,106 @@ +using IdentityModel; +using IdentityServer4; +using IdentityServer4.Extensions; +using IdentityServer4.Models; +using IdentityServer4.Services; +using IdentityServer4.Validation; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Logging; +using System; +using System.Linq; +using System.Threading.Tasks; + +namespace LINGYUN.Abp.IdentityServer.Session; +public class AbpIdentitySessionUserInfoRequestValidator : IUserInfoRequestValidator +{ + private readonly IHttpContextAccessor _httpContextAccessor; + private readonly ITokenValidator _tokenValidator; + private readonly IProfileService _profile; + private readonly ILogger _logger; + + public AbpIdentitySessionUserInfoRequestValidator( + IHttpContextAccessor httpContextAccessor, + ITokenValidator tokenValidator, + IProfileService profile, + ILogger logger) + { + _httpContextAccessor = httpContextAccessor; + _tokenValidator = tokenValidator; + _profile = profile; + _logger = logger; + } + + /// + /// Validates a userinfo request. + /// + /// The access token. + /// + /// + public async Task ValidateRequestAsync(string accessToken) + { + if (_httpContextAccessor.HttpContext?.User?.Identity?.IsAuthenticated == false) + { + _logger.LogError("User session has expired."); + + return new UserInfoRequestValidationResult + { + IsError = true, + Error = Constants.ProtectedResourceErrors.ExpiredToken, + }; + } + + // the access token needs to be valid and have at least the openid scope + var tokenResult = await _tokenValidator.ValidateAccessTokenAsync( + accessToken, + IdentityServerConstants.StandardScopes.OpenId); + + if (tokenResult.IsError) + { + return new UserInfoRequestValidationResult + { + IsError = true, + Error = tokenResult.Error + }; + } + + // the token must have a one sub claim + var subClaim = tokenResult.Claims.SingleOrDefault(c => c.Type == JwtClaimTypes.Subject); + if (subClaim == null) + { + _logger.LogError("Token contains no sub claim"); + + return new UserInfoRequestValidationResult + { + IsError = true, + Error = OidcConstants.ProtectedResourceErrors.InvalidToken + }; + } + + // create subject from incoming access token + var claims = tokenResult.Claims.Where(x => !Constants.Filters.ProtocolClaimsFilter.Contains(x.Type)); + var subject = Principal.Create("UserInfo", claims.ToArray()); + + // make sure user is still active + var isActiveContext = new IsActiveContext(subject, tokenResult.Client, IdentityServerConstants.ProfileIsActiveCallers.UserInfoRequestValidation); + await _profile.IsActiveAsync(isActiveContext); + + if (isActiveContext.IsActive == false) + { + _logger.LogError("User is not active: {sub}", subject.GetSubjectId()); + + return new UserInfoRequestValidationResult + { + IsError = true, + Error = OidcConstants.ProtectedResourceErrors.InvalidToken + }; + } + + return new UserInfoRequestValidationResult + { + IsError = false, + TokenValidationResult = tokenResult, + Subject = subject + }; + } + +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/LINGYUN/Abp/IdentityServer/Session/Constants.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/LINGYUN/Abp/IdentityServer/Session/Constants.cs new file mode 100644 index 000000000..325b0b9ce --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/LINGYUN/Abp/IdentityServer/Session/Constants.cs @@ -0,0 +1,39 @@ +using IdentityModel; +using System.Collections.Generic; + +namespace LINGYUN.Abp.IdentityServer.Session; +internal static class Constants +{ + public static Dictionary ProtectedResourceErrorStatusCodes = new Dictionary + { + { OidcConstants.ProtectedResourceErrors.InvalidToken, 401 }, + { OidcConstants.ProtectedResourceErrors.ExpiredToken, 401 }, + { OidcConstants.ProtectedResourceErrors.InvalidRequest, 400 }, + { OidcConstants.ProtectedResourceErrors.InsufficientScope, 403 } + }; + + public static class ProtectedResourceErrors + { + public const string ExpiredToken = "expired_token"; + } + + public class Filters + { + public static readonly string[] ProtocolClaimsFilter = { + JwtClaimTypes.AccessTokenHash, + JwtClaimTypes.Audience, + JwtClaimTypes.AuthorizedParty, + JwtClaimTypes.AuthorizationCodeHash, + JwtClaimTypes.ClientId, + JwtClaimTypes.Expiration, + JwtClaimTypes.IssuedAt, + JwtClaimTypes.Issuer, + JwtClaimTypes.JwtId, + JwtClaimTypes.Nonce, + JwtClaimTypes.NotBefore, + JwtClaimTypes.ReferenceTokenId, + JwtClaimTypes.SessionId, + JwtClaimTypes.Scope + }; + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/README.md b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/README.md new file mode 100644 index 000000000..d03497843 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/README.md @@ -0,0 +1,17 @@ +# LINGYUN.Abp.IdentityServer.Session + +IdentityServer集成模块用户会话扩展,通过IdentityServer暴露的事件接口处理用户会话 + +## 参考实现 + +* [Session Management](https://github.com/abpio/abp-commercial-docs/blob/dev/en/modules/identity/session-management.md#identitysessioncleanupoptions) + +## 配置使用 + +```csharp +[DependsOn(typeof(AbpIdentityServerSessionModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/System/StringsExtensions.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/System/StringsExtensions.cs new file mode 100644 index 000000000..fc4c66190 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Session/System/StringsExtensions.cs @@ -0,0 +1,19 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.Net.Http.Headers; + +namespace System; +internal static class StringsExtensions +{ + internal static bool HasApplicationFormContentType(this HttpRequest request) + { + if (request.ContentType is null) return false; + + if (MediaTypeHeaderValue.TryParse(request.ContentType, out var header)) + { + // Content-Type: application/x-www-form-urlencoded; charset=utf-8 + return header.MediaType.Equals("application/x-www-form-urlencoded", StringComparison.OrdinalIgnoreCase); + } + + return false; + } +} diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/LINGYUN.Abp.IdentityServer.SmsValidator.csproj b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/LINGYUN.Abp.IdentityServer.SmsValidator.csproj index 8fd12910f..4f80537c6 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/LINGYUN.Abp.IdentityServer.SmsValidator.csproj +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/LINGYUN.Abp.IdentityServer.SmsValidator.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.IdentityServer.SmsValidator + LINGYUN.Abp.IdentityServer.SmsValidator + false + false + false diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/LINGYUN/Abp/IdentityServer/AbpIdentityServerSmsValidatorModule.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/LINGYUN/Abp/IdentityServer/AbpIdentityServerSmsValidatorModule.cs index 9c628fe08..7fb747160 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/LINGYUN/Abp/IdentityServer/AbpIdentityServerSmsValidatorModule.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/LINGYUN/Abp/IdentityServer/AbpIdentityServerSmsValidatorModule.cs @@ -6,32 +6,31 @@ using Volo.Abp.Modularity; using Volo.Abp.VirtualFileSystem; -namespace LINGYUN.Abp.IdentityServer +namespace LINGYUN.Abp.IdentityServer; + +[DependsOn(typeof(AbpIdentityServerDomainModule))] +public class AbpIdentityServerSmsValidatorModule : AbpModule { - [DependsOn(typeof(AbpIdentityServerDomainModule))] - public class AbpIdentityServerSmsValidatorModule : AbpModule + public override void PreConfigureServices(ServiceConfigurationContext context) { - public override void PreConfigureServices(ServiceConfigurationContext context) + PreConfigure(builder => { - PreConfigure(builder => - { - builder.AddExtensionGrantValidator(); - }); - } + builder.AddExtensionGrantValidator(); + }); + } - public override void ConfigureServices(ServiceConfigurationContext context) + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => { - Configure(options => - { - options.FileSets.AddEmbedded(); - }); + options.FileSets.AddEmbedded(); + }); - Configure(options => - { - options.Resources - .Get() - .AddVirtualJson("/LINGYUN/Abp/IdentityServer/Localization/SmsValidator"); - }); - } + Configure(options => + { + options.Resources + .Get() + .AddVirtualJson("/LINGYUN/Abp/IdentityServer/Localization/SmsValidator"); + }); } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/LINGYUN/Abp/IdentityServer/SmsValidator/SmsTokenGrantValidator.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/LINGYUN/Abp/IdentityServer/SmsValidator/SmsTokenGrantValidator.cs index 4c45b135d..3313104ed 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/LINGYUN/Abp/IdentityServer/SmsValidator/SmsTokenGrantValidator.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/LINGYUN/Abp/IdentityServer/SmsValidator/SmsTokenGrantValidator.cs @@ -19,164 +19,164 @@ using IdentityUser = Volo.Abp.Identity.IdentityUser; using IIdentityUserRepository = LINGYUN.Abp.Identity.IIdentityUserRepository; -namespace LINGYUN.Abp.IdentityServer.SmsValidator +namespace LINGYUN.Abp.IdentityServer.SmsValidator; + +public class SmsTokenGrantValidator : IExtensionGrantValidator { - public class SmsTokenGrantValidator : IExtensionGrantValidator + protected ILogger Logger { get; } + protected IEventService EventService { get; } + protected IIdentityUserRepository UserRepository { get; } + protected UserManager UserManager { get; } + protected IdentitySecurityLogManager IdentitySecurityLogManager { get; } + protected IStringLocalizer IdentityLocalizer { get; } + protected IStringLocalizer IdentityServerLocalizer { get; } + + public SmsTokenGrantValidator( + IEventService eventService, + UserManager userManager, + IIdentityUserRepository userRepository, + IdentitySecurityLogManager identitySecurityLogManager, + IStringLocalizer identityLocalizer, + IStringLocalizer identityServerLocalizer, + ILogger logger) + { + Logger = logger; + EventService = eventService; + UserManager = userManager; + UserRepository = userRepository; + IdentitySecurityLogManager = identitySecurityLogManager; + IdentityLocalizer = identityLocalizer; + IdentityServerLocalizer = identityServerLocalizer; + } + + public string GrantType => SmsValidatorConsts.SmsValidatorGrantTypeName; + + [UnitOfWork] + public async Task ValidateAsync(ExtensionGrantValidationContext context) { - protected ILogger Logger { get; } - protected IEventService EventService { get; } - protected IIdentityUserRepository UserRepository { get; } - protected UserManager UserManager { get; } - protected IdentitySecurityLogManager IdentitySecurityLogManager { get; } - protected IStringLocalizer IdentityLocalizer { get; } - protected IStringLocalizer IdentityServerLocalizer { get; } - - public SmsTokenGrantValidator( - IEventService eventService, - UserManager userManager, - IIdentityUserRepository userRepository, - IdentitySecurityLogManager identitySecurityLogManager, - IStringLocalizer identityLocalizer, - IStringLocalizer identityServerLocalizer, - ILogger logger) + var raw = context.Request.Raw; + var clientId = raw.Get(OidcConstants.TokenRequest.ClientId); + var credential = raw.Get(OidcConstants.TokenRequest.GrantType); + if (credential == null || !credential.Equals(GrantType)) { - Logger = logger; - EventService = eventService; - UserManager = userManager; - UserRepository = userRepository; - IdentitySecurityLogManager = identitySecurityLogManager; - IdentityLocalizer = identityLocalizer; - IdentityServerLocalizer = identityServerLocalizer; + Logger.LogInformation("Invalid grant type: not allowed"); + context.Result = new GrantValidationResult(TokenRequestErrors.InvalidGrant, IdentityServerLocalizer["InvalidGrant:GrantTypeInvalid"]); + return; } + var phoneNumber = raw.Get(SmsValidatorConsts.SmsValidatorParamName); + var phoneToken = raw.Get(SmsValidatorConsts.SmsValidatorTokenName); + if (phoneNumber.IsNullOrWhiteSpace() || phoneToken.IsNullOrWhiteSpace()) + { + Logger.LogInformation("Invalid grant type: phone number or token code not found"); + context.Result = new GrantValidationResult(TokenRequestErrors.InvalidGrant, IdentityServerLocalizer["InvalidGrant:PhoneOrTokenCodeNotFound"]); + return; + } + var currentUser = await UserRepository.FindByPhoneNumberAsync(phoneNumber); + if(currentUser == null) + { + Logger.LogInformation("Invalid grant type: phone number not register"); + context.Result = new GrantValidationResult(TokenRequestErrors.InvalidGrant, IdentityServerLocalizer["InvalidGrant:PhoneNumberNotRegister"]); + return; + } + + if (await UserManager.IsLockedOutAsync(currentUser)) + { + Logger.LogInformation("Authentication failed for username: {username}, reason: locked out", currentUser.UserName); + context.Result = new GrantValidationResult(TokenRequestErrors.InvalidGrant, IdentityLocalizer["Volo.Abp.Identity:UserLockedOut"]); - public string GrantType => SmsValidatorConsts.SmsValidatorGrantTypeName; + await SaveSecurityLogAsync(context, currentUser, IdentityServerSecurityLogActionConsts.LoginLockedout); - [UnitOfWork] - public async Task ValidateAsync(ExtensionGrantValidationContext context) + return; + } + + var validResult = await UserManager.VerifyTwoFactorTokenAsync(currentUser, TokenOptions.DefaultPhoneProvider, phoneToken); + if (!validResult) { - var raw = context.Request.Raw; - var credential = raw.Get(OidcConstants.TokenRequest.GrantType); - if (credential == null || !credential.Equals(GrantType)) - { - Logger.LogInformation("Invalid grant type: not allowed"); - context.Result = new GrantValidationResult(TokenRequestErrors.InvalidGrant, IdentityServerLocalizer["InvalidGrant:GrantTypeInvalid"]); - return; - } - var phoneNumber = raw.Get(SmsValidatorConsts.SmsValidatorParamName); - var phoneToken = raw.Get(SmsValidatorConsts.SmsValidatorTokenName); - if (phoneNumber.IsNullOrWhiteSpace() || phoneToken.IsNullOrWhiteSpace()) + Logger.LogWarning("Authentication failed for token: {0}, reason: invalid token", phoneToken); + // 防尝试破解密码 + var identityResult = await UserManager.AccessFailedAsync(currentUser); + if (identityResult.Succeeded) { - Logger.LogInformation("Invalid grant type: phone number or token code not found"); - context.Result = new GrantValidationResult(TokenRequestErrors.InvalidGrant, IdentityServerLocalizer["InvalidGrant:PhoneOrTokenCodeNotFound"]); - return; + context.Result = new GrantValidationResult(TokenRequestErrors.InvalidGrant, IdentityServerLocalizer["InvalidGrant:PhoneVerifyInvalid"]); + await EventService.RaiseAsync(new UserLoginFailureEvent(currentUser.UserName, $"invalid phone verify code {phoneToken}", false)); } - var currentUser = await UserRepository.FindByPhoneNumberAsync(phoneNumber); - if(currentUser == null) + else { - Logger.LogInformation("Invalid grant type: phone number not register"); - context.Result = new GrantValidationResult(TokenRequestErrors.InvalidGrant, IdentityServerLocalizer["InvalidGrant:PhoneNumberNotRegister"]); - return; + Logger.LogInformation("Authentication failed for username: {username}, reason: access failed", currentUser.UserName); + var userAccessFailedError = identityResult.LocalizeErrors(IdentityLocalizer); + context.Result = new GrantValidationResult(TokenRequestErrors.InvalidGrant, userAccessFailedError); + await EventService.RaiseAsync(new UserLoginFailureEvent(currentUser.UserName, userAccessFailedError, false)); } - if (await UserManager.IsLockedOutAsync(currentUser)) - { - Logger.LogInformation("Authentication failed for username: {username}, reason: locked out", currentUser.UserName); - context.Result = new GrantValidationResult(TokenRequestErrors.InvalidGrant, IdentityLocalizer["Volo.Abp.Identity:UserLockedOut"]); - - await SaveSecurityLogAsync(context, currentUser, IdentityServerSecurityLogActionConsts.LoginLockedout); + await SaveSecurityLogAsync(context, currentUser, SmsValidatorConsts.SecurityCodeFailed); - return; - } - - var validResult = await UserManager.VerifyTwoFactorTokenAsync(currentUser, TokenOptions.DefaultPhoneProvider, phoneToken); - if (!validResult) - { - Logger.LogWarning("Authentication failed for token: {0}, reason: invalid token", phoneToken); - // 防尝试破解密码 - var identityResult = await UserManager.AccessFailedAsync(currentUser); - if (identityResult.Succeeded) - { - context.Result = new GrantValidationResult(TokenRequestErrors.InvalidGrant, IdentityServerLocalizer["InvalidGrant:PhoneVerifyInvalid"]); - await EventService.RaiseAsync(new UserLoginFailureEvent(currentUser.UserName, $"invalid phone verify code {phoneToken}", false)); - } - else - { - Logger.LogInformation("Authentication failed for username: {username}, reason: access failed", currentUser.UserName); - var userAccessFailedError = identityResult.LocalizeErrors(IdentityLocalizer); - context.Result = new GrantValidationResult(TokenRequestErrors.InvalidGrant, userAccessFailedError); - await EventService.RaiseAsync(new UserLoginFailureEvent(currentUser.UserName, userAccessFailedError, false)); - } - - await SaveSecurityLogAsync(context, currentUser, SmsValidatorConsts.SecurityCodeFailed); - - return; - } + return; + } - await EventService.RaiseAsync(new UserLoginSuccessEvent(currentUser.UserName, phoneNumber, null)); + await EventService.RaiseAsync(new UserLoginSuccessEvent(currentUser.UserName, currentUser.Id.ToString(), currentUser.Name, clientId: clientId)); - await SetSuccessResultAsync(context, currentUser); - } + await SetSuccessResultAsync(context, currentUser); + } - protected async virtual Task SetSuccessResultAsync(ExtensionGrantValidationContext context, IdentityUser user) - { - var sub = await UserManager.GetUserIdAsync(user); + protected async virtual Task SetSuccessResultAsync(ExtensionGrantValidationContext context, IdentityUser user) + { + var sub = await UserManager.GetUserIdAsync(user); - Logger.LogInformation("Credentials validated for username: {username}", user.UserName); + Logger.LogInformation("Credentials validated for username: {username}", user.UserName); - var additionalClaims = new List(); + var additionalClaims = new List(); - await AddCustomClaimsAsync(additionalClaims, user, context); + await AddCustomClaimsAsync(additionalClaims, user, context); - context.Result = new GrantValidationResult( - sub, - OidcConstants.AuthenticationMethods.ConfirmationBySms, - additionalClaims.ToArray() - ); + context.Result = new GrantValidationResult( + sub, + OidcConstants.AuthenticationMethods.ConfirmationBySms, + additionalClaims.ToArray() + ); - await SaveSecurityLogAsync( - context, - user, - IdentityServerSecurityLogActionConsts.LoginSucceeded); - } + await SaveSecurityLogAsync( + context, + user, + IdentityServerSecurityLogActionConsts.LoginSucceeded); + } - protected async virtual Task SaveSecurityLogAsync( - ExtensionGrantValidationContext context, - IdentityUser user, - string action) + protected async virtual Task SaveSecurityLogAsync( + ExtensionGrantValidationContext context, + IdentityUser user, + string action) + { + var logContext = new IdentitySecurityLogContext { - var logContext = new IdentitySecurityLogContext - { - Identity = IdentityServerSecurityLogIdentityConsts.IdentityServer, - Action = action, - UserName = user.UserName, - ClientId = await FindClientIdAsync(context) - }; - logContext.WithProperty("GrantType", GrantType); - - await IdentitySecurityLogManager.SaveAsync(logContext); - } + Identity = IdentityServerSecurityLogIdentityConsts.IdentityServer, + Action = action, + UserName = user.UserName, + ClientId = await FindClientIdAsync(context) + }; + logContext.WithProperty("GrantType", GrantType); + + await IdentitySecurityLogManager.SaveAsync(logContext); + } - protected virtual Task FindClientIdAsync(ExtensionGrantValidationContext context) - { - return Task.FromResult(context.Request?.Client?.ClientId); - } + protected virtual Task FindClientIdAsync(ExtensionGrantValidationContext context) + { + return Task.FromResult(context.Request?.Client?.ClientId); + } - protected virtual Task AddCustomClaimsAsync( - List customClaims, - IdentityUser user, - ExtensionGrantValidationContext context) + protected virtual Task AddCustomClaimsAsync( + List customClaims, + IdentityUser user, + ExtensionGrantValidationContext context) + { + if (user.TenantId.HasValue) { - if (user.TenantId.HasValue) - { - customClaims.Add( - new Claim( - AbpClaimTypes.TenantId, - user.TenantId?.ToString() - ) - ); - } - - return Task.CompletedTask; + customClaims.Add( + new Claim( + AbpClaimTypes.TenantId, + user.TenantId?.ToString() + ) + ); } + + return Task.CompletedTask; } } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/LINGYUN/Abp/IdentityServer/SmsValidator/SmsValidatorConsts.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/LINGYUN/Abp/IdentityServer/SmsValidator/SmsValidatorConsts.cs index 1c404fc2e..5fb0cd186 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/LINGYUN/Abp/IdentityServer/SmsValidator/SmsValidatorConsts.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.SmsValidator/LINGYUN/Abp/IdentityServer/SmsValidator/SmsValidatorConsts.cs @@ -1,15 +1,14 @@ -namespace LINGYUN.Abp.IdentityServer.SmsValidator +namespace LINGYUN.Abp.IdentityServer.SmsValidator; + +public class SmsValidatorConsts { - public class SmsValidatorConsts - { - public const string SmsValidatorGrantTypeName = "phone_verify"; + public const string SmsValidatorGrantTypeName = "phone_verify"; - public const string SmsValidatorParamName = "phone_number"; + public const string SmsValidatorParamName = "phone_number"; - public const string SmsValidatorTokenName = "phone_verify_code"; + public const string SmsValidatorTokenName = "phone_verify_code"; - public const string SmsValidatorPurpose = "phone_verify"; + public const string SmsValidatorPurpose = "phone_verify"; - public const string SecurityCodeFailed = "SecurityCodeFailed"; - } + public const string SecurityCodeFailed = "SecurityCodeFailed"; } diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat.Work/LINGYUN.Abp.IdentityServer.WeChat.Work.csproj b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat.Work/LINGYUN.Abp.IdentityServer.WeChat.Work.csproj index fd48ca042..457fd6574 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat.Work/LINGYUN.Abp.IdentityServer.WeChat.Work.csproj +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat.Work/LINGYUN.Abp.IdentityServer.WeChat.Work.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.IdentityServer.WeChat.Work + LINGYUN.Abp.IdentityServer.WeChat.Work + false + false + false diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat.Work/LINGYUN/Abp/IdentityServer/WeChat/Work/WeChatWorkGrantValidator.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat.Work/LINGYUN/Abp/IdentityServer/WeChat/Work/WeChatWorkGrantValidator.cs index f31356bdd..b0c369914 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat.Work/LINGYUN/Abp/IdentityServer/WeChat/Work/WeChatWorkGrantValidator.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChat.Work/LINGYUN/Abp/IdentityServer/WeChat/Work/WeChatWorkGrantValidator.cs @@ -64,6 +64,7 @@ public WeChatWorkGrantValidator( public async virtual Task ValidateAsync(ExtensionGrantValidationContext context) { var raw = context.Request.Raw; + var clientId = raw.Get(OidcConstants.TokenRequest.ClientId); var credential = raw.Get(OidcConstants.TokenRequest.GrantType); if (credential == null || !credential.Equals(GrantType)) { @@ -121,7 +122,7 @@ public async virtual Task ValidateAsync(ExtensionGrantValidationContext context) return; } - await EventService.RaiseAsync(new UserLoginSuccessEvent(AbpWeChatWorkGlobalConsts.ProviderName, userInfo.UserId, null)); + await EventService.RaiseAsync(new UserLoginSuccessEvent(currentUser.UserName, currentUser.Id.ToString(), currentUser.Name, clientId: clientId)); await SetSuccessResultAsync(context, currentUser); } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN.Abp.LocalizationManagement.Application.Contracts.csproj b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN.Abp.LocalizationManagement.Application.Contracts.csproj index b386c1bec..651f16961 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN.Abp.LocalizationManagement.Application.Contracts.csproj +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN.Abp.LocalizationManagement.Application.Contracts.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.LocalizationManagement.Application.Contracts + LINGYUN.Abp.LocalizationManagement.Application.Contracts + false + false + false diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/AbpLocalizationManagementApplicationContractsModule.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/AbpLocalizationManagementApplicationContractsModule.cs index a204e038f..0867db4a2 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/AbpLocalizationManagementApplicationContractsModule.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/AbpLocalizationManagementApplicationContractsModule.cs @@ -1,13 +1,12 @@ using Volo.Abp.Authorization; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.LocalizationManagement +namespace LINGYUN.Abp.LocalizationManagement; + +[DependsOn( + typeof(AbpAuthorizationModule), + typeof(AbpLocalizationManagementDomainSharedModule))] +public class AbpLocalizationManagementApplicationContractsModule : AbpModule { - [DependsOn( - typeof(AbpAuthorizationModule), - typeof(AbpLocalizationManagementDomainSharedModule))] - public class AbpLocalizationManagementApplicationContractsModule : AbpModule - { - } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/ITextAppService.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/ITextAppService.cs index cf788ae11..5f76b868d 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/ITextAppService.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/ITextAppService.cs @@ -1,12 +1,11 @@ using System.Threading.Tasks; using Volo.Abp.Application.Services; -namespace LINGYUN.Abp.LocalizationManagement +namespace LINGYUN.Abp.LocalizationManagement; + +public interface ITextAppService : IApplicationService { - public interface ITextAppService : IApplicationService - { - Task SetTextAsync(SetTextInput input); + Task SetTextAsync(SetTextInput input); - Task RestoreToDefaultAsync(RestoreDefaultTextInput input); - } + Task RestoreToDefaultAsync(RestoreDefaultTextInput input); } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/LanguageCreateOrUpdateDto.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/LanguageCreateOrUpdateDto.cs index 0d54197e5..58da1f5cc 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/LanguageCreateOrUpdateDto.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/LanguageCreateOrUpdateDto.cs @@ -8,6 +8,6 @@ public abstract class LanguageCreateOrUpdateDto [DynamicStringLength(typeof(LanguageConsts), nameof(LanguageConsts.MaxDisplayNameLength))] public string DisplayName { get; set; } - [DynamicStringLength(typeof(LanguageConsts), nameof(LanguageConsts.MaxFlagIconLength))] + [DynamicStringLength(typeof(LanguageConsts), nameof(LanguageConsts.MaxTwoLetterISOLanguageNameLength))] public string FlagIcon { get; set; } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/LanguageDto.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/LanguageDto.cs index 0b3ab360a..e5cf660e9 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/LanguageDto.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/LanguageDto.cs @@ -7,5 +7,5 @@ public class LanguageDto : AuditedEntityDto public string CultureName { get; set; } public string UiCultureName { get; set; } public string DisplayName { get; set; } - public string FlagIcon { get; set; } + public string TwoLetterISOLanguageName { get; set; } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/LocalizationRemoteServiceConsts.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/LocalizationRemoteServiceConsts.cs index 833d64dce..fa7ed4bfa 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/LocalizationRemoteServiceConsts.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/LocalizationRemoteServiceConsts.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.LocalizationManagement +namespace LINGYUN.Abp.LocalizationManagement; + +public static class LocalizationRemoteServiceConsts { - public static class LocalizationRemoteServiceConsts - { - public const string RemoteServiceName = "LocalizationManagement"; - } + public const string RemoteServiceName = "LocalizationManagement"; } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/Permissions/LocalizationManagementPermissionDefinitionProvider.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/Permissions/LocalizationManagementPermissionDefinitionProvider.cs index e3666d37f..e719a51e6 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/Permissions/LocalizationManagementPermissionDefinitionProvider.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/Permissions/LocalizationManagementPermissionDefinitionProvider.cs @@ -2,71 +2,70 @@ using Volo.Abp.Authorization.Permissions; using Volo.Abp.Localization; -namespace LINGYUN.Abp.LocalizationManagement.Permissions +namespace LINGYUN.Abp.LocalizationManagement.Permissions; + +public class LocalizationManagementPermissionDefinitionProvider : PermissionDefinitionProvider { - public class LocalizationManagementPermissionDefinitionProvider : PermissionDefinitionProvider + public override void Define(IPermissionDefinitionContext context) { - public override void Define(IPermissionDefinitionContext context) - { - var permissionGroup = context.AddGroup( - LocalizationManagementPermissions.GroupName, - L("Permissions:LocalizationManagement")); + var permissionGroup = context.AddGroup( + LocalizationManagementPermissions.GroupName, + L("Permissions:LocalizationManagement")); - var resourcePermission = permissionGroup.AddPermission( - LocalizationManagementPermissions.Resource.Default, - L("Permissions:Resource"), - Volo.Abp.MultiTenancy.MultiTenancySides.Host); - resourcePermission.AddChild( - LocalizationManagementPermissions.Resource.Create, - L("Permissions:Create"), - Volo.Abp.MultiTenancy.MultiTenancySides.Host); - resourcePermission.AddChild( - LocalizationManagementPermissions.Resource.Update, - L("Permissions:Update"), - Volo.Abp.MultiTenancy.MultiTenancySides.Host); - resourcePermission.AddChild( - LocalizationManagementPermissions.Resource.Delete, - L("Permissions:Delete"), - Volo.Abp.MultiTenancy.MultiTenancySides.Host); + var resourcePermission = permissionGroup.AddPermission( + LocalizationManagementPermissions.Resource.Default, + L("Permissions:Resource"), + Volo.Abp.MultiTenancy.MultiTenancySides.Host); + resourcePermission.AddChild( + LocalizationManagementPermissions.Resource.Create, + L("Permissions:Create"), + Volo.Abp.MultiTenancy.MultiTenancySides.Host); + resourcePermission.AddChild( + LocalizationManagementPermissions.Resource.Update, + L("Permissions:Update"), + Volo.Abp.MultiTenancy.MultiTenancySides.Host); + resourcePermission.AddChild( + LocalizationManagementPermissions.Resource.Delete, + L("Permissions:Delete"), + Volo.Abp.MultiTenancy.MultiTenancySides.Host); - var languagePermission = permissionGroup.AddPermission( - LocalizationManagementPermissions.Language.Default, - L("Permissions:Language"), - Volo.Abp.MultiTenancy.MultiTenancySides.Host); - languagePermission.AddChild( - LocalizationManagementPermissions.Language.Create, - L("Permissions:Create"), - Volo.Abp.MultiTenancy.MultiTenancySides.Host); - languagePermission.AddChild( - LocalizationManagementPermissions.Language.Update, - L("Permissions:Update"), - Volo.Abp.MultiTenancy.MultiTenancySides.Host); - languagePermission.AddChild( - LocalizationManagementPermissions.Language.Delete, - L("Permissions:Delete"), - Volo.Abp.MultiTenancy.MultiTenancySides.Host); + var languagePermission = permissionGroup.AddPermission( + LocalizationManagementPermissions.Language.Default, + L("Permissions:Language"), + Volo.Abp.MultiTenancy.MultiTenancySides.Host); + languagePermission.AddChild( + LocalizationManagementPermissions.Language.Create, + L("Permissions:Create"), + Volo.Abp.MultiTenancy.MultiTenancySides.Host); + languagePermission.AddChild( + LocalizationManagementPermissions.Language.Update, + L("Permissions:Update"), + Volo.Abp.MultiTenancy.MultiTenancySides.Host); + languagePermission.AddChild( + LocalizationManagementPermissions.Language.Delete, + L("Permissions:Delete"), + Volo.Abp.MultiTenancy.MultiTenancySides.Host); - var textPermission = permissionGroup.AddPermission( - LocalizationManagementPermissions.Text.Default, - L("Permissions:Text"), - Volo.Abp.MultiTenancy.MultiTenancySides.Host); - textPermission.AddChild( - LocalizationManagementPermissions.Text.Create, - L("Permissions:Create"), - Volo.Abp.MultiTenancy.MultiTenancySides.Host); - textPermission.AddChild( - LocalizationManagementPermissions.Text.Update, - L("Permissions:Update"), - Volo.Abp.MultiTenancy.MultiTenancySides.Host); - textPermission.AddChild( - LocalizationManagementPermissions.Text.Delete, - L("Permissions:Delete"), - Volo.Abp.MultiTenancy.MultiTenancySides.Host); - } + var textPermission = permissionGroup.AddPermission( + LocalizationManagementPermissions.Text.Default, + L("Permissions:Text"), + Volo.Abp.MultiTenancy.MultiTenancySides.Host); + textPermission.AddChild( + LocalizationManagementPermissions.Text.Create, + L("Permissions:Create"), + Volo.Abp.MultiTenancy.MultiTenancySides.Host); + textPermission.AddChild( + LocalizationManagementPermissions.Text.Update, + L("Permissions:Update"), + Volo.Abp.MultiTenancy.MultiTenancySides.Host); + textPermission.AddChild( + LocalizationManagementPermissions.Text.Delete, + L("Permissions:Delete"), + Volo.Abp.MultiTenancy.MultiTenancySides.Host); + } - private static LocalizableString L(string name) - { - return LocalizableString.Create(name); - } + private static LocalizableString L(string name) + { + return LocalizableString.Create(name); } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/Permissions/LocalizationManagementPermissions.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/Permissions/LocalizationManagementPermissions.cs index b8bb25f9a..bc00047eb 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/Permissions/LocalizationManagementPermissions.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/Permissions/LocalizationManagementPermissions.cs @@ -1,40 +1,39 @@ -namespace LINGYUN.Abp.LocalizationManagement.Permissions +namespace LINGYUN.Abp.LocalizationManagement.Permissions; + +public static class LocalizationManagementPermissions { - public static class LocalizationManagementPermissions - { - public const string GroupName = "LocalizationManagement"; + public const string GroupName = "LocalizationManagement"; - public class Resource - { - public const string Default = GroupName + ".Resource"; + public class Resource + { + public const string Default = GroupName + ".Resource"; - public const string Create = Default + ".Create"; + public const string Create = Default + ".Create"; - public const string Update = Default + ".Update"; + public const string Update = Default + ".Update"; - public const string Delete = Default + ".Delete"; - } + public const string Delete = Default + ".Delete"; + } - public class Language - { - public const string Default = GroupName + ".Language"; + public class Language + { + public const string Default = GroupName + ".Language"; - public const string Create = Default + ".Create"; + public const string Create = Default + ".Create"; - public const string Update = Default + ".Update"; + public const string Update = Default + ".Update"; - public const string Delete = Default + ".Delete"; - } + public const string Delete = Default + ".Delete"; + } - public class Text - { - public const string Default = GroupName + ".Text"; + public class Text + { + public const string Default = GroupName + ".Text"; - public const string Create = Default + ".Create"; + public const string Create = Default + ".Create"; - public const string Update = Default + ".Update"; + public const string Update = Default + ".Update"; - public const string Delete = Default + ".Delete"; - } + public const string Delete = Default + ".Delete"; } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/SetTextInput.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/SetTextInput.cs index 367529a60..3f1d26e4d 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/SetTextInput.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application.Contracts/LINGYUN/Abp/LocalizationManagement/SetTextInput.cs @@ -1,23 +1,22 @@ using System.ComponentModel.DataAnnotations; using Volo.Abp.Validation; -namespace LINGYUN.Abp.LocalizationManagement +namespace LINGYUN.Abp.LocalizationManagement; + +public class SetTextInput { - public class SetTextInput - { - [Required] - [DynamicStringLength(typeof(ResourceConsts), nameof(ResourceConsts.MaxNameLength))] - public string ResourceName { get; set; } + [Required] + [DynamicStringLength(typeof(ResourceConsts), nameof(ResourceConsts.MaxNameLength))] + public string ResourceName { get; set; } - [Required] - [DynamicStringLength(typeof(TextConsts), nameof(TextConsts.MaxKeyLength))] - public string Key { get; set; } + [Required] + [DynamicStringLength(typeof(TextConsts), nameof(TextConsts.MaxKeyLength))] + public string Key { get; set; } - [Required] - [DynamicStringLength(typeof(LanguageConsts), nameof(LanguageConsts.MaxCultureNameLength))] - public string CultureName { get; set; } + [Required] + [DynamicStringLength(typeof(LanguageConsts), nameof(LanguageConsts.MaxCultureNameLength))] + public string CultureName { get; set; } - [DynamicStringLength(typeof(TextConsts), nameof(TextConsts.MaxValueLength))] - public string Value { get; set; } - } + [DynamicStringLength(typeof(TextConsts), nameof(TextConsts.MaxValueLength))] + public string Value { get; set; } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN.Abp.LocalizationManagement.Application.csproj b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN.Abp.LocalizationManagement.Application.csproj index a5dd3fcdb..79666cc78 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN.Abp.LocalizationManagement.Application.csproj +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN.Abp.LocalizationManagement.Application.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.LocalizationManagement.Application + LINGYUN.Abp.LocalizationManagement.Application + false + false + false diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN/Abp/LocalizationManagement/AbpLocalizationManagementApplicationModule.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN/Abp/LocalizationManagement/AbpLocalizationManagementApplicationModule.cs index 0c8319318..b9e9c340f 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN/Abp/LocalizationManagement/AbpLocalizationManagementApplicationModule.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN/Abp/LocalizationManagement/AbpLocalizationManagementApplicationModule.cs @@ -3,22 +3,21 @@ using Microsoft.Extensions.DependencyInjection; using Volo.Abp.AutoMapper; -namespace LINGYUN.Abp.LocalizationManagement +namespace LINGYUN.Abp.LocalizationManagement; + +[DependsOn( + typeof(AbpDddApplicationModule), + typeof(AbpLocalizationManagementDomainModule), + typeof(AbpLocalizationManagementApplicationContractsModule))] +public class AbpLocalizationManagementApplicationModule : AbpModule { - [DependsOn( - typeof(AbpDddApplicationModule), - typeof(AbpLocalizationManagementDomainModule), - typeof(AbpLocalizationManagementApplicationContractsModule))] - public class AbpLocalizationManagementApplicationModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddAutoMapperObjectMapper(); + context.Services.AddAutoMapperObjectMapper(); - Configure(options => - { - options.AddProfile(validate: true); - }); - } + Configure(options => + { + options.AddProfile(validate: true); + }); } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN/Abp/LocalizationManagement/LanguageAppService.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN/Abp/LocalizationManagement/LanguageAppService.cs index d566d60e1..90fae14c8 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN/Abp/LocalizationManagement/LanguageAppService.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN/Abp/LocalizationManagement/LanguageAppService.cs @@ -1,8 +1,9 @@ using LINGYUN.Abp.LocalizationManagement.Permissions; using Microsoft.AspNetCore.Authorization; +using System.Globalization; using System.Threading.Tasks; using Volo.Abp; -using Volo.Abp.ObjectMapping; +using Volo.Abp.Localization; namespace LINGYUN.Abp.LocalizationManagement; @@ -26,24 +27,28 @@ public async virtual Task GetByNameAsync(string name) [Authorize(LocalizationManagementPermissions.Language.Create)] public async virtual Task CreateAsync(LanguageCreateDto input) { - if (_repository.FindByCultureNameAsync(input.CultureName) != null) + if (await _repository.FindByCultureNameAsync(input.CultureName) != null) { throw new BusinessException(LocalizationErrorCodes.Language.NameAlreadyExists) .WithData(nameof(Language.CultureName), input.CultureName); } - var language = new Language( - GuidGenerator.Create(), - input.CultureName, - input.UiCultureName, - input.DisplayName, - input.FlagIcon); + using (CultureHelper.Use(input.CultureName, input.UiCultureName)) + { - language = await _repository.InsertAsync(language); + var language = new Language( + GuidGenerator.Create(), + input.CultureName, + input.UiCultureName, + input.DisplayName, + CultureInfo.CurrentCulture.TwoLetterISOLanguageName); - await CurrentUnitOfWork.SaveChangesAsync(); + language = await _repository.InsertAsync(language); - return ObjectMapper.Map(language); + await CurrentUnitOfWork.SaveChangesAsync(); + + return ObjectMapper.Map(language); + } } [Authorize(LocalizationManagementPermissions.Language.Delete)] @@ -61,7 +66,6 @@ public async virtual Task UpdateAsync(string name, LanguageUpdateDt { var language = await InternalGetByNameAsync(name); - language.SetFlagIcon(input.FlagIcon); language.SetDisplayName(input.DisplayName); await _repository.UpdateAsync(language); diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN/Abp/LocalizationManagement/LocalizationManagementApplicationMapperProfile.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN/Abp/LocalizationManagement/LocalizationManagementApplicationMapperProfile.cs index b7de5ea1e..be4a77452 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN/Abp/LocalizationManagement/LocalizationManagementApplicationMapperProfile.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN/Abp/LocalizationManagement/LocalizationManagementApplicationMapperProfile.cs @@ -1,13 +1,12 @@ using AutoMapper; -namespace LINGYUN.Abp.LocalizationManagement +namespace LINGYUN.Abp.LocalizationManagement; + +public class LocalizationManagementApplicationMapperProfile : Profile { - public class LocalizationManagementApplicationMapperProfile : Profile + public LocalizationManagementApplicationMapperProfile() { - public LocalizationManagementApplicationMapperProfile() - { - CreateMap(); - CreateMap(); - } + CreateMap(); + CreateMap(); } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN/Abp/LocalizationManagement/TextAppService.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN/Abp/LocalizationManagement/TextAppService.cs index 26ca32c38..54e32edba 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN/Abp/LocalizationManagement/TextAppService.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Application/LINGYUN/Abp/LocalizationManagement/TextAppService.cs @@ -2,54 +2,53 @@ using Microsoft.AspNetCore.Authorization; using System.Threading.Tasks; -namespace LINGYUN.Abp.LocalizationManagement +namespace LINGYUN.Abp.LocalizationManagement; + +[Authorize(LocalizationManagementPermissions.Text.Default)] +public class TextAppService : LocalizationAppServiceBase, ITextAppService { - [Authorize(LocalizationManagementPermissions.Text.Default)] - public class TextAppService : LocalizationAppServiceBase, ITextAppService + private readonly ITextRepository _textRepository; + public TextAppService(ITextRepository repository) { - private readonly ITextRepository _textRepository; - public TextAppService(ITextRepository repository) - { - _textRepository = repository; - } + _textRepository = repository; + } - public async virtual Task SetTextAsync(SetTextInput input) + public async virtual Task SetTextAsync(SetTextInput input) + { + var text = await _textRepository.GetByCultureKeyAsync(input.ResourceName, input.CultureName, input.Key); + if (text == null) { - var text = await _textRepository.GetByCultureKeyAsync(input.ResourceName, input.CultureName, input.Key); - if (text == null) - { - await AuthorizationService.CheckAsync(LocalizationManagementPermissions.Text.Create); - - text = new Text( - input.ResourceName, - input.CultureName, - input.Key, - input.Value); + await AuthorizationService.CheckAsync(LocalizationManagementPermissions.Text.Create); - await _textRepository.InsertAsync(text); - } - else - { - await AuthorizationService.CheckAsync(LocalizationManagementPermissions.Text.Update); + text = new Text( + input.ResourceName, + input.CultureName, + input.Key, + input.Value); - text.SetValue(input.Value); + await _textRepository.InsertAsync(text); + } + else + { + await AuthorizationService.CheckAsync(LocalizationManagementPermissions.Text.Update); - await _textRepository.UpdateAsync(text); - } + text.SetValue(input.Value); - await CurrentUnitOfWork.SaveChangesAsync(); + await _textRepository.UpdateAsync(text); } - [Authorize(LocalizationManagementPermissions.Text.Delete)] - public async virtual Task RestoreToDefaultAsync(RestoreDefaultTextInput input) + await CurrentUnitOfWork.SaveChangesAsync(); + } + + [Authorize(LocalizationManagementPermissions.Text.Delete)] + public async virtual Task RestoreToDefaultAsync(RestoreDefaultTextInput input) + { + var text = await _textRepository.GetByCultureKeyAsync(input.ResourceName, input.CultureName, input.Key); + if (text != null) { - var text = await _textRepository.GetByCultureKeyAsync(input.ResourceName, input.CultureName, input.Key); - if (text != null) - { - await _textRepository.DeleteAsync(text); + await _textRepository.DeleteAsync(text); - await CurrentUnitOfWork.SaveChangesAsync(); - } + await CurrentUnitOfWork.SaveChangesAsync(); } } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN.Abp.LocalizationManagement.Domain.Shared.csproj b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN.Abp.LocalizationManagement.Domain.Shared.csproj index 3c1e35f5c..cd8f07f14 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN.Abp.LocalizationManagement.Domain.Shared.csproj +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN.Abp.LocalizationManagement.Domain.Shared.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.LocalizationManagement.Domain.Shared + LINGYUN.Abp.LocalizationManagement.Domain.Shared + false + false + false diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/AbpLocalizationManagementDomainSharedModule.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/AbpLocalizationManagementDomainSharedModule.cs index 4944d7447..ec03a92d7 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/AbpLocalizationManagementDomainSharedModule.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/AbpLocalizationManagementDomainSharedModule.cs @@ -1,29 +1,33 @@ using LINGYUN.Abp.LocalizationManagement.Localization; using Volo.Abp.Localization; +using Volo.Abp.Localization.ExceptionHandling; using Volo.Abp.Modularity; using Volo.Abp.Validation; using Volo.Abp.VirtualFileSystem; -namespace LINGYUN.Abp.LocalizationManagement +namespace LINGYUN.Abp.LocalizationManagement; + +[DependsOn( + typeof(AbpValidationModule), + typeof(AbpLocalizationModule))] +public class AbpLocalizationManagementDomainSharedModule : AbpModule { - [DependsOn( - typeof(AbpValidationModule), - typeof(AbpLocalizationModule))] - public class AbpLocalizationManagementDomainSharedModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + Configure(options => { - Configure(options => - { - options.FileSets.AddEmbedded(); - }); + options.FileSets.AddEmbedded(); + }); - Configure(options => - { - options.Resources - .Add("en") - .AddVirtualJson("/LINGYUN/Abp/LocalizationManagement/Localization/Resources"); - }); - } + Configure(options => + { + options.Resources + .Add("en") + .AddVirtualJson("/LINGYUN/Abp/LocalizationManagement/Localization/Resources"); + }); + Configure(options => + { + options.MapCodeNamespace(LocalizationErrorCodes.Namespace, typeof(LocalizationManagementResource)); + }); } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/LanguageConsts.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/LanguageConsts.cs index 6375272f9..b01aa3870 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/LanguageConsts.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/LanguageConsts.cs @@ -1,10 +1,9 @@ -namespace LINGYUN.Abp.LocalizationManagement +namespace LINGYUN.Abp.LocalizationManagement; + +public static class LanguageConsts { - public static class LanguageConsts - { - public static int MaxCultureNameLength { get; set; } = 20; - public static int MaxUiCultureNameLength { get; set; } = 20; - public static int MaxDisplayNameLength { get; set; } = 64; - public static int MaxFlagIconLength { get; set; } = 30; - } + public static int MaxCultureNameLength { get; set; } = 20; + public static int MaxUiCultureNameLength { get; set; } = 20; + public static int MaxDisplayNameLength { get; set; } = 64; + public static int MaxTwoLetterISOLanguageNameLength { get; set; } = 30; } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/LanguageEto.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/LanguageEto.cs index f9ad03cbf..da27c87a2 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/LanguageEto.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/LanguageEto.cs @@ -5,5 +5,5 @@ public class LanguageEto public string CultureName { get; set; } public string UiCultureName { get; set; } public string DisplayName { get; set; } - public string FlagIcon { get; set; } + public string TwoLetterISOLanguageName { get; set; } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/Localization/LocalizationManagementResource.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/Localization/LocalizationManagementResource.cs index 01d6ca45e..abe2e9242 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/Localization/LocalizationManagementResource.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/Localization/LocalizationManagementResource.cs @@ -1,9 +1,8 @@ using Volo.Abp.Localization; -namespace LINGYUN.Abp.LocalizationManagement.Localization +namespace LINGYUN.Abp.LocalizationManagement.Localization; + +[LocalizationResourceName("LocalizationManagement")] +public class LocalizationManagementResource { - [LocalizationResourceName("LocalizationManagement")] - public class LocalizationManagementResource - { - } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/ResourceConsts.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/ResourceConsts.cs index 83994ceed..1e7962940 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/ResourceConsts.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/ResourceConsts.cs @@ -1,10 +1,9 @@ -namespace LINGYUN.Abp.LocalizationManagement +namespace LINGYUN.Abp.LocalizationManagement; + +public static class ResourceConsts { - public static class ResourceConsts - { - public static int MaxNameLength { get; set; } = 50; - public static int MaxDisplayNameLength { get; set; } = 64; - public static int MaxDescriptionLength { get; set; } = 64; - public static int MaxDefaultCultureNameLength { get; set; } = 64; - } + public static int MaxNameLength { get; set; } = 50; + public static int MaxDisplayNameLength { get; set; } = 64; + public static int MaxDescriptionLength { get; set; } = 64; + public static int MaxDefaultCultureNameLength { get; set; } = 64; } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/TextConsts.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/TextConsts.cs index 37c674488..f6cbcb7dc 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/TextConsts.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/TextConsts.cs @@ -1,8 +1,7 @@ -namespace LINGYUN.Abp.LocalizationManagement +namespace LINGYUN.Abp.LocalizationManagement; + +public static class TextConsts { - public static class TextConsts - { - public static int MaxKeyLength { get; set; } = 512; - public static int MaxValueLength { get; set; } = 2 * 1024; - } + public static int MaxKeyLength { get; set; } = 512; + public static int MaxValueLength { get; set; } = 2 * 1024; } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/TextDifference.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/TextDifference.cs index dc1af3704..6cf5cb7cf 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/TextDifference.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/TextDifference.cs @@ -1,33 +1,32 @@ -namespace LINGYUN.Abp.LocalizationManagement +namespace LINGYUN.Abp.LocalizationManagement; + +public class TextDifference { - public class TextDifference - { - public int Id { get; set; } - public string CultureName { get; set; } - public string Key { get; set; } - public string Value { get; set; } - public string ResourceName { get; set; } - public string TargetCultureName { get; set; } - public string TargetValue { get; set; } + public int Id { get; set; } + public string CultureName { get; set; } + public string Key { get; set; } + public string Value { get; set; } + public string ResourceName { get; set; } + public string TargetCultureName { get; set; } + public string TargetValue { get; set; } - public TextDifference() { } - public TextDifference( - int id, - string cultureName, - string key, - string value, - string targetCultureName, - string targetValue = null, - string resourceName = null) - { - Id = id; - Key = key; - Value = value; - CultureName = cultureName; - TargetCultureName = targetCultureName; + public TextDifference() { } + public TextDifference( + int id, + string cultureName, + string key, + string value, + string targetCultureName, + string targetValue = null, + string resourceName = null) + { + Id = id; + Key = key; + Value = value; + CultureName = cultureName; + TargetCultureName = targetCultureName; - TargetValue = targetValue; - ResourceName = resourceName; - } + TargetValue = targetValue; + ResourceName = resourceName; } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/TextEto.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/TextEto.cs index 4d8ffd257..f1025f931 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/TextEto.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain.Shared/LINGYUN/Abp/LocalizationManagement/TextEto.cs @@ -1,10 +1,9 @@ -namespace LINGYUN.Abp.LocalizationManagement +namespace LINGYUN.Abp.LocalizationManagement; + +public class TextEto { - public class TextEto - { - public string CultureName { get; set; } - public string Key { get; set; } - public string Value { get; set; } - public string ResourceName { get; set; } - } + public string CultureName { get; set; } + public string Key { get; set; } + public string Value { get; set; } + public string ResourceName { get; set; } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN.Abp.LocalizationManagement.Domain.csproj b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN.Abp.LocalizationManagement.Domain.csproj index 406387e18..03273b250 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN.Abp.LocalizationManagement.Domain.csproj +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN.Abp.LocalizationManagement.Domain.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.LocalizationManagement.Domain + LINGYUN.Abp.LocalizationManagement.Domain + false + false + false diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/AbpLocalizationManagementDomainModule.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/AbpLocalizationManagementDomainModule.cs index b5a1366a1..fb198053a 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/AbpLocalizationManagementDomainModule.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/AbpLocalizationManagementDomainModule.cs @@ -5,35 +5,34 @@ using Volo.Abp.Domain; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.LocalizationManagement +namespace LINGYUN.Abp.LocalizationManagement; + +[DependsOn( + typeof(AbpAutoMapperModule), + typeof(AbpDddDomainModule), + typeof(AbpLocalizationPersistenceModule), + typeof(AbpLocalizationManagementDomainSharedModule))] +public class AbpLocalizationManagementDomainModule : AbpModule { - [DependsOn( - typeof(AbpAutoMapperModule), - typeof(AbpDddDomainModule), - typeof(AbpLocalizationPersistenceModule), - typeof(AbpLocalizationManagementDomainSharedModule))] - public class AbpLocalizationManagementDomainModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddAutoMapperObjectMapper(); + context.Services.AddAutoMapperObjectMapper(); - Configure(options => - { - options.AddProfile(validate: true); - }); + Configure(options => + { + options.AddProfile(validate: true); + }); - Configure(options => - { - options.AddPersistenceResource(); - }); + Configure(options => + { + options.AddPersistenceResource(); + }); - // 分布式事件 - //Configure(options => - //{ - // options.AutoEventSelectors.Add(); - // options.EtoMappings.Add(); - //}); - } + // 分布式事件 + //Configure(options => + //{ + // options.AutoEventSelectors.Add(); + // options.EtoMappings.Add(); + //}); } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/ILanguageRepository.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/ILanguageRepository.cs index 654a444e9..4b6530c2f 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/ILanguageRepository.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/ILanguageRepository.cs @@ -4,14 +4,13 @@ using System.Threading.Tasks; using Volo.Abp.Domain.Repositories; -namespace LINGYUN.Abp.LocalizationManagement +namespace LINGYUN.Abp.LocalizationManagement; + +public interface ILanguageRepository : IRepository { - public interface ILanguageRepository : IRepository - { - Task FindByCultureNameAsync( - string cultureName, - CancellationToken cancellationToken = default); + Task FindByCultureNameAsync( + string cultureName, + CancellationToken cancellationToken = default); - Task> GetActivedListAsync(CancellationToken cancellationToken = default); - } + Task> GetActivedListAsync(CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/IResourceRepository.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/IResourceRepository.cs index 8b633c557..7bd96a387 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/IResourceRepository.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/IResourceRepository.cs @@ -3,16 +3,15 @@ using System.Threading.Tasks; using Volo.Abp.Domain.Repositories; -namespace LINGYUN.Abp.LocalizationManagement +namespace LINGYUN.Abp.LocalizationManagement; + +public interface IResourceRepository : IRepository { - public interface IResourceRepository : IRepository - { - Task ExistsAsync( - string name, - CancellationToken cancellationToken = default); + Task ExistsAsync( + string name, + CancellationToken cancellationToken = default); - Task FindByNameAsync( - string name, - CancellationToken cancellationToken = default); - } + Task FindByNameAsync( + string name, + CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/Language.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/Language.cs index 50d44d77f..bd61d08e9 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/Language.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/Language.cs @@ -4,61 +4,57 @@ using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.Localization; -namespace LINGYUN.Abp.LocalizationManagement +namespace LINGYUN.Abp.LocalizationManagement; + +public class Language : AuditedEntity, ILanguageInfo { - public class Language : AuditedEntity, ILanguageInfo + public virtual bool Enable { get; set; } + public virtual string CultureName { get; protected set; } + public virtual string UiCultureName { get; protected set; } + public virtual string DisplayName { get; protected set; } + public virtual string TwoLetterISOLanguageName { get; set; } + protected Language() { } + public Language( + Guid id, + [NotNull] string cultureName, + [NotNull] string uiCultureName, + [NotNull] string displayName, + string twoLetterISOLanguageName = null) + : base(id) { - public virtual bool Enable { get; set; } - public virtual string CultureName { get; protected set; } - public virtual string UiCultureName { get; protected set; } - public virtual string DisplayName { get; protected set; } - public virtual string FlagIcon { get; set; } - protected Language() { } - public Language( - Guid id, - [NotNull] string cultureName, - [NotNull] string uiCultureName, - [NotNull] string displayName, - string flagIcon = null) - : base(id) - { - CultureName = Check.NotNullOrWhiteSpace(cultureName, nameof(cultureName), LanguageConsts.MaxCultureNameLength); - UiCultureName = Check.NotNullOrWhiteSpace(uiCultureName, nameof(uiCultureName), LanguageConsts.MaxUiCultureNameLength); - DisplayName = Check.NotNullOrWhiteSpace(displayName, nameof(displayName), LanguageConsts.MaxDisplayNameLength); - - FlagIcon = !flagIcon.IsNullOrWhiteSpace() - ? Check.Length(flagIcon, nameof(flagIcon), LanguageConsts.MaxFlagIconLength) - : null; + CultureName = Check.NotNullOrWhiteSpace(cultureName, nameof(cultureName), LanguageConsts.MaxCultureNameLength); + UiCultureName = Check.NotNullOrWhiteSpace(uiCultureName, nameof(uiCultureName), LanguageConsts.MaxUiCultureNameLength); + DisplayName = Check.NotNullOrWhiteSpace(displayName, nameof(displayName), LanguageConsts.MaxDisplayNameLength); + TwoLetterISOLanguageName = Check.Length(twoLetterISOLanguageName, nameof(twoLetterISOLanguageName), LanguageConsts.MaxTwoLetterISOLanguageNameLength); - Enable = true; - } + Enable = true; + } - public virtual void SetDisplayName(string displayName) - { - DisplayName = Check.NotNullOrWhiteSpace(displayName, nameof(displayName), LanguageConsts.MaxDisplayNameLength); - } + public virtual void SetDisplayName(string displayName) + { + DisplayName = Check.NotNullOrWhiteSpace(displayName, nameof(displayName), LanguageConsts.MaxDisplayNameLength); + } - public virtual void SetFlagIcon(string flagIcon) - { - FlagIcon = Check.Length(flagIcon, nameof(flagIcon), LanguageConsts.MaxFlagIconLength); - } + public virtual void SetTwoLetterISOLanguageName(string twoLetterISOLanguageName) + { + TwoLetterISOLanguageName = Check.Length(twoLetterISOLanguageName, nameof(twoLetterISOLanguageName), LanguageConsts.MaxTwoLetterISOLanguageNameLength); + } - public virtual void ChangeCulture(string cultureName, string uiCultureName = null, string displayName = null) - { - ChangeCultureInternal(cultureName, uiCultureName, displayName); - } + public virtual void ChangeCulture(string cultureName, string uiCultureName = null, string displayName = null) + { + ChangeCultureInternal(cultureName, uiCultureName, displayName); + } - private void ChangeCultureInternal(string cultureName, string uiCultureName, string displayName) - { - CultureName = Check.NotNullOrWhiteSpace(cultureName, nameof(cultureName), LanguageConsts.MaxCultureNameLength); + private void ChangeCultureInternal(string cultureName, string uiCultureName, string displayName) + { + CultureName = Check.NotNullOrWhiteSpace(cultureName, nameof(cultureName), LanguageConsts.MaxCultureNameLength); - UiCultureName = !uiCultureName.IsNullOrWhiteSpace() - ? Check.Length(uiCultureName, nameof(uiCultureName), LanguageConsts.MaxUiCultureNameLength) - : cultureName; + UiCultureName = !uiCultureName.IsNullOrWhiteSpace() + ? Check.Length(uiCultureName, nameof(uiCultureName), LanguageConsts.MaxUiCultureNameLength) + : cultureName; - DisplayName = !displayName.IsNullOrWhiteSpace() - ? Check.Length(displayName, nameof(displayName), LanguageConsts.MaxDisplayNameLength) - : cultureName; - } + DisplayName = !displayName.IsNullOrWhiteSpace() + ? Check.Length(displayName, nameof(displayName), LanguageConsts.MaxDisplayNameLength) + : cultureName; } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LanguageProvider.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LanguageProvider.cs index f505a14c6..53884261e 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LanguageProvider.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LanguageProvider.cs @@ -31,7 +31,6 @@ protected virtual LanguageInfo MapToLanguageInfo(Language language) return new LanguageInfo( language.CultureName, language.UiCultureName, - language.DisplayName, - language.FlagIcon); + language.DisplayName); } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationDbProperties.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationDbProperties.cs index 7d789eedc..8773227e8 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationDbProperties.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationDbProperties.cs @@ -1,11 +1,10 @@ -namespace LINGYUN.Abp.LocalizationManagement +namespace LINGYUN.Abp.LocalizationManagement; + +public static class LocalizationDbProperties { - public static class LocalizationDbProperties - { - public static string DbTablePrefix { get; set; } = "AbpLocalization"; + public static string DbTablePrefix { get; set; } = "AbpLocalization"; - public static string DbSchema { get; set; } = null; + public static string DbSchema { get; set; } = null; - public const string ConnectionStringName = "AbpLocalizationManagement"; - } + public const string ConnectionStringName = "AbpLocalizationManagement"; } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationManagementDomainMapperProfile.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationManagementDomainMapperProfile.cs index a54d1c063..20ba4e535 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationManagementDomainMapperProfile.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationManagementDomainMapperProfile.cs @@ -1,14 +1,13 @@ using AutoMapper; -namespace LINGYUN.Abp.LocalizationManagement +namespace LINGYUN.Abp.LocalizationManagement; + +public class LocalizationManagementDomainMapperProfile : Profile { - public class LocalizationManagementDomainMapperProfile : Profile + public LocalizationManagementDomainMapperProfile() { - public LocalizationManagementDomainMapperProfile() - { - CreateMap(); - CreateMap(); - CreateMap(); - } + CreateMap(); + CreateMap(); + CreateMap(); } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationManagementPersistenceWriter.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationManagementPersistenceWriter.cs index e0ae015b7..1c353a95b 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationManagementPersistenceWriter.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationManagementPersistenceWriter.cs @@ -91,7 +91,7 @@ await LanguageRepository.InsertAsync( language.CultureName, language.UiCultureName, language.DisplayName, - language.FlagIcon), + language.TwoLetterISOLanguageName), autoSave: true, cancellationToken: cancellationToken); } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationStore.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationStore.cs index 715ca3f44..d3ef6b14a 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationStore.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationStore.cs @@ -11,151 +11,150 @@ using Volo.Abp.Localization.External; using Volo.Abp.Threading; -namespace LINGYUN.Abp.LocalizationManagement +namespace LINGYUN.Abp.LocalizationManagement; + +[Dependency(ServiceLifetime.Transient, ReplaceServices = true)] +[ExposeServices( + typeof(IExternalLocalizationStore), + typeof(LocalizationStore))] +public class LocalizationStore : IExternalLocalizationStore { - [Dependency(ServiceLifetime.Transient, ReplaceServices = true)] - [ExposeServices( - typeof(IExternalLocalizationStore), - typeof(LocalizationStore))] - public class LocalizationStore : IExternalLocalizationStore + protected IServiceProvider ServiceProvider { get; } + protected ILocalizationStoreCache LocalizationStoreCache { get; } + + public LocalizationStore( + IServiceProvider serviceProvider, + ILocalizationStoreCache localizationStoreCache) { - protected IServiceProvider ServiceProvider { get; } - protected ILocalizationStoreCache LocalizationStoreCache { get; } + ServiceProvider = serviceProvider; + LocalizationStoreCache = localizationStoreCache; + } - public LocalizationStore( - IServiceProvider serviceProvider, - ILocalizationStoreCache localizationStoreCache) - { - ServiceProvider = serviceProvider; - LocalizationStoreCache = localizationStoreCache; - } + [Obsolete("The framework already supports dynamic languages and will be deprecated in the next release")] + public async virtual Task> GetLanguageListAsync( + CancellationToken cancellationToken = default) + { + var context = new LocalizationStoreCacheInitializeContext(ServiceProvider); + await LocalizationStoreCache.InitializeAsync(context); - [Obsolete("The framework already supports dynamic languages and will be deprecated in the next release")] - public async virtual Task> GetLanguageListAsync( - CancellationToken cancellationToken = default) - { - var context = new LocalizationStoreCacheInitializeContext(ServiceProvider); - await LocalizationStoreCache.InitializeAsync(context); + return LocalizationStoreCache.GetLanguages().ToList(); + } - return LocalizationStoreCache.GetLanguages().ToList(); - } + [Obsolete("The framework already supports dynamic languages and will be deprecated in the next release")] + public async virtual Task> GetLocalizationDictionaryAsync( + string resourceName, + CancellationToken cancellationToken = default) + { + var dictionaries = new Dictionary(); - [Obsolete("The framework already supports dynamic languages and will be deprecated in the next release")] - public async virtual Task> GetLocalizationDictionaryAsync( - string resourceName, - CancellationToken cancellationToken = default) + var context = new LocalizationStoreCacheInitializeContext(ServiceProvider); + await LocalizationStoreCache.InitializeAsync(context); + + var resource = LocalizationStoreCache.GetResourceOrNull(resourceName); + + if (resource == null) { - var dictionaries = new Dictionary(); + // 资源不存在或未启用返回空 + return dictionaries; + } - var context = new LocalizationStoreCacheInitializeContext(ServiceProvider); - await LocalizationStoreCache.InitializeAsync(context); + var texts = LocalizationStoreCache.GetAllLocalizedStrings(CultureInfo.CurrentCulture.Name); - var resource = LocalizationStoreCache.GetResourceOrNull(resourceName); - - if (resource == null) - { - // 资源不存在或未启用返回空 - return dictionaries; - } - - var texts = LocalizationStoreCache.GetAllLocalizedStrings(CultureInfo.CurrentCulture.Name); + foreach (var textGroup in texts) + { + var cultureTextDictionaires = new Dictionary(); - foreach (var textGroup in texts) + foreach (var text in textGroup.Value) { - var cultureTextDictionaires = new Dictionary(); - - foreach (var text in textGroup.Value) - { - // 本地化名称去重 - if (!cultureTextDictionaires.ContainsKey(text.Key)) - { - cultureTextDictionaires[text.Key] = new LocalizedString(text.Key, text.Value.Value.NormalizeLineEndings()); - } - } - - // 本地化语言去重 - if (!dictionaries.ContainsKey(textGroup.Key)) + // 本地化名称去重 + if (!cultureTextDictionaires.ContainsKey(text.Key)) { - dictionaries[textGroup.Key] = new StaticLocalizationDictionary(textGroup.Key, cultureTextDictionaires); + cultureTextDictionaires[text.Key] = new LocalizedString(text.Key, text.Value.Value.NormalizeLineEndings()); } } - return dictionaries; + // 本地化语言去重 + if (!dictionaries.ContainsKey(textGroup.Key)) + { + dictionaries[textGroup.Key] = new StaticLocalizationDictionary(textGroup.Key, cultureTextDictionaires); + } } - [Obsolete("The framework already supports dynamic languages and will be deprecated in the next release")] - public async virtual Task>> GetAllLocalizationDictionaryAsync(CancellationToken cancellationToken = default) - { - var result = new Dictionary>(); + return dictionaries; + } - var context = new LocalizationStoreCacheInitializeContext(ServiceProvider); - await LocalizationStoreCache.InitializeAsync(context); + [Obsolete("The framework already supports dynamic languages and will be deprecated in the next release")] + public async virtual Task>> GetAllLocalizationDictionaryAsync(CancellationToken cancellationToken = default) + { + var result = new Dictionary>(); + + var context = new LocalizationStoreCacheInitializeContext(ServiceProvider); + await LocalizationStoreCache.InitializeAsync(context); - var textList = LocalizationStoreCache.GetAllLocalizedStrings(CultureInfo.CurrentCulture.Name); + var textList = LocalizationStoreCache.GetAllLocalizedStrings(CultureInfo.CurrentCulture.Name); - foreach (var resourcesGroup in textList) + foreach (var resourcesGroup in textList) + { + var dictionaries = new Dictionary(); + foreach (var text in resourcesGroup.Value) { - var dictionaries = new Dictionary(); - foreach (var text in resourcesGroup.Value) + var cultureTextDictionaires = new Dictionary(); + // 本地化名称去重 + if (!cultureTextDictionaires.ContainsKey(text.Key)) { - var cultureTextDictionaires = new Dictionary(); - // 本地化名称去重 - if (!cultureTextDictionaires.ContainsKey(text.Key)) - { - cultureTextDictionaires[text.Key] = new LocalizedString(text.Key, text.Value.Value.NormalizeLineEndings()); - } - - // 本地化语言去重 - if (!dictionaries.ContainsKey(text.Key)) - { - dictionaries[text.Key] = new StaticLocalizationDictionary(text.Key, cultureTextDictionaires); - } + cultureTextDictionaires[text.Key] = new LocalizedString(text.Key, text.Value.Value.NormalizeLineEndings()); } - result.Add(resourcesGroup.Key, dictionaries); + // 本地化语言去重 + if (!dictionaries.ContainsKey(text.Key)) + { + dictionaries[text.Key] = new StaticLocalizationDictionary(text.Key, cultureTextDictionaires); + } } - return result; + result.Add(resourcesGroup.Key, dictionaries); } - [Obsolete("The framework already supports dynamic languages and will be deprecated in the next release")] - public async virtual Task ResourceExistsAsync(string resourceName, CancellationToken cancellationToken = default) - { - var context = new LocalizationStoreCacheInitializeContext(ServiceProvider); - await LocalizationStoreCache.InitializeAsync(context); + return result; + } - return LocalizationStoreCache.GetResourceOrNull(resourceName) != null; - } + [Obsolete("The framework already supports dynamic languages and will be deprecated in the next release")] + public async virtual Task ResourceExistsAsync(string resourceName, CancellationToken cancellationToken = default) + { + var context = new LocalizationStoreCacheInitializeContext(ServiceProvider); + await LocalizationStoreCache.InitializeAsync(context); - public LocalizationResourceBase GetResourceOrNull(string resourceName) - { - return AsyncHelper.RunSync(async () => await GetResourceOrNullAsync(resourceName)); - } + return LocalizationStoreCache.GetResourceOrNull(resourceName) != null; + } - public async virtual Task GetResourceOrNullAsync(string resourceName) - { - var context = new LocalizationStoreCacheInitializeContext(ServiceProvider); - await LocalizationStoreCache.InitializeAsync(context); + public LocalizationResourceBase GetResourceOrNull(string resourceName) + { + return AsyncHelper.RunSync(async () => await GetResourceOrNullAsync(resourceName)); + } - return LocalizationStoreCache.GetResourceOrNull(resourceName); - } + public async virtual Task GetResourceOrNullAsync(string resourceName) + { + var context = new LocalizationStoreCacheInitializeContext(ServiceProvider); + await LocalizationStoreCache.InitializeAsync(context); - public async virtual Task GetResourceNamesAsync() - { - var context = new LocalizationStoreCacheInitializeContext(ServiceProvider); - await LocalizationStoreCache.InitializeAsync(context); + return LocalizationStoreCache.GetResourceOrNull(resourceName); + } - return LocalizationStoreCache.GetResources() - .Select(x => x.ResourceName) - .ToArray(); - } + public async virtual Task GetResourceNamesAsync() + { + var context = new LocalizationStoreCacheInitializeContext(ServiceProvider); + await LocalizationStoreCache.InitializeAsync(context); - public async virtual Task GetResourcesAsync() - { - var context = new LocalizationStoreCacheInitializeContext(ServiceProvider); - await LocalizationStoreCache.InitializeAsync(context); + return LocalizationStoreCache.GetResources() + .Select(x => x.ResourceName) + .ToArray(); + } - return LocalizationStoreCache.GetResources().ToArray(); - } + public async virtual Task GetResourcesAsync() + { + var context = new LocalizationStoreCacheInitializeContext(ServiceProvider); + await LocalizationStoreCache.InitializeAsync(context); + + return LocalizationStoreCache.GetResources().ToArray(); } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationStoreInMemoryCache.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationStoreInMemoryCache.cs index 20dd8244b..217b70907 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationStoreInMemoryCache.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/LocalizationStoreInMemoryCache.cs @@ -194,8 +194,7 @@ protected async virtual Task UpdateInMemoryStoreCache(LocalizationStoreCacheInit Languages[language.CultureName] = new LanguageInfo( language.CultureName, language.UiCultureName, - language.DisplayName, - language.FlagIcon); + language.DisplayName); } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/Resource.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/Resource.cs index 14755183b..b8c6c0d27 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/Resource.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/Resource.cs @@ -3,46 +3,45 @@ using Volo.Abp; using Volo.Abp.Domain.Entities.Auditing; -namespace LINGYUN.Abp.LocalizationManagement +namespace LINGYUN.Abp.LocalizationManagement; + +public class Resource : AuditedEntity { - public class Resource : AuditedEntity + public virtual bool Enable { get; set; } + public virtual string Name { get; set; } + public virtual string DisplayName { get; set; } + public virtual string Description { get; set; } + public virtual string DefaultCultureName { get; set; } + protected Resource() { } + public Resource( + Guid id, + [NotNull] string name, + [CanBeNull] string displayName = null, + [CanBeNull] string description = null, + [CanBeNull] string defaultCultureName = null) + : base(id) { - public virtual bool Enable { get; set; } - public virtual string Name { get; set; } - public virtual string DisplayName { get; set; } - public virtual string Description { get; set; } - public virtual string DefaultCultureName { get; set; } - protected Resource() { } - public Resource( - Guid id, - [NotNull] string name, - [CanBeNull] string displayName = null, - [CanBeNull] string description = null, - [CanBeNull] string defaultCultureName = null) - : base(id) - { - Name = Check.NotNullOrWhiteSpace(name, nameof(name), ResourceConsts.MaxNameLength); + Name = Check.NotNullOrWhiteSpace(name, nameof(name), ResourceConsts.MaxNameLength); - DisplayName = Check.Length(displayName ?? Name, nameof(displayName), ResourceConsts.MaxDisplayNameLength);; - Description = Check.Length(description, nameof(description), ResourceConsts.MaxDescriptionLength); - DefaultCultureName = Check.Length(defaultCultureName, nameof(defaultCultureName), ResourceConsts.MaxDefaultCultureNameLength); + DisplayName = Check.Length(displayName ?? Name, nameof(displayName), ResourceConsts.MaxDisplayNameLength);; + Description = Check.Length(description, nameof(description), ResourceConsts.MaxDescriptionLength); + DefaultCultureName = Check.Length(defaultCultureName, nameof(defaultCultureName), ResourceConsts.MaxDefaultCultureNameLength); - Enable = true; - } + Enable = true; + } - public virtual void SetDisplayName(string displayName) - { - DisplayName = Check.Length(displayName, nameof(displayName), ResourceConsts.MaxDisplayNameLength); - } + public virtual void SetDisplayName(string displayName) + { + DisplayName = Check.Length(displayName, nameof(displayName), ResourceConsts.MaxDisplayNameLength); + } - public virtual void SetDescription(string description) - { - Description = Check.Length(description, nameof(description), ResourceConsts.MaxDescriptionLength); - } + public virtual void SetDescription(string description) + { + Description = Check.Length(description, nameof(description), ResourceConsts.MaxDescriptionLength); + } - public virtual void SetDefaultCultureName(string defaultCultureName) - { - DefaultCultureName = Check.Length(defaultCultureName, nameof(defaultCultureName), ResourceConsts.MaxDefaultCultureNameLength); - } + public virtual void SetDefaultCultureName(string defaultCultureName) + { + DefaultCultureName = Check.Length(defaultCultureName, nameof(defaultCultureName), ResourceConsts.MaxDefaultCultureNameLength); } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/Text.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/Text.cs index 6bd88117b..a513bb2b7 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/Text.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/Text.cs @@ -3,35 +3,34 @@ using Volo.Abp; using Volo.Abp.Domain.Entities; -namespace LINGYUN.Abp.LocalizationManagement +namespace LINGYUN.Abp.LocalizationManagement; + +public class Text : Entity { - public class Text : Entity + public virtual string CultureName { get; protected set; } + public virtual string Key { get; protected set; } + public virtual string Value { get; protected set; } + public virtual string ResourceName { get; protected set; } + protected Text() { } + public Text( + [NotNull] string resourceName, + [NotNull] string cultureName, + [NotNull] string key, + [CanBeNull] string value) { - public virtual string CultureName { get; protected set; } - public virtual string Key { get; protected set; } - public virtual string Value { get; protected set; } - public virtual string ResourceName { get; protected set; } - protected Text() { } - public Text( - [NotNull] string resourceName, - [NotNull] string cultureName, - [NotNull] string key, - [CanBeNull] string value) - { - ResourceName = Check.NotNull(resourceName, nameof(resourceName), ResourceConsts.MaxNameLength); - CultureName = Check.NotNullOrWhiteSpace(cultureName, nameof(cultureName), LanguageConsts.MaxCultureNameLength); - Key = Check.NotNullOrWhiteSpace(key, nameof(key), TextConsts.MaxKeyLength); + ResourceName = Check.NotNull(resourceName, nameof(resourceName), ResourceConsts.MaxNameLength); + CultureName = Check.NotNullOrWhiteSpace(cultureName, nameof(cultureName), LanguageConsts.MaxCultureNameLength); + Key = Check.NotNullOrWhiteSpace(key, nameof(key), TextConsts.MaxKeyLength); - Value = !value.IsNullOrWhiteSpace() - ? Check.NotNullOrWhiteSpace(value, nameof(value), TextConsts.MaxValueLength) - : ""; - } + Value = !value.IsNullOrWhiteSpace() + ? Check.NotNullOrWhiteSpace(value, nameof(value), TextConsts.MaxValueLength) + : ""; + } - public void SetValue(string value) - { - Value = !value.IsNullOrWhiteSpace() - ? Check.NotNullOrWhiteSpace(value, nameof(value), TextConsts.MaxValueLength) - : Value; - } + public void SetValue(string value) + { + Value = !value.IsNullOrWhiteSpace() + ? Check.NotNullOrWhiteSpace(value, nameof(value), TextConsts.MaxValueLength) + : Value; } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore.csproj b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore.csproj index 9236c4b8c..3aa6256e7 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore.csproj +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore + LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore + false + false + false diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/AbpLocalizationManagementEntityFrameworkCoreModule.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/AbpLocalizationManagementEntityFrameworkCoreModule.cs index ec4a9e4c9..50639911e 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/AbpLocalizationManagementEntityFrameworkCoreModule.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/AbpLocalizationManagementEntityFrameworkCoreModule.cs @@ -2,23 +2,22 @@ using Volo.Abp.EntityFrameworkCore; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore +namespace LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore; + +[DependsOn( + typeof(AbpEntityFrameworkCoreModule), + typeof(AbpLocalizationManagementDomainModule))] +public class AbpLocalizationManagementEntityFrameworkCoreModule : AbpModule { - [DependsOn( - typeof(AbpEntityFrameworkCoreModule), - typeof(AbpLocalizationManagementDomainModule))] - public class AbpLocalizationManagementEntityFrameworkCoreModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + context.Services.AddAbpDbContext(options => { - context.Services.AddAbpDbContext(options => - { - options.AddRepository(); - options.AddRepository(); - options.AddRepository(); + options.AddRepository(); + options.AddRepository(); + options.AddRepository(); - options.AddDefaultRepositories(includeAllEntities: true); - }); - } + options.AddDefaultRepositories(includeAllEntities: true); + }); } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/EfCoreLanguageRepository.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/EfCoreLanguageRepository.cs index 0c5a175e4..e1698ec03 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/EfCoreLanguageRepository.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/EfCoreLanguageRepository.cs @@ -7,28 +7,27 @@ using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; -namespace LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore +namespace LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore; + +public class EfCoreLanguageRepository : EfCoreRepository, + ILanguageRepository { - public class EfCoreLanguageRepository : EfCoreRepository, - ILanguageRepository + public EfCoreLanguageRepository( + IDbContextProvider dbContextProvider) : base(dbContextProvider) { - public EfCoreLanguageRepository( - IDbContextProvider dbContextProvider) : base(dbContextProvider) - { - } + } - public async virtual Task FindByCultureNameAsync( - string cultureName, - CancellationToken cancellationToken = default) - { - return await (await GetDbSetAsync()).Where(x => x.CultureName.Equals(cultureName)) - .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task FindByCultureNameAsync( + string cultureName, + CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()).Where(x => x.CultureName.Equals(cultureName)) + .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task> GetActivedListAsync(CancellationToken cancellationToken = default) - { - return await (await GetDbSetAsync()).Where(x => x.Enable) - .ToListAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task> GetActivedListAsync(CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()).Where(x => x.Enable) + .ToListAsync(GetCancellationToken(cancellationToken)); } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/EfCoreResourceRepository.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/EfCoreResourceRepository.cs index 3cf7e0738..39321c232 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/EfCoreResourceRepository.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/EfCoreResourceRepository.cs @@ -6,29 +6,28 @@ using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; -namespace LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore +namespace LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore; + +public class EfCoreResourceRepository : EfCoreRepository, + IResourceRepository { - public class EfCoreResourceRepository : EfCoreRepository, - IResourceRepository + public EfCoreResourceRepository( + IDbContextProvider dbContextProvider) : base(dbContextProvider) { - public EfCoreResourceRepository( - IDbContextProvider dbContextProvider) : base(dbContextProvider) - { - } + } - public async virtual Task ExistsAsync( - string name, - CancellationToken cancellationToken = default) - { - return await (await GetDbSetAsync()).AnyAsync(x => x.Name.Equals(name)); - } + public async virtual Task ExistsAsync( + string name, + CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()).AnyAsync(x => x.Name.Equals(name)); + } - public async virtual Task FindByNameAsync( - string name, - CancellationToken cancellationToken = default) - { - return await (await GetDbSetAsync()).Where(x => x.Name.Equals(name)) - .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task FindByNameAsync( + string name, + CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()).Where(x => x.Name.Equals(name)) + .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/EfCoreTextRepository.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/EfCoreTextRepository.cs index 43ca744e7..0b7446b71 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/EfCoreTextRepository.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/EfCoreTextRepository.cs @@ -9,150 +9,149 @@ using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; -namespace LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore +namespace LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore; + +public class EfCoreTextRepository : EfCoreRepository, + ITextRepository { - public class EfCoreTextRepository : EfCoreRepository, - ITextRepository + public EfCoreTextRepository( + IDbContextProvider dbContextProvider) : base(dbContextProvider) { - public EfCoreTextRepository( - IDbContextProvider dbContextProvider) : base(dbContextProvider) - { - } + } - public async virtual Task> GetExistsKeysAsync( - string resourceName, - string cultureName, - IEnumerable keys, - CancellationToken cancellationToken = default) - { - return await (await GetDbSetAsync()) - .Where(x => x.ResourceName.Equals(resourceName) && x.CultureName.Equals(cultureName) - && keys.Contains(x.Key)) - .Select(x => x.Key) - .Distinct() - .ToListAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task> GetExistsKeysAsync( + string resourceName, + string cultureName, + IEnumerable keys, + CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()) + .Where(x => x.ResourceName.Equals(resourceName) && x.CultureName.Equals(cultureName) + && keys.Contains(x.Key)) + .Select(x => x.Key) + .Distinct() + .ToListAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task GetByCultureKeyAsync( - string resourceName, - string cultureName, - string key, - CancellationToken cancellationToken = default - ) - { - return await (await GetDbSetAsync()) - .Where(x => x.ResourceName.Equals(resourceName) && x.CultureName.Equals(cultureName) && x.Key.Equals(key)) - .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task GetByCultureKeyAsync( + string resourceName, + string cultureName, + string key, + CancellationToken cancellationToken = default + ) + { + return await (await GetDbSetAsync()) + .Where(x => x.ResourceName.Equals(resourceName) && x.CultureName.Equals(cultureName) && x.Key.Equals(key)) + .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task GetDifferenceCountAsync( - string cultureName, - string targetCultureName, - string resourceName = null, - bool? onlyNull = null, - string filter = null, - CancellationToken cancellationToken = default) - { - return await (await BuildTextDifferenceQueryAsync( - cultureName, - targetCultureName, - resourceName, - onlyNull, - filter)) - .CountAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task GetDifferenceCountAsync( + string cultureName, + string targetCultureName, + string resourceName = null, + bool? onlyNull = null, + string filter = null, + CancellationToken cancellationToken = default) + { + return await (await BuildTextDifferenceQueryAsync( + cultureName, + targetCultureName, + resourceName, + onlyNull, + filter)) + .CountAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task> GetListAsync( - string resourceName = null, - string cultureName = null, - CancellationToken cancellationToken = default) - { - //var languages = (await GetDbContextAsync()).Set(); - //var resources = (IQueryable)(await GetDbContextAsync()).Set(); - //if (!resourceName.IsNullOrWhiteSpace()) - //{ - // resources = resources.Where(x => x.Name.Equals(resourceName)); - //} + public async virtual Task> GetListAsync( + string resourceName = null, + string cultureName = null, + CancellationToken cancellationToken = default) + { + //var languages = (await GetDbContextAsync()).Set(); + //var resources = (IQueryable)(await GetDbContextAsync()).Set(); + //if (!resourceName.IsNullOrWhiteSpace()) + //{ + // resources = resources.Where(x => x.Name.Equals(resourceName)); + //} - //var texts = await GetDbSetAsync(); + //var texts = await GetDbSetAsync(); - //return await (from txts in texts - // join r in resources - // on txts.ResourceName equals r.Name - // join lg in languages - // on txts.CultureName equals lg.CultureName - // where r.Enable && lg.Enable - // select txts) - // .ToListAsync(GetCancellationToken(cancellationToken)); + //return await (from txts in texts + // join r in resources + // on txts.ResourceName equals r.Name + // join lg in languages + // on txts.CultureName equals lg.CultureName + // where r.Enable && lg.Enable + // select txts) + // .ToListAsync(GetCancellationToken(cancellationToken)); - return await (await GetDbSetAsync()) - .WhereIf(!resourceName.IsNullOrWhiteSpace(), x => x.ResourceName.Equals(resourceName)) - .WhereIf(!cultureName.IsNullOrWhiteSpace(), x => x.CultureName.Equals(cultureName)) - .ToListAsync(GetCancellationToken(cancellationToken)); - } + return await (await GetDbSetAsync()) + .WhereIf(!resourceName.IsNullOrWhiteSpace(), x => x.ResourceName.Equals(resourceName)) + .WhereIf(!cultureName.IsNullOrWhiteSpace(), x => x.CultureName.Equals(cultureName)) + .ToListAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task> GetDifferencePagedListAsync( - string cultureName, - string targetCultureName, - string resourceName = null, - bool? onlyNull = null, - string filter = null, - string sorting = nameof(TextDifference.Key), - int skipCount = 1, - int maxResultCount = 10, - CancellationToken cancellationToken = default) - { - return await (await BuildTextDifferenceQueryAsync( - cultureName, - targetCultureName, - resourceName, - onlyNull, - filter, - sorting)) - .PageBy(skipCount, maxResultCount) - .ToListAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task> GetDifferencePagedListAsync( + string cultureName, + string targetCultureName, + string resourceName = null, + bool? onlyNull = null, + string filter = null, + string sorting = nameof(TextDifference.Key), + int skipCount = 1, + int maxResultCount = 10, + CancellationToken cancellationToken = default) + { + return await (await BuildTextDifferenceQueryAsync( + cultureName, + targetCultureName, + resourceName, + onlyNull, + filter, + sorting)) + .PageBy(skipCount, maxResultCount) + .ToListAsync(GetCancellationToken(cancellationToken)); + } - protected async virtual Task> BuildTextDifferenceQueryAsync( - string cultureName, - string targetCultureName, - string resourceName = null, - bool? onlyNull = null, - string filter = null, - string sorting = nameof(TextDifference.Key)) + protected async virtual Task> BuildTextDifferenceQueryAsync( + string cultureName, + string targetCultureName, + string resourceName = null, + bool? onlyNull = null, + string filter = null, + string sorting = nameof(TextDifference.Key)) + { + if (sorting.IsNullOrWhiteSpace()) { - if (sorting.IsNullOrWhiteSpace()) - { - sorting = nameof(TextDifference.Key); - } + sorting = nameof(TextDifference.Key); + } - var textQuery = (await GetDbSetAsync()) - .Where(x => x.CultureName.Equals(cultureName)) - .WhereIf(!resourceName.IsNullOrWhiteSpace(), x => x.ResourceName.Equals(resourceName)) - .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Key.Contains(filter)) - .OrderBy(sorting); + var textQuery = (await GetDbSetAsync()) + .Where(x => x.CultureName.Equals(cultureName)) + .WhereIf(!resourceName.IsNullOrWhiteSpace(), x => x.ResourceName.Equals(resourceName)) + .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Key.Contains(filter)) + .OrderBy(sorting); - var targetTextQuery = (await GetDbSetAsync()) - .Where(x => x.CultureName.Equals(targetCultureName)) - .WhereIf(!resourceName.IsNullOrWhiteSpace(), x => x.ResourceName.Equals(resourceName)); + var targetTextQuery = (await GetDbSetAsync()) + .Where(x => x.CultureName.Equals(targetCultureName)) + .WhereIf(!resourceName.IsNullOrWhiteSpace(), x => x.ResourceName.Equals(resourceName)); - var query = from crtText in textQuery - join tgtText in targetTextQuery - on crtText.Key equals tgtText.Key - into tgt - from tt in tgt.DefaultIfEmpty() - where onlyNull.HasValue && onlyNull.Value - ? tt.Value == null - : 1 == 1 - select new TextDifference( - crtText.Id, - crtText.CultureName, - crtText.Key, - crtText.Value, - targetCultureName, - tt != null ? tt.Value : null, - crtText.ResourceName); - return query; - } + var query = from crtText in textQuery + join tgtText in targetTextQuery + on crtText.Key equals tgtText.Key + into tgt + from tt in tgt.DefaultIfEmpty() + where onlyNull.HasValue && onlyNull.Value + ? tt.Value == null + : 1 == 1 + select new TextDifference( + crtText.Id, + crtText.CultureName, + crtText.Key, + crtText.Value, + targetCultureName, + tt != null ? tt.Value : null, + crtText.ResourceName); + return query; } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/ILocalizationDbContext.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/ILocalizationDbContext.cs index 7d04d18df..a0aa6621d 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/ILocalizationDbContext.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/ILocalizationDbContext.cs @@ -2,13 +2,12 @@ using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; -namespace LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore +namespace LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore; + +[ConnectionStringName(LocalizationDbProperties.ConnectionStringName)] +public interface ILocalizationDbContext : IEfCoreDbContext { - [ConnectionStringName(LocalizationDbProperties.ConnectionStringName)] - public interface ILocalizationDbContext : IEfCoreDbContext - { - DbSet Resources { get; } - DbSet Languages { get; } - DbSet Texts { get; } - } + DbSet Resources { get; } + DbSet Languages { get; } + DbSet Texts { get; } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/LocalizationDbContext.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/LocalizationDbContext.cs index cb6b1e92e..11f138ccd 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/LocalizationDbContext.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/LocalizationDbContext.cs @@ -2,24 +2,23 @@ using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; -namespace LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore +namespace LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore; + +[ConnectionStringName(LocalizationDbProperties.ConnectionStringName)] +public class LocalizationDbContext : AbpDbContext, ILocalizationDbContext { - [ConnectionStringName(LocalizationDbProperties.ConnectionStringName)] - public class LocalizationDbContext : AbpDbContext, ILocalizationDbContext + public virtual DbSet Resources { get; set; } + public virtual DbSet Languages { get; set; } + public virtual DbSet Texts { get; set; } + public LocalizationDbContext( + DbContextOptions options) : base(options) { - public virtual DbSet Resources { get; set; } - public virtual DbSet Languages { get; set; } - public virtual DbSet Texts { get; set; } - public LocalizationDbContext( - DbContextOptions options) : base(options) - { - } + } - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - base.OnModelCreating(modelBuilder); + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + base.OnModelCreating(modelBuilder); - modelBuilder.ConfigureLocalization(); - } + modelBuilder.ConfigureLocalization(); } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/LocalizationDbContextModelBuilderExtensions.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/LocalizationDbContextModelBuilderExtensions.cs index c5c384627..d7aa67089 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/LocalizationDbContextModelBuilderExtensions.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/LocalizationDbContextModelBuilderExtensions.cs @@ -3,100 +3,99 @@ using Volo.Abp; using Volo.Abp.EntityFrameworkCore.Modeling; -namespace LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore +namespace LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore; + +public static class LocalizationDbContextModelBuilderExtensions { - public static class LocalizationDbContextModelBuilderExtensions + public static void ConfigureLocalization( + this ModelBuilder builder, + Action optionsAction = null) { - public static void ConfigureLocalization( - this ModelBuilder builder, - Action optionsAction = null) + Check.NotNull(builder, nameof(builder)); + + var options = new LocalizationModelBuilderConfigurationOptions( + LocalizationDbProperties.DbTablePrefix, + LocalizationDbProperties.DbSchema + ); + + optionsAction?.Invoke(options); + + builder.Entity(x => + { + x.ToTable(options.TablePrefix + "Languages", options.Schema); + + x.Property(p => p.CultureName) + .IsRequired() + .HasMaxLength(LanguageConsts.MaxCultureNameLength) + .HasColumnName(nameof(Language.CultureName)); + x.Property(p => p.UiCultureName) + .IsRequired() + .HasMaxLength(LanguageConsts.MaxUiCultureNameLength) + .HasColumnName(nameof(Language.UiCultureName)); + x.Property(p => p.DisplayName) + .IsRequired() + .HasMaxLength(LanguageConsts.MaxDisplayNameLength) + .HasColumnName(nameof(Language.DisplayName)); + + x.Property(p => p.TwoLetterISOLanguageName) + .IsRequired(false) + .HasMaxLength(LanguageConsts.MaxTwoLetterISOLanguageNameLength) + .HasColumnName(nameof(Language.TwoLetterISOLanguageName)); + + x.Property(p => p.Enable) + .HasDefaultValue(true); + + x.ConfigureByConvention(); + + x.HasIndex(p => p.CultureName); + }); + + builder.Entity(x => + { + x.ToTable(options.TablePrefix + "Resources", options.Schema); + + x.Property(p => p.Name) + .IsRequired() + .HasMaxLength(ResourceConsts.MaxNameLength) + .HasColumnName(nameof(Resource.Name)); + + x.Property(p => p.DisplayName) + .HasMaxLength(ResourceConsts.MaxDisplayNameLength) + .HasColumnName(nameof(Resource.DisplayName)); + x.Property(p => p.Description) + .HasMaxLength(ResourceConsts.MaxDescriptionLength) + .HasColumnName(nameof(Resource.Description)); + x.Property(p => p.DefaultCultureName) + .HasMaxLength(ResourceConsts.MaxDefaultCultureNameLength) + .HasColumnName(nameof(Resource.DefaultCultureName)); + + x.Property(p => p.Enable) + .HasDefaultValue(true); + + x.ConfigureByConvention(); + + x.HasIndex(p => p.Name); + }); + + builder.Entity(x => { - Check.NotNull(builder, nameof(builder)); - - var options = new LocalizationModelBuilderConfigurationOptions( - LocalizationDbProperties.DbTablePrefix, - LocalizationDbProperties.DbSchema - ); - - optionsAction?.Invoke(options); - - builder.Entity(x => - { - x.ToTable(options.TablePrefix + "Languages", options.Schema); - - x.Property(p => p.CultureName) - .IsRequired() - .HasMaxLength(LanguageConsts.MaxCultureNameLength) - .HasColumnName(nameof(Language.CultureName)); - x.Property(p => p.UiCultureName) - .IsRequired() - .HasMaxLength(LanguageConsts.MaxUiCultureNameLength) - .HasColumnName(nameof(Language.UiCultureName)); - x.Property(p => p.DisplayName) - .IsRequired() - .HasMaxLength(LanguageConsts.MaxDisplayNameLength) - .HasColumnName(nameof(Language.DisplayName)); - - x.Property(p => p.FlagIcon) - .IsRequired(false) - .HasMaxLength(LanguageConsts.MaxFlagIconLength) - .HasColumnName(nameof(Language.FlagIcon)); - - x.Property(p => p.Enable) - .HasDefaultValue(true); - - x.ConfigureByConvention(); - - x.HasIndex(p => p.CultureName); - }); - - builder.Entity(x => - { - x.ToTable(options.TablePrefix + "Resources", options.Schema); - - x.Property(p => p.Name) - .IsRequired() - .HasMaxLength(ResourceConsts.MaxNameLength) - .HasColumnName(nameof(Resource.Name)); - - x.Property(p => p.DisplayName) - .HasMaxLength(ResourceConsts.MaxDisplayNameLength) - .HasColumnName(nameof(Resource.DisplayName)); - x.Property(p => p.Description) - .HasMaxLength(ResourceConsts.MaxDescriptionLength) - .HasColumnName(nameof(Resource.Description)); - x.Property(p => p.DefaultCultureName) - .HasMaxLength(ResourceConsts.MaxDefaultCultureNameLength) - .HasColumnName(nameof(Resource.DefaultCultureName)); - - x.Property(p => p.Enable) - .HasDefaultValue(true); - - x.ConfigureByConvention(); - - x.HasIndex(p => p.Name); - }); - - builder.Entity(x => - { - x.ToTable(options.TablePrefix + "Texts", options.Schema); - - x.Property(p => p.CultureName) - .IsRequired() - .HasMaxLength(LanguageConsts.MaxCultureNameLength) - .HasColumnName(nameof(Text.CultureName)); - x.Property(p => p.Key) - .IsRequired() - .HasMaxLength(TextConsts.MaxKeyLength) - .HasColumnName(nameof(Text.Key)); - x.Property(p => p.Value) - .HasMaxLength(TextConsts.MaxValueLength) - .HasColumnName(nameof(Text.Value)); - - x.ConfigureByConvention(); - - x.HasIndex(p => p.Key); - }); - } + x.ToTable(options.TablePrefix + "Texts", options.Schema); + + x.Property(p => p.CultureName) + .IsRequired() + .HasMaxLength(LanguageConsts.MaxCultureNameLength) + .HasColumnName(nameof(Text.CultureName)); + x.Property(p => p.Key) + .IsRequired() + .HasMaxLength(TextConsts.MaxKeyLength) + .HasColumnName(nameof(Text.Key)); + x.Property(p => p.Value) + .HasMaxLength(TextConsts.MaxValueLength) + .HasColumnName(nameof(Text.Value)); + + x.ConfigureByConvention(); + + x.HasIndex(p => p.Key); + }); } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/LocalizationModelBuilderConfigurationOptions.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/LocalizationModelBuilderConfigurationOptions.cs index 87eb764cf..48b5dd101 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/LocalizationModelBuilderConfigurationOptions.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore/LINGYUN/Abp/LocalizationManagement/EntityFrameworkCore/LocalizationModelBuilderConfigurationOptions.cs @@ -1,18 +1,17 @@ using JetBrains.Annotations; using Volo.Abp.EntityFrameworkCore.Modeling; -namespace LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore +namespace LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore; + +public class LocalizationModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions { - public class LocalizationModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions + public LocalizationModelBuilderConfigurationOptions( + [NotNull] string tablePrefix = "", + [CanBeNull] string schema = null) + : base( + tablePrefix, + schema) { - public LocalizationModelBuilderConfigurationOptions( - [NotNull] string tablePrefix = "", - [CanBeNull] string schema = null) - : base( - tablePrefix, - schema) - { - } } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.HttpApi/LINGYUN.Abp.LocalizationManagement.HttpApi.csproj b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.HttpApi/LINGYUN.Abp.LocalizationManagement.HttpApi.csproj index 70c03174f..7525258fe 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.HttpApi/LINGYUN.Abp.LocalizationManagement.HttpApi.csproj +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.HttpApi/LINGYUN.Abp.LocalizationManagement.HttpApi.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.LocalizationManagement.HttpApi + LINGYUN.Abp.LocalizationManagement.HttpApi + false + false + false diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.HttpApi/LINGYUN/Abp/LocalizationManagement/AbpLocalizationManagementHttpApiModule.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.HttpApi/LINGYUN/Abp/LocalizationManagement/AbpLocalizationManagementHttpApiModule.cs index 89d4ef9d9..06bcd8edd 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.HttpApi/LINGYUN/Abp/LocalizationManagement/AbpLocalizationManagementHttpApiModule.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.HttpApi/LINGYUN/Abp/LocalizationManagement/AbpLocalizationManagementHttpApiModule.cs @@ -7,37 +7,36 @@ using Volo.Abp.Modularity; using Volo.Abp.Validation.Localization; -namespace LINGYUN.Abp.LocalizationManagement +namespace LINGYUN.Abp.LocalizationManagement; + +[DependsOn( + typeof(AbpAspNetCoreMvcLocalizationModule), + typeof(AbpLocalizationManagementApplicationContractsModule))] +public class AbpLocalizationManagementHttpApiModule : AbpModule { - [DependsOn( - typeof(AbpAspNetCoreMvcLocalizationModule), - typeof(AbpLocalizationManagementApplicationContractsModule))] - public class AbpLocalizationManagementHttpApiModule : AbpModule + public override void PreConfigureServices(ServiceConfigurationContext context) { - public override void PreConfigureServices(ServiceConfigurationContext context) + // Dto验证本地化 + PreConfigure(options => { - // Dto验证本地化 - PreConfigure(options => - { - options.AddAssemblyResource( - typeof(LocalizationManagementResource), - typeof(AbpLocalizationManagementApplicationContractsModule).Assembly); - }); + options.AddAssemblyResource( + typeof(LocalizationManagementResource), + typeof(AbpLocalizationManagementApplicationContractsModule).Assembly); + }); - PreConfigure(mvcBuilder => - { - mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpLocalizationManagementApplicationContractsModule).Assembly); - }); - } + PreConfigure(mvcBuilder => + { + mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpLocalizationManagementApplicationContractsModule).Assembly); + }); + } - public override void ConfigureServices(ServiceConfigurationContext context) + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => { - Configure(options => - { - options.Resources - .Get() - .AddBaseTypes(typeof(AbpValidationResource), typeof(AbpLocalizationResource)); - }); - } + options.Resources + .Get() + .AddBaseTypes(typeof(AbpValidationResource), typeof(AbpLocalizationResource)); + }); } } diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.HttpApi/LINGYUN/Abp/LocalizationManagement/TextController.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.HttpApi/LINGYUN/Abp/LocalizationManagement/TextController.cs index 23e5ba0a0..b315c98e1 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.HttpApi/LINGYUN/Abp/LocalizationManagement/TextController.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.HttpApi/LINGYUN/Abp/LocalizationManagement/TextController.cs @@ -3,31 +3,30 @@ using Volo.Abp; using Volo.Abp.AspNetCore.Mvc; -namespace LINGYUN.Abp.LocalizationManagement +namespace LINGYUN.Abp.LocalizationManagement; + +[RemoteService(Name = LocalizationRemoteServiceConsts.RemoteServiceName)] +[Area("localization")] +[Route("api/localization/texts")] +public class TextController : AbpControllerBase, ITextAppService { - [RemoteService(Name = LocalizationRemoteServiceConsts.RemoteServiceName)] - [Area("localization")] - [Route("api/localization/texts")] - public class TextController : AbpControllerBase, ITextAppService - { - private readonly ITextAppService _service; + private readonly ITextAppService _service; - public TextController(ITextAppService service) - { - _service = service; - } + public TextController(ITextAppService service) + { + _service = service; + } - [HttpPut] - public virtual Task SetTextAsync(SetTextInput input) - { - return _service.SetTextAsync(input); - } + [HttpPut] + public virtual Task SetTextAsync(SetTextInput input) + { + return _service.SetTextAsync(input); + } - [HttpDelete] - [Route("restore-to-default")] - public virtual Task RestoreToDefaultAsync(RestoreDefaultTextInput input) - { - return _service.RestoreToDefaultAsync(input); - } + [HttpDelete] + [Route("restore-to-default")] + public virtual Task RestoreToDefaultAsync(RestoreDefaultTextInput input) + { + return _service.RestoreToDefaultAsync(input); } } diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN.Abp.OpenIddict.Application.Contracts.csproj b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN.Abp.OpenIddict.Application.Contracts.csproj index bca0b55e8..c18cb6f70 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN.Abp.OpenIddict.Application.Contracts.csproj +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN.Abp.OpenIddict.Application.Contracts.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.OpenIddict.Application.Contracts + LINGYUN.Abp.OpenIddict.Application.Contracts + false + false + false diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Permissions/AbpOpenIddictPermissionDefinitionProvider.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Permissions/AbpOpenIddictPermissionDefinitionProvider.cs index f62e7b4ca..2d3f6f2c0 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Permissions/AbpOpenIddictPermissionDefinitionProvider.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Permissions/AbpOpenIddictPermissionDefinitionProvider.cs @@ -3,85 +3,84 @@ using Volo.Abp.MultiTenancy; using Volo.Abp.OpenIddict.Localization; -namespace LINGYUN.Abp.OpenIddict.Permissions +namespace LINGYUN.Abp.OpenIddict.Permissions; + +public class AbpIdentityServerPermissionDefinitionProvider : PermissionDefinitionProvider { - public class AbpIdentityServerPermissionDefinitionProvider : PermissionDefinitionProvider + public override void Define(IPermissionDefinitionContext context) { - public override void Define(IPermissionDefinitionContext context) + var openIddictGroup = context.GetGroupOrNull(AbpOpenIddictPermissions.GroupName); + if (openIddictGroup == null) { - var openIddictGroup = context.GetGroupOrNull(AbpOpenIddictPermissions.GroupName); - if (openIddictGroup == null) - { - openIddictGroup = context - .AddGroup( - name: AbpOpenIddictPermissions.GroupName, - displayName: L("Permissions:OpenIddict")); - } + openIddictGroup = context + .AddGroup( + name: AbpOpenIddictPermissions.GroupName, + displayName: L("Permissions:OpenIddict")); + } - var applications = openIddictGroup.AddPermission( - AbpOpenIddictPermissions.Applications.Default, - L("Permissions:Applications"), - MultiTenancySides.Host); - applications.AddChild( - AbpOpenIddictPermissions.Applications.Create, - L("Permissions:Create"), - MultiTenancySides.Host); - applications.AddChild( - AbpOpenIddictPermissions.Applications.Update, - L("Permissions:Update"), - MultiTenancySides.Host); - applications.AddChild( - AbpOpenIddictPermissions.Applications.Delete, - L("Permissions:Delete"), - MultiTenancySides.Host); - applications.AddChild( - AbpOpenIddictPermissions.Applications.ManagePermissions, - L("Permissions:ManagePermissions"), - MultiTenancySides.Host); - applications.AddChild( - AbpOpenIddictPermissions.Applications.ManageSecret, - L("Permissions:ManageSecret"), - MultiTenancySides.Host); + var applications = openIddictGroup.AddPermission( + AbpOpenIddictPermissions.Applications.Default, + L("Permissions:Applications"), + MultiTenancySides.Host); + applications.AddChild( + AbpOpenIddictPermissions.Applications.Create, + L("Permissions:Create"), + MultiTenancySides.Host); + applications.AddChild( + AbpOpenIddictPermissions.Applications.Update, + L("Permissions:Update"), + MultiTenancySides.Host); + applications.AddChild( + AbpOpenIddictPermissions.Applications.Delete, + L("Permissions:Delete"), + MultiTenancySides.Host); + applications.AddChild( + AbpOpenIddictPermissions.Applications.ManagePermissions, + L("Permissions:ManagePermissions"), + MultiTenancySides.Host); + applications.AddChild( + AbpOpenIddictPermissions.Applications.ManageSecret, + L("Permissions:ManageSecret"), + MultiTenancySides.Host); - var authorizations = openIddictGroup.AddPermission( - AbpOpenIddictPermissions.Authorizations.Default, - L("Permissions:Authorizations"), - MultiTenancySides.Host); - authorizations.AddChild( - AbpOpenIddictPermissions.Authorizations.Delete, - L("Permissions:Delete"), - MultiTenancySides.Host); + var authorizations = openIddictGroup.AddPermission( + AbpOpenIddictPermissions.Authorizations.Default, + L("Permissions:Authorizations"), + MultiTenancySides.Host); + authorizations.AddChild( + AbpOpenIddictPermissions.Authorizations.Delete, + L("Permissions:Delete"), + MultiTenancySides.Host); - var scopes = openIddictGroup.AddPermission( - AbpOpenIddictPermissions.Scopes.Default, - L("Permissions:Scopes"), - MultiTenancySides.Host); - scopes.AddChild( - AbpOpenIddictPermissions.Scopes.Create, - L("Permissions:Create"), - MultiTenancySides.Host); - scopes.AddChild( - AbpOpenIddictPermissions.Scopes.Update, - L("Permissions:Update"), - MultiTenancySides.Host); - scopes.AddChild( - AbpOpenIddictPermissions.Scopes.Delete, - L("Permissions:Delete"), - MultiTenancySides.Host); + var scopes = openIddictGroup.AddPermission( + AbpOpenIddictPermissions.Scopes.Default, + L("Permissions:Scopes"), + MultiTenancySides.Host); + scopes.AddChild( + AbpOpenIddictPermissions.Scopes.Create, + L("Permissions:Create"), + MultiTenancySides.Host); + scopes.AddChild( + AbpOpenIddictPermissions.Scopes.Update, + L("Permissions:Update"), + MultiTenancySides.Host); + scopes.AddChild( + AbpOpenIddictPermissions.Scopes.Delete, + L("Permissions:Delete"), + MultiTenancySides.Host); - var tokens = openIddictGroup.AddPermission( - AbpOpenIddictPermissions.Tokens.Default, - L("Permissions:Tokens"), - MultiTenancySides.Host); - tokens.AddChild( - AbpOpenIddictPermissions.Tokens.Delete, - L("Permissions:Delete"), - MultiTenancySides.Host); - } + var tokens = openIddictGroup.AddPermission( + AbpOpenIddictPermissions.Tokens.Default, + L("Permissions:Tokens"), + MultiTenancySides.Host); + tokens.AddChild( + AbpOpenIddictPermissions.Tokens.Delete, + L("Permissions:Delete"), + MultiTenancySides.Host); + } - protected virtual LocalizableString L(string name) - { - return LocalizableString.Create(name); - } + protected virtual LocalizableString L(string name) + { + return LocalizableString.Create(name); } } diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Permissions/AbpOpenIddictPermissions.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Permissions/AbpOpenIddictPermissions.cs index 7a8125062..fc0061843 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Permissions/AbpOpenIddictPermissions.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application.Contracts/LINGYUN/Abp/OpenIddict/Permissions/AbpOpenIddictPermissions.cs @@ -1,37 +1,36 @@ -namespace LINGYUN.Abp.OpenIddict.Permissions +namespace LINGYUN.Abp.OpenIddict.Permissions; + +public class AbpOpenIddictPermissions { - public class AbpOpenIddictPermissions - { - public const string GroupName = "AbpOpenIddict"; + public const string GroupName = "AbpOpenIddict"; - public static class Applications - { - public const string Default = GroupName + ".Applications"; - public const string Create = Default + ".Create"; - public const string Update = Default + ".Update"; - public const string Delete = Default + ".Delete"; - public const string ManagePermissions = Default + ".ManagePermissions"; - public const string ManageSecret = Default + ".ManageSecret"; - } + public static class Applications + { + public const string Default = GroupName + ".Applications"; + public const string Create = Default + ".Create"; + public const string Update = Default + ".Update"; + public const string Delete = Default + ".Delete"; + public const string ManagePermissions = Default + ".ManagePermissions"; + public const string ManageSecret = Default + ".ManageSecret"; + } - public static class Authorizations - { - public const string Default = GroupName + ".Authorizations"; - public const string Delete = Default + ".Delete"; - } + public static class Authorizations + { + public const string Default = GroupName + ".Authorizations"; + public const string Delete = Default + ".Delete"; + } - public static class Scopes - { - public const string Default = GroupName + ".Scopes"; - public const string Create = Default + ".Create"; - public const string Update = Default + ".Update"; - public const string Delete = Default + ".Delete"; - } + public static class Scopes + { + public const string Default = GroupName + ".Scopes"; + public const string Create = Default + ".Create"; + public const string Update = Default + ".Update"; + public const string Delete = Default + ".Delete"; + } - public static class Tokens - { - public const string Default = GroupName + ".Tokens"; - public const string Delete = Default + ".Delete"; - } + public static class Tokens + { + public const string Default = GroupName + ".Tokens"; + public const string Delete = Default + ".Delete"; } } diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN.Abp.OpenIddict.Application.csproj b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN.Abp.OpenIddict.Application.csproj index 40e1eeaa6..16f2026a1 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN.Abp.OpenIddict.Application.csproj +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Application/LINGYUN.Abp.OpenIddict.Application.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.OpenIddict.Application + LINGYUN.Abp.OpenIddict.Application + false + false + false diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/FodyWeavers.xml b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/FodyWeavers.xml new file mode 100644 index 000000000..1715698cc --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/FodyWeavers.xsd b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/FodyWeavers.xsd new file mode 100644 index 000000000..3f3946e28 --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/LINGYUN.Abp.OpenIddict.AspNetCore.Session.csproj b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/LINGYUN.Abp.OpenIddict.AspNetCore.Session.csproj new file mode 100644 index 000000000..56a126c40 --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/LINGYUN.Abp.OpenIddict.AspNetCore.Session.csproj @@ -0,0 +1,25 @@ + + + + + + + net8.0 + LINGYUN.Abp.OpenIddict.AspNetCore.Session + LINGYUN.Abp.OpenIddict.AspNetCore.Session + false + false + false + + + + + + + + + + + + + diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/LINGYUN/Abp/OpenIddict/AspNetCore/Session/AbpOpenIddictAspNetCoreSessionModule.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/LINGYUN/Abp/OpenIddict/AspNetCore/Session/AbpOpenIddictAspNetCoreSessionModule.cs new file mode 100644 index 000000000..331cfbb7f --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/LINGYUN/Abp/OpenIddict/AspNetCore/Session/AbpOpenIddictAspNetCoreSessionModule.cs @@ -0,0 +1,35 @@ +using LINGYUN.Abp.Identity; +using LINGYUN.Abp.Identity.Session; +using LINGYUN.Abp.Identity.Session.AspNetCore; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Modularity; +using Volo.Abp.OpenIddict; + +namespace LINGYUN.Abp.OpenIddict.AspNetCore.Session; + +[DependsOn( + typeof(AbpIdentitySessionAspNetCoreModule), + typeof(AbpIdentityDomainModule), + typeof(AbpOpenIddictAspNetCoreModule))] +public class AbpOpenIddictAspNetCoreSessionModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + PreConfigure(builder => + { + builder.AddEventHandler(ProcessSignOutIdentitySession.Descriptor); + builder.AddEventHandler(ProcessSignInIdentitySession.Descriptor); + builder.AddEventHandler(RevocationIdentitySession.Descriptor); + builder.AddEventHandler(UserinfoIdentitySession.Descriptor); + }); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.SignInSessionEnabled = true; + options.SignOutSessionEnabled = true; + }); + } +} diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/LINGYUN/Abp/OpenIddict/AspNetCore/Session/ProcessSignInIdentitySession.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/LINGYUN/Abp/OpenIddict/AspNetCore/Session/ProcessSignInIdentitySession.cs new file mode 100644 index 000000000..1f1ccce98 --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/LINGYUN/Abp/OpenIddict/AspNetCore/Session/ProcessSignInIdentitySession.cs @@ -0,0 +1,34 @@ +using LINGYUN.Abp.Identity.Session; +using OpenIddict.Abstractions; +using OpenIddict.Server; +using System.Threading.Tasks; + +namespace LINGYUN.Abp.OpenIddict.AspNetCore.Session; +/// +/// 登录成功持久化用户会话 +/// +public class ProcessSignInIdentitySession : IOpenIddictServerHandler +{ + protected IIdentitySessionManager IdentitySessionManager { get; } + + public static OpenIddictServerHandlerDescriptor Descriptor { get; } + = OpenIddictServerHandlerDescriptor.CreateBuilder() + .AddFilter() + .UseScopedHandler() + .SetOrder(OpenIddictServerHandlers.PrepareAccessTokenPrincipal.Descriptor.Order + 1_000) + .SetType(OpenIddictServerHandlerType.Custom) + .Build(); + + public ProcessSignInIdentitySession(IIdentitySessionManager identitySessionManager) + { + IdentitySessionManager = identitySessionManager; + } + + public async virtual ValueTask HandleAsync(OpenIddictServerEvents.ProcessSignInContext context) + { + if (context.Request.IsPasswordGrantType() && context.Principal != null) + { + await IdentitySessionManager.SaveSessionAsync(context.Principal, context.CancellationToken); + } + } +} diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/LINGYUN/Abp/OpenIddict/AspNetCore/Session/ProcessSignOutIdentitySession.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/LINGYUN/Abp/OpenIddict/AspNetCore/Session/ProcessSignOutIdentitySession.cs new file mode 100644 index 000000000..42555f45b --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/LINGYUN/Abp/OpenIddict/AspNetCore/Session/ProcessSignOutIdentitySession.cs @@ -0,0 +1,39 @@ +using LINGYUN.Abp.Identity.Session; +using OpenIddict.Server; +using System; +using System.Threading.Tasks; + +namespace LINGYUN.Abp.OpenIddict.AspNetCore.Session; +/// +/// 用户退出登录终止会话 +/// +public class ProcessSignOutIdentitySession : IOpenIddictServerHandler +{ + protected ISessionInfoProvider SessionInfoProvider { get; } + protected IIdentitySessionManager IdentitySessionManager { get; } + + public static OpenIddictServerHandlerDescriptor Descriptor { get; } + = OpenIddictServerHandlerDescriptor.CreateBuilder() + .AddFilter() + .UseScopedHandler() + .SetOrder(OpenIddictServerHandlers.ValidateSignOutDemand.Descriptor.Order + 1_000) + .SetType(OpenIddictServerHandlerType.Custom) + .Build(); + + public ProcessSignOutIdentitySession( + ISessionInfoProvider sessionInfoProvider, + IIdentitySessionManager identitySessionManager) + { + SessionInfoProvider = sessionInfoProvider; + IdentitySessionManager = identitySessionManager; + } + + public async virtual ValueTask HandleAsync(OpenIddictServerEvents.ProcessSignOutContext context) + { + var sessionId = SessionInfoProvider.SessionId; + if (!sessionId.IsNullOrWhiteSpace()) + { + await IdentitySessionManager.RevokeSessionAsync(sessionId); + } + } +} diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/LINGYUN/Abp/OpenIddict/AspNetCore/Session/RevocationIdentitySession.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/LINGYUN/Abp/OpenIddict/AspNetCore/Session/RevocationIdentitySession.cs new file mode 100644 index 000000000..7e1109b23 --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/LINGYUN/Abp/OpenIddict/AspNetCore/Session/RevocationIdentitySession.cs @@ -0,0 +1,36 @@ +using LINGYUN.Abp.Identity.Session; +using OpenIddict.Server; +using System; +using System.Security.Principal; +using System.Threading.Tasks; + +namespace LINGYUN.Abp.OpenIddict.AspNetCore.Session; +/// +/// 令牌撤销终止用户会话 +/// +public class RevocationIdentitySession : IOpenIddictServerHandler +{ + protected IIdentitySessionManager IdentitySessionManager { get; } + + public static OpenIddictServerHandlerDescriptor Descriptor { get; } + = OpenIddictServerHandlerDescriptor.CreateBuilder() + .AddFilter() + .UseScopedHandler() + .SetOrder(OpenIddictServerHandlers.Revocation.RevokeToken.Descriptor.Order + 1_000) + .SetType(OpenIddictServerHandlerType.Custom) + .Build(); + + public RevocationIdentitySession(IIdentitySessionManager identitySessionManager) + { + IdentitySessionManager = identitySessionManager; + } + + public async virtual ValueTask HandleAsync(OpenIddictServerEvents.HandleRevocationRequestContext context) + { + var sessionId = context.Principal.FindSessionId(); + if (!sessionId.IsNullOrWhiteSpace()) + { + await IdentitySessionManager.RevokeSessionAsync(sessionId); + } + } +} diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/LINGYUN/Abp/OpenIddict/AspNetCore/Session/UserinfoIdentitySession.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/LINGYUN/Abp/OpenIddict/AspNetCore/Session/UserinfoIdentitySession.cs new file mode 100644 index 000000000..0abb32fde --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore.Session/LINGYUN/Abp/OpenIddict/AspNetCore/Session/UserinfoIdentitySession.cs @@ -0,0 +1,41 @@ +using LINGYUN.Abp.Identity.Session; +using OpenIddict.Server; +using System; +using System.Security.Principal; +using System.Threading.Tasks; +using static OpenIddict.Abstractions.OpenIddictConstants; +using static OpenIddict.Server.OpenIddictServerHandlers.Userinfo; + +namespace LINGYUN.Abp.OpenIddict.AspNetCore.Session; +/// +/// UserInfoEndpoint 检查用户会话 +/// +public class UserinfoIdentitySession : IOpenIddictServerHandler +{ + protected IIdentitySessionChecker IdentitySessionChecker { get; } + + public static OpenIddictServerHandlerDescriptor Descriptor { get; } + = OpenIddictServerHandlerDescriptor.CreateBuilder() + .AddFilter() + .UseScopedHandler() + .SetOrder(ValidateAccessTokenParameter.Descriptor.Order + 2_000) + .SetType(OpenIddictServerHandlerType.Custom) + .Build(); + + public UserinfoIdentitySession(IIdentitySessionChecker identitySessionChecker) + { + IdentitySessionChecker = identitySessionChecker; + } + + public async virtual ValueTask HandleAsync(OpenIddictServerEvents.HandleUserinfoRequestContext context) + { + var sessionId = context.Principal.FindSessionId(); + if (sessionId.IsNullOrWhiteSpace() || + !await IdentitySessionChecker.ValidateSessionAsync(sessionId)) + { + // Errors.InvalidToken ---> 401 + // Errors.ExpiredToken ---> 400 + context.Reject(Errors.InvalidToken, "The user session has expired."); + } + } +} diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/LINGYUN.Abp.OpenIddict.AspNetCore.csproj b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/LINGYUN.Abp.OpenIddict.AspNetCore.csproj index 0c6a2b1bf..5f6cf9f6c 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/LINGYUN.Abp.OpenIddict.AspNetCore.csproj +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/LINGYUN.Abp.OpenIddict.AspNetCore.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.OpenIddict.AspNetCore + LINGYUN.Abp.OpenIddict.AspNetCore + false + false + false diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/LINGYUN/Abp/OpenIddict/AspNetCore/AbpSessionOpenIddictClaimsPrincipalHandler.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/LINGYUN/Abp/OpenIddict/AspNetCore/AbpSessionOpenIddictClaimsPrincipalHandler.cs new file mode 100644 index 000000000..065fa5c43 --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/LINGYUN/Abp/OpenIddict/AspNetCore/AbpSessionOpenIddictClaimsPrincipalHandler.cs @@ -0,0 +1,12 @@ +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; +using Volo.Abp.OpenIddict; + +namespace LINGYUN.Abp.OpenIddict.AspNetCore; +public class AbpSessionOpenIddictClaimsPrincipalHandler : IAbpOpenIddictClaimsPrincipalHandler, ITransientDependency +{ + public Task HandleAsync(AbpOpenIddictClaimsPrincipalHandlerContext context) + { + return Task.CompletedTask; + } +} diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Dapr.Client/LINGYUN.Abp.OpenIddict.Dapr.Client.csproj b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Dapr.Client/LINGYUN.Abp.OpenIddict.Dapr.Client.csproj index 15a30ebbf..c7fb1deda 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Dapr.Client/LINGYUN.Abp.OpenIddict.Dapr.Client.csproj +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Dapr.Client/LINGYUN.Abp.OpenIddict.Dapr.Client.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.OpenIddict.Dapr.Client + LINGYUN.Abp.OpenIddict.Dapr.Client + false + false + false diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.HttpApi.Client/LINGYUN.Abp.OpenIddict.HttpApi.Client.csproj b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.HttpApi.Client/LINGYUN.Abp.OpenIddict.HttpApi.Client.csproj index ba8d08ce6..209bd8fab 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.HttpApi.Client/LINGYUN.Abp.OpenIddict.HttpApi.Client.csproj +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.HttpApi.Client/LINGYUN.Abp.OpenIddict.HttpApi.Client.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.OpenIddict.HttpApi.Client + LINGYUN.Abp.OpenIddict.HttpApi.Client + false + false + false diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.HttpApi/LINGYUN.Abp.OpenIddict.HttpApi.csproj b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.HttpApi/LINGYUN.Abp.OpenIddict.HttpApi.csproj index 9089b0fa7..4cbf844e7 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.HttpApi/LINGYUN.Abp.OpenIddict.HttpApi.csproj +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.HttpApi/LINGYUN.Abp.OpenIddict.HttpApi.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.OpenIddict.HttpApi + LINGYUN.Abp.OpenIddict.HttpApi + false + false + false diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.LinkUser/LINGYUN.Abp.OpenIddict.LinkUser.csproj b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.LinkUser/LINGYUN.Abp.OpenIddict.LinkUser.csproj index 0760a375e..bb83e4adf 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.LinkUser/LINGYUN.Abp.OpenIddict.LinkUser.csproj +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.LinkUser/LINGYUN.Abp.OpenIddict.LinkUser.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.OpenIddict.LinkUser + LINGYUN.Abp.OpenIddict.LinkUser + false + false + false diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Portal/LINGYUN.Abp.OpenIddict.Portal.csproj b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Portal/LINGYUN.Abp.OpenIddict.Portal.csproj index 235ff63ed..1a83fcd87 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Portal/LINGYUN.Abp.OpenIddict.Portal.csproj +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Portal/LINGYUN.Abp.OpenIddict.Portal.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.OpenIddict.Portal + LINGYUN.Abp.OpenIddict.Portal + false + false + false diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Sms/LINGYUN.Abp.OpenIddict.Sms.csproj b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Sms/LINGYUN.Abp.OpenIddict.Sms.csproj index 1f7e59a6c..b9726162f 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Sms/LINGYUN.Abp.OpenIddict.Sms.csproj +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Sms/LINGYUN.Abp.OpenIddict.Sms.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.OpenIddict.Sms + LINGYUN.Abp.OpenIddict.Sms + false + false + false diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat.Work/LINGYUN.Abp.OpenIddict.WeChat.Work.csproj b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat.Work/LINGYUN.Abp.OpenIddict.WeChat.Work.csproj index abc60b00e..d968af832 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat.Work/LINGYUN.Abp.OpenIddict.WeChat.Work.csproj +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat.Work/LINGYUN.Abp.OpenIddict.WeChat.Work.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.OpenIddict.WeChat.Work + LINGYUN.Abp.OpenIddict.WeChat.Work + false + false + false diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat/LINGYUN.Abp.OpenIddict.WeChat.csproj b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat/LINGYUN.Abp.OpenIddict.WeChat.csproj index 12fd4e41e..38d277ca5 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat/LINGYUN.Abp.OpenIddict.WeChat.csproj +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.WeChat/LINGYUN.Abp.OpenIddict.WeChat.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.OpenIddict.WeChat + LINGYUN.Abp.OpenIddict.WeChat + false + false + false diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.BlobStoring.OssManagement/LINGYUN.Abp.BlobStoring.OssManagement.csproj b/aspnet-core/modules/oss-management/LINGYUN.Abp.BlobStoring.OssManagement/LINGYUN.Abp.BlobStoring.OssManagement.csproj index a2c194cce..c5d4b100a 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.BlobStoring.OssManagement/LINGYUN.Abp.BlobStoring.OssManagement.csproj +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.BlobStoring.OssManagement/LINGYUN.Abp.BlobStoring.OssManagement.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.BlobStoring.OssManagement + LINGYUN.Abp.BlobStoring.OssManagement + false + false + false diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.BlobStoring.OssManagement/LINGYUN/Abp/BlobStoring/OssManagement/AbpBlobStoringOssManagementModule.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.BlobStoring.OssManagement/LINGYUN/Abp/BlobStoring/OssManagement/AbpBlobStoringOssManagementModule.cs index 509b4f779..4e37daf97 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.BlobStoring.OssManagement/LINGYUN/Abp/BlobStoring/OssManagement/AbpBlobStoringOssManagementModule.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.BlobStoring.OssManagement/LINGYUN/Abp/BlobStoring/OssManagement/AbpBlobStoringOssManagementModule.cs @@ -2,11 +2,10 @@ using Volo.Abp.BlobStoring; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.BlobStoring.OssManagement +namespace LINGYUN.Abp.BlobStoring.OssManagement; + +[DependsOn(typeof(AbpBlobStoringModule))] +[DependsOn(typeof(AbpOssManagementHttpApiClientModule))] +public class AbpBlobStoringOssManagementModule : AbpModule { - [DependsOn(typeof(AbpBlobStoringModule))] - [DependsOn(typeof(AbpOssManagementHttpApiClientModule))] - public class AbpBlobStoringOssManagementModule : AbpModule - { - } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.BlobStoring.OssManagement/LINGYUN/Abp/BlobStoring/OssManagement/OssManagementBlobNamingNormalizer.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.BlobStoring.OssManagement/LINGYUN/Abp/BlobStoring/OssManagement/OssManagementBlobNamingNormalizer.cs index 7f10f5c99..0e9e338d7 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.BlobStoring.OssManagement/LINGYUN/Abp/BlobStoring/OssManagement/OssManagementBlobNamingNormalizer.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.BlobStoring.OssManagement/LINGYUN/Abp/BlobStoring/OssManagement/OssManagementBlobNamingNormalizer.cs @@ -2,32 +2,31 @@ using Volo.Abp.BlobStoring; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.BlobStoring.OssManagement +namespace LINGYUN.Abp.BlobStoring.OssManagement; + +public class OssManagementBlobNamingNormalizer : IBlobNamingNormalizer, ITransientDependency { - public class OssManagementBlobNamingNormalizer : IBlobNamingNormalizer, ITransientDependency + public virtual string NormalizeBlobName(string blobName) { - public virtual string NormalizeBlobName(string blobName) - { - return NormalizeName(blobName); - } + return NormalizeName(blobName); + } - public virtual string NormalizeContainerName(string containerName) - { - // 尾部添加反斜杠 - return NormalizeName(containerName).EnsureEndsWith('/'); - } + public virtual string NormalizeContainerName(string containerName) + { + // 尾部添加反斜杠 + return NormalizeName(containerName).EnsureEndsWith('/'); + } - protected virtual string NormalizeName(string name) + protected virtual string NormalizeName(string name) + { + // 取消路径修饰符 + name = name.Replace("./", "").Replace("../", ""); + // 取消反斜杠开头 + if (name.StartsWith("/")) { - // 取消路径修饰符 - name = name.Replace("./", "").Replace("../", ""); - // 取消反斜杠开头 - if (name.StartsWith("/")) - { - name = name.Substring(1); - } - - return name; + name = name.Substring(1); } + + return name; } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.BlobStoring.OssManagement/LINGYUN/Abp/BlobStoring/OssManagement/OssManagementBlobProvider.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.BlobStoring.OssManagement/LINGYUN/Abp/BlobStoring/OssManagement/OssManagementBlobProvider.cs index 4b1961a16..44b99675a 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.BlobStoring.OssManagement/LINGYUN/Abp/BlobStoring/OssManagement/OssManagementBlobProvider.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.BlobStoring.OssManagement/LINGYUN/Abp/BlobStoring/OssManagement/OssManagementBlobProvider.cs @@ -8,117 +8,116 @@ using Volo.Abp.Content; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.BlobStoring.OssManagement +namespace LINGYUN.Abp.BlobStoring.OssManagement; + +public class OssManagementBlobProvider : BlobProviderBase, ITransientDependency { - public class OssManagementBlobProvider : BlobProviderBase, ITransientDependency + public ILogger Logger { protected get; set; } + + private readonly IOssObjectAppService _ossObjectAppService; + public OssManagementBlobProvider( + IOssObjectAppService ossObjectAppService) { - public ILogger Logger { protected get; set; } + _ossObjectAppService = ossObjectAppService; - private readonly IOssObjectAppService _ossObjectAppService; - public OssManagementBlobProvider( - IOssObjectAppService ossObjectAppService) - { - _ossObjectAppService = ossObjectAppService; + Logger = NullLogger.Instance; + } - Logger = NullLogger.Instance; - } + public override async Task DeleteAsync(BlobProviderDeleteArgs args) + { + var configuration = args.Configuration.GetOssManagementConfiguration(); + await _ossObjectAppService.DeleteAsync(new GetOssObjectInput + { + Bucket = configuration.Bucket, + Path = GetOssPath(args), + Object = GetOssName(args), + }); + return true; + } - public override async Task DeleteAsync(BlobProviderDeleteArgs args) + public override async Task ExistsAsync(BlobProviderExistsArgs args) + { + try { var configuration = args.Configuration.GetOssManagementConfiguration(); - await _ossObjectAppService.DeleteAsync(new GetOssObjectInput + var oss = await _ossObjectAppService.GetAsync(new GetOssObjectInput { Bucket = configuration.Bucket, Path = GetOssPath(args), Object = GetOssName(args), }); - return true; + return oss != null; } - - public override async Task ExistsAsync(BlobProviderExistsArgs args) + catch (Exception ex) { - try - { - var configuration = args.Configuration.GetOssManagementConfiguration(); - var oss = await _ossObjectAppService.GetAsync(new GetOssObjectInput - { - Bucket = configuration.Bucket, - Path = GetOssPath(args), - Object = GetOssName(args), - }); - return oss != null; - } - catch (Exception ex) - { - Logger.LogWarning("An error occurred while getting the OSS object, always returning that the object does not exist"); - Logger.LogWarning(ex.Message); + Logger.LogWarning("An error occurred while getting the OSS object, always returning that the object does not exist"); + Logger.LogWarning(ex.Message); - return false; - } - } - - public override async Task GetOrNullAsync(BlobProviderGetArgs args) - { - try - { - var configuration = args.Configuration.GetOssManagementConfiguration(); - var content = await _ossObjectAppService.GetContentAsync(new GetOssObjectInput - { - Bucket = configuration.Bucket, - Path = GetOssPath(args), - Object = GetOssName(args), - }); - - return content?.GetStream(); - } - catch (Exception ex) - { - Logger.LogWarning("An error occurred while getting the OSS object and an empty data stream will be returned"); - Logger.LogWarning(ex.Message); - - return null; - } + return false; } + } - public override async Task SaveAsync(BlobProviderSaveArgs args) + public override async Task GetOrNullAsync(BlobProviderGetArgs args) + { + try { var configuration = args.Configuration.GetOssManagementConfiguration(); - await _ossObjectAppService.CreateAsync(new CreateOssObjectInput + var content = await _ossObjectAppService.GetContentAsync(new GetOssObjectInput { Bucket = configuration.Bucket, - Overwrite = args.OverrideExisting, Path = GetOssPath(args), - FileName = GetOssName(args), - File = new RemoteStreamContent(args.BlobStream) + Object = GetOssName(args), }); - } - protected virtual string GetOssPath(BlobProviderArgs args) + return content?.GetStream(); + } + catch (Exception ex) { - // ContainerName: blob - // path1/path2/path3/path3/path5/file.txt => blob/path1/path2/path3/path3/path5/ - var path = args.ContainerName; - if (args.BlobName.Contains("/")) - { - var lastIndex = args.BlobName.LastIndexOf('/'); - path += args.BlobName.Substring(0, lastIndex); - } + Logger.LogWarning("An error occurred while getting the OSS object and an empty data stream will be returned"); + Logger.LogWarning(ex.Message); - return path.EnsureEndsWith('/'); + return null; } + } - protected virtual string GetOssName(BlobProviderArgs args) + public override async Task SaveAsync(BlobProviderSaveArgs args) + { + var configuration = args.Configuration.GetOssManagementConfiguration(); + await _ossObjectAppService.CreateAsync(new CreateOssObjectInput { - // path1/path2/path3/path3/path5/file.txt => file.txt - if (args.BlobName.Contains("/")) - { - var lastIndex = args.BlobName.LastIndexOf('/'); + Bucket = configuration.Bucket, + Overwrite = args.OverrideExisting, + Path = GetOssPath(args), + FileName = GetOssName(args), + File = new RemoteStreamContent(args.BlobStream) + }); + } - // TODO: 用户传递以 / 为结尾符的文件名,让系统抛出异常? - return args.BlobName.Substring(lastIndex + 1); - } + protected virtual string GetOssPath(BlobProviderArgs args) + { + // ContainerName: blob + // path1/path2/path3/path3/path5/file.txt => blob/path1/path2/path3/path3/path5/ + var path = args.ContainerName; + if (args.BlobName.Contains("/")) + { + var lastIndex = args.BlobName.LastIndexOf('/'); + path += args.BlobName.Substring(0, lastIndex); + } + + return path.EnsureEndsWith('/'); + } - return args.BlobName; + protected virtual string GetOssName(BlobProviderArgs args) + { + // path1/path2/path3/path3/path5/file.txt => file.txt + if (args.BlobName.Contains("/")) + { + var lastIndex = args.BlobName.LastIndexOf('/'); + + // TODO: 用户传递以 / 为结尾符的文件名,让系统抛出异常? + return args.BlobName.Substring(lastIndex + 1); } + + return args.BlobName; } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.BlobStoring.OssManagement/LINGYUN/Abp/BlobStoring/OssManagement/OssManagementBlobProviderConfiguration.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.BlobStoring.OssManagement/LINGYUN/Abp/BlobStoring/OssManagement/OssManagementBlobProviderConfiguration.cs index cb8c5502b..83263275e 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.BlobStoring.OssManagement/LINGYUN/Abp/BlobStoring/OssManagement/OssManagementBlobProviderConfiguration.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.BlobStoring.OssManagement/LINGYUN/Abp/BlobStoring/OssManagement/OssManagementBlobProviderConfiguration.cs @@ -1,21 +1,20 @@ using Volo.Abp; using Volo.Abp.BlobStoring; -namespace LINGYUN.Abp.BlobStoring.OssManagement +namespace LINGYUN.Abp.BlobStoring.OssManagement; + +public class OssManagementBlobProviderConfiguration { - public class OssManagementBlobProviderConfiguration + public string Bucket { - public string Bucket - { - get => _containerConfiguration.GetConfiguration(OssManagementBlobProviderConfigurationNames.Bucket); - set => _containerConfiguration.SetConfiguration(OssManagementBlobProviderConfigurationNames.Bucket, Check.NotNullOrWhiteSpace(value, nameof(value))); - } + get => _containerConfiguration.GetConfiguration(OssManagementBlobProviderConfigurationNames.Bucket); + set => _containerConfiguration.SetConfiguration(OssManagementBlobProviderConfigurationNames.Bucket, Check.NotNullOrWhiteSpace(value, nameof(value))); + } - private readonly BlobContainerConfiguration _containerConfiguration; + private readonly BlobContainerConfiguration _containerConfiguration; - public OssManagementBlobProviderConfiguration(BlobContainerConfiguration containerConfiguration) - { - _containerConfiguration = containerConfiguration; - } + public OssManagementBlobProviderConfiguration(BlobContainerConfiguration containerConfiguration) + { + _containerConfiguration = containerConfiguration; } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.BlobStoring.OssManagement/LINGYUN/Abp/BlobStoring/OssManagement/OssManagementBlobProviderConfigurationNames.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.BlobStoring.OssManagement/LINGYUN/Abp/BlobStoring/OssManagement/OssManagementBlobProviderConfigurationNames.cs index 489d4c359..82811c6dc 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.BlobStoring.OssManagement/LINGYUN/Abp/BlobStoring/OssManagement/OssManagementBlobProviderConfigurationNames.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.BlobStoring.OssManagement/LINGYUN/Abp/BlobStoring/OssManagement/OssManagementBlobProviderConfigurationNames.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.BlobStoring.OssManagement +namespace LINGYUN.Abp.BlobStoring.OssManagement; + +public class OssManagementBlobProviderConfigurationNames { - public class OssManagementBlobProviderConfigurationNames - { - public const string Bucket = "OssManagement:Bucket"; - } + public const string Bucket = "OssManagement:Bucket"; } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Aliyun/LINGYUN.Abp.OssManagement.Aliyun.csproj b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Aliyun/LINGYUN.Abp.OssManagement.Aliyun.csproj index 21d881f75..d06ae69ae 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Aliyun/LINGYUN.Abp.OssManagement.Aliyun.csproj +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Aliyun/LINGYUN.Abp.OssManagement.Aliyun.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + net8.0 + LINGYUN.Abp.OssManagement.Aliyun + LINGYUN.Abp.OssManagement.Aliyun + false + false + false diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Aliyun/LINGYUN/Abp/OssManagement/Aliyun/AbpOssManagementAliyunModule.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Aliyun/LINGYUN/Abp/OssManagement/Aliyun/AbpOssManagementAliyunModule.cs index a9bafad1a..c2a97a282 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Aliyun/LINGYUN/Abp/OssManagement/Aliyun/AbpOssManagementAliyunModule.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Aliyun/LINGYUN/Abp/OssManagement/Aliyun/AbpOssManagementAliyunModule.cs @@ -3,22 +3,21 @@ using System; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.OssManagement.Aliyun +namespace LINGYUN.Abp.OssManagement.Aliyun; + +[DependsOn( + typeof(AbpBlobStoringAliyunModule), + typeof(AbpOssManagementDomainModule))] +public class AbpOssManagementAliyunModule : AbpModule { - [DependsOn( - typeof(AbpBlobStoringAliyunModule), - typeof(AbpOssManagementDomainModule))] - public class AbpOssManagementAliyunModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddTransient(); + context.Services.AddTransient(); - context.Services.AddTransient(provider => - provider - .GetRequiredService() - .Create() - .As()); - } + context.Services.AddTransient(provider => + provider + .GetRequiredService() + .Create() + .As()); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Aliyun/LINGYUN/Abp/OssManagement/Aliyun/AliyunOssContainer.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Aliyun/LINGYUN/Abp/OssManagement/Aliyun/AliyunOssContainer.cs index 570da80ef..99687ff14 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Aliyun/LINGYUN/Abp/OssManagement/Aliyun/AliyunOssContainer.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Aliyun/LINGYUN/Abp/OssManagement/Aliyun/AliyunOssContainer.cs @@ -8,395 +8,394 @@ using Volo.Abp; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.OssManagement.Aliyun +namespace LINGYUN.Abp.OssManagement.Aliyun; + +/// +/// Oss容器的阿里云实现 +/// +internal class AliyunOssContainer : IOssContainer, IOssObjectExpireor { - /// - /// Oss容器的阿里云实现 - /// - internal class AliyunOssContainer : IOssContainer, IOssObjectExpireor + protected ICurrentTenant CurrentTenant { get; } + protected IOssClientFactory OssClientFactory { get; } + public AliyunOssContainer( + ICurrentTenant currentTenant, + IOssClientFactory ossClientFactory) { - protected ICurrentTenant CurrentTenant { get; } - protected IOssClientFactory OssClientFactory { get; } - public AliyunOssContainer( - ICurrentTenant currentTenant, - IOssClientFactory ossClientFactory) - { - CurrentTenant = currentTenant; - OssClientFactory = ossClientFactory; - } - public async virtual Task BulkDeleteObjectsAsync(BulkDeleteObjectRequest request) - { - var ossClient = await CreateClientAsync(); - - var path = GetBasePath(request.Path); - var aliyunRequest = new DeleteObjectsRequest(request.Bucket, request.Objects.Select(x => x += path).ToList()); - - ossClient.DeleteObjects(aliyunRequest); - } - - public async virtual Task CreateAsync(string name) - { - var ossClient = await CreateClientAsync(); + CurrentTenant = currentTenant; + OssClientFactory = ossClientFactory; + } + public async virtual Task BulkDeleteObjectsAsync(BulkDeleteObjectRequest request) + { + var ossClient = await CreateClientAsync(); - if (BucketExists(ossClient, name)) - { - throw new BusinessException(code: OssManagementErrorCodes.ContainerAlreadyExists); - } + var path = GetBasePath(request.Path); + var aliyunRequest = new DeleteObjectsRequest(request.Bucket, request.Objects.Select(x => x += path).ToList()); - var bucket = ossClient.CreateBucket(name); + ossClient.DeleteObjects(aliyunRequest); + } - return new OssContainer( - bucket.Name, - bucket.CreationDate, - 0L, - bucket.CreationDate, - new Dictionary - { - { "Id", bucket.Owner?.Id }, - { "DisplayName", bucket.Owner?.DisplayName } - }); - } + public async virtual Task CreateAsync(string name) + { + var ossClient = await CreateClientAsync(); - public async virtual Task CreateObjectAsync(CreateOssObjectRequest request) + if (BucketExists(ossClient, name)) { - var ossClient = await CreateClientAsync(); - - var objectPath = GetBasePath(request.Path); - - var objectName = objectPath.IsNullOrWhiteSpace() - ? request.Object - : objectPath + request.Object; + throw new BusinessException(code: OssManagementErrorCodes.ContainerAlreadyExists); + } - if (!request.Overwrite && ObjectExists(ossClient, request.Bucket, objectName)) - { - throw new BusinessException(code: OssManagementErrorCodes.ObjectAlreadyExists); - } + var bucket = ossClient.CreateBucket(name); - // 当一个对象名称是以 / 结尾时,不论该对象是否存有数据,都以目录的形式存在 - // 详情见:https://help.aliyun.com/document_detail/31910.html - if (objectName.EndsWith("/") && - request.Content.IsNullOrEmpty()) + return new OssContainer( + bucket.Name, + bucket.CreationDate, + 0L, + bucket.CreationDate, + new Dictionary { - var emptyStream = new MemoryStream(); - var emptyData = System.Text.Encoding.UTF8.GetBytes(""); - await emptyStream.WriteAsync(emptyData, 0, emptyData.Length); - request.SetContent(emptyStream); - } - - // 没有bucket则创建 - if (!BucketExists(ossClient, request.Bucket)) - { - ossClient.CreateBucket(request.Bucket); - } + { "Id", bucket.Owner?.Id }, + { "DisplayName", bucket.Owner?.DisplayName } + }); + } - var aliyunObjectRequest = new PutObjectRequest(request.Bucket, objectName, request.Content) - { - Metadata = new ObjectMetadata() - }; - if (request.ExpirationTime.HasValue) - { - aliyunObjectRequest.Metadata.ExpirationTime = DateTime.Now.Add(request.ExpirationTime.Value); - } + public async virtual Task CreateObjectAsync(CreateOssObjectRequest request) + { + var ossClient = await CreateClientAsync(); - var aliyunObject = ossClient.PutObject(aliyunObjectRequest); - - var ossObject = new OssObject( - !objectPath.IsNullOrWhiteSpace() - ? objectName.Replace(objectPath, "") - : objectName, - objectPath, - aliyunObject.ETag, - DateTime.Now, - aliyunObject.ContentLength, - DateTime.Now, - aliyunObject.ResponseMetadata, - objectName.EndsWith("/") // 名称结尾是 / 符号的则为目录:https://help.aliyun.com/document_detail/31910.html - ) - { - FullName = objectName - }; + var objectPath = GetBasePath(request.Path); - if (!Equals(request.Content, Stream.Null)) - { - request.Content.Seek(0, SeekOrigin.Begin); - ossObject.SetContent(request.Content); - } + var objectName = objectPath.IsNullOrWhiteSpace() + ? request.Object + : objectPath + request.Object; - return ossObject; + if (!request.Overwrite && ObjectExists(ossClient, request.Bucket, objectName)) + { + throw new BusinessException(code: OssManagementErrorCodes.ObjectAlreadyExists); } - public async virtual Task DeleteAsync(string name) + // 当一个对象名称是以 / 结尾时,不论该对象是否存有数据,都以目录的形式存在 + // 详情见:https://help.aliyun.com/document_detail/31910.html + if (objectName.EndsWith("/") && + request.Content.IsNullOrEmpty()) { - // 阿里云oss在控制台设置即可,无需改变 - var ossClient = await CreateClientAsync(); + var emptyStream = new MemoryStream(); + var emptyData = System.Text.Encoding.UTF8.GetBytes(""); + await emptyStream.WriteAsync(emptyData, 0, emptyData.Length); + request.SetContent(emptyStream); + } - if (BucketExists(ossClient, name)) - { - ossClient.DeleteBucket(name); - } + // 没有bucket则创建 + if (!BucketExists(ossClient, request.Bucket)) + { + ossClient.CreateBucket(request.Bucket); } - public async virtual Task ExpireAsync(ExprieOssObjectRequest request) + var aliyunObjectRequest = new PutObjectRequest(request.Bucket, objectName, request.Content) + { + Metadata = new ObjectMetadata() + }; + if (request.ExpirationTime.HasValue) { - var ossClient = await CreateClientAsync(); + aliyunObjectRequest.Metadata.ExpirationTime = DateTime.Now.Add(request.ExpirationTime.Value); + } - if (BucketExists(ossClient, request.Bucket)) - { - var listObjects = ossClient.ListObjects( - new ListObjectsRequest(request.Bucket) - { - MaxKeys = request.Batch - }); - - var removeKeys = new List(); - foreach (var ossObjectSummary in listObjects.ObjectSummaries) - { - if (ossObjectSummary.LastModified <= request.ExpirationTime) - { - removeKeys.Add(ossObjectSummary.Key); - } - } + var aliyunObject = ossClient.PutObject(aliyunObjectRequest); + + var ossObject = new OssObject( + !objectPath.IsNullOrWhiteSpace() + ? objectName.Replace(objectPath, "") + : objectName, + objectPath, + aliyunObject.ETag, + DateTime.Now, + aliyunObject.ContentLength, + DateTime.Now, + aliyunObject.ResponseMetadata, + objectName.EndsWith("/") // 名称结尾是 / 符号的则为目录:https://help.aliyun.com/document_detail/31910.html + ) + { + FullName = objectName + }; - foreach (var removeKey in removeKeys) - { - ossClient.DeleteObject(listObjects.BucketName, removeKey); - } - } + if (!Equals(request.Content, Stream.Null)) + { + request.Content.Seek(0, SeekOrigin.Begin); + ossObject.SetContent(request.Content); } - public async virtual Task DeleteObjectAsync(GetOssObjectRequest request) + return ossObject; + } + + public async virtual Task DeleteAsync(string name) + { + // 阿里云oss在控制台设置即可,无需改变 + var ossClient = await CreateClientAsync(); + + if (BucketExists(ossClient, name)) { - var ossClient = await CreateClientAsync(); + ossClient.DeleteBucket(name); + } + } - var objectPath = GetBasePath(request.Path); + public async virtual Task ExpireAsync(ExprieOssObjectRequest request) + { + var ossClient = await CreateClientAsync(); - var objectName = objectPath.IsNullOrWhiteSpace() - ? request.Object - : objectPath + request.Object; + if (BucketExists(ossClient, request.Bucket)) + { + var listObjects = ossClient.ListObjects( + new ListObjectsRequest(request.Bucket) + { + MaxKeys = request.Batch + }); - if (BucketExists(ossClient, request.Bucket) && - ObjectExists(ossClient, request.Bucket, objectName)) + var removeKeys = new List(); + foreach (var ossObjectSummary in listObjects.ObjectSummaries) { - var objectListing = ossClient.ListObjects(request.Bucket, objectName); - if (objectListing.CommonPrefixes.Any() || - objectListing.ObjectSummaries.Any()) + if (ossObjectSummary.LastModified <= request.ExpirationTime) { - throw new BusinessException(code: OssManagementErrorCodes.ObjectDeleteWithNotEmpty); - // throw new ObjectDeleteWithNotEmptyException("00201", $"Can't not delete oss object {request.Object}, because it is not empty!"); + removeKeys.Add(ossObjectSummary.Key); } - ossClient.DeleteObject(request.Bucket, objectName); + } + + foreach (var removeKey in removeKeys) + { + ossClient.DeleteObject(listObjects.BucketName, removeKey); } } + } - public async virtual Task ExistsAsync(string name) - { - var ossClient = await CreateClientAsync(); + public async virtual Task DeleteObjectAsync(GetOssObjectRequest request) + { + var ossClient = await CreateClientAsync(); - return BucketExists(ossClient, name); - } + var objectPath = GetBasePath(request.Path); + + var objectName = objectPath.IsNullOrWhiteSpace() + ? request.Object + : objectPath + request.Object; - public async virtual Task GetAsync(string name) + if (BucketExists(ossClient, request.Bucket) && + ObjectExists(ossClient, request.Bucket, objectName)) { - var ossClient = await CreateClientAsync(); - if (!BucketExists(ossClient, name)) + var objectListing = ossClient.ListObjects(request.Bucket, objectName); + if (objectListing.CommonPrefixes.Any() || + objectListing.ObjectSummaries.Any()) { - throw new BusinessException(code: OssManagementErrorCodes.ContainerNotFound); - // throw new ContainerNotFoundException($"Can't not found container {name} in aliyun blob storing"); + throw new BusinessException(code: OssManagementErrorCodes.ObjectDeleteWithNotEmpty); + // throw new ObjectDeleteWithNotEmptyException("00201", $"Can't not delete oss object {request.Object}, because it is not empty!"); } - var bucket = ossClient.GetBucketInfo(name); - - return new OssContainer( - bucket.Bucket.Name, - bucket.Bucket.CreationDate, - 0L, - bucket.Bucket.CreationDate, - new Dictionary - { - { "Id", bucket.Bucket.Owner?.Id }, - { "DisplayName", bucket.Bucket.Owner?.DisplayName } - }); + ossClient.DeleteObject(request.Bucket, objectName); } + } - public async virtual Task GetObjectAsync(GetOssObjectRequest request) - { - var ossClient = await CreateClientAsync(); - if (!BucketExists(ossClient, request.Bucket)) - { - throw new BusinessException(code: OssManagementErrorCodes.ContainerNotFound); - // throw new ContainerNotFoundException($"Can't not found container {request.Bucket} in aliyun blob storing"); - } + public async virtual Task ExistsAsync(string name) + { + var ossClient = await CreateClientAsync(); - var objectPath = GetBasePath(request.Path); - var objectName = objectPath.IsNullOrWhiteSpace() - ? request.Object - : objectPath + request.Object; + return BucketExists(ossClient, name); + } - if (!ObjectExists(ossClient, request.Bucket, objectName)) + public async virtual Task GetAsync(string name) + { + var ossClient = await CreateClientAsync(); + if (!BucketExists(ossClient, name)) + { + throw new BusinessException(code: OssManagementErrorCodes.ContainerNotFound); + // throw new ContainerNotFoundException($"Can't not found container {name} in aliyun blob storing"); + } + var bucket = ossClient.GetBucketInfo(name); + + return new OssContainer( + bucket.Bucket.Name, + bucket.Bucket.CreationDate, + 0L, + bucket.Bucket.CreationDate, + new Dictionary { - throw new BusinessException(code: OssManagementErrorCodes.ObjectNotFound); - // throw new ContainerNotFoundException($"Can't not found object {objectName} in container {request.Bucket} with aliyun blob storing"); - } + { "Id", bucket.Bucket.Owner?.Id }, + { "DisplayName", bucket.Bucket.Owner?.DisplayName } + }); + } - var aliyunOssObjectRequest = new GetObjectRequest(request.Bucket, objectName, request.Process); - var aliyunOssObject = ossClient.GetObject(aliyunOssObjectRequest); - var ossObject = new OssObject( - !objectPath.IsNullOrWhiteSpace() - ? aliyunOssObject.Key.Replace(objectPath, "") - : aliyunOssObject.Key, - request.Path, - aliyunOssObject.Metadata.ETag, - aliyunOssObject.Metadata.LastModified, - aliyunOssObject.Metadata.ContentLength, - aliyunOssObject.Metadata.LastModified, - aliyunOssObject.Metadata.UserMetadata, - aliyunOssObject.Key.EndsWith("/")) - { - FullName = aliyunOssObject.Key - }; + public async virtual Task GetObjectAsync(GetOssObjectRequest request) + { + var ossClient = await CreateClientAsync(); + if (!BucketExists(ossClient, request.Bucket)) + { + throw new BusinessException(code: OssManagementErrorCodes.ContainerNotFound); + // throw new ContainerNotFoundException($"Can't not found container {request.Bucket} in aliyun blob storing"); + } - if (aliyunOssObject.IsSetResponseStream()) - { - ossObject.SetContent(aliyunOssObject.Content); - } + var objectPath = GetBasePath(request.Path); + var objectName = objectPath.IsNullOrWhiteSpace() + ? request.Object + : objectPath + request.Object; - return ossObject; + if (!ObjectExists(ossClient, request.Bucket, objectName)) + { + throw new BusinessException(code: OssManagementErrorCodes.ObjectNotFound); + // throw new ContainerNotFoundException($"Can't not found object {objectName} in container {request.Bucket} with aliyun blob storing"); } - public async virtual Task GetListAsync(GetOssContainersRequest request) + var aliyunOssObjectRequest = new GetObjectRequest(request.Bucket, objectName, request.Process); + var aliyunOssObject = ossClient.GetObject(aliyunOssObjectRequest); + var ossObject = new OssObject( + !objectPath.IsNullOrWhiteSpace() + ? aliyunOssObject.Key.Replace(objectPath, "") + : aliyunOssObject.Key, + request.Path, + aliyunOssObject.Metadata.ETag, + aliyunOssObject.Metadata.LastModified, + aliyunOssObject.Metadata.ContentLength, + aliyunOssObject.Metadata.LastModified, + aliyunOssObject.Metadata.UserMetadata, + aliyunOssObject.Key.EndsWith("/")) { - var ossClient = await CreateClientAsync(); + FullName = aliyunOssObject.Key + }; - // TODO: 阿里云的分页差异需要前端来弥补,传递Marker, 按照Oss控制台的逻辑,直接把MaxKeys设置较大值就行了 - var aliyunRequest = new ListBucketsRequest - { - Marker = request.Marker, - Prefix = request.Prefix, - MaxKeys = request.MaxKeys - }; - var bucketsResponse = ossClient.ListBuckets(aliyunRequest); - - return new GetOssContainersResponse( - bucketsResponse.Prefix, - bucketsResponse.Marker, - bucketsResponse.NextMaker, - bucketsResponse.MaxKeys ?? 0, - bucketsResponse.Buckets - .Select(x => new OssContainer( - x.Name, - x.CreationDate, - 0L, - x.CreationDate, - new Dictionary - { - { "Id", x.Owner?.Id }, - { "DisplayName", x.Owner?.DisplayName } - })) - .ToList()); - } - - public async virtual Task GetObjectsAsync(GetOssObjectsRequest request) + if (aliyunOssObject.IsSetResponseStream()) { - - var ossClient = await CreateClientAsync(); + ossObject.SetContent(aliyunOssObject.Content); + } - var objectPath = GetBasePath(request.Prefix); - var marker = !objectPath.IsNullOrWhiteSpace() && !request.Marker.IsNullOrWhiteSpace() - ? request.Marker.Replace(objectPath, "") - : request.Marker; + return ossObject; + } - // TODO: 阿里云的分页差异需要前端来弥补,传递Marker, 按照Oss控制台的逻辑,直接把MaxKeys设置较大值就行了 - var aliyunRequest = new ListObjectsRequest(request.BucketName) - { - Marker = !marker.IsNullOrWhiteSpace() ? objectPath + marker : marker, - Prefix = objectPath, - MaxKeys = request.MaxKeys, - EncodingType = request.EncodingType, - Delimiter = request.Delimiter - }; - var objectsResponse = ossClient.ListObjects(aliyunRequest); - - var ossObjects = objectsResponse.ObjectSummaries - .Where(x => !x.Key.Equals(objectsResponse.Prefix))// 过滤当前的目录返回值 - .Select(x => new OssObject( - !objectPath.IsNullOrWhiteSpace() && !x.Key.Equals(objectPath) - ? x.Key.Replace(objectPath, "") - : x.Key, // 去除目录名称 - request.Prefix, - x.ETag, - x.LastModified, - x.Size, - x.LastModified, - new Dictionary - { - { "Id", x.Owner?.Id }, - { "DisplayName", x.Owner?.DisplayName } - }, - x.Key.EndsWith("/")) - { - FullName = x.Key - }) - .ToList(); - // 当 Delimiter 为 / 时, objectsResponse.CommonPrefixes 可用于代表层级目录 - if (objectsResponse.CommonPrefixes.Any()) - { - ossObjects.InsertRange(0, - objectsResponse.CommonPrefixes - .Select(x => new OssObject( - x.Replace(objectPath, ""), - request.Prefix, - "", - null, - 0L, - null, - null, - true))); - } - // 排序 - // TODO: 是否需要客户端来排序 - ossObjects.Sort(new OssObjectComparer()); - - return new GetOssObjectsResponse( - objectsResponse.BucketName, - request.Prefix, - marker, - !objectPath.IsNullOrWhiteSpace() && !objectsResponse.NextMarker.IsNullOrWhiteSpace() - ? objectsResponse.NextMarker.Replace(objectPath, "") - : objectsResponse.NextMarker, - objectsResponse.Delimiter, - objectsResponse.MaxKeys, - ossObjects); - } + public async virtual Task GetListAsync(GetOssContainersRequest request) + { + var ossClient = await CreateClientAsync(); - protected virtual string GetBasePath(string path) + // TODO: 阿里云的分页差异需要前端来弥补,传递Marker, 按照Oss控制台的逻辑,直接把MaxKeys设置较大值就行了 + var aliyunRequest = new ListBucketsRequest { - string objectPath = ""; - if (CurrentTenant.Id == null) - { - objectPath += "host/"; - } - else - { - objectPath += "tenants/" + CurrentTenant.Id.Value.ToString("D"); - } + Marker = request.Marker, + Prefix = request.Prefix, + MaxKeys = request.MaxKeys + }; + var bucketsResponse = ossClient.ListBuckets(aliyunRequest); + + return new GetOssContainersResponse( + bucketsResponse.Prefix, + bucketsResponse.Marker, + bucketsResponse.NextMaker, + bucketsResponse.MaxKeys ?? 0, + bucketsResponse.Buckets + .Select(x => new OssContainer( + x.Name, + x.CreationDate, + 0L, + x.CreationDate, + new Dictionary + { + { "Id", x.Owner?.Id }, + { "DisplayName", x.Owner?.DisplayName } + })) + .ToList()); + } - objectPath += path ?? ""; + public async virtual Task GetObjectsAsync(GetOssObjectsRequest request) + { + + var ossClient = await CreateClientAsync(); - return objectPath.EnsureEndsWith('/'); - } + var objectPath = GetBasePath(request.Prefix); + var marker = !objectPath.IsNullOrWhiteSpace() && !request.Marker.IsNullOrWhiteSpace() + ? request.Marker.Replace(objectPath, "") + : request.Marker; - protected virtual bool BucketExists(IOss client, string bucketName) + // TODO: 阿里云的分页差异需要前端来弥补,传递Marker, 按照Oss控制台的逻辑,直接把MaxKeys设置较大值就行了 + var aliyunRequest = new ListObjectsRequest(request.BucketName) { - return client.DoesBucketExist(bucketName); + Marker = !marker.IsNullOrWhiteSpace() ? objectPath + marker : marker, + Prefix = objectPath, + MaxKeys = request.MaxKeys, + EncodingType = request.EncodingType, + Delimiter = request.Delimiter + }; + var objectsResponse = ossClient.ListObjects(aliyunRequest); + + var ossObjects = objectsResponse.ObjectSummaries + .Where(x => !x.Key.Equals(objectsResponse.Prefix))// 过滤当前的目录返回值 + .Select(x => new OssObject( + !objectPath.IsNullOrWhiteSpace() && !x.Key.Equals(objectPath) + ? x.Key.Replace(objectPath, "") + : x.Key, // 去除目录名称 + request.Prefix, + x.ETag, + x.LastModified, + x.Size, + x.LastModified, + new Dictionary + { + { "Id", x.Owner?.Id }, + { "DisplayName", x.Owner?.DisplayName } + }, + x.Key.EndsWith("/")) + { + FullName = x.Key + }) + .ToList(); + // 当 Delimiter 为 / 时, objectsResponse.CommonPrefixes 可用于代表层级目录 + if (objectsResponse.CommonPrefixes.Any()) + { + ossObjects.InsertRange(0, + objectsResponse.CommonPrefixes + .Select(x => new OssObject( + x.Replace(objectPath, ""), + request.Prefix, + "", + null, + 0L, + null, + null, + true))); } + // 排序 + // TODO: 是否需要客户端来排序 + ossObjects.Sort(new OssObjectComparer()); + + return new GetOssObjectsResponse( + objectsResponse.BucketName, + request.Prefix, + marker, + !objectPath.IsNullOrWhiteSpace() && !objectsResponse.NextMarker.IsNullOrWhiteSpace() + ? objectsResponse.NextMarker.Replace(objectPath, "") + : objectsResponse.NextMarker, + objectsResponse.Delimiter, + objectsResponse.MaxKeys, + ossObjects); + } - protected virtual bool ObjectExists(IOss client, string bucketName, string objectName) + protected virtual string GetBasePath(string path) + { + string objectPath = ""; + if (CurrentTenant.Id == null) { - return client.DoesObjectExist(bucketName, objectName); + objectPath += "host/"; } - - protected async virtual Task CreateClientAsync() + else { - return await OssClientFactory.CreateAsync(); + objectPath += "tenants/" + CurrentTenant.Id.Value.ToString("D"); } + + objectPath += path ?? ""; + + return objectPath.EnsureEndsWith('/'); + } + + protected virtual bool BucketExists(IOss client, string bucketName) + { + return client.DoesBucketExist(bucketName); + } + + protected virtual bool ObjectExists(IOss client, string bucketName, string objectName) + { + return client.DoesObjectExist(bucketName, objectName); + } + + protected async virtual Task CreateClientAsync() + { + return await OssClientFactory.CreateAsync(); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Aliyun/LINGYUN/Abp/OssManagement/Aliyun/AliyunOssContainerFactory.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Aliyun/LINGYUN/Abp/OssManagement/Aliyun/AliyunOssContainerFactory.cs index 3f5314781..3b43ed1ee 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Aliyun/LINGYUN/Abp/OssManagement/Aliyun/AliyunOssContainerFactory.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Aliyun/LINGYUN/Abp/OssManagement/Aliyun/AliyunOssContainerFactory.cs @@ -1,26 +1,25 @@ using LINGYUN.Abp.BlobStoring.Aliyun; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.OssManagement.Aliyun +namespace LINGYUN.Abp.OssManagement.Aliyun; + +public class AliyunOssContainerFactory : IOssContainerFactory { - public class AliyunOssContainerFactory : IOssContainerFactory - { - protected ICurrentTenant CurrentTenant { get; } - protected IOssClientFactory OssClientFactory { get; } + protected ICurrentTenant CurrentTenant { get; } + protected IOssClientFactory OssClientFactory { get; } - public AliyunOssContainerFactory( - ICurrentTenant currentTenant, - IOssClientFactory ossClientFactory) - { - CurrentTenant = currentTenant; - OssClientFactory = ossClientFactory; - } + public AliyunOssContainerFactory( + ICurrentTenant currentTenant, + IOssClientFactory ossClientFactory) + { + CurrentTenant = currentTenant; + OssClientFactory = ossClientFactory; + } - public IOssContainer Create() - { - return new AliyunOssContainer( - CurrentTenant, - OssClientFactory); - } + public IOssContainer Create() + { + return new AliyunOssContainer( + CurrentTenant, + OssClientFactory); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN.Abp.OssManagement.Application.Contracts.csproj b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN.Abp.OssManagement.Application.Contracts.csproj index 7f531dc83..e29bdf879 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN.Abp.OssManagement.Application.Contracts.csproj +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN.Abp.OssManagement.Application.Contracts.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.OssManagement.Application.Contracts + LINGYUN.Abp.OssManagement.Application.Contracts + false + false + false diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/AbpOssManagementApplicationContractsModule.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/AbpOssManagementApplicationContractsModule.cs index 5da181785..9b285b9cb 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/AbpOssManagementApplicationContractsModule.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/AbpOssManagementApplicationContractsModule.cs @@ -1,12 +1,11 @@ using Volo.Abp.Application; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +[DependsOn( + typeof(AbpOssManagementDomainSharedModule), + typeof(AbpDddApplicationContractsModule))] +public class AbpOssManagementApplicationContractsModule : AbpModule { - [DependsOn( - typeof(AbpOssManagementDomainSharedModule), - typeof(AbpDddApplicationContractsModule))] - public class AbpOssManagementApplicationContractsModule : AbpModule - { - } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/BulkDeleteOssObjectInput.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/BulkDeleteOssObjectInput.cs index 01af4d86a..a2b2a3997 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/BulkDeleteOssObjectInput.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/BulkDeleteOssObjectInput.cs @@ -1,15 +1,14 @@ using System.ComponentModel.DataAnnotations; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public class BulkDeleteOssObjectInput { - public class BulkDeleteOssObjectInput - { - [Required] - public string Bucket { get; set; } + [Required] + public string Bucket { get; set; } - public string Path { get; set; } + public string Path { get; set; } - [Required] - public string[] Objects { get; set; } - } + [Required] + public string[] Objects { get; set; } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/CreateOssObjectInput.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/CreateOssObjectInput.cs index 3d9238972..e4838b96c 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/CreateOssObjectInput.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/CreateOssObjectInput.cs @@ -4,25 +4,24 @@ using Volo.Abp.Content; using Volo.Abp.Validation; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public class CreateOssObjectInput { - public class CreateOssObjectInput - { - public string Bucket { get; set; } - public string Path { get; set; } - public string FileName { get; set; } - public bool Overwrite { get; set; } + public string Bucket { get; set; } + public string Path { get; set; } + public string FileName { get; set; } + public bool Overwrite { get; set; } - [DisableAuditing] - [DisableValidation] - public IRemoteStreamContent File { get; set; } + [DisableAuditing] + [DisableValidation] + public IRemoteStreamContent File { get; set; } - public TimeSpan? ExpirationTime { get; set; } + public TimeSpan? ExpirationTime { get; set; } - public void SetContent(Stream content) - { - content.Seek(0, SeekOrigin.Begin); - File = new RemoteStreamContent(content); - } + public void SetContent(Stream content) + { + content.Seek(0, SeekOrigin.Begin); + File = new RemoteStreamContent(content); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/FileShareDto.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/FileShareDto.cs index e02ecb14b..d26c2f8d1 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/FileShareDto.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/FileShareDto.cs @@ -1,32 +1,31 @@ using System; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public class FileShareDto { - public class FileShareDto - { - public string Url { get; set; } - public int MaxAccessCount { get; set; } - public DateTime? ExpirationTime { get; set; } - } + public string Url { get; set; } + public int MaxAccessCount { get; set; } + public DateTime? ExpirationTime { get; set; } +} - public class MyFileShareDto - { - public string Name { get; set; } +public class MyFileShareDto +{ + public string Name { get; set; } - public string Path { get; set; } + public string Path { get; set; } - public string[] Roles { get; set; } + public string[] Roles { get; set; } - public string[] Users { get; set; } + public string[] Users { get; set; } - public string MD5 { get; set; } + public string MD5 { get; set; } - public string Url { get; set; } + public string Url { get; set; } - public int AccessCount { get; set; } + public int AccessCount { get; set; } - public int MaxAccessCount { get; set; } + public int MaxAccessCount { get; set; } - public DateTime ExpirationTime { get; set; } - } + public DateTime ExpirationTime { get; set; } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/FileShareInput.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/FileShareInput.cs index b0bf5e7d4..e8cf354e0 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/FileShareInput.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/FileShareInput.cs @@ -1,21 +1,20 @@ using System; using System.ComponentModel.DataAnnotations; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public class FileShareInput { - public class FileShareInput - { - [Required] - public string Name { get; set; } + [Required] + public string Name { get; set; } - public string Path { get; set; } + public string Path { get; set; } - public int MaxAccessCount { get; set; } + public int MaxAccessCount { get; set; } - public DateTime? ExpirationTime { get; set; } + public DateTime? ExpirationTime { get; set; } - public string[] Roles { get; set; } + public string[] Roles { get; set; } - public string[] Users { get; set; } - } + public string[] Users { get; set; } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/GetFileShareDto.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/GetFileShareDto.cs index abdb87f2d..c615d4763 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/GetFileShareDto.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/GetFileShareDto.cs @@ -1,17 +1,16 @@ using System.IO; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public class GetFileShareDto { - public class GetFileShareDto + public string Name { get; set; } + public Stream Content { get; set; } + public GetFileShareDto( + string name, + Stream content = null) { - public string Name { get; set; } - public Stream Content { get; set; } - public GetFileShareDto( - string name, - Stream content = null) - { - Name = name; - Content = content ?? Stream.Null; - } + Name = name; + Content = content ?? Stream.Null; } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/GetFilesInput.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/GetFilesInput.cs index 964c5e380..80df646b7 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/GetFilesInput.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/GetFilesInput.cs @@ -1,10 +1,9 @@ using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public class GetFilesInput: LimitedResultRequestDto { - public class GetFilesInput: LimitedResultRequestDto - { - public string Filter { get; set; } - public string Path { get; set; } - } + public string Filter { get; set; } + public string Path { get; set; } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/GetOssContainersInput.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/GetOssContainersInput.cs index 11cf0eb3f..6d198fba0 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/GetOssContainersInput.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/GetOssContainersInput.cs @@ -1,10 +1,9 @@ using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public class GetOssContainersInput : PagedAndSortedResultRequestDto { - public class GetOssContainersInput : PagedAndSortedResultRequestDto - { - public string Prefix { get; set; } - public string Marker { get; set; } - } + public string Prefix { get; set; } + public string Marker { get; set; } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/GetOssObjectInput.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/GetOssObjectInput.cs index 6d60f03eb..ff3ccbafa 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/GetOssObjectInput.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/GetOssObjectInput.cs @@ -1,16 +1,15 @@ using System.ComponentModel.DataAnnotations; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public class GetOssObjectInput { - public class GetOssObjectInput - { - [Required] - public string Bucket { get; set; } + [Required] + public string Bucket { get; set; } - public string Path { get; set; } + public string Path { get; set; } - [Required] - public string Object { get; set; } - public bool MD5 { get; set; } - } + [Required] + public string Object { get; set; } + public bool MD5 { get; set; } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/GetOssObjectsInput.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/GetOssObjectsInput.cs index f46a6d7cf..01c391d1e 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/GetOssObjectsInput.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/GetOssObjectsInput.cs @@ -1,14 +1,13 @@ using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public class GetOssObjectsInput : PagedAndSortedResultRequestDto { - public class GetOssObjectsInput : PagedAndSortedResultRequestDto - { - public string Bucket { get; set; } - public string Prefix { get; set; } - public string Delimiter { get; set; } - public string Marker { get; set; } - public string EncodingType { get; set; } - public bool MD5 { get; set; } - } + public string Bucket { get; set; } + public string Prefix { get; set; } + public string Delimiter { get; set; } + public string Marker { get; set; } + public string EncodingType { get; set; } + public bool MD5 { get; set; } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/GetPublicFileInput.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/GetPublicFileInput.cs index 1a2bf31fe..331a1943f 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/GetPublicFileInput.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/GetPublicFileInput.cs @@ -1,14 +1,13 @@ using System.ComponentModel.DataAnnotations; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public class GetPublicFileInput : GetFileMultiTenancyInput { - public class GetPublicFileInput : GetFileMultiTenancyInput - { - [Required] - public string Name { get; set; } + [Required] + public string Name { get; set; } - public string Path { get; set; } + public string Path { get; set; } - public string Process { get; set; } - } + public string Process { get; set; } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/GetStaticFileInput.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/GetStaticFileInput.cs index a640e5a66..966d5cf4b 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/GetStaticFileInput.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/GetStaticFileInput.cs @@ -1,16 +1,15 @@ using System.ComponentModel.DataAnnotations; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public class GetStaticFileInput : GetFileMultiTenancyInput { - public class GetStaticFileInput : GetFileMultiTenancyInput - { - [Required] - public string Name { get; set; } + [Required] + public string Name { get; set; } - public string Path { get; set; } + public string Path { get; set; } - public string Bucket { get; set; } + public string Bucket { get; set; } - public string Process { get; set; } - } + public string Process { get; set; } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IFileAppService.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IFileAppService.cs index dde139284..d32e3b3c9 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IFileAppService.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IFileAppService.cs @@ -3,18 +3,17 @@ using Volo.Abp.Application.Services; using Volo.Abp.Content; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public interface IFileAppService : IApplicationService { - public interface IFileAppService : IApplicationService - { - Task UploadAsync(UploadFileInput input); + Task UploadAsync(UploadFileInput input); - Task GetAsync(GetPublicFileInput input); + Task GetAsync(GetPublicFileInput input); - Task> GetListAsync(GetFilesInput input); + Task> GetListAsync(GetFilesInput input); - Task UploadAsync(UploadFileChunkInput input); + Task UploadAsync(UploadFileChunkInput input); - Task DeleteAsync(GetPublicFileInput input); - } + Task DeleteAsync(GetPublicFileInput input); } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IFileUploader.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IFileUploader.cs index d97752324..53c394d62 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IFileUploader.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IFileUploader.cs @@ -1,10 +1,9 @@ using System.Threading; using System.Threading.Tasks; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public interface IFileUploader { - public interface IFileUploader - { - Task UploadAsync(UploadFileChunkInput input, CancellationToken cancellationToken = default); - } + Task UploadAsync(UploadFileChunkInput input, CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IFileValidater.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IFileValidater.cs index 08de884c8..6e5174b43 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IFileValidater.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IFileValidater.cs @@ -1,9 +1,8 @@ using System.Threading.Tasks; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public interface IFileValidater { - public interface IFileValidater - { - Task ValidationAsync(UploadFile input); - } + Task ValidationAsync(UploadFile input); } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IOssContainerAppService.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IOssContainerAppService.cs index 130f85ae4..85617d1e8 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IOssContainerAppService.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IOssContainerAppService.cs @@ -1,18 +1,17 @@ using System.Threading.Tasks; using Volo.Abp.Application.Services; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public interface IOssContainerAppService: IApplicationService { - public interface IOssContainerAppService: IApplicationService - { - Task CreateAsync(string name); + Task CreateAsync(string name); - Task GetAsync(string name); + Task GetAsync(string name); - Task DeleteAsync(string name); + Task DeleteAsync(string name); - Task GetListAsync(GetOssContainersInput input); + Task GetListAsync(GetOssContainersInput input); - Task GetObjectListAsync(GetOssObjectsInput input); - } + Task GetObjectListAsync(GetOssObjectsInput input); } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IOssObjectAppService.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IOssObjectAppService.cs index d90ece811..9120313f9 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IOssObjectAppService.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IOssObjectAppService.cs @@ -2,18 +2,17 @@ using Volo.Abp.Application.Services; using Volo.Abp.Content; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public interface IOssObjectAppService : IApplicationService { - public interface IOssObjectAppService : IApplicationService - { - Task CreateAsync(CreateOssObjectInput input); + Task CreateAsync(CreateOssObjectInput input); - Task GetAsync(GetOssObjectInput input); + Task GetAsync(GetOssObjectInput input); - Task GetContentAsync(GetOssObjectInput input); + Task GetContentAsync(GetOssObjectInput input); - Task DeleteAsync(GetOssObjectInput input); + Task DeleteAsync(GetOssObjectInput input); - Task BulkDeleteAsync(BulkDeleteOssObjectInput input); - } + Task BulkDeleteAsync(BulkDeleteOssObjectInput input); } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IPrivateFileAppService.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IPrivateFileAppService.cs index d11706949..3e5c1d8ab 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IPrivateFileAppService.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IPrivateFileAppService.cs @@ -1,12 +1,11 @@ using System.Threading.Tasks; using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public interface IPrivateFileAppService : IFileAppService { - public interface IPrivateFileAppService : IFileAppService - { - Task ShareAsync(FileShareInput input); + Task ShareAsync(FileShareInput input); - Task> GetShareListAsync(); - } + Task> GetShareListAsync(); } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IPublicFileAppService.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IPublicFileAppService.cs index 6f3a8c4b6..7e2ed571a 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IPublicFileAppService.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IPublicFileAppService.cs @@ -1,6 +1,5 @@ -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public interface IPublicFileAppService : IFileAppService { - public interface IPublicFileAppService : IFileAppService - { - } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IShareFileAppService.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IShareFileAppService.cs index a8c6737d8..a84143b5e 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IShareFileAppService.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IShareFileAppService.cs @@ -3,10 +3,9 @@ using Volo.Abp.Application.Services; using Volo.Abp.Content; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public interface IShareFileAppService : IApplicationService { - public interface IShareFileAppService : IApplicationService - { - Task GetAsync(string url); - } + Task GetAsync(string url); } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IStaticFilesAppService.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IStaticFilesAppService.cs index 6fe09c2a9..bd176c762 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IStaticFilesAppService.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/IStaticFilesAppService.cs @@ -2,10 +2,9 @@ using Volo.Abp.Application.Services; using Volo.Abp.Content; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public interface IStaticFilesAppService: IApplicationService { - public interface IStaticFilesAppService: IApplicationService - { - Task GetAsync(GetStaticFileInput input); - } + Task GetAsync(GetStaticFileInput input); } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/OssContainerDto.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/OssContainerDto.cs index c3606d569..e5466c3e6 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/OssContainerDto.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/OssContainerDto.cs @@ -1,14 +1,13 @@ using System; using System.Collections.Generic; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public class OssContainerDto { - public class OssContainerDto - { - public string Name { get; set; } - public long Size { get; set; } - public DateTime CreationDate { get; set; } - public DateTime? LastModifiedDate { get; set; } - public IDictionary Metadata { get; set; } - } + public string Name { get; set; } + public long Size { get; set; } + public DateTime CreationDate { get; set; } + public DateTime? LastModifiedDate { get; set; } + public IDictionary Metadata { get; set; } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/OssContainersResultDto.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/OssContainersResultDto.cs index a64bf9cda..f45014900 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/OssContainersResultDto.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/OssContainersResultDto.cs @@ -1,13 +1,12 @@ using System.Collections.Generic; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public class OssContainersResultDto { - public class OssContainersResultDto - { - public string Prefix { get; set; } - public string Marker { get; set; } - public string NextMarker { get; set; } - public int MaxKeys { get; set; } - public List Containers { get; set; } = new List(); - } + public string Prefix { get; set; } + public string Marker { get; set; } + public string NextMarker { get; set; } + public int MaxKeys { get; set; } + public List Containers { get; set; } = new List(); } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/OssManagementRemoteServiceConsts.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/OssManagementRemoteServiceConsts.cs index fc8856b40..2d40aad5b 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/OssManagementRemoteServiceConsts.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/OssManagementRemoteServiceConsts.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public static class OssManagementRemoteServiceConsts { - public static class OssManagementRemoteServiceConsts - { - public const string RemoteServiceName = "AbpOssManagement"; - } + public const string RemoteServiceName = "AbpOssManagement"; } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/OssObjectDto.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/OssObjectDto.cs index 9f03eb07f..a33f817c3 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/OssObjectDto.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/OssObjectDto.cs @@ -1,17 +1,16 @@ using System; using System.Collections.Generic; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public class OssObjectDto { - public class OssObjectDto - { - public bool IsFolder { get; set; } - public string Path { get; set; } - public string Name { get; set; } - public long Size { get; set; } - public string MD5 { get; set; } - public DateTime? CreationDate { get; set; } - public DateTime? LastModifiedDate { get; set; } - public IDictionary Metadata { get; set; } - } + public bool IsFolder { get; set; } + public string Path { get; set; } + public string Name { get; set; } + public long Size { get; set; } + public string MD5 { get; set; } + public DateTime? CreationDate { get; set; } + public DateTime? LastModifiedDate { get; set; } + public IDictionary Metadata { get; set; } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/OssObjectsResultDto.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/OssObjectsResultDto.cs index dd8f1f722..c6376bdf3 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/OssObjectsResultDto.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/OssObjectsResultDto.cs @@ -1,15 +1,14 @@ using System.Collections.Generic; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public class OssObjectsResultDto { - public class OssObjectsResultDto - { - public string Bucket { get; set; } - public string Prefix { get; set; } - public string Delimiter { get; set; } - public string Marker { get; set; } - public string NextMarker { get; set; } - public int MaxKeys { get; set; } - public List Objects { get; set; } = new List(); - } + public string Bucket { get; set; } + public string Prefix { get; set; } + public string Delimiter { get; set; } + public string Marker { get; set; } + public string NextMarker { get; set; } + public int MaxKeys { get; set; } + public List Objects { get; set; } = new List(); } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/Permissions/AbpOssManagementPermissionDefinitionProvider.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/Permissions/AbpOssManagementPermissionDefinitionProvider.cs index 53e3b814a..9a4ee6d68 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/Permissions/AbpOssManagementPermissionDefinitionProvider.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/Permissions/AbpOssManagementPermissionDefinitionProvider.cs @@ -4,33 +4,32 @@ using Volo.Abp.Features; using LINGYUN.Abp.OssManagement.Features; -namespace LINGYUN.Abp.OssManagement.Permissions +namespace LINGYUN.Abp.OssManagement.Permissions; + +public class AbpOssManagementPermissionDefinitionProvider : PermissionDefinitionProvider { - public class AbpOssManagementPermissionDefinitionProvider : PermissionDefinitionProvider + public override void Define(IPermissionDefinitionContext context) { - public override void Define(IPermissionDefinitionContext context) - { - var ossManagement = context.AddGroup(AbpOssManagementPermissions.GroupName, L("Permission:OssManagement")); + var ossManagement = context.AddGroup(AbpOssManagementPermissions.GroupName, L("Permission:OssManagement")); - var container = ossManagement.AddPermission(AbpOssManagementPermissions.Container.Default, L("Permission:Container")); - container.AddChild(AbpOssManagementPermissions.Container.Create, L("Permission:Create")); - container.AddChild(AbpOssManagementPermissions.Container.Delete, L("Permission:Delete")); + var container = ossManagement.AddPermission(AbpOssManagementPermissions.Container.Default, L("Permission:Container")); + container.AddChild(AbpOssManagementPermissions.Container.Create, L("Permission:Create")); + container.AddChild(AbpOssManagementPermissions.Container.Delete, L("Permission:Delete")); - var ossobject = ossManagement - .AddPermission(AbpOssManagementPermissions.OssObject.Default, L("Permission:OssObject")) - .RequireFeatures(AbpOssManagementFeatureNames.OssObject.Enable); - ossobject - .AddChild(AbpOssManagementPermissions.OssObject.Create, L("Permission:Create")) - .RequireFeatures(AbpOssManagementFeatureNames.OssObject.UploadFile); - ossobject.AddChild(AbpOssManagementPermissions.OssObject.Delete, L("Permission:Delete")); - ossobject - .AddChild(AbpOssManagementPermissions.OssObject.Download, L("Permission:Download")) - .RequireFeatures(AbpOssManagementFeatureNames.OssObject.DownloadFile); - } + var ossobject = ossManagement + .AddPermission(AbpOssManagementPermissions.OssObject.Default, L("Permission:OssObject")) + .RequireFeatures(AbpOssManagementFeatureNames.OssObject.Enable); + ossobject + .AddChild(AbpOssManagementPermissions.OssObject.Create, L("Permission:Create")) + .RequireFeatures(AbpOssManagementFeatureNames.OssObject.UploadFile); + ossobject.AddChild(AbpOssManagementPermissions.OssObject.Delete, L("Permission:Delete")); + ossobject + .AddChild(AbpOssManagementPermissions.OssObject.Download, L("Permission:Download")) + .RequireFeatures(AbpOssManagementFeatureNames.OssObject.DownloadFile); + } - private static LocalizableString L(string name) - { - return LocalizableString.Create(name); - } + private static LocalizableString L(string name) + { + return LocalizableString.Create(name); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/Permissions/AbpOssManagementPermissions.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/Permissions/AbpOssManagementPermissions.cs index a0174d7c0..f5c4f6b91 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/Permissions/AbpOssManagementPermissions.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/Permissions/AbpOssManagementPermissions.cs @@ -1,27 +1,26 @@ -namespace LINGYUN.Abp.OssManagement.Permissions +namespace LINGYUN.Abp.OssManagement.Permissions; + +public class AbpOssManagementPermissions { - public class AbpOssManagementPermissions - { - public const string GroupName = "AbpOssManagement"; + public const string GroupName = "AbpOssManagement"; - public class Container - { - public const string Default = GroupName + ".Container"; + public class Container + { + public const string Default = GroupName + ".Container"; - public const string Create = Default + ".Create"; + public const string Create = Default + ".Create"; - public const string Delete = Default + ".Delete"; - } + public const string Delete = Default + ".Delete"; + } - public class OssObject - { - public const string Default = GroupName + ".OssObject"; + public class OssObject + { + public const string Default = GroupName + ".OssObject"; - public const string Create = Default + ".Create"; + public const string Create = Default + ".Create"; - public const string Delete = Default + ".Delete"; + public const string Delete = Default + ".Delete"; - public const string Download = Default + ".Download"; - } + public const string Download = Default + ".Download"; } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/UploadFile.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/UploadFile.cs index ac0988760..44cbe862f 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/UploadFile.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/UploadFile.cs @@ -1,18 +1,17 @@ using System.ComponentModel.DataAnnotations; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public class UploadFile { - public class UploadFile - { - /// - /// 总文件大小 - /// - [Required] - public long TotalSize { get; set; } - /// - /// 文件名 - /// - [Required] - public string FileName { get; set; } - } + /// + /// 总文件大小 + /// + [Required] + public long TotalSize { get; set; } + /// + /// 文件名 + /// + [Required] + public string FileName { get; set; } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/UploadFileChunkInput.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/UploadFileChunkInput.cs index 250cfef66..ac9cb1930 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/UploadFileChunkInput.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/UploadFileChunkInput.cs @@ -3,39 +3,38 @@ using Volo.Abp.Content; using Volo.Abp.Validation; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public class UploadFileChunkInput : UploadFile { - public class UploadFileChunkInput : UploadFile - { - public string Bucket { get; set; } - public string Path { get; set; } + public string Bucket { get; set; } + public string Path { get; set; } - #region 配合Uplaoder 分块传输 - /// - /// 常规块大小 - /// - [Required] - public long ChunkSize { get; set; } - /// - /// 当前块大小 - /// - [Required] - public long CurrentChunkSize { get; set; } - /// - /// 当前上传中块的索引 - /// - [Required] - public int ChunkNumber { get; set; } - /// - /// 块总数 - /// - [Required] - public int TotalChunks { get; set; } + #region 配合Uplaoder 分块传输 + /// + /// 常规块大小 + /// + [Required] + public long ChunkSize { get; set; } + /// + /// 当前块大小 + /// + [Required] + public long CurrentChunkSize { get; set; } + /// + /// 当前上传中块的索引 + /// + [Required] + public int ChunkNumber { get; set; } + /// + /// 块总数 + /// + [Required] + public int TotalChunks { get; set; } - #endregion + #endregion - [DisableAuditing] - [DisableValidation] - public IRemoteStreamContent File { get; set; } - } + [DisableAuditing] + [DisableValidation] + public IRemoteStreamContent File { get; set; } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/UploadFileInput.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/UploadFileInput.cs index 10af3220f..d7501958e 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/UploadFileInput.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application.Contracts/LINGYUN/Abp/OssManagement/UploadFileInput.cs @@ -3,17 +3,16 @@ using Volo.Abp.Content; using Volo.Abp.Validation; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public class UploadFileInput { - public class UploadFileInput - { - public string Path { get; set; } - public string Object { get; set; } - public bool Overwrite { get; set; } = true; + public string Path { get; set; } + public string Object { get; set; } + public bool Overwrite { get; set; } = true; - [Required] - [DisableAuditing] - [DisableValidation] - public IRemoteStreamContent File { get; set; } - } + [Required] + [DisableAuditing] + [DisableValidation] + public IRemoteStreamContent File { get; set; } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN.Abp.OssManagement.Application.csproj b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN.Abp.OssManagement.Application.csproj index 1c62d5ae4..a59937cae 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN.Abp.OssManagement.Application.csproj +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN.Abp.OssManagement.Application.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.OssManagement.Application + LINGYUN.Abp.OssManagement.Application + false + false + false diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/AbpOssManagementApplicationModule.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/AbpOssManagementApplicationModule.cs index 6268f36ac..e02b4fbd5 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/AbpOssManagementApplicationModule.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/AbpOssManagementApplicationModule.cs @@ -4,24 +4,23 @@ using Volo.Abp.Caching; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +[DependsOn( + typeof(AbpOssManagementDomainModule), + typeof(AbpOssManagementApplicationContractsModule), + typeof(AbpCachingModule), + typeof(AbpAutoMapperModule), + typeof(AbpDddApplicationModule))] +public class AbpOssManagementApplicationModule : AbpModule { - [DependsOn( - typeof(AbpOssManagementDomainModule), - typeof(AbpOssManagementApplicationContractsModule), - typeof(AbpCachingModule), - typeof(AbpAutoMapperModule), - typeof(AbpDddApplicationModule))] - public class AbpOssManagementApplicationModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddAutoMapperObjectMapper(); + context.Services.AddAutoMapperObjectMapper(); - Configure(options => - { - options.AddProfile(validate: true); - }); - } + Configure(options => + { + options.AddProfile(validate: true); + }); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/FileAppServiceBase.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/FileAppServiceBase.cs index 98ea4747e..bef3d3b23 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/FileAppServiceBase.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/FileAppServiceBase.cs @@ -11,135 +11,134 @@ using Volo.Abp.Features; using Volo.Abp.Validation; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public abstract class FileAppServiceBase : OssManagementApplicationServiceBase, IFileAppService { - public abstract class FileAppServiceBase : OssManagementApplicationServiceBase, IFileAppService + protected IFileUploader FileUploader { get; } + protected IFileValidater FileValidater { get; } + protected IOssContainerFactory OssContainerFactory { get; } + + protected FileAppServiceBase( + IFileUploader fileUploader, + IFileValidater fileValidater, + IOssContainerFactory ossContainerFactory) { - protected IFileUploader FileUploader { get; } - protected IFileValidater FileValidater { get; } - protected IOssContainerFactory OssContainerFactory { get; } - - protected FileAppServiceBase( - IFileUploader fileUploader, - IFileValidater fileValidater, - IOssContainerFactory ossContainerFactory) - { - FileUploader = fileUploader; - FileValidater = fileValidater; - OssContainerFactory = ossContainerFactory; - } + FileUploader = fileUploader; + FileValidater = fileValidater; + OssContainerFactory = ossContainerFactory; + } + + [RequiresFeature(AbpOssManagementFeatureNames.OssObject.UploadFile)] + public async virtual Task UploadAsync(UploadFileChunkInput input) + { + input.Bucket = GetCurrentBucket(); + input.Path = GetCurrentPath(HttpUtility.UrlDecode(input.Path)); + await FileUploader.UploadAsync(input); + } - [RequiresFeature(AbpOssManagementFeatureNames.OssObject.UploadFile)] - public async virtual Task UploadAsync(UploadFileChunkInput input) + [RequiresFeature(AbpOssManagementFeatureNames.OssObject.UploadFile)] + [RequiresLimitFeature( + AbpOssManagementFeatureNames.OssObject.UploadLimit, + AbpOssManagementFeatureNames.OssObject.UploadInterval, + LimitPolicy.Month)] + public async virtual Task UploadAsync(UploadFileInput input) + { + if (input.File == null || !input.File.ContentLength.HasValue) { - input.Bucket = GetCurrentBucket(); - input.Path = GetCurrentPath(HttpUtility.UrlDecode(input.Path)); - await FileUploader.UploadAsync(input); + ThrowValidationException(L["FileNotBeNullOrEmpty"], "File"); } - [RequiresFeature(AbpOssManagementFeatureNames.OssObject.UploadFile)] - [RequiresLimitFeature( - AbpOssManagementFeatureNames.OssObject.UploadLimit, - AbpOssManagementFeatureNames.OssObject.UploadInterval, - LimitPolicy.Month)] - public async virtual Task UploadAsync(UploadFileInput input) + await FileValidater.ValidationAsync(new UploadFile { - if (input.File == null || !input.File.ContentLength.HasValue) - { - ThrowValidationException(L["FileNotBeNullOrEmpty"], "File"); - } + TotalSize = input.File.ContentLength.Value, + FileName = input.Object + }); - await FileValidater.ValidationAsync(new UploadFile - { - TotalSize = input.File.ContentLength.Value, - FileName = input.Object - }); + var oss = OssContainerFactory.Create(); - var oss = OssContainerFactory.Create(); + var createOssObjectRequest = new CreateOssObjectRequest( + GetCurrentBucket(), + HttpUtility.UrlDecode(input.Object), + input.File.GetStream(), + GetCurrentPath(HttpUtility.UrlDecode(input.Path))) + { + Overwrite = input.Overwrite + }; - var createOssObjectRequest = new CreateOssObjectRequest( - GetCurrentBucket(), - HttpUtility.UrlDecode(input.Object), - input.File.GetStream(), - GetCurrentPath(HttpUtility.UrlDecode(input.Path))) - { - Overwrite = input.Overwrite - }; + var ossObject = await oss.CreateObjectAsync(createOssObjectRequest); - var ossObject = await oss.CreateObjectAsync(createOssObjectRequest); + return ObjectMapper.Map(ossObject); + } - return ObjectMapper.Map(ossObject); - } + public async virtual Task> GetListAsync(GetFilesInput input) + { + var ossContainer = OssContainerFactory.Create(); + var response = await ossContainer.GetObjectsAsync( + GetCurrentBucket(), + GetCurrentPath(HttpUtility.UrlDecode(input.Path)), + skipCount: 0, + maxResultCount: input.MaxResultCount); + + return new ListResultDto( + ObjectMapper.Map, List>(response.Objects)); + } - public async virtual Task> GetListAsync(GetFilesInput input) + [RequiresFeature(AbpOssManagementFeatureNames.OssObject.DownloadFile)] + [RequiresLimitFeature( + AbpOssManagementFeatureNames.OssObject.DownloadLimit, + AbpOssManagementFeatureNames.OssObject.DownloadInterval, + LimitPolicy.Month)] + public async virtual Task GetAsync(GetPublicFileInput input) + { + var ossObjectRequest = new GetOssObjectRequest( + GetCurrentBucket(), + // 需要处理特殊字符 + HttpUtility.UrlDecode(input.Name), + GetCurrentPath(HttpUtility.UrlDecode(input.Path)), + HttpUtility.UrlDecode(input.Process)) { - var ossContainer = OssContainerFactory.Create(); - var response = await ossContainer.GetObjectsAsync( - GetCurrentBucket(), - GetCurrentPath(HttpUtility.UrlDecode(input.Path)), - skipCount: 0, - maxResultCount: input.MaxResultCount); - - return new ListResultDto( - ObjectMapper.Map, List>(response.Objects)); - } + MD5 = true, + }; - [RequiresFeature(AbpOssManagementFeatureNames.OssObject.DownloadFile)] - [RequiresLimitFeature( - AbpOssManagementFeatureNames.OssObject.DownloadLimit, - AbpOssManagementFeatureNames.OssObject.DownloadInterval, - LimitPolicy.Month)] - public async virtual Task GetAsync(GetPublicFileInput input) - { - var ossObjectRequest = new GetOssObjectRequest( - GetCurrentBucket(), - // 需要处理特殊字符 - HttpUtility.UrlDecode(input.Name), - GetCurrentPath(HttpUtility.UrlDecode(input.Path)), - HttpUtility.UrlDecode(input.Process)) - { - MD5 = true, - }; + var ossContainer = OssContainerFactory.Create(); + var ossObject = await ossContainer.GetObjectAsync(ossObjectRequest); - var ossContainer = OssContainerFactory.Create(); - var ossObject = await ossContainer.GetObjectAsync(ossObjectRequest); + return new RemoteStreamContent(ossObject.Content); + } - return new RemoteStreamContent(ossObject.Content); - } + public async virtual Task DeleteAsync(GetPublicFileInput input) + { + var ossContainer = OssContainerFactory.Create(); - public async virtual Task DeleteAsync(GetPublicFileInput input) - { - var ossContainer = OssContainerFactory.Create(); + await ossContainer.DeleteObjectAsync( + GetCurrentBucket(), + HttpUtility.UrlDecode(input.Name), + GetCurrentPath(input.Path)); + } - await ossContainer.DeleteObjectAsync( - GetCurrentBucket(), - HttpUtility.UrlDecode(input.Name), - GetCurrentPath(input.Path)); - } + protected virtual string GetCurrentBucket() + { + throw new System.NotImplementedException(); + } - protected virtual string GetCurrentBucket() + protected virtual string GetCurrentPath(string path) + { + if (path.IsNullOrWhiteSpace()) { - throw new System.NotImplementedException(); + return ""; } + path = HttpUtility.UrlDecode(path); + path = path.RemovePreFix(".").RemovePreFix("/"); + return path; + } - protected virtual string GetCurrentPath(string path) - { - if (path.IsNullOrWhiteSpace()) + private static void ThrowValidationException(string message, string memberName) + { + throw new AbpValidationException(message, + new List { - return ""; - } - path = HttpUtility.UrlDecode(path); - path = path.RemovePreFix(".").RemovePreFix("/"); - return path; - } - - private static void ThrowValidationException(string message, string memberName) - { - throw new AbpValidationException(message, - new List - { - new ValidationResult(message, new[] {memberName}) - }); - } + new ValidationResult(message, new[] {memberName}) + }); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/FileShareCacheItem.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/FileShareCacheItem.cs index 9417dea4b..b46764399 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/FileShareCacheItem.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/FileShareCacheItem.cs @@ -2,95 +2,94 @@ using System.Collections.Generic; using System.Linq; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +[Serializable] +public class MyFileShareCacheItem { - [Serializable] - public class MyFileShareCacheItem + private const string CacheKeyFormat = "ui:{0}"; + + public List Items { get; set; } + public MyFileShareCacheItem() { } + public MyFileShareCacheItem(List items) { - private const string CacheKeyFormat = "ui:{0}"; + Items = items ?? new List(); + } - public List Items { get; set; } - public MyFileShareCacheItem() { } - public MyFileShareCacheItem(List items) - { - Items = items ?? new List(); - } + public static string CalculateCacheKey(Guid userId) + { + return string.Format(CacheKeyFormat, userId.ToString("N")); + } - public static string CalculateCacheKey(Guid userId) + public DateTime? GetLastExpirationTime() + { + if (!Items.Any()) { - return string.Format(CacheKeyFormat, userId.ToString("N")); + return null; } - public DateTime? GetLastExpirationTime() - { - if (!Items.Any()) - { - return null; - } - - return Items - .OrderByDescending(item => item.ExpirationTime) - .Select(item => item.ExpirationTime) - .FirstOrDefault(); - } + return Items + .OrderByDescending(item => item.ExpirationTime) + .Select(item => item.ExpirationTime) + .FirstOrDefault(); } +} - [Serializable] - public class FileShareCacheItem - { - private const string CacheKeyFormat = "url:{0}"; +[Serializable] +public class FileShareCacheItem +{ + private const string CacheKeyFormat = "url:{0}"; - public string Bucket { get; set; } + public string Bucket { get; set; } - public string Name { get; set; } + public string Name { get; set; } - public string Path { get; set; } + public string Path { get; set; } - public string[] Roles { get; set; } + public string[] Roles { get; set; } - public string[] Users { get; set; } + public string[] Users { get; set; } - public string MD5 { get; set; } + public string MD5 { get; set; } - public string Url { get; set; } + public string Url { get; set; } - public int AccessCount { get; set; } + public int AccessCount { get; set; } - public int MaxAccessCount { get; set; } + public int MaxAccessCount { get; set; } - public DateTime ExpirationTime { get; set; } + public DateTime ExpirationTime { get; set; } - public Guid UserId { get; set; } + public Guid UserId { get; set; } - public FileShareCacheItem() { } + public FileShareCacheItem() { } - public FileShareCacheItem( - Guid userId, - string bucket, - string name, - string path, - string md5, - string url, - DateTime expirationTime, - string[] roles = null, - string[] users = null, - int maxAccessCount = 0) - { - UserId = userId; - Bucket = bucket; - Name = name; - Path = path; - MD5 = md5; - Url = url; - ExpirationTime = expirationTime; - Roles = roles ?? new string[0]; - Users = users ?? new string[0]; - MaxAccessCount = maxAccessCount; - } + public FileShareCacheItem( + Guid userId, + string bucket, + string name, + string path, + string md5, + string url, + DateTime expirationTime, + string[] roles = null, + string[] users = null, + int maxAccessCount = 0) + { + UserId = userId; + Bucket = bucket; + Name = name; + Path = path; + MD5 = md5; + Url = url; + ExpirationTime = expirationTime; + Roles = roles ?? new string[0]; + Users = users ?? new string[0]; + MaxAccessCount = maxAccessCount; + } - public static string CalculateCacheKey(string shareUrl) - { - return string.Format(CacheKeyFormat, shareUrl); - } + public static string CalculateCacheKey(string shareUrl) + { + return string.Format(CacheKeyFormat, shareUrl); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/FileUploadMerger.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/FileUploadMerger.cs index dc55102d8..ec0aff509 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/FileUploadMerger.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/FileUploadMerger.cs @@ -10,73 +10,72 @@ using Volo.Abp.Features; using Volo.Abp.Validation; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public class FileUploadMerger : ITransientDependency { - public class FileUploadMerger : ITransientDependency + private readonly IFileValidater _fileValidater; + private readonly IOssContainerFactory _ossContainerFactory; + private readonly IStringLocalizer _stringLocalizer; + + public FileUploadMerger( + IFileValidater fileValidater, + IOssContainerFactory ossContainerFactory, + IStringLocalizer stringLocalizer) { - private readonly IFileValidater _fileValidater; - private readonly IOssContainerFactory _ossContainerFactory; - private readonly IStringLocalizer _stringLocalizer; + _fileValidater = fileValidater; + _ossContainerFactory = ossContainerFactory; + _stringLocalizer = stringLocalizer; + } - public FileUploadMerger( - IFileValidater fileValidater, - IOssContainerFactory ossContainerFactory, - IStringLocalizer stringLocalizer) + /// + /// 合并文件 + /// + /// + /// + [RequiresFeature(AbpOssManagementFeatureNames.OssObject.UploadFile)] + [RequiresLimitFeature( + AbpOssManagementFeatureNames.OssObject.UploadLimit, + AbpOssManagementFeatureNames.OssObject.UploadInterval, + LimitPolicy.Month)] + public async virtual Task MergeAsync(CreateOssObjectInput input) + { + if (input.File == null || !input.File.ContentLength.HasValue) { - _fileValidater = fileValidater; - _ossContainerFactory = ossContainerFactory; - _stringLocalizer = stringLocalizer; + ThrowValidationException(_stringLocalizer["FileNotBeNullOrEmpty"], "File"); } - /// - /// 合并文件 - /// - /// - /// - [RequiresFeature(AbpOssManagementFeatureNames.OssObject.UploadFile)] - [RequiresLimitFeature( - AbpOssManagementFeatureNames.OssObject.UploadLimit, - AbpOssManagementFeatureNames.OssObject.UploadInterval, - LimitPolicy.Month)] - public async virtual Task MergeAsync(CreateOssObjectInput input) + await _fileValidater.ValidationAsync(new UploadFile { - if (input.File == null || !input.File.ContentLength.HasValue) - { - ThrowValidationException(_stringLocalizer["FileNotBeNullOrEmpty"], "File"); - } + TotalSize = input.File.ContentLength.Value, + FileName = input.FileName + }); - await _fileValidater.ValidationAsync(new UploadFile - { - TotalSize = input.File.ContentLength.Value, - FileName = input.FileName - }); - - var oss = CreateOssContainer(); - - var createOssObjectRequest = new CreateOssObjectRequest( - input.Bucket, - input.FileName, - input.File.GetStream(), - input.Path, - input.ExpirationTime) - { - Overwrite = input.Overwrite - }; - return await oss.CreateObjectAsync(createOssObjectRequest); - } + var oss = CreateOssContainer(); - protected virtual IOssContainer CreateOssContainer() + var createOssObjectRequest = new CreateOssObjectRequest( + input.Bucket, + input.FileName, + input.File.GetStream(), + input.Path, + input.ExpirationTime) { - return _ossContainerFactory.Create(); - } + Overwrite = input.Overwrite + }; + return await oss.CreateObjectAsync(createOssObjectRequest); + } - private static void ThrowValidationException(string message, string memberName) - { - throw new AbpValidationException(message, - new List - { - new ValidationResult(message, new[] {memberName}) - }); - } + protected virtual IOssContainer CreateOssContainer() + { + return _ossContainerFactory.Create(); + } + + private static void ThrowValidationException(string message, string memberName) + { + throw new AbpValidationException(message, + new List + { + new ValidationResult(message, new[] {memberName}) + }); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/FileUploader.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/FileUploader.cs index 0fbece6fa..442f81690 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/FileUploader.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/FileUploader.cs @@ -6,95 +6,94 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.IO; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public class FileUploader : IFileUploader, ITransientDependency { - public class FileUploader : IFileUploader, ITransientDependency + private readonly IFileValidater _fileValidater; + private readonly FileUploadMerger _fileUploadMerger; + + public FileUploader( + IFileValidater fileValidater, + FileUploadMerger fileUploadMerger) { - private readonly IFileValidater _fileValidater; - private readonly FileUploadMerger _fileUploadMerger; + _fileValidater = fileValidater; + _fileUploadMerger = fileUploadMerger; + } - public FileUploader( - IFileValidater fileValidater, - FileUploadMerger fileUploadMerger) + public async virtual Task UploadAsync(UploadFileChunkInput input, CancellationToken cancellationToken = default) + { + await _fileValidater.ValidationAsync(input); + // 以上传的文件名创建一个临时目录 + var tempFilePath = Path.Combine( + Path.GetTempPath(), + "lingyun-abp-application", + "oss-upload-tmp", + string.Concat(input.Path ?? "", input.FileName).ToMd5()); + + try { - _fileValidater = fileValidater; - _fileUploadMerger = fileUploadMerger; - } + DirectoryHelper.CreateIfNotExists(tempFilePath); - public async virtual Task UploadAsync(UploadFileChunkInput input, CancellationToken cancellationToken = default) - { - await _fileValidater.ValidationAsync(input); - // 以上传的文件名创建一个临时目录 - var tempFilePath = Path.Combine( - Path.GetTempPath(), - "lingyun-abp-application", - "oss-upload-tmp", - string.Concat(input.Path ?? "", input.FileName).ToMd5()); - - try + if (cancellationToken.IsCancellationRequested) { - DirectoryHelper.CreateIfNotExists(tempFilePath); + // 如果取消请求,删除临时目录 + DirectoryHelper.DeleteIfExists(tempFilePath, true); + return; + } - if (cancellationToken.IsCancellationRequested) + // 以上传的分片索引创建临时文件 + var tempSavedFile = Path.Combine(tempFilePath, $"{input.ChunkNumber}.upd"); + if (input.File != null) + { + // 保存临时文件 + using (var fs = new FileStream(tempSavedFile, FileMode.Create, FileAccess.Write)) { - // 如果取消请求,删除临时目录 - DirectoryHelper.DeleteIfExists(tempFilePath, true); - return; + // 写入当前分片文件 + await input.File.GetStream().CopyToAsync(fs); } + } - // 以上传的分片索引创建临时文件 - var tempSavedFile = Path.Combine(tempFilePath, $"{input.ChunkNumber}.upd"); - if (input.File != null) + if (input.ChunkNumber == input.TotalChunks) + { + var mergeTmpFile = Path.Combine(tempFilePath, input.FileName); + // 创建临时合并文件流 + using (var mergeFileStream = new FileStream(mergeTmpFile, FileMode.Create, FileAccess.ReadWrite)) { - // 保存临时文件 - using (var fs = new FileStream(tempSavedFile, FileMode.Create, FileAccess.Write)) + var createOssObjectInput = new CreateOssObjectInput { - // 写入当前分片文件 - await input.File.GetStream().CopyToAsync(fs); - } - } - - if (input.ChunkNumber == input.TotalChunks) - { - var mergeTmpFile = Path.Combine(tempFilePath, input.FileName); - // 创建临时合并文件流 - using (var mergeFileStream = new FileStream(mergeTmpFile, FileMode.Create, FileAccess.ReadWrite)) + Bucket = input.Bucket, + Path = input.Path, + FileName = input.FileName + }; + // 合并文件 + var mergeSavedFile = Path.Combine(tempFilePath, $"{input.FileName}"); + // 获取并排序所有分片文件 + var mergeFiles = Directory.GetFiles(tempFilePath, "*.upd").OrderBy(f => f.Length).ThenBy(f => f); + // 创建临时合并文件 + foreach (var mergeFile in mergeFiles) { - var createOssObjectInput = new CreateOssObjectInput - { - Bucket = input.Bucket, - Path = input.Path, - FileName = input.FileName - }; - // 合并文件 - var mergeSavedFile = Path.Combine(tempFilePath, $"{input.FileName}"); - // 获取并排序所有分片文件 - var mergeFiles = Directory.GetFiles(tempFilePath, "*.upd").OrderBy(f => f.Length).ThenBy(f => f); - // 创建临时合并文件 - foreach (var mergeFile in mergeFiles) - { - // 读取当前文件字节 - var mergeFileBytes = await FileHelper.ReadAllBytesAsync(mergeFile); - // 写入到合并文件流 - await mergeFileStream.WriteAsync(mergeFileBytes, 0, mergeFileBytes.Length, cancellationToken); - Array.Clear(mergeFileBytes, 0, mergeFileBytes.Length); - // 删除已参与合并的临时文件分片 - FileHelper.DeleteIfExists(mergeFile); - } - createOssObjectInput.SetContent(mergeFileStream); - // 分离出合并接口,合并时计算上传次数 - await _fileUploadMerger.MergeAsync(createOssObjectInput); + // 读取当前文件字节 + var mergeFileBytes = await FileHelper.ReadAllBytesAsync(mergeFile); + // 写入到合并文件流 + await mergeFileStream.WriteAsync(mergeFileBytes, 0, mergeFileBytes.Length, cancellationToken); + Array.Clear(mergeFileBytes, 0, mergeFileBytes.Length); + // 删除已参与合并的临时文件分片 + FileHelper.DeleteIfExists(mergeFile); } - // 文件保存之后删除临时文件目录 - DirectoryHelper.DeleteIfExists(tempFilePath, true); + createOssObjectInput.SetContent(mergeFileStream); + // 分离出合并接口,合并时计算上传次数 + await _fileUploadMerger.MergeAsync(createOssObjectInput); } - } - catch - { - // 发生异常删除临时文件目录 + // 文件保存之后删除临时文件目录 DirectoryHelper.DeleteIfExists(tempFilePath, true); - throw; } } + catch + { + // 发生异常删除临时文件目录 + DirectoryHelper.DeleteIfExists(tempFilePath, true); + throw; + } } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/FileValidater.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/FileValidater.cs index 10c56857e..059d09e43 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/FileValidater.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/FileValidater.cs @@ -10,87 +10,86 @@ using Volo.Abp.IO; using Volo.Abp.Settings; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public class FileValidater : IFileValidater, ISingletonDependency { - public class FileValidater : IFileValidater, ISingletonDependency + private readonly IMemoryCache _cache; + private readonly ISettingProvider _settingProvider; + private readonly IServiceProvider _serviceProvider; + private readonly IStringLocalizer _stringLocalizer; + + public FileValidater( + IMemoryCache cache, + ISettingProvider settingProvider, + IServiceProvider serviceProvider, + IStringLocalizer stringLocalizer) { - private readonly IMemoryCache _cache; - private readonly ISettingProvider _settingProvider; - private readonly IServiceProvider _serviceProvider; - private readonly IStringLocalizer _stringLocalizer; + _cache = cache; + _settingProvider = settingProvider; + _serviceProvider = serviceProvider; + _stringLocalizer = stringLocalizer; + } - public FileValidater( - IMemoryCache cache, - ISettingProvider settingProvider, - IServiceProvider serviceProvider, - IStringLocalizer stringLocalizer) + public async virtual Task ValidationAsync(UploadFile input) + { + var validation = await GetByCacheItemAsync(); + if (validation.SizeLimit * 1024 * 1024 < input.TotalSize) { - _cache = cache; - _settingProvider = settingProvider; - _serviceProvider = serviceProvider; - _stringLocalizer = stringLocalizer; + throw new UserFriendlyException(_stringLocalizer["UploadFileSizeBeyondLimit", validation.SizeLimit]); } - - public async virtual Task ValidationAsync(UploadFile input) + var fileExtensionName = FileHelper.GetExtension(input.FileName); + if (!validation.AllowedExtensions + .Any(fe => fe.Equals(fileExtensionName, StringComparison.CurrentCultureIgnoreCase))) { - var validation = await GetByCacheItemAsync(); - if (validation.SizeLimit * 1024 * 1024 < input.TotalSize) - { - throw new UserFriendlyException(_stringLocalizer["UploadFileSizeBeyondLimit", validation.SizeLimit]); - } - var fileExtensionName = FileHelper.GetExtension(input.FileName); - if (!validation.AllowedExtensions - .Any(fe => fe.Equals(fileExtensionName, StringComparison.CurrentCultureIgnoreCase))) - { - throw new UserFriendlyException(_stringLocalizer["NotAllowedFileExtensionName", fileExtensionName]); - } + throw new UserFriendlyException(_stringLocalizer["NotAllowedFileExtensionName", fileExtensionName]); } + } - protected async virtual Task GetByCacheItemAsync() + protected async virtual Task GetByCacheItemAsync() + { + var fileValidation = _cache.Get(FileValidation.CacheKey); + if (fileValidation == null) { - var fileValidation = _cache.Get(FileValidation.CacheKey); - if (fileValidation == null) - { - fileValidation = await GetBySettingAsync(); - _cache.Set(FileValidation.CacheKey, - fileValidation, - new MemoryCacheEntryOptions - { - AbsoluteExpiration = DateTimeOffset.Now.AddMinutes(2) - }); - } - return fileValidation; + fileValidation = await GetBySettingAsync(); + _cache.Set(FileValidation.CacheKey, + fileValidation, + new MemoryCacheEntryOptions + { + AbsoluteExpiration = DateTimeOffset.Now.AddMinutes(2) + }); } + return fileValidation; + } - protected async virtual Task GetBySettingAsync() - { - var fileSizeLimited = await _settingProvider - .GetAsync( - AbpOssManagementSettingNames.FileLimitLength, - AbpOssManagementSettingNames.DefaultFileLimitLength); - var fileAllowExtension = await _settingProvider - .GetOrDefaultAsync(AbpOssManagementSettingNames.AllowFileExtensions, _serviceProvider); + protected async virtual Task GetBySettingAsync() + { + var fileSizeLimited = await _settingProvider + .GetAsync( + AbpOssManagementSettingNames.FileLimitLength, + AbpOssManagementSettingNames.DefaultFileLimitLength); + var fileAllowExtension = await _settingProvider + .GetOrDefaultAsync(AbpOssManagementSettingNames.AllowFileExtensions, _serviceProvider); - return new FileValidation(fileSizeLimited, fileAllowExtension.Split(',')); - } + return new FileValidation(fileSizeLimited, fileAllowExtension.Split(',')); } +} - public class FileValidation +public class FileValidation +{ + public const string CacheKey = "Abp.OssManagement.FileValidation"; + public long SizeLimit { get; set; } + public string[] AllowedExtensions { get; set; } + public FileValidation() { - public const string CacheKey = "Abp.OssManagement.FileValidation"; - public long SizeLimit { get; set; } - public string[] AllowedExtensions { get; set; } - public FileValidation() - { - } + } - public FileValidation( - long sizeLimit, - string[] allowedExtensions) - { - SizeLimit = sizeLimit; - AllowedExtensions = allowedExtensions; - } + public FileValidation( + long sizeLimit, + string[] allowedExtensions) + { + SizeLimit = sizeLimit; + AllowedExtensions = allowedExtensions; } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/OssContainerAppService.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/OssContainerAppService.cs index 76dee98bc..0409d4662 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/OssContainerAppService.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/OssContainerAppService.cs @@ -2,69 +2,68 @@ using Microsoft.AspNetCore.Authorization; using System.Threading.Tasks; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +[Authorize(AbpOssManagementPermissions.Container.Default)] +public class OssContainerAppService : OssManagementApplicationServiceBase, IOssContainerAppService { - [Authorize(AbpOssManagementPermissions.Container.Default)] - public class OssContainerAppService : OssManagementApplicationServiceBase, IOssContainerAppService - { - protected IOssContainerFactory OssContainerFactory { get; } + protected IOssContainerFactory OssContainerFactory { get; } - public OssContainerAppService( - IOssContainerFactory ossContainerFactory) - { - OssContainerFactory = ossContainerFactory; - } + public OssContainerAppService( + IOssContainerFactory ossContainerFactory) + { + OssContainerFactory = ossContainerFactory; + } - [Authorize(AbpOssManagementPermissions.Container.Create)] - public async virtual Task CreateAsync(string name) - { - var oss = CreateOssContainer(); - var container = await oss.CreateAsync(name); + [Authorize(AbpOssManagementPermissions.Container.Create)] + public async virtual Task CreateAsync(string name) + { + var oss = CreateOssContainer(); + var container = await oss.CreateAsync(name); - return ObjectMapper.Map(container); - } + return ObjectMapper.Map(container); + } - [Authorize(AbpOssManagementPermissions.Container.Delete)] - public async virtual Task DeleteAsync(string name) - { - var oss = CreateOssContainer(); + [Authorize(AbpOssManagementPermissions.Container.Delete)] + public async virtual Task DeleteAsync(string name) + { + var oss = CreateOssContainer(); - await oss.DeleteAsync(name); - } + await oss.DeleteAsync(name); + } - public async virtual Task GetAsync(string name) - { - var oss = CreateOssContainer(); - var container = await oss.GetAsync(name); + public async virtual Task GetAsync(string name) + { + var oss = CreateOssContainer(); + var container = await oss.GetAsync(name); - return ObjectMapper.Map(container); - } + return ObjectMapper.Map(container); + } - public async virtual Task GetListAsync(GetOssContainersInput input) - { - var oss = CreateOssContainer(); + public async virtual Task GetListAsync(GetOssContainersInput input) + { + var oss = CreateOssContainer(); - var containerResponse = await oss.GetListAsync( - input.Prefix, input.Marker, input.SkipCount, input.MaxResultCount); + var containerResponse = await oss.GetListAsync( + input.Prefix, input.Marker, input.SkipCount, input.MaxResultCount); - return ObjectMapper.Map(containerResponse); - } + return ObjectMapper.Map(containerResponse); + } - public async virtual Task GetObjectListAsync(GetOssObjectsInput input) - { - var oss = CreateOssContainer(); + public async virtual Task GetObjectListAsync(GetOssObjectsInput input) + { + var oss = CreateOssContainer(); - var ossObjectResponse = await oss.GetObjectsAsync( - input.Bucket, input.Prefix, input.Marker, - input.Delimiter, input.EncodingType, input.MD5, - input.SkipCount, input.MaxResultCount); + var ossObjectResponse = await oss.GetObjectsAsync( + input.Bucket, input.Prefix, input.Marker, + input.Delimiter, input.EncodingType, input.MD5, + input.SkipCount, input.MaxResultCount); - return ObjectMapper.Map(ossObjectResponse); - } + return ObjectMapper.Map(ossObjectResponse); + } - protected virtual IOssContainer CreateOssContainer() - { - return OssContainerFactory.Create(); - } + protected virtual IOssContainer CreateOssContainer() + { + return OssContainerFactory.Create(); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/OssManagementApplicationAutoMapperProfile.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/OssManagementApplicationAutoMapperProfile.cs index 8777051a9..8fc0cc6e2 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/OssManagementApplicationAutoMapperProfile.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/OssManagementApplicationAutoMapperProfile.cs @@ -1,19 +1,18 @@ using AutoMapper; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public class OssManagementApplicationAutoMapperProfile : Profile { - public class OssManagementApplicationAutoMapperProfile : Profile + public OssManagementApplicationAutoMapperProfile() { - public OssManagementApplicationAutoMapperProfile() - { - CreateMap(); - CreateMap() - .ForMember(dto => dto.Path, map => map.MapFrom(src => src.Prefix)); + CreateMap(); + CreateMap() + .ForMember(dto => dto.Path, map => map.MapFrom(src => src.Prefix)); - CreateMap(); - CreateMap(); + CreateMap(); + CreateMap(); - CreateMap(); - } + CreateMap(); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/OssManagementApplicationServiceBase.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/OssManagementApplicationServiceBase.cs index b43549ec7..8ef480f84 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/OssManagementApplicationServiceBase.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/OssManagementApplicationServiceBase.cs @@ -1,14 +1,13 @@ using LINGYUN.Abp.OssManagement.Localization; using Volo.Abp.Application.Services; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public abstract class OssManagementApplicationServiceBase : ApplicationService { - public abstract class OssManagementApplicationServiceBase : ApplicationService + protected OssManagementApplicationServiceBase() { - protected OssManagementApplicationServiceBase() - { - LocalizationResource = typeof(AbpOssManagementResource); - ObjectMapperContext = typeof(AbpOssManagementApplicationModule); - } + LocalizationResource = typeof(AbpOssManagementResource); + ObjectMapperContext = typeof(AbpOssManagementApplicationModule); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/OssObjectAppService.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/OssObjectAppService.cs index 490d15de6..3e039b5b3 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/OssObjectAppService.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/OssObjectAppService.cs @@ -5,83 +5,82 @@ using System.Web; using Volo.Abp.Content; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +[Authorize(AbpOssManagementPermissions.OssObject.Default)] +public class OssObjectAppService : OssManagementApplicationServiceBase, IOssObjectAppService { - [Authorize(AbpOssManagementPermissions.OssObject.Default)] - public class OssObjectAppService : OssManagementApplicationServiceBase, IOssObjectAppService + protected FileUploadMerger Merger { get; } + protected IOssContainerFactory OssContainerFactory { get; } + + public OssObjectAppService( + FileUploadMerger merger, + IOssContainerFactory ossContainerFactory) { - protected FileUploadMerger Merger { get; } - protected IOssContainerFactory OssContainerFactory { get; } + Merger = merger; + OssContainerFactory = ossContainerFactory; + } - public OssObjectAppService( - FileUploadMerger merger, - IOssContainerFactory ossContainerFactory) + [Authorize(AbpOssManagementPermissions.OssObject.Create)] + public async virtual Task CreateAsync(CreateOssObjectInput input) + { + // 内容为空时建立目录 + if (input.File == null || !input.File.ContentLength.HasValue) { - Merger = merger; - OssContainerFactory = ossContainerFactory; - } + var oss = CreateOssContainer(); + var request = new CreateOssObjectRequest( + HttpUtility.UrlDecode(input.Bucket), + HttpUtility.UrlDecode(input.FileName), + Stream.Null, + HttpUtility.UrlDecode(input.Path)); + var ossObject = await oss.CreateObjectAsync(request); - [Authorize(AbpOssManagementPermissions.OssObject.Create)] - public async virtual Task CreateAsync(CreateOssObjectInput input) + return ObjectMapper.Map(ossObject); + } + else { - // 内容为空时建立目录 - if (input.File == null || !input.File.ContentLength.HasValue) - { - var oss = CreateOssContainer(); - var request = new CreateOssObjectRequest( - HttpUtility.UrlDecode(input.Bucket), - HttpUtility.UrlDecode(input.FileName), - Stream.Null, - HttpUtility.UrlDecode(input.Path)); - var ossObject = await oss.CreateObjectAsync(request); - - return ObjectMapper.Map(ossObject); - } - else - { - var ossObject = await Merger.MergeAsync(input); - - return ObjectMapper.Map(ossObject); - } + var ossObject = await Merger.MergeAsync(input); + + return ObjectMapper.Map(ossObject); } + } - [Authorize(AbpOssManagementPermissions.OssObject.Delete)] - public async virtual Task BulkDeleteAsync(BulkDeleteOssObjectInput input) - { - var oss = CreateOssContainer(); + [Authorize(AbpOssManagementPermissions.OssObject.Delete)] + public async virtual Task BulkDeleteAsync(BulkDeleteOssObjectInput input) + { + var oss = CreateOssContainer(); - await oss.BulkDeleteObjectsAsync(input.Bucket, input.Objects, input.Path); - } + await oss.BulkDeleteObjectsAsync(input.Bucket, input.Objects, input.Path); + } - [Authorize(AbpOssManagementPermissions.OssObject.Delete)] - public async virtual Task DeleteAsync(GetOssObjectInput input) - { - var oss = CreateOssContainer(); + [Authorize(AbpOssManagementPermissions.OssObject.Delete)] + public async virtual Task DeleteAsync(GetOssObjectInput input) + { + var oss = CreateOssContainer(); - await oss.DeleteObjectAsync(input.Bucket, input.Object, input.Path); - } + await oss.DeleteObjectAsync(input.Bucket, input.Object, input.Path); + } - public async virtual Task GetAsync(GetOssObjectInput input) - { - var oss = CreateOssContainer(); + public async virtual Task GetAsync(GetOssObjectInput input) + { + var oss = CreateOssContainer(); - var ossObject = await oss.GetObjectAsync(input.Bucket, input.Object, input.Path, input.MD5); + var ossObject = await oss.GetObjectAsync(input.Bucket, input.Object, input.Path, input.MD5); - return ObjectMapper.Map(ossObject); - } + return ObjectMapper.Map(ossObject); + } - public async virtual Task GetContentAsync(GetOssObjectInput input) - { - var oss = CreateOssContainer(); + public async virtual Task GetContentAsync(GetOssObjectInput input) + { + var oss = CreateOssContainer(); - var ossObject = await oss.GetObjectAsync(input.Bucket, input.Object, input.Path, input.MD5); + var ossObject = await oss.GetObjectAsync(input.Bucket, input.Object, input.Path, input.MD5); - return new RemoteStreamContent(ossObject.Content, ossObject.Name); - } + return new RemoteStreamContent(ossObject.Content, ossObject.Name); + } - protected virtual IOssContainer CreateOssContainer() - { - return OssContainerFactory.Create(); - } + protected virtual IOssContainer CreateOssContainer() + { + return OssContainerFactory.Create(); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/PrivateFileAppService.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/PrivateFileAppService.cs index cd6901ca7..1d381a64f 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/PrivateFileAppService.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/PrivateFileAppService.cs @@ -13,218 +13,217 @@ using Volo.Abp.IO; using Volo.Abp.Users; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +/// +/// 所有登录用户访问私有文件服务接口 +/// bucket限制在users +/// path限制在用户id +/// +[Authorize] +// 不对外公开,仅通过控制器调用 +//[RemoteService(IsMetadataEnabled = false)] +public class PrivateFileAppService : FileAppServiceBase, IPrivateFileAppService { - /// - /// 所有登录用户访问私有文件服务接口 - /// bucket限制在users - /// path限制在用户id - /// + private readonly IDistributedCache _shareCache; + private readonly IDistributedCache _myShareCache; + public PrivateFileAppService( + IDistributedCache shareCache, + IDistributedCache myShareCache, + IFileUploader fileUploader, + IFileValidater fileValidater, + IOssContainerFactory ossContainerFactory) + : base(fileUploader, fileValidater, ossContainerFactory) + { + _shareCache = shareCache; + _myShareCache = myShareCache; + } + [Authorize] - // 不对外公开,仅通过控制器调用 - //[RemoteService(IsMetadataEnabled = false)] - public class PrivateFileAppService : FileAppServiceBase, IPrivateFileAppService + [RequiresFeature(AbpOssManagementFeatureNames.OssObject.DownloadFile)] + [RequiresLimitFeature( + AbpOssManagementFeatureNames.OssObject.DownloadLimit, + AbpOssManagementFeatureNames.OssObject.DownloadInterval, + LimitPolicy.Month)] + public override async Task GetAsync(GetPublicFileInput input) { - private readonly IDistributedCache _shareCache; - private readonly IDistributedCache _myShareCache; - public PrivateFileAppService( - IDistributedCache shareCache, - IDistributedCache myShareCache, - IFileUploader fileUploader, - IFileValidater fileValidater, - IOssContainerFactory ossContainerFactory) - : base(fileUploader, fileValidater, ossContainerFactory) + var ossObjectRequest = new GetOssObjectRequest( + GetCurrentBucket(), + // 需要处理特殊字符 + HttpUtility.UrlDecode(input.Name), + GetCurrentPath(HttpUtility.UrlDecode(input.Path)), + HttpUtility.UrlDecode(input.Process)) { - _shareCache = shareCache; - _myShareCache = myShareCache; - } + MD5 = true, + // TODO: 用户访问自身目录可以实现无限制创建目录层级? + CreatePathIsNotExists = true, + }; - [Authorize] - [RequiresFeature(AbpOssManagementFeatureNames.OssObject.DownloadFile)] - [RequiresLimitFeature( - AbpOssManagementFeatureNames.OssObject.DownloadLimit, - AbpOssManagementFeatureNames.OssObject.DownloadInterval, - LimitPolicy.Month)] - public override async Task GetAsync(GetPublicFileInput input) - { - var ossObjectRequest = new GetOssObjectRequest( - GetCurrentBucket(), - // 需要处理特殊字符 - HttpUtility.UrlDecode(input.Name), - GetCurrentPath(HttpUtility.UrlDecode(input.Path)), - HttpUtility.UrlDecode(input.Process)) - { - MD5 = true, - // TODO: 用户访问自身目录可以实现无限制创建目录层级? - CreatePathIsNotExists = true, - }; + var ossContainer = OssContainerFactory.Create(); + var ossObject = await ossContainer.GetObjectAsync(ossObjectRequest); - var ossContainer = OssContainerFactory.Create(); - var ossObject = await ossContainer.GetObjectAsync(ossObjectRequest); + return new RemoteStreamContent(ossObject.Content); + } - return new RemoteStreamContent(ossObject.Content); - } + [Authorize] + public override async Task> GetListAsync(GetFilesInput input) + { + var ossContainer = OssContainerFactory.Create(); + var response = await ossContainer.GetObjectsAsync( + GetCurrentBucket(), + GetCurrentPath(HttpUtility.UrlDecode(input.Path)), + skipCount: 0, + maxResultCount: input.MaxResultCount, + createPathIsNotExists: true); // TODO: 用户访问自身目录可以实现无限制创建目录层级? + + return new ListResultDto( + ObjectMapper.Map, List>(response.Objects)); + } - [Authorize] - public override async Task> GetListAsync(GetFilesInput input) - { - var ossContainer = OssContainerFactory.Create(); - var response = await ossContainer.GetObjectsAsync( - GetCurrentBucket(), - GetCurrentPath(HttpUtility.UrlDecode(input.Path)), - skipCount: 0, - maxResultCount: input.MaxResultCount, - createPathIsNotExists: true); // TODO: 用户访问自身目录可以实现无限制创建目录层级? - - return new ListResultDto( - ObjectMapper.Map, List>(response.Objects)); - } + [Authorize] + public override async Task UploadAsync(UploadFileInput input) + { + return await base.UploadAsync(input); + } - [Authorize] - public override async Task UploadAsync(UploadFileInput input) - { - return await base.UploadAsync(input); - } + [Authorize] + public override async Task UploadAsync(UploadFileChunkInput input) + { + await base.UploadAsync(input); + } - [Authorize] - public override async Task UploadAsync(UploadFileChunkInput input) + [Authorize] + public async virtual Task> GetShareListAsync() + { + if (!await FeatureChecker.IsEnabledAsync(AbpOssManagementFeatureNames.OssObject.AllowSharedFile)) { - await base.UploadAsync(input); + return new ListResultDto(); } - [Authorize] - public async virtual Task> GetShareListAsync() + var cacheKey = MyFileShareCacheItem.CalculateCacheKey(CurrentUser.GetId()); + var cacheItem = await _myShareCache.GetAsync(cacheKey); + if (cacheItem == null) { - if (!await FeatureChecker.IsEnabledAsync(AbpOssManagementFeatureNames.OssObject.AllowSharedFile)) - { - return new ListResultDto(); - } - - var cacheKey = MyFileShareCacheItem.CalculateCacheKey(CurrentUser.GetId()); - var cacheItem = await _myShareCache.GetAsync(cacheKey); - if (cacheItem == null) - { - return new ListResultDto(); - } - - // 被动刷新用户共享缓存 - // 手动调用时清除一下应该被清理掉的缓存 - cacheItem.Items.RemoveAll(items => items.MaxAccessCount > 0 && items.AccessCount > items.MaxAccessCount); - cacheItem.Items.RemoveAll(items => items.ExpirationTime < Clock.Now); - - DistributedCacheEntryOptions cacheOptions = null; - var myShareCacheExpirationTime = cacheItem.GetLastExpirationTime(); - if (myShareCacheExpirationTime.HasValue) - { - cacheOptions = new DistributedCacheEntryOptions - { - AbsoluteExpiration = DateTimeOffset.Now.Add( - Clock.Normalize(myShareCacheExpirationTime.Value) - Clock.Now), - }; - } - await _myShareCache.SetAsync(cacheKey, cacheItem, cacheOptions); - - return new ListResultDto( - ObjectMapper.Map, List>(cacheItem.Items)); + return new ListResultDto(); } - [Authorize] - public async virtual Task ShareAsync(FileShareInput input) - { - await FeatureChecker.CheckEnabledAsync(AbpOssManagementFeatureNames.OssObject.AllowSharedFile); + // 被动刷新用户共享缓存 + // 手动调用时清除一下应该被清理掉的缓存 + cacheItem.Items.RemoveAll(items => items.MaxAccessCount > 0 && items.AccessCount > items.MaxAccessCount); + cacheItem.Items.RemoveAll(items => items.ExpirationTime < Clock.Now); - var ossObjectRequest = new GetOssObjectRequest( - GetCurrentBucket(), - // 需要处理特殊字符 - HttpUtility.UrlDecode(input.Name), - GetCurrentPath(HttpUtility.UrlDecode(input.Path))) - { - MD5 = true, - }; - var ossContainer = OssContainerFactory.Create(); - var ossObject = await ossContainer.GetObjectAsync(ossObjectRequest); - - var shareUrl = $"{GuidGenerator.Create():N}.{FileHelper.GetExtension(ossObject.Name)}"; - var cacheItem = new FileShareCacheItem( - CurrentUser.GetId(), - GetCurrentBucket(), - ossObject.Name, - ossObject.Prefix, - ossObject.MD5, - shareUrl, - input.ExpirationTime ?? Clock.Now.AddDays(7), - input.Roles, - input.Users, - input.MaxAccessCount); - - var cacheOptions = new DistributedCacheEntryOptions + DistributedCacheEntryOptions cacheOptions = null; + var myShareCacheExpirationTime = cacheItem.GetLastExpirationTime(); + if (myShareCacheExpirationTime.HasValue) + { + cacheOptions = new DistributedCacheEntryOptions { - // 不传递过期时间, 默认7天 AbsoluteExpiration = DateTimeOffset.Now.Add( - Clock.Normalize(cacheItem.ExpirationTime) - Clock.Now), + Clock.Normalize(myShareCacheExpirationTime.Value) - Clock.Now), }; + } + await _myShareCache.SetAsync(cacheKey, cacheItem, cacheOptions); - await _shareCache.SetAsync( - FileShareCacheItem.CalculateCacheKey(shareUrl), - cacheItem, - cacheOptions); - - #region 当前用户共享缓存 - - // 被动刷新用户共享缓存 - var myShareCacheKey = MyFileShareCacheItem.CalculateCacheKey(CurrentUser.GetId()); - var myShareCacheItem = await _myShareCache.GetAsync(myShareCacheKey); - if (myShareCacheItem == null) - { - myShareCacheItem = new MyFileShareCacheItem( - new List() { cacheItem }); - } - else - { - myShareCacheItem.Items.Add(cacheItem); - } - DistributedCacheEntryOptions myShareCacheOptions = null; - var myShareCacheExpirationTime = myShareCacheItem.GetLastExpirationTime(); - if (myShareCacheExpirationTime.HasValue) - { - myShareCacheOptions = new DistributedCacheEntryOptions - { - AbsoluteExpiration = DateTimeOffset.Now.Add( - Clock.Normalize(myShareCacheExpirationTime.Value) - Clock.Now), - }; - } - await _myShareCache.SetAsync(myShareCacheKey, myShareCacheItem, myShareCacheOptions); + return new ListResultDto( + ObjectMapper.Map, List>(cacheItem.Items)); + } - #endregion + [Authorize] + public async virtual Task ShareAsync(FileShareInput input) + { + await FeatureChecker.CheckEnabledAsync(AbpOssManagementFeatureNames.OssObject.AllowSharedFile); - return new FileShareDto + var ossObjectRequest = new GetOssObjectRequest( + GetCurrentBucket(), + // 需要处理特殊字符 + HttpUtility.UrlDecode(input.Name), + GetCurrentPath(HttpUtility.UrlDecode(input.Path))) + { + MD5 = true, + }; + var ossContainer = OssContainerFactory.Create(); + var ossObject = await ossContainer.GetObjectAsync(ossObjectRequest); + + var shareUrl = $"{GuidGenerator.Create():N}.{FileHelper.GetExtension(ossObject.Name)}"; + var cacheItem = new FileShareCacheItem( + CurrentUser.GetId(), + GetCurrentBucket(), + ossObject.Name, + ossObject.Prefix, + ossObject.MD5, + shareUrl, + input.ExpirationTime ?? Clock.Now.AddDays(7), + input.Roles, + input.Users, + input.MaxAccessCount); + + var cacheOptions = new DistributedCacheEntryOptions + { + // 不传递过期时间, 默认7天 + AbsoluteExpiration = DateTimeOffset.Now.Add( + Clock.Normalize(cacheItem.ExpirationTime) - Clock.Now), + }; + + await _shareCache.SetAsync( + FileShareCacheItem.CalculateCacheKey(shareUrl), + cacheItem, + cacheOptions); + + #region 当前用户共享缓存 + + // 被动刷新用户共享缓存 + var myShareCacheKey = MyFileShareCacheItem.CalculateCacheKey(CurrentUser.GetId()); + var myShareCacheItem = await _myShareCache.GetAsync(myShareCacheKey); + if (myShareCacheItem == null) + { + myShareCacheItem = new MyFileShareCacheItem( + new List() { cacheItem }); + } + else + { + myShareCacheItem.Items.Add(cacheItem); + } + DistributedCacheEntryOptions myShareCacheOptions = null; + var myShareCacheExpirationTime = myShareCacheItem.GetLastExpirationTime(); + if (myShareCacheExpirationTime.HasValue) + { + myShareCacheOptions = new DistributedCacheEntryOptions { - Url = shareUrl, - MaxAccessCount = input.MaxAccessCount, - ExpirationTime = input.ExpirationTime, + AbsoluteExpiration = DateTimeOffset.Now.Add( + Clock.Normalize(myShareCacheExpirationTime.Value) - Clock.Now), }; } + await _myShareCache.SetAsync(myShareCacheKey, myShareCacheItem, myShareCacheOptions); - [Authorize] - public override async Task DeleteAsync(GetPublicFileInput input) - { - await base.DeleteAsync(input); - } + #endregion - protected override string GetCurrentBucket() + return new FileShareDto { - return "users"; - } + Url = shareUrl, + MaxAccessCount = input.MaxAccessCount, + ExpirationTime = input.ExpirationTime, + }; + } + + [Authorize] + public override async Task DeleteAsync(GetPublicFileInput input) + { + await base.DeleteAsync(input); + } + + protected override string GetCurrentBucket() + { + return "users"; + } - protected override string GetCurrentPath(string path) + protected override string GetCurrentPath(string path) + { + path = base.GetCurrentPath(path); + var userId = CurrentUser.GetId().ToString("N"); + if (path.IsNullOrWhiteSpace()) { - path = base.GetCurrentPath(path); - var userId = CurrentUser.GetId().ToString("N"); - if (path.IsNullOrWhiteSpace()) - { - return userId; - } - return path.StartsWith(userId) ? path : $"{userId}/{path}"; + return userId; } + return path.StartsWith(userId) ? path : $"{userId}/{path}"; } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/PublicFileAppService.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/PublicFileAppService.cs index adea081ad..1d446c1fe 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/PublicFileAppService.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/PublicFileAppService.cs @@ -7,80 +7,79 @@ using Volo.Abp.Content; using Volo.Abp.Features; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +[AllowAnonymous] +public class PublicFileAppService : FileAppServiceBase, IPublicFileAppService { - [AllowAnonymous] - public class PublicFileAppService : FileAppServiceBase, IPublicFileAppService + public PublicFileAppService( + IFileUploader fileUploader, + IFileValidater fileValidater, + IOssContainerFactory ossContainerFactory) + : base(fileUploader, fileValidater, ossContainerFactory) { - public PublicFileAppService( - IFileUploader fileUploader, - IFileValidater fileValidater, - IOssContainerFactory ossContainerFactory) - : base(fileUploader, fileValidater, ossContainerFactory) - { - } + } - [Authorize(AbpOssManagementPermissions.OssObject.Delete)] - public override async Task DeleteAsync(GetPublicFileInput input) - { - await CheckPublicAccessAsync(); + [Authorize(AbpOssManagementPermissions.OssObject.Delete)] + public override async Task DeleteAsync(GetPublicFileInput input) + { + await CheckPublicAccessAsync(); - await base.DeleteAsync(input); - } + await base.DeleteAsync(input); + } - public override async Task UploadAsync(UploadFileChunkInput input) - { - await CheckPublicAccessAsync(); - await FeatureChecker.CheckEnabledAsync(AbpOssManagementFeatureNames.OssObject.UploadFile); + public override async Task UploadAsync(UploadFileChunkInput input) + { + await CheckPublicAccessAsync(); + await FeatureChecker.CheckEnabledAsync(AbpOssManagementFeatureNames.OssObject.UploadFile); - await base.UploadAsync(input); - } + await base.UploadAsync(input); + } - [RequiresLimitFeature( - AbpOssManagementFeatureNames.OssObject.UploadLimit, - AbpOssManagementFeatureNames.OssObject.UploadInterval, - LimitPolicy.Month)] - public override async Task UploadAsync(UploadFileInput input) - { - await CheckPublicAccessAsync(); - await FeatureChecker.CheckEnabledAsync(AbpOssManagementFeatureNames.OssObject.UploadFile); + [RequiresLimitFeature( + AbpOssManagementFeatureNames.OssObject.UploadLimit, + AbpOssManagementFeatureNames.OssObject.UploadInterval, + LimitPolicy.Month)] + public override async Task UploadAsync(UploadFileInput input) + { + await CheckPublicAccessAsync(); + await FeatureChecker.CheckEnabledAsync(AbpOssManagementFeatureNames.OssObject.UploadFile); - // 公共目录不允许覆盖 - input.Overwrite = false; + // 公共目录不允许覆盖 + input.Overwrite = false; - return await base.UploadAsync(input); - } + return await base.UploadAsync(input); + } - public override async Task> GetListAsync(GetFilesInput input) - { - await CheckPublicAccessAsync(); + public override async Task> GetListAsync(GetFilesInput input) + { + await CheckPublicAccessAsync(); - return await base.GetListAsync(input); - } + return await base.GetListAsync(input); + } - [RequiresLimitFeature( - AbpOssManagementFeatureNames.OssObject.DownloadLimit, - AbpOssManagementFeatureNames.OssObject.DownloadInterval, - LimitPolicy.Month)] - public override async Task GetAsync(GetPublicFileInput input) - { - await CheckPublicAccessAsync(); - await FeatureChecker.CheckEnabledAsync(AbpOssManagementFeatureNames.OssObject.DownloadFile); + [RequiresLimitFeature( + AbpOssManagementFeatureNames.OssObject.DownloadLimit, + AbpOssManagementFeatureNames.OssObject.DownloadInterval, + LimitPolicy.Month)] + public override async Task GetAsync(GetPublicFileInput input) + { + await CheckPublicAccessAsync(); + await FeatureChecker.CheckEnabledAsync(AbpOssManagementFeatureNames.OssObject.DownloadFile); - return await base.GetAsync(input); - } + return await base.GetAsync(input); + } - protected override string GetCurrentBucket() - { - return "public"; - } + protected override string GetCurrentBucket() + { + return "public"; + } - protected async virtual Task CheckPublicAccessAsync() + protected async virtual Task CheckPublicAccessAsync() + { + if (!CurrentUser.IsAuthenticated) { - if (!CurrentUser.IsAuthenticated) - { - await FeatureChecker.CheckEnabledAsync(AbpOssManagementFeatureNames.PublicAccess); - } + await FeatureChecker.CheckEnabledAsync(AbpOssManagementFeatureNames.PublicAccess); } } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/ShareFileAppService.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/ShareFileAppService.cs index 7c36405c8..09179c8eb 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/ShareFileAppService.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/ShareFileAppService.cs @@ -8,120 +8,119 @@ using Volo.Abp.Content; using Volo.Abp.Http; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public class ShareFileAppService : OssManagementApplicationServiceBase, IShareFileAppService { - public class ShareFileAppService : OssManagementApplicationServiceBase, IShareFileAppService + private readonly IDistributedCache _shareCache; + private readonly IDistributedCache _myShareCache; + private readonly IOssContainerFactory _ossContainerFactory; + + public ShareFileAppService( + IDistributedCache shareCache, + IDistributedCache myShareCache, + IOssContainerFactory ossContainerFactory) { - private readonly IDistributedCache _shareCache; - private readonly IDistributedCache _myShareCache; - private readonly IOssContainerFactory _ossContainerFactory; - - public ShareFileAppService( - IDistributedCache shareCache, - IDistributedCache myShareCache, - IOssContainerFactory ossContainerFactory) + _shareCache = shareCache; + _myShareCache = myShareCache; + _ossContainerFactory = ossContainerFactory; + } + + public async virtual Task GetAsync(string url) + { + if (!await FeatureChecker.IsEnabledAsync(AbpOssManagementFeatureNames.OssObject.AllowSharedFile)) { - _shareCache = shareCache; - _myShareCache = myShareCache; - _ossContainerFactory = ossContainerFactory; + return new RemoteStreamContent(Stream.Null); } - - public async virtual Task GetAsync(string url) + var cacheKey = FileShareCacheItem.CalculateCacheKey(url); + var cacheItem = await _shareCache.GetAsync(cacheKey); + if (cacheItem == null) { - if (!await FeatureChecker.IsEnabledAsync(AbpOssManagementFeatureNames.OssObject.AllowSharedFile)) - { - return new RemoteStreamContent(Stream.Null); - } - var cacheKey = FileShareCacheItem.CalculateCacheKey(url); - var cacheItem = await _shareCache.GetAsync(cacheKey); - if (cacheItem == null) - { - return new RemoteStreamContent(Stream.Null); - } + return new RemoteStreamContent(Stream.Null); + } - // 最大访问次数 - cacheItem.AccessCount += 1; + // 最大访问次数 + cacheItem.AccessCount += 1; - // 被动刷新用户共享缓存 - await RefreshUserShareAsync(cacheItem); + // 被动刷新用户共享缓存 + await RefreshUserShareAsync(cacheItem); - if (cacheItem.MaxAccessCount > 0 && cacheItem.AccessCount > cacheItem.MaxAccessCount) - { - await _shareCache.RemoveAsync(cacheKey); + if (cacheItem.MaxAccessCount > 0 && cacheItem.AccessCount > cacheItem.MaxAccessCount) + { + await _shareCache.RemoveAsync(cacheKey); - return new RemoteStreamContent(Stream.Null); - } + return new RemoteStreamContent(Stream.Null); + } - // 共享用户 - if (cacheItem.Users != null && cacheItem.Users.Any()) + // 共享用户 + if (cacheItem.Users != null && cacheItem.Users.Any()) + { + if (cacheItem.Users.Any((userName) => !userName.Equals(CurrentUser.UserName))) { - if (cacheItem.Users.Any((userName) => !userName.Equals(CurrentUser.UserName))) - { - return new RemoteStreamContent(Stream.Null); - } + return new RemoteStreamContent(Stream.Null); } + } - // 共享角色 - if (cacheItem.Roles != null && cacheItem.Roles.Any()) + // 共享角色 + if (cacheItem.Roles != null && cacheItem.Roles.Any()) + { + if (cacheItem.Roles.Any((role) => !CurrentUser.Roles.Contains(role))) { - if (cacheItem.Roles.Any((role) => !CurrentUser.Roles.Contains(role))) - { - return new RemoteStreamContent(Stream.Null); - } + return new RemoteStreamContent(Stream.Null); } + } - var ossObjectRequest = new GetOssObjectRequest( - cacheItem.Bucket, - cacheItem.Name, - cacheItem.Path) - { - MD5 = true, - }; + var ossObjectRequest = new GetOssObjectRequest( + cacheItem.Bucket, + cacheItem.Name, + cacheItem.Path) + { + MD5 = true, + }; - var ossContainer = _ossContainerFactory.Create(); - var ossObject = await ossContainer.GetObjectAsync(ossObjectRequest); + var ossContainer = _ossContainerFactory.Create(); + var ossObject = await ossContainer.GetObjectAsync(ossObjectRequest); - var cacheOptions = new DistributedCacheEntryOptions - { - // 不传递过期时间, 默认7天 - AbsoluteExpiration = DateTimeOffset.Now.Add( - Clock.Normalize(cacheItem.ExpirationTime) - Clock.Now), - }; - // 改变共享次数 - await _shareCache.SetAsync( - cacheKey, - cacheItem, - cacheOptions); - - return new RemoteStreamContent(ossObject.Content, ossObject.Name, MimeTypes.GetByExtension(ossObject.Name), ossObject.Size); - } + var cacheOptions = new DistributedCacheEntryOptions + { + // 不传递过期时间, 默认7天 + AbsoluteExpiration = DateTimeOffset.Now.Add( + Clock.Normalize(cacheItem.ExpirationTime) - Clock.Now), + }; + // 改变共享次数 + await _shareCache.SetAsync( + cacheKey, + cacheItem, + cacheOptions); + + return new RemoteStreamContent(ossObject.Content, ossObject.Name, MimeTypes.GetByExtension(ossObject.Name), ossObject.Size); + } - protected async virtual Task RefreshUserShareAsync(FileShareCacheItem shareCacheItem) + protected async virtual Task RefreshUserShareAsync(FileShareCacheItem shareCacheItem) + { + // 清除当前用户共享缓存 + var myShareCacheKey = MyFileShareCacheItem.CalculateCacheKey(shareCacheItem.UserId); + var myShareCacheItem = await _myShareCache.GetAsync(myShareCacheKey); + if (myShareCacheItem != null) { - // 清除当前用户共享缓存 - var myShareCacheKey = MyFileShareCacheItem.CalculateCacheKey(shareCacheItem.UserId); - var myShareCacheItem = await _myShareCache.GetAsync(myShareCacheKey); - if (myShareCacheItem != null) + myShareCacheItem.Items.RemoveAll(item => item.Url.Equals(shareCacheItem.Url)); + if (shareCacheItem.MaxAccessCount == 0 || shareCacheItem.AccessCount < shareCacheItem.MaxAccessCount) { - myShareCacheItem.Items.RemoveAll(item => item.Url.Equals(shareCacheItem.Url)); - if (shareCacheItem.MaxAccessCount == 0 || shareCacheItem.AccessCount < shareCacheItem.MaxAccessCount) - { - myShareCacheItem.Items.Add(shareCacheItem); - } + myShareCacheItem.Items.Add(shareCacheItem); + } - DistributedCacheEntryOptions myShareCacheOptions = null; - var myShareCacheExpirationTime = myShareCacheItem.GetLastExpirationTime(); - if (myShareCacheExpirationTime.HasValue) + DistributedCacheEntryOptions myShareCacheOptions = null; + var myShareCacheExpirationTime = myShareCacheItem.GetLastExpirationTime(); + if (myShareCacheExpirationTime.HasValue) + { + myShareCacheOptions = new DistributedCacheEntryOptions { - myShareCacheOptions = new DistributedCacheEntryOptions - { - AbsoluteExpiration = DateTimeOffset.Now.Add( - Clock.Normalize(myShareCacheExpirationTime.Value) - Clock.Now), - }; - } - - await _myShareCache.SetAsync(myShareCacheKey, myShareCacheItem, myShareCacheOptions); + AbsoluteExpiration = DateTimeOffset.Now.Add( + Clock.Normalize(myShareCacheExpirationTime.Value) - Clock.Now), + }; } + + await _myShareCache.SetAsync(myShareCacheKey, myShareCacheItem, myShareCacheOptions); } } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/StaticFilesAppService.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/StaticFilesAppService.cs index ca1b72353..564235bd1 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/StaticFilesAppService.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/StaticFilesAppService.cs @@ -5,38 +5,37 @@ using Volo.Abp.Content; using Volo.Abp.Features; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public class StaticFilesAppService : OssManagementApplicationServiceBase, IStaticFilesAppService { - public class StaticFilesAppService : OssManagementApplicationServiceBase, IStaticFilesAppService - { - protected IOssContainerFactory OssContainerFactory { get; } + protected IOssContainerFactory OssContainerFactory { get; } - public StaticFilesAppService( - IOssContainerFactory ossContainerFactory) - { - OssContainerFactory = ossContainerFactory; - } + public StaticFilesAppService( + IOssContainerFactory ossContainerFactory) + { + OssContainerFactory = ossContainerFactory; + } - [RequiresFeature(AbpOssManagementFeatureNames.OssObject.DownloadFile)] - [RequiresLimitFeature( - AbpOssManagementFeatureNames.OssObject.DownloadLimit, - AbpOssManagementFeatureNames.OssObject.DownloadInterval, - LimitPolicy.Month)] - public async virtual Task GetAsync(GetStaticFileInput input) + [RequiresFeature(AbpOssManagementFeatureNames.OssObject.DownloadFile)] + [RequiresLimitFeature( + AbpOssManagementFeatureNames.OssObject.DownloadLimit, + AbpOssManagementFeatureNames.OssObject.DownloadInterval, + LimitPolicy.Month)] + public async virtual Task GetAsync(GetStaticFileInput input) + { + var ossObjectRequest = new GetOssObjectRequest( + HttpUtility.UrlDecode(input.Bucket), // 需要处理特殊字符 + HttpUtility.UrlDecode(input.Name), + HttpUtility.UrlDecode(input.Path), + HttpUtility.UrlDecode(input.Process)) { - var ossObjectRequest = new GetOssObjectRequest( - HttpUtility.UrlDecode(input.Bucket), // 需要处理特殊字符 - HttpUtility.UrlDecode(input.Name), - HttpUtility.UrlDecode(input.Path), - HttpUtility.UrlDecode(input.Process)) - { - MD5 = true, - }; + MD5 = true, + }; - var ossContainer = OssContainerFactory.Create(); - var ossObject = await ossContainer.GetObjectAsync(ossObjectRequest); + var ossContainer = OssContainerFactory.Create(); + var ossObject = await ossContainer.GetObjectAsync(ossObjectRequest); - return new RemoteStreamContent(ossObject.Content, ossObject.Name); - } + return new RemoteStreamContent(ossObject.Content, ossObject.Name); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN.Abp.OssManagement.Domain.Shared.csproj b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN.Abp.OssManagement.Domain.Shared.csproj index df88d2c4c..0e61036a0 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN.Abp.OssManagement.Domain.Shared.csproj +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN.Abp.OssManagement.Domain.Shared.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.OssManagement.Domain.Shared + LINGYUN.Abp.OssManagement.Domain.Shared + false + false + false diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN/Abp/OssManagement/AbpOssManagementDomainSharedModule.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN/Abp/OssManagement/AbpOssManagementDomainSharedModule.cs index ec260106f..6f6930b7d 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN/Abp/OssManagement/AbpOssManagementDomainSharedModule.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN/Abp/OssManagement/AbpOssManagementDomainSharedModule.cs @@ -6,31 +6,30 @@ using Volo.Abp.Validation; using Volo.Abp.VirtualFileSystem; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +[DependsOn( + typeof(AbpFeaturesModule), + typeof(AbpValidationModule))] +public class AbpOssManagementDomainSharedModule : AbpModule { - [DependsOn( - typeof(AbpFeaturesModule), - typeof(AbpValidationModule))] - public class AbpOssManagementDomainSharedModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + Configure(options => { - Configure(options => - { - options.FileSets.AddEmbedded(); - }); + options.FileSets.AddEmbedded(); + }); - Configure(options => - { - options.Resources - .Add("en") - .AddVirtualJson("/LINGYUN/Abp/OssManagement/Localization/Resources"); - }); + Configure(options => + { + options.Resources + .Add("en") + .AddVirtualJson("/LINGYUN/Abp/OssManagement/Localization/Resources"); + }); - Configure(options => - { - options.MapCodeNamespace(OssManagementErrorCodes.Namespace, typeof(AbpOssManagementResource)); - }); - } + Configure(options => + { + options.MapCodeNamespace(OssManagementErrorCodes.Namespace, typeof(AbpOssManagementResource)); + }); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN/Abp/OssManagement/Features/AbpOssManagementFeatureDefinitionProvider.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN/Abp/OssManagement/Features/AbpOssManagementFeatureDefinitionProvider.cs index 1978e23c2..1dc21ed43 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN/Abp/OssManagement/Features/AbpOssManagementFeatureDefinitionProvider.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN/Abp/OssManagement/Features/AbpOssManagementFeatureDefinitionProvider.cs @@ -3,86 +3,85 @@ using Volo.Abp.Localization; using Volo.Abp.Validation.StringValues; -namespace LINGYUN.Abp.OssManagement.Features +namespace LINGYUN.Abp.OssManagement.Features; + +public class AbpOssManagementFeatureDefinitionProvider : FeatureDefinitionProvider { - public class AbpOssManagementFeatureDefinitionProvider : FeatureDefinitionProvider + public override void Define(IFeatureDefinitionContext context) { - public override void Define(IFeatureDefinitionContext context) - { - var featureGroup = context.AddGroup( - name: AbpOssManagementFeatureNames.GroupName, - displayName: L("Features:OssManagement")); + var featureGroup = context.AddGroup( + name: AbpOssManagementFeatureNames.GroupName, + displayName: L("Features:OssManagement")); - featureGroup.AddFeature( - name: AbpOssManagementFeatureNames.PublicAccess, - defaultValue: false.ToString(), - displayName: L("Features:DisplayName:PublicAccess"), - description: L("Features:Description:PublicAccess"), - valueType: new ToggleStringValueType(new BooleanValueValidator())); + featureGroup.AddFeature( + name: AbpOssManagementFeatureNames.PublicAccess, + defaultValue: false.ToString(), + displayName: L("Features:DisplayName:PublicAccess"), + description: L("Features:Description:PublicAccess"), + valueType: new ToggleStringValueType(new BooleanValueValidator())); - var ossDefaultFeature = featureGroup.AddFeature( - name: AbpOssManagementFeatureNames.OssObject.Enable, - defaultValue: true.ToString(), - displayName: L("Features:DisplayName:OssObject"), - description: L("Features:Description:OssObject"), - valueType: new ToggleStringValueType(new BooleanValueValidator())); + var ossDefaultFeature = featureGroup.AddFeature( + name: AbpOssManagementFeatureNames.OssObject.Enable, + defaultValue: true.ToString(), + displayName: L("Features:DisplayName:OssObject"), + description: L("Features:Description:OssObject"), + valueType: new ToggleStringValueType(new BooleanValueValidator())); - ossDefaultFeature.CreateChild( - name: AbpOssManagementFeatureNames.OssObject.AllowSharedFile, - defaultValue: false.ToString(), - displayName: L("Features:DisplayName:AllowSharedFile"), - description: L("Features:Description:AllowSharedFile"), - valueType: new ToggleStringValueType(new BooleanValueValidator())); - ossDefaultFeature.CreateChild( - name: AbpOssManagementFeatureNames.OssObject.DownloadFile, - defaultValue: false.ToString(), - displayName: L("Features:DisplayName:DownloadFile"), - description: L("Features:Description:DownloadFile"), - valueType: new ToggleStringValueType(new BooleanValueValidator())); - ossDefaultFeature.CreateChild( - name: AbpOssManagementFeatureNames.OssObject.DownloadLimit, - defaultValue: "1000", - displayName: L("Features:DisplayName:DownloadLimit"), - description: L("Features:Description:DownloadLimit"), - valueType: new FreeTextStringValueType(new NumericValueValidator(0, 100_0000))); // 上限100万次调用 - ossDefaultFeature.CreateChild( - name: AbpOssManagementFeatureNames.OssObject.DownloadInterval, - defaultValue: "1", - displayName: L("Features:DisplayName:DownloadInterval"), - description: L("Features:Description:DownloadInterval"), - valueType: new FreeTextStringValueType(new NumericValueValidator(1, 12))); // 上限12月 + ossDefaultFeature.CreateChild( + name: AbpOssManagementFeatureNames.OssObject.AllowSharedFile, + defaultValue: false.ToString(), + displayName: L("Features:DisplayName:AllowSharedFile"), + description: L("Features:Description:AllowSharedFile"), + valueType: new ToggleStringValueType(new BooleanValueValidator())); + ossDefaultFeature.CreateChild( + name: AbpOssManagementFeatureNames.OssObject.DownloadFile, + defaultValue: false.ToString(), + displayName: L("Features:DisplayName:DownloadFile"), + description: L("Features:Description:DownloadFile"), + valueType: new ToggleStringValueType(new BooleanValueValidator())); + ossDefaultFeature.CreateChild( + name: AbpOssManagementFeatureNames.OssObject.DownloadLimit, + defaultValue: "1000", + displayName: L("Features:DisplayName:DownloadLimit"), + description: L("Features:Description:DownloadLimit"), + valueType: new FreeTextStringValueType(new NumericValueValidator(0, 100_0000))); // 上限100万次调用 + ossDefaultFeature.CreateChild( + name: AbpOssManagementFeatureNames.OssObject.DownloadInterval, + defaultValue: "1", + displayName: L("Features:DisplayName:DownloadInterval"), + description: L("Features:Description:DownloadInterval"), + valueType: new FreeTextStringValueType(new NumericValueValidator(1, 12))); // 上限12月 - ossDefaultFeature.CreateChild( - name: AbpOssManagementFeatureNames.OssObject.UploadFile, - defaultValue: true.ToString(), - displayName: L("Features:DisplayName:UploadFile"), - description: L("Features:Description:UploadFile"), - valueType: new ToggleStringValueType(new BooleanValueValidator())); - ossDefaultFeature.CreateChild( - name: AbpOssManagementFeatureNames.OssObject.UploadLimit, - defaultValue: "1000", - displayName: L("Features:DisplayName:UploadLimit"), - description: L("Features:Description:UploadLimit"), - valueType: new FreeTextStringValueType(new NumericValueValidator(0, 100_0000))); // 上限100万次调用 - ossDefaultFeature.CreateChild( - name: AbpOssManagementFeatureNames.OssObject.UploadInterval, - defaultValue: "1", - displayName: L("Features:DisplayName:UploadInterval"), - description: L("Features:Description:UploadInterval"), - valueType: new FreeTextStringValueType(new NumericValueValidator(1, 12))); // 上限12月 + ossDefaultFeature.CreateChild( + name: AbpOssManagementFeatureNames.OssObject.UploadFile, + defaultValue: true.ToString(), + displayName: L("Features:DisplayName:UploadFile"), + description: L("Features:Description:UploadFile"), + valueType: new ToggleStringValueType(new BooleanValueValidator())); + ossDefaultFeature.CreateChild( + name: AbpOssManagementFeatureNames.OssObject.UploadLimit, + defaultValue: "1000", + displayName: L("Features:DisplayName:UploadLimit"), + description: L("Features:Description:UploadLimit"), + valueType: new FreeTextStringValueType(new NumericValueValidator(0, 100_0000))); // 上限100万次调用 + ossDefaultFeature.CreateChild( + name: AbpOssManagementFeatureNames.OssObject.UploadInterval, + defaultValue: "1", + displayName: L("Features:DisplayName:UploadInterval"), + description: L("Features:Description:UploadInterval"), + valueType: new FreeTextStringValueType(new NumericValueValidator(1, 12))); // 上限12月 - // TODO: 此功能需要控制器协同,暂时不实现 - //fileSystemFeature.CreateChild( - // name: AbpOssManagementFeatureNames.OssObject.MaxUploadFileCount, - // defaultValue: 1.ToString(), - // displayName: L("Features:DisplayName:MaxUploadFileCount"), - // description: L("Features:Description:MaxUploadFileCount"), - // valueType: new FreeTextStringValueType(new NumericValueValidator(1, 10))); - } + // TODO: 此功能需要控制器协同,暂时不实现 + //fileSystemFeature.CreateChild( + // name: AbpOssManagementFeatureNames.OssObject.MaxUploadFileCount, + // defaultValue: 1.ToString(), + // displayName: L("Features:DisplayName:MaxUploadFileCount"), + // description: L("Features:Description:MaxUploadFileCount"), + // valueType: new FreeTextStringValueType(new NumericValueValidator(1, 10))); + } - protected ILocalizableString L(string name) - { - return LocalizableString.Create(name); - } + protected ILocalizableString L(string name) + { + return LocalizableString.Create(name); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN/Abp/OssManagement/Features/AbpOssManagementFeatureNames.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN/Abp/OssManagement/Features/AbpOssManagementFeatureNames.cs index cd7bf88e8..012f1e4a1 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN/Abp/OssManagement/Features/AbpOssManagementFeatureNames.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN/Abp/OssManagement/Features/AbpOssManagementFeatureNames.cs @@ -1,50 +1,49 @@ -namespace LINGYUN.Abp.OssManagement.Features +namespace LINGYUN.Abp.OssManagement.Features; + +public class AbpOssManagementFeatureNames { - public class AbpOssManagementFeatureNames + public const string GroupName = "AbpOssManagement"; + /// + /// 是否允许未经授权的用户访问公共目录 + /// + public const string PublicAccess = GroupName + ".PublicAccess"; + + public class OssObject { - public const string GroupName = "AbpOssManagement"; + public const string Default = GroupName + ".OssObject"; + + public const string Enable = Default + ".Enable"; /// - /// 是否允许未经授权的用户访问公共目录 + /// 允许用户分享文件 /// - public const string PublicAccess = GroupName + ".PublicAccess"; - - public class OssObject - { - public const string Default = GroupName + ".OssObject"; - - public const string Enable = Default + ".Enable"; - /// - /// 允许用户分享文件 - /// - public const string AllowSharedFile = Default + ".AllowSharedFile"; - /// - /// 下载文件功能 - /// - public const string DownloadFile = Default + ".DownloadFile"; - /// - /// 下载文件功能限制次数 - /// - public const string DownloadLimit = Default + ".DownloadLimit"; - /// - /// 下载文件功能限制次数周期 - /// - public const string DownloadInterval = Default + ".DownloadInterval"; - /// - /// 上传文件功能 - /// - public const string UploadFile = Default + ".UploadFile"; - /// - /// 上传文件功能限制次数 - /// - public const string UploadLimit = Default + ".UploadLimit"; - /// - /// 上传文件功能限制次数周期 - /// - public const string UploadInterval = Default + ".UploadInterval"; - /// - /// 最大上传文件 - /// - public const string MaxUploadFileCount = Default + ".MaxUploadFileCount"; - } + public const string AllowSharedFile = Default + ".AllowSharedFile"; + /// + /// 下载文件功能 + /// + public const string DownloadFile = Default + ".DownloadFile"; + /// + /// 下载文件功能限制次数 + /// + public const string DownloadLimit = Default + ".DownloadLimit"; + /// + /// 下载文件功能限制次数周期 + /// + public const string DownloadInterval = Default + ".DownloadInterval"; + /// + /// 上传文件功能 + /// + public const string UploadFile = Default + ".UploadFile"; + /// + /// 上传文件功能限制次数 + /// + public const string UploadLimit = Default + ".UploadLimit"; + /// + /// 上传文件功能限制次数周期 + /// + public const string UploadInterval = Default + ".UploadInterval"; + /// + /// 最大上传文件 + /// + public const string MaxUploadFileCount = Default + ".MaxUploadFileCount"; } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN/Abp/OssManagement/Localization/AbpOssManagementResource.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN/Abp/OssManagement/Localization/AbpOssManagementResource.cs index fc4ddbeb7..72db7121c 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN/Abp/OssManagement/Localization/AbpOssManagementResource.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN/Abp/OssManagement/Localization/AbpOssManagementResource.cs @@ -1,9 +1,8 @@ using Volo.Abp.Localization; -namespace LINGYUN.Abp.OssManagement.Localization +namespace LINGYUN.Abp.OssManagement.Localization; + +[LocalizationResourceName("AbpOssManagement")] +public class AbpOssManagementResource { - [LocalizationResourceName("AbpOssManagement")] - public class AbpOssManagementResource - { - } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN/Abp/OssManagement/OssManagementErrorCodes.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN/Abp/OssManagement/OssManagementErrorCodes.cs index aa2915c8b..59f623618 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN/Abp/OssManagement/OssManagementErrorCodes.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN/Abp/OssManagement/OssManagementErrorCodes.cs @@ -1,18 +1,17 @@ -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public static class OssManagementErrorCodes { - public static class OssManagementErrorCodes - { - public const string Namespace = "Abp.OssManagement"; + public const string Namespace = "Abp.OssManagement"; - public const string ContainerDeleteWithStatic = Namespace + ":010000"; - public const string ContainerDeleteWithNotEmpty = Namespace + ":010001"; - public const string ContainerAlreadyExists = Namespace + ":010402"; - public const string ContainerNotFound = Namespace + ":010404"; + public const string ContainerDeleteWithStatic = Namespace + ":010000"; + public const string ContainerDeleteWithNotEmpty = Namespace + ":010001"; + public const string ContainerAlreadyExists = Namespace + ":010402"; + public const string ContainerNotFound = Namespace + ":010404"; - public const string ObjectDeleteWithNotEmpty = Namespace + ":020001"; - public const string ObjectAlreadyExists = Namespace + ":020402"; - public const string ObjectNotFound = Namespace + ":020404"; + public const string ObjectDeleteWithNotEmpty = Namespace + ":020001"; + public const string ObjectAlreadyExists = Namespace + ":020402"; + public const string ObjectNotFound = Namespace + ":020404"; - public const string OssNameHasTooLong = Namespace + ":000405"; - } + public const string OssNameHasTooLong = Namespace + ":000405"; } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN/Abp/OssManagement/Settings/AbpOssManagementSettingDefinitionProvider.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN/Abp/OssManagement/Settings/AbpOssManagementSettingDefinitionProvider.cs index 59c81ee68..a4e0f303a 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN/Abp/OssManagement/Settings/AbpOssManagementSettingDefinitionProvider.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN/Abp/OssManagement/Settings/AbpOssManagementSettingDefinitionProvider.cs @@ -2,47 +2,46 @@ using Volo.Abp.Localization; using Volo.Abp.Settings; -namespace LINGYUN.Abp.OssManagement.Settings +namespace LINGYUN.Abp.OssManagement.Settings; + +public class AbpOssManagementSettingDefinitionProvider : SettingDefinitionProvider { - public class AbpOssManagementSettingDefinitionProvider : SettingDefinitionProvider + public override void Define(ISettingDefinitionContext context) { - public override void Define(ISettingDefinitionContext context) - { - context.Add(CreateFileSystemSettings()); - } + context.Add(CreateFileSystemSettings()); + } - protected SettingDefinition[] CreateFileSystemSettings() + protected SettingDefinition[] CreateFileSystemSettings() + { + return new SettingDefinition[] { - return new SettingDefinition[] - { - new SettingDefinition( - name: AbpOssManagementSettingNames.FileLimitLength, - defaultValue: AbpOssManagementSettingNames.DefaultFileLimitLength.ToString(), - displayName: L("DisplayName:FileLimitLength"), - description: L("Description:FileLimitLength"), - isVisibleToClients: true) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName), - new SettingDefinition( - name: AbpOssManagementSettingNames.AllowFileExtensions, - defaultValue: AbpOssManagementSettingNames.DefaultAllowFileExtensions, - displayName: L("DisplayName:AllowFileExtensions"), - description: L("Description:AllowFileExtensions"), - isVisibleToClients: true) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName), - }; - } + new SettingDefinition( + name: AbpOssManagementSettingNames.FileLimitLength, + defaultValue: AbpOssManagementSettingNames.DefaultFileLimitLength.ToString(), + displayName: L("DisplayName:FileLimitLength"), + description: L("Description:FileLimitLength"), + isVisibleToClients: true) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName), + new SettingDefinition( + name: AbpOssManagementSettingNames.AllowFileExtensions, + defaultValue: AbpOssManagementSettingNames.DefaultAllowFileExtensions, + displayName: L("DisplayName:AllowFileExtensions"), + description: L("Description:AllowFileExtensions"), + isVisibleToClients: true) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName), + }; + } - protected LocalizableString L(string name) - { - return LocalizableString.Create(name); - } + protected LocalizableString L(string name) + { + return LocalizableString.Create(name); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN/Abp/OssManagement/Settings/AbpOssManagementSettingNames.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN/Abp/OssManagement/Settings/AbpOssManagementSettingNames.cs index 41f5332cc..4c90cff41 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN/Abp/OssManagement/Settings/AbpOssManagementSettingNames.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN/Abp/OssManagement/Settings/AbpOssManagementSettingNames.cs @@ -1,22 +1,21 @@ -namespace LINGYUN.Abp.OssManagement.Settings +namespace LINGYUN.Abp.OssManagement.Settings; + +public class AbpOssManagementSettingNames { - public class AbpOssManagementSettingNames - { - public const string GroupName = "Abp.OssManagement"; - /// - /// 下载分包大小 - /// - public const string DownloadPackageSize = GroupName + ".DownloadPackageSize"; - /// - /// 文件限制长度 - /// - public const string FileLimitLength = GroupName + ".FileLimitLength"; - /// - /// 允许的文件扩展名类型 - /// - public const string AllowFileExtensions = GroupName + ".AllowFileExtensions"; + public const string GroupName = "Abp.OssManagement"; + /// + /// 下载分包大小 + /// + public const string DownloadPackageSize = GroupName + ".DownloadPackageSize"; + /// + /// 文件限制长度 + /// + public const string FileLimitLength = GroupName + ".FileLimitLength"; + /// + /// 允许的文件扩展名类型 + /// + public const string AllowFileExtensions = GroupName + ".AllowFileExtensions"; - public const long DefaultFileLimitLength = 100L; - public const string DefaultAllowFileExtensions = "dll,zip,rar,txt,log,xml,config,json,jpeg,jpg,png,bmp,ico,xlsx,xltx,xls,xlt,docs,dots,doc,dot,pptx,potx,ppt,pot,chm"; - } + public const long DefaultFileLimitLength = 100L; + public const string DefaultAllowFileExtensions = "dll,zip,rar,txt,log,xml,config,json,jpeg,jpg,png,bmp,ico,xlsx,xltx,xls,xlt,docs,dots,doc,dot,pptx,potx,ppt,pot,chm"; } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/System/IO/StreamExtensions.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/System/IO/StreamExtensions.cs index 1e18d5ffd..a3a0f4fd8 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/System/IO/StreamExtensions.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/System/IO/StreamExtensions.cs @@ -1,12 +1,11 @@ -namespace System.IO +namespace System.IO; + +public static class StreamExtensions { - public static class StreamExtensions + public static bool IsNullOrEmpty( + this Stream stream) { - public static bool IsNullOrEmpty( - this Stream stream) - { - return stream == null || - Equals(stream, Stream.Null); - } + return stream == null || + Equals(stream, Stream.Null); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN.Abp.OssManagement.Domain.csproj b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN.Abp.OssManagement.Domain.csproj index 5eb951b80..716a686e7 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN.Abp.OssManagement.Domain.csproj +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN.Abp.OssManagement.Domain.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + net8.0 + LINGYUN.Abp.OssManagement.Domain + LINGYUN.Abp.OssManagement.Domain + false + false + false diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/AbpOssManagementContainer.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/AbpOssManagementContainer.cs index 44688e979..cf9c14891 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/AbpOssManagementContainer.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/AbpOssManagementContainer.cs @@ -1,9 +1,8 @@ using Volo.Abp.BlobStoring; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +[BlobContainerName("abp-oss-management")] +public class AbpOssManagementContainer { - [BlobContainerName("abp-oss-management")] - public class AbpOssManagementContainer - { - } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/AbpOssManagementDomainModule.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/AbpOssManagementDomainModule.cs index dfa4091f4..5e0f91dec 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/AbpOssManagementDomainModule.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/AbpOssManagementDomainModule.cs @@ -3,15 +3,14 @@ using Volo.Abp.Modularity; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +[DependsOn( + typeof(AbpOssManagementDomainSharedModule), + typeof(AbpDddDomainModule), + typeof(AbpMultiTenancyModule), + typeof(AbpFeaturesLimitValidationModule) + )] +public class AbpOssManagementDomainModule : AbpModule { - [DependsOn( - typeof(AbpOssManagementDomainSharedModule), - typeof(AbpDddDomainModule), - typeof(AbpMultiTenancyModule), - typeof(AbpFeaturesLimitValidationModule) - )] - public class AbpOssManagementDomainModule : AbpModule - { - } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/AbpOssManagementOptions.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/AbpOssManagementOptions.cs index c1f67c007..9978a8d4e 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/AbpOssManagementOptions.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/AbpOssManagementOptions.cs @@ -4,76 +4,75 @@ using Volo.Abp; using Volo.Abp.BackgroundWorkers; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public class AbpOssManagementOptions { - public class AbpOssManagementOptions - { - /// - /// 静态容器 - /// 不允许被删除 - /// - public List StaticBuckets { get; } - /// - /// Default value: true. - /// If is false, - /// this property is ignored and the cleanup worker doesn't work for this application instance. - /// - public bool IsCleanupEnabled { get; set; } - /// - /// Default: 3,600,000 ms. - /// - public int CleanupPeriod { get; set; } - /// - /// 禁用缓存目录清除作业 - /// default: false - /// - public bool DisableTempPruning { get; set; } - /// - /// 每批次清理数量 - /// default: 100 - /// - public int MaximumTempSize { get; set; } - /// - /// 最小缓存对象寿命 - /// default: 30 minutes - /// - public TimeSpan MinimumTempLifeSpan { get; set; } + /// + /// 静态容器 + /// 不允许被删除 + /// + public List StaticBuckets { get; } + /// + /// Default value: true. + /// If is false, + /// this property is ignored and the cleanup worker doesn't work for this application instance. + /// + public bool IsCleanupEnabled { get; set; } + /// + /// Default: 3,600,000 ms. + /// + public int CleanupPeriod { get; set; } + /// + /// 禁用缓存目录清除作业 + /// default: false + /// + public bool DisableTempPruning { get; set; } + /// + /// 每批次清理数量 + /// default: 100 + /// + public int MaximumTempSize { get; set; } + /// + /// 最小缓存对象寿命 + /// default: 30 minutes + /// + public TimeSpan MinimumTempLifeSpan { get; set; } - public AbpOssManagementOptions() + public AbpOssManagementOptions() + { + StaticBuckets = new List { - StaticBuckets = new List - { - // 公共目录 - "public", - // 用户私有目录 - "users", - // 系统目录 - "system", - // 工作流 - "workflow", - // 图标 - "icons", - // 缓存 - "temp" - }; + // 公共目录 + "public", + // 用户私有目录 + "users", + // 系统目录 + "system", + // 工作流 + "workflow", + // 图标 + "icons", + // 缓存 + "temp" + }; - IsCleanupEnabled = true; - CleanupPeriod = 3_600_000; - MaximumTempSize = 100; - DisableTempPruning = false; - MinimumTempLifeSpan = TimeSpan.FromMinutes(30); - } + IsCleanupEnabled = true; + CleanupPeriod = 3_600_000; + MaximumTempSize = 100; + DisableTempPruning = false; + MinimumTempLifeSpan = TimeSpan.FromMinutes(30); + } - public void AddStaticBucket(string bucket) - { - Check.NotNullOrWhiteSpace(bucket, nameof(bucket)); + public void AddStaticBucket(string bucket) + { + Check.NotNullOrWhiteSpace(bucket, nameof(bucket)); - StaticBuckets.AddIfNotContains(bucket); - } + StaticBuckets.AddIfNotContains(bucket); + } - public bool CheckStaticBucket(string bucket) - { - return StaticBuckets.Any(bck => bck.Equals(bucket)); - } + public bool CheckStaticBucket(string bucket) + { + return StaticBuckets.Any(bck => bck.Equals(bucket)); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/BulkDeleteObjectRequest.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/BulkDeleteObjectRequest.cs index 021a56674..092322fe0 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/BulkDeleteObjectRequest.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/BulkDeleteObjectRequest.cs @@ -2,25 +2,24 @@ using System.Collections.Generic; using Volo.Abp; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public class BulkDeleteObjectRequest { - public class BulkDeleteObjectRequest - { - public string Bucket { get; } - public string Path { get; } - public ICollection Objects { get; } + public string Bucket { get; } + public string Path { get; } + public ICollection Objects { get; } - public BulkDeleteObjectRequest( - [NotNull] string bucket, - ICollection objects, - string path = "") - { - Check.NotNullOrWhiteSpace(bucket, nameof(bucket)); - Check.NotNullOrEmpty(objects, nameof(objects)); + public BulkDeleteObjectRequest( + [NotNull] string bucket, + ICollection objects, + string path = "") + { + Check.NotNullOrWhiteSpace(bucket, nameof(bucket)); + Check.NotNullOrEmpty(objects, nameof(objects)); - Bucket = bucket; - Objects = objects; - Path = path; - } + Bucket = bucket; + Objects = objects; + Path = path; } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/CreateOssObjectRequest.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/CreateOssObjectRequest.cs index 2b2bc7796..99f2ff427 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/CreateOssObjectRequest.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/CreateOssObjectRequest.cs @@ -3,34 +3,33 @@ using System.IO; using Volo.Abp; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public class CreateOssObjectRequest { - public class CreateOssObjectRequest + public string Bucket { get; } + public string Path { get; } + public string Object { get; } + public bool Overwrite { get; set; } + public Stream Content { get; private set; } + public TimeSpan? ExpirationTime { get; } + public CreateOssObjectRequest( + [NotNull] string bucket, + [NotNull] string @object, + [CanBeNull] Stream content, + [CanBeNull] string path = null, + [CanBeNull] TimeSpan? expirationTime = null) { - public string Bucket { get; } - public string Path { get; } - public string Object { get; } - public bool Overwrite { get; set; } - public Stream Content { get; private set; } - public TimeSpan? ExpirationTime { get; } - public CreateOssObjectRequest( - [NotNull] string bucket, - [NotNull] string @object, - [CanBeNull] Stream content, - [CanBeNull] string path = null, - [CanBeNull] TimeSpan? expirationTime = null) - { - Bucket = Check.NotNullOrWhiteSpace(bucket, nameof(bucket)); - Object = Check.NotNullOrWhiteSpace(@object, nameof(@object)); + Bucket = Check.NotNullOrWhiteSpace(bucket, nameof(bucket)); + Object = Check.NotNullOrWhiteSpace(@object, nameof(@object)); - Path = path; - Content = content; - ExpirationTime = expirationTime; - } + Path = path; + Content = content; + ExpirationTime = expirationTime; + } - public void SetContent(Stream content) - { - Content = content; - } + public void SetContent(Stream content) + { + Content = content; } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/GetOssContainersRequest.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/GetOssContainersRequest.cs index b1c57fe09..1ad15c4b2 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/GetOssContainersRequest.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/GetOssContainersRequest.cs @@ -1,21 +1,20 @@ -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public class GetOssContainersRequest { - public class GetOssContainersRequest + public string Prefix { get; } + public string Marker { get; } + public int Current { get; } + public int? MaxKeys { get; } + public GetOssContainersRequest( + string prefix = null, + string marker = null, + int current = 0, + int? maxKeys = 10) { - public string Prefix { get; } - public string Marker { get; } - public int Current { get; } - public int? MaxKeys { get; } - public GetOssContainersRequest( - string prefix = null, - string marker = null, - int current = 0, - int? maxKeys = 10) - { - Prefix = prefix; - Marker = marker; - Current = current; - MaxKeys = maxKeys; - } + Prefix = prefix; + Marker = marker; + Current = current; + MaxKeys = maxKeys; } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/GetOssContainersResponse.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/GetOssContainersResponse.cs index 47a7ee28a..dac01b7a8 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/GetOssContainersResponse.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/GetOssContainersResponse.cs @@ -1,28 +1,27 @@ using System.Collections.Generic; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public class GetOssContainersResponse { - public class GetOssContainersResponse - { - public string Prefix { get; } - public string Marker { get; } - public string NextMarker { get; } - public int MaxKeys { get; } - public List Containers { get; } + public string Prefix { get; } + public string Marker { get; } + public string NextMarker { get; } + public int MaxKeys { get; } + public List Containers { get; } - public GetOssContainersResponse( - string prefix, - string marker, - string nextMarker, - int maxKeys, - List containers) - { - Prefix = prefix; - Marker = marker; - NextMarker = nextMarker; - MaxKeys = maxKeys; + public GetOssContainersResponse( + string prefix, + string marker, + string nextMarker, + int maxKeys, + List containers) + { + Prefix = prefix; + Marker = marker; + NextMarker = nextMarker; + MaxKeys = maxKeys; - Containers = containers; - } + Containers = containers; } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/GetOssObjectRequest.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/GetOssObjectRequest.cs index 741c18951..77f743b6e 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/GetOssObjectRequest.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/GetOssObjectRequest.cs @@ -1,34 +1,33 @@ using JetBrains.Annotations; using Volo.Abp; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public class GetOssObjectRequest { - public class GetOssObjectRequest - { - public string Bucket { get; } - public string Path { get; } - public string Object { get; } - public bool MD5 { get; set; } - /// - /// 需要处理文件的参数 - /// - public string Process { get; } + public string Bucket { get; } + public string Path { get; } + public string Object { get; } + public bool MD5 { get; set; } + /// + /// 需要处理文件的参数 + /// + public string Process { get; } - public bool CreatePathIsNotExists { get; set; } = false; + public bool CreatePathIsNotExists { get; set; } = false; - public GetOssObjectRequest( - [NotNull] string bucket, - [NotNull] string @object, - [CanBeNull] string path = "", - [CanBeNull] string process = "") - { - Check.NotNullOrWhiteSpace(bucket, nameof(bucket)); - Check.NotNullOrWhiteSpace(@object, nameof(@object)); + public GetOssObjectRequest( + [NotNull] string bucket, + [NotNull] string @object, + [CanBeNull] string path = "", + [CanBeNull] string process = "") + { + Check.NotNullOrWhiteSpace(bucket, nameof(bucket)); + Check.NotNullOrWhiteSpace(@object, nameof(@object)); - Bucket = bucket; - Object = @object; - Path = path; - Process = process; - } + Bucket = bucket; + Object = @object; + Path = path; + Process = process; } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/GetOssObjectsRequest.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/GetOssObjectsRequest.cs index fc05f2457..b392b858f 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/GetOssObjectsRequest.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/GetOssObjectsRequest.cs @@ -1,37 +1,36 @@ using JetBrains.Annotations; using Volo.Abp; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public class GetOssObjectsRequest { - public class GetOssObjectsRequest + public string BucketName { get; } + public string Prefix { get; } + public string Delimiter { get; } + public string Marker { get; } + public string EncodingType { get; } + public int Current { get; } + public int? MaxKeys { get; } + public bool MD5 { get; set; } + public bool CreatePathIsNotExists { get; set; } = false; + public GetOssObjectsRequest( + [NotNull] string bucketName, + string prefix = null, + string marker = null, + string delimiter = null, + string encodingType = null, + int current = 0, + int maxKeys = 10) { - public string BucketName { get; } - public string Prefix { get; } - public string Delimiter { get; } - public string Marker { get; } - public string EncodingType { get; } - public int Current { get; } - public int? MaxKeys { get; } - public bool MD5 { get; set; } - public bool CreatePathIsNotExists { get; set; } = false; - public GetOssObjectsRequest( - [NotNull] string bucketName, - string prefix = null, - string marker = null, - string delimiter = null, - string encodingType = null, - int current = 0, - int maxKeys = 10) - { - Check.NotNullOrWhiteSpace(bucketName, nameof(bucketName)); + Check.NotNullOrWhiteSpace(bucketName, nameof(bucketName)); - BucketName = bucketName; - Prefix = prefix; - Marker = marker; - Delimiter = delimiter; - EncodingType = encodingType; - Current = current; - MaxKeys = maxKeys; - } + BucketName = bucketName; + Prefix = prefix; + Marker = marker; + Delimiter = delimiter; + EncodingType = encodingType; + Current = current; + MaxKeys = maxKeys; } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/GetOssObjectsResponse.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/GetOssObjectsResponse.cs index 577413ca2..c5e398a20 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/GetOssObjectsResponse.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/GetOssObjectsResponse.cs @@ -1,33 +1,32 @@ using System.Collections.Generic; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public class GetOssObjectsResponse { - public class GetOssObjectsResponse + public string Bucket { get; } + public string Prefix { get; } + public string Delimiter { get; } + public string Marker { get; } + public string NextMarker { get; } + public int MaxKeys { get; } + public List Objects { get; } + public GetOssObjectsResponse( + string bucket, + string prefix, + string marker, + string nextMarker, + string delimiter, + int maxKeys, + List ossObjects) { - public string Bucket { get; } - public string Prefix { get; } - public string Delimiter { get; } - public string Marker { get; } - public string NextMarker { get; } - public int MaxKeys { get; } - public List Objects { get; } - public GetOssObjectsResponse( - string bucket, - string prefix, - string marker, - string nextMarker, - string delimiter, - int maxKeys, - List ossObjects) - { - Bucket = bucket; - Prefix = prefix; - Marker = marker; - NextMarker = nextMarker; - Delimiter = delimiter; - MaxKeys = maxKeys; + Bucket = bucket; + Prefix = prefix; + Marker = marker; + NextMarker = nextMarker; + Delimiter = delimiter; + MaxKeys = maxKeys; - Objects = ossObjects; - } + Objects = ossObjects; } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/IOssContainer.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/IOssContainer.cs index d752ab284..a3a2994bd 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/IOssContainer.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/IOssContainer.cs @@ -1,72 +1,71 @@ using System.Threading.Tasks; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +/// +/// Oss容器 +/// +public interface IOssContainer { /// - /// Oss容器 + /// 创建容器 + /// + /// + /// + Task CreateAsync(string name); + /// + /// 创建Oss对象 + /// + /// + /// + Task CreateObjectAsync(CreateOssObjectRequest request); + /// + /// 获取容器信息 + /// + /// + /// + Task GetAsync(string name); + /// + /// 获取Oss对象信息 + /// + /// + /// + Task GetObjectAsync(GetOssObjectRequest request); + /// + /// 删除容器 + /// + /// + /// + Task DeleteAsync(string name); + /// + /// 删除Oss对象 + /// + /// + /// + Task DeleteObjectAsync(GetOssObjectRequest request); + /// + /// 批量删除Oss对象 + /// + /// + /// + Task BulkDeleteObjectsAsync(BulkDeleteObjectRequest request); + /// + /// 容器是否存在 + /// + /// + /// + Task ExistsAsync(string name); + /// + /// 获取容器列表 + /// + /// + /// + Task GetListAsync(GetOssContainersRequest request); + /// + /// 获取对象列表 /// - public interface IOssContainer - { - /// - /// 创建容器 - /// - /// - /// - Task CreateAsync(string name); - /// - /// 创建Oss对象 - /// - /// - /// - Task CreateObjectAsync(CreateOssObjectRequest request); - /// - /// 获取容器信息 - /// - /// - /// - Task GetAsync(string name); - /// - /// 获取Oss对象信息 - /// - /// - /// - Task GetObjectAsync(GetOssObjectRequest request); - /// - /// 删除容器 - /// - /// - /// - Task DeleteAsync(string name); - /// - /// 删除Oss对象 - /// - /// - /// - Task DeleteObjectAsync(GetOssObjectRequest request); - /// - /// 批量删除Oss对象 - /// - /// - /// - Task BulkDeleteObjectsAsync(BulkDeleteObjectRequest request); - /// - /// 容器是否存在 - /// - /// - /// - Task ExistsAsync(string name); - /// - /// 获取容器列表 - /// - /// - /// - Task GetListAsync(GetOssContainersRequest request); - /// - /// 获取对象列表 - /// - /// - /// - Task GetObjectsAsync(GetOssObjectsRequest request); - // Task> GetObjectsAsync(string name, string prefix = null, string marker = null, string delimiter = null, int maxResultCount = 10); - } + /// + /// + Task GetObjectsAsync(GetOssObjectsRequest request); + // Task> GetObjectsAsync(string name, string prefix = null, string marker = null, string delimiter = null, int maxResultCount = 10); } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/IOssContainerExtensions.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/IOssContainerExtensions.cs index 634f7382a..3fc81d0e9 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/IOssContainerExtensions.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/IOssContainerExtensions.cs @@ -1,93 +1,92 @@ using System.Collections.Generic; using System.Threading.Tasks; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public static class IOssContainerExtensions { - public static class IOssContainerExtensions + /// + /// 如果不存在容器则创建 + /// + /// + /// + /// 返回容器信息 + public static async Task CreateIfNotExistsAsync( + this IOssContainer ossContainer, + string name) { - /// - /// 如果不存在容器则创建 - /// - /// - /// - /// 返回容器信息 - public static async Task CreateIfNotExistsAsync( - this IOssContainer ossContainer, - string name) + if (! await ossContainer.ExistsAsync(name)) { - if (! await ossContainer.ExistsAsync(name)) - { - await ossContainer.CreateAsync(name); - } - - return await ossContainer.GetAsync(name); + await ossContainer.CreateAsync(name); } - public static async Task DeleteObjectAsync( - this IOssContainer ossContainer, - string bucket, - string @object, - string path = "") - { - await ossContainer.DeleteObjectAsync( - new GetOssObjectRequest(bucket, @object, path)); - } + return await ossContainer.GetAsync(name); + } - public static async Task BulkDeleteObjectsAsync( - this IOssContainer ossContainer, - string bucketName, - ICollection objectNames, - string path = "") - { - await ossContainer.BulkDeleteObjectsAsync( - new BulkDeleteObjectRequest(bucketName, objectNames, path)); - } + public static async Task DeleteObjectAsync( + this IOssContainer ossContainer, + string bucket, + string @object, + string path = "") + { + await ossContainer.DeleteObjectAsync( + new GetOssObjectRequest(bucket, @object, path)); + } - public static async Task GetListAsync( - this IOssContainer ossContainer, - string prefix = null, - string marker = null, - int skipCount = 0, - int maxResultCount = 10) - { - return await ossContainer.GetListAsync( - new GetOssContainersRequest(prefix, marker, skipCount, maxResultCount)); - } + public static async Task BulkDeleteObjectsAsync( + this IOssContainer ossContainer, + string bucketName, + ICollection objectNames, + string path = "") + { + await ossContainer.BulkDeleteObjectsAsync( + new BulkDeleteObjectRequest(bucketName, objectNames, path)); + } - public static async Task GetObjectAsync( - this IOssContainer ossContainer, - string bucket, - string @object, - string path = "", - bool md5 = false, - bool createPathIsNotExists = false) - { - return await ossContainer.GetObjectAsync( - new GetOssObjectRequest(bucket, @object, path) - { - MD5 = md5, - CreatePathIsNotExists = createPathIsNotExists - }); - } + public static async Task GetListAsync( + this IOssContainer ossContainer, + string prefix = null, + string marker = null, + int skipCount = 0, + int maxResultCount = 10) + { + return await ossContainer.GetListAsync( + new GetOssContainersRequest(prefix, marker, skipCount, maxResultCount)); + } - public static async Task GetObjectsAsync( - this IOssContainer ossContainer, - string name, - string prefix = null, - string marker = null, - string delimiter = null, - string encodingType = null, - bool md5 = false, - int skipCount = 0, - int maxResultCount = 10, - bool createPathIsNotExists = false) - { - return await ossContainer.GetObjectsAsync( - new GetOssObjectsRequest(name, prefix, marker, delimiter, encodingType, skipCount, maxResultCount) - { - MD5 = md5, - CreatePathIsNotExists = createPathIsNotExists, - }); - } + public static async Task GetObjectAsync( + this IOssContainer ossContainer, + string bucket, + string @object, + string path = "", + bool md5 = false, + bool createPathIsNotExists = false) + { + return await ossContainer.GetObjectAsync( + new GetOssObjectRequest(bucket, @object, path) + { + MD5 = md5, + CreatePathIsNotExists = createPathIsNotExists + }); + } + + public static async Task GetObjectsAsync( + this IOssContainer ossContainer, + string name, + string prefix = null, + string marker = null, + string delimiter = null, + string encodingType = null, + bool md5 = false, + int skipCount = 0, + int maxResultCount = 10, + bool createPathIsNotExists = false) + { + return await ossContainer.GetObjectsAsync( + new GetOssObjectsRequest(name, prefix, marker, delimiter, encodingType, skipCount, maxResultCount) + { + MD5 = md5, + CreatePathIsNotExists = createPathIsNotExists, + }); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/IOssContainerFactory.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/IOssContainerFactory.cs index 90ade75c4..ce4cfebf1 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/IOssContainerFactory.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/IOssContainerFactory.cs @@ -1,18 +1,17 @@ -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +/// +/// Oss容器构建工厂 +/// +public interface IOssContainerFactory { - /// - /// Oss容器构建工厂 - /// - public interface IOssContainerFactory - { - IOssContainer Create(); - } + IOssContainer Create(); +} - /// - /// Oss容器构建工厂 - /// - public interface IOssContainerFactory - { - IOssContainer Create(TConfiguration configuration); - } +/// +/// Oss容器构建工厂 +/// +public interface IOssContainerFactory +{ + IOssContainer Create(TConfiguration configuration); } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/OssContainer.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/OssContainer.cs index 9ae82078f..a70541aee 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/OssContainer.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/OssContainer.cs @@ -1,31 +1,30 @@ using System; using System.Collections.Generic; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +/// +/// 描述了一个容器的状态信息 +/// +public class OssContainer { - /// - /// 描述了一个容器的状态信息 - /// - public class OssContainer - { - public string Name { get; } - public long Size { get; } - public DateTime CreationDate { get; } - public DateTime? LastModifiedDate { get; } - public IDictionary Metadata { get; } + public string Name { get; } + public long Size { get; } + public DateTime CreationDate { get; } + public DateTime? LastModifiedDate { get; } + public IDictionary Metadata { get; } - public OssContainer( - string name, - DateTime creationDate, - long size = 0, - DateTime? lastModifiedDate = null, - IDictionary metadata = null) - { - Name = name; - CreationDate = creationDate; - LastModifiedDate = lastModifiedDate; - Size = size; - Metadata = metadata ?? new Dictionary(); - } + public OssContainer( + string name, + DateTime creationDate, + long size = 0, + DateTime? lastModifiedDate = null, + IDictionary metadata = null) + { + Name = name; + CreationDate = creationDate; + LastModifiedDate = lastModifiedDate; + Size = size; + Metadata = metadata ?? new Dictionary(); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/OssObject.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/OssObject.cs index d987f15cf..074987114 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/OssObject.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/OssObject.cs @@ -2,52 +2,51 @@ using System.Collections.Generic; using System.IO; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +/// +/// 描述了一个对象的状态信息 +/// +public class OssObject { - /// - /// 描述了一个对象的状态信息 - /// - public class OssObject - { - private Stream _content; + private Stream _content; - public bool IsFolder { get; } - public string Name { get; } - public string FullName { get; set; } - public string Prefix { get; } - public string MD5{ get; } - public long Size { get; } - public Stream Content => _content; - public DateTime? CreationDate { get; } - public DateTime? LastModifiedDate { get; } - public IDictionary Metadata { get; } - public OssObject( - string name, - string prefix, - string md5, - DateTime? creationDate = null, - long size = 0, - DateTime? lastModifiedDate = null, - IDictionary metadata = null, - bool isFolder = false) - { - Name = name; - Prefix = prefix; - MD5 = md5; - CreationDate = creationDate; - LastModifiedDate = lastModifiedDate; - Size = size; - IsFolder = isFolder; - Metadata = metadata ?? new Dictionary(); - } + public bool IsFolder { get; } + public string Name { get; } + public string FullName { get; set; } + public string Prefix { get; } + public string MD5{ get; } + public long Size { get; } + public Stream Content => _content; + public DateTime? CreationDate { get; } + public DateTime? LastModifiedDate { get; } + public IDictionary Metadata { get; } + public OssObject( + string name, + string prefix, + string md5, + DateTime? creationDate = null, + long size = 0, + DateTime? lastModifiedDate = null, + IDictionary metadata = null, + bool isFolder = false) + { + Name = name; + Prefix = prefix; + MD5 = md5; + CreationDate = creationDate; + LastModifiedDate = lastModifiedDate; + Size = size; + IsFolder = isFolder; + Metadata = metadata ?? new Dictionary(); + } - public void SetContent(Stream stream) + public void SetContent(Stream stream) + { + _content = stream; + if (!_content.IsNullOrEmpty()) { - _content = stream; - if (!_content.IsNullOrEmpty()) - { - _content.Seek(0, SeekOrigin.Begin); - } + _content.Seek(0, SeekOrigin.Begin); } } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/OssObjectComparer.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/OssObjectComparer.cs index c75491aeb..e011028c3 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/OssObjectComparer.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/OssObjectComparer.cs @@ -1,27 +1,26 @@ using System.Collections.Generic; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public class OssObjectComparer : IComparer { - public class OssObjectComparer : IComparer + public virtual int Compare(OssObject x, OssObject y) { - public virtual int Compare(OssObject x, OssObject y) + if (x.IsFolder && y.IsFolder) { - if (x.IsFolder && y.IsFolder) - { - return x.Name.CompareTo(y.Name); - } - - if (x.IsFolder && !y.IsFolder) - { - return -1; - } + return x.Name.CompareTo(y.Name); + } - if (!x.IsFolder && y.IsFolder) - { - return 1; - } + if (x.IsFolder && !y.IsFolder) + { + return -1; + } - return x.Name.CompareTo(y.Name); + if (!x.IsFolder && y.IsFolder) + { + return 1; } + + return x.Name.CompareTo(y.Name); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/OssStaticContainerDataSeedContributor.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/OssStaticContainerDataSeedContributor.cs index 202d312b6..ed9123d57 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/OssStaticContainerDataSeedContributor.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain/LINGYUN/Abp/OssManagement/OssStaticContainerDataSeedContributor.cs @@ -3,28 +3,27 @@ using Volo.Abp.Data; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +public class OssStaticContainerDataSeedContributor : IDataSeedContributor, ITransientDependency { - public class OssStaticContainerDataSeedContributor : IDataSeedContributor, ITransientDependency + private readonly AbpOssManagementOptions _options; + private readonly IOssContainerFactory _ossContainerFactory; + public OssStaticContainerDataSeedContributor( + IOptions options, + IOssContainerFactory ossContainerFactory) { - private readonly AbpOssManagementOptions _options; - private readonly IOssContainerFactory _ossContainerFactory; - public OssStaticContainerDataSeedContributor( - IOptions options, - IOssContainerFactory ossContainerFactory) - { - _options = options.Value; - _ossContainerFactory = ossContainerFactory; - } + _options = options.Value; + _ossContainerFactory = ossContainerFactory; + } - public async virtual Task SeedAsync(DataSeedContext context) - { - var ossContainer = _ossContainerFactory.Create(); + public async virtual Task SeedAsync(DataSeedContext context) + { + var ossContainer = _ossContainerFactory.Create(); - foreach (var bucket in _options.StaticBuckets) - { - await ossContainer.CreateIfNotExistsAsync(bucket); - } + foreach (var bucket in _options.StaticBuckets) + { + await ossContainer.CreateIfNotExistsAsync(bucket); } } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.ImageSharp/LINGYUN.Abp.OssManagement.FileSystem.ImageSharp.csproj b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.ImageSharp/LINGYUN.Abp.OssManagement.FileSystem.ImageSharp.csproj index c19956339..641f0dbd1 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.ImageSharp/LINGYUN.Abp.OssManagement.FileSystem.ImageSharp.csproj +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.ImageSharp/LINGYUN.Abp.OssManagement.FileSystem.ImageSharp.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.OssManagement.FileSystem.ImageSharp + LINGYUN.Abp.OssManagement.FileSystem.ImageSharp + false + false + false diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.ImageSharp/LINGYUN/Abp/OssManagement/FileSystem/ImageSharp/AbpOssManagementFileSystemImageSharpModule.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.ImageSharp/LINGYUN/Abp/OssManagement/FileSystem/ImageSharp/AbpOssManagementFileSystemImageSharpModule.cs index a8c25d81c..440aacc37 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.ImageSharp/LINGYUN/Abp/OssManagement/FileSystem/ImageSharp/AbpOssManagementFileSystemImageSharpModule.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.ImageSharp/LINGYUN/Abp/OssManagement/FileSystem/ImageSharp/AbpOssManagementFileSystemImageSharpModule.cs @@ -1,16 +1,15 @@ using Volo.Abp.Modularity; -namespace LINGYUN.Abp.OssManagement.FileSystem.ImageSharp +namespace LINGYUN.Abp.OssManagement.FileSystem.ImageSharp; + +[DependsOn(typeof(AbpOssManagementFileSystemModule))] +public class AbpOssManagementFileSystemImageSharpModule : AbpModule { - [DependsOn(typeof(AbpOssManagementFileSystemModule))] - public class AbpOssManagementFileSystemImageSharpModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + Configure(options => { - Configure(options => - { - options.AddProcesser(new ImageSharpProcesserContributor()); - }); - } + options.AddProcesser(new ImageSharpProcesserContributor()); + }); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.ImageSharp/LINGYUN/Abp/OssManagement/FileSystem/ImageSharp/ImageSharpFileSystemOssObjectProcesser.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.ImageSharp/LINGYUN/Abp/OssManagement/FileSystem/ImageSharp/ImageSharpFileSystemOssObjectProcesser.cs index ba314e3c2..6c90f53e3 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.ImageSharp/LINGYUN/Abp/OssManagement/FileSystem/ImageSharp/ImageSharpFileSystemOssObjectProcesser.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.ImageSharp/LINGYUN/Abp/OssManagement/FileSystem/ImageSharp/ImageSharpFileSystemOssObjectProcesser.cs @@ -10,62 +10,61 @@ using System.Linq; using System.Threading.Tasks; -namespace LINGYUN.Abp.OssManagement.FileSystem.ImageSharp +namespace LINGYUN.Abp.OssManagement.FileSystem.ImageSharp; + +public class ImageSharpProcesserContributor : IFileSystemOssObjectProcesserContributor { - public class ImageSharpProcesserContributor : IFileSystemOssObjectProcesserContributor + public async virtual Task ProcessAsync(FileSystemOssObjectContext context) { - public async virtual Task ProcessAsync(FileSystemOssObjectContext context) - { - var copyStream = context.OssObject.Content; - var bytes = await copyStream.GetAllBytesAsync(); + var copyStream = context.OssObject.Content; + var bytes = await copyStream.GetAllBytesAsync(); - if (bytes.IsImage()) + if (bytes.IsImage()) + { + var args = context.Process.Split(','); + if (DrawGraphics(bytes, args, out var content)) { - var args = context.Process.Split(','); - if (DrawGraphics(bytes, args, out var content)) - { - context.SetContent(content); + context.SetContent(content); - // 释放原图形流数据 - await copyStream.DisposeAsync(); - } - } + // 释放原图形流数据 + await copyStream.DisposeAsync(); + } } + } - protected virtual bool DrawGraphics(byte[] fileBytes, string[] args, out Stream content) - { - using var image = Image.Load(fileBytes); + protected virtual bool DrawGraphics(byte[] fileBytes, string[] args, out Stream content) + { + using var image = Image.Load(fileBytes); - // 大小 - var width = args.GetInt32Prarm("w_"); - var height = args.GetInt32Prarm("h_"); - if (!width.IsNullOrWhiteSpace() && - !height.IsNullOrWhiteSpace()) - { - image.Mutate(x => x.Resize(int.Parse(width), int.Parse(height))); - } + // 大小 + var width = args.GetInt32Prarm("w_"); + var height = args.GetInt32Prarm("h_"); + if (!width.IsNullOrWhiteSpace() && + !height.IsNullOrWhiteSpace()) + { + image.Mutate(x => x.Resize(int.Parse(width), int.Parse(height))); + } - // 水印 - //var txt = GetString(args, "t_"); - //if (!txt.IsNullOrWhiteSpace()) - //{ - // FontCollection fonts = new FontCollection(); - // FontFamily fontfamily = fonts.Install("本地字体.TTF"); - // var font = new Font(fontfamily, 20, FontStyle.Bold); - // var size = TextMeasurer.Measure(txt, new RendererOptions(font)); + // 水印 + //var txt = GetString(args, "t_"); + //if (!txt.IsNullOrWhiteSpace()) + //{ + // FontCollection fonts = new FontCollection(); + // FontFamily fontfamily = fonts.Install("本地字体.TTF"); + // var font = new Font(fontfamily, 20, FontStyle.Bold); + // var size = TextMeasurer.Measure(txt, new RendererOptions(font)); - // image.Mutate(x => x.DrawText(txt, font, Color.WhiteSmoke, - // new PointF(image.Width - size.Width - 3, image.Height - size.Height - 3))); - //} + // image.Mutate(x => x.DrawText(txt, font, Color.WhiteSmoke, + // new PointF(image.Width - size.Width - 3, image.Height - size.Height - 3))); + //} - // TODO: 其他处理参数及现有的优化 + // TODO: 其他处理参数及现有的优化 - var imageStream = new MemoryStream(); - image.Save(imageStream, image.Metadata.DecodedImageFormat); - imageStream.Seek(0, SeekOrigin.Begin); + var imageStream = new MemoryStream(); + image.Save(imageStream, image.Metadata.DecodedImageFormat); + imageStream.Seek(0, SeekOrigin.Begin); - content = imageStream; - return true; - } + content = imageStream; + return true; } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.Imaging.ImageSharp/LINGYUN.Abp.OssManagement.FileSystem.Imaging.ImageSharp.csproj b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.Imaging.ImageSharp/LINGYUN.Abp.OssManagement.FileSystem.Imaging.ImageSharp.csproj index 4dcbb3685..a22ac4846 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.Imaging.ImageSharp/LINGYUN.Abp.OssManagement.FileSystem.Imaging.ImageSharp.csproj +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.Imaging.ImageSharp/LINGYUN.Abp.OssManagement.FileSystem.Imaging.ImageSharp.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.OssManagement.FileSystem.Imaging.ImageSharp + LINGYUN.Abp.OssManagement.FileSystem.Imaging.ImageSharp + false + false + false diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.Imaging/LINGYUN.Abp.OssManagement.FileSystem.Imaging.csproj b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.Imaging/LINGYUN.Abp.OssManagement.FileSystem.Imaging.csproj index 75f65f51c..5ff41456a 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.Imaging/LINGYUN.Abp.OssManagement.FileSystem.Imaging.csproj +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem.Imaging/LINGYUN.Abp.OssManagement.FileSystem.Imaging.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.OssManagement.FileSystem.Imaging + LINGYUN.Abp.OssManagement.FileSystem.Imaging + false + false + false diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN.Abp.OssManagement.FileSystem.csproj b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN.Abp.OssManagement.FileSystem.csproj index 50ccc853c..b0ea17cf7 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN.Abp.OssManagement.FileSystem.csproj +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN.Abp.OssManagement.FileSystem.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.OssManagement.FileSystem + LINGYUN.Abp.OssManagement.FileSystem + false + false + false latest diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN/Abp/OssManagement/FileSystem/AbpOssManagementFileSystemModule.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN/Abp/OssManagement/FileSystem/AbpOssManagementFileSystemModule.cs index 03e87b134..cc88113ac 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN/Abp/OssManagement/FileSystem/AbpOssManagementFileSystemModule.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN/Abp/OssManagement/FileSystem/AbpOssManagementFileSystemModule.cs @@ -3,22 +3,21 @@ using Volo.Abp.BlobStoring.FileSystem; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.OssManagement.FileSystem +namespace LINGYUN.Abp.OssManagement.FileSystem; + +[DependsOn( + typeof(AbpBlobStoringFileSystemModule), + typeof(AbpOssManagementDomainModule))] +public class AbpOssManagementFileSystemModule : AbpModule { - [DependsOn( - typeof(AbpBlobStoringFileSystemModule), - typeof(AbpOssManagementDomainModule))] - public class AbpOssManagementFileSystemModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddTransient(); + context.Services.AddTransient(); - context.Services.AddTransient(provider => - provider - .GetRequiredService() - .Create() - .As()); - } + context.Services.AddTransient(provider => + provider + .GetRequiredService() + .Create() + .As()); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN/Abp/OssManagement/FileSystem/FileSystemOssContainer.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN/Abp/OssManagement/FileSystem/FileSystemOssContainer.cs index 5be44fcc2..d44ef2f19 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN/Abp/OssManagement/FileSystem/FileSystemOssContainer.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN/Abp/OssManagement/FileSystem/FileSystemOssContainer.cs @@ -12,582 +12,581 @@ using Volo.Abp.IO; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.OssManagement.FileSystem +namespace LINGYUN.Abp.OssManagement.FileSystem; + +/// +/// Oss容器的本地文件系统实现 +/// +internal class FileSystemOssContainer : IOssContainer, IOssObjectExpireor { - /// - /// Oss容器的本地文件系统实现 - /// - internal class FileSystemOssContainer : IOssContainer, IOssObjectExpireor + protected ICurrentTenant CurrentTenant { get; } + protected IHostEnvironment Environment { get; } + protected IBlobFilePathCalculator FilePathCalculator { get; } + protected IBlobContainerConfigurationProvider ConfigurationProvider { get; } + protected IServiceProvider ServiceProvider { get; } + protected FileSystemOssOptions Options { get; } + protected AbpOssManagementOptions OssOptions { get; } + + public FileSystemOssContainer( + ICurrentTenant currentTenant, + IHostEnvironment environment, + IServiceProvider serviceProvider, + IBlobFilePathCalculator blobFilePathCalculator, + IBlobContainerConfigurationProvider configurationProvider, + IOptions options, + IOptions ossOptions) { - protected ICurrentTenant CurrentTenant { get; } - protected IHostEnvironment Environment { get; } - protected IBlobFilePathCalculator FilePathCalculator { get; } - protected IBlobContainerConfigurationProvider ConfigurationProvider { get; } - protected IServiceProvider ServiceProvider { get; } - protected FileSystemOssOptions Options { get; } - protected AbpOssManagementOptions OssOptions { get; } - - public FileSystemOssContainer( - ICurrentTenant currentTenant, - IHostEnvironment environment, - IServiceProvider serviceProvider, - IBlobFilePathCalculator blobFilePathCalculator, - IBlobContainerConfigurationProvider configurationProvider, - IOptions options, - IOptions ossOptions) - { - CurrentTenant = currentTenant; - Environment = environment; - ServiceProvider = serviceProvider; - FilePathCalculator = blobFilePathCalculator; - ConfigurationProvider = configurationProvider; - Options = options.Value; - OssOptions = ossOptions.Value; - } + CurrentTenant = currentTenant; + Environment = environment; + ServiceProvider = serviceProvider; + FilePathCalculator = blobFilePathCalculator; + ConfigurationProvider = configurationProvider; + Options = options.Value; + OssOptions = ossOptions.Value; + } - public virtual Task BulkDeleteObjectsAsync(BulkDeleteObjectRequest request) - { - var objectPath = !request.Path.IsNullOrWhiteSpace() - ? request.Path.EnsureEndsWith('/') - : ""; - var filesPath = request.Objects.Select(x => CalculateFilePath(request.Bucket, objectPath + x)); + public virtual Task BulkDeleteObjectsAsync(BulkDeleteObjectRequest request) + { + var objectPath = !request.Path.IsNullOrWhiteSpace() + ? request.Path.EnsureEndsWith('/') + : ""; + var filesPath = request.Objects.Select(x => CalculateFilePath(request.Bucket, objectPath + x)); - foreach (var file in filesPath) + foreach (var file in filesPath) + { + if (Directory.Exists(file)) { - if (Directory.Exists(file)) + if (Directory.GetFileSystemEntries(file).Length > 0) { - if (Directory.GetFileSystemEntries(file).Length > 0) - { - throw new BusinessException(code: OssManagementErrorCodes.ContainerDeleteWithNotEmpty); - // throw new ContainerDeleteWithNotEmptyException("00101", $"Can't not delete container {name}, because it is not empty!"); - } - Directory.Delete(file); - } - else if (File.Exists(file)) - { - File.Delete(file); + throw new BusinessException(code: OssManagementErrorCodes.ContainerDeleteWithNotEmpty); + // throw new ContainerDeleteWithNotEmptyException("00101", $"Can't not delete container {name}, because it is not empty!"); } + Directory.Delete(file); } - - return Task.CompletedTask; - } - - public virtual Task CreateAsync(string name) - { - var filePath = CalculateFilePath(name); - ThrowOfPathHasTooLong(filePath); - if (!Directory.Exists(filePath)) + else if (File.Exists(file)) { - Directory.CreateDirectory(filePath); + File.Delete(file); } + } - var directoryInfo = new DirectoryInfo(filePath); - var container = new OssContainer( - directoryInfo.Name, - directoryInfo.CreationTime, - 0L, - directoryInfo.LastWriteTime, - new Dictionary - { - { "LastAccessTime", directoryInfo.LastAccessTime.ToString("yyyy-MM-dd HH:mm:ss") } - }); + return Task.CompletedTask; + } - return Task.FromResult(container); + public virtual Task CreateAsync(string name) + { + var filePath = CalculateFilePath(name); + ThrowOfPathHasTooLong(filePath); + if (!Directory.Exists(filePath)) + { + Directory.CreateDirectory(filePath); } - public virtual Task ExpireAsync(ExprieOssObjectRequest request) - { - var filePath = CalculateFilePath(request.Bucket); + var directoryInfo = new DirectoryInfo(filePath); + var container = new OssContainer( + directoryInfo.Name, + directoryInfo.CreationTime, + 0L, + directoryInfo.LastWriteTime, + new Dictionary + { + { "LastAccessTime", directoryInfo.LastAccessTime.ToString("yyyy-MM-dd HH:mm:ss") } + }); - DirectoryHelper.CreateIfNotExists(filePath); + return Task.FromResult(container); + } - // 目录也属于Oss对象,需要抽象的文件系统集合来存储 - var fileSystems = Directory.GetFileSystemEntries(filePath) - .Select(ConvertFileSystem) - .Where(file => file.CreationTime <= request.ExpirationTime) - .OrderBy(file => file.CreationTime) - .Take(request.Batch) - .Select(file => file.FullName); + public virtual Task ExpireAsync(ExprieOssObjectRequest request) + { + var filePath = CalculateFilePath(request.Bucket); - static FileSystemInfo ConvertFileSystem(string path) - { - if (File.Exists(path)) - { - return new FileInfo(path); - } + DirectoryHelper.CreateIfNotExists(filePath); - return new DirectoryInfo(path); - } + // 目录也属于Oss对象,需要抽象的文件系统集合来存储 + var fileSystems = Directory.GetFileSystemEntries(filePath) + .Select(ConvertFileSystem) + .Where(file => file.CreationTime <= request.ExpirationTime) + .OrderBy(file => file.CreationTime) + .Take(request.Batch) + .Select(file => file.FullName); - foreach (var fileSystem in fileSystems) + static FileSystemInfo ConvertFileSystem(string path) + { + if (File.Exists(path)) { - FileHelper.DeleteIfExists(fileSystem); - DirectoryHelper.DeleteIfExists(fileSystem, true); + return new FileInfo(path); } - return Task.CompletedTask; + return new DirectoryInfo(path); } - public async virtual Task CreateObjectAsync(CreateOssObjectRequest request) + foreach (var fileSystem in fileSystems) { - var objectPath = !request.Path.IsNullOrWhiteSpace() - ? request.Path.EnsureEndsWith('/') - : ""; - var objectName = objectPath.IsNullOrWhiteSpace() - ? request.Object - : objectPath + request.Object; - - var filePath = CalculateFilePath(request.Bucket, objectName); - if (!request.Content.IsNullOrEmpty()) - { - ThrowOfPathHasTooLong(filePath); - - if (!request.Overwrite && File.Exists(filePath)) - { - throw new BusinessException(code: OssManagementErrorCodes.ObjectAlreadyExists); - // throw new OssObjectAlreadyExistsException($"Can't not put object {objectName} in container {request.Bucket}, Because a file with the same name already exists in the directory!"); - } - - DirectoryHelper.CreateIfNotExists(Path.GetDirectoryName(filePath)); + FileHelper.DeleteIfExists(fileSystem); + DirectoryHelper.DeleteIfExists(fileSystem, true); + } - string fileMd5 = ""; - FileMode fileMode = request.Overwrite ? FileMode.Create : FileMode.CreateNew; - using (var fileStream = File.Open(filePath, fileMode, FileAccess.ReadWrite)) - { - await request.Content.CopyToAsync(fileStream); + return Task.CompletedTask; + } - fileMd5 = fileStream.MD5(); + public async virtual Task CreateObjectAsync(CreateOssObjectRequest request) + { + var objectPath = !request.Path.IsNullOrWhiteSpace() + ? request.Path.EnsureEndsWith('/') + : ""; + var objectName = objectPath.IsNullOrWhiteSpace() + ? request.Object + : objectPath + request.Object; + + var filePath = CalculateFilePath(request.Bucket, objectName); + if (!request.Content.IsNullOrEmpty()) + { + ThrowOfPathHasTooLong(filePath); - await fileStream.FlushAsync(); - } + if (!request.Overwrite && File.Exists(filePath)) + { + throw new BusinessException(code: OssManagementErrorCodes.ObjectAlreadyExists); + // throw new OssObjectAlreadyExistsException($"Can't not put object {objectName} in container {request.Bucket}, Because a file with the same name already exists in the directory!"); + } - var fileInfo = new FileInfo(filePath); - var ossObject = new OssObject( - fileInfo.Name, - objectPath, - fileMd5, - fileInfo.CreationTime, - fileInfo.Length, - fileInfo.LastWriteTime, - new Dictionary - { - { "IsReadOnly", fileInfo.IsReadOnly.ToString() }, - { "LastAccessTime", fileInfo.LastAccessTime.ToString("yyyy-MM-dd HH:mm:ss") } - }) - { - FullName = fileInfo.FullName.Replace(Environment.ContentRootPath, "") - }; - ossObject.SetContent(request.Content); + DirectoryHelper.CreateIfNotExists(Path.GetDirectoryName(filePath)); - return ossObject; - } - else + string fileMd5 = ""; + FileMode fileMode = request.Overwrite ? FileMode.Create : FileMode.CreateNew; + using (var fileStream = File.Open(filePath, fileMode, FileAccess.ReadWrite)) { - ThrowOfPathHasTooLong(filePath); - if (Directory.Exists(filePath)) - { - throw new BusinessException(code: OssManagementErrorCodes.ObjectAlreadyExists); - // throw new OssObjectAlreadyExistsException($"Can't not put object {objectName} in container {request.Bucket}, Because a file with the same name already exists in the directory!"); - } - Directory.CreateDirectory(filePath); - var directoryInfo = new DirectoryInfo(filePath); + await request.Content.CopyToAsync(fileStream); - var ossObject = new OssObject( - directoryInfo.Name.EnsureEndsWith('/'), - objectPath, - "", - directoryInfo.CreationTime, - 0L, - directoryInfo.LastWriteTime, - new Dictionary - { - { "LastAccessTime", directoryInfo.LastAccessTime.ToString("yyyy-MM-dd HH:mm:ss") } - }, - true) - { - FullName = directoryInfo.FullName.Replace(Environment.ContentRootPath, "") - }; - ossObject.SetContent(request.Content); + fileMd5 = fileStream.MD5(); - return ossObject; + await fileStream.FlushAsync(); } - } - - public virtual Task DeleteAsync(string name) - { - CheckStaticBucket(name); - var filePath = CalculateFilePath(name); - if (!Directory.Exists(filePath)) + var fileInfo = new FileInfo(filePath); + var ossObject = new OssObject( + fileInfo.Name, + objectPath, + fileMd5, + fileInfo.CreationTime, + fileInfo.Length, + fileInfo.LastWriteTime, + new Dictionary { - throw new BusinessException(code: OssManagementErrorCodes.ContainerNotFound); - } - // 非空目录无法删除 - if (Directory.GetFileSystemEntries(filePath).Length > 0) + { "IsReadOnly", fileInfo.IsReadOnly.ToString() }, + { "LastAccessTime", fileInfo.LastAccessTime.ToString("yyyy-MM-dd HH:mm:ss") } + }) { - throw new BusinessException(code: OssManagementErrorCodes.ContainerDeleteWithNotEmpty); - // throw new ContainerDeleteWithNotEmptyException("00101", $"Can't not delete container {name}, because it is not empty!"); - } - Directory.Delete(filePath); + FullName = fileInfo.FullName.Replace(Environment.ContentRootPath, "") + }; + ossObject.SetContent(request.Content); - return Task.CompletedTask; + return ossObject; } - - public virtual Task DeleteObjectAsync(GetOssObjectRequest request) + else { - var objectName = request.Path.IsNullOrWhiteSpace() - ? request.Object - : request.Path.EnsureEndsWith('/') + request.Object; - var filePath = CalculateFilePath(request.Bucket, objectName); - if (File.Exists(filePath)) + ThrowOfPathHasTooLong(filePath); + if (Directory.Exists(filePath)) { - File.Delete(filePath); + throw new BusinessException(code: OssManagementErrorCodes.ObjectAlreadyExists); + // throw new OssObjectAlreadyExistsException($"Can't not put object {objectName} in container {request.Bucket}, Because a file with the same name already exists in the directory!"); } - else if (Directory.Exists(filePath)) + Directory.CreateDirectory(filePath); + var directoryInfo = new DirectoryInfo(filePath); + + var ossObject = new OssObject( + directoryInfo.Name.EnsureEndsWith('/'), + objectPath, + "", + directoryInfo.CreationTime, + 0L, + directoryInfo.LastWriteTime, + new Dictionary { - if (Directory.GetFileSystemEntries(filePath).Length > 0) - { - throw new BusinessException(code: OssManagementErrorCodes.ObjectDeleteWithNotEmpty); - } - Directory.Delete(filePath); - } + { "LastAccessTime", directoryInfo.LastAccessTime.ToString("yyyy-MM-dd HH:mm:ss") } + }, + true) + { + FullName = directoryInfo.FullName.Replace(Environment.ContentRootPath, "") + }; + ossObject.SetContent(request.Content); - return Task.CompletedTask; + return ossObject; } + } - public virtual Task ExistsAsync(string name) - { - var filePath = CalculateFilePath(name); + public virtual Task DeleteAsync(string name) + { + CheckStaticBucket(name); - return Task.FromResult(Directory.Exists(filePath)); + var filePath = CalculateFilePath(name); + if (!Directory.Exists(filePath)) + { + throw new BusinessException(code: OssManagementErrorCodes.ContainerNotFound); } - - public virtual Task GetAsync(string name) + // 非空目录无法删除 + if (Directory.GetFileSystemEntries(filePath).Length > 0) { - var filePath = CalculateFilePath(name); - if (!Directory.Exists(filePath)) - { - throw new BusinessException(code: OssManagementErrorCodes.ContainerNotFound); - // throw new ContainerNotFoundException($"Can't not found container {name} in file system"); - } + throw new BusinessException(code: OssManagementErrorCodes.ContainerDeleteWithNotEmpty); + // throw new ContainerDeleteWithNotEmptyException("00101", $"Can't not delete container {name}, because it is not empty!"); + } + Directory.Delete(filePath); - var directoryInfo = new DirectoryInfo(filePath); - var container = new OssContainer( - directoryInfo.Name, - directoryInfo.CreationTime, - 0L, - directoryInfo.LastWriteTime, - new Dictionary - { - { "LastAccessTime", directoryInfo.LastAccessTime.ToString("yyyy-MM-dd HH:mm:ss") } - }); + return Task.CompletedTask; + } - return Task.FromResult(container); + public virtual Task DeleteObjectAsync(GetOssObjectRequest request) + { + var objectName = request.Path.IsNullOrWhiteSpace() + ? request.Object + : request.Path.EnsureEndsWith('/') + request.Object; + var filePath = CalculateFilePath(request.Bucket, objectName); + if (File.Exists(filePath)) + { + File.Delete(filePath); } - - public async virtual Task GetObjectAsync(GetOssObjectRequest request) + else if (Directory.Exists(filePath)) { - var objectPath = !request.Path.IsNullOrWhiteSpace() - ? request.Path.EnsureEndsWith('/') - : ""; - var objectName = objectPath.IsNullOrWhiteSpace() - ? request.Object - : objectPath + request.Object; - - var filePath = CalculateFilePath(request.Bucket, objectName); - if (!File.Exists(filePath)) + if (Directory.GetFileSystemEntries(filePath).Length > 0) { - if (!Directory.Exists(filePath) && !request.CreatePathIsNotExists) - { - throw new BusinessException(code: OssManagementErrorCodes.ObjectNotFound); - // throw new ContainerNotFoundException($"Can't not found object {objectName} in container {request.Bucket} with file system"); - } - - DirectoryHelper.CreateIfNotExists(filePath); - - var directoryInfo = new DirectoryInfo(filePath); - var ossObject = new OssObject( - directoryInfo.Name.EnsureEndsWith('/'), - objectPath, - "", - directoryInfo.CreationTime, - 0L, - directoryInfo.LastWriteTime, - new Dictionary - { - { "LastAccessTime", directoryInfo.LastAccessTime.ToString("yyyy-MM-dd HH:mm:ss") } - }, - true) - { - FullName = directoryInfo.FullName.Replace(Environment.ContentRootPath, "") - }; - return ossObject; + throw new BusinessException(code: OssManagementErrorCodes.ObjectDeleteWithNotEmpty); } - else - { - var fileInfo = new FileInfo(filePath); - var fileStream = File.OpenRead(filePath); - var ossObject = new OssObject( - fileInfo.Name, - objectPath, - request.MD5 ? fileStream.MD5() : "", - fileInfo.CreationTime, - fileInfo.Length, - fileInfo.LastWriteTime, - new Dictionary - { - { "IsReadOnly", fileInfo.IsReadOnly.ToString() }, - { "LastAccessTime", fileInfo.LastAccessTime.ToString("yyyy-MM-dd HH:mm:ss") } - }) - { - FullName = fileInfo.FullName.Replace(Environment.ContentRootPath, "") - }; - - ossObject.SetContent(fileStream); + Directory.Delete(filePath); + } - if (!request.Process.IsNullOrWhiteSpace()) - { - using var serviceScope = ServiceProvider.CreateScope(); - var context = new FileSystemOssObjectContext(request.Process, ossObject, serviceScope.ServiceProvider); - foreach (var processer in Options.Processers) - { - await processer.ProcessAsync(context); + return Task.CompletedTask; + } - if (context.Handled) - { - ossObject.SetContent(context.Content); - break; - } - } - } + public virtual Task ExistsAsync(string name) + { + var filePath = CalculateFilePath(name); - return ossObject; - } - } + return Task.FromResult(Directory.Exists(filePath)); + } - public virtual Task GetListAsync(GetOssContainersRequest request) + public virtual Task GetAsync(string name) + { + var filePath = CalculateFilePath(name); + if (!Directory.Exists(filePath)) { - // 不传递Bucket 检索根目录的Bucket - var filePath = CalculateFilePath(null); - - // 获取根目录 - var directories = Directory.GetDirectories(filePath, request.Prefix ?? "*.*"); + throw new BusinessException(code: OssManagementErrorCodes.ContainerNotFound); + // throw new ContainerNotFoundException($"Can't not found container {name} in file system"); + } - // 排序目录 - Array.Sort(directories, delegate (string x, string y) + var directoryInfo = new DirectoryInfo(filePath); + var container = new OssContainer( + directoryInfo.Name, + directoryInfo.CreationTime, + 0L, + directoryInfo.LastWriteTime, + new Dictionary { - return x.CompareTo(y); + { "LastAccessTime", directoryInfo.LastAccessTime.ToString("yyyy-MM-dd HH:mm:ss") } }); - // 容器对应的目录信息集合 - // 本地文件系统直接用PageBy即可 - var directoryInfos = directories - .AsQueryable() - .PageBy(request.Current, request.MaxKeys ?? 10) - .Select(file => new DirectoryInfo(file)) - .ToArray(); - var nextMarkerIndex = directories.FindIndex(x => x.EndsWith(directoryInfos[directoryInfos.Length - 1].Name)); - string nextMarker = ""; - if (nextMarkerIndex >= 0 && nextMarkerIndex + 1 < directories.Length) - { - nextMarker = directories[nextMarkerIndex + 1]; - nextMarker = new DirectoryInfo(nextMarker).Name; - } - // 返回Oss容器描述集合 - var response = new GetOssContainersResponse( - request.Prefix, - request.Marker, - nextMarker, - directories.Length, - directoryInfos.Select(x => new OssContainer( - x.Name, - x.CreationTime, - 0L, - x.LastWriteTime, - new Dictionary - { - { "LastAccessTime", x.LastAccessTime.ToString("yyyy-MM-dd HH:mm:ss") } - })) - .ToList()); - return Task.FromResult(response); - } + return Task.FromResult(container); + } - public virtual Task GetObjectsAsync(GetOssObjectsRequest request) + public async virtual Task GetObjectAsync(GetOssObjectRequest request) + { + var objectPath = !request.Path.IsNullOrWhiteSpace() + ? request.Path.EnsureEndsWith('/') + : ""; + var objectName = objectPath.IsNullOrWhiteSpace() + ? request.Object + : objectPath + request.Object; + + var filePath = CalculateFilePath(request.Bucket, objectName); + if (!File.Exists(filePath)) { - // 先定位检索的目录 - var filePath = CalculateFilePath(request.BucketName, request.Prefix); if (!Directory.Exists(filePath) && !request.CreatePathIsNotExists) { - throw new BusinessException(code: OssManagementErrorCodes.ContainerNotFound); - // throw new ContainerNotFoundException($"Can't not found container {request.BucketName} in file system"); + throw new BusinessException(code: OssManagementErrorCodes.ObjectNotFound); + // throw new ContainerNotFoundException($"Can't not found object {objectName} in container {request.Bucket} with file system"); } + DirectoryHelper.CreateIfNotExists(filePath); - // 目录也属于Oss对象,需要抽象的文件系统集合来存储 - var fileSystemNames = string.Equals(request.Delimiter, "/") - ? Directory.GetDirectories(filePath) - : Directory.GetFileSystemEntries(filePath); - // 排序所有文件与目录 - Array.Sort(fileSystemNames, delegate (string x, string y) + var directoryInfo = new DirectoryInfo(filePath); + var ossObject = new OssObject( + directoryInfo.Name.EnsureEndsWith('/'), + objectPath, + "", + directoryInfo.CreationTime, + 0L, + directoryInfo.LastWriteTime, + new Dictionary + { + { "LastAccessTime", directoryInfo.LastAccessTime.ToString("yyyy-MM-dd HH:mm:ss") } + }, + true) { - // 检索的是文件系统名称 - // 需要判断是否为文件夹进行升序排序 - // 参考 OssObjectComparer - - var xFolder = Directory.Exists(x); - var yFolder = Directory.Exists(y); - - if (xFolder && yFolder) - { - return x.CompareTo(y); - } - - if (xFolder && !yFolder) - { - return -1; - } - - if (!xFolder && yFolder) + FullName = directoryInfo.FullName.Replace(Environment.ContentRootPath, "") + }; + return ossObject; + } + else + { + var fileInfo = new FileInfo(filePath); + var fileStream = File.OpenRead(filePath); + var ossObject = new OssObject( + fileInfo.Name, + objectPath, + request.MD5 ? fileStream.MD5() : "", + fileInfo.CreationTime, + fileInfo.Length, + fileInfo.LastWriteTime, + new Dictionary { - return 1; - } + { "IsReadOnly", fileInfo.IsReadOnly.ToString() }, + { "LastAccessTime", fileInfo.LastAccessTime.ToString("yyyy-MM-dd HH:mm:ss") } + }) + { + FullName = fileInfo.FullName.Replace(Environment.ContentRootPath, "") + }; - return x.CompareTo(y); - }); + ossObject.SetContent(fileStream); - //// 需要计算从哪个位置截断 - //int markIndex = 0; - //if (!request.Marker.IsNullOrWhiteSpace()) - //{ - // markIndex = fileSystemNames.FindIndex(x => x.EndsWith(request.Marker)); - // if (markIndex < 0) - // { - // markIndex = 0; - // } - //} - - //// 需要截断Oss对象列表 - //var copyFileSystemNames = fileSystemNames; - //if (markIndex > 0) - //{ - // // fix: 翻页查询数组可能引起下标越界 - // // copyFileSystemNames = fileSystemNames[(markIndex+1)..]; - // copyFileSystemNames = fileSystemNames[markIndex..]; - //} - // Oss对象信息集合 - - static FileSystemInfo ConvertFileSystem(string path) + if (!request.Process.IsNullOrWhiteSpace()) { - if (File.Exists(path)) + using var serviceScope = ServiceProvider.CreateScope(); + var context = new FileSystemOssObjectContext(request.Process, ossObject, serviceScope.ServiceProvider); + foreach (var processer in Options.Processers) { - return new FileInfo(path); - } + await processer.ProcessAsync(context); - return new DirectoryInfo(path); + if (context.Handled) + { + ossObject.SetContent(context.Content); + break; + } + } } - var fileSystems = fileSystemNames - .AsQueryable() - .PageBy(request.Current, request.MaxKeys ?? 10) - .Select(ConvertFileSystem) - .ToArray(); + return ossObject; + } + } - var nextMarkerIndex = -1; - if (fileSystems.Length > 0) - { - // 计算下一页起始标记文件/目录名称 - nextMarkerIndex = fileSystemNames.FindIndex(x => x.EndsWith(fileSystems[^1].Name)); - } - var nextMarker = ""; - if (nextMarkerIndex >= 0 && nextMarkerIndex + 1 < fileSystemNames.Length) - { - nextMarker = fileSystemNames[nextMarkerIndex + 1]; - nextMarker = File.Exists(nextMarker) - ? new FileInfo(nextMarker).Name - : new DirectoryInfo(nextMarker).Name.EnsureEndsWith('/'); - } - // 返回Oss对象描述集合 - var response = new GetOssObjectsResponse( - request.BucketName, - request.Prefix, - request.Marker, - nextMarker, - "/", // 文件系统目录分隔符 - fileSystemNames.Length, - fileSystems.Select(x => new OssObject( - (x is DirectoryInfo) ? x.Name.EnsureEndsWith('/') : x.Name, - request.Prefix, - request.MD5 ? (x as FileInfo)?.OpenRead().MD5() ?? "" : "", - x.CreationTime, - (x as FileInfo)?.Length ?? 0L, - x.LastWriteTime, - new Dictionary - { - { "LastAccessTime", x.LastAccessTime.ToString("yyyy-MM-dd HH:mm:ss") } - }, - x is DirectoryInfo) - { - FullName = x.FullName.Replace(Environment.ContentRootPath, "") - }) - .ToList()); + public virtual Task GetListAsync(GetOssContainersRequest request) + { + // 不传递Bucket 检索根目录的Bucket + var filePath = CalculateFilePath(null); - return Task.FromResult(response); - } + // 获取根目录 + var directories = Directory.GetDirectories(filePath, request.Prefix ?? "*.*"); - protected virtual FileSystemBlobProviderConfiguration GetFileSystemConfiguration() + // 排序目录 + Array.Sort(directories, delegate (string x, string y) + { + return x.CompareTo(y); + }); + // 容器对应的目录信息集合 + // 本地文件系统直接用PageBy即可 + var directoryInfos = directories + .AsQueryable() + .PageBy(request.Current, request.MaxKeys ?? 10) + .Select(file => new DirectoryInfo(file)) + .ToArray(); + var nextMarkerIndex = directories.FindIndex(x => x.EndsWith(directoryInfos[directoryInfos.Length - 1].Name)); + string nextMarker = ""; + if (nextMarkerIndex >= 0 && nextMarkerIndex + 1 < directories.Length) { - var configuration = ConfigurationProvider.Get(); - var fileSystemConfiguration = configuration.GetFileSystemConfiguration(); - return fileSystemConfiguration; + nextMarker = directories[nextMarkerIndex + 1]; + nextMarker = new DirectoryInfo(nextMarker).Name; } + // 返回Oss容器描述集合 + var response = new GetOssContainersResponse( + request.Prefix, + request.Marker, + nextMarker, + directories.Length, + directoryInfos.Select(x => new OssContainer( + x.Name, + x.CreationTime, + 0L, + x.LastWriteTime, + new Dictionary + { + { "LastAccessTime", x.LastAccessTime.ToString("yyyy-MM-dd HH:mm:ss") } + })) + .ToList()); + + return Task.FromResult(response); + } - protected virtual string CalculateFilePath(string bucketName, string blobName = "") + public virtual Task GetObjectsAsync(GetOssObjectsRequest request) + { + // 先定位检索的目录 + var filePath = CalculateFilePath(request.BucketName, request.Prefix); + if (!Directory.Exists(filePath) && !request.CreatePathIsNotExists) + { + throw new BusinessException(code: OssManagementErrorCodes.ContainerNotFound); + // throw new ContainerNotFoundException($"Can't not found container {request.BucketName} in file system"); + } + DirectoryHelper.CreateIfNotExists(filePath); + // 目录也属于Oss对象,需要抽象的文件系统集合来存储 + var fileSystemNames = string.Equals(request.Delimiter, "/") + ? Directory.GetDirectories(filePath) + : Directory.GetFileSystemEntries(filePath); + + // 排序所有文件与目录 + Array.Sort(fileSystemNames, delegate (string x, string y) { - var fileSystemConfiguration = GetFileSystemConfiguration(); - var blobPath = fileSystemConfiguration.BasePath; + // 检索的是文件系统名称 + // 需要判断是否为文件夹进行升序排序 + // 参考 OssObjectComparer - if (CurrentTenant.Id == null) + var xFolder = Directory.Exists(x); + var yFolder = Directory.Exists(y); + + if (xFolder && yFolder) { - blobPath = Path.Combine(blobPath, "host"); + return x.CompareTo(y); } - else + + if (xFolder && !yFolder) { - blobPath = Path.Combine(blobPath, "tenants", CurrentTenant.Id.Value.ToString("D")); + return -1; } - // fix bug: 新租户可能无法检索不存在的目录,blob的根目录将自动创建 - DirectoryHelper.CreateIfNotExists(blobPath); - if (fileSystemConfiguration.AppendContainerNameToBasePath && - !bucketName.IsNullOrWhiteSpace()) + if (!xFolder && yFolder) { - blobPath = Path.Combine(blobPath, bucketName); + return 1; } - if (!blobName.IsNullOrWhiteSpace()) + + return x.CompareTo(y); + }); + + //// 需要计算从哪个位置截断 + //int markIndex = 0; + //if (!request.Marker.IsNullOrWhiteSpace()) + //{ + // markIndex = fileSystemNames.FindIndex(x => x.EndsWith(request.Marker)); + // if (markIndex < 0) + // { + // markIndex = 0; + // } + //} + + //// 需要截断Oss对象列表 + //var copyFileSystemNames = fileSystemNames; + //if (markIndex > 0) + //{ + // // fix: 翻页查询数组可能引起下标越界 + // // copyFileSystemNames = fileSystemNames[(markIndex+1)..]; + // copyFileSystemNames = fileSystemNames[markIndex..]; + //} + // Oss对象信息集合 + + static FileSystemInfo ConvertFileSystem(string path) + { + if (File.Exists(path)) { - // fix: If the user passes /, the disk root directory is retrieved - blobName = blobName.Equals("/") ? "./" : blobName; - blobPath = Path.Combine(blobPath, blobName); + return new FileInfo(path); } - return blobPath; + return new DirectoryInfo(path); } - protected virtual void CheckStaticBucket(string bucket) + var fileSystems = fileSystemNames + .AsQueryable() + .PageBy(request.Current, request.MaxKeys ?? 10) + .Select(ConvertFileSystem) + .ToArray(); + + var nextMarkerIndex = -1; + if (fileSystems.Length > 0) + { + // 计算下一页起始标记文件/目录名称 + nextMarkerIndex = fileSystemNames.FindIndex(x => x.EndsWith(fileSystems[^1].Name)); + } + var nextMarker = ""; + if (nextMarkerIndex >= 0 && nextMarkerIndex + 1 < fileSystemNames.Length) { - if (OssOptions.CheckStaticBucket(bucket)) + nextMarker = fileSystemNames[nextMarkerIndex + 1]; + nextMarker = File.Exists(nextMarker) + ? new FileInfo(nextMarker).Name + : new DirectoryInfo(nextMarker).Name.EnsureEndsWith('/'); + } + // 返回Oss对象描述集合 + var response = new GetOssObjectsResponse( + request.BucketName, + request.Prefix, + request.Marker, + nextMarker, + "/", // 文件系统目录分隔符 + fileSystemNames.Length, + fileSystems.Select(x => new OssObject( + (x is DirectoryInfo) ? x.Name.EnsureEndsWith('/') : x.Name, + request.Prefix, + request.MD5 ? (x as FileInfo)?.OpenRead().MD5() ?? "" : "", + x.CreationTime, + (x as FileInfo)?.Length ?? 0L, + x.LastWriteTime, + new Dictionary + { + { "LastAccessTime", x.LastAccessTime.ToString("yyyy-MM-dd HH:mm:ss") } + }, + x is DirectoryInfo) { - throw new BusinessException(code: OssManagementErrorCodes.ContainerDeleteWithStatic); - } + FullName = x.FullName.Replace(Environment.ContentRootPath, "") + }) + .ToList()); + + return Task.FromResult(response); + } + + protected virtual FileSystemBlobProviderConfiguration GetFileSystemConfiguration() + { + var configuration = ConfigurationProvider.Get(); + var fileSystemConfiguration = configuration.GetFileSystemConfiguration(); + return fileSystemConfiguration; + } + + protected virtual string CalculateFilePath(string bucketName, string blobName = "") + { + var fileSystemConfiguration = GetFileSystemConfiguration(); + var blobPath = fileSystemConfiguration.BasePath; + + if (CurrentTenant.Id == null) + { + blobPath = Path.Combine(blobPath, "host"); + } + else + { + blobPath = Path.Combine(blobPath, "tenants", CurrentTenant.Id.Value.ToString("D")); + } + // fix bug: 新租户可能无法检索不存在的目录,blob的根目录将自动创建 + DirectoryHelper.CreateIfNotExists(blobPath); + + if (fileSystemConfiguration.AppendContainerNameToBasePath && + !bucketName.IsNullOrWhiteSpace()) + { + blobPath = Path.Combine(blobPath, bucketName); + } + if (!blobName.IsNullOrWhiteSpace()) + { + // fix: If the user passes /, the disk root directory is retrieved + blobName = blobName.Equals("/") ? "./" : blobName; + blobPath = Path.Combine(blobPath, blobName); } - private void ThrowOfPathHasTooLong(string path) + return blobPath; + } + + protected virtual void CheckStaticBucket(string bucket) + { + if (OssOptions.CheckStaticBucket(bucket)) { - // Windows 133 260 - // Linux 255 4096 - //if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && path.Length >= 255) // 预留5位 - //{ - // throw new BusinessException(code: OssManagementErrorCodes.OssNameHasTooLong); - //} + throw new BusinessException(code: OssManagementErrorCodes.ContainerDeleteWithStatic); } } + + private void ThrowOfPathHasTooLong(string path) + { + // Windows 133 260 + // Linux 255 4096 + //if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && path.Length >= 255) // 预留5位 + //{ + // throw new BusinessException(code: OssManagementErrorCodes.OssNameHasTooLong); + //} + } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN/Abp/OssManagement/FileSystem/FileSystemOssContainerFactory.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN/Abp/OssManagement/FileSystem/FileSystemOssContainerFactory.cs index 7bb617608..60942b9ae 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN/Abp/OssManagement/FileSystem/FileSystemOssContainerFactory.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN/Abp/OssManagement/FileSystem/FileSystemOssContainerFactory.cs @@ -5,46 +5,45 @@ using Volo.Abp.BlobStoring.FileSystem; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.OssManagement.FileSystem +namespace LINGYUN.Abp.OssManagement.FileSystem; + +public class FileSystemOssContainerFactory : IOssContainerFactory { - public class FileSystemOssContainerFactory : IOssContainerFactory - { - protected ICurrentTenant CurrentTenant { get; } - protected IHostEnvironment Environment { get; } - protected IServiceProvider ServiceProvider { get; } - protected IBlobFilePathCalculator FilePathCalculator { get; } - protected IBlobContainerConfigurationProvider ConfigurationProvider { get; } - protected IOptions Options { get; } - protected IOptions OssOptions { get; } + protected ICurrentTenant CurrentTenant { get; } + protected IHostEnvironment Environment { get; } + protected IServiceProvider ServiceProvider { get; } + protected IBlobFilePathCalculator FilePathCalculator { get; } + protected IBlobContainerConfigurationProvider ConfigurationProvider { get; } + protected IOptions Options { get; } + protected IOptions OssOptions { get; } - public FileSystemOssContainerFactory( - ICurrentTenant currentTenant, - IHostEnvironment environment, - IServiceProvider serviceProvider, - IBlobFilePathCalculator blobFilePathCalculator, - IBlobContainerConfigurationProvider configurationProvider, - IOptions options, - IOptions ossOptions) - { - Environment = environment; - CurrentTenant = currentTenant; - ServiceProvider = serviceProvider; - FilePathCalculator = blobFilePathCalculator; - ConfigurationProvider = configurationProvider; - Options = options; - OssOptions = ossOptions; - } + public FileSystemOssContainerFactory( + ICurrentTenant currentTenant, + IHostEnvironment environment, + IServiceProvider serviceProvider, + IBlobFilePathCalculator blobFilePathCalculator, + IBlobContainerConfigurationProvider configurationProvider, + IOptions options, + IOptions ossOptions) + { + Environment = environment; + CurrentTenant = currentTenant; + ServiceProvider = serviceProvider; + FilePathCalculator = blobFilePathCalculator; + ConfigurationProvider = configurationProvider; + Options = options; + OssOptions = ossOptions; + } - public IOssContainer Create() - { - return new FileSystemOssContainer( - CurrentTenant, - Environment, - ServiceProvider, - FilePathCalculator, - ConfigurationProvider, - Options, - OssOptions); - } + public IOssContainer Create() + { + return new FileSystemOssContainer( + CurrentTenant, + Environment, + ServiceProvider, + FilePathCalculator, + ConfigurationProvider, + Options, + OssOptions); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN/Abp/OssManagement/FileSystem/FileSystemOssObjectContext.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN/Abp/OssManagement/FileSystem/FileSystemOssObjectContext.cs index 8a41266f8..5185a15fd 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN/Abp/OssManagement/FileSystem/FileSystemOssObjectContext.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN/Abp/OssManagement/FileSystem/FileSystemOssObjectContext.cs @@ -2,31 +2,30 @@ using System.IO; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.OssManagement.FileSystem +namespace LINGYUN.Abp.OssManagement.FileSystem; + +public class FileSystemOssObjectContext : IServiceProviderAccessor { - public class FileSystemOssObjectContext : IServiceProviderAccessor - { - public string Process { get; } - public OssObject OssObject { get; } - public bool Handled { get; private set; } - public Stream Content { get; private set; } - public IServiceProvider ServiceProvider { get; } + public string Process { get; } + public OssObject OssObject { get; } + public bool Handled { get; private set; } + public Stream Content { get; private set; } + public IServiceProvider ServiceProvider { get; } - public FileSystemOssObjectContext( - string process, - OssObject ossObject, - IServiceProvider serviceProvider) - { - Process = process; - OssObject = ossObject; - ServiceProvider = serviceProvider; - } + public FileSystemOssObjectContext( + string process, + OssObject ossObject, + IServiceProvider serviceProvider) + { + Process = process; + OssObject = ossObject; + ServiceProvider = serviceProvider; + } - public void SetContent(Stream content) - { - Content = content; - Content.Seek(0, SeekOrigin.Begin); - Handled = true; - } + public void SetContent(Stream content) + { + Content = content; + Content.Seek(0, SeekOrigin.Begin); + Handled = true; } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN/Abp/OssManagement/FileSystem/FileSystemOssOptions.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN/Abp/OssManagement/FileSystem/FileSystemOssOptions.cs index 5d5fd4f6c..b4f8dbb15 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN/Abp/OssManagement/FileSystem/FileSystemOssOptions.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN/Abp/OssManagement/FileSystem/FileSystemOssOptions.cs @@ -1,19 +1,18 @@ using JetBrains.Annotations; using System.Collections.Generic; -namespace LINGYUN.Abp.OssManagement.FileSystem +namespace LINGYUN.Abp.OssManagement.FileSystem; + +public class FileSystemOssOptions { - public class FileSystemOssOptions - { - [NotNull] - public List Processers { get; } + [NotNull] + public List Processers { get; } - public FileSystemOssOptions() + public FileSystemOssOptions() + { + Processers = new List { - Processers = new List - { - new NoneFileSystemOssObjectProcesser() - }; - } + new NoneFileSystemOssObjectProcesser() + }; } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN/Abp/OssManagement/FileSystem/FileSystemOssOptionsExtensions.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN/Abp/OssManagement/FileSystem/FileSystemOssOptionsExtensions.cs index 806052fbe..d88066af7 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN/Abp/OssManagement/FileSystem/FileSystemOssOptionsExtensions.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN/Abp/OssManagement/FileSystem/FileSystemOssOptionsExtensions.cs @@ -1,15 +1,14 @@ using System.Collections.Generic; -namespace LINGYUN.Abp.OssManagement.FileSystem +namespace LINGYUN.Abp.OssManagement.FileSystem; + +public static class FileSystemOssOptionsExtensions { - public static class FileSystemOssOptionsExtensions + public static void AddProcesser( + this FileSystemOssOptions options, + TProcesserContributor contributor) + where TProcesserContributor : IFileSystemOssObjectProcesserContributor { - public static void AddProcesser( - this FileSystemOssOptions options, - TProcesserContributor contributor) - where TProcesserContributor : IFileSystemOssObjectProcesserContributor - { - options.Processers.InsertBefore((x) => x is NoneFileSystemOssObjectProcesser, contributor); - } + options.Processers.InsertBefore((x) => x is NoneFileSystemOssObjectProcesser, contributor); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN/Abp/OssManagement/FileSystem/IFileSystemOssObjectProcesserContributor.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN/Abp/OssManagement/FileSystem/IFileSystemOssObjectProcesserContributor.cs index 9ac5df132..73ba2b716 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN/Abp/OssManagement/FileSystem/IFileSystemOssObjectProcesserContributor.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN/Abp/OssManagement/FileSystem/IFileSystemOssObjectProcesserContributor.cs @@ -1,9 +1,8 @@ using System.Threading.Tasks; -namespace LINGYUN.Abp.OssManagement.FileSystem +namespace LINGYUN.Abp.OssManagement.FileSystem; + +public interface IFileSystemOssObjectProcesserContributor { - public interface IFileSystemOssObjectProcesserContributor - { - Task ProcessAsync(FileSystemOssObjectContext context); - } + Task ProcessAsync(FileSystemOssObjectContext context); } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN/Abp/OssManagement/FileSystem/NoneFileSystemOssObjectProcesser.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN/Abp/OssManagement/FileSystem/NoneFileSystemOssObjectProcesser.cs index 2b337cf40..b1465a615 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN/Abp/OssManagement/FileSystem/NoneFileSystemOssObjectProcesser.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/LINGYUN/Abp/OssManagement/FileSystem/NoneFileSystemOssObjectProcesser.cs @@ -1,14 +1,13 @@ using System.Threading.Tasks; -namespace LINGYUN.Abp.OssManagement.FileSystem +namespace LINGYUN.Abp.OssManagement.FileSystem; + +public class NoneFileSystemOssObjectProcesser : IFileSystemOssObjectProcesserContributor { - public class NoneFileSystemOssObjectProcesser : IFileSystemOssObjectProcesserContributor + public Task ProcessAsync(FileSystemOssObjectContext context) { - public Task ProcessAsync(FileSystemOssObjectContext context) - { - context.SetContent(context.OssObject.Content); + context.SetContent(context.OssObject.Content); - return Task.CompletedTask; - } + return Task.CompletedTask; } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/System/IO/FileSystemExtensions.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/System/IO/FileSystemExtensions.cs index 1363051c7..5a6df4a04 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/System/IO/FileSystemExtensions.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.FileSystem/System/IO/FileSystemExtensions.cs @@ -1,25 +1,24 @@ using System.Security.Cryptography; using System.Text; -namespace System.IO +namespace System.IO; + +internal static class FileSystemExtensions { - internal static class FileSystemExtensions + public static string MD5(this FileStream stream) { - public static string MD5(this FileStream stream) + if (stream.CanSeek) { - if (stream.CanSeek) - { - stream.Seek(0, SeekOrigin.Begin); - } - using MD5 md5 = new MD5CryptoServiceProvider(); - byte[] retVal = md5.ComputeHash(stream); - StringBuilder sb = new StringBuilder(); - for (int i = 0; i < retVal.Length; i++) - { - sb.Append(retVal[i].ToString("x2")); - } stream.Seek(0, SeekOrigin.Begin); - return sb.ToString(); } + using MD5 md5 = new MD5CryptoServiceProvider(); + byte[] retVal = md5.ComputeHash(stream); + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < retVal.Length; i++) + { + sb.Append(retVal[i].ToString("x2")); + } + stream.Seek(0, SeekOrigin.Begin); + return sb.ToString(); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi.Client/LINGYUN.Abp.OssManagement.HttpApi.Client.csproj b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi.Client/LINGYUN.Abp.OssManagement.HttpApi.Client.csproj index 39e7ce18d..654e330a9 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi.Client/LINGYUN.Abp.OssManagement.HttpApi.Client.csproj +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi.Client/LINGYUN.Abp.OssManagement.HttpApi.Client.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.OssManagement.HttpApi.Client + LINGYUN.Abp.OssManagement.HttpApi.Client + false + false + false diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi.Client/LINGYUN/Abp/OssManagement/AbpOssManagementHttpApiClientModule.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi.Client/LINGYUN/Abp/OssManagement/AbpOssManagementHttpApiClientModule.cs index a774a27b5..10fda813c 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi.Client/LINGYUN/Abp/OssManagement/AbpOssManagementHttpApiClientModule.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi.Client/LINGYUN/Abp/OssManagement/AbpOssManagementHttpApiClientModule.cs @@ -2,19 +2,18 @@ using Volo.Abp.Http.Client; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +[DependsOn( + typeof(AbpOssManagementApplicationContractsModule), + typeof(AbpHttpClientModule))] +public class AbpOssManagementHttpApiClientModule : AbpModule { - [DependsOn( - typeof(AbpOssManagementApplicationContractsModule), - typeof(AbpHttpClientModule))] - public class AbpOssManagementHttpApiClientModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddHttpClientProxies( - typeof(AbpOssManagementApplicationContractsModule).Assembly, - OssManagementRemoteServiceConsts.RemoteServiceName - ); - } + context.Services.AddHttpClientProxies( + typeof(AbpOssManagementApplicationContractsModule).Assembly, + OssManagementRemoteServiceConsts.RemoteServiceName + ); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN.Abp.OssManagement.HttpApi.csproj b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN.Abp.OssManagement.HttpApi.csproj index 5a355f5e4..af51f05e0 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN.Abp.OssManagement.HttpApi.csproj +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN.Abp.OssManagement.HttpApi.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.OssManagement.HttpApi + LINGYUN.Abp.OssManagement.HttpApi + false + false + false diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN/Abp/OssManagement/AbpOssManagementHttpApiModule.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN/Abp/OssManagement/AbpOssManagementHttpApiModule.cs index 1666dd651..4e1fe69f7 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN/Abp/OssManagement/AbpOssManagementHttpApiModule.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN/Abp/OssManagement/AbpOssManagementHttpApiModule.cs @@ -8,40 +8,39 @@ using Volo.Abp.AspNetCore.Mvc.DataAnnotations; using Volo.Abp.AspNetCore.Mvc.Localization; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +[DependsOn( + typeof(AbpOssManagementApplicationContractsModule), + typeof(AbpAspNetCoreMvcModule) + )] +public class AbpOssManagementHttpApiModule : AbpModule { - [DependsOn( - typeof(AbpOssManagementApplicationContractsModule), - typeof(AbpAspNetCoreMvcModule) - )] - public class AbpOssManagementHttpApiModule : AbpModule + public override void PreConfigureServices(ServiceConfigurationContext context) { - public override void PreConfigureServices(ServiceConfigurationContext context) + PreConfigure(mvcBuilder => { - PreConfigure(mvcBuilder => - { - mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpOssManagementHttpApiModule).Assembly); - }); - - PreConfigure(options => - { - options.AddAssemblyResource( - typeof(AbpOssManagementResource), - typeof(AbpOssManagementApplicationContractsModule).Assembly); - }); - } + mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpOssManagementHttpApiModule).Assembly); + }); - //public override void ConfigureServices(ServiceConfigurationContext context) - //{ - // Configure(options => - // { - // options.Resources - // .Get() - // .AddBaseTypes( - // typeof(AbpAuthorizationResource), - // typeof(AbpValidationResource) - // ); - // }); - //} + PreConfigure(options => + { + options.AddAssemblyResource( + typeof(AbpOssManagementResource), + typeof(AbpOssManagementApplicationContractsModule).Assembly); + }); } + + //public override void ConfigureServices(ServiceConfigurationContext context) + //{ + // Configure(options => + // { + // options.Resources + // .Get() + // .AddBaseTypes( + // typeof(AbpAuthorizationResource), + // typeof(AbpValidationResource) + // ); + // }); + //} } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN/Abp/OssManagement/OssContainerController.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN/Abp/OssManagement/OssContainerController.cs index 01d311081..f6595ea2f 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN/Abp/OssManagement/OssContainerController.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN/Abp/OssManagement/OssContainerController.cs @@ -3,53 +3,52 @@ using Volo.Abp; using Volo.Abp.AspNetCore.Mvc; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +[RemoteService(Name = OssManagementRemoteServiceConsts.RemoteServiceName)] +[Area("oss-management")] +[Route("api/oss-management/containes")] +public class OssContainerController : AbpControllerBase, IOssContainerAppService { - [RemoteService(Name = OssManagementRemoteServiceConsts.RemoteServiceName)] - [Area("oss-management")] - [Route("api/oss-management/containes")] - public class OssContainerController : AbpControllerBase, IOssContainerAppService + protected IOssContainerAppService OssContainerAppService { get; } + + public OssContainerController( + IOssContainerAppService ossContainerAppService) + { + OssContainerAppService = ossContainerAppService; + } + + [HttpPost] + [Route("{name}")] + public async virtual Task CreateAsync(string name) + { + return await OssContainerAppService.CreateAsync(name); + } + + [HttpDelete] + [Route("{name}")] + public async virtual Task DeleteAsync(string name) + { + await OssContainerAppService.DeleteAsync(name); + } + + [HttpGet] + [Route("{name}")] + public async virtual Task GetAsync(string name) + { + return await OssContainerAppService.GetAsync(name); + } + + [HttpGet] + public async virtual Task GetListAsync(GetOssContainersInput input) + { + return await OssContainerAppService.GetListAsync(input); + } + + [HttpGet] + [Route("objects")] + public async virtual Task GetObjectListAsync(GetOssObjectsInput input) { - protected IOssContainerAppService OssContainerAppService { get; } - - public OssContainerController( - IOssContainerAppService ossContainerAppService) - { - OssContainerAppService = ossContainerAppService; - } - - [HttpPost] - [Route("{name}")] - public async virtual Task CreateAsync(string name) - { - return await OssContainerAppService.CreateAsync(name); - } - - [HttpDelete] - [Route("{name}")] - public async virtual Task DeleteAsync(string name) - { - await OssContainerAppService.DeleteAsync(name); - } - - [HttpGet] - [Route("{name}")] - public async virtual Task GetAsync(string name) - { - return await OssContainerAppService.GetAsync(name); - } - - [HttpGet] - public async virtual Task GetListAsync(GetOssContainersInput input) - { - return await OssContainerAppService.GetListAsync(input); - } - - [HttpGet] - [Route("objects")] - public async virtual Task GetObjectListAsync(GetOssObjectsInput input) - { - return await OssContainerAppService.GetObjectListAsync(input); - } + return await OssContainerAppService.GetObjectListAsync(input); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN/Abp/OssManagement/OssObjectController.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN/Abp/OssManagement/OssObjectController.cs index f79a81bd9..5e5d98a69 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN/Abp/OssManagement/OssObjectController.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN/Abp/OssManagement/OssObjectController.cs @@ -7,63 +7,62 @@ using Volo.Abp.Auditing; using Volo.Abp.Content; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +[RemoteService(Name = OssManagementRemoteServiceConsts.RemoteServiceName)] +[Area("oss-management")] +[Route("api/oss-management/objects")] +public class OssObjectController : AbpControllerBase, IOssObjectAppService { - [RemoteService(Name = OssManagementRemoteServiceConsts.RemoteServiceName)] - [Area("oss-management")] - [Route("api/oss-management/objects")] - public class OssObjectController : AbpControllerBase, IOssObjectAppService - { - protected IFileUploader FileUploader { get; } - protected IOssObjectAppService OssObjectAppService { get; } + protected IFileUploader FileUploader { get; } + protected IOssObjectAppService OssObjectAppService { get; } - public OssObjectController( - IFileUploader fileUploader, - IOssObjectAppService ossObjectAppService) - { - FileUploader = fileUploader; - OssObjectAppService = ossObjectAppService; - } + public OssObjectController( + IFileUploader fileUploader, + IOssObjectAppService ossObjectAppService) + { + FileUploader = fileUploader; + OssObjectAppService = ossObjectAppService; + } - [HttpPost] - public async virtual Task CreateAsync([FromForm] CreateOssObjectInput input) - { - return await OssObjectAppService.CreateAsync(input); - } + [HttpPost] + public async virtual Task CreateAsync([FromForm] CreateOssObjectInput input) + { + return await OssObjectAppService.CreateAsync(input); + } - [HttpPost] - [Route("upload")] - [DisableAuditing] - [Authorize(AbpOssManagementPermissions.OssObject.Create)] - public async virtual Task UploadAsync([FromForm] UploadFileChunkInput input) - { - await FileUploader.UploadAsync(input); - } + [HttpPost] + [Route("upload")] + [DisableAuditing] + [Authorize(AbpOssManagementPermissions.OssObject.Create)] + public async virtual Task UploadAsync([FromForm] UploadFileChunkInput input) + { + await FileUploader.UploadAsync(input); + } - [HttpPost] - [Route("bulk-delete")] - public async virtual Task BulkDeleteAsync(BulkDeleteOssObjectInput input) - { - await OssObjectAppService.BulkDeleteAsync(input); - } + [HttpPost] + [Route("bulk-delete")] + public async virtual Task BulkDeleteAsync(BulkDeleteOssObjectInput input) + { + await OssObjectAppService.BulkDeleteAsync(input); + } - [HttpDelete] - public async virtual Task DeleteAsync(GetOssObjectInput input) - { - await OssObjectAppService.DeleteAsync(input); - } + [HttpDelete] + public async virtual Task DeleteAsync(GetOssObjectInput input) + { + await OssObjectAppService.DeleteAsync(input); + } - [HttpGet] - public async virtual Task GetAsync(GetOssObjectInput input) - { - return await OssObjectAppService.GetAsync(input); - } + [HttpGet] + public async virtual Task GetAsync(GetOssObjectInput input) + { + return await OssObjectAppService.GetAsync(input); + } - [HttpGet] - [Route("download")] - public async virtual Task GetContentAsync(GetOssObjectInput input) - { - return await OssObjectAppService.GetContentAsync(input); - } + [HttpGet] + [Route("download")] + public async virtual Task GetContentAsync(GetOssObjectInput input) + { + return await OssObjectAppService.GetContentAsync(input); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN/Abp/OssManagement/PrivateFilesController.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN/Abp/OssManagement/PrivateFilesController.cs index cfce7ba9d..ee1b98f90 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN/Abp/OssManagement/PrivateFilesController.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN/Abp/OssManagement/PrivateFilesController.cs @@ -9,78 +9,77 @@ using Volo.Abp.Content; using Volo.Abp.Validation; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +[RemoteService(Name = OssManagementRemoteServiceConsts.RemoteServiceName)] +[Area("oss-management")] +[Route("api/files/private")] +public class PrivateFilesController : AbpControllerBase, IPrivateFileAppService { - [RemoteService(Name = OssManagementRemoteServiceConsts.RemoteServiceName)] - [Area("oss-management")] - [Route("api/files/private")] - public class PrivateFilesController : AbpControllerBase, IPrivateFileAppService - { - private readonly IPrivateFileAppService _service; + private readonly IPrivateFileAppService _service; - public PrivateFilesController( - IPrivateFileAppService service) - { - _service = service; + public PrivateFilesController( + IPrivateFileAppService service) + { + _service = service; - LocalizationResource = typeof(AbpOssManagementResource); - } + LocalizationResource = typeof(AbpOssManagementResource); + } - [HttpPost] - public async virtual Task UploadAsync([FromForm] UploadFileInput input) - { - return await _service.UploadAsync(input); - } + [HttpPost] + public async virtual Task UploadAsync([FromForm] UploadFileInput input) + { + return await _service.UploadAsync(input); + } - [HttpPost] - [Route("upload")] - public async virtual Task UploadAsync([FromForm] UploadFileChunkInput input) - { - await _service.UploadAsync(input); - } + [HttpPost] + [Route("upload")] + public async virtual Task UploadAsync([FromForm] UploadFileChunkInput input) + { + await _service.UploadAsync(input); + } - [HttpGet] - [Route("search")] - public async virtual Task> GetListAsync(GetFilesInput input) - { - return await _service.GetListAsync(input); - } + [HttpGet] + [Route("search")] + public async virtual Task> GetListAsync(GetFilesInput input) + { + return await _service.GetListAsync(input); + } - [HttpGet] - [Route("{Name}")] - [Route("{Name}/{Process}")] - [Route("p/{Path}/{Name}")] - [Route("p/{Path}/{Name}/{Process}")] - [Route("t/{TenantId}/{Name}")] - [Route("t/{TenantId}/{Name}/{Process}")] - [Route("t/{TenantId}/p/{Path}/{Name}")] - [Route("t/{TenantId}/p/{Path}/{Name}/{Process}")] - public async virtual Task GetAsync([FromRoute] GetPublicFileInput input) + [HttpGet] + [Route("{Name}")] + [Route("{Name}/{Process}")] + [Route("p/{Path}/{Name}")] + [Route("p/{Path}/{Name}/{Process}")] + [Route("t/{TenantId}/{Name}")] + [Route("t/{TenantId}/{Name}/{Process}")] + [Route("t/{TenantId}/p/{Path}/{Name}")] + [Route("t/{TenantId}/p/{Path}/{Name}/{Process}")] + public async virtual Task GetAsync([FromRoute] GetPublicFileInput input) + { + using (CurrentTenant.Change(input.GetTenantId(CurrentTenant))) { - using (CurrentTenant.Change(input.GetTenantId(CurrentTenant))) - { - return await _service.GetAsync(input); - } + return await _service.GetAsync(input); } + } - [HttpDelete] - public async virtual Task DeleteAsync(GetPublicFileInput input) - { - await _service.DeleteAsync(input); - } + [HttpDelete] + public async virtual Task DeleteAsync(GetPublicFileInput input) + { + await _service.DeleteAsync(input); + } - [HttpGet] - [Route("share")] - public async virtual Task> GetShareListAsync() - { - return await _service.GetShareListAsync(); - } + [HttpGet] + [Route("share")] + public async virtual Task> GetShareListAsync() + { + return await _service.GetShareListAsync(); + } - [HttpPost] - [Route("share")] - public async virtual Task ShareAsync(FileShareInput input) - { - return await _service.ShareAsync(input); - } + [HttpPost] + [Route("share")] + public async virtual Task ShareAsync(FileShareInput input) + { + return await _service.ShareAsync(input); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN/Abp/OssManagement/PublicFilesController.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN/Abp/OssManagement/PublicFilesController.cs index c6066e909..8e9b6eedc 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN/Abp/OssManagement/PublicFilesController.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN/Abp/OssManagement/PublicFilesController.cs @@ -6,66 +6,65 @@ using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.Content; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +[RemoteService(Name = OssManagementRemoteServiceConsts.RemoteServiceName)] +[Area("oss-management")] +[Route("api/files/public")] +public class PublicFilesController : AbpControllerBase, IPublicFileAppService { - [RemoteService(Name = OssManagementRemoteServiceConsts.RemoteServiceName)] - [Area("oss-management")] - [Route("api/files/public")] - public class PublicFilesController : AbpControllerBase, IPublicFileAppService - { - private readonly IPublicFileAppService _publicFileAppService; + private readonly IPublicFileAppService _publicFileAppService; - public PublicFilesController( - IPublicFileAppService publicFileAppService) - { - _publicFileAppService = publicFileAppService; + public PublicFilesController( + IPublicFileAppService publicFileAppService) + { + _publicFileAppService = publicFileAppService; - LocalizationResource = typeof(AbpOssManagementResource); - } + LocalizationResource = typeof(AbpOssManagementResource); + } - [HttpPost] - public async virtual Task UploadAsync([FromForm] UploadFileInput input) - { - return await _publicFileAppService.UploadAsync(input); - } + [HttpPost] + public async virtual Task UploadAsync([FromForm] UploadFileInput input) + { + return await _publicFileAppService.UploadAsync(input); + } - [HttpPost] - [Route("upload")] - public async virtual Task UploadAsync([FromForm] UploadFileChunkInput input) - { - await _publicFileAppService.UploadAsync(input); - } + [HttpPost] + [Route("upload")] + public async virtual Task UploadAsync([FromForm] UploadFileChunkInput input) + { + await _publicFileAppService.UploadAsync(input); + } - [HttpGet] - [Route("search")] - public async virtual Task> GetListAsync(GetFilesInput input) - { - return await _publicFileAppService.GetListAsync(input); - } + [HttpGet] + [Route("search")] + public async virtual Task> GetListAsync(GetFilesInput input) + { + return await _publicFileAppService.GetListAsync(input); + } - [HttpGet] - [Route("{Name}")] - [Route("{Name}/{Process}")] - [Route("p/{Path}/{Name}")] - [Route("p/{Path}/{Name}/{Process}")] - [Route("t/{TenantId}/{Name}")] - [Route("t/{TenantId}/{Name}/{Process}")] - [Route("t/{TenantId}/p/{Path}/{Name}")] - [Route("t/{TenantId}/p/{Path}/{Name}/{Process}")] - public async virtual Task GetAsync([FromRoute] GetPublicFileInput input) + [HttpGet] + [Route("{Name}")] + [Route("{Name}/{Process}")] + [Route("p/{Path}/{Name}")] + [Route("p/{Path}/{Name}/{Process}")] + [Route("t/{TenantId}/{Name}")] + [Route("t/{TenantId}/{Name}/{Process}")] + [Route("t/{TenantId}/p/{Path}/{Name}")] + [Route("t/{TenantId}/p/{Path}/{Name}/{Process}")] + public async virtual Task GetAsync([FromRoute] GetPublicFileInput input) + { + using (CurrentTenant.Change(input.GetTenantId(CurrentTenant))) { - using (CurrentTenant.Change(input.GetTenantId(CurrentTenant))) - { - return await _publicFileAppService.GetAsync(input); - } + return await _publicFileAppService.GetAsync(input); } + } - [HttpDelete] - public async virtual Task DeleteAsync(GetPublicFileInput input) - { - await _publicFileAppService.DeleteAsync(input); - } + [HttpDelete] + public async virtual Task DeleteAsync(GetPublicFileInput input) + { + await _publicFileAppService.DeleteAsync(input); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN/Abp/OssManagement/ShareFilesController.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN/Abp/OssManagement/ShareFilesController.cs index 102e29849..a68ee045c 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN/Abp/OssManagement/ShareFilesController.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN/Abp/OssManagement/ShareFilesController.cs @@ -5,29 +5,28 @@ using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.Content; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +[Area("oss-management")] +[Route("api/files/share")] +[RemoteService(false)] +[ApiExplorerSettings(IgnoreApi = true)] +public class ShareFilesController : AbpControllerBase, IShareFileAppService { - [Area("oss-management")] - [Route("api/files/share")] - [RemoteService(false)] - [ApiExplorerSettings(IgnoreApi = true)] - public class ShareFilesController : AbpControllerBase, IShareFileAppService - { - private readonly IShareFileAppService _service; + private readonly IShareFileAppService _service; - public ShareFilesController( - IShareFileAppService service) - { - _service = service; + public ShareFilesController( + IShareFileAppService service) + { + _service = service; - LocalizationResource = typeof(AbpOssManagementResource); - } + LocalizationResource = typeof(AbpOssManagementResource); + } - [HttpGet] - [Route("{url}")] - public virtual Task GetAsync(string url) - { - return _service.GetAsync(url); - } + [HttpGet] + [Route("{url}")] + public virtual Task GetAsync(string url) + { + return _service.GetAsync(url); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN/Abp/OssManagement/StaticFilesController.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN/Abp/OssManagement/StaticFilesController.cs index 0f395f73d..77aa9d2a7 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN/Abp/OssManagement/StaticFilesController.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN/Abp/OssManagement/StaticFilesController.cs @@ -7,48 +7,47 @@ using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.Content; -namespace LINGYUN.Abp.OssManagement +namespace LINGYUN.Abp.OssManagement; + +[RemoteService(Name = OssManagementRemoteServiceConsts.RemoteServiceName)] +[Area("oss-management")] +[Route("api/files/static")] +public class StaticFilesController : AbpControllerBase, IStaticFilesAppService { - [RemoteService(Name = OssManagementRemoteServiceConsts.RemoteServiceName)] - [Area("oss-management")] - [Route("api/files/static")] - public class StaticFilesController : AbpControllerBase, IStaticFilesAppService - { - private readonly IOssObjectAppService _ossObjectAppService; - private readonly IStaticFilesAppService _staticFilesAppServic; + private readonly IOssObjectAppService _ossObjectAppService; + private readonly IStaticFilesAppService _staticFilesAppServic; - public StaticFilesController( - IOssObjectAppService ossObjectAppService, - IStaticFilesAppService staticFilesAppServic) - { - _ossObjectAppService = ossObjectAppService; - _staticFilesAppServic = staticFilesAppServic; + public StaticFilesController( + IOssObjectAppService ossObjectAppService, + IStaticFilesAppService staticFilesAppServic) + { + _ossObjectAppService = ossObjectAppService; + _staticFilesAppServic = staticFilesAppServic; - LocalizationResource = typeof(AbpOssManagementResource); - } + LocalizationResource = typeof(AbpOssManagementResource); + } - [HttpPost] - [Authorize(AbpOssManagementPermissions.OssObject.Create)] - public async virtual Task UploadAsync([FromForm] CreateOssObjectInput input) - { - return await _ossObjectAppService.CreateAsync(input); - } + [HttpPost] + [Authorize(AbpOssManagementPermissions.OssObject.Create)] + public async virtual Task UploadAsync([FromForm] CreateOssObjectInput input) + { + return await _ossObjectAppService.CreateAsync(input); + } - [HttpGet] - [Route("{Bucket}/{Name}")] - [Route("{Bucket}/{Name}/{Process}")] - [Route("{Bucket}/p/{Path}/{Name}")] - [Route("{Bucket}/p/{Path}/{Name}/{Process}")] - [Route("t/{TenantId}/{Bucket}/{Name}")] - [Route("t/{TenantId}/{Bucket}/{Name}/{Process}")] - [Route("t/{TenantId}/{Bucket}/p/{Path}/{Name}")] - [Route("t/{TenantId}/{Bucket}/p/{Path}/{Name}/{Process}")] - public async virtual Task GetAsync([FromRoute] GetStaticFileInput input) + [HttpGet] + [Route("{Bucket}/{Name}")] + [Route("{Bucket}/{Name}/{Process}")] + [Route("{Bucket}/p/{Path}/{Name}")] + [Route("{Bucket}/p/{Path}/{Name}/{Process}")] + [Route("t/{TenantId}/{Bucket}/{Name}")] + [Route("t/{TenantId}/{Bucket}/{Name}/{Process}")] + [Route("t/{TenantId}/{Bucket}/p/{Path}/{Name}")] + [Route("t/{TenantId}/{Bucket}/p/{Path}/{Name}/{Process}")] + public async virtual Task GetAsync([FromRoute] GetStaticFileInput input) + { + using (CurrentTenant.Change(input.GetTenantId(CurrentTenant))) { - using (CurrentTenant.Change(input.GetTenantId(CurrentTenant))) - { - return await _staticFilesAppServic.GetAsync(input); - } + return await _staticFilesAppServic.GetAsync(input); } } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Nexus/LINGYUN.Abp.OssManagement.Nexus.csproj b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Nexus/LINGYUN.Abp.OssManagement.Nexus.csproj index 0d9f70268..477b42a51 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Nexus/LINGYUN.Abp.OssManagement.Nexus.csproj +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Nexus/LINGYUN.Abp.OssManagement.Nexus.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + net8.0 + LINGYUN.Abp.OssManagement.Nexus + LINGYUN.Abp.OssManagement.Nexus + false + false + false diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Nexus/System/IO/SystemExtensions.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Nexus/System/IO/SystemExtensions.cs index 5a28f21d1..f0037ca87 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Nexus/System/IO/SystemExtensions.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Nexus/System/IO/SystemExtensions.cs @@ -1,25 +1,24 @@ using System.Security.Cryptography; using System.Text; -namespace System.IO +namespace System.IO; + +internal static class SystemExtensions { - internal static class SystemExtensions + public static string MD5(this Stream stream) { - public static string MD5(this Stream stream) + if (stream.CanSeek) { - if (stream.CanSeek) - { - stream.Seek(0, SeekOrigin.Begin); - } - using MD5 md5 = new MD5CryptoServiceProvider(); - byte[] retVal = md5.ComputeHash(stream); - StringBuilder sb = new StringBuilder(); - for (int i = 0; i < retVal.Length; i++) - { - sb.Append(retVal[i].ToString("x2")); - } stream.Seek(0, SeekOrigin.Begin); - return sb.ToString(); } + using MD5 md5 = new MD5CryptoServiceProvider(); + byte[] retVal = md5.ComputeHash(stream); + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < retVal.Length; i++) + { + sb.Append(retVal[i].ToString("x2")); + } + stream.Seek(0, SeekOrigin.Begin); + return sb.ToString(); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.SettingManagement/LINGYUN.Abp.OssManagement.SettingManagement.csproj b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.SettingManagement/LINGYUN.Abp.OssManagement.SettingManagement.csproj index 89f931819..693719e65 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.SettingManagement/LINGYUN.Abp.OssManagement.SettingManagement.csproj +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.SettingManagement/LINGYUN.Abp.OssManagement.SettingManagement.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.OssManagement.SettingManagement + LINGYUN.Abp.OssManagement.SettingManagement + false + false + false diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.SettingManagement/LINGYUN/Abp/OssManagement/SettingManagement/AbpOssManagementSettingManagementModule.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.SettingManagement/LINGYUN/Abp/OssManagement/SettingManagement/AbpOssManagementSettingManagementModule.cs index 9e120094b..bcb49ef35 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.SettingManagement/LINGYUN/Abp/OssManagement/SettingManagement/AbpOssManagementSettingManagementModule.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.SettingManagement/LINGYUN/Abp/OssManagement/SettingManagement/AbpOssManagementSettingManagementModule.cs @@ -2,19 +2,18 @@ using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.OssManagement.SettingManagement +namespace LINGYUN.Abp.OssManagement.SettingManagement; + +[DependsOn( + typeof(AbpOssManagementApplicationContractsModule), + typeof(AbpAspNetCoreMvcModule))] +public class AbpOssManagementSettingManagementModule : AbpModule { - [DependsOn( - typeof(AbpOssManagementApplicationContractsModule), - typeof(AbpAspNetCoreMvcModule))] - public class AbpOssManagementSettingManagementModule : AbpModule + public override void PreConfigureServices(ServiceConfigurationContext context) { - public override void PreConfigureServices(ServiceConfigurationContext context) + PreConfigure(mvcBuilder => { - PreConfigure(mvcBuilder => - { - mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpOssManagementSettingManagementModule).Assembly); - }); - } + mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpOssManagementSettingManagementModule).Assembly); + }); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.SettingManagement/LINGYUN/Abp/OssManagement/SettingManagement/IOssManagementSettingAppService.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.SettingManagement/LINGYUN/Abp/OssManagement/SettingManagement/IOssManagementSettingAppService.cs index b22edcb04..60abf0008 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.SettingManagement/LINGYUN/Abp/OssManagement/SettingManagement/IOssManagementSettingAppService.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.SettingManagement/LINGYUN/Abp/OssManagement/SettingManagement/IOssManagementSettingAppService.cs @@ -1,8 +1,7 @@ using LINGYUN.Abp.SettingManagement; -namespace LINGYUN.Abp.OssManagement.SettingManagement +namespace LINGYUN.Abp.OssManagement.SettingManagement; + +public interface IOssManagementSettingAppService : IReadonlySettingAppService { - public interface IOssManagementSettingAppService : IReadonlySettingAppService - { - } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.SettingManagement/LINGYUN/Abp/OssManagement/SettingManagement/OssManagementSettingAppService.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.SettingManagement/LINGYUN/Abp/OssManagement/SettingManagement/OssManagementSettingAppService.cs index c7d4b8ae0..133b808ba 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.SettingManagement/LINGYUN/Abp/OssManagement/SettingManagement/OssManagementSettingAppService.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.SettingManagement/LINGYUN/Abp/OssManagement/SettingManagement/OssManagementSettingAppService.cs @@ -11,62 +11,61 @@ using Volo.Abp.Settings; using ValueType = LINGYUN.Abp.SettingManagement.ValueType; -namespace LINGYUN.Abp.OssManagement.SettingManagement +namespace LINGYUN.Abp.OssManagement.SettingManagement; + +public class OssManagementSettingAppService : ApplicationService, IOssManagementSettingAppService { - public class OssManagementSettingAppService : ApplicationService, IOssManagementSettingAppService + protected ISettingManager SettingManager { get; } + protected IPermissionChecker PermissionChecker { get; } + protected ISettingDefinitionManager SettingDefinitionManager { get; } + + public OssManagementSettingAppService( + ISettingManager settingManager, + IPermissionChecker permissionChecker, + ISettingDefinitionManager settingDefinitionManager) { - protected ISettingManager SettingManager { get; } - protected IPermissionChecker PermissionChecker { get; } - protected ISettingDefinitionManager SettingDefinitionManager { get; } + SettingManager = settingManager; + PermissionChecker = permissionChecker; + SettingDefinitionManager = settingDefinitionManager; + LocalizationResource = typeof(AbpOssManagementResource); + } - public OssManagementSettingAppService( - ISettingManager settingManager, - IPermissionChecker permissionChecker, - ISettingDefinitionManager settingDefinitionManager) - { - SettingManager = settingManager; - PermissionChecker = permissionChecker; - SettingDefinitionManager = settingDefinitionManager; - LocalizationResource = typeof(AbpOssManagementResource); - } + public async virtual Task GetAllForCurrentTenantAsync() + { + return await GetAllForProviderAsync(TenantSettingValueProvider.ProviderName, CurrentTenant.GetId().ToString()); + } - public async virtual Task GetAllForCurrentTenantAsync() - { - return await GetAllForProviderAsync(TenantSettingValueProvider.ProviderName, CurrentTenant.GetId().ToString()); - } + public async virtual Task GetAllForGlobalAsync() + { + return await GetAllForProviderAsync(GlobalSettingValueProvider.ProviderName, null); + } - public async virtual Task GetAllForGlobalAsync() - { - return await GetAllForProviderAsync(GlobalSettingValueProvider.ProviderName, null); - } + protected async virtual Task GetAllForProviderAsync(string providerName, string providerKey) + { + var settingGroups = new SettingGroupResult(); - protected async virtual Task GetAllForProviderAsync(string providerName, string providerKey) + // 无权限返回空结果,直接报错的话,网关聚合会抛出异常 + if (await FeatureChecker.IsEnabledAsync(AbpOssManagementFeatureNames.OssObject.Enable) && + await PermissionChecker.IsGrantedAsync(AbpOssManagementPermissions.OssObject.Default)) { - var settingGroups = new SettingGroupResult(); - - // 无权限返回空结果,直接报错的话,网关聚合会抛出异常 - if (await FeatureChecker.IsEnabledAsync(AbpOssManagementFeatureNames.OssObject.Enable) && - await PermissionChecker.IsGrantedAsync(AbpOssManagementPermissions.OssObject.Default)) - { - var ossSettingGroup = new SettingGroupDto(L["DisplayName:OssManagement"], L["Description:OssManagement"]); + var ossSettingGroup = new SettingGroupDto(L["DisplayName:OssManagement"], L["Description:OssManagement"]); - var ossObjectSetting = ossSettingGroup.AddSetting(L["DisplayName:OssObject"], L["Description:OssObject"]); + var ossObjectSetting = ossSettingGroup.AddSetting(L["DisplayName:OssObject"], L["Description:OssObject"]); - ossObjectSetting.AddDetail( - await SettingDefinitionManager.GetAsync(AbpOssManagementSettingNames.FileLimitLength), - StringLocalizerFactory, - await SettingManager.GetOrNullAsync(AbpOssManagementSettingNames.FileLimitLength, providerName, providerKey), - ValueType.Number); - ossObjectSetting.AddDetail( - await SettingDefinitionManager.GetAsync(AbpOssManagementSettingNames.AllowFileExtensions), - StringLocalizerFactory, - await SettingManager.GetOrNullAsync(AbpOssManagementSettingNames.AllowFileExtensions, providerName, providerKey), - ValueType.String); + ossObjectSetting.AddDetail( + await SettingDefinitionManager.GetAsync(AbpOssManagementSettingNames.FileLimitLength), + StringLocalizerFactory, + await SettingManager.GetOrNullAsync(AbpOssManagementSettingNames.FileLimitLength, providerName, providerKey), + ValueType.Number); + ossObjectSetting.AddDetail( + await SettingDefinitionManager.GetAsync(AbpOssManagementSettingNames.AllowFileExtensions), + StringLocalizerFactory, + await SettingManager.GetOrNullAsync(AbpOssManagementSettingNames.AllowFileExtensions, providerName, providerKey), + ValueType.String); - settingGroups.AddGroup(ossSettingGroup); - } - - return settingGroups; + settingGroups.AddGroup(ossSettingGroup); } + + return settingGroups; } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.SettingManagement/LINGYUN/Abp/OssManagement/SettingManagement/OssManagementSettingController.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.SettingManagement/LINGYUN/Abp/OssManagement/SettingManagement/OssManagementSettingController.cs index d8076135f..b9cb26e27 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.SettingManagement/LINGYUN/Abp/OssManagement/SettingManagement/OssManagementSettingController.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.SettingManagement/LINGYUN/Abp/OssManagement/SettingManagement/OssManagementSettingController.cs @@ -4,33 +4,32 @@ using Volo.Abp; using Volo.Abp.AspNetCore.Mvc; -namespace LINGYUN.Abp.OssManagement.SettingManagement +namespace LINGYUN.Abp.OssManagement.SettingManagement; + +[RemoteService(Name = OssManagementRemoteServiceConsts.RemoteServiceName)] +[Area("settingManagement")] +[Route("api/setting-management/oss-management")] +public class OssManagementSettingController : AbpControllerBase, IOssManagementSettingAppService { - [RemoteService(Name = OssManagementRemoteServiceConsts.RemoteServiceName)] - [Area("settingManagement")] - [Route("api/setting-management/oss-management")] - public class OssManagementSettingController : AbpControllerBase, IOssManagementSettingAppService - { - protected IOssManagementSettingAppService WeChatSettingAppService { get; } + protected IOssManagementSettingAppService WeChatSettingAppService { get; } - public OssManagementSettingController( - IOssManagementSettingAppService weChatSettingAppService) - { - WeChatSettingAppService = weChatSettingAppService; - } + public OssManagementSettingController( + IOssManagementSettingAppService weChatSettingAppService) + { + WeChatSettingAppService = weChatSettingAppService; + } - [HttpGet] - [Route("by-current-tenant")] - public async virtual Task GetAllForCurrentTenantAsync() - { - return await WeChatSettingAppService.GetAllForCurrentTenantAsync(); - } + [HttpGet] + [Route("by-current-tenant")] + public async virtual Task GetAllForCurrentTenantAsync() + { + return await WeChatSettingAppService.GetAllForCurrentTenantAsync(); + } - [HttpGet] - [Route("by-global")] - public async virtual Task GetAllForGlobalAsync() - { - return await WeChatSettingAppService.GetAllForGlobalAsync(); - } + [HttpGet] + [Route("by-global")] + public async virtual Task GetAllForGlobalAsync() + { + return await WeChatSettingAppService.GetAllForGlobalAsync(); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Tencent/LINGYUN.Abp.OssManagement.Tencent.csproj b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Tencent/LINGYUN.Abp.OssManagement.Tencent.csproj index 4753b066f..8f85ce951 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Tencent/LINGYUN.Abp.OssManagement.Tencent.csproj +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Tencent/LINGYUN.Abp.OssManagement.Tencent.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + net8.0 + LINGYUN.Abp.OssManagement.Tencent + LINGYUN.Abp.OssManagement.Tencent + false + false + false diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Tencent/LINGYUN/Abp/OssManagement/Tencent/AbpOssManagementTencentModule.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Tencent/LINGYUN/Abp/OssManagement/Tencent/AbpOssManagementTencentModule.cs index 4fc93e7b5..3579b70b7 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Tencent/LINGYUN/Abp/OssManagement/Tencent/AbpOssManagementTencentModule.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Tencent/LINGYUN/Abp/OssManagement/Tencent/AbpOssManagementTencentModule.cs @@ -3,22 +3,21 @@ using System; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.OssManagement.Tencent +namespace LINGYUN.Abp.OssManagement.Tencent; + +[DependsOn( + typeof(AbpBlobStoringTencentCloudModule), + typeof(AbpOssManagementDomainModule))] +public class AbpOssManagementTencentModule : AbpModule { - [DependsOn( - typeof(AbpBlobStoringTencentCloudModule), - typeof(AbpOssManagementDomainModule))] - public class AbpOssManagementTencentModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddTransient(); + context.Services.AddTransient(); - context.Services.AddTransient(provider => - provider - .GetRequiredService() - .Create() - .As()); - } + context.Services.AddTransient(provider => + provider + .GetRequiredService() + .Create() + .As()); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Tencent/LINGYUN/Abp/OssManagement/Tencent/TencentOssContainer.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Tencent/LINGYUN/Abp/OssManagement/Tencent/TencentOssContainer.cs index 1a001a1a9..fdc0cf0a2 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Tencent/LINGYUN/Abp/OssManagement/Tencent/TencentOssContainer.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Tencent/LINGYUN/Abp/OssManagement/Tencent/TencentOssContainer.cs @@ -12,419 +12,418 @@ using Volo.Abp.MultiTenancy; using Volo.Abp.Timing; -namespace LINGYUN.Abp.OssManagement.Tencent +namespace LINGYUN.Abp.OssManagement.Tencent; + +/// +/// Oss容器的阿里云实现 +/// +internal class TencentOssContainer : IOssContainer, IOssObjectExpireor { - /// - /// Oss容器的阿里云实现 - /// - internal class TencentOssContainer : IOssContainer, IOssObjectExpireor + protected IClock Clock { get; } + protected ICurrentTenant CurrentTenant { get; } + protected ICosClientFactory CosClientFactory { get; } + public TencentOssContainer( + IClock clock, + ICurrentTenant currentTenant, + ICosClientFactory cosClientFactory) { - protected IClock Clock { get; } - protected ICurrentTenant CurrentTenant { get; } - protected ICosClientFactory CosClientFactory { get; } - public TencentOssContainer( - IClock clock, - ICurrentTenant currentTenant, - ICosClientFactory cosClientFactory) - { - Clock = clock; - CurrentTenant = currentTenant; - CosClientFactory = cosClientFactory; - } - public async virtual Task BulkDeleteObjectsAsync(BulkDeleteObjectRequest request) - { - var ossClient = await CreateClientAsync(); - - var path = GetBasePath(request.Path); - var deleteRequest = new DeleteMultiObjectRequest(request.Bucket); - deleteRequest.SetObjectKeys(request.Objects.Select(x => x += path).ToList()); - - ossClient.DeleteMultiObjects(deleteRequest); - } - - public async virtual Task CreateAsync(string name) - { - var ossClient = await CreateClientAsync(); + Clock = clock; + CurrentTenant = currentTenant; + CosClientFactory = cosClientFactory; + } + public async virtual Task BulkDeleteObjectsAsync(BulkDeleteObjectRequest request) + { + var ossClient = await CreateClientAsync(); - if (BucketExists(ossClient, name)) - { - throw new BusinessException(code: OssManagementErrorCodes.ContainerAlreadyExists); - } + var path = GetBasePath(request.Path); + var deleteRequest = new DeleteMultiObjectRequest(request.Bucket); + deleteRequest.SetObjectKeys(request.Objects.Select(x => x += path).ToList()); - var putBucketRequest = new PutBucketRequest(name); - var bucketResult = ossClient.PutBucket(putBucketRequest); + ossClient.DeleteMultiObjects(deleteRequest); + } - return new OssContainer( - bucketResult.Key, - Clock.Now, - 0L, - Clock.Now, - new Dictionary - { - { "Id", bucketResult.Key }, - { "DisplayName", bucketResult.Key } - }); - } + public async virtual Task CreateAsync(string name) + { + var ossClient = await CreateClientAsync(); - public async virtual Task CreateObjectAsync(CreateOssObjectRequest request) + if (BucketExists(ossClient, name)) { - var ossClient = await CreateClientAsync(); - - var objectPath = GetBasePath(request.Path); - - var objectName = objectPath.IsNullOrWhiteSpace() - ? request.Object - : objectPath + request.Object; + throw new BusinessException(code: OssManagementErrorCodes.ContainerAlreadyExists); + } - if (!request.Overwrite && ObjectExists(ossClient, request.Bucket, objectName)) - { - throw new BusinessException(code: OssManagementErrorCodes.ObjectAlreadyExists); - } + var putBucketRequest = new PutBucketRequest(name); + var bucketResult = ossClient.PutBucket(putBucketRequest); - // 当一个对象名称是以 / 结尾时,不论该对象是否存有数据,都以目录的形式存在 - // 详情见:https://help.aliyun.com/document_detail/31910.html - if (objectName.EndsWith("/") && - request.Content.IsNullOrEmpty()) + return new OssContainer( + bucketResult.Key, + Clock.Now, + 0L, + Clock.Now, + new Dictionary { - var emptyStream = new MemoryStream(); - var emptyData = System.Text.Encoding.UTF8.GetBytes(""); - await emptyStream.WriteAsync(emptyData, 0, emptyData.Length); - request.SetContent(emptyStream); - } + { "Id", bucketResult.Key }, + { "DisplayName", bucketResult.Key } + }); + } - // 没有bucket则创建 - if (!BucketExists(ossClient, request.Bucket)) - { - var putBucketRequest = new PutBucketRequest(request.Bucket); - ossClient.PutBucket(putBucketRequest); - } + public async virtual Task CreateObjectAsync(CreateOssObjectRequest request) + { + var ossClient = await CreateClientAsync(); - var contentLength = request.Content.Length; - var putObjectRequest = new PutObjectRequest(request.Bucket, objectName, request.Content); + var objectPath = GetBasePath(request.Path); - var objectResult = ossClient.PutObject(putObjectRequest); + var objectName = objectPath.IsNullOrWhiteSpace() + ? request.Object + : objectPath + request.Object; - if (objectResult.IsSuccessful() && request.ExpirationTime.HasValue) - { - var putBuckerLifeRequest = new PutBucketLifecycleRequest(request.Bucket); + if (!request.Overwrite && ObjectExists(ossClient, request.Bucket, objectName)) + { + throw new BusinessException(code: OssManagementErrorCodes.ObjectAlreadyExists); + } - var rule = new COSXML.Model.Tag.LifecycleConfiguration.Rule(); - rule.id = "lfiecycleConfigureId"; - rule.status = "Enabled"; //Enabled,Disabled + // 当一个对象名称是以 / 结尾时,不论该对象是否存有数据,都以目录的形式存在 + // 详情见:https://help.aliyun.com/document_detail/31910.html + if (objectName.EndsWith("/") && + request.Content.IsNullOrEmpty()) + { + var emptyStream = new MemoryStream(); + var emptyData = System.Text.Encoding.UTF8.GetBytes(""); + await emptyStream.WriteAsync(emptyData, 0, emptyData.Length); + request.SetContent(emptyStream); + } - rule.filter = new COSXML.Model.Tag.LifecycleConfiguration.Filter(); - // TODO: 需要测试 - rule.filter.prefix = objectName; + // 没有bucket则创建 + if (!BucketExists(ossClient, request.Bucket)) + { + var putBucketRequest = new PutBucketRequest(request.Bucket); + ossClient.PutBucket(putBucketRequest); + } - putBuckerLifeRequest.SetRule(rule); + var contentLength = request.Content.Length; + var putObjectRequest = new PutObjectRequest(request.Bucket, objectName, request.Content); - ossClient.PutBucketLifecycle(putBuckerLifeRequest); - } + var objectResult = ossClient.PutObject(putObjectRequest); - var ossObject = new OssObject( - !objectPath.IsNullOrWhiteSpace() - ? objectName.Replace(objectPath, "") - : objectName, - objectPath, - objectResult.eTag, - DateTime.Now, - contentLength, - DateTime.Now, - new Dictionary(), - objectName.EndsWith("/") // 名称结尾是 / 符号的则为目录:https://cloud.tencent.com/document/product/436/13324 - ) - { - FullName = objectName - }; + if (objectResult.IsSuccessful() && request.ExpirationTime.HasValue) + { + var putBuckerLifeRequest = new PutBucketLifecycleRequest(request.Bucket); - if (!Equals(request.Content, Stream.Null)) - { - request.Content.Seek(0, SeekOrigin.Begin); - ossObject.SetContent(request.Content); - } + var rule = new COSXML.Model.Tag.LifecycleConfiguration.Rule(); + rule.id = "lfiecycleConfigureId"; + rule.status = "Enabled"; //Enabled,Disabled - return ossObject; - } + rule.filter = new COSXML.Model.Tag.LifecycleConfiguration.Filter(); + // TODO: 需要测试 + rule.filter.prefix = objectName; - public async virtual Task DeleteAsync(string name) - { - // 阿里云oss在控制台设置即可,无需改变 - var ossClient = await CreateClientAsync(); + putBuckerLifeRequest.SetRule(rule); - if (BucketExists(ossClient, name)) - { - var deleteBucketRequest = new DeleteBucketRequest(name); - ossClient.DeleteBucket(deleteBucketRequest); - } + ossClient.PutBucketLifecycle(putBuckerLifeRequest); } - public async virtual Task ExpireAsync(ExprieOssObjectRequest request) + var ossObject = new OssObject( + !objectPath.IsNullOrWhiteSpace() + ? objectName.Replace(objectPath, "") + : objectName, + objectPath, + objectResult.eTag, + DateTime.Now, + contentLength, + DateTime.Now, + new Dictionary(), + objectName.EndsWith("/") // 名称结尾是 / 符号的则为目录:https://cloud.tencent.com/document/product/436/13324 + ) { - var ossClient = await CreateClientAsync(); + FullName = objectName + }; - if (BucketExists(ossClient, request.Bucket)) - { - var getBucketRequest = new GetBucketRequest(request.Bucket); + if (!Equals(request.Content, Stream.Null)) + { + request.Content.Seek(0, SeekOrigin.Begin); + ossObject.SetContent(request.Content); + } - var getBucketResult = ossClient.GetBucket(getBucketRequest); + return ossObject; + } - var removeKeys = new List(); - foreach (var content in getBucketResult.listBucket.contentsList) - { - if (DateTime.TryParse(content.lastModified, out var lastModified) && lastModified <= request.ExpirationTime) - { - removeKeys.Add(content.key); - } - } + public async virtual Task DeleteAsync(string name) + { + // 阿里云oss在控制台设置即可,无需改变 + var ossClient = await CreateClientAsync(); - foreach (var removeKey in removeKeys) - { - ossClient.DeleteObject( - new DeleteObjectRequest(getBucketResult.listBucket.name, removeKey)); - } - } + if (BucketExists(ossClient, name)) + { + var deleteBucketRequest = new DeleteBucketRequest(name); + ossClient.DeleteBucket(deleteBucketRequest); } + } - public async virtual Task DeleteObjectAsync(GetOssObjectRequest request) - { - var ossClient = await CreateClientAsync(); + public async virtual Task ExpireAsync(ExprieOssObjectRequest request) + { + var ossClient = await CreateClientAsync(); - var objectPath = GetBasePath(request.Path); + if (BucketExists(ossClient, request.Bucket)) + { + var getBucketRequest = new GetBucketRequest(request.Bucket); - var objectName = objectPath.IsNullOrWhiteSpace() - ? request.Object - : objectPath + request.Object; + var getBucketResult = ossClient.GetBucket(getBucketRequest); - if (BucketExists(ossClient, request.Bucket) && - ObjectExists(ossClient, request.Bucket, objectName)) + var removeKeys = new List(); + foreach (var content in getBucketResult.listBucket.contentsList) { - var getBucketRequest = new GetBucketRequest(request.Bucket); - - var getBucketResult = ossClient.GetBucket(getBucketRequest); - if (getBucketResult.listBucket.commonPrefixesList.Any() || - getBucketResult.listBucket.contentsList.Any()) + if (DateTime.TryParse(content.lastModified, out var lastModified) && lastModified <= request.ExpirationTime) { - throw new BusinessException(code: OssManagementErrorCodes.ObjectDeleteWithNotEmpty); + removeKeys.Add(content.key); } - var deleteObjectRequest = new DeleteObjectRequest(request.Bucket, objectName); - ossClient.DeleteObject(deleteObjectRequest); } - } - - public async virtual Task ExistsAsync(string name) - { - var ossClient = await CreateClientAsync(); - return BucketExists(ossClient, name); - } - - public async virtual Task GetAsync(string name) - { - var ossClient = await CreateClientAsync(); - if (!BucketExists(ossClient, name)) + foreach (var removeKey in removeKeys) { - throw new BusinessException(code: OssManagementErrorCodes.ContainerNotFound); - // throw new ContainerNotFoundException($"Can't not found container {name} in aliyun blob storing"); + ossClient.DeleteObject( + new DeleteObjectRequest(getBucketResult.listBucket.name, removeKey)); } - var getBucketRequest = new GetBucketRequest(name); - var bucket = ossClient.GetBucket(getBucketRequest); - - return new OssContainer( - bucket.Key, - new DateTime(1970, 1, 1, 0, 0, 0), // TODO: 从header获取? 需要测试 - 0L, - null, - new Dictionary - { - { "Id", bucket.Key }, - { "DisplayName", bucket.Key } - }); } + } - public async virtual Task GetObjectAsync(GetOssObjectRequest request) - { - var ossClient = await CreateClientAsync(); - if (!BucketExists(ossClient, request.Bucket)) - { - throw new BusinessException(code: OssManagementErrorCodes.ContainerNotFound); - // throw new ContainerNotFoundException($"Can't not found container {request.Bucket} in aliyun blob storing"); - } + public async virtual Task DeleteObjectAsync(GetOssObjectRequest request) + { + var ossClient = await CreateClientAsync(); - var objectPath = GetBasePath(request.Path); - var objectName = objectPath.IsNullOrWhiteSpace() - ? request.Object - : objectPath + request.Object; + var objectPath = GetBasePath(request.Path); - if (!ObjectExists(ossClient, request.Bucket, objectName)) - { - throw new BusinessException(code: OssManagementErrorCodes.ObjectNotFound); - // throw new ContainerNotFoundException($"Can't not found object {objectName} in container {request.Bucket} with aliyun blob storing"); - } + var objectName = objectPath.IsNullOrWhiteSpace() + ? request.Object + : objectPath + request.Object; - var getObjectRequest = new GetObjectBytesRequest(request.Bucket, objectName); - if (!request.Process.IsNullOrWhiteSpace()) - { - getObjectRequest.SetQueryParameter(request.Process, null); - } - var objectResult = ossClient.GetObject(getObjectRequest); - var ossObject = new OssObject( - !objectPath.IsNullOrWhiteSpace() - ? objectResult.Key.Replace(objectPath, "") - : objectResult.Key, - request.Path, - objectResult.eTag, - null, - objectResult.content.Length, - null, - new Dictionary(), - objectResult.Key.EndsWith("/")) - { - FullName = objectResult.Key - }; + if (BucketExists(ossClient, request.Bucket) && + ObjectExists(ossClient, request.Bucket, objectName)) + { + var getBucketRequest = new GetBucketRequest(request.Bucket); - if (objectResult.content.Length > 0) + var getBucketResult = ossClient.GetBucket(getBucketRequest); + if (getBucketResult.listBucket.commonPrefixesList.Any() || + getBucketResult.listBucket.contentsList.Any()) { - var memoryStream = new MemoryStream(); - await memoryStream.WriteAsync(objectResult.content, 0, objectResult.content.Length); - memoryStream.Seek(0, SeekOrigin.Begin); - ossObject.SetContent(memoryStream); + throw new BusinessException(code: OssManagementErrorCodes.ObjectDeleteWithNotEmpty); } - - return ossObject; + var deleteObjectRequest = new DeleteObjectRequest(request.Bucket, objectName); + ossClient.DeleteObject(deleteObjectRequest); } + } + + public async virtual Task ExistsAsync(string name) + { + var ossClient = await CreateClientAsync(); + + return BucketExists(ossClient, name); + } - public async virtual Task GetListAsync(GetOssContainersRequest request) + public async virtual Task GetAsync(string name) + { + var ossClient = await CreateClientAsync(); + if (!BucketExists(ossClient, name)) { - var ossClient = await CreateClientAsync(); - - // TODO: 腾讯云直接返回所有列表? - var getBucketRequest = new GetServiceRequest(); - var bucket = ossClient.GetService(getBucketRequest); - - return new GetOssContainersResponse( - request.Prefix, - request.Marker, - null, - bucket.listAllMyBuckets.buckets.Count, - bucket.listAllMyBuckets.buckets - .Select(x => new OssContainer( - x.name, - DateTime.TryParse(x.createDate, out var time) ? time : new DateTime(1970, 1, 1), - 0L, - null, - new Dictionary - { - { "Id", x.name }, - { "DisplayName", x.name } - })) - .ToList()); + throw new BusinessException(code: OssManagementErrorCodes.ContainerNotFound); + // throw new ContainerNotFoundException($"Can't not found container {name} in aliyun blob storing"); } + var getBucketRequest = new GetBucketRequest(name); + var bucket = ossClient.GetBucket(getBucketRequest); + + return new OssContainer( + bucket.Key, + new DateTime(1970, 1, 1, 0, 0, 0), // TODO: 从header获取? 需要测试 + 0L, + null, + new Dictionary + { + { "Id", bucket.Key }, + { "DisplayName", bucket.Key } + }); + } - public async virtual Task GetObjectsAsync(GetOssObjectsRequest request) + public async virtual Task GetObjectAsync(GetOssObjectRequest request) + { + var ossClient = await CreateClientAsync(); + if (!BucketExists(ossClient, request.Bucket)) { - - var ossClient = await CreateClientAsync(); - - var objectPath = GetBasePath(request.Prefix); - var marker = !objectPath.IsNullOrWhiteSpace() && !request.Marker.IsNullOrWhiteSpace() - ? request.Marker.Replace(objectPath, "") - : request.Marker; - - // TODO: 阿里云的分页差异需要前端来弥补,传递Marker, 按照Oss控制台的逻辑,直接把MaxKeys设置较大值就行了 + throw new BusinessException(code: OssManagementErrorCodes.ContainerNotFound); + // throw new ContainerNotFoundException($"Can't not found container {request.Bucket} in aliyun blob storing"); + } - var getBucketRequest = new GetBucketRequest(request.BucketName); - getBucketRequest.SetMarker(!marker.IsNullOrWhiteSpace() ? objectPath + marker : marker); - getBucketRequest.SetMaxKeys(request.MaxKeys?.ToString() ?? "10"); - getBucketRequest.SetPrefix(objectPath); - getBucketRequest.SetDelimiter(request.Delimiter); - getBucketRequest.SetEncodingType(request.EncodingType); + var objectPath = GetBasePath(request.Path); + var objectName = objectPath.IsNullOrWhiteSpace() + ? request.Object + : objectPath + request.Object; - var getBucketResult = ossClient.GetBucket(getBucketRequest); + if (!ObjectExists(ossClient, request.Bucket, objectName)) + { + throw new BusinessException(code: OssManagementErrorCodes.ObjectNotFound); + // throw new ContainerNotFoundException($"Can't not found object {objectName} in container {request.Bucket} with aliyun blob storing"); + } - var ossObjects = getBucketResult.listBucket.contentsList - .Where(x => !x.key.Equals(objectPath))// 过滤当前的目录返回值 - .Select(x => new OssObject( - !objectPath.IsNullOrWhiteSpace() && !x.key.Equals(objectPath) - ? x.key.Replace(objectPath, "") - : x.key, // 去除目录名称 - request.Prefix, - x.eTag, - DateTime.TryParse(x.lastModified, out var ctime) ? ctime : null, - x.size, - DateTime.TryParse(x.lastModified, out var mtime) ? mtime : null, - new Dictionary - { - { "Id", x.key }, - { "DisplayName", x.key } - }, - x.key.EndsWith("/")) - { - FullName = x.key - }) - .ToList(); - // 当 Delimiter 为 / 时, objectsResponse.CommonPrefixes 可用于代表层级目录 - if (getBucketResult.listBucket.commonPrefixesList.Any()) - { - ossObjects.InsertRange(0, - getBucketResult.listBucket.commonPrefixesList - .Select(x => new OssObject( - x.prefix.Replace(objectPath, ""), - request.Prefix, - "", - null, - 0L, - null, - null, - true))); - } - // 排序 - // TODO: 是否需要客户端来排序 - ossObjects.Sort(new OssObjectComparer()); - - return new GetOssObjectsResponse( - getBucketResult.Key, - request.Prefix, - marker, - !objectPath.IsNullOrWhiteSpace() && !getBucketResult.listBucket.nextMarker.IsNullOrWhiteSpace() - ? getBucketResult.listBucket.nextMarker.Replace(objectPath, "") - : getBucketResult.listBucket.nextMarker, - getBucketResult.listBucket.delimiter, - getBucketResult.listBucket.maxKeys, - ossObjects); + var getObjectRequest = new GetObjectBytesRequest(request.Bucket, objectName); + if (!request.Process.IsNullOrWhiteSpace()) + { + getObjectRequest.SetQueryParameter(request.Process, null); } + var objectResult = ossClient.GetObject(getObjectRequest); + var ossObject = new OssObject( + !objectPath.IsNullOrWhiteSpace() + ? objectResult.Key.Replace(objectPath, "") + : objectResult.Key, + request.Path, + objectResult.eTag, + null, + objectResult.content.Length, + null, + new Dictionary(), + objectResult.Key.EndsWith("/")) + { + FullName = objectResult.Key + }; - protected virtual string GetBasePath(string path) + if (objectResult.content.Length > 0) { - string objectPath = ""; - if (CurrentTenant.Id == null) - { - objectPath += "host/"; - } - else - { - objectPath += "tenants/" + CurrentTenant.Id.Value.ToString("D"); - } + var memoryStream = new MemoryStream(); + await memoryStream.WriteAsync(objectResult.content, 0, objectResult.content.Length); + memoryStream.Seek(0, SeekOrigin.Begin); + ossObject.SetContent(memoryStream); + } - objectPath += path ?? ""; + return ossObject; + } - return objectPath.EnsureEndsWith('/'); - } + public async virtual Task GetListAsync(GetOssContainersRequest request) + { + var ossClient = await CreateClientAsync(); + + // TODO: 腾讯云直接返回所有列表? + var getBucketRequest = new GetServiceRequest(); + var bucket = ossClient.GetService(getBucketRequest); + + return new GetOssContainersResponse( + request.Prefix, + request.Marker, + null, + bucket.listAllMyBuckets.buckets.Count, + bucket.listAllMyBuckets.buckets + .Select(x => new OssContainer( + x.name, + DateTime.TryParse(x.createDate, out var time) ? time : new DateTime(1970, 1, 1), + 0L, + null, + new Dictionary + { + { "Id", x.name }, + { "DisplayName", x.name } + })) + .ToList()); + } - protected virtual bool BucketExists(CosXml cos, string bucketName) + public async virtual Task GetObjectsAsync(GetOssObjectsRequest request) + { + + var ossClient = await CreateClientAsync(); + + var objectPath = GetBasePath(request.Prefix); + var marker = !objectPath.IsNullOrWhiteSpace() && !request.Marker.IsNullOrWhiteSpace() + ? request.Marker.Replace(objectPath, "") + : request.Marker; + + // TODO: 阿里云的分页差异需要前端来弥补,传递Marker, 按照Oss控制台的逻辑,直接把MaxKeys设置较大值就行了 + + var getBucketRequest = new GetBucketRequest(request.BucketName); + getBucketRequest.SetMarker(!marker.IsNullOrWhiteSpace() ? objectPath + marker : marker); + getBucketRequest.SetMaxKeys(request.MaxKeys?.ToString() ?? "10"); + getBucketRequest.SetPrefix(objectPath); + getBucketRequest.SetDelimiter(request.Delimiter); + getBucketRequest.SetEncodingType(request.EncodingType); + + var getBucketResult = ossClient.GetBucket(getBucketRequest); + + var ossObjects = getBucketResult.listBucket.contentsList + .Where(x => !x.key.Equals(objectPath))// 过滤当前的目录返回值 + .Select(x => new OssObject( + !objectPath.IsNullOrWhiteSpace() && !x.key.Equals(objectPath) + ? x.key.Replace(objectPath, "") + : x.key, // 去除目录名称 + request.Prefix, + x.eTag, + DateTime.TryParse(x.lastModified, out var ctime) ? ctime : null, + x.size, + DateTime.TryParse(x.lastModified, out var mtime) ? mtime : null, + new Dictionary + { + { "Id", x.key }, + { "DisplayName", x.key } + }, + x.key.EndsWith("/")) + { + FullName = x.key + }) + .ToList(); + // 当 Delimiter 为 / 时, objectsResponse.CommonPrefixes 可用于代表层级目录 + if (getBucketResult.listBucket.commonPrefixesList.Any()) { - var request = new DoesBucketExistRequest(bucketName); - return cos.DoesBucketExist(request); + ossObjects.InsertRange(0, + getBucketResult.listBucket.commonPrefixesList + .Select(x => new OssObject( + x.prefix.Replace(objectPath, ""), + request.Prefix, + "", + null, + 0L, + null, + null, + true))); } + // 排序 + // TODO: 是否需要客户端来排序 + ossObjects.Sort(new OssObjectComparer()); + + return new GetOssObjectsResponse( + getBucketResult.Key, + request.Prefix, + marker, + !objectPath.IsNullOrWhiteSpace() && !getBucketResult.listBucket.nextMarker.IsNullOrWhiteSpace() + ? getBucketResult.listBucket.nextMarker.Replace(objectPath, "") + : getBucketResult.listBucket.nextMarker, + getBucketResult.listBucket.delimiter, + getBucketResult.listBucket.maxKeys, + ossObjects); + } - protected virtual bool ObjectExists(CosXml cos, string bucketName, string objectName) + protected virtual string GetBasePath(string path) + { + string objectPath = ""; + if (CurrentTenant.Id == null) { - var request = new DoesObjectExistRequest(bucketName, objectName); - return cos.DoesObjectExist(request); + objectPath += "host/"; } - - protected async virtual Task CreateClientAsync() + else { - return await CosClientFactory.CreateAsync(); + objectPath += "tenants/" + CurrentTenant.Id.Value.ToString("D"); } + + objectPath += path ?? ""; + + return objectPath.EnsureEndsWith('/'); + } + + protected virtual bool BucketExists(CosXml cos, string bucketName) + { + var request = new DoesBucketExistRequest(bucketName); + return cos.DoesBucketExist(request); + } + + protected virtual bool ObjectExists(CosXml cos, string bucketName, string objectName) + { + var request = new DoesObjectExistRequest(bucketName, objectName); + return cos.DoesObjectExist(request); + } + + protected async virtual Task CreateClientAsync() + { + return await CosClientFactory.CreateAsync(); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Tencent/LINGYUN/Abp/OssManagement/Tencent/TencentOssContainerFactory.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Tencent/LINGYUN/Abp/OssManagement/Tencent/TencentOssContainerFactory.cs index 5c64675f0..ac4cc41ce 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Tencent/LINGYUN/Abp/OssManagement/Tencent/TencentOssContainerFactory.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Tencent/LINGYUN/Abp/OssManagement/Tencent/TencentOssContainerFactory.cs @@ -2,30 +2,29 @@ using Volo.Abp.MultiTenancy; using Volo.Abp.Timing; -namespace LINGYUN.Abp.OssManagement.Tencent +namespace LINGYUN.Abp.OssManagement.Tencent; + +public class TencentOssContainerFactory : IOssContainerFactory { - public class TencentOssContainerFactory : IOssContainerFactory - { - protected IClock Clock { get; } - protected ICurrentTenant CurrentTenant { get; } - protected ICosClientFactory CosClientFactory { get; } + protected IClock Clock { get; } + protected ICurrentTenant CurrentTenant { get; } + protected ICosClientFactory CosClientFactory { get; } - public TencentOssContainerFactory( - IClock clock, - ICurrentTenant currentTenant, - ICosClientFactory cosClientFactory) - { - Clock = clock; - CurrentTenant = currentTenant; - CosClientFactory = cosClientFactory; - } + public TencentOssContainerFactory( + IClock clock, + ICurrentTenant currentTenant, + ICosClientFactory cosClientFactory) + { + Clock = clock; + CurrentTenant = currentTenant; + CosClientFactory = cosClientFactory; + } - public IOssContainer Create() - { - return new TencentOssContainer( - Clock, - CurrentTenant, - CosClientFactory); - } + public IOssContainer Create() + { + return new TencentOssContainer( + Clock, + CurrentTenant, + CosClientFactory); } } diff --git a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN.Abp.PermissionManagement.Application.Contracts.csproj b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN.Abp.PermissionManagement.Application.Contracts.csproj index 8882026ca..7de5d3b6e 100644 --- a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN.Abp.PermissionManagement.Application.Contracts.csproj +++ b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application.Contracts/LINGYUN.Abp.PermissionManagement.Application.Contracts.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.PermissionManagement.Application.Contracts + LINGYUN.Abp.PermissionManagement.Application.Contracts + false + false + false diff --git a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/LINGYUN.Abp.PermissionManagement.Application.csproj b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/LINGYUN.Abp.PermissionManagement.Application.csproj index 75f158c9f..080cf2ec6 100644 --- a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/LINGYUN.Abp.PermissionManagement.Application.csproj +++ b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/LINGYUN.Abp.PermissionManagement.Application.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.PermissionManagement.Application + LINGYUN.Abp.PermissionManagement.Application + false + false + false diff --git a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Domain.OrganizationUnits/LINGYUN.Abp.PermissionManagement.Domain.OrganizationUnits.csproj b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Domain.OrganizationUnits/LINGYUN.Abp.PermissionManagement.Domain.OrganizationUnits.csproj index 1fb528e8a..7aa02f309 100644 --- a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Domain.OrganizationUnits/LINGYUN.Abp.PermissionManagement.Domain.OrganizationUnits.csproj +++ b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Domain.OrganizationUnits/LINGYUN.Abp.PermissionManagement.Domain.OrganizationUnits.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.PermissionManagement.Domain.OrganizationUnits + LINGYUN.Abp.PermissionManagement.Domain.OrganizationUnits + false + false + false diff --git a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.HttpApi/LINGYUN.Abp.PermissionManagement.HttpApi.csproj b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.HttpApi/LINGYUN.Abp.PermissionManagement.HttpApi.csproj index c4084e198..fd6fd28d2 100644 --- a/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.HttpApi/LINGYUN.Abp.PermissionManagement.HttpApi.csproj +++ b/aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.HttpApi/LINGYUN.Abp.PermissionManagement.HttpApi.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.PermissionManagement.HttpApi + LINGYUN.Abp.PermissionManagement.HttpApi + false + false + false diff --git a/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin/LINGYUN.Abp.UI.Navigation.VueVbenAdmin.csproj b/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin/LINGYUN.Abp.UI.Navigation.VueVbenAdmin.csproj index 1ea66ae69..6307667ed 100644 --- a/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin/LINGYUN.Abp.UI.Navigation.VueVbenAdmin.csproj +++ b/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin/LINGYUN.Abp.UI.Navigation.VueVbenAdmin.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.UI.Navigation.VueVbenAdmin + LINGYUN.Abp.UI.Navigation.VueVbenAdmin + false + false + false diff --git a/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin/LINGYUN/Abp/UI/Navigation/VueVbenAdmin/AbpUINavigationVueVbenAdminModule.cs b/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin/LINGYUN/Abp/UI/Navigation/VueVbenAdmin/AbpUINavigationVueVbenAdminModule.cs index aa854e81d..0efc53efa 100644 --- a/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin/LINGYUN/Abp/UI/Navigation/VueVbenAdmin/AbpUINavigationVueVbenAdminModule.cs +++ b/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin/LINGYUN/Abp/UI/Navigation/VueVbenAdmin/AbpUINavigationVueVbenAdminModule.cs @@ -1,19 +1,18 @@ using LINGYUN.Platform; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.UI.Navigation.VueVbenAdmin +namespace LINGYUN.Abp.UI.Navigation.VueVbenAdmin; + +[DependsOn( + typeof(AbpUINavigationModule), + typeof(PlatformDomainModule))] +public class AbpUINavigationVueVbenAdminModule : AbpModule { - [DependsOn( - typeof(AbpUINavigationModule), - typeof(PlatformDomainModule))] - public class AbpUINavigationVueVbenAdminModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + Configure(options => { - Configure(options => - { - options.NavigationSeedContributors.Add(); - }); - } + options.NavigationSeedContributors.Add(); + }); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin/LINGYUN/Abp/UI/Navigation/VueVbenAdmin/AbpUINavigationVueVbenAdminNavigationDefinitionProvider.cs b/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin/LINGYUN/Abp/UI/Navigation/VueVbenAdmin/AbpUINavigationVueVbenAdminNavigationDefinitionProvider.cs index b35eaa1e7..f8ea44860 100644 --- a/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin/LINGYUN/Abp/UI/Navigation/VueVbenAdmin/AbpUINavigationVueVbenAdminNavigationDefinitionProvider.cs +++ b/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin/LINGYUN/Abp/UI/Navigation/VueVbenAdmin/AbpUINavigationVueVbenAdminNavigationDefinitionProvider.cs @@ -3,646 +3,645 @@ using Volo.Abp.Data; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.UI.Navigation.VueVbenAdmin +namespace LINGYUN.Abp.UI.Navigation.VueVbenAdmin; + +public class AbpUINavigationVueVbenAdminNavigationDefinitionProvider : NavigationDefinitionProvider { - public class AbpUINavigationVueVbenAdminNavigationDefinitionProvider : NavigationDefinitionProvider + public override void Define(INavigationDefinitionContext context) { - public override void Define(INavigationDefinitionContext context) - { - context.Add(GetDashboard()); - context.Add(GetManage()); - context.Add(GetSaas()); - context.Add(GetPlatform()); - // TODO: 网关不再需要动态管理 - // context.Add(GetApiGateway()); - context.Add(GetLocalization()); - context.Add(GetOssManagement()); - context.Add(GetTaskManagement()); - context.Add(GetWebhooksManagement()); - context.Add(GetMessages()); - context.Add(GetTextTemplating()); - } + context.Add(GetDashboard()); + context.Add(GetManage()); + context.Add(GetSaas()); + context.Add(GetPlatform()); + // TODO: 网关不再需要动态管理 + // context.Add(GetApiGateway()); + context.Add(GetLocalization()); + context.Add(GetOssManagement()); + context.Add(GetTaskManagement()); + context.Add(GetWebhooksManagement()); + context.Add(GetMessages()); + context.Add(GetTextTemplating()); + } - private static NavigationDefinition GetDashboard() - { - var dashboard = new ApplicationMenu( - name: "Vben Dashboard", - displayName: "仪表盘", - url: "/dashboard", - component: "", - description: "仪表盘", - icon: "ion:grid-outline", - redirect: "/dashboard/workbench"); + private static NavigationDefinition GetDashboard() + { + var dashboard = new ApplicationMenu( + name: "Vben Dashboard", + displayName: "仪表盘", + url: "/dashboard", + component: "", + description: "仪表盘", + icon: "ion:grid-outline", + redirect: "/dashboard/workbench"); + + dashboard.AddItem( + new ApplicationMenu( + name: "Analysis", + displayName: "分析页", + url: "/dashboard/analysis", + component: "/dashboard/analysis/index", + description: "分析页")); + dashboard.AddItem( + new ApplicationMenu( + name: "Workbench", + displayName: "工作台", + url: "/dashboard/workbench", + component: "/dashboard/workbench/index", + description: "工作台")); + + + return new NavigationDefinition(dashboard); + } - dashboard.AddItem( - new ApplicationMenu( - name: "Analysis", - displayName: "分析页", - url: "/dashboard/analysis", - component: "/dashboard/analysis/index", - description: "分析页")); - dashboard.AddItem( - new ApplicationMenu( - name: "Workbench", - displayName: "工作台", - url: "/dashboard/workbench", - component: "/dashboard/workbench/index", - description: "工作台")); - - - return new NavigationDefinition(dashboard); + private static NavigationDefinition GetManage() + { + var manage = new ApplicationMenu( + name: "Manage", + displayName: "管理", + url: "/manage", + component: "", + description: "管理", + icon: "ant-design:control-outlined"); + + var identity = manage.AddItem( + new ApplicationMenu( + name: "Identity", + displayName: "身份认证管理", + url: "/manage/identity", + component: "", + description: "身份认证管理")); + identity.AddItem( + new ApplicationMenu( + name: "User", + displayName: "用户", + url: "/manage/identity/user", + component: "/identity/user/index", + description: "用户")); + identity.AddItem( + new ApplicationMenu( + name: "Role", + displayName: "角色", + url: "/manage/identity/role", + component: "/identity/role/index", + description: "角色")); + identity.AddItem( + new ApplicationMenu( + name: "Claim", + displayName: "身份标识", + url: "/manage/identity/claim-types", + component: "/identity/claim-types/index", + description: "身份标识", + multiTenancySides: MultiTenancySides.Host)); + identity.AddItem( + new ApplicationMenu( + name: "OrganizationUnits", + displayName: "组织机构", + url: "/manage/identity/organization-units", + component: "/identity/organization-units/index", + description: "组织机构")); + identity.AddItem( + new ApplicationMenu( + name: "SecurityLogs", + displayName: "安全日志", + url: "/manage/identity/security-logs", + component: "/identity/security-logs/index", + description: "安全日志") + // 此路由需要依赖安全日志特性 + .SetProperty("requiredFeatures", "AbpAuditing.Logging.SecurityLog")); + + manage.AddItem(new ApplicationMenu( + name: "AuditLogs", + displayName: "审计日志", + url: "/manage/audit-logs", + component: "/auditing/index", + description: "审计日志") + // 此路由需要依赖审计日志特性 + .SetProperty("requiredFeatures", "AbpAuditing.Logging.AuditLog")); + + var settingManagement = manage.AddItem(new ApplicationMenu( + name: "SettingManagement", + displayName: "设置管理", + url: "/manage/settings", + component: "LAYOUT", + description: "设置管理", + icon: "ant-design:setting-outlined", + multiTenancySides: MultiTenancySides.Host) + // 此路由需要依赖设置管理特性 + .SetProperty("requiredFeatures", "SettingManagement.Enable")); + settingManagement.AddItem(new ApplicationMenu( + name: "SystemSettings", + displayName: "系统设置", + url: "/manage/settings/system-setting", + component: "/settings-management/settings/index", + description: "系统设置", + multiTenancySides: MultiTenancySides.Host)); + settingManagement.AddItem(new ApplicationMenu( + name: "SettingDefinitions", + displayName: "设置定义", + url: "/manage/settings/definitions", + component: "/settings-management/definitions/index", + description: "设置定义", + multiTenancySides: MultiTenancySides.Host)); + + var featureManagement = manage.AddItem(new ApplicationMenu( + name: "FeaturesManagement", + displayName: "功能管理", + url: "/manage/feature-management", + component: "LAYOUT", + description: "功能管理", + icon: "ant-design:gold-outlined", + multiTenancySides: MultiTenancySides.Host)); + featureManagement.AddItem(new ApplicationMenu( + name: "FeaturesGroupDefinitions", + displayName: "功能分组", + url: "/manage/feature-management/definitions/groups", + component: "/feature-management/definitions/groups/index", + description: "功能分组", + multiTenancySides: MultiTenancySides.Host)); + featureManagement.AddItem(new ApplicationMenu( + name: "FeaturesDefinitions", + displayName: "功能定义", + url: "/manage/feature-management/definitions/features", + component: "/feature-management/definitions/features/index", + description: "功能定义", + multiTenancySides: MultiTenancySides.Host)); + + var permissionManagement = manage.AddItem(new ApplicationMenu( + name: "PermissionsManagement", + displayName: "权限管理", + url: "/manage/permission-management", + component: "LAYOUT", + description: "权限管理", + icon: "arcticons:permissionsmanager", + multiTenancySides: MultiTenancySides.Host)); + permissionManagement.AddItem(new ApplicationMenu( + name: "PermissionsGroupDefinitions", + displayName: "权限分组", + url: "/manage/permission-management/definitions/groups", + component: "/permission-management/definitions/groups/index", + description: "权限分组", + multiTenancySides: MultiTenancySides.Host)); + permissionManagement.AddItem(new ApplicationMenu( + name: "PermissionsDefinitions", + displayName: "权限定义", + url: "/manage/permission-management/definitions/permissions", + component: "/permission-management/definitions/permissions/index", + description: "权限定义", + multiTenancySides: MultiTenancySides.Host)); + + var notificationManagement = manage.AddItem(new ApplicationMenu( + name: "RealtimeNotifications", + displayName: "通知管理", + url: "/realtime/notifications", + component: "LAYOUT", + description: "通知管理", + icon: "ant-design:notification-outlined", + multiTenancySides: MultiTenancySides.Host)); + notificationManagement.AddItem(new ApplicationMenu( + name: "NotificationsGroupDefinitions", + displayName: "通知分组", + url: "/realtime/notifications/definitions/groups", + component: "/realtime/notifications/definitions/groups/index", + description: "通知分组", + multiTenancySides: MultiTenancySides.Host)); + notificationManagement.AddItem(new ApplicationMenu( + name: "NotificationsDefinitions", + displayName: "通知定义", + url: "/realtime/notifications/definitions/notifications", + component: "/realtime/notifications/definitions/notifications/index", + description: "通知定义", + multiTenancySides: MultiTenancySides.Host)); + + var removedIdsVersion = false; + var assembly = typeof(AbpUINavigationVueVbenAdminNavigationDefinitionProvider).Assembly; + var versionAttr = assembly.GetCustomAttribute(); + if (versionAttr != null) + { + if (Version.TryParse(versionAttr.Version, out var version)) + { + var version6 = new Version("6.0.0"); + removedIdsVersion = version6 >= version; + } } - private static NavigationDefinition GetManage() + if (!removedIdsVersion) { - var manage = new ApplicationMenu( - name: "Manage", - displayName: "管理", - url: "/manage", - component: "", - description: "管理", - icon: "ant-design:control-outlined"); - - var identity = manage.AddItem( + var identityServer = manage.AddItem( new ApplicationMenu( - name: "Identity", - displayName: "身份认证管理", - url: "/manage/identity", + name: "IdentityServer", + displayName: "身份认证服务器", + url: "/manage/identity-server", component: "", - description: "身份认证管理")); - identity.AddItem( - new ApplicationMenu( - name: "User", - displayName: "用户", - url: "/manage/identity/user", - component: "/identity/user/index", - description: "用户")); - identity.AddItem( - new ApplicationMenu( - name: "Role", - displayName: "角色", - url: "/manage/identity/role", - component: "/identity/role/index", - description: "角色")); - identity.AddItem( - new ApplicationMenu( - name: "Claim", - displayName: "身份标识", - url: "/manage/identity/claim-types", - component: "/identity/claim-types/index", - description: "身份标识", - multiTenancySides: MultiTenancySides.Host)); - identity.AddItem( - new ApplicationMenu( - name: "OrganizationUnits", - displayName: "组织机构", - url: "/manage/identity/organization-units", - component: "/identity/organization-units/index", - description: "组织机构")); - identity.AddItem( - new ApplicationMenu( - name: "SecurityLogs", - displayName: "安全日志", - url: "/manage/identity/security-logs", - component: "/identity/security-logs/index", - description: "安全日志") - // 此路由需要依赖安全日志特性 - .SetProperty("requiredFeatures", "AbpAuditing.Logging.SecurityLog")); - - manage.AddItem(new ApplicationMenu( - name: "AuditLogs", - displayName: "审计日志", - url: "/manage/audit-logs", - component: "/auditing/index", - description: "审计日志") - // 此路由需要依赖审计日志特性 - .SetProperty("requiredFeatures", "AbpAuditing.Logging.AuditLog")); - - var settingManagement = manage.AddItem(new ApplicationMenu( - name: "SettingManagement", - displayName: "设置管理", - url: "/manage/settings", - component: "LAYOUT", - description: "设置管理", - icon: "ant-design:setting-outlined", - multiTenancySides: MultiTenancySides.Host) - // 此路由需要依赖设置管理特性 - .SetProperty("requiredFeatures", "SettingManagement.Enable")); - settingManagement.AddItem(new ApplicationMenu( - name: "SystemSettings", - displayName: "系统设置", - url: "/manage/settings/system-setting", - component: "/settings-management/settings/index", - description: "系统设置", - multiTenancySides: MultiTenancySides.Host)); - settingManagement.AddItem(new ApplicationMenu( - name: "SettingDefinitions", - displayName: "设置定义", - url: "/manage/settings/definitions", - component: "/settings-management/definitions/index", - description: "设置定义", - multiTenancySides: MultiTenancySides.Host)); - - var featureManagement = manage.AddItem(new ApplicationMenu( - name: "FeaturesManagement", - displayName: "功能管理", - url: "/manage/feature-management", - component: "LAYOUT", - description: "功能管理", - icon: "ant-design:gold-outlined", - multiTenancySides: MultiTenancySides.Host)); - featureManagement.AddItem(new ApplicationMenu( - name: "FeaturesGroupDefinitions", - displayName: "功能分组", - url: "/manage/feature-management/definitions/groups", - component: "/feature-management/definitions/groups/index", - description: "功能分组", - multiTenancySides: MultiTenancySides.Host)); - featureManagement.AddItem(new ApplicationMenu( - name: "FeaturesDefinitions", - displayName: "功能定义", - url: "/manage/feature-management/definitions/features", - component: "/feature-management/definitions/features/index", - description: "功能定义", - multiTenancySides: MultiTenancySides.Host)); - - var permissionManagement = manage.AddItem(new ApplicationMenu( - name: "PermissionsManagement", - displayName: "权限管理", - url: "/manage/permission-management", - component: "LAYOUT", - description: "权限管理", - icon: "arcticons:permissionsmanager", - multiTenancySides: MultiTenancySides.Host)); - permissionManagement.AddItem(new ApplicationMenu( - name: "PermissionsGroupDefinitions", - displayName: "权限分组", - url: "/manage/permission-management/definitions/groups", - component: "/permission-management/definitions/groups/index", - description: "权限分组", - multiTenancySides: MultiTenancySides.Host)); - permissionManagement.AddItem(new ApplicationMenu( - name: "PermissionsDefinitions", - displayName: "权限定义", - url: "/manage/permission-management/definitions/permissions", - component: "/permission-management/definitions/permissions/index", - description: "权限定义", - multiTenancySides: MultiTenancySides.Host)); - - var notificationManagement = manage.AddItem(new ApplicationMenu( - name: "RealtimeNotifications", - displayName: "通知管理", - url: "/realtime/notifications", - component: "LAYOUT", - description: "通知管理", - icon: "ant-design:notification-outlined", - multiTenancySides: MultiTenancySides.Host)); - notificationManagement.AddItem(new ApplicationMenu( - name: "NotificationsGroupDefinitions", - displayName: "通知分组", - url: "/realtime/notifications/definitions/groups", - component: "/realtime/notifications/definitions/groups/index", - description: "通知分组", - multiTenancySides: MultiTenancySides.Host)); - notificationManagement.AddItem(new ApplicationMenu( - name: "NotificationsDefinitions", - displayName: "通知定义", - url: "/realtime/notifications/definitions/notifications", - component: "/realtime/notifications/definitions/notifications/index", - description: "通知定义", - multiTenancySides: MultiTenancySides.Host)); - - var removedIdsVersion = false; - var assembly = typeof(AbpUINavigationVueVbenAdminNavigationDefinitionProvider).Assembly; - var versionAttr = assembly.GetCustomAttribute(); - if (versionAttr != null) - { - if (Version.TryParse(versionAttr.Version, out var version)) - { - var version6 = new Version("6.0.0"); - removedIdsVersion = version6 >= version; - } - } - - if (!removedIdsVersion) - { - var identityServer = manage.AddItem( - new ApplicationMenu( - name: "IdentityServer", - displayName: "身份认证服务器", - url: "/manage/identity-server", - component: "", - description: "身份认证服务器", - multiTenancySides: MultiTenancySides.Host)); - identityServer.AddItem( - new ApplicationMenu( - name: "Clients", - displayName: "客户端", - url: "/manage/identity-server/clients", - component: "/identity-server/clients/index", - description: "客户端", - multiTenancySides: MultiTenancySides.Host)); - identityServer.AddItem( - new ApplicationMenu( - name: "ApiResources", - displayName: "Api 资源", - url: "/manage/identity-server/api-resources", - component: "/identity-server/api-resources/index", - description: "Api 资源", - multiTenancySides: MultiTenancySides.Host)); - identityServer.AddItem( - new ApplicationMenu( - name: "IdentityResources", - displayName: "身份资源", - url: "/manage/identity-server/identity-resources", - component: "/identity-server/identity-resources/index", - description: "身份资源", - multiTenancySides: MultiTenancySides.Host)); - identityServer.AddItem( - new ApplicationMenu( - name: "ApiScopes", - displayName: "Api 范围", - url: "/manage/identity-server/api-scopes", - component: "/identity-server/api-scopes/index", - description: "Api 范围", - multiTenancySides: MultiTenancySides.Host)); - identityServer.AddItem( - new ApplicationMenu( - name: "PersistedGrants", - displayName: "持久授权", - url: "/manage/identity-server/persisted-grants", - component: "/identity-server/persisted-grants/index", - description: "持久授权", - multiTenancySides: MultiTenancySides.Host)); - } - else - { - var openIddict = manage.AddItem( - new ApplicationMenu( - name: "OpenIddict", - displayName: "身份认证服务器", - url: "/manage/openiddict", - component: "LAYOUT", - description: "身份认证服务器(OpenIddict)", - multiTenancySides: MultiTenancySides.Host)); - openIddict.AddItem( - new ApplicationMenu( - name: "OpenIddictApplications", - displayName: "应用管理", - url: "/manage/openiddict/applications", - component: "/openiddict/applications/index", - description: "应用管理", - multiTenancySides: MultiTenancySides.Host)); - openIddict.AddItem( - new ApplicationMenu( - name: "OpenIddictAuthorizations", - displayName: "授权管理", - url: "/manage/openiddict/authorizations", - component: "/openiddict/authorizations/index", - description: "授权管理", - multiTenancySides: MultiTenancySides.Host)); - openIddict.AddItem( - new ApplicationMenu( - name: "OpenIddictScopes", - displayName: "Api 范围", - url: "/manage/openiddict/scopes", - component: "/openiddict/scopes/index", - description: "Api 范围", - multiTenancySides: MultiTenancySides.Host)); - openIddict.AddItem( - new ApplicationMenu( - name: "OpenIddictTokens", - displayName: "授权令牌", - url: "/manage/openiddict/tokens", - component: "/openiddict/tokens/index", - description: "授权令牌", - multiTenancySides: MultiTenancySides.Host)); - } - - manage.AddItem( + description: "身份认证服务器", + multiTenancySides: MultiTenancySides.Host)); + identityServer.AddItem( new ApplicationMenu( - name: "Logs", - displayName: "系统日志", - url: "/sys/logs", - component: "/sys/logging/index", - description: "系统日志", + name: "Clients", + displayName: "客户端", + url: "/manage/identity-server/clients", + component: "/identity-server/clients/index", + description: "客户端", multiTenancySides: MultiTenancySides.Host)); - - manage.AddItem( + identityServer.AddItem( new ApplicationMenu( - name: "ApiDocument", - displayName: "Api 文档", - url: "/openapi", - component: "IFrame", - description: "Api 文档", - multiTenancySides: MultiTenancySides.Host) - // TODO: 注意在部署完毕之后手动修改此菜单iframe地址 - .SetProperty("frameSrc", "http://127.0.0.1:30000/swagger/index.html")); - - manage.AddItem( + name: "ApiResources", + displayName: "Api 资源", + url: "/manage/identity-server/api-resources", + component: "/identity-server/api-resources/index", + description: "Api 资源", + multiTenancySides: MultiTenancySides.Host)); + identityServer.AddItem( new ApplicationMenu( - name: "Caches", - displayName: "缓存管理", - url: "/manage/cache", - component: "/caching-management/cache/index", - description: "缓存管理")); - - return new NavigationDefinition(manage); + name: "IdentityResources", + displayName: "身份资源", + url: "/manage/identity-server/identity-resources", + component: "/identity-server/identity-resources/index", + description: "身份资源", + multiTenancySides: MultiTenancySides.Host)); + identityServer.AddItem( + new ApplicationMenu( + name: "ApiScopes", + displayName: "Api 范围", + url: "/manage/identity-server/api-scopes", + component: "/identity-server/api-scopes/index", + description: "Api 范围", + multiTenancySides: MultiTenancySides.Host)); + identityServer.AddItem( + new ApplicationMenu( + name: "PersistedGrants", + displayName: "持久授权", + url: "/manage/identity-server/persisted-grants", + component: "/identity-server/persisted-grants/index", + description: "持久授权", + multiTenancySides: MultiTenancySides.Host)); } - - private static NavigationDefinition GetSaas() + else { - var saas = new ApplicationMenu( - name: "Saas", - displayName: "Saas", - url: "/saas", - component: "", - description: "Saas", - icon: "ant-design:cloud-server-outlined", - multiTenancySides: MultiTenancySides.Host); - saas.AddItem( - new ApplicationMenu( - name: "Tenants", - displayName: "租户管理", - url: "/saas/tenants", - component: "/saas/tenant/index", - description: "租户管理", - multiTenancySides: MultiTenancySides.Host)); - saas.AddItem( - new ApplicationMenu( - name: "Editions", - displayName: "版本管理", - url: "/saas/editions", - component: "/saas/editions/index", - description: "版本管理", - multiTenancySides: MultiTenancySides.Host)); - - return new NavigationDefinition(saas); + var openIddict = manage.AddItem( + new ApplicationMenu( + name: "OpenIddict", + displayName: "身份认证服务器", + url: "/manage/openiddict", + component: "LAYOUT", + description: "身份认证服务器(OpenIddict)", + multiTenancySides: MultiTenancySides.Host)); + openIddict.AddItem( + new ApplicationMenu( + name: "OpenIddictApplications", + displayName: "应用管理", + url: "/manage/openiddict/applications", + component: "/openiddict/applications/index", + description: "应用管理", + multiTenancySides: MultiTenancySides.Host)); + openIddict.AddItem( + new ApplicationMenu( + name: "OpenIddictAuthorizations", + displayName: "授权管理", + url: "/manage/openiddict/authorizations", + component: "/openiddict/authorizations/index", + description: "授权管理", + multiTenancySides: MultiTenancySides.Host)); + openIddict.AddItem( + new ApplicationMenu( + name: "OpenIddictScopes", + displayName: "Api 范围", + url: "/manage/openiddict/scopes", + component: "/openiddict/scopes/index", + description: "Api 范围", + multiTenancySides: MultiTenancySides.Host)); + openIddict.AddItem( + new ApplicationMenu( + name: "OpenIddictTokens", + displayName: "授权令牌", + url: "/manage/openiddict/tokens", + component: "/openiddict/tokens/index", + description: "授权令牌", + multiTenancySides: MultiTenancySides.Host)); } - private static NavigationDefinition GetPlatform() - { - var platform = new ApplicationMenu( - name: "Platform", - displayName: "平台管理", - url: "/platform", - component: "", - description: "平台管理", - icon: "ep:platform"); - platform.AddItem( - new ApplicationMenu( - name: "DataDictionary", - displayName: "数据字典", - url: "/platform/data-dic", - component: "/platform/dataDic/index", - description: "数据字典")); - platform.AddItem( - new ApplicationMenu( - name: "Layout", - displayName: "布局", - url: "/platform/layout", - component: "/platform/layout/index", - description: "布局")); - platform.AddItem( - new ApplicationMenu( - name: "Menu", - displayName: "菜单", - url: "/platform/menu", - component: "/platform/menu/index", - description: "菜单")); - - return new NavigationDefinition(platform); - } + manage.AddItem( + new ApplicationMenu( + name: "Logs", + displayName: "系统日志", + url: "/sys/logs", + component: "/sys/logging/index", + description: "系统日志", + multiTenancySides: MultiTenancySides.Host)); + + manage.AddItem( + new ApplicationMenu( + name: "ApiDocument", + displayName: "Api 文档", + url: "/openapi", + component: "IFrame", + description: "Api 文档", + multiTenancySides: MultiTenancySides.Host) + // TODO: 注意在部署完毕之后手动修改此菜单iframe地址 + .SetProperty("frameSrc", "http://127.0.0.1:30000/swagger/index.html")); + + manage.AddItem( + new ApplicationMenu( + name: "Caches", + displayName: "缓存管理", + url: "/manage/cache", + component: "/caching-management/cache/index", + description: "缓存管理")); + + return new NavigationDefinition(manage); + } - private static NavigationDefinition GetApiGateway() - { - var apiGateway = new ApplicationMenu( - name: "ApiGateway", - displayName: "网关管理", - url: "/api-gateway", - component: "", - description: "网关管理", - icon: "ant-design:gateway-outlined", - multiTenancySides: MultiTenancySides.Host); - apiGateway.AddItem( - new ApplicationMenu( - name: "RouteGroup", - displayName: "路由分组", - url: "/api-gateway/group", - component: "/api-gateway/group/index", - description: "路由分组", - multiTenancySides: MultiTenancySides.Host)); - apiGateway.AddItem( - new ApplicationMenu( - name: "GlobalConfiguration", - displayName: "公共配置", - url: "/api-gateway/global", - component: "/api-gateway/global/index", - description: "公共配置", - multiTenancySides: MultiTenancySides.Host)); - apiGateway.AddItem( - new ApplicationMenu( - name: "Route", - displayName: "路由管理", - url: "/api-gateway/route", - component: "/api-gateway/route/index", - description: "路由管理", - multiTenancySides: MultiTenancySides.Host)); - apiGateway.AddItem( - new ApplicationMenu( - name: "AggregateRoute", - displayName: "聚合路由", - url: "/api-gateway/aggregate", - component: "/api-gateway/aggregate/index", - description: "聚合路由", - multiTenancySides: MultiTenancySides.Host)); - - return new NavigationDefinition(apiGateway); - } + private static NavigationDefinition GetSaas() + { + var saas = new ApplicationMenu( + name: "Saas", + displayName: "Saas", + url: "/saas", + component: "", + description: "Saas", + icon: "ant-design:cloud-server-outlined", + multiTenancySides: MultiTenancySides.Host); + saas.AddItem( + new ApplicationMenu( + name: "Tenants", + displayName: "租户管理", + url: "/saas/tenants", + component: "/saas/tenant/index", + description: "租户管理", + multiTenancySides: MultiTenancySides.Host)); + saas.AddItem( + new ApplicationMenu( + name: "Editions", + displayName: "版本管理", + url: "/saas/editions", + component: "/saas/editions/index", + description: "版本管理", + multiTenancySides: MultiTenancySides.Host)); + + return new NavigationDefinition(saas); + } - private static NavigationDefinition GetLocalization() - { - var localization = new ApplicationMenu( - name: "Localization", - displayName: "本地化管理", - url: "/localization", - component: "", - description: "本地化管理", - icon: "ant-design:translation-outlined", - multiTenancySides: MultiTenancySides.Host); - localization.AddItem( - new ApplicationMenu( - name: "Languages", - displayName: "语言管理", - url: "/localization/languages", - component: "/localization/languages/index", - description: "语言管理", - multiTenancySides: MultiTenancySides.Host) - ); - localization.AddItem( - new ApplicationMenu( - name: "Resources", - displayName: "资源管理", - url: "/localization/resources", - component: "/localization/resources/index", - description: "资源管理", - multiTenancySides: MultiTenancySides.Host) - ); - localization.AddItem( - new ApplicationMenu( - name: "Texts", - displayName: "文档管理", - url: "/localization/texts", - component: "/localization/texts/index", - description: "文档管理", - multiTenancySides: MultiTenancySides.Host) - ); - - return new NavigationDefinition(localization); - } + private static NavigationDefinition GetPlatform() + { + var platform = new ApplicationMenu( + name: "Platform", + displayName: "平台管理", + url: "/platform", + component: "", + description: "平台管理", + icon: "ep:platform"); + platform.AddItem( + new ApplicationMenu( + name: "DataDictionary", + displayName: "数据字典", + url: "/platform/data-dic", + component: "/platform/dataDic/index", + description: "数据字典")); + platform.AddItem( + new ApplicationMenu( + name: "Layout", + displayName: "布局", + url: "/platform/layout", + component: "/platform/layout/index", + description: "布局")); + platform.AddItem( + new ApplicationMenu( + name: "Menu", + displayName: "菜单", + url: "/platform/menu", + component: "/platform/menu/index", + description: "菜单")); + + return new NavigationDefinition(platform); + } - private static NavigationDefinition GetOssManagement() - { - var oss = new ApplicationMenu( - name: "OssManagement", - displayName: "对象存储", - url: "/oss", - component: "", - description: "对象存储", - icon: "ant-design:file-twotone"); - oss.AddItem( - new ApplicationMenu( - name: "Containers", - displayName: "容器管理", - url: "/oss/containers", - component: "/oss-management/containers/index", - description: "容器管理")); - oss.AddItem( - new ApplicationMenu( - name: "Objects", - displayName: "文件管理", - url: "/oss/objects", - component: "/oss-management/objects/index", - description: "文件管理")); - - return new NavigationDefinition(oss); - } + private static NavigationDefinition GetApiGateway() + { + var apiGateway = new ApplicationMenu( + name: "ApiGateway", + displayName: "网关管理", + url: "/api-gateway", + component: "", + description: "网关管理", + icon: "ant-design:gateway-outlined", + multiTenancySides: MultiTenancySides.Host); + apiGateway.AddItem( + new ApplicationMenu( + name: "RouteGroup", + displayName: "路由分组", + url: "/api-gateway/group", + component: "/api-gateway/group/index", + description: "路由分组", + multiTenancySides: MultiTenancySides.Host)); + apiGateway.AddItem( + new ApplicationMenu( + name: "GlobalConfiguration", + displayName: "公共配置", + url: "/api-gateway/global", + component: "/api-gateway/global/index", + description: "公共配置", + multiTenancySides: MultiTenancySides.Host)); + apiGateway.AddItem( + new ApplicationMenu( + name: "Route", + displayName: "路由管理", + url: "/api-gateway/route", + component: "/api-gateway/route/index", + description: "路由管理", + multiTenancySides: MultiTenancySides.Host)); + apiGateway.AddItem( + new ApplicationMenu( + name: "AggregateRoute", + displayName: "聚合路由", + url: "/api-gateway/aggregate", + component: "/api-gateway/aggregate/index", + description: "聚合路由", + multiTenancySides: MultiTenancySides.Host)); + + return new NavigationDefinition(apiGateway); + } - private static NavigationDefinition GetTaskManagement() - { - var task = new ApplicationMenu( - name: "TaskManagement", - displayName: "任务调度平台", - url: "/task-management", - component: "", - description: "任务调度平台", - icon: "bi:list-task"); - task.AddItem( - new ApplicationMenu( - name: "BackgroundJobs", - displayName: "任务管理", - url: "/task-management/background-jobs", - component: "/task-management/background-jobs/index", - description: "任务管理")); - task.AddItem( - new ApplicationMenu( - name: "BackgroundJobInfoDetail", - displayName: "任务详情", - url: "/task-management/background-jobs/:id", - component: "/task-management/background-jobs/components/BackgroundJobInfoDetail", - description: "任务详情") - .SetProperty("hideMenu", "true") - .SetProperty("hideTab", "true")); - - return new NavigationDefinition(task); - } + private static NavigationDefinition GetLocalization() + { + var localization = new ApplicationMenu( + name: "Localization", + displayName: "本地化管理", + url: "/localization", + component: "", + description: "本地化管理", + icon: "ant-design:translation-outlined", + multiTenancySides: MultiTenancySides.Host); + localization.AddItem( + new ApplicationMenu( + name: "Languages", + displayName: "语言管理", + url: "/localization/languages", + component: "/localization/languages/index", + description: "语言管理", + multiTenancySides: MultiTenancySides.Host) + ); + localization.AddItem( + new ApplicationMenu( + name: "Resources", + displayName: "资源管理", + url: "/localization/resources", + component: "/localization/resources/index", + description: "资源管理", + multiTenancySides: MultiTenancySides.Host) + ); + localization.AddItem( + new ApplicationMenu( + name: "Texts", + displayName: "文档管理", + url: "/localization/texts", + component: "/localization/texts/index", + description: "文档管理", + multiTenancySides: MultiTenancySides.Host) + ); + + return new NavigationDefinition(localization); + } - private static NavigationDefinition GetWebhooksManagement() - { - var webhooks = new ApplicationMenu( - name: "WebHooks", - displayName: "WebHooks", - url: "/webhooks", - component: "", - description: "WebHooks", - icon: "ic:outline-webhook", - multiTenancySides: MultiTenancySides.Host); - webhooks.AddItem( - new ApplicationMenu( - name: "Subscriptions", - displayName: "管理订阅", - url: "/webhooks/subscriptions", - component: "/webhooks/subscriptions/index", - description: "管理订阅", - multiTenancySides: MultiTenancySides.Host)); - webhooks.AddItem( - new ApplicationMenu( - name: "SendAttempts", - displayName: "管理记录", - url: "/webhooks/send-attempts", - component: "/webhooks/send-attempts/index", - description: "管理记录", - multiTenancySides: MultiTenancySides.Host)); - webhooks.AddItem( - new ApplicationMenu( - name: "WebhooksGroupDefinitions", - displayName: "Webhook 分组", - url: "/webhooks/definitions/groups", - component: "/webhooks/definitions/groups/index", - description: "Webhook 分组", - multiTenancySides: MultiTenancySides.Host)); - webhooks.AddItem( - new ApplicationMenu( - name: "WebhooksDefinitions", - displayName: "Webhook 定义", - url: "/webhooks/definitions/webhooks", - component: "/webhooks/definitions/webhooks/index", - description: "Webhook 定义", - multiTenancySides: MultiTenancySides.Host)); - - return new NavigationDefinition(webhooks); - } + private static NavigationDefinition GetOssManagement() + { + var oss = new ApplicationMenu( + name: "OssManagement", + displayName: "对象存储", + url: "/oss", + component: "", + description: "对象存储", + icon: "ant-design:file-twotone"); + oss.AddItem( + new ApplicationMenu( + name: "Containers", + displayName: "容器管理", + url: "/oss/containers", + component: "/oss-management/containers/index", + description: "容器管理")); + oss.AddItem( + new ApplicationMenu( + name: "Objects", + displayName: "文件管理", + url: "/oss/objects", + component: "/oss-management/objects/index", + description: "文件管理")); + + return new NavigationDefinition(oss); + } - private static NavigationDefinition GetMessages() - { - var messages = new ApplicationMenu( - name: "Messages", - displayName: "消息管理", - url: "/messages", - component: "", - description: "消息管理", - icon: "ant-design:message-outlined"); - messages.AddItem( - new ApplicationMenu( - name: "Notifications", - displayName: "通知管理", - url: "/messages/notifications", - component: "/messages/notifications/index", - description: "通知管理")); - - return new NavigationDefinition(messages); - } + private static NavigationDefinition GetTaskManagement() + { + var task = new ApplicationMenu( + name: "TaskManagement", + displayName: "任务调度平台", + url: "/task-management", + component: "", + description: "任务调度平台", + icon: "bi:list-task"); + task.AddItem( + new ApplicationMenu( + name: "BackgroundJobs", + displayName: "任务管理", + url: "/task-management/background-jobs", + component: "/task-management/background-jobs/index", + description: "任务管理")); + task.AddItem( + new ApplicationMenu( + name: "BackgroundJobInfoDetail", + displayName: "任务详情", + url: "/task-management/background-jobs/:id", + component: "/task-management/background-jobs/components/BackgroundJobInfoDetail", + description: "任务详情") + .SetProperty("hideMenu", "true") + .SetProperty("hideTab", "true")); + + return new NavigationDefinition(task); + } - private static NavigationDefinition GetTextTemplating() - { - var textTemplating = new ApplicationMenu( - name: "Templates", - displayName: "模板管理", - url: "/text-templating", - component: "", - description: "模板管理", - icon: "eos-icons:templates-outlined", - multiTenancySides: MultiTenancySides.Host); - textTemplating.AddItem( - new ApplicationMenu( - name: "TextTemplates", - displayName: "文本模板", - url: "/text-templating/text-templates", - component: "/text-templating/templates/index", - description: "文本模板", - multiTenancySides: MultiTenancySides.Host)); - - return new NavigationDefinition(textTemplating); - } + private static NavigationDefinition GetWebhooksManagement() + { + var webhooks = new ApplicationMenu( + name: "WebHooks", + displayName: "WebHooks", + url: "/webhooks", + component: "", + description: "WebHooks", + icon: "ic:outline-webhook", + multiTenancySides: MultiTenancySides.Host); + webhooks.AddItem( + new ApplicationMenu( + name: "Subscriptions", + displayName: "管理订阅", + url: "/webhooks/subscriptions", + component: "/webhooks/subscriptions/index", + description: "管理订阅", + multiTenancySides: MultiTenancySides.Host)); + webhooks.AddItem( + new ApplicationMenu( + name: "SendAttempts", + displayName: "管理记录", + url: "/webhooks/send-attempts", + component: "/webhooks/send-attempts/index", + description: "管理记录", + multiTenancySides: MultiTenancySides.Host)); + webhooks.AddItem( + new ApplicationMenu( + name: "WebhooksGroupDefinitions", + displayName: "Webhook 分组", + url: "/webhooks/definitions/groups", + component: "/webhooks/definitions/groups/index", + description: "Webhook 分组", + multiTenancySides: MultiTenancySides.Host)); + webhooks.AddItem( + new ApplicationMenu( + name: "WebhooksDefinitions", + displayName: "Webhook 定义", + url: "/webhooks/definitions/webhooks", + component: "/webhooks/definitions/webhooks/index", + description: "Webhook 定义", + multiTenancySides: MultiTenancySides.Host)); + + return new NavigationDefinition(webhooks); + } + + private static NavigationDefinition GetMessages() + { + var messages = new ApplicationMenu( + name: "Messages", + displayName: "消息管理", + url: "/messages", + component: "", + description: "消息管理", + icon: "ant-design:message-outlined"); + messages.AddItem( + new ApplicationMenu( + name: "Notifications", + displayName: "通知管理", + url: "/messages/notifications", + component: "/messages/notifications/index", + description: "通知管理")); + + return new NavigationDefinition(messages); + } + + private static NavigationDefinition GetTextTemplating() + { + var textTemplating = new ApplicationMenu( + name: "Templates", + displayName: "模板管理", + url: "/text-templating", + component: "", + description: "模板管理", + icon: "eos-icons:templates-outlined", + multiTenancySides: MultiTenancySides.Host); + textTemplating.AddItem( + new ApplicationMenu( + name: "TextTemplates", + displayName: "文本模板", + url: "/text-templating/text-templates", + component: "/text-templating/templates/index", + description: "文本模板", + multiTenancySides: MultiTenancySides.Host)); + + return new NavigationDefinition(textTemplating); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin/LINGYUN/Abp/UI/Navigation/VueVbenAdmin/AbpUINavigationVueVbenAdminOptions.cs b/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin/LINGYUN/Abp/UI/Navigation/VueVbenAdmin/AbpUINavigationVueVbenAdminOptions.cs index 4dce95725..a04e9d3ed 100644 --- a/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin/LINGYUN/Abp/UI/Navigation/VueVbenAdmin/AbpUINavigationVueVbenAdminOptions.cs +++ b/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin/LINGYUN/Abp/UI/Navigation/VueVbenAdmin/AbpUINavigationVueVbenAdminOptions.cs @@ -1,15 +1,14 @@ -namespace LINGYUN.Abp.UI.Navigation.VueVbenAdmin +namespace LINGYUN.Abp.UI.Navigation.VueVbenAdmin; + +public class AbpUINavigationVueVbenAdminOptions { - public class AbpUINavigationVueVbenAdminOptions + public string UI { get; set; } + public string LayoutName { get; set; } + public string LayoutPath { get; set; } + public AbpUINavigationVueVbenAdminOptions() { - public string UI { get; set; } - public string LayoutName { get; set; } - public string LayoutPath { get; set; } - public AbpUINavigationVueVbenAdminOptions() - { - UI = "Vue Vben Admin"; - LayoutName = "Vben Admin Layout"; - LayoutPath = "LAYOUT"; - } + UI = "Vue Vben Admin"; + LayoutName = "Vben Admin Layout"; + LayoutPath = "LAYOUT"; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin/LINGYUN/Abp/UI/Navigation/VueVbenAdmin/VueVbenAdminNavigationSeedContributor.cs b/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin/LINGYUN/Abp/UI/Navigation/VueVbenAdmin/VueVbenAdminNavigationSeedContributor.cs index 7d044a49f..eb0e50fe0 100644 --- a/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin/LINGYUN/Abp/UI/Navigation/VueVbenAdmin/VueVbenAdminNavigationSeedContributor.cs +++ b/aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin/LINGYUN/Abp/UI/Navigation/VueVbenAdmin/VueVbenAdminNavigationSeedContributor.cs @@ -13,446 +13,445 @@ using Volo.Abp.MultiTenancy; using ValueType = LINGYUN.Platform.Datas.ValueType; -namespace LINGYUN.Abp.UI.Navigation.VueVbenAdmin +namespace LINGYUN.Abp.UI.Navigation.VueVbenAdmin; + +public class VueVbenAdminNavigationSeedContributor : NavigationSeedContributor { - public class VueVbenAdminNavigationSeedContributor : NavigationSeedContributor + private static int _lastCodeNumber = 0; + protected ICurrentTenant CurrentTenant { get; } + protected IGuidGenerator GuidGenerator { get; } + protected IRouteDataSeeder RouteDataSeeder { get; } + protected IDataDictionaryDataSeeder DataDictionaryDataSeeder { get; } + protected IMenuRepository MenuRepository { get; } + protected ILayoutRepository LayoutRepository { get; } + protected AbpUINavigationVueVbenAdminOptions Options { get; } + + public VueVbenAdminNavigationSeedContributor( + ICurrentTenant currentTenant, + IRouteDataSeeder routeDataSeeder, + IMenuRepository menuRepository, + ILayoutRepository layoutRepository, + IGuidGenerator guidGenerator, + IDataDictionaryDataSeeder dataDictionaryDataSeeder, + IOptions options) { - private static int _lastCodeNumber = 0; - protected ICurrentTenant CurrentTenant { get; } - protected IGuidGenerator GuidGenerator { get; } - protected IRouteDataSeeder RouteDataSeeder { get; } - protected IDataDictionaryDataSeeder DataDictionaryDataSeeder { get; } - protected IMenuRepository MenuRepository { get; } - protected ILayoutRepository LayoutRepository { get; } - protected AbpUINavigationVueVbenAdminOptions Options { get; } - - public VueVbenAdminNavigationSeedContributor( - ICurrentTenant currentTenant, - IRouteDataSeeder routeDataSeeder, - IMenuRepository menuRepository, - ILayoutRepository layoutRepository, - IGuidGenerator guidGenerator, - IDataDictionaryDataSeeder dataDictionaryDataSeeder, - IOptions options) - { - CurrentTenant = currentTenant; - GuidGenerator = guidGenerator; - RouteDataSeeder = routeDataSeeder; - MenuRepository = menuRepository; - LayoutRepository = layoutRepository; - DataDictionaryDataSeeder = dataDictionaryDataSeeder; - - Options = options.Value; - } + CurrentTenant = currentTenant; + GuidGenerator = guidGenerator; + RouteDataSeeder = routeDataSeeder; + MenuRepository = menuRepository; + LayoutRepository = layoutRepository; + DataDictionaryDataSeeder = dataDictionaryDataSeeder; - public override async Task SeedAsync(NavigationSeedContext context) - { - var uiDataItem = await SeedUIFrameworkDataAsync(CurrentTenant.Id); + Options = options.Value; + } - var layoutData = await SeedLayoutDataAsync(CurrentTenant.Id); + public override async Task SeedAsync(NavigationSeedContext context) + { + var uiDataItem = await SeedUIFrameworkDataAsync(CurrentTenant.Id); - var layout = await SeedDefaultLayoutAsync(layoutData, uiDataItem); + var layoutData = await SeedLayoutDataAsync(CurrentTenant.Id); - var latMenu = await MenuRepository.GetLastMenuAsync(); + var layout = await SeedDefaultLayoutAsync(layoutData, uiDataItem); - if (int.TryParse(CodeNumberGenerator.GetLastCode(latMenu?.Code ?? "0"), out int _lastNumber)) - { - Interlocked.Exchange(ref _lastCodeNumber, _lastNumber); - } + var latMenu = await MenuRepository.GetLastMenuAsync(); - await SeedDefinitionMenusAsync(layout, layoutData, context.Menus, context.MultiTenancySides); + if (int.TryParse(CodeNumberGenerator.GetLastCode(latMenu?.Code ?? "0"), out int _lastNumber)) + { + Interlocked.Exchange(ref _lastCodeNumber, _lastNumber); } - private async Task SeedDefinitionMenusAsync( - Layout layout, - Data data, - IReadOnlyCollection menus, - MultiTenancySides multiTenancySides) + await SeedDefinitionMenusAsync(layout, layoutData, context.Menus, context.MultiTenancySides); + } + + private async Task SeedDefinitionMenusAsync( + Layout layout, + Data data, + IReadOnlyCollection menus, + MultiTenancySides multiTenancySides) + { + foreach (var menu in menus) { - foreach (var menu in menus) + if (!menu.MultiTenancySides.HasFlag(multiTenancySides)) { - if (!menu.MultiTenancySides.HasFlag(multiTenancySides)) - { - continue; - } - - var menuMeta = new Dictionary() - { - { "title", menu.DisplayName }, - { "icon", menu.Icon ?? "" }, - { "orderNo", menu.Order }, - { "hideTab", false }, - { "ignoreAuth", false }, - }; - foreach (var prop in menu.ExtraProperties) - { - if (menuMeta.ContainsKey(prop.Key)) - { - menuMeta[prop.Key] = prop.Value; - } - else - { - menuMeta.Add(prop.Key, prop.Value); - } - } - - var seedMenu = await SeedMenuAsync( - layout: layout, - data: data, - name: menu.Name, - path: menu.Url, - code: CodeNumberGenerator.CreateCode(GetNextCode()), - component: layout.Path, - displayName: menu.DisplayName, - redirect: menu.Redirect, - description: menu.Description, - parentId: null, - tenantId: layout.TenantId, - meta: menuMeta, - roles: new string[] { "admin" }); - - await SeedDefinitionMenuItemsAsync(layout, data, seedMenu, menu.Items, multiTenancySides); + continue; } - } - private async Task SeedDefinitionMenuItemsAsync( - Layout layout, - Data data, - Menu menu, - ApplicationMenuList items, - MultiTenancySides multiTenancySides) - { - int index = 1; - foreach (var item in items) + var menuMeta = new Dictionary() + { + { "title", menu.DisplayName }, + { "icon", menu.Icon ?? "" }, + { "orderNo", menu.Order }, + { "hideTab", false }, + { "ignoreAuth", false }, + }; + foreach (var prop in menu.ExtraProperties) { - if (!item.MultiTenancySides.HasFlag(multiTenancySides)) + if (menuMeta.ContainsKey(prop.Key)) { - continue; + menuMeta[prop.Key] = prop.Value; } - - var menuMeta = new Dictionary() - { - { "title", item.DisplayName }, - { "icon", item.Icon ?? "" }, - { "orderNo", item.Order }, - { "hideTab", false }, - { "ignoreAuth", false }, - }; - foreach (var prop in item.ExtraProperties) + else { - if (menuMeta.ContainsKey(prop.Key)) - { - menuMeta[prop.Key] = prop.Value; - } - else - { - menuMeta.Add(prop.Key, prop.Value); - } + menuMeta.Add(prop.Key, prop.Value); } - - var seedMenu = await SeedMenuAsync( - layout: layout, - data: data, - name: item.Name, - path: item.Url, - code: CodeNumberGenerator.AppendCode(menu.Code, CodeNumberGenerator.CreateCode(index)), - component: item.Component.IsNullOrWhiteSpace() ? layout.Path : item.Component, - displayName: item.DisplayName, - redirect: item.Redirect, - description: item.Description, - parentId: menu.Id, - tenantId: menu.TenantId, - meta: menuMeta, - roles: new string[] { "admin" }); - - await SeedDefinitionMenuItemsAsync(layout, data, seedMenu, item.Items, multiTenancySides); - - index++; } + + var seedMenu = await SeedMenuAsync( + layout: layout, + data: data, + name: menu.Name, + path: menu.Url, + code: CodeNumberGenerator.CreateCode(GetNextCode()), + component: layout.Path, + displayName: menu.DisplayName, + redirect: menu.Redirect, + description: menu.Description, + parentId: null, + tenantId: layout.TenantId, + meta: menuMeta, + roles: new string[] { "admin" }); + + await SeedDefinitionMenuItemsAsync(layout, data, seedMenu, menu.Items, multiTenancySides); } + } - private async Task SeedMenuAsync( - Layout layout, - Data data, - string name, - string path, - string code, - string component, - string displayName, - string redirect = "", - string description = "", - Guid? parentId = null, - Guid? tenantId = null, - Dictionary meta = null, - string[] roles = null, - Guid[] users = null, - bool isPublic = false - ) + private async Task SeedDefinitionMenuItemsAsync( + Layout layout, + Data data, + Menu menu, + ApplicationMenuList items, + MultiTenancySides multiTenancySides) + { + int index = 1; + foreach (var item in items) { - var menu = await RouteDataSeeder.SeedMenuAsync( - layout, - name, - path, - code, - component, - displayName, - redirect, - description, - parentId, - tenantId, - isPublic - ); - foreach (var item in data.Items) + if (!item.MultiTenancySides.HasFlag(multiTenancySides)) { - menu.SetProperty(item.Name, item.DefaultValue); - } - if (meta != null) - { - foreach (var item in meta) - { - menu.SetProperty(item.Key, item.Value); - } + continue; } - if (roles != null) + var menuMeta = new Dictionary() { - foreach (var role in roles) + { "title", item.DisplayName }, + { "icon", item.Icon ?? "" }, + { "orderNo", item.Order }, + { "hideTab", false }, + { "ignoreAuth", false }, + }; + foreach (var prop in item.ExtraProperties) + { + if (menuMeta.ContainsKey(prop.Key)) { - await RouteDataSeeder.SeedRoleMenuAsync(role, menu, tenantId); + menuMeta[prop.Key] = prop.Value; } - } - - if (users != null) - { - foreach (var user in users) + else { - await RouteDataSeeder.SeedUserMenuAsync(user, menu, tenantId); + menuMeta.Add(prop.Key, prop.Value); } } - return menu; + var seedMenu = await SeedMenuAsync( + layout: layout, + data: data, + name: item.Name, + path: item.Url, + code: CodeNumberGenerator.AppendCode(menu.Code, CodeNumberGenerator.CreateCode(index)), + component: item.Component.IsNullOrWhiteSpace() ? layout.Path : item.Component, + displayName: item.DisplayName, + redirect: item.Redirect, + description: item.Description, + parentId: menu.Id, + tenantId: menu.TenantId, + meta: menuMeta, + roles: new string[] { "admin" }); + + await SeedDefinitionMenuItemsAsync(layout, data, seedMenu, item.Items, multiTenancySides); + + index++; } + } - private async Task SeedUIFrameworkDataAsync(Guid? tenantId) + private async Task SeedMenuAsync( + Layout layout, + Data data, + string name, + string path, + string code, + string component, + string displayName, + string redirect = "", + string description = "", + Guid? parentId = null, + Guid? tenantId = null, + Dictionary meta = null, + string[] roles = null, + Guid[] users = null, + bool isPublic = false + ) + { + var menu = await RouteDataSeeder.SeedMenuAsync( + layout, + name, + path, + code, + component, + displayName, + redirect, + description, + parentId, + tenantId, + isPublic + ); + foreach (var item in data.Items) { - var data = await DataDictionaryDataSeeder - .SeedAsync( - "UI Framework", - CodeNumberGenerator.CreateCode(10), - "UI框架", - "UI Framework", - null, - tenantId, - true); - - data.AddItem( - GuidGenerator, - Options.UI, - Options.UI, - Options.UI, - ValueType.String, - Options.UI, - isStatic: true); - - return data.FindItem(Options.UI); + menu.SetProperty(item.Name, item.DefaultValue); } - - private async Task SeedDefaultLayoutAsync(Data data, DataItem uiDataItem) + if (meta != null) { - var layout = await RouteDataSeeder.SeedLayoutAsync( - Options.LayoutName, - Options.LayoutPath, // 路由层面已经处理好了,只需要传递LAYOUT可自动引用布局 - Options.LayoutName, - data.Id, - uiDataItem.Name, - "", - Options.LayoutName, - data.TenantId - ); - - return layout; + foreach (var item in meta) + { + menu.SetProperty(item.Key, item.Value); + } } - private async Task SeedLayoutDataAsync(Guid? tenantId) + if (roles != null) { - var data = await DataDictionaryDataSeeder - .SeedAsync( - Options.LayoutName, - CodeNumberGenerator.CreateCode(10), - "Vben Admin 布局约束", - "Vben Admin Layout Meta Dictionary", - null, - tenantId, - true); - - data.AddItem( - GuidGenerator, - "hideMenu", - "不在菜单显示", - "false", - ValueType.Boolean, - "当前路由不在菜单显示", - isStatic: true); - data.AddItem( - GuidGenerator, - "icon", - "图标", - "", - ValueType.String, - "图标,也是菜单图标", - isStatic: true); - data.AddItem( - GuidGenerator, - "currentActiveMenu", - "当前激活的菜单", - "", - ValueType.String, - "用于配置详情页时左侧激活的菜单路径", - isStatic: true); - data.AddItem( - GuidGenerator, - "ignoreKeepAlive", - "KeepAlive缓存", - "false", - ValueType.Boolean, - "是否忽略KeepAlive缓存", - isStatic: true); - data.AddItem( - GuidGenerator, - "frameSrc", - "IFrame地址", - "", - ValueType.String, - "内嵌iframe的地址", - isStatic: true); - data.AddItem( - GuidGenerator, - "transitionName", - "路由切换动画", - "", - ValueType.String, - "指定该路由切换的动画名", - isStatic: true); - data.AddItem( - GuidGenerator, - "roles", - "可以访问的角色", - "", - ValueType.Array, - "可以访问的角色,只在权限模式为Role的时候有效", - isStatic: true); - data.AddItem( - GuidGenerator, - "title", - "路由标题", - "", - ValueType.String, - "路由title 一般必填", - false, - isStatic: true); - data.AddItem( - GuidGenerator, - "carryParam", - "在tab页显示", - "false", - ValueType.Boolean, - "如果该路由会携带参数,且需要在tab页上面显示。则需要设置为true", - isStatic: true); - data.AddItem( - GuidGenerator, - "hideBreadcrumb", - "隐藏面包屑", - "false", - ValueType.Boolean, - "隐藏该路由在面包屑上面的显示", - isStatic: true); - data.AddItem( - GuidGenerator, - "ignoreAuth", - "忽略权限", - "false", - ValueType.Boolean, - "是否忽略权限,只在权限模式为Role的时候有效", - isStatic: true); - data.AddItem( - GuidGenerator, - "hideChildrenInMenu", - "隐藏所有子菜单", - "false", - ValueType.Boolean, - "隐藏所有子菜单", - isStatic: true); - data.AddItem( - GuidGenerator, - "hideTab", - "不在标签页显示", - "false", - ValueType.Boolean, - "当前路由不在标签页显示", - isStatic: true); - data.AddItem( - GuidGenerator, - "affix", - "固定标签页", - "false", - ValueType.Boolean, - "是否固定标签页", - isStatic: true); - data.AddItem( - GuidGenerator, - "requiredFeatures", - "必要的功能", - "", - ValueType.String, - "多个功能间用英文 , 分隔", - isStatic: true); - data.AddItem( - GuidGenerator, - "dynamicLevel", - "可打开Tab页数", - "", - ValueType.Numeic, - "动态路由可打开Tab页数", - isStatic: true); - data.AddItem( - GuidGenerator, - "hidePathForChildren", - "忽略本级path", - "", - ValueType.Boolean, - "是否在子级菜单的完整path中忽略本级path。2.5.3以上版本有效", - isStatic: true); - data.AddItem( - GuidGenerator, - "orderNo", - "菜单排序", - "", - ValueType.Numeic, - "菜单排序,只对第一级有效", - isStatic: true); - data.AddItem( - GuidGenerator, - "realPath", - "实际Path", - "", - ValueType.String, - "动态路由的实际Path, 即去除路由的动态部分;", - isStatic: true); - data.AddItem( - GuidGenerator, - "frameFormat", - "格式化IFrame", - "false", - ValueType.Boolean, - "扩展的格式化frame,{token}: 在打开的iframe页面传递token请求头"); - - return data; + foreach (var role in roles) + { + await RouteDataSeeder.SeedRoleMenuAsync(role, menu, tenantId); + } } - private int GetNextCode() + if (users != null) { - Interlocked.Increment(ref _lastCodeNumber); - return _lastCodeNumber; + foreach (var user in users) + { + await RouteDataSeeder.SeedUserMenuAsync(user, menu, tenantId); + } } + + return menu; + } + + private async Task SeedUIFrameworkDataAsync(Guid? tenantId) + { + var data = await DataDictionaryDataSeeder + .SeedAsync( + "UI Framework", + CodeNumberGenerator.CreateCode(10), + "UI框架", + "UI Framework", + null, + tenantId, + true); + + data.AddItem( + GuidGenerator, + Options.UI, + Options.UI, + Options.UI, + ValueType.String, + Options.UI, + isStatic: true); + + return data.FindItem(Options.UI); + } + + private async Task SeedDefaultLayoutAsync(Data data, DataItem uiDataItem) + { + var layout = await RouteDataSeeder.SeedLayoutAsync( + Options.LayoutName, + Options.LayoutPath, // 路由层面已经处理好了,只需要传递LAYOUT可自动引用布局 + Options.LayoutName, + data.Id, + uiDataItem.Name, + "", + Options.LayoutName, + data.TenantId + ); + + return layout; + } + + private async Task SeedLayoutDataAsync(Guid? tenantId) + { + var data = await DataDictionaryDataSeeder + .SeedAsync( + Options.LayoutName, + CodeNumberGenerator.CreateCode(10), + "Vben Admin 布局约束", + "Vben Admin Layout Meta Dictionary", + null, + tenantId, + true); + + data.AddItem( + GuidGenerator, + "hideMenu", + "不在菜单显示", + "false", + ValueType.Boolean, + "当前路由不在菜单显示", + isStatic: true); + data.AddItem( + GuidGenerator, + "icon", + "图标", + "", + ValueType.String, + "图标,也是菜单图标", + isStatic: true); + data.AddItem( + GuidGenerator, + "currentActiveMenu", + "当前激活的菜单", + "", + ValueType.String, + "用于配置详情页时左侧激活的菜单路径", + isStatic: true); + data.AddItem( + GuidGenerator, + "ignoreKeepAlive", + "KeepAlive缓存", + "false", + ValueType.Boolean, + "是否忽略KeepAlive缓存", + isStatic: true); + data.AddItem( + GuidGenerator, + "frameSrc", + "IFrame地址", + "", + ValueType.String, + "内嵌iframe的地址", + isStatic: true); + data.AddItem( + GuidGenerator, + "transitionName", + "路由切换动画", + "", + ValueType.String, + "指定该路由切换的动画名", + isStatic: true); + data.AddItem( + GuidGenerator, + "roles", + "可以访问的角色", + "", + ValueType.Array, + "可以访问的角色,只在权限模式为Role的时候有效", + isStatic: true); + data.AddItem( + GuidGenerator, + "title", + "路由标题", + "", + ValueType.String, + "路由title 一般必填", + false, + isStatic: true); + data.AddItem( + GuidGenerator, + "carryParam", + "在tab页显示", + "false", + ValueType.Boolean, + "如果该路由会携带参数,且需要在tab页上面显示。则需要设置为true", + isStatic: true); + data.AddItem( + GuidGenerator, + "hideBreadcrumb", + "隐藏面包屑", + "false", + ValueType.Boolean, + "隐藏该路由在面包屑上面的显示", + isStatic: true); + data.AddItem( + GuidGenerator, + "ignoreAuth", + "忽略权限", + "false", + ValueType.Boolean, + "是否忽略权限,只在权限模式为Role的时候有效", + isStatic: true); + data.AddItem( + GuidGenerator, + "hideChildrenInMenu", + "隐藏所有子菜单", + "false", + ValueType.Boolean, + "隐藏所有子菜单", + isStatic: true); + data.AddItem( + GuidGenerator, + "hideTab", + "不在标签页显示", + "false", + ValueType.Boolean, + "当前路由不在标签页显示", + isStatic: true); + data.AddItem( + GuidGenerator, + "affix", + "固定标签页", + "false", + ValueType.Boolean, + "是否固定标签页", + isStatic: true); + data.AddItem( + GuidGenerator, + "requiredFeatures", + "必要的功能", + "", + ValueType.String, + "多个功能间用英文 , 分隔", + isStatic: true); + data.AddItem( + GuidGenerator, + "dynamicLevel", + "可打开Tab页数", + "", + ValueType.Numeic, + "动态路由可打开Tab页数", + isStatic: true); + data.AddItem( + GuidGenerator, + "hidePathForChildren", + "忽略本级path", + "", + ValueType.Boolean, + "是否在子级菜单的完整path中忽略本级path。2.5.3以上版本有效", + isStatic: true); + data.AddItem( + GuidGenerator, + "orderNo", + "菜单排序", + "", + ValueType.Numeic, + "菜单排序,只对第一级有效", + isStatic: true); + data.AddItem( + GuidGenerator, + "realPath", + "实际Path", + "", + ValueType.String, + "动态路由的实际Path, 即去除路由的动态部分;", + isStatic: true); + data.AddItem( + GuidGenerator, + "frameFormat", + "格式化IFrame", + "false", + ValueType.Boolean, + "扩展的格式化frame,{token}: 在打开的iframe页面传递token请求头"); + + return data; + } + + private int GetNextCode() + { + Interlocked.Increment(ref _lastCodeNumber); + return _lastCodeNumber; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN.Platform.Application.Contracts.csproj b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN.Platform.Application.Contracts.csproj index f175ccc03..6de470973 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN.Platform.Application.Contracts.csproj +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN.Platform.Application.Contracts.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Platform.Application.Contracts + LINGYUN.Abp.Platform.Application.Contracts + false + false + false diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataCreateDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataCreateDto.cs index a5ea68f16..6f6a7fee5 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataCreateDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataCreateDto.cs @@ -1,9 +1,8 @@ using System; -namespace LINGYUN.Platform.Datas +namespace LINGYUN.Platform.Datas; + +public class DataCreateDto : DataCreateOrUpdateDto { - public class DataCreateDto : DataCreateOrUpdateDto - { - public Guid? ParentId { get; set; } - } + public Guid? ParentId { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataCreateOrUpdateDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataCreateOrUpdateDto.cs index c48488e5a..c514ab788 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataCreateOrUpdateDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataCreateOrUpdateDto.cs @@ -1,19 +1,18 @@ using System.ComponentModel.DataAnnotations; using Volo.Abp.Validation; -namespace LINGYUN.Platform.Datas +namespace LINGYUN.Platform.Datas; + +public class DataCreateOrUpdateDto { - public class DataCreateOrUpdateDto - { - [Required] - [DynamicStringLength(typeof(DataConsts), nameof(DataConsts.MaxNameLength))] - public string Name { get; set; } + [Required] + [DynamicStringLength(typeof(DataConsts), nameof(DataConsts.MaxNameLength))] + public string Name { get; set; } - [Required] - [DynamicStringLength(typeof(DataConsts), nameof(DataConsts.MaxDisplayNameLength))] - public string DisplayName { get; set; } + [Required] + [DynamicStringLength(typeof(DataConsts), nameof(DataConsts.MaxDisplayNameLength))] + public string DisplayName { get; set; } - [DynamicStringLength(typeof(DataConsts), nameof(DataConsts.MaxDescriptionLength))] - public string Description { get; set; } - } + [DynamicStringLength(typeof(DataConsts), nameof(DataConsts.MaxDescriptionLength))] + public string Description { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataDto.cs index d52aefc8c..e851e1652 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataDto.cs @@ -2,20 +2,19 @@ using System.Collections.Generic; using Volo.Abp.Application.Dtos; -namespace LINGYUN.Platform.Datas +namespace LINGYUN.Platform.Datas; + +public class DataDto : EntityDto { - public class DataDto : EntityDto - { - public string Name { get; set; } + public string Name { get; set; } - public string Code { get; set; } + public string Code { get; set; } - public string DisplayName { get; set; } + public string DisplayName { get; set; } - public string Description { get; set; } + public string Description { get; set; } - public Guid? ParentId { get; set; } + public Guid? ParentId { get; set; } - public List Items { get; set; } = new List(); - } + public List Items { get; set; } = new List(); } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataItemCreateDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataItemCreateDto.cs index e7321212e..7d285a2ed 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataItemCreateDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataItemCreateDto.cs @@ -2,12 +2,11 @@ using System.ComponentModel.DataAnnotations; using Volo.Abp.Validation; -namespace LINGYUN.Platform.Datas +namespace LINGYUN.Platform.Datas; + +public class DataItemCreateDto : DataItemCreateOrUpdateDto { - public class DataItemCreateDto : DataItemCreateOrUpdateDto - { - [Required] - [DynamicStringLength(typeof(DataItemConsts), nameof(DataItemConsts.MaxNameLength))] - public string Name { get; set; } - } + [Required] + [DynamicStringLength(typeof(DataItemConsts), nameof(DataItemConsts.MaxNameLength))] + public string Name { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataItemCreateOrUpdateDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataItemCreateOrUpdateDto.cs index 913f169d4..8d1acff0d 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataItemCreateOrUpdateDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataItemCreateOrUpdateDto.cs @@ -6,33 +6,32 @@ using LINGYUN.Platform.Localization; using Microsoft.Extensions.Localization; -namespace LINGYUN.Platform.Datas +namespace LINGYUN.Platform.Datas; + +public class DataItemCreateOrUpdateDto : IValidatableObject { - public class DataItemCreateOrUpdateDto : IValidatableObject - { - [Required] - [DynamicStringLength(typeof(DataItemConsts), nameof(DataItemConsts.MaxDisplayNameLength))] - public string DisplayName { get; set; } + [Required] + [DynamicStringLength(typeof(DataItemConsts), nameof(DataItemConsts.MaxDisplayNameLength))] + public string DisplayName { get; set; } - [DynamicStringLength(typeof(DataItemConsts), nameof(DataItemConsts.MaxValueLength))] - public string DefaultValue { get; set; } + [DynamicStringLength(typeof(DataItemConsts), nameof(DataItemConsts.MaxValueLength))] + public string DefaultValue { get; set; } - [DynamicStringLength(typeof(DataItemConsts), nameof(DataItemConsts.MaxDescriptionLength))] - public string Description { get; set; } + [DynamicStringLength(typeof(DataItemConsts), nameof(DataItemConsts.MaxDescriptionLength))] + public string Description { get; set; } - public bool AllowBeNull { get; set; } + public bool AllowBeNull { get; set; } - public ValueType ValueType { get; set; } + public ValueType ValueType { get; set; } - public IEnumerable Validate(ValidationContext validationContext) + public IEnumerable Validate(ValidationContext validationContext) + { + if (!AllowBeNull && DefaultValue.IsNullOrWhiteSpace()) { - if (!AllowBeNull && DefaultValue.IsNullOrWhiteSpace()) - { - var localizer = validationContext.GetRequiredService>(); - yield return new ValidationResult( - localizer["The {0} field is required.", localizer["DisplayName:Value"]], - new string[] { nameof(DefaultValue) }); - } + var localizer = validationContext.GetRequiredService>(); + yield return new ValidationResult( + localizer["The {0} field is required.", localizer["DisplayName:Value"]], + new string[] { nameof(DefaultValue) }); } } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataItemDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataItemDto.cs index f37517a94..3e7116cf7 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataItemDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataItemDto.cs @@ -1,20 +1,19 @@ using System; using Volo.Abp.Application.Dtos; -namespace LINGYUN.Platform.Datas +namespace LINGYUN.Platform.Datas; + +public class DataItemDto : EntityDto { - public class DataItemDto : EntityDto - { - public string Name { get; set; } + public string Name { get; set; } - public string DisplayName { get; set; } + public string DisplayName { get; set; } - public string DefaultValue { get; set; } + public string DefaultValue { get; set; } - public string Description { get; set; } + public string Description { get; set; } - public bool AllowBeNull { get; set; } + public bool AllowBeNull { get; set; } - public ValueType ValueType { get; set; } - } + public ValueType ValueType { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataItemUpdateDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataItemUpdateDto.cs index 26c1aaaaf..ef54261d8 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataItemUpdateDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataItemUpdateDto.cs @@ -1,8 +1,7 @@ using System; -namespace LINGYUN.Platform.Datas +namespace LINGYUN.Platform.Datas; + +public class DataItemUpdateDto : DataItemCreateOrUpdateDto { - public class DataItemUpdateDto : DataItemCreateOrUpdateDto - { - } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataUpdateDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataUpdateDto.cs index fe4fdaab8..7cc41bec2 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataUpdateDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/DataUpdateDto.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Platform.Datas +namespace LINGYUN.Platform.Datas; + +public class DataUpdateDto : DataCreateOrUpdateDto { - public class DataUpdateDto : DataCreateOrUpdateDto - { - } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/GetDataByNameInput.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/GetDataByNameInput.cs index 10e40aaa6..6a669c2aa 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/GetDataByNameInput.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/GetDataByNameInput.cs @@ -1,12 +1,11 @@ using System.ComponentModel.DataAnnotations; using Volo.Abp.Validation; -namespace LINGYUN.Platform.Datas +namespace LINGYUN.Platform.Datas; + +public class GetDataByNameInput { - public class GetDataByNameInput - { - [Required] - [DynamicStringLength(typeof(DataConsts), nameof(DataConsts.MaxNameLength))] - public string Name { get; set; } - } + [Required] + [DynamicStringLength(typeof(DataConsts), nameof(DataConsts.MaxNameLength))] + public string Name { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/GetDataListInput.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/GetDataListInput.cs index a7b9217f6..e5ba3c294 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/GetDataListInput.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/Dto/GetDataListInput.cs @@ -1,9 +1,8 @@ using Volo.Abp.Application.Dtos; -namespace LINGYUN.Platform.Datas +namespace LINGYUN.Platform.Datas; + +public class GetDataListInput : PagedAndSortedResultRequestDto { - public class GetDataListInput : PagedAndSortedResultRequestDto - { - public string Filter { get; set; } - } + public string Filter { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/IDataAppService.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/IDataAppService.cs index fe223d185..a25f42cd5 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/IDataAppService.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Datas/IDataAppService.cs @@ -3,26 +3,25 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; -namespace LINGYUN.Platform.Datas +namespace LINGYUN.Platform.Datas; + +public interface IDataAppService : + ICrudAppService< + DataDto, + Guid, + GetDataListInput, + DataCreateDto, + DataUpdateDto> { - public interface IDataAppService : - ICrudAppService< - DataDto, - Guid, - GetDataListInput, - DataCreateDto, - DataUpdateDto> - { - Task GetAsync(string name); + Task GetAsync(string name); - Task> GetAllAsync(); + Task> GetAllAsync(); - Task MoveAsync(Guid id, DataMoveDto input); + Task MoveAsync(Guid id, DataMoveDto input); - Task CreateItemAsync(Guid id, DataItemCreateDto input); + Task CreateItemAsync(Guid id, DataItemCreateDto input); - Task UpdateItemAsync(Guid id, string name, DataItemUpdateDto input); + Task UpdateItemAsync(Guid id, string name, DataItemUpdateDto input); - Task DeleteItemAsync(Guid id, string name); - } + Task DeleteItemAsync(Guid id, string name); } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/GetLayoutListInput.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/GetLayoutListInput.cs index 080d341c0..b34cdb349 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/GetLayoutListInput.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/GetLayoutListInput.cs @@ -2,13 +2,12 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.Validation; -namespace LINGYUN.Platform.Layouts +namespace LINGYUN.Platform.Layouts; + +public class GetLayoutListInput : PagedAndSortedResultRequestDto { - public class GetLayoutListInput : PagedAndSortedResultRequestDto - { - public string Filter { get; set; } + public string Filter { get; set; } - [DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))] - public string Framework { get; set; } - } + [DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))] + public string Framework { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutCreateDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutCreateDto.cs index e8da1d057..bd615ade8 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutCreateDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutCreateDto.cs @@ -3,14 +3,13 @@ using System.ComponentModel.DataAnnotations; using Volo.Abp.Validation; -namespace LINGYUN.Platform.Layouts +namespace LINGYUN.Platform.Layouts; + +public class LayoutCreateDto : LayoutCreateOrUpdateDto { - public class LayoutCreateDto : LayoutCreateOrUpdateDto - { - public Guid DataId { get; set; } + public Guid DataId { get; set; } - [Required] - [DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))] - public string Framework { get; set; } - } + [Required] + [DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))] + public string Framework { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutCreateOrUpdateDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutCreateOrUpdateDto.cs index b54697129..ada68768a 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutCreateOrUpdateDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutCreateOrUpdateDto.cs @@ -2,26 +2,25 @@ using System.ComponentModel.DataAnnotations; using Volo.Abp.Validation; -namespace LINGYUN.Platform.Layouts +namespace LINGYUN.Platform.Layouts; + +public class LayoutCreateOrUpdateDto { - public class LayoutCreateOrUpdateDto - { - [Required] - [DynamicStringLength(typeof(RouteConsts), nameof(RouteConsts.MaxNameLength))] - public string Name { get; set; } + [Required] + [DynamicStringLength(typeof(RouteConsts), nameof(RouteConsts.MaxNameLength))] + public string Name { get; set; } - [Required] - [DynamicStringLength(typeof(RouteConsts), nameof(RouteConsts.MaxDisplayNameLength))] - public string DisplayName { get; set; } + [Required] + [DynamicStringLength(typeof(RouteConsts), nameof(RouteConsts.MaxDisplayNameLength))] + public string DisplayName { get; set; } - [DynamicStringLength(typeof(RouteConsts), nameof(RouteConsts.MaxDescriptionLength))] - public string Description { get; set; } + [DynamicStringLength(typeof(RouteConsts), nameof(RouteConsts.MaxDescriptionLength))] + public string Description { get; set; } - [Required] - [DynamicStringLength(typeof(RouteConsts), nameof(RouteConsts.MaxPathLength))] - public string Path { get; set; } + [Required] + [DynamicStringLength(typeof(RouteConsts), nameof(RouteConsts.MaxPathLength))] + public string Path { get; set; } - [DynamicStringLength(typeof(RouteConsts), nameof(RouteConsts.MaxRedirectLength))] - public string Redirect { get; set; } - } + [DynamicStringLength(typeof(RouteConsts), nameof(RouteConsts.MaxRedirectLength))] + public string Redirect { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutDto.cs index a3974cea9..10eae3a02 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutDto.cs @@ -1,17 +1,16 @@ using LINGYUN.Platform.Routes; using System; -namespace LINGYUN.Platform.Layouts +namespace LINGYUN.Platform.Layouts; + +public class LayoutDto : RouteDto { - public class LayoutDto : RouteDto - { - /// - /// 框架 - /// - public string Framework { get; set; } - /// - /// 约定的Meta采用哪种数据字典,主要是约束路由必须字段的一致性 - /// - public Guid DataId { get; set; } - } + /// + /// 框架 + /// + public string Framework { get; set; } + /// + /// 约定的Meta采用哪种数据字典,主要是约束路由必须字段的一致性 + /// + public Guid DataId { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutUpdateDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutUpdateDto.cs index 5ab55c5b3..056d67db4 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutUpdateDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/Dto/LayoutUpdateDto.cs @@ -1,6 +1,5 @@ -namespace LINGYUN.Platform.Layouts +namespace LINGYUN.Platform.Layouts; + +public class LayoutUpdateDto : LayoutCreateOrUpdateDto { - public class LayoutUpdateDto : LayoutCreateOrUpdateDto - { - } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/ILayoutAppService.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/ILayoutAppService.cs index 69dc95752..e27af2662 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/ILayoutAppService.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Layouts/ILayoutAppService.cs @@ -3,16 +3,15 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; -namespace LINGYUN.Platform.Layouts +namespace LINGYUN.Platform.Layouts; + +public interface ILayoutAppService : + ICrudAppService< + LayoutDto, + Guid, + GetLayoutListInput, + LayoutCreateDto, + LayoutUpdateDto> { - public interface ILayoutAppService : - ICrudAppService< - LayoutDto, - Guid, - GetLayoutListInput, - LayoutCreateDto, - LayoutUpdateDto> - { - Task> GetAllListAsync(); - } + Task> GetAllListAsync(); } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/GetMenuInput.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/GetMenuInput.cs index f4b0336bc..498737f79 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/GetMenuInput.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/GetMenuInput.cs @@ -1,11 +1,10 @@ using LINGYUN.Platform.Routes; using Volo.Abp.Validation; -namespace LINGYUN.Platform.Menus +namespace LINGYUN.Platform.Menus; + +public class GetMenuInput { - public class GetMenuInput - { - [DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))] - public string Framework { get; set; } - } + [DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))] + public string Framework { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuCreateDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuCreateDto.cs index f2896541d..c2d8b164d 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuCreateDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuCreateDto.cs @@ -1,11 +1,10 @@ using System; using System.ComponentModel.DataAnnotations; -namespace LINGYUN.Platform.Menus +namespace LINGYUN.Platform.Menus; + +public class MenuCreateDto : MenuCreateOrUpdateDto { - public class MenuCreateDto : MenuCreateOrUpdateDto - { - [Required] - public Guid LayoutId { get; set; } - } + [Required] + public Guid LayoutId { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuCreateOrUpdateDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuCreateOrUpdateDto.cs index 8b59081bb..3ded986ad 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuCreateOrUpdateDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuCreateOrUpdateDto.cs @@ -4,36 +4,35 @@ using System.ComponentModel.DataAnnotations; using Volo.Abp.Validation; -namespace LINGYUN.Platform.Menus +namespace LINGYUN.Platform.Menus; + +public class MenuCreateOrUpdateDto { - public class MenuCreateOrUpdateDto - { - public Guid? ParentId { get; set; } + public Guid? ParentId { get; set; } - [Required] - [DynamicStringLength(typeof(RouteConsts), nameof(RouteConsts.MaxNameLength))] - public string Name { get; set; } + [Required] + [DynamicStringLength(typeof(RouteConsts), nameof(RouteConsts.MaxNameLength))] + public string Name { get; set; } - [Required] - [DynamicStringLength(typeof(RouteConsts), nameof(RouteConsts.MaxDisplayNameLength))] - public string DisplayName { get; set; } + [Required] + [DynamicStringLength(typeof(RouteConsts), nameof(RouteConsts.MaxDisplayNameLength))] + public string DisplayName { get; set; } - [DynamicStringLength(typeof(RouteConsts), nameof(RouteConsts.MaxDescriptionLength))] - public string Description { get; set; } + [DynamicStringLength(typeof(RouteConsts), nameof(RouteConsts.MaxDescriptionLength))] + public string Description { get; set; } - [Required] - [DynamicStringLength(typeof(RouteConsts), nameof(RouteConsts.MaxPathLength))] - public string Path { get; set; } + [Required] + [DynamicStringLength(typeof(RouteConsts), nameof(RouteConsts.MaxPathLength))] + public string Path { get; set; } - [DynamicStringLength(typeof(RouteConsts), nameof(RouteConsts.MaxRedirectLength))] - public string Redirect { get; set; } + [DynamicStringLength(typeof(RouteConsts), nameof(RouteConsts.MaxRedirectLength))] + public string Redirect { get; set; } - [Required] - [DynamicStringLength(typeof(MenuConsts), nameof(MenuConsts.MaxComponentLength))] - public string Component { get; set; } + [Required] + [DynamicStringLength(typeof(MenuConsts), nameof(MenuConsts.MaxComponentLength))] + public string Component { get; set; } - public bool IsPublic { get; set; } + public bool IsPublic { get; set; } - public Dictionary Meta { get; set; } = new Dictionary(); - } + public Dictionary Meta { get; set; } = new Dictionary(); } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuDto.cs index be0bd7daa..6bf874365 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuDto.cs @@ -2,32 +2,31 @@ using System; using System.Collections.Generic; -namespace LINGYUN.Platform.Menus +namespace LINGYUN.Platform.Menus; + +public class MenuDto : RouteDto { - public class MenuDto : RouteDto - { - /// - /// 菜单编号 - /// - public string Code { get; set; } - /// - /// 菜单布局页 - /// - public string Component { get; set; } - /// - /// 框架 - /// - public string Framework { get; set; } - /// - /// 父节点 - /// - public Guid? ParentId { get; set; } - /// - /// 所属布局标识 - /// - public Guid LayoutId { get; set; } + /// + /// 菜单编号 + /// + public string Code { get; set; } + /// + /// 菜单布局页 + /// + public string Component { get; set; } + /// + /// 框架 + /// + public string Framework { get; set; } + /// + /// 父节点 + /// + public Guid? ParentId { get; set; } + /// + /// 所属布局标识 + /// + public Guid LayoutId { get; set; } - public bool IsPublic { get; set; } - public bool Startup { get; set; } - } + public bool IsPublic { get; set; } + public bool Startup { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetAllInput.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetAllInput.cs index b573b2f00..fa0b6218f 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetAllInput.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetAllInput.cs @@ -3,21 +3,20 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.Validation; -namespace LINGYUN.Platform.Menus +namespace LINGYUN.Platform.Menus; + +public class MenuGetAllInput : ISortedResultRequest { - public class MenuGetAllInput : ISortedResultRequest - { - [DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))] - public string Framework { get; set; } + [DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))] + public string Framework { get; set; } - public string Filter { get; set; } + public string Filter { get; set; } - public bool Reverse { get; set; } + public bool Reverse { get; set; } - public Guid? ParentId { get; set; } + public Guid? ParentId { get; set; } - public string Sorting { get; set; } + public string Sorting { get; set; } - public Guid? LayoutId { get; set; } - } + public Guid? LayoutId { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetByRoleInput.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetByRoleInput.cs index f5cb155bd..c2118d880 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetByRoleInput.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetByRoleInput.cs @@ -2,15 +2,14 @@ using System.ComponentModel.DataAnnotations; using Volo.Abp.Validation; -namespace LINGYUN.Platform.Menus +namespace LINGYUN.Platform.Menus; + +public class MenuGetByRoleInput { - public class MenuGetByRoleInput - { - [Required] - [StringLength(80)] - public string Role { get; set; } + [Required] + [StringLength(80)] + public string Role { get; set; } - [DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))] - public string Framework { get; set; } - } + [DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))] + public string Framework { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetByUserInput.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetByUserInput.cs index 241cd7210..50c181c90 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetByUserInput.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetByUserInput.cs @@ -3,16 +3,15 @@ using System.ComponentModel.DataAnnotations; using Volo.Abp.Validation; -namespace LINGYUN.Platform.Menus +namespace LINGYUN.Platform.Menus; + +public class MenuGetByUserInput { - public class MenuGetByUserInput - { - [Required] - public Guid UserId { get; set; } + [Required] + public Guid UserId { get; set; } - public string[] Roles { get; set; } = new string[0]; + public string[] Roles { get; set; } = new string[0]; - [DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))] - public string Framework { get; set; } - } + [DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))] + public string Framework { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetListInput.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetListInput.cs index c9b847857..b3c3511c1 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetListInput.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuGetListInput.cs @@ -3,17 +3,16 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.Validation; -namespace LINGYUN.Platform.Menus +namespace LINGYUN.Platform.Menus; + +public class MenuGetListInput : PagedAndSortedResultRequestDto { - public class MenuGetListInput : PagedAndSortedResultRequestDto - { - [DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))] - public string Framework { get; set; } + [DynamicStringLength(typeof(LayoutConsts), nameof(LayoutConsts.MaxFrameworkLength))] + public string Framework { get; set; } - public string Filter { get; set; } + public string Filter { get; set; } - public Guid? ParentId { get; set; } + public Guid? ParentId { get; set; } - public Guid? LayoutId { get; set; } - } + public Guid? LayoutId { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuItemDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuItemDto.cs index 0bc5350e9..507ade439 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuItemDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuItemDto.cs @@ -1,21 +1,20 @@ using LINGYUN.Platform.Routes; using System.Collections.Generic; -namespace LINGYUN.Platform.Menus +namespace LINGYUN.Platform.Menus; + +public class MenuItemDto : RouteDto { - public class MenuItemDto : RouteDto - { - /// - /// 菜单编号 - /// - public string Code { get; set; } - /// - /// 菜单组件 - /// - public string Component { get; set; } - /// - /// 子菜单列表 - /// - public List Children { get; set; } = new List(); - } + /// + /// 菜单编号 + /// + public string Code { get; set; } + /// + /// 菜单组件 + /// + public string Component { get; set; } + /// + /// 子菜单列表 + /// + public List Children { get; set; } = new List(); } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuUpdateDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuUpdateDto.cs index c6a75f952..67d503864 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuUpdateDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/MenuUpdateDto.cs @@ -1,6 +1,5 @@ -namespace LINGYUN.Platform.Menus +namespace LINGYUN.Platform.Menus; + +public class MenuUpdateDto : MenuCreateOrUpdateDto { - public class MenuUpdateDto : MenuCreateOrUpdateDto - { - } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/RoleMenuInput.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/RoleMenuInput.cs index e44537515..6329d3766 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/RoleMenuInput.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/RoleMenuInput.cs @@ -2,15 +2,14 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -namespace LINGYUN.Platform.Menus +namespace LINGYUN.Platform.Menus; + +public class RoleMenuInput { - public class RoleMenuInput - { - [Required] - [StringLength(80)] - public string RoleName { get; set; } + [Required] + [StringLength(80)] + public string RoleName { get; set; } - [Required] - public List MenuIds { get; set; } = new List(); - } + [Required] + public List MenuIds { get; set; } = new List(); } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/UserMenuInput.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/UserMenuInput.cs index b0f971fe6..4ad6fe864 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/UserMenuInput.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/Dto/UserMenuInput.cs @@ -2,14 +2,13 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -namespace LINGYUN.Platform.Menus +namespace LINGYUN.Platform.Menus; + +public class UserMenuInput { - public class UserMenuInput - { - [Required] - public Guid UserId { get; set; } + [Required] + public Guid UserId { get; set; } - [Required] - public List MenuIds { get; set; } = new List(); - } + [Required] + public List MenuIds { get; set; } = new List(); } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/IMenuAppService.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/IMenuAppService.cs index 4adf49ba8..df5850c47 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/IMenuAppService.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Menus/IMenuAppService.cs @@ -3,30 +3,29 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; -namespace LINGYUN.Platform.Menus +namespace LINGYUN.Platform.Menus; + +public interface IMenuAppService : + ICrudAppService< + MenuDto, + Guid, + MenuGetListInput, + MenuCreateDto, + MenuUpdateDto> { - public interface IMenuAppService : - ICrudAppService< - MenuDto, - Guid, - MenuGetListInput, - MenuCreateDto, - MenuUpdateDto> - { - Task> GetAllAsync(MenuGetAllInput input); + Task> GetAllAsync(MenuGetAllInput input); - Task> GetUserMenuListAsync(MenuGetByUserInput input); + Task> GetUserMenuListAsync(MenuGetByUserInput input); - Task> GetRoleMenuListAsync(MenuGetByRoleInput input); + Task> GetRoleMenuListAsync(MenuGetByRoleInput input); - Task SetUserMenusAsync(UserMenuInput input); + Task SetUserMenusAsync(UserMenuInput input); - Task SetUserStartupAsync(Guid id, UserMenuStartupInput input); + Task SetUserStartupAsync(Guid id, UserMenuStartupInput input); - Task SetRoleMenusAsync(RoleMenuInput input); + Task SetRoleMenusAsync(RoleMenuInput input); - Task SetRoleStartupAsync(Guid id, RoleMenuStartupInput input); + Task SetRoleStartupAsync(Guid id, RoleMenuStartupInput input); - Task> GetCurrentUserMenuListAsync(GetMenuInput input); - } + Task> GetCurrentUserMenuListAsync(GetMenuInput input); } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageGetLatestInput.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageGetLatestInput.cs index 2c779cafd..ea6833373 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageGetLatestInput.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Packages/Dto/PackageGetLatestInput.cs @@ -6,6 +6,9 @@ namespace LINGYUN.Platform.Packages; public class PackageGetLatestInput { [Required] - [DynamicMaxLength(typeof(PackageBlobConsts), nameof(PackageBlobConsts.MaxNameLength))] + [DynamicMaxLength(typeof(PackageConsts), nameof(PackageConsts.MaxNameLength))] public string Name { get; set; } + + [DynamicMaxLength(typeof(PackageConsts), nameof(PackageConsts.MaxVersionLength))] + public string Version { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Permissions/PlatformPermissionDefinitionProvider.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Permissions/PlatformPermissionDefinitionProvider.cs index d9397a3bb..dabb728f0 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Permissions/PlatformPermissionDefinitionProvider.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Permissions/PlatformPermissionDefinitionProvider.cs @@ -2,44 +2,43 @@ using Volo.Abp.Authorization.Permissions; using Volo.Abp.Localization; -namespace LINGYUN.Platform.Permissions +namespace LINGYUN.Platform.Permissions; + +public class PlatformPermissionDefinitionProvider : PermissionDefinitionProvider { - public class PlatformPermissionDefinitionProvider : PermissionDefinitionProvider + public override void Define(IPermissionDefinitionContext context) { - public override void Define(IPermissionDefinitionContext context) - { - var platform = context.AddGroup(PlatformPermissions.GroupName, L("Permission:Platform")); + var platform = context.AddGroup(PlatformPermissions.GroupName, L("Permission:Platform")); - var dataDictionary = platform.AddPermission(PlatformPermissions.DataDictionary.Default, L("Permission:DataDictionary")); - dataDictionary.AddChild(PlatformPermissions.DataDictionary.Create, L("Permission:Create")); - dataDictionary.AddChild(PlatformPermissions.DataDictionary.Update, L("Permission:Update")); - dataDictionary.AddChild(PlatformPermissions.DataDictionary.Move, L("Permission:Move")); - dataDictionary.AddChild(PlatformPermissions.DataDictionary.Delete, L("Permission:Delete")); - dataDictionary.AddChild(PlatformPermissions.DataDictionary.ManageItems, L("Permission:ManageItems")); + var dataDictionary = platform.AddPermission(PlatformPermissions.DataDictionary.Default, L("Permission:DataDictionary")); + dataDictionary.AddChild(PlatformPermissions.DataDictionary.Create, L("Permission:Create")); + dataDictionary.AddChild(PlatformPermissions.DataDictionary.Update, L("Permission:Update")); + dataDictionary.AddChild(PlatformPermissions.DataDictionary.Move, L("Permission:Move")); + dataDictionary.AddChild(PlatformPermissions.DataDictionary.Delete, L("Permission:Delete")); + dataDictionary.AddChild(PlatformPermissions.DataDictionary.ManageItems, L("Permission:ManageItems")); - var layout = platform.AddPermission(PlatformPermissions.Layout.Default, L("Permission:Layout")); - layout.AddChild(PlatformPermissions.Layout.Create, L("Permission:Create")); - layout.AddChild(PlatformPermissions.Layout.Update, L("Permission:Update")); - layout.AddChild(PlatformPermissions.Layout.Delete, L("Permission:Delete")); + var layout = platform.AddPermission(PlatformPermissions.Layout.Default, L("Permission:Layout")); + layout.AddChild(PlatformPermissions.Layout.Create, L("Permission:Create")); + layout.AddChild(PlatformPermissions.Layout.Update, L("Permission:Update")); + layout.AddChild(PlatformPermissions.Layout.Delete, L("Permission:Delete")); - var menu = platform.AddPermission(PlatformPermissions.Menu.Default, L("Permission:Menu")); - menu.AddChild(PlatformPermissions.Menu.Create, L("Permission:Create")); - menu.AddChild(PlatformPermissions.Menu.Update, L("Permission:Update")); - menu.AddChild(PlatformPermissions.Menu.Delete, L("Permission:Delete")); - menu.AddChild(PlatformPermissions.Menu.ManageRoles, L("Permission:ManageRoleMenus")); - menu.AddChild(PlatformPermissions.Menu.ManageUsers, L("Permission:ManageUserMenus")); - menu.AddChild(PlatformPermissions.Menu.ManageUserFavorites, L("Permission:ManageUserFavoriteMenus")); + var menu = platform.AddPermission(PlatformPermissions.Menu.Default, L("Permission:Menu")); + menu.AddChild(PlatformPermissions.Menu.Create, L("Permission:Create")); + menu.AddChild(PlatformPermissions.Menu.Update, L("Permission:Update")); + menu.AddChild(PlatformPermissions.Menu.Delete, L("Permission:Delete")); + menu.AddChild(PlatformPermissions.Menu.ManageRoles, L("Permission:ManageRoleMenus")); + menu.AddChild(PlatformPermissions.Menu.ManageUsers, L("Permission:ManageUserMenus")); + menu.AddChild(PlatformPermissions.Menu.ManageUserFavorites, L("Permission:ManageUserFavoriteMenus")); - var package = platform.AddPermission(PlatformPermissions.Package.Default, L("Permission:Package")); - package.AddChild(PlatformPermissions.Package.Create, L("Permission:Create")); - package.AddChild(PlatformPermissions.Package.Update, L("Permission:Update")); - package.AddChild(PlatformPermissions.Package.Delete, L("Permission:Delete")); - package.AddChild(PlatformPermissions.Package.ManageBlobs, L("Permission:ManageBlobs")); - } + var package = platform.AddPermission(PlatformPermissions.Package.Default, L("Permission:Package")); + package.AddChild(PlatformPermissions.Package.Create, L("Permission:Create")); + package.AddChild(PlatformPermissions.Package.Update, L("Permission:Update")); + package.AddChild(PlatformPermissions.Package.Delete, L("Permission:Delete")); + package.AddChild(PlatformPermissions.Package.ManageBlobs, L("Permission:ManageBlobs")); + } - private static LocalizableString L(string name) - { - return LocalizableString.Create(name); - } + private static LocalizableString L(string name) + { + return LocalizableString.Create(name); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Permissions/PlatformPermissions.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Permissions/PlatformPermissions.cs index e15d43430..c98f0c487 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Permissions/PlatformPermissions.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Permissions/PlatformPermissions.cs @@ -1,106 +1,105 @@ using Volo.Abp.Reflection; -namespace LINGYUN.Platform.Permissions +namespace LINGYUN.Platform.Permissions; + +public static class PlatformPermissions { - public static class PlatformPermissions - { - public const string GroupName = "Platform"; + public const string GroupName = "Platform"; - public class DataDictionary - { - public const string Default = GroupName + ".DataDictionary"; + public class DataDictionary + { + public const string Default = GroupName + ".DataDictionary"; - public const string Create = Default + ".Create"; + public const string Create = Default + ".Create"; - public const string Update = Default + ".Update"; + public const string Update = Default + ".Update"; - public const string Move = Default + ".Move"; + public const string Move = Default + ".Move"; - public const string Delete = Default + ".Delete"; + public const string Delete = Default + ".Delete"; - public const string ManageItems = Default + ".ManageItems"; - } + public const string ManageItems = Default + ".ManageItems"; + } - public class Layout - { - public const string Default = GroupName + ".Layout"; + public class Layout + { + public const string Default = GroupName + ".Layout"; - public const string Create = Default + ".Create"; + public const string Create = Default + ".Create"; - public const string Update = Default + ".Update"; + public const string Update = Default + ".Update"; - public const string Delete = Default + ".Delete"; - } + public const string Delete = Default + ".Delete"; + } - public class Menu - { - public const string Default = GroupName + ".Menu"; + public class Menu + { + public const string Default = GroupName + ".Menu"; - public const string Create = Default + ".Create"; + public const string Create = Default + ".Create"; - public const string Update = Default + ".Update"; + public const string Update = Default + ".Update"; - public const string Delete = Default + ".Delete"; + public const string Delete = Default + ".Delete"; - public const string ManageRoles = Default + ".ManageRoles"; + public const string ManageRoles = Default + ".ManageRoles"; - public const string ManageUsers = Default + ".ManageUsers"; + public const string ManageUsers = Default + ".ManageUsers"; - public const string ManageUserFavorites = Default + ".ManageUserFavorites"; - } + public const string ManageUserFavorites = Default + ".ManageUserFavorites"; + } - // 如果abp后期提供对象存储的目录管理接口,则启用此权限 - /// - /// 文件系统 - /// - public class FileSystem - { - public const string Default = GroupName + ".FileSystem"; + // 如果abp后期提供对象存储的目录管理接口,则启用此权限 + /// + /// 文件系统 + /// + public class FileSystem + { + public const string Default = GroupName + ".FileSystem"; - public const string Create = Default + ".Create"; + public const string Create = Default + ".Create"; - public const string Delete = Default + ".Delete"; + public const string Delete = Default + ".Delete"; - public const string Rename = Default + ".Rename"; + public const string Rename = Default + ".Rename"; - public const string Copy = Default + ".Copy"; + public const string Copy = Default + ".Copy"; - public const string Move = Default + ".Move"; + public const string Move = Default + ".Move"; - public class FileManager - { - public const string Default = FileSystem.Default + ".FileManager"; + public class FileManager + { + public const string Default = FileSystem.Default + ".FileManager"; - public const string Create = Default + ".Create"; + public const string Create = Default + ".Create"; - public const string Copy = Default + ".Copy"; + public const string Copy = Default + ".Copy"; - public const string Delete = Default + ".Delete"; + public const string Delete = Default + ".Delete"; - public const string Update = Default + ".Update"; + public const string Update = Default + ".Update"; - public const string Move = Default + ".Move"; + public const string Move = Default + ".Move"; - public const string Download = Default + ".Download"; - } + public const string Download = Default + ".Download"; } + } - public class Package - { - public const string Default = GroupName + ".Package"; + public class Package + { + public const string Default = GroupName + ".Package"; - public const string Create = Default + ".Create"; + public const string Create = Default + ".Create"; - public const string Delete = Default + ".Delete"; + public const string Delete = Default + ".Delete"; - public const string Update = Default + ".Update"; + public const string Update = Default + ".Update"; - public const string ManageBlobs = Default + ".ManageBlobs"; - } + public const string ManageBlobs = Default + ".ManageBlobs"; + } - public static string[] GetAll() - { - return ReflectionHelper.GetPublicConstantsRecursively(typeof(PlatformPermissions)); - } + public static string[] GetAll() + { + return ReflectionHelper.GetPublicConstantsRecursively(typeof(PlatformPermissions)); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/PlatformApplicationContractModule.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/PlatformApplicationContractModule.cs index d6bfd65ca..0ba871a4f 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/PlatformApplicationContractModule.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/PlatformApplicationContractModule.cs @@ -3,24 +3,23 @@ using Volo.Abp.Modularity; using Volo.Abp.VirtualFileSystem; -namespace LINGYUN.Platform +namespace LINGYUN.Platform; + +[DependsOn(typeof(PlatformDomainSharedModule))] +public class PlatformApplicationContractModule : AbpModule { - [DependsOn(typeof(PlatformDomainSharedModule))] - public class PlatformApplicationContractModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + Configure(options => { - Configure(options => - { - options.FileSets.AddEmbedded(); - }); + options.FileSets.AddEmbedded(); + }); - Configure(options => - { - options.Resources - .Get() - .AddVirtualJson("/LINGYUN/Platform/Localization/ApplicationContracts"); - }); - } + Configure(options => + { + options.Resources + .Get() + .AddVirtualJson("/LINGYUN/Platform/Localization/ApplicationContracts"); + }); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/PlatformRemoteServiceConsts.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/PlatformRemoteServiceConsts.cs index b63616538..91ba4b5bb 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/PlatformRemoteServiceConsts.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/PlatformRemoteServiceConsts.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Platform +namespace LINGYUN.Platform; + +public static class PlatformRemoteServiceConsts { - public static class PlatformRemoteServiceConsts - { - public const string RemoteServiceName = "Platform"; - } + public const string RemoteServiceName = "Platform"; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Routes/Dto/RouteDto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Routes/Dto/RouteDto.cs index 4eb45ef5e..2e3e4932e 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Routes/Dto/RouteDto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/Routes/Dto/RouteDto.cs @@ -2,33 +2,32 @@ using System.Collections.Generic; using Volo.Abp.Application.Dtos; -namespace LINGYUN.Platform.Routes +namespace LINGYUN.Platform.Routes; + +public class RouteDto : EntityDto { - public class RouteDto : EntityDto - { - /// - /// 路径 - /// - public string Path { get; set; } - /// - /// 名称 - /// - public string Name { get; set; } - /// - /// 显示名称 - /// - public string DisplayName { get; set; } - /// - /// 说明 - /// - public string Description { get; set; } - /// - /// 重定向路径 - /// - public string Redirect { get; set; } - /// - /// 路由的一些辅助元素,取决于数据字典的设计 - /// - public Dictionary Meta { get; set; } - } + /// + /// 路径 + /// + public string Path { get; set; } + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 显示名称 + /// + public string DisplayName { get; set; } + /// + /// 说明 + /// + public string Description { get; set; } + /// + /// 重定向路径 + /// + public string Redirect { get; set; } + /// + /// 路由的一些辅助元素,取决于数据字典的设计 + /// + public Dictionary Meta { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN.Platform.Application.csproj b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN.Platform.Application.csproj index 272a84906..e1c796511 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN.Platform.Application.csproj +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN.Platform.Application.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.Platform.Application + LINGYUN.Abp.Platform.Application + false + false + false diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Datas/DataAppService.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Datas/DataAppService.cs index 46dc23403..1d6b418f1 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Datas/DataAppService.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Datas/DataAppService.cs @@ -8,204 +8,203 @@ using Volo.Abp; using Volo.Abp.Application.Dtos; -namespace LINGYUN.Platform.Datas +namespace LINGYUN.Platform.Datas; + +[Authorize(PlatformPermissions.DataDictionary.Default)] +public class DataAppService : PlatformApplicationServiceBase, IDataAppService { - [Authorize(PlatformPermissions.DataDictionary.Default)] - public class DataAppService : PlatformApplicationServiceBase, IDataAppService + protected IDataRepository DataRepository { get; } + + public DataAppService( + IDataRepository dataRepository) { - protected IDataRepository DataRepository { get; } + DataRepository = dataRepository; + } - public DataAppService( - IDataRepository dataRepository) + [Authorize(PlatformPermissions.DataDictionary.Create)] + public async virtual Task CreateAsync(DataCreateDto input) + { + var data = await DataRepository.FindByNameAsync(input.Name); + if (data != null) { - DataRepository = dataRepository; + throw new UserFriendlyException(L["DuplicateData", input.Name]); } - [Authorize(PlatformPermissions.DataDictionary.Create)] - public async virtual Task CreateAsync(DataCreateDto input) + string code = string.Empty; + var children = await DataRepository.GetChildrenAsync(input.ParentId); + if (children.Any()) { - var data = await DataRepository.FindByNameAsync(input.Name); - if (data != null) - { - throw new UserFriendlyException(L["DuplicateData", input.Name]); - } - - string code = string.Empty; - var children = await DataRepository.GetChildrenAsync(input.ParentId); - if (children.Any()) - { - var lastChildren = children.OrderBy(x => x.Code).FirstOrDefault(); - code = CodeNumberGenerator.CalculateNextCode(lastChildren.Code); - } - else - { - var parentData = input.ParentId != null - ? await DataRepository.GetAsync(input.ParentId.Value) - : null; - - code = CodeNumberGenerator.AppendCode(parentData?.Code, CodeNumberGenerator.CreateCode(1)); - } - - data = new Data( - GuidGenerator.Create(), - input.Name, - code, - input.DisplayName, - input.Description, - input.ParentId, - CurrentTenant.Id - ); - - data = await DataRepository.InsertAsync(data); - await CurrentUnitOfWork.SaveChangesAsync(); - - return ObjectMapper.Map(data); + var lastChildren = children.OrderBy(x => x.Code).FirstOrDefault(); + code = CodeNumberGenerator.CalculateNextCode(lastChildren.Code); } - - [Authorize(PlatformPermissions.DataDictionary.Delete)] - public async virtual Task DeleteAsync(Guid id) + else { - var data = await DataRepository.GetAsync(id); - - var children = await DataRepository.GetChildrenAsync(data.Id); - if (children.Any()) - { - throw new UserFriendlyException(L["UnableRemoveHasChildNode"]); - } + var parentData = input.ParentId != null + ? await DataRepository.GetAsync(input.ParentId.Value) + : null; - await DataRepository.DeleteAsync(data); + code = CodeNumberGenerator.AppendCode(parentData?.Code, CodeNumberGenerator.CreateCode(1)); } - public async virtual Task GetAsync(string name) - { - var data = await DataRepository.FindByNameAsync(name); + data = new Data( + GuidGenerator.Create(), + input.Name, + code, + input.DisplayName, + input.Description, + input.ParentId, + CurrentTenant.Id + ); - return ObjectMapper.Map(data); - } + data = await DataRepository.InsertAsync(data); + await CurrentUnitOfWork.SaveChangesAsync(); - public async virtual Task GetAsync(Guid id) - { - var data = await DataRepository.GetAsync(id); + return ObjectMapper.Map(data); + } - return ObjectMapper.Map(data); - } + [Authorize(PlatformPermissions.DataDictionary.Delete)] + public async virtual Task DeleteAsync(Guid id) + { + var data = await DataRepository.GetAsync(id); - public async virtual Task> GetAllAsync() + var children = await DataRepository.GetChildrenAsync(data.Id); + if (children.Any()) { - var datas = await DataRepository.GetListAsync(includeDetails: false); - - return new ListResultDto( - ObjectMapper.Map, List>(datas)); + throw new UserFriendlyException(L["UnableRemoveHasChildNode"]); } - public async virtual Task> GetListAsync(GetDataListInput input) - { - var count = await DataRepository.GetCountAsync(input.Filter); + await DataRepository.DeleteAsync(data); + } - var datas = await DataRepository.GetPagedListAsync( - input.Filter, input.Sorting, - false, input.SkipCount, input.MaxResultCount); + public async virtual Task GetAsync(string name) + { + var data = await DataRepository.FindByNameAsync(name); - return new PagedResultDto(count, - ObjectMapper.Map, List>(datas)); - } + return ObjectMapper.Map(data); + } - [Authorize(PlatformPermissions.DataDictionary.Move)] - public async virtual Task MoveAsync(Guid id, DataMoveDto input) - { - var data = await DataRepository.GetAsync(id); + public async virtual Task GetAsync(Guid id) + { + var data = await DataRepository.GetAsync(id); + + return ObjectMapper.Map(data); + } - data.ParentId = input.ParentId; + public async virtual Task> GetAllAsync() + { + var datas = await DataRepository.GetListAsync(includeDetails: false); - data = await DataRepository.UpdateAsync(data); - await CurrentUnitOfWork.SaveChangesAsync(); + return new ListResultDto( + ObjectMapper.Map, List>(datas)); + } - return ObjectMapper.Map(data); - } + public async virtual Task> GetListAsync(GetDataListInput input) + { + var count = await DataRepository.GetCountAsync(input.Filter); + + var datas = await DataRepository.GetPagedListAsync( + input.Filter, input.Sorting, + false, input.SkipCount, input.MaxResultCount); + + return new PagedResultDto(count, + ObjectMapper.Map, List>(datas)); + } - [Authorize(PlatformPermissions.DataDictionary.Update)] - public async virtual Task UpdateAsync(Guid id, DataUpdateDto input) + [Authorize(PlatformPermissions.DataDictionary.Move)] + public async virtual Task MoveAsync(Guid id, DataMoveDto input) + { + var data = await DataRepository.GetAsync(id); + + data.ParentId = input.ParentId; + + data = await DataRepository.UpdateAsync(data); + await CurrentUnitOfWork.SaveChangesAsync(); + + return ObjectMapper.Map(data); + } + + [Authorize(PlatformPermissions.DataDictionary.Update)] + public async virtual Task UpdateAsync(Guid id, DataUpdateDto input) + { + var data = await DataRepository.GetAsync(id); + + if (!string.Equals(data.Name, input.Name, StringComparison.InvariantCultureIgnoreCase)) { - var data = await DataRepository.GetAsync(id); - - if (!string.Equals(data.Name, input.Name, StringComparison.InvariantCultureIgnoreCase)) - { - data.Name = input.Name; - } - if (!string.Equals(data.DisplayName, input.DisplayName, StringComparison.InvariantCultureIgnoreCase)) - { - data.DisplayName = input.DisplayName; - } - if (!string.Equals(data.Description, input.Description, StringComparison.InvariantCultureIgnoreCase)) - { - data.Description = input.Description; - } - - data = await DataRepository.UpdateAsync(data); - await CurrentUnitOfWork.SaveChangesAsync(); - - return ObjectMapper.Map(data); + data.Name = input.Name; } - - [Authorize(PlatformPermissions.DataDictionary.ManageItems)] - public async virtual Task UpdateItemAsync(Guid id, string name, DataItemUpdateDto input) + if (!string.Equals(data.DisplayName, input.DisplayName, StringComparison.InvariantCultureIgnoreCase)) + { + data.DisplayName = input.DisplayName; + } + if (!string.Equals(data.Description, input.Description, StringComparison.InvariantCultureIgnoreCase)) { - var data = await DataRepository.GetAsync(id); - var dataItem = data.FindItem(name); - if (dataItem == null) - { - throw new UserFriendlyException(L["DataItemNotFound", name]); - } - - if (!string.Equals(dataItem.DefaultValue, input.DefaultValue, StringComparison.InvariantCultureIgnoreCase)) - { - dataItem.DefaultValue = input.DefaultValue; - } - if (!string.Equals(dataItem.DisplayName, input.DisplayName, StringComparison.InvariantCultureIgnoreCase)) - { - dataItem.DisplayName = input.DisplayName; - } - if (!string.Equals(dataItem.Description, input.Description, StringComparison.InvariantCultureIgnoreCase)) - { - dataItem.Description = input.Description; - } - dataItem.AllowBeNull = input.AllowBeNull; - - await DataRepository.UpdateAsync(data); - await CurrentUnitOfWork.SaveChangesAsync(); + data.Description = input.Description; } - [Authorize(PlatformPermissions.DataDictionary.ManageItems)] - public async virtual Task CreateItemAsync(Guid id, DataItemCreateDto input) + data = await DataRepository.UpdateAsync(data); + await CurrentUnitOfWork.SaveChangesAsync(); + + return ObjectMapper.Map(data); + } + + [Authorize(PlatformPermissions.DataDictionary.ManageItems)] + public async virtual Task UpdateItemAsync(Guid id, string name, DataItemUpdateDto input) + { + var data = await DataRepository.GetAsync(id); + var dataItem = data.FindItem(name); + if (dataItem == null) { - var data = await DataRepository.GetAsync(id); - var dataItem = data.FindItem(input.Name); - if (dataItem != null) - { - throw new UserFriendlyException(L["DuplicateDataItem", input.Name]); - } - - data.AddItem( - GuidGenerator, - input.Name, - input.DisplayName, - input.DefaultValue, - input.ValueType, - input.Description, - input.AllowBeNull); - - await DataRepository.UpdateAsync(data); - await CurrentUnitOfWork.SaveChangesAsync(); + throw new UserFriendlyException(L["DataItemNotFound", name]); } - [Authorize(PlatformPermissions.DataDictionary.ManageItems)] - public async virtual Task DeleteItemAsync(Guid id, string name) + if (!string.Equals(dataItem.DefaultValue, input.DefaultValue, StringComparison.InvariantCultureIgnoreCase)) { - var data = await DataRepository.GetAsync(id); - data.RemoveItem(name); + dataItem.DefaultValue = input.DefaultValue; + } + if (!string.Equals(dataItem.DisplayName, input.DisplayName, StringComparison.InvariantCultureIgnoreCase)) + { + dataItem.DisplayName = input.DisplayName; + } + if (!string.Equals(dataItem.Description, input.Description, StringComparison.InvariantCultureIgnoreCase)) + { + dataItem.Description = input.Description; + } + dataItem.AllowBeNull = input.AllowBeNull; + + await DataRepository.UpdateAsync(data); + await CurrentUnitOfWork.SaveChangesAsync(); + } - await DataRepository.UpdateAsync(data); - await CurrentUnitOfWork.SaveChangesAsync(); + [Authorize(PlatformPermissions.DataDictionary.ManageItems)] + public async virtual Task CreateItemAsync(Guid id, DataItemCreateDto input) + { + var data = await DataRepository.GetAsync(id); + var dataItem = data.FindItem(input.Name); + if (dataItem != null) + { + throw new UserFriendlyException(L["DuplicateDataItem", input.Name]); } + + data.AddItem( + GuidGenerator, + input.Name, + input.DisplayName, + input.DefaultValue, + input.ValueType, + input.Description, + input.AllowBeNull); + + await DataRepository.UpdateAsync(data); + await CurrentUnitOfWork.SaveChangesAsync(); + } + + [Authorize(PlatformPermissions.DataDictionary.ManageItems)] + public async virtual Task DeleteItemAsync(Guid id, string name) + { + var data = await DataRepository.GetAsync(id); + data.RemoveItem(name); + + await DataRepository.UpdateAsync(data); + await CurrentUnitOfWork.SaveChangesAsync(); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Layouts/LayoutAppService.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Layouts/LayoutAppService.cs index 25a1c1258..a2e554aed 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Layouts/LayoutAppService.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Layouts/LayoutAppService.cs @@ -6,116 +6,115 @@ using Volo.Abp; using Volo.Abp.Application.Dtos; -namespace LINGYUN.Platform.Layouts +namespace LINGYUN.Platform.Layouts; + +[Authorize(PlatformPermissions.Layout.Default)] +public class LayoutAppService : PlatformApplicationServiceBase, ILayoutAppService { - [Authorize(PlatformPermissions.Layout.Default)] - public class LayoutAppService : PlatformApplicationServiceBase, ILayoutAppService + protected ILayoutRepository LayoutRepository { get; } + + public LayoutAppService( + ILayoutRepository layoutRepository) { - protected ILayoutRepository LayoutRepository { get; } + LayoutRepository = layoutRepository; + } - public LayoutAppService( - ILayoutRepository layoutRepository) + [Authorize(PlatformPermissions.Layout.Create)] + public async virtual Task CreateAsync(LayoutCreateDto input) + { + var layout = await LayoutRepository.FindByNameAsync(input.Name); + if (layout != null) { - LayoutRepository = layoutRepository; + throw new UserFriendlyException(L["DuplicateLayout", input.Name]); } - [Authorize(PlatformPermissions.Layout.Create)] - public async virtual Task CreateAsync(LayoutCreateDto input) - { - var layout = await LayoutRepository.FindByNameAsync(input.Name); - if (layout != null) - { - throw new UserFriendlyException(L["DuplicateLayout", input.Name]); - } - - layout = new Layout( - GuidGenerator.Create(), - input.Path, - input.Name, - input.DisplayName, - input.DataId, - input.Framework, - input.Redirect, - input.Description, - CurrentTenant.Id); - - layout = await LayoutRepository.InsertAsync(layout); - await CurrentUnitOfWork.SaveChangesAsync(); - - return ObjectMapper.Map(layout); - } + layout = new Layout( + GuidGenerator.Create(), + input.Path, + input.Name, + input.DisplayName, + input.DataId, + input.Framework, + input.Redirect, + input.Description, + CurrentTenant.Id); + + layout = await LayoutRepository.InsertAsync(layout); + await CurrentUnitOfWork.SaveChangesAsync(); + + return ObjectMapper.Map(layout); + } - [Authorize(PlatformPermissions.Layout.Delete)] - public async virtual Task DeleteAsync(Guid id) - { - var layout = await LayoutRepository.GetAsync(id); + [Authorize(PlatformPermissions.Layout.Delete)] + public async virtual Task DeleteAsync(Guid id) + { + var layout = await LayoutRepository.GetAsync(id); - //if (await LayoutRepository.AnyMenuAsync(layout.Id)) - //{ - // throw new UserFriendlyException($"不能删除存在菜单的布局!"); - //} + //if (await LayoutRepository.AnyMenuAsync(layout.Id)) + //{ + // throw new UserFriendlyException($"不能删除存在菜单的布局!"); + //} - await LayoutRepository.DeleteAsync(layout); - await CurrentUnitOfWork.SaveChangesAsync(); - } + await LayoutRepository.DeleteAsync(layout); + await CurrentUnitOfWork.SaveChangesAsync(); + } - public async virtual Task GetAsync(Guid id) - { - var layout = await LayoutRepository.GetAsync(id); + public async virtual Task GetAsync(Guid id) + { + var layout = await LayoutRepository.GetAsync(id); - return ObjectMapper.Map(layout); - } + return ObjectMapper.Map(layout); + } - public async virtual Task> GetAllListAsync() - { - var layouts = await LayoutRepository.GetListAsync(); + public async virtual Task> GetAllListAsync() + { + var layouts = await LayoutRepository.GetListAsync(); - return new ListResultDto( - ObjectMapper.Map, List>(layouts)); - } + return new ListResultDto( + ObjectMapper.Map, List>(layouts)); + } - public async virtual Task> GetListAsync(GetLayoutListInput input) - { - var count = await LayoutRepository.GetCountAsync(input.Framework, input.Filter); + public async virtual Task> GetListAsync(GetLayoutListInput input) + { + var count = await LayoutRepository.GetCountAsync(input.Framework, input.Filter); - var layouts = await LayoutRepository.GetPagedListAsync( - input.Framework, input.Filter, - input.Sorting, false, - input.SkipCount, input.MaxResultCount); + var layouts = await LayoutRepository.GetPagedListAsync( + input.Framework, input.Filter, + input.Sorting, false, + input.SkipCount, input.MaxResultCount); - return new PagedResultDto(count, - ObjectMapper.Map, List>(layouts)); - } + return new PagedResultDto(count, + ObjectMapper.Map, List>(layouts)); + } + + [Authorize(PlatformPermissions.Layout.Update)] + public async virtual Task UpdateAsync(Guid id, LayoutUpdateDto input) + { + var layout = await LayoutRepository.GetAsync(id); - [Authorize(PlatformPermissions.Layout.Update)] - public async virtual Task UpdateAsync(Guid id, LayoutUpdateDto input) + if (!string.Equals(layout.Name, input.Name, StringComparison.InvariantCultureIgnoreCase)) { - var layout = await LayoutRepository.GetAsync(id); - - if (!string.Equals(layout.Name, input.Name, StringComparison.InvariantCultureIgnoreCase)) - { - layout.Name = input.Name; - } - if (!string.Equals(layout.DisplayName, input.DisplayName, StringComparison.InvariantCultureIgnoreCase)) - { - layout.DisplayName = input.DisplayName; - } - if (!string.Equals(layout.Description, input.Description, StringComparison.InvariantCultureIgnoreCase)) - { - layout.Description = input.Description; - } - if (!string.Equals(layout.Path, input.Path, StringComparison.InvariantCultureIgnoreCase)) - { - layout.Path = input.Path; - } - if (!string.Equals(layout.Redirect, input.Redirect, StringComparison.InvariantCultureIgnoreCase)) - { - layout.Redirect = input.Redirect; - } - layout = await LayoutRepository.UpdateAsync(layout); - await CurrentUnitOfWork.SaveChangesAsync(); - - return ObjectMapper.Map(layout); + layout.Name = input.Name; } + if (!string.Equals(layout.DisplayName, input.DisplayName, StringComparison.InvariantCultureIgnoreCase)) + { + layout.DisplayName = input.DisplayName; + } + if (!string.Equals(layout.Description, input.Description, StringComparison.InvariantCultureIgnoreCase)) + { + layout.Description = input.Description; + } + if (!string.Equals(layout.Path, input.Path, StringComparison.InvariantCultureIgnoreCase)) + { + layout.Path = input.Path; + } + if (!string.Equals(layout.Redirect, input.Redirect, StringComparison.InvariantCultureIgnoreCase)) + { + layout.Redirect = input.Redirect; + } + layout = await LayoutRepository.UpdateAsync(layout); + await CurrentUnitOfWork.SaveChangesAsync(); + + return ObjectMapper.Map(layout); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Menus/MenuAppService.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Menus/MenuAppService.cs index 528809a90..c7be98b84 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Menus/MenuAppService.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Menus/MenuAppService.cs @@ -12,298 +12,297 @@ using Volo.Abp.Data; using Volo.Abp.Users; -namespace LINGYUN.Platform.Menus +namespace LINGYUN.Platform.Menus; + +[Authorize] +public class MenuAppService : PlatformApplicationServiceBase, IMenuAppService { - [Authorize] - public class MenuAppService : PlatformApplicationServiceBase, IMenuAppService + protected DataItemMappingOptions DataItemMapping { get; } + protected MenuManager MenuManager { get; } + protected IMenuRepository MenuRepository { get; } + protected IUserMenuRepository UserMenuRepository { get; } + protected IRoleMenuRepository RoleMenuRepository { get; } + protected IDataRepository DataRepository { get; } + protected ILayoutRepository LayoutRepository { get; } + + public MenuAppService( + MenuManager menuManager, + IMenuRepository menuRepository, + IDataRepository dataRepository, + ILayoutRepository layoutRepository, + IUserMenuRepository userMenuRepository, + IRoleMenuRepository roleMenuRepository, + IOptions options) { - protected DataItemMappingOptions DataItemMapping { get; } - protected MenuManager MenuManager { get; } - protected IMenuRepository MenuRepository { get; } - protected IUserMenuRepository UserMenuRepository { get; } - protected IRoleMenuRepository RoleMenuRepository { get; } - protected IDataRepository DataRepository { get; } - protected ILayoutRepository LayoutRepository { get; } - - public MenuAppService( - MenuManager menuManager, - IMenuRepository menuRepository, - IDataRepository dataRepository, - ILayoutRepository layoutRepository, - IUserMenuRepository userMenuRepository, - IRoleMenuRepository roleMenuRepository, - IOptions options) - { - MenuManager = menuManager; - MenuRepository = menuRepository; - DataRepository = dataRepository; - LayoutRepository = layoutRepository; - UserMenuRepository = userMenuRepository; - RoleMenuRepository = roleMenuRepository; - DataItemMapping = options.Value; - } + MenuManager = menuManager; + MenuRepository = menuRepository; + DataRepository = dataRepository; + LayoutRepository = layoutRepository; + UserMenuRepository = userMenuRepository; + RoleMenuRepository = roleMenuRepository; + DataItemMapping = options.Value; + } - public async virtual Task> GetCurrentUserMenuListAsync(GetMenuInput input) - { - var myMenus = await MenuRepository.GetUserMenusAsync( - CurrentUser.GetId(), - CurrentUser.Roles, - input.Framework); + public async virtual Task> GetCurrentUserMenuListAsync(GetMenuInput input) + { + var myMenus = await MenuRepository.GetUserMenusAsync( + CurrentUser.GetId(), + CurrentUser.Roles, + input.Framework); - var menus = ObjectMapper.Map, List>(myMenus); + var menus = ObjectMapper.Map, List>(myMenus); - var startupMenu = await UserMenuRepository.GetStartupMenuAsync( - CurrentUser.GetId()); + var startupMenu = await UserMenuRepository.GetStartupMenuAsync( + CurrentUser.GetId()); - if (startupMenu == null && CurrentUser.Roles.Any()) - { - startupMenu = await RoleMenuRepository.GetStartupMenuAsync(CurrentUser.Roles); - } + if (startupMenu == null && CurrentUser.Roles.Any()) + { + startupMenu = await RoleMenuRepository.GetStartupMenuAsync(CurrentUser.Roles); + } - if (startupMenu != null) - { - var findMenu = menus.FirstOrDefault(x => x.Id.Equals(startupMenu.Id)); + if (startupMenu != null) + { + var findMenu = menus.FirstOrDefault(x => x.Id.Equals(startupMenu.Id)); - if (findMenu != null) - { - findMenu.Startup = true; - } + if (findMenu != null) + { + findMenu.Startup = true; } - - - return new ListResultDto(menus); } + - [Authorize(PlatformPermissions.Menu.Default)] - public async virtual Task GetAsync(Guid id) - { - var menu = await MenuRepository.GetAsync(id); + return new ListResultDto(menus); + } - return ObjectMapper.Map(menu); - } + [Authorize(PlatformPermissions.Menu.Default)] + public async virtual Task GetAsync(Guid id) + { + var menu = await MenuRepository.GetAsync(id); - [Authorize(PlatformPermissions.Menu.Default)] - public async virtual Task> GetAllAsync(MenuGetAllInput input) - { - var menus = await MenuRepository.GetAllAsync( - input.Filter, input.Sorting, - input.Framework, input.ParentId, input.LayoutId); + return ObjectMapper.Map(menu); + } - return new ListResultDto( - ObjectMapper.Map, List>(menus)); - } + [Authorize(PlatformPermissions.Menu.Default)] + public async virtual Task> GetAllAsync(MenuGetAllInput input) + { + var menus = await MenuRepository.GetAllAsync( + input.Filter, input.Sorting, + input.Framework, input.ParentId, input.LayoutId); - [Authorize(PlatformPermissions.Menu.Default)] - public async virtual Task> GetListAsync(MenuGetListInput input) - { - var count = await MenuRepository.GetCountAsync(input.Filter, input.Framework, input.ParentId, input.LayoutId); + return new ListResultDto( + ObjectMapper.Map, List>(menus)); + } - var menus = await MenuRepository.GetListAsync( - input.Filter, input.Sorting, - input.Framework, input.ParentId, input.LayoutId, - input.SkipCount, input.MaxResultCount); + [Authorize(PlatformPermissions.Menu.Default)] + public async virtual Task> GetListAsync(MenuGetListInput input) + { + var count = await MenuRepository.GetCountAsync(input.Filter, input.Framework, input.ParentId, input.LayoutId); - return new PagedResultDto(count, - ObjectMapper.Map, List>(menus)); - } + var menus = await MenuRepository.GetListAsync( + input.Filter, input.Sorting, + input.Framework, input.ParentId, input.LayoutId, + input.SkipCount, input.MaxResultCount); + + return new PagedResultDto(count, + ObjectMapper.Map, List>(menus)); + } - [Authorize(PlatformPermissions.Menu.Create)] - public async virtual Task CreateAsync(MenuCreateDto input) + [Authorize(PlatformPermissions.Menu.Create)] + public async virtual Task CreateAsync(MenuCreateDto input) + { + var layout = await LayoutRepository.GetAsync(input.LayoutId); + var data = await DataRepository.GetAsync(layout.DataId); + + var menu = await MenuManager.CreateAsync( + layout, + GuidGenerator.Create(), + input.Path, + input.Name, + input.Component, + input.DisplayName, + input.Redirect, + input.Description, + input.ParentId, + CurrentTenant.Id, + input.IsPublic); + + // 利用布局约定的数据字典来校验必须的路由元数据,元数据的加入是为了适配多端路由 + foreach (var dataItem in data.Items) { - var layout = await LayoutRepository.GetAsync(input.LayoutId); - var data = await DataRepository.GetAsync(layout.DataId); - - var menu = await MenuManager.CreateAsync( - layout, - GuidGenerator.Create(), - input.Path, - input.Name, - input.Component, - input.DisplayName, - input.Redirect, - input.Description, - input.ParentId, - CurrentTenant.Id, - input.IsPublic); - - // 利用布局约定的数据字典来校验必须的路由元数据,元数据的加入是为了适配多端路由 - foreach (var dataItem in data.Items) + if (!input.Meta.TryGetValue(dataItem.Name, out object meta)) { - if (!input.Meta.TryGetValue(dataItem.Name, out object meta)) - { - if (!dataItem.AllowBeNull) - { - throw new BusinessException(PlatformErrorCodes.MenuMissingMetadata) - .WithData("Name", dataItem.DisplayName) - .WithData("DataName", data.DisplayName); - } - // 是否需要设定默认值 - menu.SetProperty(dataItem.Name, dataItem.DefaultValue); - } - else + if (!dataItem.AllowBeNull) { - // 需要检查参数是否有效 - menu.SetProperty(dataItem.Name, DataItemMapping.MapToString(dataItem.ValueType, meta)); + throw new BusinessException(PlatformErrorCodes.MenuMissingMetadata) + .WithData("Name", dataItem.DisplayName) + .WithData("DataName", data.DisplayName); } + // 是否需要设定默认值 + menu.SetProperty(dataItem.Name, dataItem.DefaultValue); } + else + { + // 需要检查参数是否有效 + menu.SetProperty(dataItem.Name, DataItemMapping.MapToString(dataItem.ValueType, meta)); + } + } - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork.SaveChangesAsync(); - return ObjectMapper.Map(menu); - } + return ObjectMapper.Map(menu); + } - [Authorize(PlatformPermissions.Menu.Update)] - public async virtual Task UpdateAsync(Guid id, MenuUpdateDto input) - { - var menu = await MenuRepository.GetAsync(id); + [Authorize(PlatformPermissions.Menu.Update)] + public async virtual Task UpdateAsync(Guid id, MenuUpdateDto input) + { + var menu = await MenuRepository.GetAsync(id); - // 利用布局约定的数据字典来校验必须的路由元数据,元数据的加入是为了适配多端路由 - var layout = await LayoutRepository.GetAsync(menu.LayoutId); - var data = await DataRepository.GetAsync(layout.DataId); - foreach (var dataItem in data.Items) + // 利用布局约定的数据字典来校验必须的路由元数据,元数据的加入是为了适配多端路由 + var layout = await LayoutRepository.GetAsync(menu.LayoutId); + var data = await DataRepository.GetAsync(layout.DataId); + foreach (var dataItem in data.Items) + { + if (!input.Meta.TryGetValue(dataItem.Name, out object meta)) { - if (!input.Meta.TryGetValue(dataItem.Name, out object meta)) + if (!dataItem.AllowBeNull) { - if (!dataItem.AllowBeNull) - { - throw new BusinessException(PlatformErrorCodes.MenuMissingMetadata) - .WithData("Name", dataItem.DisplayName) - .WithData("DataName", data.DisplayName); - } - // 是否需要设定默认值? - menu.SetProperty(dataItem.Name, dataItem.DefaultValue); - } - else - { - // 与现有的数据做对比 - var menuMeta = menu.GetProperty(dataItem.Name); - if (menuMeta != null && menuMeta.Equals(meta)) - { - continue; - } - // 需要检查参数是否有效 - menu.SetProperty(dataItem.Name, DataItemMapping.MapToString(dataItem.ValueType, meta)); + throw new BusinessException(PlatformErrorCodes.MenuMissingMetadata) + .WithData("Name", dataItem.DisplayName) + .WithData("DataName", data.DisplayName); } + // 是否需要设定默认值? + menu.SetProperty(dataItem.Name, dataItem.DefaultValue); } - - if (!string.Equals(menu.Name, input.Name, StringComparison.InvariantCultureIgnoreCase)) + else { - menu.Name = input.Name; - } - if (!string.Equals(menu.DisplayName, input.DisplayName, StringComparison.InvariantCultureIgnoreCase)) - { - menu.DisplayName = input.DisplayName; - } - if (!string.Equals(menu.Description, input.Description, StringComparison.InvariantCultureIgnoreCase)) - { - menu.Description = input.Description; - } - if (!string.Equals(menu.Path, input.Path, StringComparison.InvariantCultureIgnoreCase)) - { - menu.Path = input.Path; - } - if (!string.Equals(menu.Redirect, input.Redirect, StringComparison.InvariantCultureIgnoreCase)) - { - menu.Redirect = input.Redirect; - } - if (!string.Equals(menu.Component, input.Component, StringComparison.InvariantCultureIgnoreCase)) - { - menu.Component = input.Component; + // 与现有的数据做对比 + var menuMeta = menu.GetProperty(dataItem.Name); + if (menuMeta != null && menuMeta.Equals(meta)) + { + continue; + } + // 需要检查参数是否有效 + menu.SetProperty(dataItem.Name, DataItemMapping.MapToString(dataItem.ValueType, meta)); } - - menu.ParentId = input.ParentId; - menu.IsPublic = input.IsPublic; - - await MenuManager.UpdateAsync(menu); - await CurrentUnitOfWork.SaveChangesAsync(); - - return ObjectMapper.Map(menu); } - [Authorize(PlatformPermissions.Menu.Delete)] - public async virtual Task DeleteAsync(Guid id) + if (!string.Equals(menu.Name, input.Name, StringComparison.InvariantCultureIgnoreCase)) { - var childrens = await MenuRepository.GetChildrenAsync(id); - if (childrens.Any()) - { - throw new BusinessException(PlatformErrorCodes.DeleteMenuHaveChildren); - } - - var menu = await MenuRepository.GetAsync(id); - await MenuRepository.DeleteAsync(menu); + menu.Name = input.Name; } - - [Authorize(PlatformPermissions.Menu.ManageUsers)] - public async virtual Task> GetUserMenuListAsync(MenuGetByUserInput input) + if (!string.Equals(menu.DisplayName, input.DisplayName, StringComparison.InvariantCultureIgnoreCase)) + { + menu.DisplayName = input.DisplayName; + } + if (!string.Equals(menu.Description, input.Description, StringComparison.InvariantCultureIgnoreCase)) { - var menus = await MenuRepository.GetUserMenusAsync(input.UserId, input.Roles, input.Framework); + menu.Description = input.Description; + } + if (!string.Equals(menu.Path, input.Path, StringComparison.InvariantCultureIgnoreCase)) + { + menu.Path = input.Path; + } + if (!string.Equals(menu.Redirect, input.Redirect, StringComparison.InvariantCultureIgnoreCase)) + { + menu.Redirect = input.Redirect; + } + if (!string.Equals(menu.Component, input.Component, StringComparison.InvariantCultureIgnoreCase)) + { + menu.Component = input.Component; + } - var menuDtos = ObjectMapper.Map, List>(menus); + menu.ParentId = input.ParentId; + menu.IsPublic = input.IsPublic; - var startupMenu = await UserMenuRepository.GetStartupMenuAsync(input.UserId); + await MenuManager.UpdateAsync(menu); + await CurrentUnitOfWork.SaveChangesAsync(); - if (startupMenu == null) - { - startupMenu = await RoleMenuRepository.GetStartupMenuAsync(input.Roles); - } + return ObjectMapper.Map(menu); + } - if (startupMenu != null) - { - var findMenu = menuDtos.FirstOrDefault(x => x.Id.Equals(startupMenu.Id)); + [Authorize(PlatformPermissions.Menu.Delete)] + public async virtual Task DeleteAsync(Guid id) + { + var childrens = await MenuRepository.GetChildrenAsync(id); + if (childrens.Any()) + { + throw new BusinessException(PlatformErrorCodes.DeleteMenuHaveChildren); + } - if (findMenu != null) - { - findMenu.Startup = true; - } - } + var menu = await MenuRepository.GetAsync(id); + await MenuRepository.DeleteAsync(menu); + } - return new ListResultDto(menuDtos); - } + [Authorize(PlatformPermissions.Menu.ManageUsers)] + public async virtual Task> GetUserMenuListAsync(MenuGetByUserInput input) + { + var menus = await MenuRepository.GetUserMenusAsync(input.UserId, input.Roles, input.Framework); - [Authorize(PlatformPermissions.Menu.ManageUsers)] - public async virtual Task SetUserMenusAsync(UserMenuInput input) - { - await MenuManager.SetUserMenusAsync(input.UserId, input.MenuIds); - } + var menuDtos = ObjectMapper.Map, List>(menus); - [Authorize(PlatformPermissions.Menu.ManageUsers)] - public async virtual Task SetUserStartupAsync(Guid id, UserMenuStartupInput input) - { - await MenuManager.SetUserStartupMenuAsync(input.UserId, id); - } + var startupMenu = await UserMenuRepository.GetStartupMenuAsync(input.UserId); - [Authorize(PlatformPermissions.Menu.ManageRoles)] - public async virtual Task SetRoleMenusAsync(RoleMenuInput input) + if (startupMenu == null) { - await MenuManager.SetRoleMenusAsync(input.RoleName, input.MenuIds); + startupMenu = await RoleMenuRepository.GetStartupMenuAsync(input.Roles); } - [Authorize(PlatformPermissions.Menu.ManageRoles)] - public async virtual Task SetRoleStartupAsync(Guid id, RoleMenuStartupInput input) + if (startupMenu != null) { - await MenuManager.SetRoleStartupMenuAsync(input.RoleName, id); + var findMenu = menuDtos.FirstOrDefault(x => x.Id.Equals(startupMenu.Id)); + + if (findMenu != null) + { + findMenu.Startup = true; + } } - [Authorize(PlatformPermissions.Menu.ManageRoles)] - public async virtual Task> GetRoleMenuListAsync(MenuGetByRoleInput input) - { - var menus = await MenuRepository.GetRoleMenusAsync(new string[] { input.Role }, input.Framework); + return new ListResultDto(menuDtos); + } - var menuDtos = ObjectMapper.Map, List>(menus); + [Authorize(PlatformPermissions.Menu.ManageUsers)] + public async virtual Task SetUserMenusAsync(UserMenuInput input) + { + await MenuManager.SetUserMenusAsync(input.UserId, input.MenuIds); + } - var startupMenu = await RoleMenuRepository.GetStartupMenuAsync(new string[] { input.Role }); + [Authorize(PlatformPermissions.Menu.ManageUsers)] + public async virtual Task SetUserStartupAsync(Guid id, UserMenuStartupInput input) + { + await MenuManager.SetUserStartupMenuAsync(input.UserId, id); + } - if (startupMenu != null) - { - var findMenu = menuDtos.FirstOrDefault(x => x.Id.Equals(startupMenu.Id)); + [Authorize(PlatformPermissions.Menu.ManageRoles)] + public async virtual Task SetRoleMenusAsync(RoleMenuInput input) + { + await MenuManager.SetRoleMenusAsync(input.RoleName, input.MenuIds); + } - if (findMenu != null) - { - findMenu.Startup = true; - } - } + [Authorize(PlatformPermissions.Menu.ManageRoles)] + public async virtual Task SetRoleStartupAsync(Guid id, RoleMenuStartupInput input) + { + await MenuManager.SetRoleStartupMenuAsync(input.RoleName, id); + } + + [Authorize(PlatformPermissions.Menu.ManageRoles)] + public async virtual Task> GetRoleMenuListAsync(MenuGetByRoleInput input) + { + var menus = await MenuRepository.GetRoleMenusAsync(new string[] { input.Role }, input.Framework); - return new ListResultDto(menuDtos); + var menuDtos = ObjectMapper.Map, List>(menus); + + var startupMenu = await RoleMenuRepository.GetStartupMenuAsync(new string[] { input.Role }); + + if (startupMenu != null) + { + var findMenu = menuDtos.FirstOrDefault(x => x.Id.Equals(startupMenu.Id)); + + if (findMenu != null) + { + findMenu.Startup = true; + } } + + return new ListResultDto(menuDtos); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Packages/PackageAppService.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Packages/PackageAppService.cs index 0c65bec58..7292aece0 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Packages/PackageAppService.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/Packages/PackageAppService.cs @@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Authorization; using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Threading.Tasks; using Volo.Abp; @@ -26,7 +27,7 @@ public PackageAppService( public async virtual Task GetLatestAsync(PackageGetLatestInput input) { - var package = await _packageRepository.FindLatestAsync(input.Name); + var package = await _packageRepository.FindLatestAsync(input.Name, input.Version); return package == null ? PackageDto.None() : ObjectMapper.Map(package); } @@ -50,8 +51,7 @@ public async virtual Task CreateAsync(PackageCreateDto input) input.Name, input.Note, input.Version, - input.Description, - CurrentTenant.Id); + input.Description); UpdateByInput(package, input); @@ -119,7 +119,11 @@ public async virtual Task DownloadBlobAsync(Guid id, Packa var package = await _packageRepository.GetAsync(id); var packageBlob = package.FindBlob(input.Name); - var stream = await _blobManager.DownloadBlobAsync(package, packageBlob); + Stream stream; + using (CurrentTenant.Change(null)) + { + stream = await _blobManager.DownloadBlobAsync(package, packageBlob); + } return new RemoteStreamContent(stream, packageBlob.Name, packageBlob.ContentType); } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/PlatformApplicationMappingProfile.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/PlatformApplicationMappingProfile.cs index 76935198b..73e2a0c5b 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/PlatformApplicationMappingProfile.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/PlatformApplicationMappingProfile.cs @@ -4,23 +4,22 @@ using LINGYUN.Platform.Menus; using LINGYUN.Platform.Packages; -namespace LINGYUN.Platform +namespace LINGYUN.Platform; + +public class PlatformApplicationMappingProfile : Profile { - public class PlatformApplicationMappingProfile : Profile + public PlatformApplicationMappingProfile() { - public PlatformApplicationMappingProfile() - { - CreateMap(); - CreateMap(); + CreateMap(); + CreateMap(); - CreateMap(); - CreateMap(); - CreateMap() - .ForMember(dto => dto.Meta, map => map.MapFrom(src => src.ExtraProperties)) - .ForMember(dto => dto.Startup, map => map.Ignore()); - CreateMap() - .ForMember(dto => dto.Meta, map => map.MapFrom(src => src.ExtraProperties)); - CreateMap(); - } + CreateMap(); + CreateMap(); + CreateMap() + .ForMember(dto => dto.Meta, map => map.MapFrom(src => src.ExtraProperties)) + .ForMember(dto => dto.Startup, map => map.Ignore()); + CreateMap() + .ForMember(dto => dto.Meta, map => map.MapFrom(src => src.ExtraProperties)); + CreateMap(); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/PlatformApplicationModule.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/PlatformApplicationModule.cs index 91fa001f7..3394f7b23 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/PlatformApplicationModule.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/PlatformApplicationModule.cs @@ -2,19 +2,18 @@ using Volo.Abp.AutoMapper; using Volo.Abp.Modularity; -namespace LINGYUN.Platform +namespace LINGYUN.Platform; + +[DependsOn(typeof(PlatformApplicationContractModule))] +public class PlatformApplicationModule : AbpModule { - [DependsOn(typeof(PlatformApplicationContractModule))] - public class PlatformApplicationModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddAutoMapperObjectMapper(); + context.Services.AddAutoMapperObjectMapper(); - Configure(options => - { - options.AddProfile(validate: true); - }); - } + Configure(options => + { + options.AddProfile(validate: true); + }); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/PlatformApplicationServiceBase.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/PlatformApplicationServiceBase.cs index 9da28d2d0..b3961579f 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/PlatformApplicationServiceBase.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application/LINGYUN/Platform/PlatformApplicationServiceBase.cs @@ -1,12 +1,11 @@ using Volo.Abp.Application.Services; -namespace LINGYUN.Platform +namespace LINGYUN.Platform; + +public abstract class PlatformApplicationServiceBase : ApplicationService { - public abstract class PlatformApplicationServiceBase : ApplicationService + protected PlatformApplicationServiceBase() { - protected PlatformApplicationServiceBase() - { - } } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN.Platform.Domain.Shared.csproj b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN.Platform.Domain.Shared.csproj index f1e10b645..8cf31db65 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN.Platform.Domain.Shared.csproj +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN.Platform.Domain.Shared.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Platform.Domain.Shared + LINGYUN.Abp.Platform.Domain.Shared + false + false + false diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/BlobStoring/BlobConsts.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/BlobStoring/BlobConsts.cs index fc68f431f..850a053b6 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/BlobStoring/BlobConsts.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/BlobStoring/BlobConsts.cs @@ -1,16 +1,15 @@ -namespace LINGYUN.Platform.BlobStoring +namespace LINGYUN.Platform.BlobStoring; + +public static class BlobConsts { - public static class BlobConsts + public static int MaxNameLength { - public static int MaxNameLength - { - get; - set; - } = 255; - public static int MaxSha256Length - { - get; - set; - } = 65; - } + get; + set; + } = 255; + public static int MaxSha256Length + { + get; + set; + } = 65; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/BlobStoring/BlobContainerConsts.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/BlobStoring/BlobContainerConsts.cs index 304dd4dbc..c482c6691 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/BlobStoring/BlobContainerConsts.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/BlobStoring/BlobContainerConsts.cs @@ -1,17 +1,16 @@ -namespace LINGYUN.Platform.BlobStoring +namespace LINGYUN.Platform.BlobStoring; + +public static class BlobContainerConsts { - public static class BlobContainerConsts + public static int MaxNameLength { - public static int MaxNameLength - { - get; - set; - } = 255; + get; + set; + } = 255; - public static int MaxPathLength - { - get; - set; - } = 255; - } + public static int MaxPathLength + { + get; + set; + } = 255; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Datas/DataConsts.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Datas/DataConsts.cs index 73d7f1e89..63dd65488 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Datas/DataConsts.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Datas/DataConsts.cs @@ -1,29 +1,28 @@ -namespace LINGYUN.Platform.Datas +namespace LINGYUN.Platform.Datas; + +public static class DataConsts { - public static class DataConsts + public static int MaxNameLength { - public static int MaxNameLength - { - get; - set; - } = 30; + get; + set; + } = 30; - public static int MaxCodeLength - { - get; - set; - } = 1024; + public static int MaxCodeLength + { + get; + set; + } = 1024; - public static int MaxDisplayNameLength - { - get; - set; - } = 128; + public static int MaxDisplayNameLength + { + get; + set; + } = 128; - public static int MaxDescriptionLength - { - get; - set; - } = 1024; - } + public static int MaxDescriptionLength + { + get; + set; + } = 1024; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Datas/DataItemConsts.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Datas/DataItemConsts.cs index 2c7c0f439..e2eaae5c5 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Datas/DataItemConsts.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Datas/DataItemConsts.cs @@ -1,29 +1,28 @@ -namespace LINGYUN.Platform.Datas +namespace LINGYUN.Platform.Datas; + +public static class DataItemConsts { - public static class DataItemConsts + public static int MaxNameLength { - public static int MaxNameLength - { - get; - set; - } = 30; + get; + set; + } = 30; - public static int MaxValueLength - { - get; - set; - } = 128; + public static int MaxValueLength + { + get; + set; + } = 128; - public static int MaxDisplayNameLength - { - get; - set; - } = 128; + public static int MaxDisplayNameLength + { + get; + set; + } = 128; - public static int MaxDescriptionLength - { - get; - set; - } = 1024; - } + public static int MaxDescriptionLength + { + get; + set; + } = 1024; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Datas/ValueType.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Datas/ValueType.cs index 39703c081..f1610a073 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Datas/ValueType.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Datas/ValueType.cs @@ -1,13 +1,12 @@ -namespace LINGYUN.Platform.Datas +namespace LINGYUN.Platform.Datas; + +public enum ValueType { - public enum ValueType - { - String = 0, - Numeic = 1, - Boolean = 2, - Date = 3, - DateTime = 4, - Array = 5, - Object = 6 - } + String = 0, + Numeic = 1, + Boolean = 2, + Date = 3, + DateTime = 4, + Array = 5, + Object = 6 } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Layouts/LayoutEto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Layouts/LayoutEto.cs index 8c0ddca8e..cc423cf66 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Layouts/LayoutEto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Layouts/LayoutEto.cs @@ -1,10 +1,9 @@ using LINGYUN.Platform.Routes; using Volo.Abp.EventBus; -namespace LINGYUN.Platform.Layouts +namespace LINGYUN.Platform.Layouts; + +[EventName("platform.layouts.layout")] +public class LayoutEto : RouteEto { - [EventName("platform.layouts.layout")] - public class LayoutEto : RouteEto - { - } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Localization/PlatformResource.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Localization/PlatformResource.cs index cb20541b4..ec172ebde 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Localization/PlatformResource.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Localization/PlatformResource.cs @@ -1,10 +1,9 @@ using Volo.Abp.Localization; -namespace LINGYUN.Platform.Localization +namespace LINGYUN.Platform.Localization; + +[LocalizationResourceName("AppPlatform")] +public class PlatformResource { - [LocalizationResourceName("AppPlatform")] - public class PlatformResource - { - } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Menus/MenuConsts.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Menus/MenuConsts.cs index 8a6be5ec2..db2098fc7 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Menus/MenuConsts.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Menus/MenuConsts.cs @@ -1,21 +1,20 @@ -namespace LINGYUN.Platform.Menus +namespace LINGYUN.Platform.Menus; + +public static class MenuConsts { - public static class MenuConsts + public static int MaxComponentLength { - public static int MaxComponentLength - { - get; - set; - } = 255; + get; + set; + } = 255; - /// - /// 最大深度 - /// - /// - /// 默认为4,仅支持四级子菜单 - /// - public const int MaxDepth = 4; + /// + /// 最大深度 + /// + /// + /// 默认为4,仅支持四级子菜单 + /// + public const int MaxDepth = 4; - public const int MaxCodeLength = MaxDepth * (PlatformConsts.CodeUnitLength + 1) - 1; - } + public const int MaxCodeLength = MaxDepth * (PlatformConsts.CodeUnitLength + 1) - 1; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Menus/MenuEto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Menus/MenuEto.cs index d16481845..d27e975a0 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Menus/MenuEto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Menus/MenuEto.cs @@ -1,11 +1,10 @@ using LINGYUN.Platform.Routes; using Volo.Abp.EventBus; -namespace LINGYUN.Platform.Menus +namespace LINGYUN.Platform.Menus; + +[EventName("platform.menus.menu")] +public class MenuEto : RouteEto { - [EventName("platform.menus.menu")] - public class MenuEto : RouteEto - { - public string Framework { get; set; } - } + public string Framework { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Menus/RoleMenuEto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Menus/RoleMenuEto.cs index 33f5e2405..85d5a4c8d 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Menus/RoleMenuEto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Menus/RoleMenuEto.cs @@ -2,13 +2,12 @@ using Volo.Abp.EventBus; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Platform.Menus +namespace LINGYUN.Platform.Menus; + +[EventName("platform.menus.role_menu")] +public class RoleMenuEto : IMultiTenant { - [EventName("platform.menus.role_menu")] - public class RoleMenuEto : IMultiTenant - { - public Guid? TenantId { get; set; } - public Guid MenuId { get; set; } - public string RoleName { get; set; } - } + public Guid? TenantId { get; set; } + public Guid MenuId { get; set; } + public string RoleName { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Menus/UserMenuEto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Menus/UserMenuEto.cs index b1b5e4faa..4c6396ec7 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Menus/UserMenuEto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Menus/UserMenuEto.cs @@ -2,13 +2,12 @@ using Volo.Abp.EventBus; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Platform.Menus +namespace LINGYUN.Platform.Menus; + +[EventName("platform.menus.user_menu")] +public class UserMenuEto : IMultiTenant { - [EventName("platform.menus.user_menu")] - public class UserMenuEto : IMultiTenant - { - public Guid? TenantId { get; set; } - public Guid MenuId { get; set; } - public Guid UserId { get; set; } - } + public Guid? TenantId { get; set; } + public Guid MenuId { get; set; } + public Guid UserId { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/ObjectExtending/PlatformModuleExtensionConfigurationDictionaryExtensions.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/ObjectExtending/PlatformModuleExtensionConfigurationDictionaryExtensions.cs index 3c37991d1..432002b41 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/ObjectExtending/PlatformModuleExtensionConfigurationDictionaryExtensions.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/ObjectExtending/PlatformModuleExtensionConfigurationDictionaryExtensions.cs @@ -1,18 +1,17 @@ using System; using Volo.Abp.ObjectExtending.Modularity; -namespace LINGYUN.Platform.ObjectExtending +namespace LINGYUN.Platform.ObjectExtending; + +public static class PlatformModuleExtensionConfigurationDictionaryExtensions { - public static class PlatformModuleExtensionConfigurationDictionaryExtensions + public static ModuleExtensionConfigurationDictionary ConfigurePlatform( + this ModuleExtensionConfigurationDictionary modules, + Action configureAction) { - public static ModuleExtensionConfigurationDictionary ConfigurePlatform( - this ModuleExtensionConfigurationDictionary modules, - Action configureAction) - { - return modules.ConfigureModule( - PlatformModuleExtensionConsts.ModuleName, - configureAction - ); - } + return modules.ConfigureModule( + PlatformModuleExtensionConsts.ModuleName, + configureAction + ); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/ObjectExtending/PlatformModuleExtensionConsts.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/ObjectExtending/PlatformModuleExtensionConsts.cs index 8b366e4d5..640091bda 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/ObjectExtending/PlatformModuleExtensionConsts.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/ObjectExtending/PlatformModuleExtensionConsts.cs @@ -1,14 +1,13 @@ -namespace LINGYUN.Platform.ObjectExtending +namespace LINGYUN.Platform.ObjectExtending; + +public class PlatformModuleExtensionConsts { - public class PlatformModuleExtensionConsts - { - public const string ModuleName = "AppPlatform"; + public const string ModuleName = "AppPlatform"; - public static class EntityNames - { - public const string Route = "Route"; + public static class EntityNames + { + public const string Route = "Route"; - public const string Package = "Package"; - } + public const string Package = "Package"; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/ObjectExtending/PlatfromModuleExtensionConfiguration.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/ObjectExtending/PlatfromModuleExtensionConfiguration.cs index d0d16e06f..bb9abab75 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/ObjectExtending/PlatfromModuleExtensionConfiguration.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/ObjectExtending/PlatfromModuleExtensionConfiguration.cs @@ -1,26 +1,25 @@ using System; using Volo.Abp.ObjectExtending.Modularity; -namespace LINGYUN.Platform.ObjectExtending +namespace LINGYUN.Platform.ObjectExtending; + +public class PlatfromModuleExtensionConfiguration : ModuleExtensionConfiguration { - public class PlatfromModuleExtensionConfiguration : ModuleExtensionConfiguration + public PlatfromModuleExtensionConfiguration ConfigureRoute( + Action configureAction) { - public PlatfromModuleExtensionConfiguration ConfigureRoute( - Action configureAction) - { - return this.ConfigureEntity( - PlatformModuleExtensionConsts.EntityNames.Route, - configureAction - ); - } + return this.ConfigureEntity( + PlatformModuleExtensionConsts.EntityNames.Route, + configureAction + ); + } - public PlatfromModuleExtensionConfiguration ConfigurePackage( - Action configureAction) - { - return this.ConfigureEntity( - PlatformModuleExtensionConsts.EntityNames.Package, - configureAction - ); - } + public PlatfromModuleExtensionConfiguration ConfigurePackage( + Action configureAction) + { + return this.ConfigureEntity( + PlatformModuleExtensionConsts.EntityNames.Package, + configureAction + ); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Packages/PackageEto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Packages/PackageEto.cs index caf756db7..47a513564 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Packages/PackageEto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Packages/PackageEto.cs @@ -5,9 +5,8 @@ namespace LINGYUN.Platform.Packages; [EventName("platform.packages")] -public class PackageEto : IMultiTenant +public class PackageEto { - public Guid? TenantId { get; set; } /// /// 名称 /// diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/PlatformConsts.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/PlatformConsts.cs index bd8d662e1..d3a7e8c15 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/PlatformConsts.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/PlatformConsts.cs @@ -1,14 +1,13 @@ -namespace LINGYUN.Platform +namespace LINGYUN.Platform; + +public static class PlatformConsts { - public static class PlatformConsts - { - /// - /// 编号不足位补足字符,如编号为 3,长度5位,补足字符为 0,则编号为00003 - /// - public static char CodePrefix { get; set; } = '0'; - /// - /// 编号长度 - /// - public const int CodeUnitLength = 5; - } + /// + /// 编号不足位补足字符,如编号为 3,长度5位,补足字符为 0,则编号为00003 + /// + public static char CodePrefix { get; set; } = '0'; + /// + /// 编号长度 + /// + public const int CodeUnitLength = 5; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/PlatformDomainSharedModule.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/PlatformDomainSharedModule.cs index e1e4ebea3..fdae0a4e4 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/PlatformDomainSharedModule.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/PlatformDomainSharedModule.cs @@ -6,32 +6,31 @@ using Volo.Abp.Validation.Localization; using Volo.Abp.VirtualFileSystem; -namespace LINGYUN.Platform +namespace LINGYUN.Platform; + +[DependsOn( + typeof(AbpLocalizationModule), + typeof(AbpMultiTenancyAbstractionsModule))] +public class PlatformDomainSharedModule : AbpModule { - [DependsOn( - typeof(AbpLocalizationModule), - typeof(AbpMultiTenancyAbstractionsModule))] - public class PlatformDomainSharedModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + Configure(options => { - Configure(options => - { - options.FileSets.AddEmbedded(); - }); + options.FileSets.AddEmbedded(); + }); - Configure(options => - { - options.Resources - .Add("en") - .AddBaseTypes(typeof(AbpValidationResource)) - .AddVirtualJson("/LINGYUN/Platform/Localization/Resources"); - }); + Configure(options => + { + options.Resources + .Add("en") + .AddBaseTypes(typeof(AbpValidationResource)) + .AddVirtualJson("/LINGYUN/Platform/Localization/Resources"); + }); - Configure(options => - { - options.MapCodeNamespace("Platform", typeof(PlatformResource)); - }); - } + Configure(options => + { + options.MapCodeNamespace("Platform", typeof(PlatformResource)); + }); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/PlatformErrorCodes.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/PlatformErrorCodes.cs index 42d92cf09..d6ce475e1 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/PlatformErrorCodes.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/PlatformErrorCodes.cs @@ -1,41 +1,40 @@ -namespace LINGYUN.Platform +namespace LINGYUN.Platform; + +public static class PlatformErrorCodes { - public static class PlatformErrorCodes - { - private const string Namespace = "Platform"; + private const string Namespace = "Platform"; - public const string VersionFileNotFound = Namespace + ":01404"; - /// - /// 包版本不能降级 - /// - public const string PackageVersionDegraded = Namespace + ":01403"; - /// - /// 同级菜单已经存在 - /// - public const string DuplicateMenu = Namespace + ":02001"; - /// - /// 不能删除拥有子菜单的节点 - /// - public const string DeleteMenuHaveChildren = Namespace + ":02002"; - /// - /// 菜单层级已达到最大值 - /// - public const string MenuAchieveMaxDepth = Namespace + ":02003"; - /// - /// 菜单元数据缺少必要的元素 - /// - public const string MenuMissingMetadata = Namespace + ":02101"; - /// - /// 元数据格式不匹配 - /// - public const string MetaFormatMissMatch = Namespace + ":03001"; - /// - /// 用户重复收藏菜单 - /// - public const string UserDuplicateFavoriteMenu = Namespace + ":04400"; - /// - /// 用户收藏菜单未找到 - /// - public const string UserFavoriteMenuNotFound = Namespace + ":04404"; - } + public const string VersionFileNotFound = Namespace + ":01404"; + /// + /// 包版本不能降级 + /// + public const string PackageVersionDegraded = Namespace + ":01403"; + /// + /// 同级菜单已经存在 + /// + public const string DuplicateMenu = Namespace + ":02001"; + /// + /// 不能删除拥有子菜单的节点 + /// + public const string DeleteMenuHaveChildren = Namespace + ":02002"; + /// + /// 菜单层级已达到最大值 + /// + public const string MenuAchieveMaxDepth = Namespace + ":02003"; + /// + /// 菜单元数据缺少必要的元素 + /// + public const string MenuMissingMetadata = Namespace + ":02101"; + /// + /// 元数据格式不匹配 + /// + public const string MetaFormatMissMatch = Namespace + ":03001"; + /// + /// 用户重复收藏菜单 + /// + public const string UserDuplicateFavoriteMenu = Namespace + ":04400"; + /// + /// 用户收藏菜单未找到 + /// + public const string UserFavoriteMenuNotFound = Namespace + ":04404"; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/PlatformType.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/PlatformType.cs index 509c8e6cd..1c945ef8b 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/PlatformType.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/PlatformType.cs @@ -1,64 +1,63 @@ using System; -namespace LINGYUN.Platform +namespace LINGYUN.Platform; + +/// +/// 平台类型 +/// +[Flags] +public enum PlatformType { /// - /// 平台类型 + /// 未定义 + /// + None = 0, + /// + /// Windows CE + /// + WinCe = 2, + /// + /// Windows NT + /// + WinForm = 4, + /// + /// Windows桌面通用 + /// + Desktop = WinCe | WinForm, + /// + /// WebForm + /// + WebForm = 8, + /// + /// MVC + /// + WebMvc = 16, + /// + /// 其他Mvvm架构 + /// + WebMvvm = 32, + /// + /// Web通用 + /// + Web = WebForm | WebMvc | WebMvvm, + /// + /// Android + /// + Android = 64, + /// + /// IOS + /// + iOS = 128, + /// + /// 移动端通用 + /// + Mobile = Android | iOS, + /// + /// 小程序 + /// + MiniProgram = 256, + /// + /// 所有平台通用 /// - [Flags] - public enum PlatformType - { - /// - /// 未定义 - /// - None = 0, - /// - /// Windows CE - /// - WinCe = 2, - /// - /// Windows NT - /// - WinForm = 4, - /// - /// Windows桌面通用 - /// - Desktop = WinCe | WinForm, - /// - /// WebForm - /// - WebForm = 8, - /// - /// MVC - /// - WebMvc = 16, - /// - /// 其他Mvvm架构 - /// - WebMvvm = 32, - /// - /// Web通用 - /// - Web = WebForm | WebMvc | WebMvvm, - /// - /// Android - /// - Android = 64, - /// - /// IOS - /// - iOS = 128, - /// - /// 移动端通用 - /// - Mobile = Android | iOS, - /// - /// 小程序 - /// - MiniProgram = 256, - /// - /// 所有平台通用 - /// - All = Desktop | Web | Mobile | MiniProgram - } + All = Desktop | Web | Mobile | MiniProgram } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Routes/LayoutConsts.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Routes/LayoutConsts.cs index 1dee3d996..c48890654 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Routes/LayoutConsts.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Routes/LayoutConsts.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Platform.Routes +namespace LINGYUN.Platform.Routes; + +public static class LayoutConsts { - public static class LayoutConsts - { - public static int MaxFrameworkLength { get; set; } = 64; - } + public static int MaxFrameworkLength { get; set; } = 64; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Routes/RoleRouteConsts.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Routes/RoleRouteConsts.cs index 63f382a13..12b22a1d4 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Routes/RoleRouteConsts.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Routes/RoleRouteConsts.cs @@ -1,11 +1,10 @@ -namespace LINGYUN.Platform.Routes +namespace LINGYUN.Platform.Routes; + +public class RoleRouteConsts { - public class RoleRouteConsts + public static int MaxRoleNameLength { - public static int MaxRoleNameLength - { - get; - set; - } = 256; - } + get; + set; + } = 256; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Routes/RouteConsts.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Routes/RouteConsts.cs index 55dbace88..7c39ed3df 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Routes/RouteConsts.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Routes/RouteConsts.cs @@ -1,59 +1,58 @@ -namespace LINGYUN.Platform.Routes +namespace LINGYUN.Platform.Routes; + +public class RouteConsts { - public class RouteConsts + public static int MaxNameLength { - public static int MaxNameLength - { - get; - set; - } = 64; + get; + set; + } = 64; - public static int MaxFullNameLength - { - get; - set; - } = 128; + public static int MaxFullNameLength + { + get; + set; + } = 128; - public static int MaxDisplayNameLength - { - get; - set; - } = 128; + public static int MaxDisplayNameLength + { + get; + set; + } = 128; - public static int MaxDescriptionLength - { - get; - set; - } = 255; + public static int MaxDescriptionLength + { + get; + set; + } = 255; - public static int MaxIconLength - { - get; - set; - } = 128; + public static int MaxIconLength + { + get; + set; + } = 128; - public static int MaxPathLength - { - get; - set; - } = 255; + public static int MaxPathLength + { + get; + set; + } = 255; - public static int MaxRedirectLength - { - get; - set; - } = 255; - /// - /// 层级深度 - /// - public const int MaxDepth = 16; - /// - /// 编码长度 - /// - public const int CodeUnitLength = 5; - /// - /// 编号最大长度 - /// - public const int MaxCodeLength = MaxDepth * (CodeUnitLength + 1) - 1; - } + public static int MaxRedirectLength + { + get; + set; + } = 255; + /// + /// 层级深度 + /// + public const int MaxDepth = 16; + /// + /// 编码长度 + /// + public const int CodeUnitLength = 5; + /// + /// 编号最大长度 + /// + public const int MaxCodeLength = MaxDepth * (CodeUnitLength + 1) - 1; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Routes/RouteEto.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Routes/RouteEto.cs index b411e9f88..1e9806ba6 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Routes/RouteEto.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Routes/RouteEto.cs @@ -1,16 +1,15 @@ using System; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Platform.Routes +namespace LINGYUN.Platform.Routes; + +public abstract class RouteEto : IMultiTenant { - public abstract class RouteEto : IMultiTenant - { - public Guid? TenantId { get; set; } - public Guid Id { get; set; } - public string Path { get; set; } - public string Name { get; set; } - public string DisplayName { get; set; } - public string Description { get; set; } - public string Redirect { get; set; } - } + public Guid? TenantId { get; set; } + public Guid Id { get; set; } + public string Path { get; set; } + public string Name { get; set; } + public string DisplayName { get; set; } + public string Description { get; set; } + public string Redirect { get; set; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Settings/PlatformSettingNames.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Settings/PlatformSettingNames.cs index 2aeb8247c..6bdcafa4d 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Settings/PlatformSettingNames.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Settings/PlatformSettingNames.cs @@ -1,20 +1,19 @@ -namespace LINGYUN.Platform.Settings +namespace LINGYUN.Platform.Settings; + +public class PlatformSettingNames { - public class PlatformSettingNames - { - public const string GroupName = "AppPlatform"; + public const string GroupName = "AppPlatform"; - public class AppVersion - { - public const string Default = GroupName + ".AppVersion"; - /// - /// 文件限制长度 - /// - public const string VersionFileLimitLength = Default + ".VersionFileLimitLength"; - /// - /// 允许的文件扩展名类型 - /// - public const string AllowVersionFileExtensions = Default + ".AllowVersionFileExtensions"; - } + public class AppVersion + { + public const string Default = GroupName + ".AppVersion"; + /// + /// 文件限制长度 + /// + public const string VersionFileLimitLength = Default + ".VersionFileLimitLength"; + /// + /// 允许的文件扩展名类型 + /// + public const string AllowVersionFileExtensions = Default + ".AllowVersionFileExtensions"; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN.Platform.Domain.csproj b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN.Platform.Domain.csproj index a7e0854be..0cffe4291 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN.Platform.Domain.csproj +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN.Platform.Domain.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.Platform.Domain + LINGYUN.Abp.Platform.Domain + false + false + false diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/Data.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/Data.cs index eadb7d712..2f1dbebc1 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/Data.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/Data.cs @@ -8,120 +8,119 @@ using Volo.Abp.Guids; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Platform.Datas +namespace LINGYUN.Platform.Datas; + +/// +/// 数据字典 +/// +public class Data : FullAuditedAggregateRoot, IMultiTenant { - /// - /// 数据字典 - /// - public class Data : FullAuditedAggregateRoot, IMultiTenant - { - public virtual Guid? TenantId { get; protected set; } + public virtual Guid? TenantId { get; protected set; } - public virtual string Name { get; set; } + public virtual string Name { get; set; } - public virtual string Code { get; set; } + public virtual string Code { get; set; } - public virtual string DisplayName { get; set; } + public virtual string DisplayName { get; set; } - public virtual string Description { get; set; } + public virtual string Description { get; set; } - public virtual Guid? ParentId { get; set; } + public virtual Guid? ParentId { get; set; } - public virtual bool IsStatic { get; set; } + public virtual bool IsStatic { get; set; } - public virtual ICollection Items { get; protected set; } + public virtual ICollection Items { get; protected set; } - protected Data() - { - Items = new Collection(); - } + protected Data() + { + Items = new Collection(); + } - public Data( - [NotNull] Guid id, - [NotNull] string name, - [NotNull] string code, - [NotNull] string displayName, - string description = "", - Guid? parentId = null, - Guid? tenantId = null) - { - Check.NotNull(id, nameof(id)); - Check.NotNullOrWhiteSpace(name, nameof(name)); - Check.NotNullOrWhiteSpace(code, nameof(code)); - Check.NotNullOrWhiteSpace(displayName, nameof(displayName)); - - Id = id; - Name = name; - Code = code; - DisplayName = displayName; - Description = description; - ParentId = parentId; - TenantId = tenantId; - - CreationTime = DateTime.Now; - - Items = new Collection(); - } + public Data( + [NotNull] Guid id, + [NotNull] string name, + [NotNull] string code, + [NotNull] string displayName, + string description = "", + Guid? parentId = null, + Guid? tenantId = null) + { + Check.NotNull(id, nameof(id)); + Check.NotNullOrWhiteSpace(name, nameof(name)); + Check.NotNullOrWhiteSpace(code, nameof(code)); + Check.NotNullOrWhiteSpace(displayName, nameof(displayName)); + + Id = id; + Name = name; + Code = code; + DisplayName = displayName; + Description = description; + ParentId = parentId; + TenantId = tenantId; + + CreationTime = DateTime.Now; + + Items = new Collection(); + } - public Data AddItem( - [NotNull] IGuidGenerator guidGenerator, - [NotNull] string name, - [NotNull] string displayName, - [CanBeNull] string defaultValue, - ValueType valueType = ValueType.String, - string description = "", - bool allowBeNull = true, - bool isStatic = false) - { - Check.NotNull(guidGenerator, nameof(guidGenerator)); - Check.NotNull(name, nameof(name)); - Check.NotNull(displayName, nameof(displayName)); + public Data AddItem( + [NotNull] IGuidGenerator guidGenerator, + [NotNull] string name, + [NotNull] string displayName, + [CanBeNull] string defaultValue, + ValueType valueType = ValueType.String, + string description = "", + bool allowBeNull = true, + bool isStatic = false) + { + Check.NotNull(guidGenerator, nameof(guidGenerator)); + Check.NotNull(name, nameof(name)); + Check.NotNull(displayName, nameof(displayName)); - if (!IsInItem(name)) + if (!IsInItem(name)) + { + var dataItem = new DataItem( + guidGenerator.Create(), + Id, + name, + displayName, + defaultValue, + valueType, + description, + allowBeNull, + TenantId + ) { - var dataItem = new DataItem( - guidGenerator.Create(), - Id, - name, - displayName, - defaultValue, - valueType, - description, - allowBeNull, - TenantId - ) - { - IsStatic = isStatic - }; - Items.Add(dataItem); - } - - return this; + IsStatic = isStatic + }; + Items.Add(dataItem); } - public DataItem FindItem(string name) - { - return Items.FirstOrDefault(item => item.Name == name); - } + return this; + } - public DataItem FindItem(Guid id) - { - return Items.FirstOrDefault(item => item.Id == id); - } + public DataItem FindItem(string name) + { + return Items.FirstOrDefault(item => item.Name == name); + } - public bool RemoveItem(string name) - { - if (IsInItem(name)) - { - Items.RemoveAll(item => item.Name == name); - return true; - } - return false; - } + public DataItem FindItem(Guid id) + { + return Items.FirstOrDefault(item => item.Id == id); + } - public bool IsInItem(string name) + public bool RemoveItem(string name) + { + if (IsInItem(name)) { - return Items.Any(item => item.Name == name); + Items.RemoveAll(item => item.Name == name); + return true; } + return false; + } + + public bool IsInItem(string name) + { + return Items.Any(item => item.Name == name); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/DataDictionaryDataSeeder.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/DataDictionaryDataSeeder.cs index 313370dd4..352c5e16e 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/DataDictionaryDataSeeder.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/DataDictionaryDataSeeder.cs @@ -5,57 +5,56 @@ using Volo.Abp.Guids; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Platform.Datas +namespace LINGYUN.Platform.Datas; + +public class DataDictionaryDataSeeder : IDataDictionaryDataSeeder, ITransientDependency { - public class DataDictionaryDataSeeder : IDataDictionaryDataSeeder, ITransientDependency + protected ICurrentTenant CurrentTenant { get; } + protected IGuidGenerator GuidGenerator { get; } + protected IDataRepository DataRepository { get; } + + public DataDictionaryDataSeeder( + ICurrentTenant currentTenant, + IGuidGenerator guidGenerator, + IDataRepository dataRepository) { - protected ICurrentTenant CurrentTenant { get; } - protected IGuidGenerator GuidGenerator { get; } - protected IDataRepository DataRepository { get; } + CurrentTenant = currentTenant; + GuidGenerator = guidGenerator; + DataRepository = dataRepository; + } - public DataDictionaryDataSeeder( - ICurrentTenant currentTenant, - IGuidGenerator guidGenerator, - IDataRepository dataRepository) + public async virtual Task SeedAsync( + string name, + string code, + string displayName, + string description = "", + Guid? parentId = null, + Guid? tenantId = null, + bool isStatic = false, + CancellationToken cancellationToken = default) + { + using (CurrentTenant.Change(tenantId)) { - CurrentTenant = currentTenant; - GuidGenerator = guidGenerator; - DataRepository = dataRepository; - } + var data = await DataRepository.FindByNameAsync(name, cancellationToken: cancellationToken); - public async virtual Task SeedAsync( - string name, - string code, - string displayName, - string description = "", - Guid? parentId = null, - Guid? tenantId = null, - bool isStatic = false, - CancellationToken cancellationToken = default) - { - using (CurrentTenant.Change(tenantId)) + if (data == null) { - var data = await DataRepository.FindByNameAsync(name, cancellationToken: cancellationToken); - - if (data == null) + data = new Data( + GuidGenerator.Create(), + name, + code, + displayName, + description, + parentId, + tenantId) { - data = new Data( - GuidGenerator.Create(), - name, - code, - displayName, - description, - parentId, - tenantId) - { - IsStatic = isStatic - }; + IsStatic = isStatic + }; - data = await DataRepository.InsertAsync(data, true); - } - - return data; + data = await DataRepository.InsertAsync(data, true); } + + return data; } } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/DataItem.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/DataItem.cs index 071c2b116..e7ae03ca6 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/DataItem.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/DataItem.cs @@ -4,91 +4,90 @@ using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Platform.Datas +namespace LINGYUN.Platform.Datas; + +public class DataItem : FullAuditedAggregateRoot, IMultiTenant { - public class DataItem : FullAuditedAggregateRoot, IMultiTenant - { - public virtual Guid? TenantId { get; protected set; } + public virtual Guid? TenantId { get; protected set; } - public virtual string Name { get; protected set; } + public virtual string Name { get; protected set; } - public virtual string DisplayName { get; set; } + public virtual string DisplayName { get; set; } - public virtual string DefaultValue { get; set; } + public virtual string DefaultValue { get; set; } - public virtual string Description { get; set; } + public virtual string Description { get; set; } - public virtual bool AllowBeNull { get; set; } + public virtual bool AllowBeNull { get; set; } - public virtual bool IsStatic { get; set; } + public virtual bool IsStatic { get; set; } - public virtual ValueType ValueType { get; protected set; } + public virtual ValueType ValueType { get; protected set; } - public virtual Guid DataId { get; protected set; } + public virtual Guid DataId { get; protected set; } - protected DataItem() { } + protected DataItem() { } - internal DataItem( - [NotNull] Guid id, - [NotNull] Guid dataId, - [NotNull] string name, - [NotNull] string displayName, - [CanBeNull] string defaultValue = null, - ValueType valueType = ValueType.String, - string description = "", - bool allowBeNull = true, - Guid? tenantId = null) - { - Check.NotNull(id, nameof(id)); - Check.NotNull(dataId, nameof(dataId)); - Check.NotNullOrWhiteSpace(name, nameof(name)); - Check.NotNullOrWhiteSpace(displayName, nameof(displayName)); - - Id = id; - Name = name; - DefaultValue = defaultValue ?? SetDefaultValue(); - ValueType = valueType; - DisplayName = displayName; - AllowBeNull = allowBeNull; - - DataId = dataId; - TenantId = tenantId; - Description = description; - } + internal DataItem( + [NotNull] Guid id, + [NotNull] Guid dataId, + [NotNull] string name, + [NotNull] string displayName, + [CanBeNull] string defaultValue = null, + ValueType valueType = ValueType.String, + string description = "", + bool allowBeNull = true, + Guid? tenantId = null) + { + Check.NotNull(id, nameof(id)); + Check.NotNull(dataId, nameof(dataId)); + Check.NotNullOrWhiteSpace(name, nameof(name)); + Check.NotNullOrWhiteSpace(displayName, nameof(displayName)); - public string SetDefaultValue() + Id = id; + Name = name; + DefaultValue = defaultValue ?? SetDefaultValue(); + ValueType = valueType; + DisplayName = displayName; + AllowBeNull = allowBeNull; + + DataId = dataId; + TenantId = tenantId; + Description = description; + } + + public string SetDefaultValue() + { + switch (ValueType) { - switch (ValueType) - { - case ValueType.Array: - DefaultValue = "";// 当数据类型为数组对象时,需要前端来做转换了,约定的分隔符为英文逗号 - break; - case ValueType.Boolean: - DefaultValue = "false"; - break; - case ValueType.Date: - DefaultValue = !AllowBeNull ? DateTime.Now.ToString("yyyy-MM-dd") : ""; - break; - case ValueType.DateTime: - if (!AllowBeNull) - { - DefaultValue = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); // TODO: 以当前时间作为默认值? - } - DefaultValue = !AllowBeNull ? DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") : ""; - break; - case ValueType.Numeic: - DefaultValue = "0"; - break; - case ValueType.Object: - DefaultValue = "{}"; - break; - default: - case ValueType.String: - DefaultValue = ""; - break; - } - - return DefaultValue; + case ValueType.Array: + DefaultValue = "";// 当数据类型为数组对象时,需要前端来做转换了,约定的分隔符为英文逗号 + break; + case ValueType.Boolean: + DefaultValue = "false"; + break; + case ValueType.Date: + DefaultValue = !AllowBeNull ? DateTime.Now.ToString("yyyy-MM-dd") : ""; + break; + case ValueType.DateTime: + if (!AllowBeNull) + { + DefaultValue = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); // TODO: 以当前时间作为默认值? + } + DefaultValue = !AllowBeNull ? DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") : ""; + break; + case ValueType.Numeic: + DefaultValue = "0"; + break; + case ValueType.Object: + DefaultValue = "{}"; + break; + default: + case ValueType.String: + DefaultValue = ""; + break; } + + return DefaultValue; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/DataItemMappingOptions.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/DataItemMappingOptions.cs index ac9276df8..f592a0080 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/DataItemMappingOptions.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/DataItemMappingOptions.cs @@ -5,132 +5,131 @@ using System.Text.Json.Nodes; using Volo.Abp; -namespace LINGYUN.Platform.Datas +namespace LINGYUN.Platform.Datas; + +public class DataItemMappingOptions { - public class DataItemMappingOptions + public Dictionary> DataItemMaps { get; } + + public DataItemMappingOptions() { - public Dictionary> DataItemMaps { get; } + DataItemMaps = new Dictionary>(); + } - public DataItemMappingOptions() + internal void SetDefaultMapping() + { + SetMapping(ValueType.Array, value => { - DataItemMaps = new Dictionary>(); - } + if (value == null) + { + return ""; + } - internal void SetDefaultMapping() - { - SetMapping(ValueType.Array, value => + if (value is Array array) { - if (value == null) + var joinString = string.Empty; + foreach (var obj in array) { - return ""; + joinString += obj.ToString() + ","; } + return joinString.EndsWith(",") ? joinString[..^1] : joinString; + } - if (value is Array array) + if (value is JsonArray jsonArray) + { + var joinString = string.Empty; + foreach (var node in jsonArray) { - var joinString = string.Empty; - foreach (var obj in array) - { - joinString += obj.ToString() + ","; - } - return joinString.EndsWith(",") ? joinString[..^1] : joinString; + joinString += node.ToString() + ","; } + return joinString.EndsWith(",") ? joinString[..^1] : joinString; + } - if (value is JsonArray jsonArray) + if (value is JArray jArray) + { + var joinString = string.Empty; + foreach (var token in jArray.Children()) { - var joinString = string.Empty; - foreach (var node in jsonArray) - { - joinString += node.ToString() + ","; - } - return joinString.EndsWith(",") ? joinString[..^1] : joinString; + joinString += token.ToString() + ","; } - - if (value is JArray jArray) + return joinString.EndsWith(",") ? joinString[..^1] : joinString; + } + throw new BusinessException(PlatformErrorCodes.MetaFormatMissMatch); + }); + SetMapping(ValueType.Boolean, value => + { + if (value != null) + { + if (value is bool bo) { - var joinString = string.Empty; - foreach (var token in jArray.Children()) - { - joinString += token.ToString() + ","; - } - return joinString.EndsWith(",") ? joinString[..^1] : joinString; + return bo.ToString().ToLower(); } - throw new BusinessException(PlatformErrorCodes.MetaFormatMissMatch); - }); - SetMapping(ValueType.Boolean, value => - { - if (value != null) + else { - if (value is bool bo) - { - return bo.ToString().ToLower(); - } - else + var boInput = value.ToString().ToLower(); + if (boInput == "true" || + boInput == "false") { - var boInput = value.ToString().ToLower(); - if (boInput == "true" || - boInput == "false") - { - return boInput; - } - } + return boInput; + } } - throw new BusinessException(PlatformErrorCodes.MetaFormatMissMatch); - }); - SetMapping(ValueType.Date, value => + } + throw new BusinessException(PlatformErrorCodes.MetaFormatMissMatch); + }); + SetMapping(ValueType.Date, value => + { + if (value != null && value is DateTime date) { - if (value != null && value is DateTime date) - { - return date.ToString("yyyy-MM-dd"); - } - throw new BusinessException(PlatformErrorCodes.MetaFormatMissMatch); - }); - SetMapping(ValueType.DateTime, value => + return date.ToString("yyyy-MM-dd"); + } + throw new BusinessException(PlatformErrorCodes.MetaFormatMissMatch); + }); + SetMapping(ValueType.DateTime, value => + { + if (value != null && value is DateTime date) { - if (value != null && value is DateTime date) - { - return date.ToString("yyyy-MM-dd HH:mm:ss"); - } - throw new BusinessException(PlatformErrorCodes.MetaFormatMissMatch); - }); - SetMapping(ValueType.Numeic, value => + return date.ToString("yyyy-MM-dd HH:mm:ss"); + } + throw new BusinessException(PlatformErrorCodes.MetaFormatMissMatch); + }); + SetMapping(ValueType.Numeic, value => + { + if (value != null) { - if (value != null) + var valueType = value.GetType(); + if (!valueType.IsClass && !valueType.IsInterface && typeof(IFormattable).IsAssignableFrom(valueType)) { - var valueType = value.GetType(); - if (!valueType.IsClass && !valueType.IsInterface && typeof(IFormattable).IsAssignableFrom(valueType)) - { - return value.ToString(); - } + return value.ToString(); } - throw new BusinessException(PlatformErrorCodes.MetaFormatMissMatch); - }); - SetMapping(ValueType.String, value => + } + throw new BusinessException(PlatformErrorCodes.MetaFormatMissMatch); + }); + SetMapping(ValueType.String, value => + { + if (value == null) { - if (value == null) - { - return ""; - } - return value.ToString(); - }); - SetMapping(ValueType.Object, value => + return ""; + } + return value.ToString(); + }); + SetMapping(ValueType.Object, value => + { + if (value == null) { - if (value == null) - { - return "{}"; - } + return "{}"; + } - return JsonConvert.SerializeObject(value); - }); - } + return JsonConvert.SerializeObject(value); + }); + } - public void SetMapping(ValueType valueType, Func func) - { - DataItemMaps[valueType] = func; - } + public void SetMapping(ValueType valueType, Func func) + { + DataItemMaps[valueType] = func; + } - public string MapToString(ValueType valueType, object inputValue) - { - return DataItemMaps[valueType](inputValue); - } + public string MapToString(ValueType valueType, object inputValue) + { + return DataItemMaps[valueType](inputValue); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/IDataDictionaryDataSeeder.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/IDataDictionaryDataSeeder.cs index 6e956659d..76ed4b2dd 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/IDataDictionaryDataSeeder.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/IDataDictionaryDataSeeder.cs @@ -2,18 +2,17 @@ using System.Threading; using System.Threading.Tasks; -namespace LINGYUN.Platform.Datas +namespace LINGYUN.Platform.Datas; + +public interface IDataDictionaryDataSeeder { - public interface IDataDictionaryDataSeeder - { - Task SeedAsync( - string name, - string code, - string displayName, - string description = "", - Guid? parentId = null, - Guid? tenantId = null, - bool isStatic = false, - CancellationToken cancellationToken = default); - } + Task SeedAsync( + string name, + string code, + string displayName, + string description = "", + Guid? parentId = null, + Guid? tenantId = null, + bool isStatic = false, + CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/IDataRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/IDataRepository.cs index 5526eb14c..742ca3e8a 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/IDataRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Datas/IDataRepository.cs @@ -4,31 +4,30 @@ using System.Threading.Tasks; using Volo.Abp.Domain.Repositories; -namespace LINGYUN.Platform.Datas +namespace LINGYUN.Platform.Datas; + +public interface IDataRepository : IBasicRepository { - public interface IDataRepository : IBasicRepository - { - Task FindByNameAsync( - string name, - bool includeDetails = true, - CancellationToken cancellationToken = default); + Task FindByNameAsync( + string name, + bool includeDetails = true, + CancellationToken cancellationToken = default); - Task> GetChildrenAsync( - Guid? parentId, - bool includeDetails = false, - CancellationToken cancellationToken = default - ); + Task> GetChildrenAsync( + Guid? parentId, + bool includeDetails = false, + CancellationToken cancellationToken = default + ); - Task GetCountAsync( - string filter = "", - CancellationToken cancellationToken = default); + Task GetCountAsync( + string filter = "", + CancellationToken cancellationToken = default); - Task> GetPagedListAsync( - string filter = "", - string sorting = nameof(Data.Code), - bool includeDetails = false, - int skipCount = 0, - int maxResultCount = 10, - CancellationToken cancellationToken = default); - } + Task> GetPagedListAsync( + string filter = "", + string sorting = nameof(Data.Code), + bool includeDetails = false, + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Layouts/ILayoutRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Layouts/ILayoutRepository.cs index 58571b70b..792e911f0 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Layouts/ILayoutRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Layouts/ILayoutRepository.cs @@ -4,34 +4,33 @@ using System.Threading.Tasks; using Volo.Abp.Domain.Repositories; -namespace LINGYUN.Platform.Layouts +namespace LINGYUN.Platform.Layouts; + +public interface ILayoutRepository : IBasicRepository { - public interface ILayoutRepository : IBasicRepository - { - /// - /// 根据名称查询布局 - /// - /// - /// - /// - /// - Task FindByNameAsync( - string name, - bool includeDetails = true, - CancellationToken cancellationToken = default); + /// + /// 根据名称查询布局 + /// + /// + /// + /// + /// + Task FindByNameAsync( + string name, + bool includeDetails = true, + CancellationToken cancellationToken = default); - Task GetCountAsync( - string framework = "", - string filter = "", - CancellationToken cancellationToken = default); + Task GetCountAsync( + string framework = "", + string filter = "", + CancellationToken cancellationToken = default); - Task> GetPagedListAsync( - string framework = "", - string filter = "", - string sorting = nameof(Layout.Name), - bool includeDetails = false, - int skipCount = 0, - int maxResultCount = 10, - CancellationToken cancellationToken = default); - } + Task> GetPagedListAsync( + string framework = "", + string filter = "", + string sorting = nameof(Layout.Name), + bool includeDetails = false, + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Layouts/Layout.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Layouts/Layout.cs index f734369fd..78c7b9c4f 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Layouts/Layout.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Layouts/Layout.cs @@ -2,38 +2,37 @@ using LINGYUN.Platform.Routes; using System; -namespace LINGYUN.Platform.Layouts +namespace LINGYUN.Platform.Layouts; + +/// +/// 布局视图实体 +/// +public class Layout : Route { /// - /// 布局视图实体 + /// 框架 /// - public class Layout : Route - { - /// - /// 框架 - /// - public virtual string Framework { get; protected set; } - /// - /// 约定的Meta采用哪种数据字典,主要是约束路由必须字段的一致性 - /// - public virtual Guid DataId { get; protected set; } + public virtual string Framework { get; protected set; } + /// + /// 约定的Meta采用哪种数据字典,主要是约束路由必须字段的一致性 + /// + public virtual Guid DataId { get; protected set; } - protected Layout() { } + protected Layout() { } - public Layout( - [NotNull] Guid id, - [NotNull] string path, - [NotNull] string name, - [NotNull] string displayName, - [NotNull] Guid dataId, - [NotNull] string framework, - [CanBeNull] string redirect = "", - [CanBeNull] string description = "", - [CanBeNull] Guid? tenantId = null) - : base(id, path, name, displayName, redirect, description, tenantId) - { - DataId = dataId; - Framework = framework; - } + public Layout( + [NotNull] Guid id, + [NotNull] string path, + [NotNull] string name, + [NotNull] string displayName, + [NotNull] Guid dataId, + [NotNull] string framework, + [CanBeNull] string redirect = "", + [CanBeNull] string description = "", + [CanBeNull] Guid? tenantId = null) + : base(id, path, name, displayName, redirect, description, tenantId) + { + DataId = dataId; + Framework = framework; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IMenuRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IMenuRepository.cs index d7af723ca..6ec05ed9d 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IMenuRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IMenuRepository.cs @@ -4,120 +4,119 @@ using System.Threading.Tasks; using Volo.Abp.Domain.Repositories; -namespace LINGYUN.Platform.Menus +namespace LINGYUN.Platform.Menus; + +public interface IMenuRepository : IBasicRepository { - public interface IMenuRepository : IBasicRepository - { - Task> GetListAsync( - IEnumerable idList, - CancellationToken cancellationToken = default); - /// - /// 获取最后一个菜单 - /// - /// - /// - /// - Task GetLastMenuAsync( - Guid? parentId = null, - CancellationToken cancellationToken = default); - /// - /// 根据名称查询菜单 - /// - /// - /// - /// - Task FindByNameAsync( - string menuName, - CancellationToken cancellationToken = default); - /// - /// 查询主菜单,每一个布局页创建的时候都要创建路径为 / 的主菜单 - /// - /// - /// - /// - Task FindMainAsync( - string framework = "", - CancellationToken cancellationToken = default); - /// - /// 获取子节点 - /// - /// - /// - /// - Task> GetChildrenAsync( - Guid? parentId, - CancellationToken cancellationToken = default - ); - /// - /// 通过父菜单编码查询子菜单 - /// - /// - /// - /// - /// - Task> GetAllChildrenWithParentCodeAsync( - string code, - Guid? parentId, - CancellationToken cancellationToken = default - ); - /// - /// 查找用户可访问菜单 - /// - /// 用户标识 - /// 角色列表 - /// 平台类型 - /// - /// - Task> GetUserMenusAsync( - Guid userId, - string[] roles, - string framework = "", - CancellationToken cancellationToken = default); - /// - /// 查找角色可访问菜单 - /// - /// 角色列表 - /// 平台类型 - /// - /// - Task> GetRoleMenusAsync( - string[] roles, - string framework = "", - CancellationToken cancellationToken = default); + Task> GetListAsync( + IEnumerable idList, + CancellationToken cancellationToken = default); + /// + /// 获取最后一个菜单 + /// + /// + /// + /// + Task GetLastMenuAsync( + Guid? parentId = null, + CancellationToken cancellationToken = default); + /// + /// 根据名称查询菜单 + /// + /// + /// + /// + Task FindByNameAsync( + string menuName, + CancellationToken cancellationToken = default); + /// + /// 查询主菜单,每一个布局页创建的时候都要创建路径为 / 的主菜单 + /// + /// + /// + /// + Task FindMainAsync( + string framework = "", + CancellationToken cancellationToken = default); + /// + /// 获取子节点 + /// + /// + /// + /// + Task> GetChildrenAsync( + Guid? parentId, + CancellationToken cancellationToken = default + ); + /// + /// 通过父菜单编码查询子菜单 + /// + /// + /// + /// + /// + Task> GetAllChildrenWithParentCodeAsync( + string code, + Guid? parentId, + CancellationToken cancellationToken = default + ); + /// + /// 查找用户可访问菜单 + /// + /// 用户标识 + /// 角色列表 + /// 平台类型 + /// + /// + Task> GetUserMenusAsync( + Guid userId, + string[] roles, + string framework = "", + CancellationToken cancellationToken = default); + /// + /// 查找角色可访问菜单 + /// + /// 角色列表 + /// 平台类型 + /// + /// + Task> GetRoleMenusAsync( + string[] roles, + string framework = "", + CancellationToken cancellationToken = default); - Task GetCountAsync( - string filter = "", - string framework = "", - Guid? parentId = null, - Guid? layoutId = null, - CancellationToken cancellationToken = default); + Task GetCountAsync( + string filter = "", + string framework = "", + Guid? parentId = null, + Guid? layoutId = null, + CancellationToken cancellationToken = default); - Task> GetListAsync( - string filter = "", - string sorting = nameof(Menu.Code), - string framework = "", - Guid? parentId = null, - Guid? layoutId = null, - int skipCount = 0, - int maxResultCount = 10, - CancellationToken cancellationToken = default); + Task> GetListAsync( + string filter = "", + string sorting = nameof(Menu.Code), + string framework = "", + Guid? parentId = null, + Guid? layoutId = null, + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default); - Task> GetAllAsync( - string filter = "", - string sorting = nameof(Menu.Code), - string framework = "", - Guid? parentId = null, - Guid? layoutId = null, - CancellationToken cancellationToken = default); + Task> GetAllAsync( + string filter = "", + string sorting = nameof(Menu.Code), + string framework = "", + Guid? parentId = null, + Guid? layoutId = null, + CancellationToken cancellationToken = default); - Task RemoveAllRolesAsync( - Menu menu, - CancellationToken cancellationToken = default - ); + Task RemoveAllRolesAsync( + Menu menu, + CancellationToken cancellationToken = default + ); - Task RemoveAllMembersAsync( - Menu menu, - CancellationToken cancellationToken = default - ); - } + Task RemoveAllMembersAsync( + Menu menu, + CancellationToken cancellationToken = default + ); } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IRoleMenuRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IRoleMenuRepository.cs index 9f04a193b..10c8af0bd 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IRoleMenuRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IRoleMenuRepository.cs @@ -4,28 +4,27 @@ using System.Threading.Tasks; using Volo.Abp.Domain.Repositories; -namespace LINGYUN.Platform.Menus +namespace LINGYUN.Platform.Menus; + +public interface IRoleMenuRepository : IBasicRepository { - public interface IRoleMenuRepository : IBasicRepository - { - /// - /// 角色是否拥有菜单 - /// - /// - /// - /// - /// - Task RoleHasInMenuAsync( - string roleName, - string menuName, - CancellationToken cancellationToken = default); + /// + /// 角色是否拥有菜单 + /// + /// + /// + /// + /// + Task RoleHasInMenuAsync( + string roleName, + string menuName, + CancellationToken cancellationToken = default); - Task> GetListByRoleNameAsync( - string roleName, - CancellationToken cancellationToken = default); + Task> GetListByRoleNameAsync( + string roleName, + CancellationToken cancellationToken = default); - Task GetStartupMenuAsync( - IEnumerable roleNames, - CancellationToken cancellationToken = default); - } + Task GetStartupMenuAsync( + IEnumerable roleNames, + CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IUserMenuRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IUserMenuRepository.cs index 2e1fea0de..57650845f 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IUserMenuRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IUserMenuRepository.cs @@ -4,28 +4,27 @@ using System.Threading.Tasks; using Volo.Abp.Domain.Repositories; -namespace LINGYUN.Platform.Menus +namespace LINGYUN.Platform.Menus; + +public interface IUserMenuRepository : IBasicRepository { - public interface IUserMenuRepository : IBasicRepository - { - /// - /// 用户是否拥有菜单 - /// - /// - /// - /// - /// - Task UserHasInMenuAsync( - Guid userId, - string menuName, - CancellationToken cancellationToken = default); + /// + /// 用户是否拥有菜单 + /// + /// + /// + /// + /// + Task UserHasInMenuAsync( + Guid userId, + string menuName, + CancellationToken cancellationToken = default); - Task> GetListByUserIdAsync( - Guid userId, - CancellationToken cancellationToken = default); + Task> GetListByUserIdAsync( + Guid userId, + CancellationToken cancellationToken = default); - Task GetStartupMenuAsync( - Guid userId, - CancellationToken cancellationToken = default); - } + Task GetStartupMenuAsync( + Guid userId, + CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/Menu.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/Menu.cs index d94fc6639..6707915cc 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/Menu.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/Menu.cs @@ -3,65 +3,64 @@ using System; using Volo.Abp; -namespace LINGYUN.Platform.Menus +namespace LINGYUN.Platform.Menus; + +/// +/// 菜单 +/// +public class Menu : Route { /// - /// 菜单 + /// 框架 + /// + public virtual string Framework { get; set; } + /// + /// 菜单编号 + /// + public virtual string Code { get; set; } + /// + /// 菜单布局页,Layout的路径 + /// + public virtual string Component { get; set; } + /// + /// 所属的父菜单 /// - public class Menu : Route + public virtual Guid? ParentId { get; set; } + /// + /// 所属布局标识 + /// + public virtual Guid LayoutId { get; set; } + /// + /// 公共菜单 + /// + public virtual bool IsPublic { get; set; } + protected Menu() { - /// - /// 框架 - /// - public virtual string Framework { get; set; } - /// - /// 菜单编号 - /// - public virtual string Code { get; set; } - /// - /// 菜单布局页,Layout的路径 - /// - public virtual string Component { get; set; } - /// - /// 所属的父菜单 - /// - public virtual Guid? ParentId { get; set; } - /// - /// 所属布局标识 - /// - public virtual Guid LayoutId { get; set; } - /// - /// 公共菜单 - /// - public virtual bool IsPublic { get; set; } - protected Menu() - { - } + } - public Menu( - [NotNull] Guid id, - [NotNull] Guid layoutId, - [NotNull] string path, - [NotNull] string name, - [NotNull] string code, - [NotNull] string component, - [NotNull] string displayName, - [NotNull] string framework, - string redirect = "", - string description = "", - Guid? parentId = null, - Guid? tenantId = null) - : base(id, path, name, displayName, redirect, description, tenantId) - { - Check.NotNullOrWhiteSpace(code, nameof(code)); + public Menu( + [NotNull] Guid id, + [NotNull] Guid layoutId, + [NotNull] string path, + [NotNull] string name, + [NotNull] string code, + [NotNull] string component, + [NotNull] string displayName, + [NotNull] string framework, + string redirect = "", + string description = "", + Guid? parentId = null, + Guid? tenantId = null) + : base(id, path, name, displayName, redirect, description, tenantId) + { + Check.NotNullOrWhiteSpace(code, nameof(code)); - LayoutId = layoutId; - Code = code; - Component = component;// 下属的一级菜单的Component应该是布局页, 例如vue-admin中的 component: Layout, 其他前端框架雷同, 此处应传递布局页的路径让前端import - Framework = framework; - ParentId = parentId; + LayoutId = layoutId; + Code = code; + Component = component;// 下属的一级菜单的Component应该是布局页, 例如vue-admin中的 component: Layout, 其他前端框架雷同, 此处应传递布局页的路径让前端import + Framework = framework; + ParentId = parentId; - IsPublic = false; - } + IsPublic = false; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/MenuManager.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/MenuManager.cs index b9dd4be07..8f062ad1f 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/MenuManager.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/MenuManager.cs @@ -8,276 +8,275 @@ using Volo.Abp.Domain.Services; using Volo.Abp.Uow; -namespace LINGYUN.Platform.Menus +namespace LINGYUN.Platform.Menus; + +public class MenuManager : DomainService { - public class MenuManager : DomainService - { - protected IUnitOfWorkManager UnitOfWorkManager => LazyServiceProvider.LazyGetRequiredService(); + protected IUnitOfWorkManager UnitOfWorkManager => LazyServiceProvider.LazyGetRequiredService(); - protected IMenuRepository MenuRepository { get; } - protected IUserMenuRepository UserMenuRepository { get; } - protected IRoleMenuRepository RoleMenuRepository { get; } + protected IMenuRepository MenuRepository { get; } + protected IUserMenuRepository UserMenuRepository { get; } + protected IRoleMenuRepository RoleMenuRepository { get; } - public MenuManager( - IMenuRepository menuRepository, - IUserMenuRepository userMenuRepository, - IRoleMenuRepository roleMenuRepository) - { - MenuRepository = menuRepository; - UserMenuRepository = userMenuRepository; - RoleMenuRepository = roleMenuRepository; - } + public MenuManager( + IMenuRepository menuRepository, + IUserMenuRepository userMenuRepository, + IRoleMenuRepository roleMenuRepository) + { + MenuRepository = menuRepository; + UserMenuRepository = userMenuRepository; + RoleMenuRepository = roleMenuRepository; + } - [UnitOfWork] - public async virtual Task CreateAsync( - Layout layout, - Guid id, - string path, - string name, - string component, - string displayName, - string redirect = "", - string description = "", - Guid? parentId = null, - Guid? tenantId = null, - bool isPublic = false) + [UnitOfWork] + public async virtual Task CreateAsync( + Layout layout, + Guid id, + string path, + string name, + string component, + string displayName, + string redirect = "", + string description = "", + Guid? parentId = null, + Guid? tenantId = null, + bool isPublic = false) + { + var code = await GetNextChildCodeAsync(parentId); + if (code.Length > MenuConsts.MaxCodeLength) { - var code = await GetNextChildCodeAsync(parentId); - if (code.Length > MenuConsts.MaxCodeLength) - { - throw new BusinessException(PlatformErrorCodes.MenuAchieveMaxDepth) - .WithData("Depth", MenuConsts.MaxDepth); - } - var menu = new Menu( - id, - layout.Id, - path, - name, - code, - component, - displayName, - layout.Framework, - redirect, - description, - parentId, - tenantId) - { - IsPublic = isPublic - }; - await ValidateMenuAsync(menu); - await MenuRepository.InsertAsync(menu); - - return menu; + throw new BusinessException(PlatformErrorCodes.MenuAchieveMaxDepth) + .WithData("Depth", MenuConsts.MaxDepth); } - - [UnitOfWork] - public async virtual Task UpdateAsync(Menu menu) + var menu = new Menu( + id, + layout.Id, + path, + name, + code, + component, + displayName, + layout.Framework, + redirect, + description, + parentId, + tenantId) { - await ValidateMenuAsync(menu); - await MenuRepository.UpdateAsync(menu); - } + IsPublic = isPublic + }; + await ValidateMenuAsync(menu); + await MenuRepository.InsertAsync(menu); - [UnitOfWork] - public async virtual Task DeleteAsync(Guid id) - { - var children = await FindChildrenAsync(id, true); + return menu; + } - foreach (var child in children) - { - await MenuRepository.RemoveAllMembersAsync(child); - await MenuRepository.RemoveAllRolesAsync(child); - await MenuRepository.DeleteAsync(child); - } + [UnitOfWork] + public async virtual Task UpdateAsync(Menu menu) + { + await ValidateMenuAsync(menu); + await MenuRepository.UpdateAsync(menu); + } - var menu = await MenuRepository.GetAsync(id); - await MenuRepository.RemoveAllMembersAsync(menu); - await MenuRepository.RemoveAllRolesAsync(menu); + [UnitOfWork] + public async virtual Task DeleteAsync(Guid id) + { + var children = await FindChildrenAsync(id, true); - await MenuRepository.DeleteAsync(id); + foreach (var child in children) + { + await MenuRepository.RemoveAllMembersAsync(child); + await MenuRepository.RemoveAllRolesAsync(child); + await MenuRepository.DeleteAsync(child); } - [UnitOfWork] - public async virtual Task MoveAsync(Guid id, Guid? parentId) - { - var menu = await MenuRepository.GetAsync(id); - if (menu.ParentId == parentId) - { - return; - } + var menu = await MenuRepository.GetAsync(id); + await MenuRepository.RemoveAllMembersAsync(menu); + await MenuRepository.RemoveAllRolesAsync(menu); - var children = await FindChildrenAsync(id, true); + await MenuRepository.DeleteAsync(id); + } - var oldCode = menu.Code; + [UnitOfWork] + public async virtual Task MoveAsync(Guid id, Guid? parentId) + { + var menu = await MenuRepository.GetAsync(id); + if (menu.ParentId == parentId) + { + return; + } - menu.Code = await GetNextChildCodeAsync(parentId); - menu.ParentId = parentId; + var children = await FindChildrenAsync(id, true); - await ValidateMenuAsync(menu); + var oldCode = menu.Code; - foreach (var child in children) - { - child.Code = CodeNumberGenerator.AppendCode(menu.Code, CodeNumberGenerator.GetRelativeCode(child.Code, oldCode)); - } - } + menu.Code = await GetNextChildCodeAsync(parentId); + menu.ParentId = parentId; + + await ValidateMenuAsync(menu); - public async virtual Task UserHasInMenuAsync(Guid userId, string menuName) + foreach (var child in children) { - var menu = await MenuRepository.FindByNameAsync(menuName); - return false; + child.Code = CodeNumberGenerator.AppendCode(menu.Code, CodeNumberGenerator.GetRelativeCode(child.Code, oldCode)); } + } + + public async virtual Task UserHasInMenuAsync(Guid userId, string menuName) + { + var menu = await MenuRepository.FindByNameAsync(menuName); + return false; + } - public async virtual Task SetUserStartupMenuAsync(Guid userId, Guid menuId) + public async virtual Task SetUserStartupMenuAsync(Guid userId, Guid menuId) + { + using (var unitOfWork = UnitOfWorkManager.Begin()) { - using (var unitOfWork = UnitOfWorkManager.Begin()) - { - var userMenus = await UserMenuRepository.GetListByUserIdAsync(userId); + var userMenus = await UserMenuRepository.GetListByUserIdAsync(userId); - foreach (var menu in userMenus) + foreach (var menu in userMenus) + { + menu.Startup = false; + if (menu.MenuId.Equals(menuId)) { - menu.Startup = false; - if (menu.MenuId.Equals(menuId)) - { - menu.Startup = true; - } + menu.Startup = true; } + } - await UserMenuRepository.UpdateManyAsync(userMenus); + await UserMenuRepository.UpdateManyAsync(userMenus); - await unitOfWork.SaveChangesAsync(); - } + await unitOfWork.SaveChangesAsync(); } + } - public async virtual Task SetUserMenusAsync(Guid userId, IEnumerable menuIds) + public async virtual Task SetUserMenusAsync(Guid userId, IEnumerable menuIds) + { + using (var unitOfWork = UnitOfWorkManager.Begin()) { - using (var unitOfWork = UnitOfWorkManager.Begin()) - { - var userMenus = await UserMenuRepository.GetListByUserIdAsync(userId); - - // 移除不存在的菜单 - // TODO: 升级框架版本解决未能删除不需要菜单的问题 - // userMenus.RemoveAll(x => !menuIds.Contains(x.MenuId)); - var dels = userMenus.Where(x => !menuIds.Contains(x.MenuId)); - if (dels.Any()) - { - await UserMenuRepository.DeleteManyAsync(dels); - } + var userMenus = await UserMenuRepository.GetListByUserIdAsync(userId); - var adds = menuIds.Where(menuId => !userMenus.Any(x => x.MenuId == menuId)); - if (adds.Any()) - { - var addInMenus = adds.Select(menuId => new UserMenu(GuidGenerator.Create(), menuId, userId, CurrentTenant.Id)); - await UserMenuRepository.InsertManyAsync(addInMenus); - } - - await unitOfWork.SaveChangesAsync(); + // 移除不存在的菜单 + // TODO: 升级框架版本解决未能删除不需要菜单的问题 + // userMenus.RemoveAll(x => !menuIds.Contains(x.MenuId)); + var dels = userMenus.Where(x => !menuIds.Contains(x.MenuId)); + if (dels.Any()) + { + await UserMenuRepository.DeleteManyAsync(dels); } - } - public async virtual Task SetRoleStartupMenuAsync(string roleName, Guid menuId) - { - using (var unitOfWork = UnitOfWorkManager.Begin()) + var adds = menuIds.Where(menuId => !userMenus.Any(x => x.MenuId == menuId)); + if (adds.Any()) { - var roleMenus = await RoleMenuRepository.GetListByRoleNameAsync(roleName); - - foreach (var menu in roleMenus) - { - menu.Startup = false; - if (menu.MenuId.Equals(menuId)) - { - menu.Startup = true; - } - } - - await RoleMenuRepository.UpdateManyAsync(roleMenus); - - await unitOfWork.SaveChangesAsync(); + var addInMenus = adds.Select(menuId => new UserMenu(GuidGenerator.Create(), menuId, userId, CurrentTenant.Id)); + await UserMenuRepository.InsertManyAsync(addInMenus); } + + await unitOfWork.SaveChangesAsync(); } + } - public async virtual Task SetRoleMenusAsync(string roleName, IEnumerable menuIds) + public async virtual Task SetRoleStartupMenuAsync(string roleName, Guid menuId) + { + using (var unitOfWork = UnitOfWorkManager.Begin()) { - using (var unitOfWork = UnitOfWorkManager.Begin()) - { - var roleMenus = await RoleMenuRepository.GetListByRoleNameAsync(roleName); + var roleMenus = await RoleMenuRepository.GetListByRoleNameAsync(roleName); - // 移除不存在的菜单 - // TODO: 升级框架版本解决未能删除不需要菜单的问题 - // roleMenus.RemoveAll(x => !menuIds.Contains(x.MenuId)); - var dels = roleMenus.Where(x => !menuIds.Contains(x.MenuId)); - if (dels.Any()) + foreach (var menu in roleMenus) + { + menu.Startup = false; + if (menu.MenuId.Equals(menuId)) { - await RoleMenuRepository.DeleteManyAsync(dels); + menu.Startup = true; } + } - var adds = menuIds.Where(menuId => !roleMenus.Any(x => x.MenuId == menuId)); - if (adds.Any()) - { - var addInMenus = adds.Select(menuId => new RoleMenu(GuidGenerator.Create(), menuId, roleName, CurrentTenant.Id)); - await RoleMenuRepository.InsertManyAsync(addInMenus); - } + await RoleMenuRepository.UpdateManyAsync(roleMenus); - await unitOfWork.SaveChangesAsync(); - } + await unitOfWork.SaveChangesAsync(); } + } - public async virtual Task GetNextChildCodeAsync(Guid? parentId) + public async virtual Task SetRoleMenusAsync(string roleName, IEnumerable menuIds) + { + using (var unitOfWork = UnitOfWorkManager.Begin()) { - var lastChild = await GetLastChildOrNullAsync(parentId); - if (lastChild != null) + var roleMenus = await RoleMenuRepository.GetListByRoleNameAsync(roleName); + + // 移除不存在的菜单 + // TODO: 升级框架版本解决未能删除不需要菜单的问题 + // roleMenus.RemoveAll(x => !menuIds.Contains(x.MenuId)); + var dels = roleMenus.Where(x => !menuIds.Contains(x.MenuId)); + if (dels.Any()) { - return CodeNumberGenerator.CalculateNextCode(lastChild.Code); + await RoleMenuRepository.DeleteManyAsync(dels); } - var parentCode = parentId != null - ? await GetCodeOrDefaultAsync(parentId.Value) - : null; + var adds = menuIds.Where(menuId => !roleMenus.Any(x => x.MenuId == menuId)); + if (adds.Any()) + { + var addInMenus = adds.Select(menuId => new RoleMenu(GuidGenerator.Create(), menuId, roleName, CurrentTenant.Id)); + await RoleMenuRepository.InsertManyAsync(addInMenus); + } - return CodeNumberGenerator.AppendCode( - parentCode, - CodeNumberGenerator.CreateCode(1) - ); + await unitOfWork.SaveChangesAsync(); } + } - public async virtual Task GetLastChildOrNullAsync(Guid? parentId) + public async virtual Task GetNextChildCodeAsync(Guid? parentId) + { + var lastChild = await GetLastChildOrNullAsync(parentId); + if (lastChild != null) { - var children = await MenuRepository.GetChildrenAsync(parentId); - return children.OrderBy(c => c.Code).LastOrDefault(); + return CodeNumberGenerator.CalculateNextCode(lastChild.Code); } - public async Task> FindChildrenAsync(Guid? parentId, bool recursive = false) - { - if (!recursive) - { - return await MenuRepository.GetChildrenAsync(parentId); - } + var parentCode = parentId != null + ? await GetCodeOrDefaultAsync(parentId.Value) + : null; - if (!parentId.HasValue) - { - return await MenuRepository.GetListAsync(includeDetails: true); - } + return CodeNumberGenerator.AppendCode( + parentCode, + CodeNumberGenerator.CreateCode(1) + ); + } - var code = await GetCodeOrDefaultAsync(parentId.Value); + public async virtual Task GetLastChildOrNullAsync(Guid? parentId) + { + var children = await MenuRepository.GetChildrenAsync(parentId); + return children.OrderBy(c => c.Code).LastOrDefault(); + } - return await MenuRepository.GetAllChildrenWithParentCodeAsync(code, parentId); + public async Task> FindChildrenAsync(Guid? parentId, bool recursive = false) + { + if (!recursive) + { + return await MenuRepository.GetChildrenAsync(parentId); } - public async virtual Task GetCodeOrDefaultAsync(Guid id) + if (!parentId.HasValue) { - var menu = await MenuRepository.GetAsync(id); - return menu?.Code; + return await MenuRepository.GetListAsync(includeDetails: true); } - protected async virtual Task ValidateMenuAsync(Menu menu) - { - var siblings = (await FindChildrenAsync(menu.ParentId)) - .Where(x => x.Id != menu.Id) - .ToList(); + var code = await GetCodeOrDefaultAsync(parentId.Value); - if (siblings.Any(x => x.Name == menu.Name)) - { - throw new BusinessException(PlatformErrorCodes.DuplicateMenu) - .WithData("Name", menu.Name); - } + return await MenuRepository.GetAllChildrenWithParentCodeAsync(code, parentId); + } + + public async virtual Task GetCodeOrDefaultAsync(Guid id) + { + var menu = await MenuRepository.GetAsync(id); + return menu?.Code; + } + + protected async virtual Task ValidateMenuAsync(Menu menu) + { + var siblings = (await FindChildrenAsync(menu.ParentId)) + .Where(x => x.Id != menu.Id) + .ToList(); + + if (siblings.Any(x => x.Name == menu.Name)) + { + throw new BusinessException(PlatformErrorCodes.DuplicateMenu) + .WithData("Name", menu.Name); } } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/RoleMenu.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/RoleMenu.cs index 168eeac24..09a4c1582 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/RoleMenu.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/RoleMenu.cs @@ -2,38 +2,37 @@ using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Platform.Menus +namespace LINGYUN.Platform.Menus; + +/// +/// 角色菜单 +/// +public class RoleMenu : AuditedEntity, IMultiTenant { - /// - /// 角色菜单 - /// - public class RoleMenu : AuditedEntity, IMultiTenant - { - public virtual Guid? TenantId { get; protected set; } + public virtual Guid? TenantId { get; protected set; } - public virtual Guid MenuId { get; protected set; } + public virtual Guid MenuId { get; protected set; } - public virtual string RoleName { get; protected set; } + public virtual string RoleName { get; protected set; } - public virtual bool Startup { get; set; } + public virtual bool Startup { get; set; } - protected RoleMenu() { } + protected RoleMenu() { } - public RoleMenu( - Guid id, - Guid menuId, - string roleName, - Guid? tenantId = null) - : base(id) - { - MenuId = menuId; - RoleName = roleName; - TenantId = tenantId; - } + public RoleMenu( + Guid id, + Guid menuId, + string roleName, + Guid? tenantId = null) + : base(id) + { + MenuId = menuId; + RoleName = roleName; + TenantId = tenantId; + } - public override object[] GetKeys() - { - return new object[] { MenuId, RoleName }; - } + public override object[] GetKeys() + { + return new object[] { MenuId, RoleName }; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/UserMenu.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/UserMenu.cs index f865d4141..9c3558d7a 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/UserMenu.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/UserMenu.cs @@ -2,38 +2,37 @@ using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Platform.Menus +namespace LINGYUN.Platform.Menus; + +/// +/// 用户菜单 +/// +public class UserMenu : AuditedEntity, IMultiTenant { - /// - /// 用户菜单 - /// - public class UserMenu : AuditedEntity, IMultiTenant - { - public virtual Guid? TenantId { get; protected set; } + public virtual Guid? TenantId { get; protected set; } - public virtual Guid MenuId { get; protected set; } + public virtual Guid MenuId { get; protected set; } - public virtual Guid UserId { get; protected set; } + public virtual Guid UserId { get; protected set; } - public virtual bool Startup { get; set; } + public virtual bool Startup { get; set; } - protected UserMenu() { } + protected UserMenu() { } - public UserMenu( - Guid id, - Guid menuId, - Guid userId, - Guid? tenantId = null) - : base(id) - { - MenuId = menuId; - UserId = userId; - TenantId = tenantId; - } + public UserMenu( + Guid id, + Guid menuId, + Guid userId, + Guid? tenantId = null) + : base(id) + { + MenuId = menuId; + UserId = userId; + TenantId = tenantId; + } - public override object[] GetKeys() - { - return new object[] { MenuId, UserId }; - } + public override object[] GetKeys() + { + return new object[] { MenuId, UserId }; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Packages/IPackageRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Packages/IPackageRepository.cs index 6acce015b..5b4a00aa1 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Packages/IPackageRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Packages/IPackageRepository.cs @@ -16,6 +16,7 @@ Task FindByNameAsync( Task FindLatestAsync( string name, + string version = null, bool includeDetails = true, CancellationToken cancellationToken = default); diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Packages/Package.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Packages/Package.cs index d9e732ea7..ab4dbad5e 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Packages/Package.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Packages/Package.cs @@ -10,9 +10,8 @@ namespace LINGYUN.Platform.Packages; -public class Package : FullAuditedAggregateRoot, IMultiTenant +public class Package : FullAuditedAggregateRoot { - public virtual Guid? TenantId { get; protected set; } /// /// 名称 /// @@ -52,8 +51,7 @@ public Package( string name, string note, string version, - string description = null, - Guid? tenantId = null) + string description = null) : base(id) { Name = Check.NotNullOrWhiteSpace(name, nameof(name), PackageConsts.MaxNameLength); @@ -61,7 +59,6 @@ public Package( Version = Check.NotNullOrWhiteSpace(version, nameof(version), PackageConsts.MaxVersionLength); Description = Check.Length(description, nameof(description), PackageConsts.MaxDescriptionLength); - TenantId = tenantId; Level = PackageLevel.None; Blobs = new Collection(); @@ -90,8 +87,7 @@ public PackageBlob CreateBlob( createdAt, updatedAt, size, - summary, - TenantId); + summary); Blobs.Add(findBlob); } return findBlob; diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Packages/PackageBlob.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Packages/PackageBlob.cs index be13d93fd..c791981a8 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Packages/PackageBlob.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Packages/PackageBlob.cs @@ -6,9 +6,8 @@ namespace LINGYUN.Platform.Packages; -public class PackageBlob : CreationAuditedEntity, IMultiTenant, IHasExtraProperties +public class PackageBlob : CreationAuditedEntity, IHasExtraProperties { - public virtual Guid? TenantId { get; protected set; } public virtual Guid PackageId { get; private set; } public virtual Package Package { get; private set; } public virtual string Name { get; protected set; } @@ -36,8 +35,7 @@ internal PackageBlob( DateTime createdAt, DateTime? updatedAt = null, long? size = null, - string summary = null, - Guid? tenantId = null) + string summary = null) { PackageId = packageId; Name = Check.NotNullOrWhiteSpace(name, nameof(name), PackageBlobConsts.MaxNameLength); @@ -45,7 +43,6 @@ internal PackageBlob( UpdatedAt = updatedAt; Size = size; Summary = Check.Length(summary, nameof(summary), PackageBlobConsts.MaxSummaryLength); - TenantId = tenantId; DownloadCount = 0; ExtraProperties = new ExtraPropertyDictionary(); diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/PlatformDbProperties.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/PlatformDbProperties.cs index b6cc902a0..d1ed86ce9 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/PlatformDbProperties.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/PlatformDbProperties.cs @@ -1,11 +1,10 @@ -namespace LINGYUN.Platform +namespace LINGYUN.Platform; + +public static class PlatformDbProperties { - public static class PlatformDbProperties - { - public static string DbTablePrefix { get; set; } = "AppPlatform"; + public static string DbTablePrefix { get; set; } = "AppPlatform"; - public static string DbSchema { get; set; } = null; + public static string DbSchema { get; set; } = null; - public const string ConnectionStringName = "AppPlatform"; - } + public const string ConnectionStringName = "AppPlatform"; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/PlatformDomainMappingProfile.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/PlatformDomainMappingProfile.cs index 9c5bb86a2..d9fdcec8f 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/PlatformDomainMappingProfile.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/PlatformDomainMappingProfile.cs @@ -3,19 +3,18 @@ using LINGYUN.Platform.Menus; using LINGYUN.Platform.Packages; -namespace LINGYUN.Platform +namespace LINGYUN.Platform; + +public class PlatformDomainMappingProfile : Profile { - public class PlatformDomainMappingProfile : Profile + public PlatformDomainMappingProfile() { - public PlatformDomainMappingProfile() - { - CreateMap(); + CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); - CreateMap(); - } + CreateMap(); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/PlatformDomainModule.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/PlatformDomainModule.cs index 664a8aa32..c0933cf5d 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/PlatformDomainModule.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/PlatformDomainModule.cs @@ -12,59 +12,58 @@ using Volo.Abp.Modularity; using Volo.Abp.ObjectExtending.Modularity; -namespace LINGYUN.Platform +namespace LINGYUN.Platform; + +[DependsOn( + typeof(PlatformDomainSharedModule), + typeof(AbpBlobStoringModule), + typeof(AbpEventBusModule))] +public class PlatformDomainModule : AbpModule { - [DependsOn( - typeof(PlatformDomainSharedModule), - typeof(AbpBlobStoringModule), - typeof(AbpEventBusModule))] - public class PlatformDomainModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddAutoMapperObjectMapper(); + context.Services.AddAutoMapperObjectMapper(); - Configure(options => - { - options.SetDefaultMapping(); - }); + Configure(options => + { + options.SetDefaultMapping(); + }); - Configure(options => - { - options.AddProfile(validate: true); - }); + Configure(options => + { + options.AddProfile(validate: true); + }); - Configure(options => + Configure(options => + { + options.Containers.Configure(containerConfiguration => { - options.Containers.Configure(containerConfiguration => - { - containerConfiguration.IsMultiTenant = true; - }); + containerConfiguration.IsMultiTenant = true; }); + }); - Configure(options => - { - options.EtoMappings.Add(typeof(PlatformDomainModule)); + Configure(options => + { + options.EtoMappings.Add(typeof(PlatformDomainModule)); - options.EtoMappings.Add(typeof(PlatformDomainModule)); - options.EtoMappings.Add(typeof(PlatformDomainModule)); - options.EtoMappings.Add(typeof(PlatformDomainModule)); + options.EtoMappings.Add(typeof(PlatformDomainModule)); + options.EtoMappings.Add(typeof(PlatformDomainModule)); + options.EtoMappings.Add(typeof(PlatformDomainModule)); - options.EtoMappings.Add(typeof(PlatformDomainModule)); - }); - } - public override void PostConfigureServices(ServiceConfigurationContext context) - { - ModuleExtensionConfigurationHelper.ApplyEntityConfigurationToEntity( - PlatformModuleExtensionConsts.ModuleName, - PlatformModuleExtensionConsts.EntityNames.Route, - typeof(Route) - ); - ModuleExtensionConfigurationHelper.ApplyEntityConfigurationToEntity( - PlatformModuleExtensionConsts.ModuleName, - PlatformModuleExtensionConsts.EntityNames.Package, - typeof(Package) - ); - } + options.EtoMappings.Add(typeof(PlatformDomainModule)); + }); + } + public override void PostConfigureServices(ServiceConfigurationContext context) + { + ModuleExtensionConfigurationHelper.ApplyEntityConfigurationToEntity( + PlatformModuleExtensionConsts.ModuleName, + PlatformModuleExtensionConsts.EntityNames.Route, + typeof(Route) + ); + ModuleExtensionConfigurationHelper.ApplyEntityConfigurationToEntity( + PlatformModuleExtensionConsts.ModuleName, + PlatformModuleExtensionConsts.EntityNames.Package, + typeof(Package) + ); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/IRouteDataSeeder.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/IRouteDataSeeder.cs index 8746db03d..8dd57f8c3 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/IRouteDataSeeder.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/IRouteDataSeeder.cs @@ -4,47 +4,46 @@ using System.Threading; using System.Threading.Tasks; -namespace LINGYUN.Platform.Routes +namespace LINGYUN.Platform.Routes; + +public interface IRouteDataSeeder { - public interface IRouteDataSeeder - { - Task SeedLayoutAsync( - string name, - string path, - string displayName, - Guid dataId, - string framework, - string redirect = "", - string description = "", - Guid? tenantId = null, - CancellationToken cancellationToken = default); + Task SeedLayoutAsync( + string name, + string path, + string displayName, + Guid dataId, + string framework, + string redirect = "", + string description = "", + Guid? tenantId = null, + CancellationToken cancellationToken = default); - Task SeedMenuAsync( - Layout layout, - string name, - string path, - string code, - string component, - string displayName, - string redirect = "", - string description = "", - Guid? parentId = null, - Guid? tenantId = null, - bool isPublic = false, - CancellationToken cancellationToken = default); + Task SeedMenuAsync( + Layout layout, + string name, + string path, + string code, + string component, + string displayName, + string redirect = "", + string description = "", + Guid? parentId = null, + Guid? tenantId = null, + bool isPublic = false, + CancellationToken cancellationToken = default); - Task SeedUserMenuAsync( - Guid userId, - Menu menu, - Guid? tenantId = null, - CancellationToken cancellationToken = default - ); + Task SeedUserMenuAsync( + Guid userId, + Menu menu, + Guid? tenantId = null, + CancellationToken cancellationToken = default + ); - Task SeedRoleMenuAsync( - string roleName, - Menu menu, - Guid? tenantId = null, - CancellationToken cancellationToken = default - ); - } + Task SeedRoleMenuAsync( + string roleName, + Menu menu, + Guid? tenantId = null, + CancellationToken cancellationToken = default + ); } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/Route.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/Route.cs index e4b6249e3..9757afe4f 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/Route.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/Route.cs @@ -4,76 +4,75 @@ using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Platform.Routes +namespace LINGYUN.Platform.Routes; + +/// +/// 不管是布局还是视图或者页面,都作为路由的实现,因此抽象一个路由实体
+/// 注意:这是基于 Vue Router 的路由规则设计的实体,详情:https://router.vuejs.org/zh/api/#routes +///
+public abstract class Route : FullAuditedAggregateRoot, IMultiTenant { + public virtual Guid? TenantId { get; protected set; } /// - /// 不管是布局还是视图或者页面,都作为路由的实现,因此抽象一个路由实体
- /// 注意:这是基于 Vue Router 的路由规则设计的实体,详情:https://router.vuejs.org/zh/api/#routes + /// 路径 ///
- public abstract class Route : FullAuditedAggregateRoot, IMultiTenant - { - public virtual Guid? TenantId { get; protected set; } - /// - /// 路径 - /// - public virtual string Path { get; set; } - /// - /// 名称 - /// - public virtual string Name { get; set; } - /// - /// 显示名称 - /// - public virtual string DisplayName { get; set; } - /// - /// 说明 - /// - public virtual string Description { get; set; } - /// - /// 重定向路径 - /// - public virtual string Redirect { get; set; } + public virtual string Path { get; set; } + /// + /// 名称 + /// + public virtual string Name { get; set; } + /// + /// 显示名称 + /// + public virtual string DisplayName { get; set; } + /// + /// 说明 + /// + public virtual string Description { get; set; } + /// + /// 重定向路径 + /// + public virtual string Redirect { get; set; } - protected Route() { } + protected Route() { } - protected Route( - [NotNull] Guid id, - [NotNull] string path, - [NotNull] string name, - [NotNull] string displayName, - [CanBeNull] string redirect = "", - [CanBeNull] string description = "", - [CanBeNull] Guid? tenantId = null) - : base(id) - { - Check.NotNullOrWhiteSpace(path, nameof(path)); - Check.NotNullOrWhiteSpace(name, nameof(name)); - Check.NotNullOrWhiteSpace(displayName, nameof(displayName)); + protected Route( + [NotNull] Guid id, + [NotNull] string path, + [NotNull] string name, + [NotNull] string displayName, + [CanBeNull] string redirect = "", + [CanBeNull] string description = "", + [CanBeNull] Guid? tenantId = null) + : base(id) + { + Check.NotNullOrWhiteSpace(path, nameof(path)); + Check.NotNullOrWhiteSpace(name, nameof(name)); + Check.NotNullOrWhiteSpace(displayName, nameof(displayName)); - Path = path; - Name = name; - DisplayName = displayName; - Redirect = redirect; - Description = description; - TenantId = tenantId; - } + Path = path; + Name = name; + DisplayName = displayName; + Redirect = redirect; + Description = description; + TenantId = tenantId; + } - public override int GetHashCode() + public override int GetHashCode() + { + return Name.GetHashCode(); + } + + public override bool Equals(object obj) + { + if (obj == null) { - return Name.GetHashCode(); + return false; } - - public override bool Equals(object obj) + if (obj is Route route) { - if (obj == null) - { - return false; - } - if (obj is Route route) - { - return route.Name.Equals(Name, StringComparison.InvariantCultureIgnoreCase); - } - return base.Equals(obj); + return route.Name.Equals(Name, StringComparison.InvariantCultureIgnoreCase); } + return base.Equals(obj); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/RouteDataSeeder.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/RouteDataSeeder.cs index 936b53bbe..b47fb8ada 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/RouteDataSeeder.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/RouteDataSeeder.cs @@ -7,143 +7,142 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.Guids; -namespace LINGYUN.Platform.Routes +namespace LINGYUN.Platform.Routes; + +public class RouteDataSeeder : IRouteDataSeeder, ITransientDependency { - public class RouteDataSeeder : IRouteDataSeeder, ITransientDependency + protected IGuidGenerator GuidGenerator { get; } + protected ILayoutRepository LayoutRepository { get; } + protected IMenuRepository MenuRepository { get; } + protected IUserMenuRepository UserMenuRepository { get; } + protected IRoleMenuRepository RoleMenuRepository { get; } + + public RouteDataSeeder( + IGuidGenerator guidGenerator, + IMenuRepository menuRepository, + ILayoutRepository layoutRepository, + IUserMenuRepository userMenuRepository, + IRoleMenuRepository roleMenuRepository) { - protected IGuidGenerator GuidGenerator { get; } - protected ILayoutRepository LayoutRepository { get; } - protected IMenuRepository MenuRepository { get; } - protected IUserMenuRepository UserMenuRepository { get; } - protected IRoleMenuRepository RoleMenuRepository { get; } + GuidGenerator = guidGenerator; + MenuRepository = menuRepository; + LayoutRepository = layoutRepository; + UserMenuRepository = userMenuRepository; + RoleMenuRepository = roleMenuRepository; + } - public RouteDataSeeder( - IGuidGenerator guidGenerator, - IMenuRepository menuRepository, - ILayoutRepository layoutRepository, - IUserMenuRepository userMenuRepository, - IRoleMenuRepository roleMenuRepository) + public async virtual Task SeedLayoutAsync( + string name, + string path, + string displayName, + Guid dataId, + string framework, + string redirect = "", + string description = "", + Guid? tenantId = null, + CancellationToken cancellationToken = default) + { + var layout = await LayoutRepository.FindByNameAsync(name, cancellationToken: cancellationToken); + if (layout == null) { - GuidGenerator = guidGenerator; - MenuRepository = menuRepository; - LayoutRepository = layoutRepository; - UserMenuRepository = userMenuRepository; - RoleMenuRepository = roleMenuRepository; + layout = new Layout( + GuidGenerator.Create(), + path, + name, + displayName, + dataId, + framework, + redirect, + description, + tenantId); + layout = await LayoutRepository.InsertAsync(layout, cancellationToken: cancellationToken); } + return layout; + } - public async virtual Task SeedLayoutAsync( - string name, - string path, - string displayName, - Guid dataId, - string framework, - string redirect = "", - string description = "", - Guid? tenantId = null, - CancellationToken cancellationToken = default) + public async virtual Task SeedMenuAsync( + Layout layout, + string name, + string path, + string code, + string component, + string displayName, + string redirect = "", + string description = "", + Guid? parentId = null, + Guid? tenantId = null, + bool isPublic = false, + CancellationToken cancellationToken = default) + { + if (parentId.HasValue) { - var layout = await LayoutRepository.FindByNameAsync(name, cancellationToken: cancellationToken); - if (layout == null) + var children = await MenuRepository.GetChildrenAsync(parentId); + var childMenu = children.FirstOrDefault(x => x.Name == name); + if (childMenu != null) { - layout = new Layout( - GuidGenerator.Create(), - path, - name, - displayName, - dataId, - framework, - redirect, - description, - tenantId); - layout = await LayoutRepository.InsertAsync(layout, cancellationToken: cancellationToken); + return childMenu; } - return layout; } - - public async virtual Task SeedMenuAsync( - Layout layout, - string name, - string path, - string code, - string component, - string displayName, - string redirect = "", - string description = "", - Guid? parentId = null, - Guid? tenantId = null, - bool isPublic = false, - CancellationToken cancellationToken = default) + var menu = await MenuRepository.FindByNameAsync(name, cancellationToken: cancellationToken); + if (menu == null) { - if (parentId.HasValue) + menu = new Menu( + GuidGenerator.Create(), + layout.Id, + path, + name, + code, + component, + displayName, + layout.Framework, + redirect, + description, + parentId, + tenantId) { - var children = await MenuRepository.GetChildrenAsync(parentId); - var childMenu = children.FirstOrDefault(x => x.Name == name); - if (childMenu != null) - { - return childMenu; - } - } - var menu = await MenuRepository.FindByNameAsync(name, cancellationToken: cancellationToken); - if (menu == null) - { - menu = new Menu( - GuidGenerator.Create(), - layout.Id, - path, - name, - code, - component, - displayName, - layout.Framework, - redirect, - description, - parentId, - tenantId) - { - IsPublic = isPublic - }; - - menu = await MenuRepository.InsertAsync(menu, cancellationToken: cancellationToken); - } + IsPublic = isPublic + }; - return menu; + menu = await MenuRepository.InsertAsync(menu, cancellationToken: cancellationToken); } - public async virtual Task SeedRoleMenuAsync( - string roleName, - Menu menu, - Guid? tenantId = null, - CancellationToken cancellationToken = default) + return menu; + } + + public async virtual Task SeedRoleMenuAsync( + string roleName, + Menu menu, + Guid? tenantId = null, + CancellationToken cancellationToken = default) + { + if (! await RoleMenuRepository.RoleHasInMenuAsync(roleName, menu.Name, cancellationToken)) { - if (! await RoleMenuRepository.RoleHasInMenuAsync(roleName, menu.Name, cancellationToken)) - { - var roleMenu = new RoleMenu(GuidGenerator.Create(), menu.Id, roleName, tenantId); - await RoleMenuRepository.InsertAsync(roleMenu); + var roleMenu = new RoleMenu(GuidGenerator.Create(), menu.Id, roleName, tenantId); + await RoleMenuRepository.InsertAsync(roleMenu); - var childrens = await MenuRepository.GetChildrenAsync(menu.Id); - foreach (var children in childrens) - { - await SeedRoleMenuAsync(roleName, children, tenantId, cancellationToken); - } + var childrens = await MenuRepository.GetChildrenAsync(menu.Id); + foreach (var children in childrens) + { + await SeedRoleMenuAsync(roleName, children, tenantId, cancellationToken); } } + } - public async virtual Task SeedUserMenuAsync( - Guid userId, - Menu menu, - Guid? tenantId = null, - CancellationToken cancellationToken = default) + public async virtual Task SeedUserMenuAsync( + Guid userId, + Menu menu, + Guid? tenantId = null, + CancellationToken cancellationToken = default) + { + if (!await UserMenuRepository.UserHasInMenuAsync(userId, menu.Name, cancellationToken)) { - if (!await UserMenuRepository.UserHasInMenuAsync(userId, menu.Name, cancellationToken)) - { - var userMenu = new UserMenu(GuidGenerator.Create(), menu.Id, userId, tenantId); - await UserMenuRepository.InsertAsync(userMenu); + var userMenu = new UserMenu(GuidGenerator.Create(), menu.Id, userId, tenantId); + await UserMenuRepository.InsertAsync(userMenu); - var childrens = await MenuRepository.GetChildrenAsync(menu.Id); - foreach (var children in childrens) - { - await SeedUserMenuAsync(userId, children, tenantId, cancellationToken); - } + var childrens = await MenuRepository.GetChildrenAsync(menu.Id); + foreach (var children in childrens) + { + await SeedUserMenuAsync(userId, children, tenantId, cancellationToken); } } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Settings/PlatformSettingDefinitionProvider.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Settings/PlatformSettingDefinitionProvider.cs index d83fa45b9..5fc292efa 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Settings/PlatformSettingDefinitionProvider.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Settings/PlatformSettingDefinitionProvider.cs @@ -2,23 +2,22 @@ using Volo.Abp.Localization; using Volo.Abp.Settings; -namespace LINGYUN.Platform.Settings +namespace LINGYUN.Platform.Settings; + +public class PlatformSettingDefinitionProvider : SettingDefinitionProvider { - public class PlatformSettingDefinitionProvider : SettingDefinitionProvider + public override void Define(ISettingDefinitionContext context) { - public override void Define(ISettingDefinitionContext context) - { - context.Add(CreateDefaultSettings()); - } + context.Add(CreateDefaultSettings()); + } - protected SettingDefinition[] CreateDefaultSettings() - { - return new SettingDefinition[0]; - } + protected SettingDefinition[] CreateDefaultSettings() + { + return new SettingDefinition[0]; + } - protected LocalizableString L(string name) - { - return LocalizableString.Create(name); - } + protected LocalizableString L(string name) + { + return LocalizableString.Create(name); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Utils/CodeNumberGenerator.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Utils/CodeNumberGenerator.cs index 2cb615914..b8868ba96 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Utils/CodeNumberGenerator.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Utils/CodeNumberGenerator.cs @@ -2,93 +2,92 @@ using System.Collections.Generic; using System.Linq; -namespace LINGYUN.Platform.Utils +namespace LINGYUN.Platform.Utils; + +public static class CodeNumberGenerator { - public static class CodeNumberGenerator + public static string CreateCode(params int[] numbers) { - public static string CreateCode(params int[] numbers) + if (numbers.IsNullOrEmpty()) { - if (numbers.IsNullOrEmpty()) - { - return null; - } + return null; + } + + return numbers.Select(number => number.ToString(new string(PlatformConsts.CodePrefix, PlatformConsts.CodeUnitLength))).JoinAsString("."); + } - return numbers.Select(number => number.ToString(new string(PlatformConsts.CodePrefix, PlatformConsts.CodeUnitLength))).JoinAsString("."); + public static string AppendCode(string parentCode, string childCode) + { + if (childCode.IsNullOrEmpty()) + { + throw new ArgumentNullException(nameof(childCode), "childCode can not be null or empty."); } - public static string AppendCode(string parentCode, string childCode) + if (parentCode.IsNullOrEmpty()) { - if (childCode.IsNullOrEmpty()) - { - throw new ArgumentNullException(nameof(childCode), "childCode can not be null or empty."); - } + return childCode; + } - if (parentCode.IsNullOrEmpty()) - { - return childCode; - } + return parentCode + "." + childCode; + } - return parentCode + "." + childCode; + public static string GetRelativeCode(string code, string parentCode) + { + if (code.IsNullOrEmpty()) + { + throw new ArgumentNullException(nameof(code), "code can not be null or empty."); } - public static string GetRelativeCode(string code, string parentCode) + if (parentCode.IsNullOrEmpty()) { - if (code.IsNullOrEmpty()) - { - throw new ArgumentNullException(nameof(code), "code can not be null or empty."); - } - - if (parentCode.IsNullOrEmpty()) - { - return code; - } - - if (code.Length == parentCode.Length) - { - return null; - } - - return code.Substring(parentCode.Length + 1); + return code; } - public static string CalculateNextCode(string code) + if (code.Length == parentCode.Length) { - if (code.IsNullOrEmpty()) - { - throw new ArgumentNullException(nameof(code), "code can not be null or empty."); - } + return null; + } - var parentCode = GetParentCode(code); - var lastUnitCode = GetLastCode(code); + return code.Substring(parentCode.Length + 1); + } - return AppendCode(parentCode, CreateCode(Convert.ToInt32(lastUnitCode) + 1)); + public static string CalculateNextCode(string code) + { + if (code.IsNullOrEmpty()) + { + throw new ArgumentNullException(nameof(code), "code can not be null or empty."); } - public static string GetLastCode(string code) + var parentCode = GetParentCode(code); + var lastUnitCode = GetLastCode(code); + + return AppendCode(parentCode, CreateCode(Convert.ToInt32(lastUnitCode) + 1)); + } + + public static string GetLastCode(string code) + { + if (code.IsNullOrEmpty()) { - if (code.IsNullOrEmpty()) - { - throw new ArgumentNullException(nameof(code), "code can not be null or empty."); - } + throw new ArgumentNullException(nameof(code), "code can not be null or empty."); + } + + var splittedCode = code.Split('.'); + return splittedCode[splittedCode.Length - 1]; + } - var splittedCode = code.Split('.'); - return splittedCode[splittedCode.Length - 1]; + public static string GetParentCode(string code) + { + if (code.IsNullOrEmpty()) + { + throw new ArgumentNullException(nameof(code), "code can not be null or empty."); } - public static string GetParentCode(string code) + var splittedCode = code.Split('.'); + if (splittedCode.Length == 1) { - if (code.IsNullOrEmpty()) - { - throw new ArgumentNullException(nameof(code), "code can not be null or empty."); - } - - var splittedCode = code.Split('.'); - if (splittedCode.Length == 1) - { - return null; - } - - return splittedCode.Take(splittedCode.Length - 1).JoinAsString("."); + return null; } + + return splittedCode.Take(splittedCode.Length - 1).JoinAsString("."); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/System/BytesExtensions.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/System/BytesExtensions.cs index af35b96d4..34fd9b93c 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/System/BytesExtensions.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/System/BytesExtensions.cs @@ -1,47 +1,46 @@ using System.Security.Cryptography; -namespace System +namespace System; + +public static class BytesExtensions { - public static class BytesExtensions + public static string Md5(this byte[] data, bool lowercase = false) { - public static string Md5(this byte[] data, bool lowercase = false) + using (var md5 = MD5.Create()) { - using (var md5 = MD5.Create()) - { - var hashBytes = md5.ComputeHash(data); - var md5Str = BitConverter.ToString(hashBytes).Replace("-", string.Empty); - return lowercase ? md5Str.ToLower() : md5Str; - } + var hashBytes = md5.ComputeHash(data); + var md5Str = BitConverter.ToString(hashBytes).Replace("-", string.Empty); + return lowercase ? md5Str.ToLower() : md5Str; } + } - public static string Sha1(this byte[] data, bool lowercase = false) + public static string Sha1(this byte[] data, bool lowercase = false) + { + using (var sha = SHA1.Create()) { - using (var sha = SHA1.Create()) - { - var hashBytes = sha.ComputeHash(data); - var sha1 = BitConverter.ToString(hashBytes).Replace("-", string.Empty); - return lowercase ? sha1.ToLower() : sha1; - } + var hashBytes = sha.ComputeHash(data); + var sha1 = BitConverter.ToString(hashBytes).Replace("-", string.Empty); + return lowercase ? sha1.ToLower() : sha1; } + } - public static string Sha256(this byte[] data, bool lowercase = false) + public static string Sha256(this byte[] data, bool lowercase = false) + { + using (var sha = SHA256.Create()) { - using (var sha = SHA256.Create()) - { - var hashBytes = sha.ComputeHash(data); - var sha256 = BitConverter.ToString(hashBytes).Replace("-", string.Empty); - return lowercase ? sha256.ToLower() : sha256; - } + var hashBytes = sha.ComputeHash(data); + var sha256 = BitConverter.ToString(hashBytes).Replace("-", string.Empty); + return lowercase ? sha256.ToLower() : sha256; } + } - public static string Sha512(this byte[] data, bool lowercase = false) + public static string Sha512(this byte[] data, bool lowercase = false) + { + using (var sha = SHA512.Create()) { - using (var sha = SHA512.Create()) - { - var hashBytes = sha.ComputeHash(data); - var sha512 = BitConverter.ToString(hashBytes).Replace("-", string.Empty); - return lowercase ? sha512.ToLower() : sha512; - } + var hashBytes = sha.ComputeHash(data); + var sha512 = BitConverter.ToString(hashBytes).Replace("-", string.Empty); + return lowercase ? sha512.ToLower() : sha512; } } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/System/StringExtensions.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/System/StringExtensions.cs index 488aa77b1..abe0dd2d6 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/System/StringExtensions.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/System/StringExtensions.cs @@ -1,48 +1,47 @@ using System.Security.Cryptography; using System.Text; -namespace System +namespace System; + +public static class StringExtensions { - public static class StringExtensions + public static string Md5(this string str, bool lowercase = false) { - public static string Md5(this string str, bool lowercase = false) + using (var md5 = MD5.Create()) { - using (var md5 = MD5.Create()) - { - var hashBytes = md5.ComputeHash(Encoding.UTF8.GetBytes(str)); - var md5Str = BitConverter.ToString(hashBytes).Replace("-", string.Empty); - return lowercase ? md5Str.ToLower() : md5Str; - } + var hashBytes = md5.ComputeHash(Encoding.UTF8.GetBytes(str)); + var md5Str = BitConverter.ToString(hashBytes).Replace("-", string.Empty); + return lowercase ? md5Str.ToLower() : md5Str; } + } - public static string Sha1(this string str, bool lowercase = false) + public static string Sha1(this string str, bool lowercase = false) + { + using (var sha = SHA1.Create()) { - using (var sha = SHA1.Create()) - { - var hashBytes = sha.ComputeHash(Encoding.UTF8.GetBytes(str)); - var sha1 = BitConverter.ToString(hashBytes).Replace("-", string.Empty); - return lowercase ? sha1.ToLower() : sha1; - } + var hashBytes = sha.ComputeHash(Encoding.UTF8.GetBytes(str)); + var sha1 = BitConverter.ToString(hashBytes).Replace("-", string.Empty); + return lowercase ? sha1.ToLower() : sha1; } + } - public static string Sha256(this string str, bool lowercase = false) + public static string Sha256(this string str, bool lowercase = false) + { + using (var sha = SHA256.Create()) { - using (var sha = SHA256.Create()) - { - var hashBytes = sha.ComputeHash(Encoding.UTF8.GetBytes(str)); - var sha256 = BitConverter.ToString(hashBytes).Replace("-", string.Empty); - return lowercase ? sha256.ToLower() : sha256; - } + var hashBytes = sha.ComputeHash(Encoding.UTF8.GetBytes(str)); + var sha256 = BitConverter.ToString(hashBytes).Replace("-", string.Empty); + return lowercase ? sha256.ToLower() : sha256; } + } - public static string Sha512(this string str, bool lowercase = false) + public static string Sha512(this string str, bool lowercase = false) + { + using (var sha = SHA512.Create()) { - using (var sha = SHA512.Create()) - { - var hashBytes = sha.ComputeHash(Encoding.UTF8.GetBytes(str)); - var sha512 = BitConverter.ToString(hashBytes).Replace("-", string.Empty); - return lowercase ? sha512.ToLower() : sha512; - } + var hashBytes = sha.ComputeHash(Encoding.UTF8.GetBytes(str)); + var sha512 = BitConverter.ToString(hashBytes).Replace("-", string.Empty); + return lowercase ? sha512.ToLower() : sha512; } } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN.Platform.EntityFrameworkCore.csproj b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN.Platform.EntityFrameworkCore.csproj index 48ddc1ecc..7e0d792fb 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN.Platform.EntityFrameworkCore.csproj +++ b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN.Platform.EntityFrameworkCore.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.Platform.EntityFrameworkCore + LINGYUN.Abp.Platform.EntityFrameworkCore + false + false + false diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Datas/EfCoreDataRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Datas/EfCoreDataRepository.cs index 85ec18867..1b27973c0 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Datas/EfCoreDataRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Datas/EfCoreDataRepository.cs @@ -8,86 +8,84 @@ using System.Threading.Tasks; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; -using static System.Runtime.InteropServices.JavaScript.JSType; -namespace LINGYUN.Platform.Datas +namespace LINGYUN.Platform.Datas; + +public class EfCoreDataRepository : EfCoreRepository, IDataRepository { - public class EfCoreDataRepository : EfCoreRepository, IDataRepository + public EfCoreDataRepository( + IDbContextProvider dbContextProvider) : base(dbContextProvider) { - public EfCoreDataRepository( - IDbContextProvider dbContextProvider) : base(dbContextProvider) - { - } + } - public async virtual Task FindByNameAsync( - string name, - bool includeDetails = true, - CancellationToken cancellationToken = default) - { - var dbSet = await GetDbSetAsync(); - return await dbSet - .IncludeDetails(includeDetails) - .Where(x => x.Name == name) - .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task FindByNameAsync( + string name, + bool includeDetails = true, + CancellationToken cancellationToken = default) + { + var dbSet = await GetDbSetAsync(); + return await dbSet + .IncludeDetails(includeDetails) + .Where(x => x.Name == name) + .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task> GetChildrenAsync( - Guid? parentId, - bool includeDetails = false, - CancellationToken cancellationToken = default) - { - var dbSet = await GetDbSetAsync(); - return await dbSet - .IncludeDetails(includeDetails) - .Where(x => x.ParentId == parentId) - .ToListAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task> GetChildrenAsync( + Guid? parentId, + bool includeDetails = false, + CancellationToken cancellationToken = default) + { + var dbSet = await GetDbSetAsync(); + return await dbSet + .IncludeDetails(includeDetails) + .Where(x => x.ParentId == parentId) + .ToListAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task GetCountAsync( - string filter = "", - CancellationToken cancellationToken = default) - { - var dbSet = await GetDbSetAsync(); - return await dbSet - .WhereIf(!filter.IsNullOrWhiteSpace(), x => - x.Code.Contains(filter) || x.Description.Contains(filter) || - x.DisplayName.Contains(filter) || x.Name.Contains(filter)) - .CountAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task GetCountAsync( + string filter = "", + CancellationToken cancellationToken = default) + { + var dbSet = await GetDbSetAsync(); + return await dbSet + .WhereIf(!filter.IsNullOrWhiteSpace(), x => + x.Code.Contains(filter) || x.Description.Contains(filter) || + x.DisplayName.Contains(filter) || x.Name.Contains(filter)) + .CountAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task> GetPagedListAsync( - string filter = "", - string sorting = "Code", - bool includeDetails = false, - int skipCount = 0, - int maxResultCount = 10, - CancellationToken cancellationToken = default) + public async virtual Task> GetPagedListAsync( + string filter = "", + string sorting = "Code", + bool includeDetails = false, + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default) + { + if (sorting.IsNullOrWhiteSpace()) { - if (sorting.IsNullOrWhiteSpace()) - { - sorting = nameof(Data.Code); - } - - var dbSet = await GetDbSetAsync(); - return await dbSet - .IncludeDetails(includeDetails) - .WhereIf(!filter.IsNullOrWhiteSpace(), x => - x.Code.Contains(filter) || x.Description.Contains(filter) || - x.DisplayName.Contains(filter) || x.Name.Contains(filter)) - .OrderBy(sorting) - .PageBy(skipCount, maxResultCount) - .ToListAsync(GetCancellationToken(cancellationToken)); + sorting = nameof(Data.Code); } - public override async Task> WithDetailsAsync() - { - return (await GetQueryableAsync()).IncludeDetails(); - } + var dbSet = await GetDbSetAsync(); + return await dbSet + .IncludeDetails(includeDetails) + .WhereIf(!filter.IsNullOrWhiteSpace(), x => + x.Code.Contains(filter) || x.Description.Contains(filter) || + x.DisplayName.Contains(filter) || x.Name.Contains(filter)) + .OrderBy(sorting) + .PageBy(skipCount, maxResultCount) + .ToListAsync(GetCancellationToken(cancellationToken)); + } - [System.Obsolete("将在abp框架移除之后删除")] - public override IQueryable WithDetails() - { - return GetQueryable().IncludeDetails(); - } + public override async Task> WithDetailsAsync() + { + return (await GetQueryableAsync()).IncludeDetails(); + } + + [System.Obsolete("将在abp框架移除之后删除")] + public override IQueryable WithDetails() + { + return GetQueryable().IncludeDetails(); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/IPlatformDbContext.cs b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/IPlatformDbContext.cs index 4684c49b1..a18908cef 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/IPlatformDbContext.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/IPlatformDbContext.cs @@ -7,20 +7,19 @@ using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; -namespace LINGYUN.Platform.EntityFrameworkCore +namespace LINGYUN.Platform.EntityFrameworkCore; + +[ConnectionStringName(PlatformDbProperties.ConnectionStringName)] +public interface IPlatformDbContext : IEfCoreDbContext { - [ConnectionStringName(PlatformDbProperties.ConnectionStringName)] - public interface IPlatformDbContext : IEfCoreDbContext - { - DbSet Menus { get; } - DbSet Layouts { get; } - DbSet RoleMenus { get; } - DbSet UserMenus { get; } - DbSet UserFavoriteMenus { get; } - DbSet Datas { get; } - DbSet DataItems { get; } - DbSet Packages { get; } - DbSet PackageBlobs { get; } - DbSet Enterprises { get; } - } + DbSet Menus { get; } + DbSet Layouts { get; } + DbSet RoleMenus { get; } + DbSet UserMenus { get; } + DbSet UserFavoriteMenus { get; } + DbSet Datas { get; } + DbSet DataItems { get; } + DbSet Packages { get; } + DbSet PackageBlobs { get; } + DbSet Enterprises { get; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformDbContext.cs b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformDbContext.cs index 72f504d0d..f8c1eae79 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformDbContext.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformDbContext.cs @@ -7,32 +7,31 @@ using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; -namespace LINGYUN.Platform.EntityFrameworkCore +namespace LINGYUN.Platform.EntityFrameworkCore; + +[ConnectionStringName(PlatformDbProperties.ConnectionStringName)] +public class PlatformDbContext : AbpDbContext, IPlatformDbContext { - [ConnectionStringName(PlatformDbProperties.ConnectionStringName)] - public class PlatformDbContext : AbpDbContext, IPlatformDbContext + public DbSet RoleMenus { get; set; } + public DbSet UserMenus { get; set; } + public DbSet UserFavoriteMenus { get; set; } + public DbSet Menus { get; set; } + public DbSet Layouts { get; set; } + public DbSet Datas { get; set; } + public DbSet DataItems { get; set; } + public DbSet Packages { get; set; } + public DbSet PackageBlobs { get; set; } + public DbSet Enterprises { get; set; } + public PlatformDbContext(DbContextOptions options) + : base(options) { - public DbSet RoleMenus { get; set; } - public DbSet UserMenus { get; set; } - public DbSet UserFavoriteMenus { get; set; } - public DbSet Menus { get; set; } - public DbSet Layouts { get; set; } - public DbSet Datas { get; set; } - public DbSet DataItems { get; set; } - public DbSet Packages { get; set; } - public DbSet PackageBlobs { get; set; } - public DbSet Enterprises { get; set; } - public PlatformDbContext(DbContextOptions options) - : base(options) - { - } + } - protected override void OnModelCreating(ModelBuilder builder) - { - base.OnModelCreating(builder); + protected override void OnModelCreating(ModelBuilder builder) + { + base.OnModelCreating(builder); - builder.ConfigurePlatform(); - } + builder.ConfigurePlatform(); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformDbContextModelBuilderExtensions.cs b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformDbContextModelBuilderExtensions.cs index 8c28a54de..681fbd44a 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformDbContextModelBuilderExtensions.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformDbContextModelBuilderExtensions.cs @@ -10,332 +10,330 @@ using System; using Volo.Abp; using Volo.Abp.EntityFrameworkCore.Modeling; -using static System.Runtime.CompilerServices.RuntimeHelpers; -namespace LINGYUN.Platform.EntityFrameworkCore +namespace LINGYUN.Platform.EntityFrameworkCore; + +public static class PlatformDbContextModelBuilderExtensions { - public static class PlatformDbContextModelBuilderExtensions + public static void ConfigurePlatform( + this ModelBuilder builder, + Action optionsAction = null) { - public static void ConfigurePlatform( - this ModelBuilder builder, - Action optionsAction = null) + Check.NotNull(builder, nameof(builder)); + + var options = new PlatformModelBuilderConfigurationOptions( + PlatformDbProperties.DbTablePrefix, + PlatformDbProperties.DbSchema + ); + + optionsAction?.Invoke(options); + + builder.Entity(b => { - Check.NotNull(builder, nameof(builder)); - - var options = new PlatformModelBuilderConfigurationOptions( - PlatformDbProperties.DbTablePrefix, - PlatformDbProperties.DbSchema - ); - - optionsAction?.Invoke(options); - - builder.Entity(b => - { - b.ToTable(options.TablePrefix + "Layouts", options.Schema); - - b.Property(p => p.Framework) - .HasMaxLength(LayoutConsts.MaxFrameworkLength) - .HasColumnName(nameof(Layout.Framework)) - .IsRequired(); - - b.ConfigureRoute(); - }); - - builder.Entity(b => - { - b.ToTable(options.TablePrefix + "Menus", options.Schema); - - b.ConfigureRoute(); - - b.Property(p => p.Framework) - .HasMaxLength(LayoutConsts.MaxFrameworkLength) - .HasColumnName(nameof(Menu.Framework)) - .IsRequired(); - b.Property(p => p.Component) - .HasMaxLength(MenuConsts.MaxComponentLength) - .HasColumnName(nameof(Menu.Component)) - .IsRequired(); - b.Property(p => p.Code) - .HasMaxLength(MenuConsts.MaxCodeLength) - .HasColumnName(nameof(Menu.Code)) - .IsRequired(); - }); - - builder.Entity(x => - { - x.ToTable(options.TablePrefix + "RoleMenus"); - - x.Property(p => p.RoleName) - .IsRequired() - .HasMaxLength(RoleRouteConsts.MaxRoleNameLength) - .HasColumnName(nameof(RoleMenu.RoleName)); - - x.ConfigureByConvention(); - - x.HasIndex(i => new { i.RoleName, i.MenuId }); - }); - - builder.Entity(x => - { - x.ToTable(options.TablePrefix + "UserMenus"); - - x.ConfigureByConvention(); - - x.HasIndex(i => new { i.UserId, i.MenuId }); - }); - - builder.Entity(x => - { - x.ToTable(options.TablePrefix + "UserFavoriteMenus"); - - x.Property(p => p.Framework) - .HasMaxLength(LayoutConsts.MaxFrameworkLength) - .HasColumnName(nameof(Menu.Framework)) - .IsRequired(); - x.Property(p => p.DisplayName) - .HasMaxLength(RouteConsts.MaxDisplayNameLength) - .HasColumnName(nameof(Route.DisplayName)) - .IsRequired(); - x.Property(p => p.Name) - .HasMaxLength(RouteConsts.MaxNameLength) - .HasColumnName(nameof(Route.Name)) - .IsRequired(); - x.Property(p => p.Path) - .HasMaxLength(RouteConsts.MaxPathLength) - .HasColumnName(nameof(Route.Path)) - .IsRequired(); - - x.Property(p => p.Icon) - .HasMaxLength(UserFavoriteMenuConsts.MaxIconLength) - .HasColumnName(nameof(UserFavoriteMenu.Icon)); - x.Property(p => p.Color) - .HasMaxLength(UserFavoriteMenuConsts.MaxColorLength) - .HasColumnName(nameof(UserFavoriteMenu.Color)); - x.Property(p => p.AliasName) - .HasMaxLength(UserFavoriteMenuConsts.MaxAliasNameLength) - .HasColumnName(nameof(UserFavoriteMenu.AliasName)); - - x.ConfigureByConvention(); - - x.HasIndex(i => new { i.UserId, i.MenuId }); - }); - - builder.Entity(x => - { - x.ToTable(options.TablePrefix + "Datas"); - - x.Property(p => p.Code) - .HasMaxLength(DataConsts.MaxCodeLength) - .HasColumnName(nameof(Data.Code)) - .IsRequired(); - x.Property(p => p.Name) - .HasMaxLength(DataConsts.MaxNameLength) - .HasColumnName(nameof(Data.Name)) - .IsRequired(); - x.Property(p => p.DisplayName) - .HasMaxLength(DataConsts.MaxDisplayNameLength) - .HasColumnName(nameof(Data.DisplayName)) - .IsRequired(); - x.Property(p => p.Description) - .HasMaxLength(DataConsts.MaxDescriptionLength) - .HasColumnName(nameof(Data.Description)); - - x.ConfigureByConvention(); - - x.HasMany(p => p.Items) - .WithOne() - .HasForeignKey(fk => fk.DataId) - .IsRequired(); - - x.HasIndex(i => new { i.Name }); - }); - - builder.Entity(x => - { - x.ToTable(options.TablePrefix + "DataItems"); - - x.Property(p => p.DefaultValue) - .HasMaxLength(DataItemConsts.MaxValueLength) - .HasColumnName(nameof(DataItem.DefaultValue)); - x.Property(p => p.Name) - .HasMaxLength(DataItemConsts.MaxNameLength) - .HasColumnName(nameof(DataItem.Name)) - .IsRequired(); - x.Property(p => p.DisplayName) - .HasMaxLength(DataItemConsts.MaxDisplayNameLength) - .HasColumnName(nameof(DataItem.DisplayName)) - .IsRequired(); - x.Property(p => p.Description) - .HasMaxLength(DataItemConsts.MaxDescriptionLength) - .HasColumnName(nameof(DataItem.Description)); - - x.Property(p => p.AllowBeNull).HasDefaultValue(true); - - x.ConfigureByConvention(); - - x.HasIndex(i => new { i.Name }); - }); - - builder.Entity(x => - { - x.ToTable(options.TablePrefix + "Packages", options.Schema); - - x.Property(p => p.Name) - .IsRequired() - .HasColumnName(nameof(Package.Name)) - .HasMaxLength(PackageConsts.MaxNameLength); - x.Property(p => p.Note) - .IsRequired() - .HasColumnName(nameof(Package.Note)) - .HasMaxLength(PackageConsts.MaxNoteLength); - x.Property(p => p.Version) - .IsRequired() - .HasColumnName(nameof(Package.Version)) - .HasMaxLength(PackageConsts.MaxVersionLength); - - x.Property(p => p.Description) - .HasColumnName(nameof(Package.Description)) - .HasMaxLength(PackageConsts.MaxDescriptionLength); - x.Property(p => p.Authors) - .HasColumnName(nameof(Package.Authors)) - .HasMaxLength(PackageConsts.MaxAuthorsLength); - - x.ConfigureByConvention(); - - x.HasIndex(i => new { i.Name, i.Version }); - - x.HasMany(p => p.Blobs) - .WithOne(q => q.Package) - .HasPrincipalKey(pk => pk.Id) - .HasForeignKey(fk => fk.PackageId) - .OnDelete(DeleteBehavior.Cascade); - }); - - builder.Entity(x => - { - x.ToTable(options.TablePrefix + "PackageBlobs", options.Schema); - - x.Property(p => p.Name) - .IsRequired() - .HasColumnName(nameof(PackageBlob.Name)) - .HasMaxLength(PackageBlobConsts.MaxNameLength); - - x.Property(p => p.SHA256) - .HasColumnName(nameof(PackageBlob.SHA256)) - .HasMaxLength(PackageBlobConsts.MaxSHA256Length); - x.Property(p => p.Url) - .HasColumnName(nameof(PackageBlob.Url)) - .HasMaxLength(PackageBlobConsts.MaxUrlLength); - x.Property(p => p.Summary) - .HasColumnName(nameof(PackageBlob.Summary)) - .HasMaxLength(PackageBlobConsts.MaxSummaryLength); - x.Property(p => p.Authors) - .HasColumnName(nameof(PackageBlob.Authors)) - .HasMaxLength(PackageBlobConsts.MaxAuthorsLength); - x.Property(p => p.License) - .HasColumnName(nameof(PackageBlob.License)) - .HasMaxLength(PackageBlobConsts.MaxLicenseLength); - x.Property(p => p.ContentType) - .HasColumnName(nameof(PackageBlob.ContentType)) - .HasMaxLength(PackageBlobConsts.MaxContentTypeLength); - - x.ConfigureByConvention(); - - x.HasIndex(i => new { i.PackageId, i.Name }); - }); - - builder.Entity(x => - { - x.ToTable(options.TablePrefix + "Enterprises", options.Schema); - - x.Property(p => p.Name) - .IsRequired() - .HasColumnName(nameof(Enterprise.Name)) - .HasMaxLength(EnterpriseConsts.MaxNameLength); - - x.Property(p => p.EnglishName) - .HasColumnName(nameof(Enterprise.EnglishName)) - .HasMaxLength(EnterpriseConsts.MaxEnglishNameLength); - x.Property(p => p.Address) - .HasColumnName(nameof(Enterprise.Address)) - .HasMaxLength(EnterpriseConsts.MaxAddressLength); - x.Property(p => p.Logo) - .HasColumnName(nameof(Enterprise.Logo)) - .HasMaxLength(EnterpriseConsts.MaxLogoLength); - x.Property(p => p.LegalMan) - .HasColumnName(nameof(Enterprise.LegalMan)) - .HasMaxLength(EnterpriseConsts.MaxLegalManLength); - x.Property(p => p.TaxCode) - .HasColumnName(nameof(Enterprise.TaxCode)) - .HasMaxLength(EnterpriseConsts.MaxTaxCodeLength); - x.Property(p => p.OrganizationCode) - .HasColumnName(nameof(Enterprise.OrganizationCode)) - .HasMaxLength(EnterpriseConsts.MaxOrganizationCodeLength); - x.Property(p => p.RegistrationCode) - .HasColumnName(nameof(Enterprise.RegistrationCode)) - .HasMaxLength(EnterpriseConsts.MaxRegistrationCodeLength); - - x.ConfigureByConvention(); - }); - } - - public static EntityTypeBuilder ConfigureRoute( - this EntityTypeBuilder builder) - where TRoute : Route + b.ToTable(options.TablePrefix + "Layouts", options.Schema); + + b.Property(p => p.Framework) + .HasMaxLength(LayoutConsts.MaxFrameworkLength) + .HasColumnName(nameof(Layout.Framework)) + .IsRequired(); + + b.ConfigureRoute(); + }); + + builder.Entity(b => { - builder - .Property(p => p.DisplayName) - .HasMaxLength(RouteConsts.MaxDisplayNameLength) - .HasColumnName(nameof(Route.DisplayName)) + b.ToTable(options.TablePrefix + "Menus", options.Schema); + + b.ConfigureRoute(); + + b.Property(p => p.Framework) + .HasMaxLength(LayoutConsts.MaxFrameworkLength) + .HasColumnName(nameof(Menu.Framework)) .IsRequired(); - builder - .Property(p => p.Name) - .HasMaxLength(RouteConsts.MaxNameLength) - .HasColumnName(nameof(Route.Name)) + b.Property(p => p.Component) + .HasMaxLength(MenuConsts.MaxComponentLength) + .HasColumnName(nameof(Menu.Component)) .IsRequired(); - builder - .Property(p => p.Path) - .HasMaxLength(RouteConsts.MaxPathLength) - .HasColumnName(nameof(Route.Path)); - builder - .Property(p => p.Redirect) - .HasMaxLength(RouteConsts.MaxRedirectLength) - .HasColumnName(nameof(Route.Redirect)); - - builder.ConfigureByConvention(); - - return builder; - } - - public static OwnedNavigationBuilder ConfigureRoute( - [NotNull] this OwnedNavigationBuilder builder, - [CanBeNull] string tablePrefix = "", - [CanBeNull] string schema = null) - where TEntity : class - where TRoute : Route + b.Property(p => p.Code) + .HasMaxLength(MenuConsts.MaxCodeLength) + .HasColumnName(nameof(Menu.Code)) + .IsRequired(); + }); + + builder.Entity(x => { - builder.ToTable(tablePrefix + "Routes", schema); + x.ToTable(options.TablePrefix + "RoleMenus"); + + x.Property(p => p.RoleName) + .IsRequired() + .HasMaxLength(RoleRouteConsts.MaxRoleNameLength) + .HasColumnName(nameof(RoleMenu.RoleName)); - builder - .Property(p => p.DisplayName) + x.ConfigureByConvention(); + + x.HasIndex(i => new { i.RoleName, i.MenuId }); + }); + + builder.Entity(x => + { + x.ToTable(options.TablePrefix + "UserMenus"); + + x.ConfigureByConvention(); + + x.HasIndex(i => new { i.UserId, i.MenuId }); + }); + + builder.Entity(x => + { + x.ToTable(options.TablePrefix + "UserFavoriteMenus"); + + x.Property(p => p.Framework) + .HasMaxLength(LayoutConsts.MaxFrameworkLength) + .HasColumnName(nameof(Menu.Framework)) + .IsRequired(); + x.Property(p => p.DisplayName) .HasMaxLength(RouteConsts.MaxDisplayNameLength) .HasColumnName(nameof(Route.DisplayName)) .IsRequired(); - builder - .Property(p => p.Name) + x.Property(p => p.Name) .HasMaxLength(RouteConsts.MaxNameLength) .HasColumnName(nameof(Route.Name)) .IsRequired(); - builder - .Property(p => p.Path) + x.Property(p => p.Path) .HasMaxLength(RouteConsts.MaxPathLength) - .HasColumnName(nameof(Route.Path)); - builder - .Property(p => p.Redirect) - .HasMaxLength(RouteConsts.MaxRedirectLength) - .HasColumnName(nameof(Route.Redirect)); - - return builder; - } + .HasColumnName(nameof(Route.Path)) + .IsRequired(); + + x.Property(p => p.Icon) + .HasMaxLength(UserFavoriteMenuConsts.MaxIconLength) + .HasColumnName(nameof(UserFavoriteMenu.Icon)); + x.Property(p => p.Color) + .HasMaxLength(UserFavoriteMenuConsts.MaxColorLength) + .HasColumnName(nameof(UserFavoriteMenu.Color)); + x.Property(p => p.AliasName) + .HasMaxLength(UserFavoriteMenuConsts.MaxAliasNameLength) + .HasColumnName(nameof(UserFavoriteMenu.AliasName)); + + x.ConfigureByConvention(); + + x.HasIndex(i => new { i.UserId, i.MenuId }); + }); + + builder.Entity(x => + { + x.ToTable(options.TablePrefix + "Datas"); + + x.Property(p => p.Code) + .HasMaxLength(DataConsts.MaxCodeLength) + .HasColumnName(nameof(Data.Code)) + .IsRequired(); + x.Property(p => p.Name) + .HasMaxLength(DataConsts.MaxNameLength) + .HasColumnName(nameof(Data.Name)) + .IsRequired(); + x.Property(p => p.DisplayName) + .HasMaxLength(DataConsts.MaxDisplayNameLength) + .HasColumnName(nameof(Data.DisplayName)) + .IsRequired(); + x.Property(p => p.Description) + .HasMaxLength(DataConsts.MaxDescriptionLength) + .HasColumnName(nameof(Data.Description)); + + x.ConfigureByConvention(); + + x.HasMany(p => p.Items) + .WithOne() + .HasForeignKey(fk => fk.DataId) + .IsRequired(); + + x.HasIndex(i => new { i.Name }); + }); + + builder.Entity(x => + { + x.ToTable(options.TablePrefix + "DataItems"); + + x.Property(p => p.DefaultValue) + .HasMaxLength(DataItemConsts.MaxValueLength) + .HasColumnName(nameof(DataItem.DefaultValue)); + x.Property(p => p.Name) + .HasMaxLength(DataItemConsts.MaxNameLength) + .HasColumnName(nameof(DataItem.Name)) + .IsRequired(); + x.Property(p => p.DisplayName) + .HasMaxLength(DataItemConsts.MaxDisplayNameLength) + .HasColumnName(nameof(DataItem.DisplayName)) + .IsRequired(); + x.Property(p => p.Description) + .HasMaxLength(DataItemConsts.MaxDescriptionLength) + .HasColumnName(nameof(DataItem.Description)); + + x.Property(p => p.AllowBeNull).HasDefaultValue(true); + + x.ConfigureByConvention(); + + x.HasIndex(i => new { i.Name }); + }); + + builder.Entity(x => + { + x.ToTable(options.TablePrefix + "Packages", options.Schema); + + x.Property(p => p.Name) + .IsRequired() + .HasColumnName(nameof(Package.Name)) + .HasMaxLength(PackageConsts.MaxNameLength); + x.Property(p => p.Note) + .IsRequired() + .HasColumnName(nameof(Package.Note)) + .HasMaxLength(PackageConsts.MaxNoteLength); + x.Property(p => p.Version) + .IsRequired() + .HasColumnName(nameof(Package.Version)) + .HasMaxLength(PackageConsts.MaxVersionLength); + + x.Property(p => p.Description) + .HasColumnName(nameof(Package.Description)) + .HasMaxLength(PackageConsts.MaxDescriptionLength); + x.Property(p => p.Authors) + .HasColumnName(nameof(Package.Authors)) + .HasMaxLength(PackageConsts.MaxAuthorsLength); + + x.ConfigureByConvention(); + + x.HasIndex(i => new { i.Name, i.Version }); + + x.HasMany(p => p.Blobs) + .WithOne(q => q.Package) + .HasPrincipalKey(pk => pk.Id) + .HasForeignKey(fk => fk.PackageId) + .OnDelete(DeleteBehavior.Cascade); + }); + + builder.Entity(x => + { + x.ToTable(options.TablePrefix + "PackageBlobs", options.Schema); + + x.Property(p => p.Name) + .IsRequired() + .HasColumnName(nameof(PackageBlob.Name)) + .HasMaxLength(PackageBlobConsts.MaxNameLength); + + x.Property(p => p.SHA256) + .HasColumnName(nameof(PackageBlob.SHA256)) + .HasMaxLength(PackageBlobConsts.MaxSHA256Length); + x.Property(p => p.Url) + .HasColumnName(nameof(PackageBlob.Url)) + .HasMaxLength(PackageBlobConsts.MaxUrlLength); + x.Property(p => p.Summary) + .HasColumnName(nameof(PackageBlob.Summary)) + .HasMaxLength(PackageBlobConsts.MaxSummaryLength); + x.Property(p => p.Authors) + .HasColumnName(nameof(PackageBlob.Authors)) + .HasMaxLength(PackageBlobConsts.MaxAuthorsLength); + x.Property(p => p.License) + .HasColumnName(nameof(PackageBlob.License)) + .HasMaxLength(PackageBlobConsts.MaxLicenseLength); + x.Property(p => p.ContentType) + .HasColumnName(nameof(PackageBlob.ContentType)) + .HasMaxLength(PackageBlobConsts.MaxContentTypeLength); + + x.ConfigureByConvention(); + + x.HasIndex(i => new { i.PackageId, i.Name }); + }); + + builder.Entity(x => + { + x.ToTable(options.TablePrefix + "Enterprises", options.Schema); + + x.Property(p => p.Name) + .IsRequired() + .HasColumnName(nameof(Enterprise.Name)) + .HasMaxLength(EnterpriseConsts.MaxNameLength); + + x.Property(p => p.EnglishName) + .HasColumnName(nameof(Enterprise.EnglishName)) + .HasMaxLength(EnterpriseConsts.MaxEnglishNameLength); + x.Property(p => p.Address) + .HasColumnName(nameof(Enterprise.Address)) + .HasMaxLength(EnterpriseConsts.MaxAddressLength); + x.Property(p => p.Logo) + .HasColumnName(nameof(Enterprise.Logo)) + .HasMaxLength(EnterpriseConsts.MaxLogoLength); + x.Property(p => p.LegalMan) + .HasColumnName(nameof(Enterprise.LegalMan)) + .HasMaxLength(EnterpriseConsts.MaxLegalManLength); + x.Property(p => p.TaxCode) + .HasColumnName(nameof(Enterprise.TaxCode)) + .HasMaxLength(EnterpriseConsts.MaxTaxCodeLength); + x.Property(p => p.OrganizationCode) + .HasColumnName(nameof(Enterprise.OrganizationCode)) + .HasMaxLength(EnterpriseConsts.MaxOrganizationCodeLength); + x.Property(p => p.RegistrationCode) + .HasColumnName(nameof(Enterprise.RegistrationCode)) + .HasMaxLength(EnterpriseConsts.MaxRegistrationCodeLength); + + x.ConfigureByConvention(); + }); + } + + public static EntityTypeBuilder ConfigureRoute( + this EntityTypeBuilder builder) + where TRoute : Route + { + builder + .Property(p => p.DisplayName) + .HasMaxLength(RouteConsts.MaxDisplayNameLength) + .HasColumnName(nameof(Route.DisplayName)) + .IsRequired(); + builder + .Property(p => p.Name) + .HasMaxLength(RouteConsts.MaxNameLength) + .HasColumnName(nameof(Route.Name)) + .IsRequired(); + builder + .Property(p => p.Path) + .HasMaxLength(RouteConsts.MaxPathLength) + .HasColumnName(nameof(Route.Path)); + builder + .Property(p => p.Redirect) + .HasMaxLength(RouteConsts.MaxRedirectLength) + .HasColumnName(nameof(Route.Redirect)); + + builder.ConfigureByConvention(); + + return builder; + } + + public static OwnedNavigationBuilder ConfigureRoute( + [NotNull] this OwnedNavigationBuilder builder, + [CanBeNull] string tablePrefix = "", + [CanBeNull] string schema = null) + where TEntity : class + where TRoute : Route + { + builder.ToTable(tablePrefix + "Routes", schema); + + builder + .Property(p => p.DisplayName) + .HasMaxLength(RouteConsts.MaxDisplayNameLength) + .HasColumnName(nameof(Route.DisplayName)) + .IsRequired(); + builder + .Property(p => p.Name) + .HasMaxLength(RouteConsts.MaxNameLength) + .HasColumnName(nameof(Route.Name)) + .IsRequired(); + builder + .Property(p => p.Path) + .HasMaxLength(RouteConsts.MaxPathLength) + .HasColumnName(nameof(Route.Path)); + builder + .Property(p => p.Redirect) + .HasMaxLength(RouteConsts.MaxRedirectLength) + .HasColumnName(nameof(Route.Redirect)); + + return builder; } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformEfCoreQueryableExtensions.cs b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformEfCoreQueryableExtensions.cs index a0114b3f9..d232de167 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformEfCoreQueryableExtensions.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformEfCoreQueryableExtensions.cs @@ -5,53 +5,52 @@ using Microsoft.EntityFrameworkCore; using System.Linq; -namespace LINGYUN.Platform.EntityFrameworkCore +namespace LINGYUN.Platform.EntityFrameworkCore; + +public static class PlatformEfCoreQueryableExtensions { - public static class PlatformEfCoreQueryableExtensions - { - public static IQueryable IncludeDetails(this IQueryable queryable, bool include = true) + public static IQueryable IncludeDetails(this IQueryable queryable, bool include = true) + { + if (!include) { - if (!include) - { - return queryable; - } - return queryable; } - public static IQueryable IncludeDetails(this IQueryable queryable, bool include = true) - { - if (!include) - { - return queryable; - } + return queryable; + } + public static IQueryable IncludeDetails(this IQueryable queryable, bool include = true) + { + if (!include) + { return queryable; } - public static IQueryable IncludeDetails(this IQueryable queryable, bool include = true) + return queryable; + } + + public static IQueryable IncludeDetails(this IQueryable queryable, bool include = true) + { + if (!include) { - if (!include) - { - return queryable; - } - - return queryable - .AsSplitQuery() - .Include(x => x.Items); + return queryable; } - public static IQueryable IncludeDetails(this IQueryable queryable, bool include = true) + return queryable + .AsSplitQuery() + .Include(x => x.Items); + } + + public static IQueryable IncludeDetails(this IQueryable queryable, bool include = true) + { + if (!include) { - if (!include) - { - return queryable; - } - - return queryable - .AsSplitQuery() - .Include(x => x.Blobs); + return queryable; } + + return queryable + .AsSplitQuery() + .Include(x => x.Blobs); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformEntityFrameworkCoreModule.cs b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformEntityFrameworkCoreModule.cs index ec0307a11..7d0b4269f 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformEntityFrameworkCoreModule.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformEntityFrameworkCoreModule.cs @@ -7,28 +7,27 @@ using Volo.Abp.EntityFrameworkCore; using Volo.Abp.Modularity; -namespace LINGYUN.Platform.EntityFrameworkCore +namespace LINGYUN.Platform.EntityFrameworkCore; + +[DependsOn( + typeof(PlatformDomainModule), + typeof(AbpEntityFrameworkCoreModule))] +public class PlatformEntityFrameworkCoreModule : AbpModule { - [DependsOn( - typeof(PlatformDomainModule), - typeof(AbpEntityFrameworkCoreModule))] - public class PlatformEntityFrameworkCoreModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + context.Services.AddAbpDbContext(options => { - context.Services.AddAbpDbContext(options => - { - options.AddRepository(); - options.AddRepository(); - options.AddRepository(); - options.AddRepository(); - options.AddRepository(); - options.AddRepository(); - options.AddRepository(); - options.AddRepository(); + options.AddRepository(); + options.AddRepository(); + options.AddRepository(); + options.AddRepository(); + options.AddRepository(); + options.AddRepository(); + options.AddRepository(); + options.AddRepository(); - options.AddDefaultRepositories(includeAllEntities: true); - }); - } + options.AddDefaultRepositories(includeAllEntities: true); + }); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformModelBuilderConfigurationOptions.cs b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformModelBuilderConfigurationOptions.cs index 260ea5b4f..74cd0684c 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformModelBuilderConfigurationOptions.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformModelBuilderConfigurationOptions.cs @@ -1,18 +1,17 @@ using JetBrains.Annotations; using Volo.Abp.EntityFrameworkCore.Modeling; -namespace LINGYUN.Platform.EntityFrameworkCore +namespace LINGYUN.Platform.EntityFrameworkCore; + +public class PlatformModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions { - public class PlatformModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions + public PlatformModelBuilderConfigurationOptions( + [NotNull] string tablePrefix = "", + [CanBeNull] string schema = null) + : base( + tablePrefix, + schema) { - public PlatformModelBuilderConfigurationOptions( - [NotNull] string tablePrefix = "", - [CanBeNull] string schema = null) - : base( - tablePrefix, - schema) - { - } } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Layouts/EfCoreLayoutRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Layouts/EfCoreLayoutRepository.cs index 233a08c25..dd0cdb1c9 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Layouts/EfCoreLayoutRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Layouts/EfCoreLayoutRepository.cs @@ -9,73 +9,72 @@ using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; -namespace LINGYUN.Platform.Layouts +namespace LINGYUN.Platform.Layouts; + +public class EfCoreLayoutRepository : EfCoreRepository, ILayoutRepository { - public class EfCoreLayoutRepository : EfCoreRepository, ILayoutRepository + public EfCoreLayoutRepository(IDbContextProvider dbContextProvider) + : base(dbContextProvider) { - public EfCoreLayoutRepository(IDbContextProvider dbContextProvider) - : base(dbContextProvider) - { - } + } - public async virtual Task FindByNameAsync( - string name, - bool includeDetails = false, - CancellationToken cancellationToken = default) - { - return await (await GetDbSetAsync()) - .IncludeDetails(includeDetails) - .Where(x => x.Name == name) - .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task FindByNameAsync( + string name, + bool includeDetails = false, + CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()) + .IncludeDetails(includeDetails) + .Where(x => x.Name == name) + .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task GetCountAsync( - string framework = "", - string filter = "", - CancellationToken cancellationToken = default) - { - return await (await GetDbSetAsync()) - .WhereIf(!framework.IsNullOrWhiteSpace(), x => x.Framework.Equals(framework)) - .WhereIf(!filter.IsNullOrWhiteSpace(), x => - x.Name.Contains(filter) || x.DisplayName.Contains(filter) || - x.Description.Contains(filter) || x.Redirect.Contains(filter)) - .CountAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task GetCountAsync( + string framework = "", + string filter = "", + CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()) + .WhereIf(!framework.IsNullOrWhiteSpace(), x => x.Framework.Equals(framework)) + .WhereIf(!filter.IsNullOrWhiteSpace(), x => + x.Name.Contains(filter) || x.DisplayName.Contains(filter) || + x.Description.Contains(filter) || x.Redirect.Contains(filter)) + .CountAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task> GetPagedListAsync( - string framework = "", - string filter = "", - string sorting = nameof(Layout.Name), - bool includeDetails = false, - int skipCount = 0, - int maxResultCount = 10, - CancellationToken cancellationToken = default) + public async virtual Task> GetPagedListAsync( + string framework = "", + string filter = "", + string sorting = nameof(Layout.Name), + bool includeDetails = false, + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default) + { + if (sorting.IsNullOrWhiteSpace()) { - if (sorting.IsNullOrWhiteSpace()) - { - sorting = nameof(Layout.Name); - } - - return await (await GetDbSetAsync()) - .IncludeDetails(includeDetails) - .WhereIf(!framework.IsNullOrWhiteSpace(), x => x.Framework.Equals(framework)) - .WhereIf(!filter.IsNullOrWhiteSpace(), x => - x.Name.Contains(filter) || x.DisplayName.Contains(filter) || - x.Description.Contains(filter) || x.Redirect.Contains(filter)) - .OrderBy(sorting) - .PageBy(skipCount, maxResultCount) - .ToListAsync(GetCancellationToken(cancellationToken)); + sorting = nameof(Layout.Name); } - public override async Task> WithDetailsAsync() - { - return (await GetQueryableAsync()).IncludeDetails(); - } + return await (await GetDbSetAsync()) + .IncludeDetails(includeDetails) + .WhereIf(!framework.IsNullOrWhiteSpace(), x => x.Framework.Equals(framework)) + .WhereIf(!filter.IsNullOrWhiteSpace(), x => + x.Name.Contains(filter) || x.DisplayName.Contains(filter) || + x.Description.Contains(filter) || x.Redirect.Contains(filter)) + .OrderBy(sorting) + .PageBy(skipCount, maxResultCount) + .ToListAsync(GetCancellationToken(cancellationToken)); + } - [System.Obsolete("将在abp框架移除之后删除")] - public override IQueryable WithDetails() - { - return GetQueryable().IncludeDetails(); - } + public override async Task> WithDetailsAsync() + { + return (await GetQueryableAsync()).IncludeDetails(); + } + + [System.Obsolete("将在abp框架移除之后删除")] + public override IQueryable WithDetails() + { + return GetQueryable().IncludeDetails(); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreMenuRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreMenuRepository.cs index 3838c0a20..f88d7ec7f 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreMenuRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreMenuRepository.cs @@ -9,265 +9,264 @@ using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; -namespace LINGYUN.Platform.Menus +namespace LINGYUN.Platform.Menus; + +public class EfCoreMenuRepository : EfCoreRepository, IMenuRepository { - public class EfCoreMenuRepository : EfCoreRepository, IMenuRepository + public EfCoreMenuRepository( + IDbContextProvider dbContextProvider) + : base(dbContextProvider) { - public EfCoreMenuRepository( - IDbContextProvider dbContextProvider) - : base(dbContextProvider) - { - } - - public async virtual Task> GetListAsync( - IEnumerable idList, - CancellationToken cancellationToken = default) - { - return await (await GetDbSetAsync()) - .Where(x => idList.Contains(x.Id)) - .ToListAsync(GetCancellationToken(cancellationToken)); - } + } - public async virtual Task GetLastMenuAsync( - Guid? parentId = null, - CancellationToken cancellationToken = default) - { - return await (await GetDbSetAsync()) - .Where(x => x.ParentId == parentId) - .OrderByDescending(x => x.CreationTime) - .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task> GetListAsync( + IEnumerable idList, + CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()) + .Where(x => idList.Contains(x.Id)) + .ToListAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task UserHasInMenuAsync( - Guid userId, - string menuName, - CancellationToken cancellationToken = default) - { - var menuQuery = (await GetDbSetAsync()).Where(x => x.Name == menuName); + public async virtual Task GetLastMenuAsync( + Guid? parentId = null, + CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()) + .Where(x => x.ParentId == parentId) + .OrderByDescending(x => x.CreationTime) + .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); + } - return await (from menu in menuQuery - join userMenu in (await GetDbContextAsync()).Set() - on menu.Id equals userMenu.MenuId - select userMenu) - .AnyAsync(x => x.UserId == userId, GetCancellationToken(cancellationToken)); - } + public async virtual Task UserHasInMenuAsync( + Guid userId, + string menuName, + CancellationToken cancellationToken = default) + { + var menuQuery = (await GetDbSetAsync()).Where(x => x.Name == menuName); - public async virtual Task RoleHasInMenuAsync( - string roleName, - string menuName, - CancellationToken cancellationToken = default) - { - var menuQuery = (await GetDbSetAsync()).Where(x => x.Name == menuName); + return await (from menu in menuQuery + join userMenu in (await GetDbContextAsync()).Set() + on menu.Id equals userMenu.MenuId + select userMenu) + .AnyAsync(x => x.UserId == userId, GetCancellationToken(cancellationToken)); + } - return await (from menu in menuQuery - join roleMenu in (await GetDbContextAsync()).Set() - on menu.Id equals roleMenu.MenuId - select roleMenu) - .AnyAsync(x => x.RoleName == roleName, GetCancellationToken(cancellationToken)); - } + public async virtual Task RoleHasInMenuAsync( + string roleName, + string menuName, + CancellationToken cancellationToken = default) + { + var menuQuery = (await GetDbSetAsync()).Where(x => x.Name == menuName); - public async virtual Task FindByNameAsync( - string menuName, - CancellationToken cancellationToken = default) - { - return await (await GetDbSetAsync()) - .Where(x => x.Name == menuName) - .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); - } + return await (from menu in menuQuery + join roleMenu in (await GetDbContextAsync()).Set() + on menu.Id equals roleMenu.MenuId + select roleMenu) + .AnyAsync(x => x.RoleName == roleName, GetCancellationToken(cancellationToken)); + } - public async virtual Task FindMainAsync( - string framework = "", - CancellationToken cancellationToken = default) - { - return await (await GetDbSetAsync()) - .Where(menu => menu.Framework.Equals(framework) && menu.Path == "/") - .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task FindByNameAsync( + string menuName, + CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()) + .Where(x => x.Name == menuName) + .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task> GetRoleMenusAsync( - string[] roles, - string framework = "", - CancellationToken cancellationToken = default) - { - var menuQuery = (await GetDbSetAsync()) - .Where(menu => menu.Framework.Equals(framework)); + public async virtual Task FindMainAsync( + string framework = "", + CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()) + .Where(menu => menu.Framework.Equals(framework) && menu.Path == "/") + .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); + } - var roleMenuQuery = (await GetDbContextAsync()).Set() - .Where(menu => roles.Contains(menu.RoleName)); + public async virtual Task> GetRoleMenusAsync( + string[] roles, + string framework = "", + CancellationToken cancellationToken = default) + { + var menuQuery = (await GetDbSetAsync()) + .Where(menu => menu.Framework.Equals(framework)); - return await (from menu in menuQuery - join roleMenu in roleMenuQuery - on menu.Id equals roleMenu.MenuId - select menu) - .Union(menuQuery.Where(x => x.IsPublic)) - .Distinct() - .ToListAsync(GetCancellationToken(cancellationToken)); - } + var roleMenuQuery = (await GetDbContextAsync()).Set() + .Where(menu => roles.Contains(menu.RoleName)); - public async virtual Task> GetUserMenusAsync( - Guid userId, - string[] roles, - string framework = "", - CancellationToken cancellationToken = default) - { - var menuQuery = (await GetDbSetAsync()) - .Where(menu => menu.Framework.Equals(framework)); + return await (from menu in menuQuery + join roleMenu in roleMenuQuery + on menu.Id equals roleMenu.MenuId + select menu) + .Union(menuQuery.Where(x => x.IsPublic)) + .Distinct() + .ToListAsync(GetCancellationToken(cancellationToken)); + } - var dbContext = await GetDbContextAsync(); - var userMenuQuery = from userMenu in dbContext.Set() - join menu in menuQuery - on userMenu.MenuId equals menu.Id - where userMenu.UserId == userId - select menu; + public async virtual Task> GetUserMenusAsync( + Guid userId, + string[] roles, + string framework = "", + CancellationToken cancellationToken = default) + { + var menuQuery = (await GetDbSetAsync()) + .Where(menu => menu.Framework.Equals(framework)); - if (roles != null && roles.Length > 0) - { - var roleMenuQuery = from roleMenu in dbContext.Set() - join menu in menuQuery - on roleMenu.MenuId equals menu.Id - where roles.Contains(roleMenu.RoleName) - select menu; ; + var dbContext = await GetDbContextAsync(); + var userMenuQuery = from userMenu in dbContext.Set() + join menu in menuQuery + on userMenu.MenuId equals menu.Id + where userMenu.UserId == userId + select menu; - return await userMenuQuery - .Union(roleMenuQuery) - .Union(menuQuery.Where(x => x.IsPublic)) - .Distinct() - .ToListAsync(GetCancellationToken(cancellationToken)); - } + if (roles != null && roles.Length > 0) + { + var roleMenuQuery = from roleMenu in dbContext.Set() + join menu in menuQuery + on roleMenu.MenuId equals menu.Id + where roles.Contains(roleMenu.RoleName) + select menu; ; return await userMenuQuery - .Union(menuQuery.Where(x => x.IsPublic)) - .Distinct() - .ToListAsync(GetCancellationToken(cancellationToken)); + .Union(roleMenuQuery) + .Union(menuQuery.Where(x => x.IsPublic)) + .Distinct() + .ToListAsync(GetCancellationToken(cancellationToken)); } - public async virtual Task> GetChildrenAsync( - Guid? parentId, - CancellationToken cancellationToken = default - ) - { - return await (await GetDbSetAsync()) - .Where(x => x.ParentId == parentId) + return await userMenuQuery + .Union(menuQuery.Where(x => x.IsPublic)) + .Distinct() .ToListAsync(GetCancellationToken(cancellationToken)); - } + } + + public async virtual Task> GetChildrenAsync( + Guid? parentId, + CancellationToken cancellationToken = default + ) + { + return await (await GetDbSetAsync()) + .Where(x => x.ParentId == parentId) + .ToListAsync(GetCancellationToken(cancellationToken)); + } + + public async virtual Task> GetAllChildrenWithParentCodeAsync( + string code, + Guid? parentId, + CancellationToken cancellationToken = default + ) + { + return await (await GetDbSetAsync()) + .Where(x => x.Code.StartsWith(code) && x.Id != parentId.Value) + .ToListAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task> GetAllChildrenWithParentCodeAsync( - string code, - Guid? parentId, - CancellationToken cancellationToken = default - ) + public async virtual Task> GetAllAsync( + string filter = "", + string sorting = nameof(Menu.Code), + string framework = "", + Guid? parentId = null, + Guid? layoutId = null, + CancellationToken cancellationToken = default) + { + if (sorting.IsNullOrWhiteSpace()) { - return await (await GetDbSetAsync()) - .Where(x => x.Code.StartsWith(code) && x.Id != parentId.Value) - .ToListAsync(GetCancellationToken(cancellationToken)); + sorting = nameof(Menu.Code); } - public async virtual Task> GetAllAsync( - string filter = "", - string sorting = nameof(Menu.Code), - string framework = "", - Guid? parentId = null, - Guid? layoutId = null, - CancellationToken cancellationToken = default) - { - if (sorting.IsNullOrWhiteSpace()) - { - sorting = nameof(Menu.Code); - } + return await (await GetDbSetAsync()) + .WhereIf(parentId.HasValue, x => x.ParentId == parentId) + .WhereIf(layoutId.HasValue, x => x.LayoutId == layoutId) + .WhereIf(!framework.IsNullOrWhiteSpace(), menu => menu.Framework.Equals(framework)) + .WhereIf(!filter.IsNullOrWhiteSpace(), menu => + menu.Path.Contains(filter) || menu.Name.Contains(filter) || + menu.DisplayName.Contains(filter) || menu.Description.Contains(filter) || + menu.Redirect.Contains(filter)) + .OrderBy(sorting) + .ToListAsync(GetCancellationToken(cancellationToken)); + } - return await (await GetDbSetAsync()) - .WhereIf(parentId.HasValue, x => x.ParentId == parentId) - .WhereIf(layoutId.HasValue, x => x.LayoutId == layoutId) - .WhereIf(!framework.IsNullOrWhiteSpace(), menu => menu.Framework.Equals(framework)) - .WhereIf(!filter.IsNullOrWhiteSpace(), menu => - menu.Path.Contains(filter) || menu.Name.Contains(filter) || - menu.DisplayName.Contains(filter) || menu.Description.Contains(filter) || - menu.Redirect.Contains(filter)) - .OrderBy(sorting) - .ToListAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task GetCountAsync( + string filter = "", + string framework = "", + Guid? parentId = null, + Guid? layoutId = null, + CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()) + .WhereIf(parentId.HasValue, x => x.ParentId == parentId) + .WhereIf(layoutId.HasValue, x => x.LayoutId == layoutId) + .WhereIf(!framework.IsNullOrWhiteSpace(), menu => menu.Framework.Equals(framework)) + .WhereIf(!filter.IsNullOrWhiteSpace(), menu => + menu.Path.Contains(filter) || menu.Name.Contains(filter) || + menu.DisplayName.Contains(filter) || menu.Description.Contains(filter) || + menu.Redirect.Contains(filter)) + .CountAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task GetCountAsync( - string filter = "", - string framework = "", - Guid? parentId = null, - Guid? layoutId = null, - CancellationToken cancellationToken = default) + public async virtual Task> GetListAsync( + string filter = "", + string sorting = nameof(Menu.Code), + string framework = "", + Guid? parentId = null, + Guid? layoutId = null, + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default) + { + if (sorting.IsNullOrWhiteSpace()) { - return await (await GetDbSetAsync()) - .WhereIf(parentId.HasValue, x => x.ParentId == parentId) - .WhereIf(layoutId.HasValue, x => x.LayoutId == layoutId) - .WhereIf(!framework.IsNullOrWhiteSpace(), menu => menu.Framework.Equals(framework)) - .WhereIf(!filter.IsNullOrWhiteSpace(), menu => - menu.Path.Contains(filter) || menu.Name.Contains(filter) || - menu.DisplayName.Contains(filter) || menu.Description.Contains(filter) || - menu.Redirect.Contains(filter)) - .CountAsync(GetCancellationToken(cancellationToken)); + sorting = nameof(Menu.Code); } - public async virtual Task> GetListAsync( - string filter = "", - string sorting = nameof(Menu.Code), - string framework = "", - Guid? parentId = null, - Guid? layoutId = null, - int skipCount = 0, - int maxResultCount = 10, - CancellationToken cancellationToken = default) - { - if (sorting.IsNullOrWhiteSpace()) - { - sorting = nameof(Menu.Code); - } - - return await (await GetDbSetAsync()) - .WhereIf(parentId.HasValue, x => x.ParentId == parentId) - .WhereIf(layoutId.HasValue, x => x.LayoutId == layoutId) - .WhereIf(!framework.IsNullOrWhiteSpace(), menu => menu.Framework.Equals(framework)) - .WhereIf(!filter.IsNullOrWhiteSpace(), menu => - menu.Path.Contains(filter) || menu.Name.Contains(filter) || - menu.DisplayName.Contains(filter) || menu.Description.Contains(filter) || - menu.Redirect.Contains(filter)) - .OrderBy(sorting) - .PageBy(skipCount, maxResultCount) - .ToListAsync(GetCancellationToken(cancellationToken)); - } + return await (await GetDbSetAsync()) + .WhereIf(parentId.HasValue, x => x.ParentId == parentId) + .WhereIf(layoutId.HasValue, x => x.LayoutId == layoutId) + .WhereIf(!framework.IsNullOrWhiteSpace(), menu => menu.Framework.Equals(framework)) + .WhereIf(!filter.IsNullOrWhiteSpace(), menu => + menu.Path.Contains(filter) || menu.Name.Contains(filter) || + menu.DisplayName.Contains(filter) || menu.Description.Contains(filter) || + menu.Redirect.Contains(filter)) + .OrderBy(sorting) + .PageBy(skipCount, maxResultCount) + .ToListAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task RemoveAllRolesAsync( - Menu menu, - CancellationToken cancellationToken = default - ) - { - var dbContext = await GetDbContextAsync(); - var rolesQuery = await dbContext.Set() - .Where(q => q.MenuId == menu.Id) - .ToListAsync(GetCancellationToken(cancellationToken)); + public async virtual Task RemoveAllRolesAsync( + Menu menu, + CancellationToken cancellationToken = default + ) + { + var dbContext = await GetDbContextAsync(); + var rolesQuery = await dbContext.Set() + .Where(q => q.MenuId == menu.Id) + .ToListAsync(GetCancellationToken(cancellationToken)); - dbContext.Set().RemoveRange(rolesQuery); - } + dbContext.Set().RemoveRange(rolesQuery); + } - public async virtual Task RemoveAllMembersAsync( - Menu menu, - CancellationToken cancellationToken = default - ) - { - var dbContext = await GetDbContextAsync(); - var membersQuery = await dbContext.Set() - .Where(q => q.MenuId == menu.Id) - .ToListAsync(GetCancellationToken(cancellationToken)); + public async virtual Task RemoveAllMembersAsync( + Menu menu, + CancellationToken cancellationToken = default + ) + { + var dbContext = await GetDbContextAsync(); + var membersQuery = await dbContext.Set() + .Where(q => q.MenuId == menu.Id) + .ToListAsync(GetCancellationToken(cancellationToken)); - dbContext.Set().RemoveRange(membersQuery); - } + dbContext.Set().RemoveRange(membersQuery); + } - public override async Task> WithDetailsAsync() - { - return (await GetQueryableAsync()).IncludeDetails(); - } + public override async Task> WithDetailsAsync() + { + return (await GetQueryableAsync()).IncludeDetails(); + } - [System.Obsolete("将在abp框架移除之后删除")] - public override IQueryable WithDetails() - { - return GetQueryable().IncludeDetails(); - } + [System.Obsolete("将在abp框架移除之后删除")] + public override IQueryable WithDetails() + { + return GetQueryable().IncludeDetails(); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreRoleMenuRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreRoleMenuRepository.cs index 112a7cdf6..ba9de1489 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreRoleMenuRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreRoleMenuRepository.cs @@ -8,54 +8,53 @@ using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; -namespace LINGYUN.Platform.Menus +namespace LINGYUN.Platform.Menus; + +public class EfCoreRoleMenuRepository : EfCoreRepository, IRoleMenuRepository { - public class EfCoreRoleMenuRepository : EfCoreRepository, IRoleMenuRepository + public EfCoreRoleMenuRepository( + IDbContextProvider dbContextProvider) + : base(dbContextProvider) { - public EfCoreRoleMenuRepository( - IDbContextProvider dbContextProvider) - : base(dbContextProvider) - { - } + } - public async virtual Task> GetListByRoleNameAsync(string roleName, CancellationToken cancellationToken = default) - { - return await (await GetDbSetAsync()).Where(x => x.RoleName.Equals(roleName)) - .ToListAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task> GetListByRoleNameAsync(string roleName, CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()).Where(x => x.RoleName.Equals(roleName)) + .ToListAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task RoleHasInMenuAsync( - string roleName, - string menuName, - CancellationToken cancellationToken = default) - { - var menuQuery = (await GetDbContextAsync()).Set().Where(x => x.Name == menuName); + public async virtual Task RoleHasInMenuAsync( + string roleName, + string menuName, + CancellationToken cancellationToken = default) + { + var menuQuery = (await GetDbContextAsync()).Set().Where(x => x.Name == menuName); - return await - (from roleMenu in (await GetDbSetAsync()) - join menu in menuQuery - on roleMenu.MenuId equals menu.Id - select roleMenu) - .AnyAsync(x => x.RoleName == roleName, - GetCancellationToken(cancellationToken)); - } + return await + (from roleMenu in (await GetDbSetAsync()) + join menu in menuQuery + on roleMenu.MenuId equals menu.Id + select roleMenu) + .AnyAsync(x => x.RoleName == roleName, + GetCancellationToken(cancellationToken)); + } - public async virtual Task GetStartupMenuAsync( - IEnumerable roleNames, - CancellationToken cancellationToken = default) - { - var dbContext = await GetDbContextAsync(); - var roleMenuQuery = dbContext.Set() - .Where(x => roleNames.Contains(x.RoleName)) - .Where(x => x.Startup); + public async virtual Task GetStartupMenuAsync( + IEnumerable roleNames, + CancellationToken cancellationToken = default) + { + var dbContext = await GetDbContextAsync(); + var roleMenuQuery = dbContext.Set() + .Where(x => roleNames.Contains(x.RoleName)) + .Where(x => x.Startup); - return await - (from roleMenu in roleMenuQuery - join menu in dbContext.Set() - on roleMenu.MenuId equals menu.Id - select menu) - .OrderByDescending(x => x.CreationTime) - .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); - } + return await + (from roleMenu in roleMenuQuery + join menu in dbContext.Set() + on roleMenu.MenuId equals menu.Id + select menu) + .OrderByDescending(x => x.CreationTime) + .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreUserMenuRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreUserMenuRepository.cs index f22f74ab6..f73aaa747 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreUserMenuRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreUserMenuRepository.cs @@ -8,58 +8,57 @@ using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; -namespace LINGYUN.Platform.Menus +namespace LINGYUN.Platform.Menus; + +public class EfCoreUserMenuRepository : EfCoreRepository, IUserMenuRepository { - public class EfCoreUserMenuRepository : EfCoreRepository, IUserMenuRepository + public EfCoreUserMenuRepository( + IDbContextProvider dbContextProvider) + : base(dbContextProvider) { - public EfCoreUserMenuRepository( - IDbContextProvider dbContextProvider) - : base(dbContextProvider) - { - } + } - public async virtual Task UserHasInMenuAsync( - Guid userId, - string menuName, - CancellationToken cancellationToken = default) - { - var dbContext = await GetDbContextAsync(); - return await - (from userMenu in dbContext.Set() - join menu in dbContext.Set() - on userMenu.MenuId equals menu.Id - where userMenu.UserId.Equals(userId) - select menu) - .AnyAsync( - x => x.Name.Equals(menuName), - GetCancellationToken(cancellationToken)); - } + public async virtual Task UserHasInMenuAsync( + Guid userId, + string menuName, + CancellationToken cancellationToken = default) + { + var dbContext = await GetDbContextAsync(); + return await + (from userMenu in dbContext.Set() + join menu in dbContext.Set() + on userMenu.MenuId equals menu.Id + where userMenu.UserId.Equals(userId) + select menu) + .AnyAsync( + x => x.Name.Equals(menuName), + GetCancellationToken(cancellationToken)); + } - public async virtual Task> GetListByUserIdAsync( - Guid userId, - CancellationToken cancellationToken = default) - { - var dbSet = await GetDbSetAsync(); - return await dbSet.Where(x => x.UserId.Equals(userId)) - .ToListAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task> GetListByUserIdAsync( + Guid userId, + CancellationToken cancellationToken = default) + { + var dbSet = await GetDbSetAsync(); + return await dbSet.Where(x => x.UserId.Equals(userId)) + .ToListAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task GetStartupMenuAsync( - Guid userId, - CancellationToken cancellationToken = default) - { - var dbContext = await GetDbContextAsync(); - var userMenuQuery = dbContext.Set() - .Where(x => x.UserId.Equals(userId)) - .Where(x => x.Startup); + public async virtual Task GetStartupMenuAsync( + Guid userId, + CancellationToken cancellationToken = default) + { + var dbContext = await GetDbContextAsync(); + var userMenuQuery = dbContext.Set() + .Where(x => x.UserId.Equals(userId)) + .Where(x => x.Startup); - return await - (from userMenu in userMenuQuery - join menu in dbContext.Set() - on userMenu.MenuId equals menu.Id - select menu) - .OrderByDescending(x => x.CreationTime) - .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); - } + return await + (from userMenu in userMenuQuery + join menu in dbContext.Set() + on userMenu.MenuId equals menu.Id + select menu) + .OrderByDescending(x => x.CreationTime) + .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Packages/EfCorePackageRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Packages/EfCorePackageRepository.cs index d4dbf51c6..9b7698f69 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Packages/EfCorePackageRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Packages/EfCorePackageRepository.cs @@ -35,13 +35,24 @@ public async virtual Task FindByNameAsync( public async virtual Task FindLatestAsync( string name, + string version = null, bool includeDetails = true, CancellationToken cancellationToken = default) { + if (version.IsNullOrWhiteSpace()) + { + return await (await GetDbSetAsync()) + .IncludeDetails(includeDetails) + .Where(x => x.Name == name) + .OrderByDescending(x => x.Version) + .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); + } return await (await GetDbSetAsync()) .IncludeDetails(includeDetails) .Where(x => x.Name == name) - .OrderByDescending(x => x.Version) + .OrderByDescending(x => x.Level) + .ThenByDescending(x => x.Version) + .Where(x => x.Version.CompareTo(version) > 0) .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN.Platform.HttpApi.csproj b/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN.Platform.HttpApi.csproj index bbb371a0b..4adbcd0fa 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN.Platform.HttpApi.csproj +++ b/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN.Platform.HttpApi.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.Platform.HttpApi + LINGYUN.Abp.Platform.HttpApi + false + false + false diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN/Platform/Datas/DataController.cs b/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN/Platform/Datas/DataController.cs index bbb53327b..dec6d22ba 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN/Platform/Datas/DataController.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN/Platform/Datas/DataController.cs @@ -5,94 +5,93 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.AspNetCore.Mvc; -namespace LINGYUN.Platform.Datas +namespace LINGYUN.Platform.Datas; + +[RemoteService(Name = PlatformRemoteServiceConsts.RemoteServiceName)] +[Area("platform")] +[Route("api/platform/datas")] +public class DataController : AbpControllerBase, IDataAppService { - [RemoteService(Name = PlatformRemoteServiceConsts.RemoteServiceName)] - [Area("platform")] - [Route("api/platform/datas")] - public class DataController : AbpControllerBase, IDataAppService - { - protected IDataAppService DataAppService { get; } + protected IDataAppService DataAppService { get; } - public DataController( - IDataAppService dataAppService) - { - DataAppService = dataAppService; - } + public DataController( + IDataAppService dataAppService) + { + DataAppService = dataAppService; + } - [HttpPost] - public async virtual Task CreateAsync(DataCreateDto input) - { - return await DataAppService.CreateAsync(input); - } + [HttpPost] + public async virtual Task CreateAsync(DataCreateDto input) + { + return await DataAppService.CreateAsync(input); + } - [HttpPost] - [Route("{id}/items")] - public async virtual Task CreateItemAsync(Guid id, DataItemCreateDto input) - { - await DataAppService.CreateItemAsync(id, input); - } + [HttpPost] + [Route("{id}/items")] + public async virtual Task CreateItemAsync(Guid id, DataItemCreateDto input) + { + await DataAppService.CreateItemAsync(id, input); + } - [HttpDelete] - [Route("{id}")] - public async virtual Task DeleteAsync(Guid id) - { - await DataAppService.DeleteAsync(id); - } + [HttpDelete] + [Route("{id}")] + public async virtual Task DeleteAsync(Guid id) + { + await DataAppService.DeleteAsync(id); + } - [HttpDelete] - [Route("{id}/items/{name}")] - public async virtual Task DeleteItemAsync(Guid id, string name) - { - await DataAppService.DeleteItemAsync(id, name); - } + [HttpDelete] + [Route("{id}/items/{name}")] + public async virtual Task DeleteItemAsync(Guid id, string name) + { + await DataAppService.DeleteItemAsync(id, name); + } - [HttpGet] - [Route("by-name/{name}")] - public async virtual Task GetAsync(string name) - { - return await DataAppService.GetAsync(name); - } + [HttpGet] + [Route("by-name/{name}")] + public async virtual Task GetAsync(string name) + { + return await DataAppService.GetAsync(name); + } - [HttpGet] - [Route("{id}")] - public async virtual Task GetAsync(Guid id) - { - return await DataAppService.GetAsync(id); - } + [HttpGet] + [Route("{id}")] + public async virtual Task GetAsync(Guid id) + { + return await DataAppService.GetAsync(id); + } - [HttpGet] - [Route("all")] - public async virtual Task> GetAllAsync() - { - return await DataAppService.GetAllAsync(); - } + [HttpGet] + [Route("all")] + public async virtual Task> GetAllAsync() + { + return await DataAppService.GetAllAsync(); + } - [HttpGet] - public async virtual Task> GetListAsync(GetDataListInput input) - { - return await DataAppService.GetListAsync(input); - } + [HttpGet] + public async virtual Task> GetListAsync(GetDataListInput input) + { + return await DataAppService.GetListAsync(input); + } - [HttpPut] - [Route("{id}/move")] - public async virtual Task MoveAsync(Guid id, DataMoveDto input) - { - return await DataAppService.MoveAsync(id, input); - } + [HttpPut] + [Route("{id}/move")] + public async virtual Task MoveAsync(Guid id, DataMoveDto input) + { + return await DataAppService.MoveAsync(id, input); + } - [HttpPut] - [Route("{id}")] - public async virtual Task UpdateAsync(Guid id, DataUpdateDto input) - { - return await DataAppService.UpdateAsync(id, input); - } + [HttpPut] + [Route("{id}")] + public async virtual Task UpdateAsync(Guid id, DataUpdateDto input) + { + return await DataAppService.UpdateAsync(id, input); + } - [HttpPut] - [Route("{id}/items/{name}")] - public async virtual Task UpdateItemAsync(Guid id, string name, DataItemUpdateDto input) - { - await DataAppService.UpdateItemAsync(id, name, input); - } + [HttpPut] + [Route("{id}/items/{name}")] + public async virtual Task UpdateItemAsync(Guid id, string name, DataItemUpdateDto input) + { + await DataAppService.UpdateItemAsync(id, name, input); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN/Platform/Layouts/LayoutController.cs b/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN/Platform/Layouts/LayoutController.cs index 2a8778de1..6b49e8a7e 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN/Platform/Layouts/LayoutController.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN/Platform/Layouts/LayoutController.cs @@ -5,59 +5,58 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.AspNetCore.Mvc; -namespace LINGYUN.Platform.Layouts +namespace LINGYUN.Platform.Layouts; + +[RemoteService(Name = PlatformRemoteServiceConsts.RemoteServiceName)] +[Area("platform")] +[Route("api/platform/layouts")] +public class LayoutController : AbpControllerBase, ILayoutAppService { - [RemoteService(Name = PlatformRemoteServiceConsts.RemoteServiceName)] - [Area("platform")] - [Route("api/platform/layouts")] - public class LayoutController : AbpControllerBase, ILayoutAppService + protected ILayoutAppService LayoutAppService { get; } + + public LayoutController( + ILayoutAppService layoutAppService) + { + LayoutAppService = layoutAppService; + } + + [HttpPost] + public async virtual Task CreateAsync(LayoutCreateDto input) + { + return await LayoutAppService.CreateAsync(input); + } + + [HttpDelete] + [Route("{id}")] + public async virtual Task DeleteAsync(Guid id) + { + await LayoutAppService.DeleteAsync(id); + } + + [HttpGet] + [Route("{id}")] + public async virtual Task GetAsync(Guid id) + { + return await LayoutAppService.GetAsync(id); + } + + [HttpGet] + [Route("all")] + public async virtual Task> GetAllListAsync() + { + return await LayoutAppService.GetAllListAsync(); + } + + [HttpGet] + public async virtual Task> GetListAsync(GetLayoutListInput input) + { + return await LayoutAppService.GetListAsync(input); + } + + [HttpPut] + [Route("{id}")] + public async virtual Task UpdateAsync(Guid id, LayoutUpdateDto input) { - protected ILayoutAppService LayoutAppService { get; } - - public LayoutController( - ILayoutAppService layoutAppService) - { - LayoutAppService = layoutAppService; - } - - [HttpPost] - public async virtual Task CreateAsync(LayoutCreateDto input) - { - return await LayoutAppService.CreateAsync(input); - } - - [HttpDelete] - [Route("{id}")] - public async virtual Task DeleteAsync(Guid id) - { - await LayoutAppService.DeleteAsync(id); - } - - [HttpGet] - [Route("{id}")] - public async virtual Task GetAsync(Guid id) - { - return await LayoutAppService.GetAsync(id); - } - - [HttpGet] - [Route("all")] - public async virtual Task> GetAllListAsync() - { - return await LayoutAppService.GetAllListAsync(); - } - - [HttpGet] - public async virtual Task> GetListAsync(GetLayoutListInput input) - { - return await LayoutAppService.GetListAsync(input); - } - - [HttpPut] - [Route("{id}")] - public async virtual Task UpdateAsync(Guid id, LayoutUpdateDto input) - { - return await LayoutAppService.UpdateAsync(id, input); - } + return await LayoutAppService.UpdateAsync(id, input); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN/Platform/Menus/MenuController.cs b/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN/Platform/Menus/MenuController.cs index 5155635d2..949be050c 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN/Platform/Menus/MenuController.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN/Platform/Menus/MenuController.cs @@ -6,137 +6,136 @@ using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.Identity; -namespace LINGYUN.Platform.Menus +namespace LINGYUN.Platform.Menus; + +[RemoteService(Name = PlatformRemoteServiceConsts.RemoteServiceName)] +[Area("platform")] +[Route("api/platform/menus")] +public class MenuController : AbpControllerBase, IMenuAppService { - [RemoteService(Name = PlatformRemoteServiceConsts.RemoteServiceName)] - [Area("platform")] - [Route("api/platform/menus")] - public class MenuController : AbpControllerBase, IMenuAppService + protected IMenuAppService MenuAppService { get; } + protected IUserRoleFinder UserRoleFinder { get; } + + public MenuController( + IMenuAppService menuAppService, + IUserRoleFinder userRoleFinder) { - protected IMenuAppService MenuAppService { get; } - protected IUserRoleFinder UserRoleFinder { get; } + MenuAppService = menuAppService; + UserRoleFinder = userRoleFinder; + } - public MenuController( - IMenuAppService menuAppService, - IUserRoleFinder userRoleFinder) - { - MenuAppService = menuAppService; - UserRoleFinder = userRoleFinder; - } + [HttpGet] + [Route("by-current-user")] + public async virtual Task> GetCurrentUserMenuListAsync(GetMenuInput input) + { + return await MenuAppService.GetCurrentUserMenuListAsync(input); + } - [HttpGet] - [Route("by-current-user")] - public async virtual Task> GetCurrentUserMenuListAsync(GetMenuInput input) - { - return await MenuAppService.GetCurrentUserMenuListAsync(input); - } + [HttpGet] + [Route("{id}")] + public async virtual Task GetAsync(Guid id) + { + return await MenuAppService.GetAsync(id); + } - [HttpGet] - [Route("{id}")] - public async virtual Task GetAsync(Guid id) - { - return await MenuAppService.GetAsync(id); - } + [HttpGet] + [Route("all")] + public async virtual Task> GetAllAsync(MenuGetAllInput input) + { + return await MenuAppService.GetAllAsync(input); + } - [HttpGet] - [Route("all")] - public async virtual Task> GetAllAsync(MenuGetAllInput input) - { - return await MenuAppService.GetAllAsync(input); - } + [HttpGet] + public async virtual Task> GetListAsync(MenuGetListInput input) + { + return await MenuAppService.GetListAsync(input); + } - [HttpGet] - public async virtual Task> GetListAsync(MenuGetListInput input) - { - return await MenuAppService.GetListAsync(input); - } + [HttpPost] + public async virtual Task CreateAsync(MenuCreateDto input) + { + return await MenuAppService.CreateAsync(input); + } - [HttpPost] - public async virtual Task CreateAsync(MenuCreateDto input) - { - return await MenuAppService.CreateAsync(input); - } + [HttpPut] + [Route("{id}")] + public async virtual Task UpdateAsync(Guid id, MenuUpdateDto input) + { + return await MenuAppService.UpdateAsync(id, input); + } - [HttpPut] - [Route("{id}")] - public async virtual Task UpdateAsync(Guid id, MenuUpdateDto input) - { - return await MenuAppService.UpdateAsync(id, input); - } + [HttpDelete] + [Route("{id}")] + public async virtual Task DeleteAsync(Guid id) + { + await MenuAppService.DeleteAsync(id); + } - [HttpDelete] - [Route("{id}")] - public async virtual Task DeleteAsync(Guid id) - { - await MenuAppService.DeleteAsync(id); - } + [HttpPut] + [Route("by-user")] + public async virtual Task SetUserMenusAsync(UserMenuInput input) + { + await MenuAppService.SetUserMenusAsync(input); + } - [HttpPut] - [Route("by-user")] - public async virtual Task SetUserMenusAsync(UserMenuInput input) - { - await MenuAppService.SetUserMenusAsync(input); - } + [HttpPut] + [Route("startup/{id}/by-user")] + public async virtual Task SetUserStartupAsync(Guid id, UserMenuStartupInput input) + { + await MenuAppService.SetUserStartupAsync(id, input); + } - [HttpPut] - [Route("startup/{id}/by-user")] - public async virtual Task SetUserStartupAsync(Guid id, UserMenuStartupInput input) - { - await MenuAppService.SetUserStartupAsync(id, input); - } + [HttpGet] + [Route("by-user")] + public async virtual Task> GetUserMenuListAsync(MenuGetByUserInput input) + { + return await MenuAppService.GetUserMenuListAsync(input); + } - [HttpGet] - [Route("by-user")] - public async virtual Task> GetUserMenuListAsync(MenuGetByUserInput input) - { - return await MenuAppService.GetUserMenuListAsync(input); - } + [HttpGet] + [Route("by-user/{userId}/{framework}")] + public async virtual Task> GetUserMenuListAsync(Guid userId, string framework) + { + var userRoles = await UserRoleFinder.GetRoleNamesAsync(userId); - [HttpGet] - [Route("by-user/{userId}/{framework}")] - public async virtual Task> GetUserMenuListAsync(Guid userId, string framework) - { - var userRoles = await UserRoleFinder.GetRoleNamesAsync(userId); - - var getMenuByUser = new MenuGetByUserInput - { - UserId = userId, - Roles = userRoles, - Framework = framework - }; - return await MenuAppService.GetUserMenuListAsync(getMenuByUser); - } - - [HttpPut] - [Route("by-role")] - public async virtual Task SetRoleMenusAsync(RoleMenuInput input) + var getMenuByUser = new MenuGetByUserInput { - await MenuAppService.SetRoleMenusAsync(input); - } + UserId = userId, + Roles = userRoles, + Framework = framework + }; + return await MenuAppService.GetUserMenuListAsync(getMenuByUser); + } - [HttpPut] - [Route("startup/{id}/by-role")] - public async virtual Task SetRoleStartupAsync(Guid id, RoleMenuStartupInput input) - { - await MenuAppService.SetRoleStartupAsync(id, input); - } + [HttpPut] + [Route("by-role")] + public async virtual Task SetRoleMenusAsync(RoleMenuInput input) + { + await MenuAppService.SetRoleMenusAsync(input); + } - [HttpGet] - [Route("by-role")] - public async virtual Task> GetRoleMenuListAsync(MenuGetByRoleInput input) - { - return await MenuAppService.GetRoleMenuListAsync(input); - } + [HttpPut] + [Route("startup/{id}/by-role")] + public async virtual Task SetRoleStartupAsync(Guid id, RoleMenuStartupInput input) + { + await MenuAppService.SetRoleStartupAsync(id, input); + } - [HttpGet] - [Route("by-role/{role}/{framework}")] - public async virtual Task> GetRoleMenuListAsync(string role, string framework) + [HttpGet] + [Route("by-role")] + public async virtual Task> GetRoleMenuListAsync(MenuGetByRoleInput input) + { + return await MenuAppService.GetRoleMenuListAsync(input); + } + + [HttpGet] + [Route("by-role/{role}/{framework}")] + public async virtual Task> GetRoleMenuListAsync(string role, string framework) + { + return await MenuAppService.GetRoleMenuListAsync(new MenuGetByRoleInput { - return await MenuAppService.GetRoleMenuListAsync(new MenuGetByRoleInput - { - Role = role, - Framework = framework - }); - } + Role = role, + Framework = framework + }); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN/Platform/Packages/PackageController.cs b/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN/Platform/Packages/PackageController.cs index 43919c6a2..1809e8df7 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN/Platform/Packages/PackageController.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN/Platform/Packages/PackageController.cs @@ -74,6 +74,7 @@ public virtual Task GetAsync(Guid id) [HttpGet] [Route("{Name}/latest")] + [Route("{Name}/latest/{Version}")] [AllowAnonymous] public virtual Task GetLatestAsync(PackageGetLatestInput input) { diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN/Platform/PlatformControllerBase.cs b/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN/Platform/PlatformControllerBase.cs index 5c783f101..0994faf19 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN/Platform/PlatformControllerBase.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN/Platform/PlatformControllerBase.cs @@ -2,15 +2,14 @@ using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.Settings; -namespace LINGYUN.Platform +namespace LINGYUN.Platform; + +public abstract class PlatformControllerBase : AbpControllerBase { - public abstract class PlatformControllerBase : AbpControllerBase - { - protected ISettingProvider SettingProvider => LazyServiceProvider.LazyGetRequiredService(); + protected ISettingProvider SettingProvider => LazyServiceProvider.LazyGetRequiredService(); - protected PlatformControllerBase() - { - LocalizationResource = typeof(PlatformResource); - } + protected PlatformControllerBase() + { + LocalizationResource = typeof(PlatformResource); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN/Platform/PlatformHttpApiModule.cs b/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN/Platform/PlatformHttpApiModule.cs index b7aa8ce52..03d16febb 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN/Platform/PlatformHttpApiModule.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.HttpApi/LINGYUN/Platform/PlatformHttpApiModule.cs @@ -3,29 +3,28 @@ using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.Modularity; -namespace LINGYUN.Platform.HttpApi +namespace LINGYUN.Platform.HttpApi; + +[DependsOn( + typeof(PlatformApplicationContractModule), + typeof(AbpAspNetCoreMvcModule))] +public class PlatformHttpApiModule : AbpModule { - [DependsOn( - typeof(PlatformApplicationContractModule), - typeof(AbpAspNetCoreMvcModule))] - public class PlatformHttpApiModule : AbpModule + public override void PreConfigureServices(ServiceConfigurationContext context) { - public override void PreConfigureServices(ServiceConfigurationContext context) + PreConfigure(mvcBuilder => { - PreConfigure(mvcBuilder => - { - mvcBuilder.AddApplicationPartIfNotExists(typeof(PlatformApplicationContractModule).Assembly); - }); - } + mvcBuilder.AddApplicationPartIfNotExists(typeof(PlatformApplicationContractModule).Assembly); + }); + } - public override void ConfigureServices(ServiceConfigurationContext context) + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => { - Configure(options => - { - options.ValueLengthLimit = int.MaxValue; - options.MultipartBodyLengthLimit = int.MaxValue; - options.MultipartHeadersLengthLimit = int.MaxValue; - }); - } + options.ValueLengthLimit = int.MaxValue; + options.MultipartBodyLengthLimit = int.MaxValue; + options.MultipartHeadersLengthLimit = int.MaxValue; + }); } } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Settings.VueVbenAdmin/LINGYUN.Platform.Settings.VueVbenAdmin.csproj b/aspnet-core/modules/platform/LINGYUN.Platform.Settings.VueVbenAdmin/LINGYUN.Platform.Settings.VueVbenAdmin.csproj index 7dd9f6654..68adf4d0a 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Settings.VueVbenAdmin/LINGYUN.Platform.Settings.VueVbenAdmin.csproj +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Settings.VueVbenAdmin/LINGYUN.Platform.Settings.VueVbenAdmin.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Platform.Settings.VueVbenAdmin + LINGYUN.Abp.Platform.Settings.VueVbenAdmin + false + false + false diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/LINGYUN.Platform.Theme.VueVbenAdmin.csproj b/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/LINGYUN.Platform.Theme.VueVbenAdmin.csproj index f4255313e..65d427f34 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/LINGYUN.Platform.Theme.VueVbenAdmin.csproj +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Theme.VueVbenAdmin/LINGYUN.Platform.Theme.VueVbenAdmin.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Platform.Theme.VueVbenAdmin + LINGYUN.Platform.Theme.VueVbenAdmin + false + false + false diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM.SignalR/LINGYUN.Abp.IM.SignalR.csproj b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM.SignalR/LINGYUN.Abp.IM.SignalR.csproj index 652137cba..1b4bf8195 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM.SignalR/LINGYUN.Abp.IM.SignalR.csproj +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM.SignalR/LINGYUN.Abp.IM.SignalR.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.IM.SignalR + LINGYUN.Abp.IM.SignalR + false + false + false diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/AbpIMSignalRModule.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/AbpIMSignalRModule.cs index 0fb3ddc59..54f16708a 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/AbpIMSignalRModule.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/AbpIMSignalRModule.cs @@ -5,31 +5,30 @@ using Volo.Abp.Modularity; using Volo.Abp.VirtualFileSystem; -namespace LINGYUN.Abp.IM.SignalR +namespace LINGYUN.Abp.IM.SignalR; + +[DependsOn( + typeof(AbpIMModule), + typeof(AbpAspNetCoreSignalRModule))] +public class AbpIMSignalRModule : AbpModule { - [DependsOn( - typeof(AbpIMModule), - typeof(AbpAspNetCoreSignalRModule))] - public class AbpIMSignalRModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + Configure(options => { - Configure(options => - { - options.Providers.Add(); - }); + options.Providers.Add(); + }); - Configure(options => - { - options.FileSets.AddEmbedded(); - }); + Configure(options => + { + options.FileSets.AddEmbedded(); + }); - Configure(options => - { - options.Resources - .Get() - .AddVirtualJson("/LINGYUN/Abp/IM/SignalR/Localization/Resources"); - }); - } + Configure(options => + { + options.Resources + .Get() + .AddVirtualJson("/LINGYUN/Abp/IM/SignalR/Localization/Resources"); + }); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/AbpIMSignalROptions.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/AbpIMSignalROptions.cs index 8bf7c70a7..04708a0a4 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/AbpIMSignalROptions.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/AbpIMSignalROptions.cs @@ -1,30 +1,29 @@ -namespace LINGYUN.Abp.IM.SignalR +namespace LINGYUN.Abp.IM.SignalR; + +public class AbpIMSignalROptions { - public class AbpIMSignalROptions - { - /// - /// 自定义的客户端接收消息方法名称 - /// - public string GetChatMessageMethod { get; set; } - /// - /// 自定义的客户端撤回消息方法名称 - /// - public string ReCallChatMessageMethod { get; set; } - /// - /// 用户上线接收方法名称 - /// - public string UserOnlineMethod { get; set; } - /// - /// 用户下线接收方法名称 - /// - public string UserOfflineMethod { get; set; } + /// + /// 自定义的客户端接收消息方法名称 + /// + public string GetChatMessageMethod { get; set; } + /// + /// 自定义的客户端撤回消息方法名称 + /// + public string ReCallChatMessageMethod { get; set; } + /// + /// 用户上线接收方法名称 + /// + public string UserOnlineMethod { get; set; } + /// + /// 用户下线接收方法名称 + /// + public string UserOfflineMethod { get; set; } - public AbpIMSignalROptions() - { - GetChatMessageMethod = "get-chat-message"; - ReCallChatMessageMethod = "recall-chat-message"; - UserOnlineMethod = "on-user-onlined"; - UserOfflineMethod = "on-user-offlined"; - } + public AbpIMSignalROptions() + { + GetChatMessageMethod = "get-chat-message"; + ReCallChatMessageMethod = "recall-chat-message"; + UserOnlineMethod = "on-user-onlined"; + UserOfflineMethod = "on-user-offlined"; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Hubs/MessagesHub.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Hubs/MessagesHub.cs index 98e9c05ec..93c11b4e0 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Hubs/MessagesHub.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Hubs/MessagesHub.cs @@ -20,262 +20,261 @@ using Volo.Abp.Localization; using Volo.Abp.Users; -namespace LINGYUN.Abp.IM.SignalR.Hubs +namespace LINGYUN.Abp.IM.SignalR.Hubs; + +[Authorize] +public class MessagesHub : AbpHub { - [Authorize] - public class MessagesHub : AbpHub - { - protected IMessageProcessor Processor => LazyServiceProvider.LazyGetService(); + protected IMessageProcessor Processor => LazyServiceProvider.LazyGetService(); - protected IUserOnlineChanger OnlineChanger => LazyServiceProvider.LazyGetService(); + protected IUserOnlineChanger OnlineChanger => LazyServiceProvider.LazyGetService(); - protected IDistributedIdGenerator DistributedIdGenerator => LazyServiceProvider.LazyGetRequiredService(); + protected IDistributedIdGenerator DistributedIdGenerator => LazyServiceProvider.LazyGetRequiredService(); - protected IExceptionToErrorInfoConverter ErrorInfoConverter => LazyServiceProvider.LazyGetRequiredService(); + protected IExceptionToErrorInfoConverter ErrorInfoConverter => LazyServiceProvider.LazyGetRequiredService(); - protected AbpIMSignalROptions Options => LazyServiceProvider.LazyGetRequiredService>().Value; + protected AbpIMSignalROptions Options => LazyServiceProvider.LazyGetRequiredService>().Value; - protected IFriendStore FriendStore => LazyServiceProvider.LazyGetRequiredService(); + protected IFriendStore FriendStore => LazyServiceProvider.LazyGetRequiredService(); - protected IMessageStore MessageStore => LazyServiceProvider.LazyGetRequiredService(); + protected IMessageStore MessageStore => LazyServiceProvider.LazyGetRequiredService(); - protected IUserGroupStore UserGroupStore => LazyServiceProvider.LazyGetRequiredService(); + protected IUserGroupStore UserGroupStore => LazyServiceProvider.LazyGetRequiredService(); - protected AbpExceptionHandlingOptions ExceptionHandlingOptions => LazyServiceProvider.LazyGetRequiredService>().Value; + protected AbpExceptionHandlingOptions ExceptionHandlingOptions => LazyServiceProvider.LazyGetRequiredService>().Value; - public override async Task OnConnectedAsync() + public override async Task OnConnectedAsync() + { + await base.OnConnectedAsync(); + + try { - await base.OnConnectedAsync(); + await SendUserOnlineStateAsync(); + } + catch (OperationCanceledException) + { + // Ignore + return; + } + catch (Exception ex) + { + Logger.LogWarning("An error occurred in the OnConnected method:{message}", ex.Message); + } + } - try - { - await SendUserOnlineStateAsync(); - } - catch (OperationCanceledException) - { - // Ignore - return; - } - catch (Exception ex) + public override async Task OnDisconnectedAsync(Exception exception) + { + await base.OnDisconnectedAsync(exception); + + try + { + await SendUserOnlineStateAsync(false); + } + catch (OperationCanceledException) + { + // Ignore + return; + } + catch (Exception ex) + { + Logger.LogWarning("An error occurred in the OnDisconnected method:{message}", ex.Message); + } + } + + protected async virtual Task SendUserOnlineStateAsync(bool isOnlined = true) + { + var methodName = isOnlined ? Options.UserOnlineMethod : Options.UserOfflineMethod; + + var userGroups = await UserGroupStore.GetUserGroupsAsync(CurrentTenant.Id, CurrentUser.GetId()); + foreach (var group in userGroups) + { + if (isOnlined) { - Logger.LogWarning("An error occurred in the OnConnected method:{message}", ex.Message); + // 应使用群组标识 + await Groups.AddToGroupAsync(Context.ConnectionId, group.Id); } + var groupClient = Clients.Group(group.Id); + await groupClient.SendAsync(methodName, CurrentTenant.Id, CurrentUser.GetId()); } - public override async Task OnDisconnectedAsync(Exception exception) + var userFriends = await FriendStore.GetListAsync(CurrentTenant.Id, CurrentUser.GetId()); + if (userFriends.Count > 0) { - await base.OnDisconnectedAsync(exception); + var friendClientIds = userFriends.Select(friend => friend.FriendId.ToString()).ToImmutableArray(); + var userClients = Clients.Users(friendClientIds); + await userClients.SendAsync(methodName, CurrentTenant.Id, CurrentUser.GetId()); + } + } + /// + /// 客户端调用发送消息方法 + /// + /// + /// + [HubMethodName("send")] + public async virtual Task SendMessageAsync(ChatMessage chatMessage) + { + return await SendMessageAsync(Options.GetChatMessageMethod, chatMessage, true); + } - try + [HubMethodName("recall")] + public async virtual Task ReCallAsync(ChatMessage chatMessage) + { + try + { + await Processor?.ReCallAsync(chatMessage); + if (!chatMessage.GroupId.IsNullOrWhiteSpace()) { - await SendUserOnlineStateAsync(false); + await SendMessageAsync( + Options.ReCallChatMessageMethod, + ChatMessage.SystemLocalized( + chatMessage.FormUserId, + chatMessage.GroupId, + new LocalizableStringInfo( + LocalizationResourceNameAttribute.GetName(typeof(AbpIMResource)), + "Messages:RecallMessage", + new Dictionary + { + { "User", chatMessage.FormUserName } + }), + Clock, + chatMessage.MessageType, + chatMessage.TenantId) + .SetProperty(nameof(ChatMessage.MessageId).ToPascalCase(), chatMessage.MessageId), + callbackException: false); } - catch (OperationCanceledException) + else { - // Ignore - return; + await SendMessageAsync( + Options.ReCallChatMessageMethod, + ChatMessage.SystemLocalized( + chatMessage.ToUserId.Value, + chatMessage.FormUserId, + new LocalizableStringInfo( + LocalizationResourceNameAttribute.GetName(typeof(AbpIMResource)), + "Messages:RecallMessage", + new Dictionary + { + { "User", chatMessage.FormUserName } + }), + Clock, + chatMessage.MessageType, + chatMessage.TenantId) + .SetProperty(nameof(ChatMessage.MessageId).ToPascalCase(), chatMessage.MessageId), + callbackException: false); } - catch (Exception ex) + } + catch (Exception ex) + { + if (ex is IBusinessException) { - Logger.LogWarning("An error occurred in the OnDisconnected method:{message}", ex.Message); + var errorInfo = ErrorInfoConverter.Convert(ex, options => + { + options.SendExceptionsDetailsToClients = ExceptionHandlingOptions.SendExceptionsDetailsToClients; + options.SendStackTraceToClients = ExceptionHandlingOptions.SendStackTraceToClients; + }); + + await SendMessageAsync( + Options.ReCallChatMessageMethod, + ChatMessage.System( + chatMessage.ToUserId.Value, + chatMessage.FormUserId, + errorInfo.Message, + Clock, + MessageType.Notifier, + chatMessage.TenantId) + .SetProperty(nameof(ChatMessage.MessageId).ToPascalCase(), chatMessage.MessageId), + callbackException: false); } } + } - protected async virtual Task SendUserOnlineStateAsync(bool isOnlined = true) + [HubMethodName("read")] + public async virtual Task ReadAsync(ChatMessage chatMessage) + { + try { - var methodName = isOnlined ? Options.UserOnlineMethod : Options.UserOfflineMethod; + await Processor?.ReadAsync(chatMessage); + } + catch (OperationCanceledException) + { + // Ignore + return; + } + catch (Exception ex) + { + Logger.LogWarning("An error occurred in the Read method:{message}", ex.Message); + } + } - var userGroups = await UserGroupStore.GetUserGroupsAsync(CurrentTenant.Id, CurrentUser.GetId()); - foreach (var group in userGroups) + protected async virtual Task SendMessageAsync(string methodName, ChatMessage chatMessage, bool callbackException = false) + { + // 持久化 + try + { + chatMessage.SetProperty(nameof(ChatMessage.IsAnonymous), chatMessage.IsAnonymous); + chatMessage.MessageId = DistributedIdGenerator.Create().ToString(); + await MessageStore.StoreMessageAsync(chatMessage); + + if (!chatMessage.GroupId.IsNullOrWhiteSpace()) { - if (isOnlined) - { - // 应使用群组标识 - await Groups.AddToGroupAsync(Context.ConnectionId, group.Id); - } - var groupClient = Clients.Group(group.Id); - await groupClient.SendAsync(methodName, CurrentTenant.Id, CurrentUser.GetId()); + await SendMessageToGroupAsync(methodName, chatMessage); } - - var userFriends = await FriendStore.GetListAsync(CurrentTenant.Id, CurrentUser.GetId()); - if (userFriends.Count > 0) + else { - var friendClientIds = userFriends.Select(friend => friend.FriendId.ToString()).ToImmutableArray(); - var userClients = Clients.Users(friendClientIds); - await userClients.SendAsync(methodName, CurrentTenant.Id, CurrentUser.GetId()); + await SendMessageToUserAsync(methodName, chatMessage); } - } - /// - /// 客户端调用发送消息方法 - /// - /// - /// - [HubMethodName("send")] - public async virtual Task SendMessageAsync(ChatMessage chatMessage) - { - return await SendMessageAsync(Options.GetChatMessageMethod, chatMessage, true); - } - [HubMethodName("recall")] - public async virtual Task ReCallAsync(ChatMessage chatMessage) + return chatMessage.MessageId; + } + catch (Exception ex) { - try + if (callbackException && ex is IBusinessException) { - await Processor?.ReCallAsync(chatMessage); + var errorInfo = ErrorInfoConverter.Convert(ex, options => + { + options.SendExceptionsDetailsToClients = ExceptionHandlingOptions.SendExceptionsDetailsToClients; + options.SendStackTraceToClients = ExceptionHandlingOptions.SendStackTraceToClients; + }); if (!chatMessage.GroupId.IsNullOrWhiteSpace()) { - await SendMessageAsync( - Options.ReCallChatMessageMethod, - ChatMessage.SystemLocalized( + await SendMessageToGroupAsync( + methodName, + ChatMessage.System( chatMessage.FormUserId, chatMessage.GroupId, - new LocalizableStringInfo( - LocalizationResourceNameAttribute.GetName(typeof(AbpIMResource)), - "Messages:RecallMessage", - new Dictionary - { - { "User", chatMessage.FormUserName } - }), + errorInfo.Message, Clock, - chatMessage.MessageType, - chatMessage.TenantId) - .SetProperty(nameof(ChatMessage.MessageId).ToPascalCase(), chatMessage.MessageId), - callbackException: false); + MessageType.Notifier, + chatMessage.TenantId)); } else { - await SendMessageAsync( - Options.ReCallChatMessageMethod, - ChatMessage.SystemLocalized( - chatMessage.ToUserId.Value, - chatMessage.FormUserId, - new LocalizableStringInfo( - LocalizationResourceNameAttribute.GetName(typeof(AbpIMResource)), - "Messages:RecallMessage", - new Dictionary - { - { "User", chatMessage.FormUserName } - }), - Clock, - chatMessage.MessageType, - chatMessage.TenantId) - .SetProperty(nameof(ChatMessage.MessageId).ToPascalCase(), chatMessage.MessageId), - callbackException: false); - } - } - catch (Exception ex) - { - if (ex is IBusinessException) - { - var errorInfo = ErrorInfoConverter.Convert(ex, options => - { - options.SendExceptionsDetailsToClients = ExceptionHandlingOptions.SendExceptionsDetailsToClients; - options.SendStackTraceToClients = ExceptionHandlingOptions.SendStackTraceToClients; - }); - - await SendMessageAsync( - Options.ReCallChatMessageMethod, + await SendMessageToUserAsync( + methodName, ChatMessage.System( chatMessage.ToUserId.Value, chatMessage.FormUserId, errorInfo.Message, Clock, MessageType.Notifier, - chatMessage.TenantId) - .SetProperty(nameof(ChatMessage.MessageId).ToPascalCase(), chatMessage.MessageId), - callbackException: false); + chatMessage.TenantId)); } } } - [HubMethodName("read")] - public async virtual Task ReadAsync(ChatMessage chatMessage) - { - try - { - await Processor?.ReadAsync(chatMessage); - } - catch (OperationCanceledException) - { - // Ignore - return; - } - catch (Exception ex) - { - Logger.LogWarning("An error occurred in the Read method:{message}", ex.Message); - } - } - - protected async virtual Task SendMessageAsync(string methodName, ChatMessage chatMessage, bool callbackException = false) - { - // 持久化 - try - { - chatMessage.SetProperty(nameof(ChatMessage.IsAnonymous), chatMessage.IsAnonymous); - chatMessage.MessageId = DistributedIdGenerator.Create().ToString(); - await MessageStore.StoreMessageAsync(chatMessage); - - if (!chatMessage.GroupId.IsNullOrWhiteSpace()) - { - await SendMessageToGroupAsync(methodName, chatMessage); - } - else - { - await SendMessageToUserAsync(methodName, chatMessage); - } - - return chatMessage.MessageId; - } - catch (Exception ex) - { - if (callbackException && ex is IBusinessException) - { - var errorInfo = ErrorInfoConverter.Convert(ex, options => - { - options.SendExceptionsDetailsToClients = ExceptionHandlingOptions.SendExceptionsDetailsToClients; - options.SendStackTraceToClients = ExceptionHandlingOptions.SendStackTraceToClients; - }); - if (!chatMessage.GroupId.IsNullOrWhiteSpace()) - { - await SendMessageToGroupAsync( - methodName, - ChatMessage.System( - chatMessage.FormUserId, - chatMessage.GroupId, - errorInfo.Message, - Clock, - MessageType.Notifier, - chatMessage.TenantId)); - } - else - { - await SendMessageToUserAsync( - methodName, - ChatMessage.System( - chatMessage.ToUserId.Value, - chatMessage.FormUserId, - errorInfo.Message, - Clock, - MessageType.Notifier, - chatMessage.TenantId)); - } - } - } - - return ""; - } + return ""; + } - protected async virtual Task SendMessageToGroupAsync(string methodName, ChatMessage chatMessage) - { - var signalRClient = Clients.Group(chatMessage.GroupId); - await signalRClient.SendAsync(methodName, chatMessage); - } + protected async virtual Task SendMessageToGroupAsync(string methodName, ChatMessage chatMessage) + { + var signalRClient = Clients.Group(chatMessage.GroupId); + await signalRClient.SendAsync(methodName, chatMessage); + } - protected async virtual Task SendMessageToUserAsync(string methodName, ChatMessage chatMessage) - { - var onlineClients = Clients.User(chatMessage.ToUserId.GetValueOrDefault().ToString()); - await onlineClients.SendAsync(methodName, chatMessage); - } + protected async virtual Task SendMessageToUserAsync(string methodName, ChatMessage chatMessage) + { + var onlineClients = Clients.User(chatMessage.ToUserId.GetValueOrDefault().ToString()); + await onlineClients.SendAsync(methodName, chatMessage); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Messages/SignalRMessageSenderProvider.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Messages/SignalRMessageSenderProvider.cs index 02a74c5a0..bb76abc9c 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Messages/SignalRMessageSenderProvider.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Messages/SignalRMessageSenderProvider.cs @@ -11,126 +11,125 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.Timing; -namespace LINGYUN.Abp.IM.SignalR.Messages +namespace LINGYUN.Abp.IM.SignalR.Messages; + +public class SignalRMessageSenderProvider : MessageSenderProviderBase { - public class SignalRMessageSenderProvider : MessageSenderProviderBase + public override string Name => "SignalR"; + private readonly AbpIMSignalROptions _options; + + private readonly IHubContext _hubContext; + private readonly AbpExceptionHandlingOptions _exceptionHandlingOptions; + + public SignalRMessageSenderProvider( + IHubContext hubContext, + IAbpLazyServiceProvider serviceProvider, + IOptions options, + IOptions exceptionHandlingOptions) + : base(serviceProvider) { - public override string Name => "SignalR"; - private readonly AbpIMSignalROptions _options; + _options = options.Value; + _exceptionHandlingOptions = exceptionHandlingOptions.Value; + _hubContext = hubContext; + } - private readonly IHubContext _hubContext; - private readonly AbpExceptionHandlingOptions _exceptionHandlingOptions; + protected override async Task SendMessageToGroupAsync(ChatMessage chatMessage) + { + await TrySendMessageToGroupAsync(chatMessage, true); + } - public SignalRMessageSenderProvider( - IHubContext hubContext, - IAbpLazyServiceProvider serviceProvider, - IOptions options, - IOptions exceptionHandlingOptions) - : base(serviceProvider) - { - _options = options.Value; - _exceptionHandlingOptions = exceptionHandlingOptions.Value; - _hubContext = hubContext; - } + protected override async Task SendMessageToUserAsync(ChatMessage chatMessage) + { + await TrySendMessageToUserAsync(chatMessage, true); + } - protected override async Task SendMessageToGroupAsync(ChatMessage chatMessage) + protected async virtual Task TrySendMessageToGroupAsync(ChatMessage chatMessage, bool sendingExceptionCallback = true) + { + try { - await TrySendMessageToGroupAsync(chatMessage, true); - } + var signalRClient = _hubContext.Clients.Group(chatMessage.GroupId); + if (signalRClient == null) + { + Logger.LogDebug("Can not get group " + chatMessage.GroupId + " from SignalR hub!"); + return; + } - protected override async Task SendMessageToUserAsync(ChatMessage chatMessage) - { - await TrySendMessageToUserAsync(chatMessage, true); + await signalRClient.SendAsync(_options.GetChatMessageMethod, chatMessage); } - - protected async virtual Task TrySendMessageToGroupAsync(ChatMessage chatMessage, bool sendingExceptionCallback = true) + catch (Exception ex) { - try - { - var signalRClient = _hubContext.Clients.Group(chatMessage.GroupId); - if (signalRClient == null) - { - Logger.LogDebug("Can not get group " + chatMessage.GroupId + " from SignalR hub!"); - return; - } + Logger.LogWarning("Could not send message to group: {0}", chatMessage.GroupId); + Logger.LogWarning("Send to group message error: {0}", ex.Message); - await signalRClient.SendAsync(_options.GetChatMessageMethod, chatMessage); - } - catch (Exception ex) + if (sendingExceptionCallback) { - Logger.LogWarning("Could not send message to group: {0}", chatMessage.GroupId); - Logger.LogWarning("Send to group message error: {0}", ex.Message); - - if (sendingExceptionCallback) - { - await TrySendBusinessErrorMessage(ex, chatMessage); - } + await TrySendBusinessErrorMessage(ex, chatMessage); } } + } - protected async virtual Task TrySendMessageToUserAsync(ChatMessage chatMessage, bool sendingExceptionCallback = true) + protected async virtual Task TrySendMessageToUserAsync(ChatMessage chatMessage, bool sendingExceptionCallback = true) + { + try { - try + var onlineClients = _hubContext.Clients.User(chatMessage.ToUserId.Value.ToString()); + if (onlineClients == null) { - var onlineClients = _hubContext.Clients.User(chatMessage.ToUserId.Value.ToString()); - if (onlineClients == null) - { - Logger.LogDebug("Can not get user " + chatMessage.ToUserId + " connection from SignalR hub!"); - return; - } - await onlineClients.SendAsync(_options.GetChatMessageMethod, chatMessage); + Logger.LogDebug("Can not get user " + chatMessage.ToUserId + " connection from SignalR hub!"); + return; } - catch (Exception ex) - { - Logger.LogWarning("Could not send message to user: {0}", chatMessage.ToUserId); - Logger.LogWarning("Send to user message error: {0}", ex.Message); + await onlineClients.SendAsync(_options.GetChatMessageMethod, chatMessage); + } + catch (Exception ex) + { + Logger.LogWarning("Could not send message to user: {0}", chatMessage.ToUserId); + Logger.LogWarning("Send to user message error: {0}", ex.Message); - if (sendingExceptionCallback) - { - await TrySendBusinessErrorMessage(ex, chatMessage); - } + if (sendingExceptionCallback) + { + await TrySendBusinessErrorMessage(ex, chatMessage); } } + } - protected async virtual Task TrySendBusinessErrorMessage(Exception ex, ChatMessage chatMessage) + protected async virtual Task TrySendBusinessErrorMessage(Exception ex, ChatMessage chatMessage) + { + if (ex is IBusinessException) { - if (ex is IBusinessException) + var clock = ServiceProvider.LazyGetRequiredService(); + var errorInfoConverter = ServiceProvider.LazyGetService(); + if (errorInfoConverter != null) { - var clock = ServiceProvider.LazyGetRequiredService(); - var errorInfoConverter = ServiceProvider.LazyGetService(); - if (errorInfoConverter != null) + var errorInfo = errorInfoConverter.Convert(ex, options => + { + options.SendExceptionsDetailsToClients = _exceptionHandlingOptions.SendExceptionsDetailsToClients; + options.SendStackTraceToClients = _exceptionHandlingOptions.SendStackTraceToClients; + }); + if (!chatMessage.GroupId.IsNullOrWhiteSpace()) + { + await TrySendMessageToGroupAsync( + ChatMessage.System( + chatMessage.FormUserId, + chatMessage.GroupId, + errorInfo.Message, + clock, + chatMessage.MessageType, + chatMessage.TenantId) + .SetProperty(nameof(ChatMessage.MessageId).ToPascalCase(), chatMessage.MessageId), + sendingExceptionCallback: false); + } + else { - var errorInfo = errorInfoConverter.Convert(ex, options => - { - options.SendExceptionsDetailsToClients = _exceptionHandlingOptions.SendExceptionsDetailsToClients; - options.SendStackTraceToClients = _exceptionHandlingOptions.SendStackTraceToClients; - }); - if (!chatMessage.GroupId.IsNullOrWhiteSpace()) - { - await TrySendMessageToGroupAsync( - ChatMessage.System( - chatMessage.FormUserId, - chatMessage.GroupId, - errorInfo.Message, - clock, - chatMessage.MessageType, - chatMessage.TenantId) - .SetProperty(nameof(ChatMessage.MessageId).ToPascalCase(), chatMessage.MessageId), - sendingExceptionCallback: false); - } - else - { - await TrySendMessageToUserAsync( - ChatMessage.System( - chatMessage.FormUserId, - chatMessage.ToUserId.Value, - errorInfo.Message, - clock, - chatMessage.MessageType, - chatMessage.TenantId) - .SetProperty(nameof(ChatMessage.MessageId).ToPascalCase(), chatMessage.MessageId), - sendingExceptionCallback: false); - } + await TrySendMessageToUserAsync( + ChatMessage.System( + chatMessage.FormUserId, + chatMessage.ToUserId.Value, + errorInfo.Message, + clock, + chatMessage.MessageType, + chatMessage.TenantId) + .SetProperty(nameof(ChatMessage.MessageId).ToPascalCase(), chatMessage.MessageId), + sendingExceptionCallback: false); } } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN.Abp.IM.csproj b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN.Abp.IM.csproj index bfa7b0950..e1199015e 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN.Abp.IM.csproj +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN.Abp.IM.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.IM + LINGYUN.Abp.IM + false + false + false diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/AbpIMModule.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/AbpIMModule.cs index 35001fbcd..60f51c41d 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/AbpIMModule.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/AbpIMModule.cs @@ -6,28 +6,27 @@ using Volo.Abp.Modularity; using Volo.Abp.VirtualFileSystem; -namespace LINGYUN.Abp.IM +namespace LINGYUN.Abp.IM; + +[DependsOn( + typeof(AbpEventBusModule), + typeof(AbpRealTimeModule), + typeof(AbpLocalizationModule), + typeof(AbpIdGeneratorModule))] +public class AbpIMModule : AbpModule { - [DependsOn( - typeof(AbpEventBusModule), - typeof(AbpRealTimeModule), - typeof(AbpLocalizationModule), - typeof(AbpIdGeneratorModule))] - public class AbpIMModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + Configure(options => { - Configure(options => - { - options.FileSets.AddEmbedded(); - }); + options.FileSets.AddEmbedded(); + }); - Configure(options => - { - options.Resources - .Add() - .AddVirtualJson("/LINGYUN/Abp/IM/Localization/Resources"); - }); - } + Configure(options => + { + options.Resources + .Add() + .AddVirtualJson("/LINGYUN/Abp/IM/Localization/Resources"); + }); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/AbpIMOptions.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/AbpIMOptions.cs index 9899489c4..6603388d8 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/AbpIMOptions.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/AbpIMOptions.cs @@ -1,18 +1,17 @@ using LINGYUN.Abp.IM.Messages; using Volo.Abp.Collections; -namespace LINGYUN.Abp.IM +namespace LINGYUN.Abp.IM; + +public class AbpIMOptions { - public class AbpIMOptions - { - /// - /// 消息发送者 - /// - public ITypeList Providers { get; } + /// + /// 消息发送者 + /// + public ITypeList Providers { get; } - public AbpIMOptions() - { - Providers = new TypeList(); - } + public AbpIMOptions() + { + Providers = new TypeList(); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/IFriendStore.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/IFriendStore.cs index 5e0564d8e..8a879915f 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/IFriendStore.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/IFriendStore.cs @@ -3,156 +3,155 @@ using System.Threading; using System.Threading.Tasks; -namespace LINGYUN.Abp.IM.Contract +namespace LINGYUN.Abp.IM.Contract; + +public interface IFriendStore { - public interface IFriendStore - { - /// - /// 是否是好友关系 - /// - /// - /// - /// - /// - Task IsFriendAsync( - Guid? tenantId, - Guid userId, - Guid friendId, - CancellationToken cancellationToken = default - ); - /// - /// 查询好友列表 - /// - /// - /// - /// - /// - Task> GetListAsync( - Guid? tenantId, - Guid userId, - string sorting = nameof(UserFriend.UserId), - CancellationToken cancellationToken = default - ); - /// - /// 获取好友数量 - /// - /// - /// - /// - /// - Task GetCountAsync( - Guid? tenantId, - Guid userId, - string filter = "", - CancellationToken cancellationToken = default); - /// - /// 获取好友列表 - /// - /// - /// - /// - /// - /// - /// - /// - Task> GetPagedListAsync( - Guid? tenantId, - Guid userId, - string filter = "", - string sorting = nameof(UserFriend.UserId), - int skipCount = 0, - int maxResultCount = 10, - CancellationToken cancellationToken = default); - /// - /// 获取最近联系好友列表 - /// - /// - /// - /// - /// - /// - Task> GetLastContactListAsync( - Guid? tenantId, - Guid userId, - int skipCount = 0, - int maxResultCount = 10, - CancellationToken cancellationToken = default); - /// - /// 获取好友信息 - /// - /// - /// - /// - /// - Task GetMemberAsync( - Guid? tenantId, - Guid userId, - Guid friendId, - CancellationToken cancellationToken = default); - /// - /// 添加好友 - /// - /// - /// - /// - /// - Task AddMemberAsync( - Guid? tenantId, - Guid userId, - Guid friendId, - string remarkName = "", - bool isStatic = false, - CancellationToken cancellationToken = default); - /// - /// 添加好友请求 - /// - /// - /// - /// - /// - /// - Task AddRequestAsync( - Guid? tenantId, - Guid userId, - Guid friendId, - string remarkName = "", - string description = "", - CancellationToken cancellationToken = default); - /// - /// 移除好友 - /// - /// - /// - /// - /// - Task RemoveMemberAsync( - Guid? tenantId, - Guid userId, - Guid friendId, - CancellationToken cancellationToken = default); - /// - /// 添加黑名单 - /// - /// - /// - /// - /// - Task AddShieldMemberAsync( - Guid? tenantId, - Guid userId, - Guid friendId, - CancellationToken cancellationToken = default); - /// - /// 移除黑名单 - /// - /// - /// - /// - /// - Task RemoveShieldMemberAsync( - Guid? tenantId, - Guid userId, - Guid friendId, - CancellationToken cancellationToken = default); - } + /// + /// 是否是好友关系 + /// + /// + /// + /// + /// + Task IsFriendAsync( + Guid? tenantId, + Guid userId, + Guid friendId, + CancellationToken cancellationToken = default + ); + /// + /// 查询好友列表 + /// + /// + /// + /// + /// + Task> GetListAsync( + Guid? tenantId, + Guid userId, + string sorting = nameof(UserFriend.UserId), + CancellationToken cancellationToken = default + ); + /// + /// 获取好友数量 + /// + /// + /// + /// + /// + Task GetCountAsync( + Guid? tenantId, + Guid userId, + string filter = "", + CancellationToken cancellationToken = default); + /// + /// 获取好友列表 + /// + /// + /// + /// + /// + /// + /// + /// + Task> GetPagedListAsync( + Guid? tenantId, + Guid userId, + string filter = "", + string sorting = nameof(UserFriend.UserId), + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default); + /// + /// 获取最近联系好友列表 + /// + /// + /// + /// + /// + /// + Task> GetLastContactListAsync( + Guid? tenantId, + Guid userId, + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default); + /// + /// 获取好友信息 + /// + /// + /// + /// + /// + Task GetMemberAsync( + Guid? tenantId, + Guid userId, + Guid friendId, + CancellationToken cancellationToken = default); + /// + /// 添加好友 + /// + /// + /// + /// + /// + Task AddMemberAsync( + Guid? tenantId, + Guid userId, + Guid friendId, + string remarkName = "", + bool isStatic = false, + CancellationToken cancellationToken = default); + /// + /// 添加好友请求 + /// + /// + /// + /// + /// + /// + Task AddRequestAsync( + Guid? tenantId, + Guid userId, + Guid friendId, + string remarkName = "", + string description = "", + CancellationToken cancellationToken = default); + /// + /// 移除好友 + /// + /// + /// + /// + /// + Task RemoveMemberAsync( + Guid? tenantId, + Guid userId, + Guid friendId, + CancellationToken cancellationToken = default); + /// + /// 添加黑名单 + /// + /// + /// + /// + /// + Task AddShieldMemberAsync( + Guid? tenantId, + Guid userId, + Guid friendId, + CancellationToken cancellationToken = default); + /// + /// 移除黑名单 + /// + /// + /// + /// + /// + Task RemoveShieldMemberAsync( + Guid? tenantId, + Guid userId, + Guid friendId, + CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/UserAddFriendResult.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/UserAddFriendResult.cs index 70d1c00ba..6c25f26ac 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/UserAddFriendResult.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/UserAddFriendResult.cs @@ -1,12 +1,11 @@ -namespace LINGYUN.Abp.IM.Contract +namespace LINGYUN.Abp.IM.Contract; + +public class UserAddFriendResult { - public class UserAddFriendResult + public bool Successed => Status == UserFriendStatus.Added; + public UserFriendStatus Status { get; } + public UserAddFriendResult(UserFriendStatus status) { - public bool Successed => Status == UserFriendStatus.Added; - public UserFriendStatus Status { get; } - public UserAddFriendResult(UserFriendStatus status) - { - Status = status; - } + Status = status; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/UserFriend.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/UserFriend.cs index 67d37cbe2..4097f900a 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/UserFriend.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/UserFriend.cs @@ -1,46 +1,45 @@ using System; -namespace LINGYUN.Abp.IM.Contract +namespace LINGYUN.Abp.IM.Contract; + +public class UserFriend : UserCard { - public class UserFriend : UserCard + /// + /// 好友标识 + /// + public Guid FriendId { get; set; } + /// + /// 已添加黑名单 + /// + public bool Black { get; set; } + /// + /// 特别关注 + /// + public bool SpecialFocus { get; set; } + /// + /// 消息免打扰 + /// + public bool DontDisturb { get; set; } + /// + /// 备注名称 + /// + public string RemarkName { get; set; } + + public override int GetHashCode() { - /// - /// 好友标识 - /// - public Guid FriendId { get; set; } - /// - /// 已添加黑名单 - /// - public bool Black { get; set; } - /// - /// 特别关注 - /// - public bool SpecialFocus { get; set; } - /// - /// 消息免打扰 - /// - public bool DontDisturb { get; set; } - /// - /// 备注名称 - /// - public string RemarkName { get; set; } + return FriendId.GetHashCode(); + } - public override int GetHashCode() + public override bool Equals(object obj) + { + if (obj == null) { - return FriendId.GetHashCode(); + return false; } - - public override bool Equals(object obj) + if (obj is UserFriend friend) { - if (obj == null) - { - return false; - } - if (obj is UserFriend friend) - { - return friend.FriendId.Equals(FriendId); - } - return false; + return friend.FriendId.Equals(FriendId); } + return false; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/UserFriendGroup.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/UserFriendGroup.cs index f249f7a7a..cc164769c 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/UserFriendGroup.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/UserFriendGroup.cs @@ -1,17 +1,16 @@ using System; using System.Collections.Generic; -namespace LINGYUN.Abp.IM.Contract +namespace LINGYUN.Abp.IM.Contract; + +public class UserFriendGroup { - public class UserFriendGroup - { - public Guid? TenantId { get; set; } - public string DisplayName { get; set; } - public List UserFriends { get; set; } = new List(); + public Guid? TenantId { get; set; } + public string DisplayName { get; set; } + public List UserFriends { get; set; } = new List(); - public void AddFriend(UserFriend friend) - { - UserFriends.AddIfNotContains(friend); - } + public void AddFriend(UserFriend friend) + { + UserFriends.AddIfNotContains(friend); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/UserFriendStatus.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/UserFriendStatus.cs index b9b7843d5..128df1c3d 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/UserFriendStatus.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/UserFriendStatus.cs @@ -1,14 +1,13 @@ -namespace LINGYUN.Abp.IM.Contract +namespace LINGYUN.Abp.IM.Contract; + +public enum UserFriendStatus : byte { - public enum UserFriendStatus : byte - { - /// - /// 需要验证 - /// - NeedValidation, - /// - /// 已添加 - /// - Added - } + /// + /// 需要验证 + /// + NeedValidation, + /// + /// 已添加 + /// + Added } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Groups/Group.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Groups/Group.cs index 26e73b176..63eef222c 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Groups/Group.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Groups/Group.cs @@ -1,34 +1,33 @@ -namespace LINGYUN.Abp.IM.Groups +namespace LINGYUN.Abp.IM.Groups; + +public class Group { - public class Group - { - /// - /// 群组标识 - /// - public string Id { get; set; } - /// - /// 群组名称 - /// - public string Name { get; set; } - /// - /// 群组头像 - /// - public string AvatarUrl { get; set; } - /// - /// 允许匿名聊天 - /// - public bool AllowAnonymous { get; set; } - /// - /// 允许发送消息 - /// - public bool AllowSendMessage { get; set; } - /// - /// 最大用户数 - /// - public int MaxUserLength { get; set; } - /// - /// 群组用户数 - /// - public int GroupUserCount { get; set; } - } + /// + /// 群组标识 + /// + public string Id { get; set; } + /// + /// 群组名称 + /// + public string Name { get; set; } + /// + /// 群组头像 + /// + public string AvatarUrl { get; set; } + /// + /// 允许匿名聊天 + /// + public bool AllowAnonymous { get; set; } + /// + /// 允许发送消息 + /// + public bool AllowSendMessage { get; set; } + /// + /// 最大用户数 + /// + public int MaxUserLength { get; set; } + /// + /// 群组用户数 + /// + public int GroupUserCount { get; set; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Groups/GroupUserCard.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Groups/GroupUserCard.cs index 380821b63..3fe7d2376 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Groups/GroupUserCard.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Groups/GroupUserCard.cs @@ -1,12 +1,11 @@ -namespace LINGYUN.Abp.IM.Groups +namespace LINGYUN.Abp.IM.Groups; + +public class GroupUserCard : UserCard { - public class GroupUserCard : UserCard + public long GroupId { get; set; } + public bool IsAdmin { get; set; } + public bool IsSuperAdmin { get; set; } + public GroupUserCard() { - public long GroupId { get; set; } - public bool IsAdmin { get; set; } - public bool IsSuperAdmin { get; set; } - public GroupUserCard() - { - } } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Groups/IGroupStore.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Groups/IGroupStore.cs index 8f81344e0..8dae94497 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Groups/IGroupStore.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Groups/IGroupStore.cs @@ -3,48 +3,47 @@ using System.Threading; using System.Threading.Tasks; -namespace LINGYUN.Abp.IM.Groups +namespace LINGYUN.Abp.IM.Groups; + +public interface IGroupStore { - public interface IGroupStore - { - /// - /// 获取群组信息 - /// - /// - /// - /// - /// - Task GetAsync( - Guid? tenantId, - string groupId, - CancellationToken cancellationToken = default); - /// - /// 获取群组数 - /// - /// - /// - /// - /// - Task GetCountAsync( - Guid? tenantId, - string filter = null, - CancellationToken cancellationToken = default); - /// - /// 获取群组列表 - /// - /// - /// - /// - /// - /// - /// - /// - Task> GetListAsync( - Guid? tenantId, - string filter = null, - string sorting = nameof(Group.Name), - int skipCount = 0, - int maxResultCount = 10, - CancellationToken cancellationToken = default); - } + /// + /// 获取群组信息 + /// + /// + /// + /// + /// + Task GetAsync( + Guid? tenantId, + string groupId, + CancellationToken cancellationToken = default); + /// + /// 获取群组数 + /// + /// + /// + /// + /// + Task GetCountAsync( + Guid? tenantId, + string filter = null, + CancellationToken cancellationToken = default); + /// + /// 获取群组列表 + /// + /// + /// + /// + /// + /// + /// + /// + Task> GetListAsync( + Guid? tenantId, + string filter = null, + string sorting = nameof(Group.Name), + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Groups/IUserGroupStore.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Groups/IUserGroupStore.cs index e6cceb33b..15a107023 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Groups/IUserGroupStore.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Groups/IUserGroupStore.cs @@ -3,104 +3,103 @@ using System.Threading; using System.Threading.Tasks; -namespace LINGYUN.Abp.IM.Groups +namespace LINGYUN.Abp.IM.Groups; + +public interface IUserGroupStore { - public interface IUserGroupStore - { - /// - /// 成员是否在群组 - /// - /// - /// - /// - /// - Task MemberHasInGroupAsync( - Guid? tenantId, - long groupId, - Guid userId, - CancellationToken cancellationToken = default); - /// - /// 获取群组用户身份 - /// - /// - /// - /// - /// - Task GetUserGroupCardAsync( - Guid? tenantId, - long groupId, - Guid userId, - CancellationToken cancellationToken = default); - /// - /// 获取用户所在通讯组列表 - /// - /// - /// - /// - Task> GetUserGroupsAsync( - Guid? tenantId, - Guid userId, - CancellationToken cancellationToken = default); - /// - /// 获取群组成员列表 - /// - /// - /// - /// - Task> GetMembersAsync( - Guid? tenantId, - long groupId, - CancellationToken cancellationToken = default); - /// - /// 获取群组成员数 - /// - /// - /// - /// - Task GetMembersCountAsync( - Guid? tenantId, - long groupId, - CancellationToken cancellationToken = default); - /// - /// 获取通讯组用户 - /// - /// - /// - /// - /// - /// - /// - Task> GetMembersAsync( - Guid? tenantId, - long groupId, - string sorting = nameof(GroupUserCard.UserId), - int skipCount = 0, - int maxResultCount = 10, - CancellationToken cancellationToken = default); - /// - /// 用户加入通讯组 - /// - /// - /// - /// - /// - Task AddUserToGroupAsync( - Guid? tenantId, - Guid userId, - long groupId, - Guid acceptUserId, - CancellationToken cancellationToken = default); - /// - /// 用户退出通讯组 - /// - /// - /// - /// - /// - Task RemoveUserFormGroupAsync( - Guid? tenantId, - Guid userId, - long groupId, - CancellationToken cancellationToken = default); - } + /// + /// 成员是否在群组 + /// + /// + /// + /// + /// + Task MemberHasInGroupAsync( + Guid? tenantId, + long groupId, + Guid userId, + CancellationToken cancellationToken = default); + /// + /// 获取群组用户身份 + /// + /// + /// + /// + /// + Task GetUserGroupCardAsync( + Guid? tenantId, + long groupId, + Guid userId, + CancellationToken cancellationToken = default); + /// + /// 获取用户所在通讯组列表 + /// + /// + /// + /// + Task> GetUserGroupsAsync( + Guid? tenantId, + Guid userId, + CancellationToken cancellationToken = default); + /// + /// 获取群组成员列表 + /// + /// + /// + /// + Task> GetMembersAsync( + Guid? tenantId, + long groupId, + CancellationToken cancellationToken = default); + /// + /// 获取群组成员数 + /// + /// + /// + /// + Task GetMembersCountAsync( + Guid? tenantId, + long groupId, + CancellationToken cancellationToken = default); + /// + /// 获取通讯组用户 + /// + /// + /// + /// + /// + /// + /// + Task> GetMembersAsync( + Guid? tenantId, + long groupId, + string sorting = nameof(GroupUserCard.UserId), + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default); + /// + /// 用户加入通讯组 + /// + /// + /// + /// + /// + Task AddUserToGroupAsync( + Guid? tenantId, + Guid userId, + long groupId, + Guid acceptUserId, + CancellationToken cancellationToken = default); + /// + /// 用户退出通讯组 + /// + /// + /// + /// + /// + Task RemoveUserFormGroupAsync( + Guid? tenantId, + Guid userId, + long groupId, + CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Groups/UserGroup.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Groups/UserGroup.cs index 2e84e6ba6..def4ce335 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Groups/UserGroup.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Groups/UserGroup.cs @@ -1,13 +1,12 @@ using System; -namespace LINGYUN.Abp.IM.Groups +namespace LINGYUN.Abp.IM.Groups; + +public class UserGroup { - public class UserGroup - { - public Guid? TenantId { get; set; } - public Guid UserId { get; set; } - public long GroupId { get; set; } - public bool IsAdmin { get; set; } - public bool IsSuperAdmin { get; set; } - } + public Guid? TenantId { get; set; } + public Guid UserId { get; set; } + public long GroupId { get; set; } + public bool IsAdmin { get; set; } + public bool IsSuperAdmin { get; set; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/IUserCardFinder.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/IUserCardFinder.cs index 658be6d97..3d657b902 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/IUserCardFinder.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/IUserCardFinder.cs @@ -2,57 +2,56 @@ using System.Collections.Generic; using System.Threading.Tasks; -namespace LINGYUN.Abp.IM +namespace LINGYUN.Abp.IM; + +/// +/// IM用户资料查找接口 +/// +public interface IUserCardFinder { /// - /// IM用户资料查找接口 + /// 查询IM用户数量 + /// + /// + /// 用户名称 + /// 起止年龄 + /// 起止年龄 + /// 性别 + /// + Task GetCountAsync( + Guid? tenantId, + string findUserName = "", + int? startAge = null, + int? endAge = null, + Sex? sex = null); + /// + /// 查询IM用户列表 + /// + /// + /// 用户名称 + /// 起止年龄 + /// 起止年龄 + /// 性别 + /// 排序字段 + /// 起始记录位置 + /// 最大返回数量 + /// + Task> GetListAsync( + Guid? tenantId, + string findUserName = "", + int? startAge = null, + int? endAge = null, + Sex? sex = null, + string sorting = nameof(UserCard.UserId), + int skipCount = 0, + int maxResultCount = 10); + /// + /// 获取IM用户信息 /// - public interface IUserCardFinder - { - /// - /// 查询IM用户数量 - /// - /// - /// 用户名称 - /// 起止年龄 - /// 起止年龄 - /// 性别 - /// - Task GetCountAsync( - Guid? tenantId, - string findUserName = "", - int? startAge = null, - int? endAge = null, - Sex? sex = null); - /// - /// 查询IM用户列表 - /// - /// - /// 用户名称 - /// 起止年龄 - /// 起止年龄 - /// 性别 - /// 排序字段 - /// 起始记录位置 - /// 最大返回数量 - /// - Task> GetListAsync( - Guid? tenantId, - string findUserName = "", - int? startAge = null, - int? endAge = null, - Sex? sex = null, - string sorting = nameof(UserCard.UserId), - int skipCount = 0, - int maxResultCount = 10); - /// - /// 获取IM用户信息 - /// - /// - /// - /// - Task GetMemberAsync( - Guid? tenantId, - Guid findUserId); - } + /// + /// + /// + Task GetMemberAsync( + Guid? tenantId, + Guid findUserId); } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/IUserOnlineChanger.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/IUserOnlineChanger.cs index 0211ae619..ba32f47dd 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/IUserOnlineChanger.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/IUserOnlineChanger.cs @@ -2,14 +2,13 @@ using System.Threading; using System.Threading.Tasks; -namespace LINGYUN.Abp.IM +namespace LINGYUN.Abp.IM; + +public interface IUserOnlineChanger { - public interface IUserOnlineChanger - { - Task ChangeAsync( - Guid? tenantId, - Guid userId, - UserOnlineState state, - CancellationToken cancellationToken = default); - } + Task ChangeAsync( + Guid? tenantId, + Guid userId, + UserOnlineState state, + CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/IUserOnlineChecker.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/IUserOnlineChecker.cs index 9584d2901..b736b8242 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/IUserOnlineChecker.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/IUserOnlineChecker.cs @@ -2,13 +2,12 @@ using System.Threading; using System.Threading.Tasks; -namespace LINGYUN.Abp.IM +namespace LINGYUN.Abp.IM; + +public interface IUserOnlineChecker { - public interface IUserOnlineChecker - { - Task CheckAsync( - Guid? tenantId, - Guid userId, - CancellationToken cancellationToken = default); - } + Task CheckAsync( + Guid? tenantId, + Guid userId, + CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Localization/AbpIMResource.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Localization/AbpIMResource.cs index 4ffa6d4e8..b77c7e4b3 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Localization/AbpIMResource.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Localization/AbpIMResource.cs @@ -1,9 +1,8 @@ using Volo.Abp.Localization; -namespace LINGYUN.Abp.IM.Localization +namespace LINGYUN.Abp.IM.Localization; + +[LocalizationResourceName("AbpIM")] +public class AbpIMResource { - [LocalizationResourceName("AbpIM")] - public class AbpIMResource - { - } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/ChatMessage.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/ChatMessage.cs index a38f8a3d0..020d0aaf1 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/ChatMessage.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/ChatMessage.cs @@ -5,232 +5,231 @@ using Volo.Abp.EventBus; using Volo.Abp.Timing; -namespace LINGYUN.Abp.IM.Messages +namespace LINGYUN.Abp.IM.Messages; + +[Serializable] +[EventName("im.message")] +public class ChatMessage : IHasExtraProperties { - [Serializable] - [EventName("im.message")] - public class ChatMessage : IHasExtraProperties - { - /// - /// 租户 - /// - public Guid? TenantId { get; set; } - /// - /// 群组标识 - /// - public string GroupId { get; set; } - /// - /// 消息标识 - /// - /// - /// 调用者无需关注此字段,将由服务自动生成 - /// - public string MessageId { get; set; } - /// - /// 发送者标识 - /// - public Guid FormUserId { get; set; } - /// - /// 发送者名称 - /// - public string FormUserName { get; set; } - /// - /// 接收用户标识 - /// - /// - /// 设计为可空是为了兼容群聊消息 - /// /remarks> - public Guid? ToUserId { get; set; } - /// - /// 消息内容 - /// - [DisableAuditing] - public string Content { get; set; } - /// - /// 发送时间 - /// - public DateTime SendTime { get; set; } - /// - /// 是否匿名发送(存储在扩展字段) - /// - public bool IsAnonymous { get; set; } - /// - /// 消息类型 - /// - public MessageType MessageType { get; set; } = MessageType.Text; + /// + /// 租户 + /// + public Guid? TenantId { get; set; } + /// + /// 群组标识 + /// + public string GroupId { get; set; } + /// + /// 消息标识 + /// + /// + /// 调用者无需关注此字段,将由服务自动生成 + /// + public string MessageId { get; set; } + /// + /// 发送者标识 + /// + public Guid FormUserId { get; set; } + /// + /// 发送者名称 + /// + public string FormUserName { get; set; } + /// + /// 接收用户标识 + /// + /// + /// 设计为可空是为了兼容群聊消息 + /// /remarks> + public Guid? ToUserId { get; set; } + /// + /// 消息内容 + /// + [DisableAuditing] + public string Content { get; set; } + /// + /// 发送时间 + /// + public DateTime SendTime { get; set; } + /// + /// 是否匿名发送(存储在扩展字段) + /// + public bool IsAnonymous { get; set; } + /// + /// 消息类型 + /// + public MessageType MessageType { get; set; } = MessageType.Text; - public MessageSourceType Source { get; set; } = MessageSourceType.User; + public MessageSourceType Source { get; set; } = MessageSourceType.User; - public ExtraPropertyDictionary ExtraProperties { get; set; } + public ExtraPropertyDictionary ExtraProperties { get; set; } - public ChatMessage() - { - ExtraProperties = new ExtraPropertyDictionary(); - this.SetDefaultsForExtraProperties(); - } + public ChatMessage() + { + ExtraProperties = new ExtraPropertyDictionary(); + this.SetDefaultsForExtraProperties(); + } - public static ChatMessage User( - Guid formUserId, - string formUserName, - Guid toUserId, - string content, - IClock clock, - bool isAnonymous = false, - MessageType type = MessageType.Text, - MessageSourceType souce = MessageSourceType.User, - Guid? tenantId = null) + public static ChatMessage User( + Guid formUserId, + string formUserName, + Guid toUserId, + string content, + IClock clock, + bool isAnonymous = false, + MessageType type = MessageType.Text, + MessageSourceType souce = MessageSourceType.User, + Guid? tenantId = null) + { + return new ChatMessage { - return new ChatMessage - { - FormUserId = formUserId, - FormUserName = formUserName, - ToUserId = toUserId, - Content = content, - SendTime = clock.Now, - IsAnonymous = isAnonymous, - MessageType = type, - TenantId = tenantId, - Source = souce, - }; - } - public static ChatMessage System( - Guid formUserId, - Guid toUserId, - string content, - IClock clock, - MessageType type = MessageType.Text, - Guid? tenantId = null) + FormUserId = formUserId, + FormUserName = formUserName, + ToUserId = toUserId, + Content = content, + SendTime = clock.Now, + IsAnonymous = isAnonymous, + MessageType = type, + TenantId = tenantId, + Source = souce, + }; + } + public static ChatMessage System( + Guid formUserId, + Guid toUserId, + string content, + IClock clock, + MessageType type = MessageType.Text, + Guid? tenantId = null) + { + return new ChatMessage { - return new ChatMessage - { - FormUserId = formUserId, - FormUserName = "system", - ToUserId = toUserId, - Content = content, - SendTime = clock.Now, - IsAnonymous = false, - MessageType = type, - TenantId = tenantId, - Source = MessageSourceType.System, - } - .SetProperty("L", false); + FormUserId = formUserId, + FormUserName = "system", + ToUserId = toUserId, + Content = content, + SendTime = clock.Now, + IsAnonymous = false, + MessageType = type, + TenantId = tenantId, + Source = MessageSourceType.System, } + .SetProperty("L", false); + } - /// - /// 本地化系统消息 - /// 用户消息与群组消息不能使用多语言 - /// - /// - /// - /// - /// - /// - /// - /// - public static ChatMessage SystemLocalized( - Guid formUserId, - Guid toUserId, - LocalizableStringInfo content, - IClock clock, - MessageType type = MessageType.Text, - Guid? tenantId = null) + /// + /// 本地化系统消息 + /// 用户消息与群组消息不能使用多语言 + /// + /// + /// + /// + /// + /// + /// + /// + public static ChatMessage SystemLocalized( + Guid formUserId, + Guid toUserId, + LocalizableStringInfo content, + IClock clock, + MessageType type = MessageType.Text, + Guid? tenantId = null) + { + return new ChatMessage { - return new ChatMessage - { - FormUserId = formUserId, - FormUserName = "system", - ToUserId = toUserId, - Content = "", - SendTime = clock.Now, - IsAnonymous = false, - MessageType = type, - TenantId = tenantId, - Source = MessageSourceType.System, - } - .SetProperty("L", true) - .SetProperty(nameof(ChatMessage.Content).ToPascalCase(), content); + FormUserId = formUserId, + FormUserName = "system", + ToUserId = toUserId, + Content = "", + SendTime = clock.Now, + IsAnonymous = false, + MessageType = type, + TenantId = tenantId, + Source = MessageSourceType.System, } + .SetProperty("L", true) + .SetProperty(nameof(ChatMessage.Content).ToPascalCase(), content); + } - public static ChatMessage System( - Guid formUserId, - string groupId, - string content, - IClock clock, - MessageType type = MessageType.Text, - Guid? tenantId = null) + public static ChatMessage System( + Guid formUserId, + string groupId, + string content, + IClock clock, + MessageType type = MessageType.Text, + Guid? tenantId = null) + { + return new ChatMessage { - return new ChatMessage - { - FormUserId = formUserId, - FormUserName = "system", - GroupId = groupId, - Content = content, - SendTime = clock.Now, - IsAnonymous = false, - MessageType = type, - TenantId = tenantId, - Source = MessageSourceType.System, - } - .SetProperty("L", false); + FormUserId = formUserId, + FormUserName = "system", + GroupId = groupId, + Content = content, + SendTime = clock.Now, + IsAnonymous = false, + MessageType = type, + TenantId = tenantId, + Source = MessageSourceType.System, } - /// - /// 本地化系统消息 - /// 用户消息与群组消息不能使用多语言 - /// - /// - /// - /// - /// - /// - /// - /// - public static ChatMessage SystemLocalized( - Guid formUserId, - string groupId, - LocalizableStringInfo content, - IClock clock, - MessageType type = MessageType.Text, - Guid? tenantId = null) + .SetProperty("L", false); + } + /// + /// 本地化系统消息 + /// 用户消息与群组消息不能使用多语言 + /// + /// + /// + /// + /// + /// + /// + /// + public static ChatMessage SystemLocalized( + Guid formUserId, + string groupId, + LocalizableStringInfo content, + IClock clock, + MessageType type = MessageType.Text, + Guid? tenantId = null) + { + return new ChatMessage { - return new ChatMessage - { - FormUserId = formUserId, - FormUserName = "system", - GroupId = groupId, - Content = "", - SendTime = clock.Now, - IsAnonymous = false, - MessageType = type, - TenantId = tenantId, - Source = MessageSourceType.System, - } - .SetProperty("L", true) - .SetProperty(nameof(ChatMessage.Content).ToPascalCase(), content); + FormUserId = formUserId, + FormUserName = "system", + GroupId = groupId, + Content = "", + SendTime = clock.Now, + IsAnonymous = false, + MessageType = type, + TenantId = tenantId, + Source = MessageSourceType.System, } + .SetProperty("L", true) + .SetProperty(nameof(ChatMessage.Content).ToPascalCase(), content); + } - public static ChatMessage Group( - Guid formUserId, - string formUserName, - string groupId, - string content, - IClock clock, - bool isAnonymous = false, - MessageType type = MessageType.Text, - MessageSourceType souce = MessageSourceType.User, - Guid? tenantId = null) + public static ChatMessage Group( + Guid formUserId, + string formUserName, + string groupId, + string content, + IClock clock, + bool isAnonymous = false, + MessageType type = MessageType.Text, + MessageSourceType souce = MessageSourceType.User, + Guid? tenantId = null) + { + return new ChatMessage { - return new ChatMessage - { - FormUserId = formUserId, - FormUserName = formUserName, - GroupId = groupId, - Content = content, - SendTime = clock.Now, - IsAnonymous = isAnonymous, - MessageType = type, - TenantId = tenantId, - Source = souce, - }; - } + FormUserId = formUserId, + FormUserName = formUserName, + GroupId = groupId, + Content = content, + SendTime = clock.Now, + IsAnonymous = isAnonymous, + MessageType = type, + TenantId = tenantId, + Source = souce, + }; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageBlocker.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageBlocker.cs index 905c06751..671b0560c 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageBlocker.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageBlocker.cs @@ -1,12 +1,11 @@ using System.Threading.Tasks; -namespace LINGYUN.Abp.IM.Messages +namespace LINGYUN.Abp.IM.Messages; + +/// +/// 消息拦截器 +/// +public interface IMessageBlocker { - /// - /// 消息拦截器 - /// - public interface IMessageBlocker - { - Task InterceptAsync(ChatMessage message); - } + Task InterceptAsync(ChatMessage message); } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageProcessor.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageProcessor.cs index b5c82806d..c2e21e2bb 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageProcessor.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageProcessor.cs @@ -1,23 +1,22 @@ using System.Threading.Tasks; -namespace LINGYUN.Abp.IM.Messages +namespace LINGYUN.Abp.IM.Messages; + +/// +/// 消息处理器 +/// +public interface IMessageProcessor { /// - /// 消息处理器 + /// 撤回 + /// + /// + /// + Task ReCallAsync(ChatMessage message); + /// + /// 消息已读 /// - public interface IMessageProcessor - { - /// - /// 撤回 - /// - /// - /// - Task ReCallAsync(ChatMessage message); - /// - /// 消息已读 - /// - /// - /// - Task ReadAsync(ChatMessage message); - } + /// + /// + Task ReadAsync(ChatMessage message); } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageSender.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageSender.cs index 89d952c56..35ae00f97 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageSender.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageSender.cs @@ -1,9 +1,8 @@ using System.Threading.Tasks; -namespace LINGYUN.Abp.IM.Messages +namespace LINGYUN.Abp.IM.Messages; + +public interface IMessageSender { - public interface IMessageSender - { - Task SendMessageAsync(ChatMessage chatMessage); - } + Task SendMessageAsync(ChatMessage chatMessage); } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageSenderProvider.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageSenderProvider.cs index fb7862084..780044436 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageSenderProvider.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageSenderProvider.cs @@ -1,10 +1,9 @@ using System.Threading.Tasks; -namespace LINGYUN.Abp.IM.Messages +namespace LINGYUN.Abp.IM.Messages; + +public interface IMessageSenderProvider { - public interface IMessageSenderProvider - { - string Name { get; } - Task SendMessageAsync(ChatMessage chatMessage); - } + string Name { get; } + Task SendMessageAsync(ChatMessage chatMessage); } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageSenderProviderManager.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageSenderProviderManager.cs index 08a292d1d..748c83be8 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageSenderProviderManager.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageSenderProviderManager.cs @@ -1,9 +1,8 @@ using System.Collections.Generic; -namespace LINGYUN.Abp.IM.Messages +namespace LINGYUN.Abp.IM.Messages; + +public interface IMessageSenderProviderManager { - public interface IMessageSenderProviderManager - { - List Providers { get; } - } + List Providers { get; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageStore.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageStore.cs index 76d99c5ba..445ded07b 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageStore.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageStore.cs @@ -3,109 +3,108 @@ using System.Threading; using System.Threading.Tasks; -namespace LINGYUN.Abp.IM.Messages +namespace LINGYUN.Abp.IM.Messages; + +public interface IMessageStore { - public interface IMessageStore - { - /// - /// 存储聊天记录 - /// - /// - /// - /// - /// - Task StoreMessageAsync( - ChatMessage chatMessage, - CancellationToken cancellationToken = default); - /// - /// 获取群组聊天记录总数 - /// - /// - /// - /// - /// - /// - Task GetGroupMessageCountAsync( - Guid? tenantId, - long groupId, - MessageType? type = null, - string filter = "", - CancellationToken cancellationToken = default); - /// - /// 获取群组聊天记录 - /// - /// - /// - /// - /// - /// - /// - /// - /// - Task> GetGroupMessageAsync( - Guid? tenantId, - long groupId, - MessageType? type = null, - string filter = "", - string sorting = nameof(ChatMessage.MessageId), - int skipCount = 0, - int maxResultCount = 10, - CancellationToken cancellationToken = default); - /// - /// 获取上一次通讯消息记录 - /// - /// - /// - /// - /// - /// - /// - Task> GetLastChatMessagesAsync( - Guid? tenantId, - Guid userId, - MessageState? state = null, - string sorting = nameof(LastChatMessage.SendTime), - int maxResultCount = 10, - CancellationToken cancellationToken = default - ); - /// - /// 获取与某个用户的聊天记录总数 - /// - /// - /// - /// - /// - /// - /// - Task GetChatMessageCountAsync( - Guid? tenantId, - Guid sendUserId, - Guid receiveUserId, - MessageType? type = null, - string filter = "", - CancellationToken cancellationToken = default); - /// - /// 获取用户聊天记录 - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - Task> GetChatMessageAsync( - Guid? tenantId, - Guid sendUserId, - Guid receiveUserId, - MessageType? type = null, - string filter = "", - string sorting = nameof(ChatMessage.MessageId), - int skipCount = 0, - int maxResultCount = 10, - CancellationToken cancellationToken = default); - } + /// + /// 存储聊天记录 + /// + /// + /// + /// + /// + Task StoreMessageAsync( + ChatMessage chatMessage, + CancellationToken cancellationToken = default); + /// + /// 获取群组聊天记录总数 + /// + /// + /// + /// + /// + /// + Task GetGroupMessageCountAsync( + Guid? tenantId, + long groupId, + MessageType? type = null, + string filter = "", + CancellationToken cancellationToken = default); + /// + /// 获取群组聊天记录 + /// + /// + /// + /// + /// + /// + /// + /// + /// + Task> GetGroupMessageAsync( + Guid? tenantId, + long groupId, + MessageType? type = null, + string filter = "", + string sorting = nameof(ChatMessage.MessageId), + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default); + /// + /// 获取上一次通讯消息记录 + /// + /// + /// + /// + /// + /// + /// + Task> GetLastChatMessagesAsync( + Guid? tenantId, + Guid userId, + MessageState? state = null, + string sorting = nameof(LastChatMessage.SendTime), + int maxResultCount = 10, + CancellationToken cancellationToken = default + ); + /// + /// 获取与某个用户的聊天记录总数 + /// + /// + /// + /// + /// + /// + /// + Task GetChatMessageCountAsync( + Guid? tenantId, + Guid sendUserId, + Guid receiveUserId, + MessageType? type = null, + string filter = "", + CancellationToken cancellationToken = default); + /// + /// 获取用户聊天记录 + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + Task> GetChatMessageAsync( + Guid? tenantId, + Guid sendUserId, + Guid receiveUserId, + MessageType? type = null, + string filter = "", + string sorting = nameof(ChatMessage.MessageId), + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/LastChatMessage.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/LastChatMessage.cs index e82606ac5..09340bb82 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/LastChatMessage.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/LastChatMessage.cs @@ -2,68 +2,67 @@ using Volo.Abp.Auditing; using Volo.Abp.Data; -namespace LINGYUN.Abp.IM.Messages +namespace LINGYUN.Abp.IM.Messages; + +/// +/// 上一次通讯消息 +/// +public class LastChatMessage : IHasExtraProperties { + public string AvatarUrl { get; set; } + public string Object { get; set; } /// - /// 上一次通讯消息 + /// 租户 /// - public class LastChatMessage : IHasExtraProperties - { - public string AvatarUrl { get; set; } - public string Object { get; set; } - /// - /// 租户 - /// - public Guid? TenantId { get; set; } - /// - /// 群组标识 - /// - public string GroupId { get; set; } - /// - /// 消息标识 - /// - /// - /// 调用者无需关注此字段,将由服务自动生成 - /// - public string MessageId { get; set; } - /// - /// 发送者标识 - /// - public Guid FormUserId { get; set; } - /// - /// 发送者名称 - /// - public string FormUserName { get; set; } - /// - /// 接收用户标识 - /// - /// - /// 设计为可空是为了兼容群聊消息 - /// /remarks> - public string ToUserId { get; set; } - /// - /// 消息内容 - /// - [DisableAuditing] - public string Content { get; set; } - /// - /// 发送时间 - /// - public DateTime SendTime { get; set; } - /// - /// 是否匿名发送(存储在扩展字段) - /// - public bool IsAnonymous => this.GetProperty(nameof(IsAnonymous), false); - /// - /// 消息类型 - /// - public MessageType MessageType { get; set; } + public Guid? TenantId { get; set; } + /// + /// 群组标识 + /// + public string GroupId { get; set; } + /// + /// 消息标识 + /// + /// + /// 调用者无需关注此字段,将由服务自动生成 + /// + public string MessageId { get; set; } + /// + /// 发送者标识 + /// + public Guid FormUserId { get; set; } + /// + /// 发送者名称 + /// + public string FormUserName { get; set; } + /// + /// 接收用户标识 + /// + /// + /// 设计为可空是为了兼容群聊消息 + /// /remarks> + public string ToUserId { get; set; } + /// + /// 消息内容 + /// + [DisableAuditing] + public string Content { get; set; } + /// + /// 发送时间 + /// + public DateTime SendTime { get; set; } + /// + /// 是否匿名发送(存储在扩展字段) + /// + public bool IsAnonymous => this.GetProperty(nameof(IsAnonymous), false); + /// + /// 消息类型 + /// + public MessageType MessageType { get; set; } - public MessageSourceType Source { get; set; } - public ExtraPropertyDictionary ExtraProperties { get; set; } - public LastChatMessage() - { - ExtraProperties = new ExtraPropertyDictionary(); - } + public MessageSourceType Source { get; set; } + public ExtraPropertyDictionary ExtraProperties { get; set; } + public LastChatMessage() + { + ExtraProperties = new ExtraPropertyDictionary(); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSendResult.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSendResult.cs index 98c587e6d..a4bf046cf 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSendResult.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSendResult.cs @@ -1,45 +1,44 @@ -namespace LINGYUN.Abp.IM.Messages +namespace LINGYUN.Abp.IM.Messages; + +public class MessageSendResult { - public class MessageSendResult + public bool Success { get; } + public string Error { get; } + public int Code { get; } + public string Form { get; } + public string To { get; } + public string Content { get; } + public static MessageSendResult Successed(string form, string to, string content) { - public bool Success { get; } - public string Error { get; } - public int Code { get; } - public string Form { get; } - public string To { get; } - public string Content { get; } - public static MessageSendResult Successed(string form, string to, string content) - { - return new MessageSendResult(form, to, content); - } + return new MessageSendResult(form, to, content); + } - public static MessageSendResult Failed(int code, string error, string form, string to, string content) - { - return new MessageSendResult(code, error, form, to, content); - } - private MessageSendResult( - int code, - string error, - string form, - string to, - string content) - { - Code = code; - Error = error; - Form = form; - To = to; - Success = false; - } + public static MessageSendResult Failed(int code, string error, string form, string to, string content) + { + return new MessageSendResult(code, error, form, to, content); + } + private MessageSendResult( + int code, + string error, + string form, + string to, + string content) + { + Code = code; + Error = error; + Form = form; + To = to; + Success = false; + } - private MessageSendResult( - string form, - string to, - string content) - { - Form = form; - To = to; - Content = content; - Success = true; - } + private MessageSendResult( + string form, + string to, + string content) + { + Form = form; + To = to; + Content = content; + Success = true; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSender.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSender.cs index a8f3dfd36..513443eaf 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSender.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSender.cs @@ -5,31 +5,30 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.EventBus.Distributed; -namespace LINGYUN.Abp.IM.Messages +namespace LINGYUN.Abp.IM.Messages; + +public class MessageSender : IMessageSender, ITransientDependency { - public class MessageSender : IMessageSender, ITransientDependency + protected IDistributedEventBus EventBus { get; } + protected IDistributedIdGenerator DistributedIdGenerator { get; } + public MessageSender( + IDistributedEventBus eventBus, + IDistributedIdGenerator distributedIdGenerator) { - protected IDistributedEventBus EventBus { get; } - protected IDistributedIdGenerator DistributedIdGenerator { get; } - public MessageSender( - IDistributedEventBus eventBus, - IDistributedIdGenerator distributedIdGenerator) - { - EventBus = eventBus; - DistributedIdGenerator = distributedIdGenerator; - } + EventBus = eventBus; + DistributedIdGenerator = distributedIdGenerator; + } - public async virtual Task SendMessageAsync(ChatMessage chatMessage) - { - chatMessage.SetProperty(nameof(ChatMessage.IsAnonymous), chatMessage.IsAnonymous); - chatMessage.MessageId = DistributedIdGenerator.Create().ToString(); - // 如果先存储的话,就紧耦合消息处理模块了 - // await Store.StoreMessageAsync(chatMessage); - var eto = new RealTimeEto(chatMessage); + public async virtual Task SendMessageAsync(ChatMessage chatMessage) + { + chatMessage.SetProperty(nameof(ChatMessage.IsAnonymous), chatMessage.IsAnonymous); + chatMessage.MessageId = DistributedIdGenerator.Create().ToString(); + // 如果先存储的话,就紧耦合消息处理模块了 + // await Store.StoreMessageAsync(chatMessage); + var eto = new RealTimeEto(chatMessage); - await EventBus.PublishAsync(eto); + await EventBus.PublishAsync(eto); - return chatMessage.MessageId; - } + return chatMessage.MessageId; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSenderProviderBase.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSenderProviderBase.cs index af6282368..d8c2bea62 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSenderProviderBase.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSenderProviderBase.cs @@ -4,47 +4,46 @@ using System.Threading.Tasks; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.IM.Messages +namespace LINGYUN.Abp.IM.Messages; + +public abstract class MessageSenderProviderBase : IMessageSenderProvider, ITransientDependency { - public abstract class MessageSenderProviderBase : IMessageSenderProvider, ITransientDependency - { - public abstract string Name { get; } + public abstract string Name { get; } - protected IAbpLazyServiceProvider ServiceProvider { get; } + protected IAbpLazyServiceProvider ServiceProvider { get; } - protected ILoggerFactory LoggerFactory => ServiceProvider.LazyGetRequiredService(); + protected ILoggerFactory LoggerFactory => ServiceProvider.LazyGetRequiredService(); - protected ILogger Logger => _lazyLogger.Value; - private Lazy _lazyLogger => new Lazy(() => LoggerFactory?.CreateLogger(GetType().FullName) ?? NullLogger.Instance, true); + protected ILogger Logger => _lazyLogger.Value; + private Lazy _lazyLogger => new Lazy(() => LoggerFactory?.CreateLogger(GetType().FullName) ?? NullLogger.Instance, true); - protected MessageSenderProviderBase(IAbpLazyServiceProvider serviceProvider) - { - ServiceProvider = serviceProvider; - } + protected MessageSenderProviderBase(IAbpLazyServiceProvider serviceProvider) + { + ServiceProvider = serviceProvider; + } - public async virtual Task SendMessageAsync(ChatMessage chatMessage) + public async virtual Task SendMessageAsync(ChatMessage chatMessage) + { + try { - try + if (!chatMessage.GroupId.IsNullOrWhiteSpace()) { - if (!chatMessage.GroupId.IsNullOrWhiteSpace()) - { - await SendMessageToGroupAsync(chatMessage); - } - else - { - await SendMessageToUserAsync(chatMessage); - } + await SendMessageToGroupAsync(chatMessage); } - catch (Exception ex) + else { - Logger.LogWarning("Could not send message, group: {0}, formUser: {1}, toUser: {2}", - chatMessage.GroupId, chatMessage.FormUserName, - chatMessage.ToUserId.HasValue ? chatMessage.ToUserId.ToString() : "None"); - Logger.LogWarning("Send group message error: {0}", ex.Message); + await SendMessageToUserAsync(chatMessage); } } - - protected abstract Task SendMessageToGroupAsync(ChatMessage chatMessage); - protected abstract Task SendMessageToUserAsync(ChatMessage chatMessage); + catch (Exception ex) + { + Logger.LogWarning("Could not send message, group: {0}, formUser: {1}, toUser: {2}", + chatMessage.GroupId, chatMessage.FormUserName, + chatMessage.ToUserId.HasValue ? chatMessage.ToUserId.ToString() : "None"); + Logger.LogWarning("Send group message error: {0}", ex.Message); + } } + + protected abstract Task SendMessageToGroupAsync(ChatMessage chatMessage); + protected abstract Task SendMessageToUserAsync(ChatMessage chatMessage); } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSenderProviderManager.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSenderProviderManager.cs index 3b0c4ec16..4a6f6d4b5 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSenderProviderManager.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSenderProviderManager.cs @@ -5,29 +5,28 @@ using System.Linq; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.IM.Messages +namespace LINGYUN.Abp.IM.Messages; + +public class MessageSenderProviderManager : IMessageSenderProviderManager, ISingletonDependency { - public class MessageSenderProviderManager : IMessageSenderProviderManager, ISingletonDependency - { - public List Providers => _lazyProviders.Value; + public List Providers => _lazyProviders.Value; - protected AbpIMOptions Options { get; } + protected AbpIMOptions Options { get; } - private readonly Lazy> _lazyProviders; + private readonly Lazy> _lazyProviders; - public MessageSenderProviderManager( - IServiceProvider serviceProvider, - IOptions options) - { - Options = options.Value; + public MessageSenderProviderManager( + IServiceProvider serviceProvider, + IOptions options) + { + Options = options.Value; - _lazyProviders = new Lazy>( - () => Options - .Providers - .Select(type => serviceProvider.GetRequiredService(type) as IMessageSenderProvider) - .ToList(), - true - ); - } + _lazyProviders = new Lazy>( + () => Options + .Providers + .Select(type => serviceProvider.GetRequiredService(type) as IMessageSenderProvider) + .ToList(), + true + ); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSourceType.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSourceType.cs index 2be37aaca..69656e6d3 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSourceType.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSourceType.cs @@ -1,8 +1,7 @@ -namespace LINGYUN.Abp.IM.Messages +namespace LINGYUN.Abp.IM.Messages; + +public enum MessageSourceType { - public enum MessageSourceType - { - User = 0, - System = 10, - } + User = 0, + System = 10, } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageState.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageState.cs index f7f9ee0e0..740f040cf 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageState.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageState.cs @@ -1,29 +1,28 @@ -namespace LINGYUN.Abp.IM.Messages +namespace LINGYUN.Abp.IM.Messages; + +/// +/// 消息状态 +/// +public enum MessageState : sbyte { /// - /// 消息状态 + /// 已发送 /// - public enum MessageState : sbyte - { - /// - /// 已发送 - /// - Send = 0, - /// - /// 已读 - /// - Read = 1, - /// - /// 撤回 - /// - ReCall = 10, - /// - /// 发送失败 - /// - Failed = 50, - /// - /// 退回 - /// - BackTo = 100 - } + Send = 0, + /// + /// 已读 + /// + Read = 1, + /// + /// 撤回 + /// + ReCall = 10, + /// + /// 发送失败 + /// + Failed = 50, + /// + /// 退回 + /// + BackTo = 100 } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageType.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageType.cs index 6a08a727f..684d8d55b 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageType.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageType.cs @@ -1,35 +1,34 @@ -namespace LINGYUN.Abp.IM.Messages +namespace LINGYUN.Abp.IM.Messages; + +public enum MessageType { - public enum MessageType - { - /// - /// 文本消息 - /// - Text = 0, - /// - /// 图片消息 - /// - Image = 10, - /// - /// 链接 - /// - Link = 20, - /// - /// 视频 - /// - Video = 30, - /// - /// 音频 - /// - Voice = 40, - /// - /// 文件 - /// - File = 50, - /// - /// 通知 - /// 一般用于错误处理 - /// - Notifier = 100, - } + /// + /// 文本消息 + /// + Text = 0, + /// + /// 图片消息 + /// + Image = 10, + /// + /// 链接 + /// + Link = 20, + /// + /// 视频 + /// + Video = 30, + /// + /// 音频 + /// + Voice = 40, + /// + /// 文件 + /// + File = 50, + /// + /// 通知 + /// 一般用于错误处理 + /// + Notifier = 100, } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/NullMessageBlocker.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/NullMessageBlocker.cs index 27d8584dd..40af3928b 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/NullMessageBlocker.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/NullMessageBlocker.cs @@ -1,14 +1,13 @@ using System.Threading.Tasks; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.IM.Messages +namespace LINGYUN.Abp.IM.Messages; + +[Dependency(TryRegister = true)] +public class NullMessageBlocker : IMessageBlocker, ISingletonDependency { - [Dependency(TryRegister = true)] - public class NullMessageBlocker : IMessageBlocker, ISingletonDependency + public Task InterceptAsync(ChatMessage message) { - public Task InterceptAsync(ChatMessage message) - { - return Task.CompletedTask; - } + return Task.CompletedTask; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/NullMessageProcessor.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/NullMessageProcessor.cs index f6c3ad18f..3b7dbd875 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/NullMessageProcessor.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/NullMessageProcessor.cs @@ -1,19 +1,18 @@ using System.Threading.Tasks; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.IM.Messages +namespace LINGYUN.Abp.IM.Messages; + +[Dependency(TryRegister = true)] +public class NullMessageProcessor : IMessageProcessor, ISingletonDependency { - [Dependency(TryRegister = true)] - public class NullMessageProcessor : IMessageProcessor, ISingletonDependency + public Task ReadAsync(ChatMessage message) { - public Task ReadAsync(ChatMessage message) - { - return Task.CompletedTask; - } + return Task.CompletedTask; + } - public Task ReCallAsync(ChatMessage message) - { - return Task.CompletedTask; - } + public Task ReCallAsync(ChatMessage message) + { + return Task.CompletedTask; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/NullUserOnlineChanger.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/NullUserOnlineChanger.cs index 9c379f8bc..aa5921266 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/NullUserOnlineChanger.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/NullUserOnlineChanger.cs @@ -3,14 +3,13 @@ using System.Threading.Tasks; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.IM +namespace LINGYUN.Abp.IM; + +[Dependency(TryRegister = true)] +public class NullUserOnlineChanger : IUserOnlineChanger, ISingletonDependency { - [Dependency(TryRegister = true)] - public class NullUserOnlineChanger : IUserOnlineChanger, ISingletonDependency + public Task ChangeAsync(Guid? tenantId, Guid userId, UserOnlineState state, CancellationToken cancellationToken = default) { - public Task ChangeAsync(Guid? tenantId, Guid userId, UserOnlineState state, CancellationToken cancellationToken = default) - { - return Task.CompletedTask; - } + return Task.CompletedTask; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/NullUserOnlineChecker.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/NullUserOnlineChecker.cs index 921cf5c16..d59158569 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/NullUserOnlineChecker.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/NullUserOnlineChecker.cs @@ -3,14 +3,13 @@ using System.Threading.Tasks; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.IM +namespace LINGYUN.Abp.IM; + +[Dependency(TryRegister = true)] +public class NullUserOnlineChecker : IUserOnlineChecker, ISingletonDependency { - [Dependency(TryRegister = true)] - public class NullUserOnlineChecker : IUserOnlineChecker, ISingletonDependency + public Task CheckAsync(Guid? tenantId, Guid userId, CancellationToken cancellationToken = default) { - public Task CheckAsync(Guid? tenantId, Guid userId, CancellationToken cancellationToken = default) - { - return Task.FromResult(false); - } + return Task.FromResult(false); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Settings/AbpIMSettingNames.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Settings/AbpIMSettingNames.cs index 556b517a0..c6e7b7224 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Settings/AbpIMSettingNames.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Settings/AbpIMSettingNames.cs @@ -2,10 +2,9 @@ using System.Collections.Generic; using System.Text; -namespace LINGYUN.Abp.IM.Settings +namespace LINGYUN.Abp.IM.Settings; + +public static class AbpIMSettingNames { - public static class AbpIMSettingNames - { - } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Sex.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Sex.cs index 9421daaa5..ab0db8af4 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Sex.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Sex.cs @@ -1,9 +1,8 @@ -namespace LINGYUN.Abp.IM +namespace LINGYUN.Abp.IM; + +public enum Sex { - public enum Sex - { - Male, - Female, - Other - } + Male, + Female, + Other } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/UserCard.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/UserCard.cs index 9489b1ba7..788d860d0 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/UserCard.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/UserCard.cs @@ -1,47 +1,46 @@ using System; -namespace LINGYUN.Abp.IM +namespace LINGYUN.Abp.IM; + +public class UserCard { - public class UserCard - { - public Guid? TenantId { get; set; } + public Guid? TenantId { get; set; } - public Guid UserId { get; set; } + public Guid UserId { get; set; } - #region 细粒度的用户资料 + #region 细粒度的用户资料 - public string UserName { get; set; } - /// - /// 头像 - /// - public string AvatarUrl { get; set; } - /// - /// 昵称 - /// - public string NickName { get; set; } - /// - /// 年龄 - /// - public int Age { get; set; } - /// - /// 性别 - /// - public Sex Sex { get; set; } - /// - /// 签名 - /// - public string Sign { get; set; } - /// - /// 说明 - /// - public string Description { get; set; } - /// - /// 生日 - /// - public DateTime? Birthday { get; set; } + public string UserName { get; set; } + /// + /// 头像 + /// + public string AvatarUrl { get; set; } + /// + /// 昵称 + /// + public string NickName { get; set; } + /// + /// 年龄 + /// + public int Age { get; set; } + /// + /// 性别 + /// + public Sex Sex { get; set; } + /// + /// 签名 + /// + public string Sign { get; set; } + /// + /// 说明 + /// + public string Description { get; set; } + /// + /// 生日 + /// + public DateTime? Birthday { get; set; } - public bool Online { get; set; } + public bool Online { get; set; } - #endregion - } + #endregion } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/UserOnlineState.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/UserOnlineState.cs index fb9e01d15..eff2fbbe7 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/UserOnlineState.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.IM/LINGYUN/Abp/IM/UserOnlineState.cs @@ -1,10 +1,9 @@ -namespace LINGYUN.Abp.IM +namespace LINGYUN.Abp.IM; + +public enum UserOnlineState { - public enum UserOnlineState - { - Online, - Offline, - Busy, - Stealth - } + Online, + Offline, + Busy, + Stealth } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN.Abp.MessageService.Application.Contracts.csproj b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN.Abp.MessageService.Application.Contracts.csproj index 72ebb1e21..11d025d48 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN.Abp.MessageService.Application.Contracts.csproj +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN.Abp.MessageService.Application.Contracts.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.MessageService.Application.Contracts + LINGYUN.Abp.MessageService.Application.Contracts + false + false + false diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/AbpMessageServiceApplicationContractsModule.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/AbpMessageServiceApplicationContractsModule.cs index d2fc22278..5daae4b20 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/AbpMessageServiceApplicationContractsModule.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/AbpMessageServiceApplicationContractsModule.cs @@ -3,24 +3,23 @@ using Volo.Abp.Modularity; using Volo.Abp.VirtualFileSystem; -namespace LINGYUN.Abp.MessageService +namespace LINGYUN.Abp.MessageService; + +[DependsOn(typeof(AbpMessageServiceDomainSharedModule))] +public class AbpMessageServiceApplicationContractsModule : AbpModule { - [DependsOn(typeof(AbpMessageServiceDomainSharedModule))] - public class AbpMessageServiceApplicationContractsModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + Configure(options => { - Configure(options => - { - options.FileSets.AddEmbedded(); - }); + options.FileSets.AddEmbedded(); + }); - Configure(options => - { - options.Resources - .Get() - .AddVirtualJson("/LINGYUN/Abp/MessageService/Localization/ApplicationContracts"); - }); - } + Configure(options => + { + options.Resources + .Get() + .AddVirtualJson("/LINGYUN/Abp/MessageService/Localization/ApplicationContracts"); + }); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/AbpMessageServiceConsts.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/AbpMessageServiceConsts.cs index d0b58ada0..34a7d4236 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/AbpMessageServiceConsts.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/AbpMessageServiceConsts.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.MessageService +namespace LINGYUN.Abp.MessageService; + +public class AbpMessageServiceConsts { - public class AbpMessageServiceConsts - { - public const string RemoteServiceName = "MessageService"; - } + public const string RemoteServiceName = "MessageService"; } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/ChatMessageSendResultDto.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/ChatMessageSendResultDto.cs index c400f6b94..a6aaab39f 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/ChatMessageSendResultDto.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/ChatMessageSendResultDto.cs @@ -1,11 +1,10 @@ -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public class ChatMessageSendResultDto { - public class ChatMessageSendResultDto + public string MessageId { get; } + public ChatMessageSendResultDto(string messageId) { - public string MessageId { get; } - public ChatMessageSendResultDto(string messageId) - { - MessageId = messageId; - } + MessageId = messageId; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/GetMyFriendsDto.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/GetMyFriendsDto.cs index 4d1f6a7b5..789b28ade 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/GetMyFriendsDto.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/GetMyFriendsDto.cs @@ -1,9 +1,8 @@ using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public class GetMyFriendsDto : ISortedResultRequest { - public class GetMyFriendsDto : ISortedResultRequest - { - public string Sorting { get; set; } - } + public string Sorting { get; set; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/GetUserLastMessageDto.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/GetUserLastMessageDto.cs index ff90a85d5..0365392b4 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/GetUserLastMessageDto.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/GetUserLastMessageDto.cs @@ -1,12 +1,11 @@ using LINGYUN.Abp.IM.Messages; using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public class GetUserLastMessageDto : ILimitedResultRequest, ISortedResultRequest { - public class GetUserLastMessageDto : ILimitedResultRequest, ISortedResultRequest - { - public int MaxResultCount { get; set; } - public string Sorting { get; set; } - public MessageState? State { get; set; } - } + public int MaxResultCount { get; set; } + public string Sorting { get; set; } + public MessageState? State { get; set; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/GroupMessageGetByPagedDto.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/GroupMessageGetByPagedDto.cs index 6c64ff096..c7e4f435f 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/GroupMessageGetByPagedDto.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/GroupMessageGetByPagedDto.cs @@ -2,13 +2,12 @@ using System.ComponentModel.DataAnnotations; using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public class GroupMessageGetByPagedDto : PagedAndSortedResultRequestDto { - public class GroupMessageGetByPagedDto : PagedAndSortedResultRequestDto - { - [Required] - public long GroupId { get; set; } - public string Filter { get; set; } - public MessageType? MessageType { get; set; } - } + [Required] + public long GroupId { get; set; } + public string Filter { get; set; } + public MessageType? MessageType { get; set; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/MyFriendAddRequestDto.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/MyFriendAddRequestDto.cs index d68bbd2f3..ba2819d38 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/MyFriendAddRequestDto.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/MyFriendAddRequestDto.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public class MyFriendAddRequestDto : MyFriendOperationDto { - public class MyFriendAddRequestDto : MyFriendOperationDto - { - public string RemarkName { get; set; } - } + public string RemarkName { get; set; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/MyFriendCreateDto.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/MyFriendCreateDto.cs index 9fcc3e309..b0703286e 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/MyFriendCreateDto.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/MyFriendCreateDto.cs @@ -1,6 +1,5 @@ -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public class MyFriendCreateDto : MyFriendOperationDto { - public class MyFriendCreateDto : MyFriendOperationDto - { - } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/MyFriendGetByPagedDto.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/MyFriendGetByPagedDto.cs index 0ad728d55..5a7fe0811 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/MyFriendGetByPagedDto.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/MyFriendGetByPagedDto.cs @@ -1,13 +1,12 @@ using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public class MyFriendGetByPagedDto : PagedAndSortedResultRequestDto { - public class MyFriendGetByPagedDto : PagedAndSortedResultRequestDto - { - public string Filter { get; set; } - } + public string Filter { get; set; } +} - public class MyLastContractFriendGetByPagedDto : PagedResultRequestDto - { - } +public class MyLastContractFriendGetByPagedDto : PagedResultRequestDto +{ } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/MyFriendOperationDto.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/MyFriendOperationDto.cs index 4b1021666..e00688601 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/MyFriendOperationDto.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/MyFriendOperationDto.cs @@ -1,11 +1,10 @@ using System; using System.ComponentModel.DataAnnotations; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public class MyFriendOperationDto { - public class MyFriendOperationDto - { - [Required] - public Guid FriendId { get; set; } - } + [Required] + public Guid FriendId { get; set; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/UserGroupGetByGroupIdDto.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/UserGroupGetByGroupIdDto.cs index e44a957f9..0be830632 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/UserGroupGetByGroupIdDto.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/UserGroupGetByGroupIdDto.cs @@ -1,10 +1,9 @@ using System.ComponentModel.DataAnnotations; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public class UserGroupGetByGroupIdDto { - public class UserGroupGetByGroupIdDto - { - [Required] - public long GroupId { get; set; } - } + [Required] + public long GroupId { get; set; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/UserMessageGetByPagedDto.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/UserMessageGetByPagedDto.cs index 444dfaf37..387af5921 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/UserMessageGetByPagedDto.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/UserMessageGetByPagedDto.cs @@ -3,13 +3,12 @@ using System.ComponentModel.DataAnnotations; using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public class UserMessageGetByPagedDto : PagedAndSortedResultRequestDto { - public class UserMessageGetByPagedDto : PagedAndSortedResultRequestDto - { - [Required] - public Guid ReceiveUserId { get; set; } - public string Filter { get; set; } - public MessageType? MessageType { get; set; } - } + [Required] + public Guid ReceiveUserId { get; set; } + public string Filter { get; set; } + public MessageType? MessageType { get; set; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/IChatAppService.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/IChatAppService.cs index 196c5924a..e9c3ea3ef 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/IChatAppService.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/IChatAppService.cs @@ -3,34 +3,33 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public interface IChatAppService : IApplicationService { - public interface IChatAppService : IApplicationService - { - /// - /// 发送消息 - /// - /// - /// - Task SendMessageAsync(ChatMessage input); - /// - /// 获取群组消息 - /// - /// - /// - Task> GetMyGroupMessageAsync(GroupMessageGetByPagedDto input); - /// - /// 获取我的消息 - /// - /// - /// - Task> GetMyChatMessageAsync(UserMessageGetByPagedDto input); - /// - /// 获取我最近的消息 - /// - /// - /// - Task> GetMyLastChatMessageAsync(GetUserLastMessageDto input); - //TOTO: 还应该有获取我的未读消息 获取我的未读群组消息 - } + /// + /// 发送消息 + /// + /// + /// + Task SendMessageAsync(ChatMessage input); + /// + /// 获取群组消息 + /// + /// + /// + Task> GetMyGroupMessageAsync(GroupMessageGetByPagedDto input); + /// + /// 获取我的消息 + /// + /// + /// + Task> GetMyChatMessageAsync(UserMessageGetByPagedDto input); + /// + /// 获取我最近的消息 + /// + /// + /// + Task> GetMyLastChatMessageAsync(GetUserLastMessageDto input); + //TOTO: 还应该有获取我的未读消息 获取我的未读群组消息 } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/IMyFriendAppService.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/IMyFriendAppService.cs index 47823eaf2..23952eef9 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/IMyFriendAppService.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/IMyFriendAppService.cs @@ -4,20 +4,19 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public interface IMyFriendAppService : IApplicationService { - public interface IMyFriendAppService : IApplicationService - { - Task GetAsync(Guid friendId); + Task GetAsync(Guid friendId); - Task> GetListAsync(MyFriendGetByPagedDto input); + Task> GetListAsync(MyFriendGetByPagedDto input); - Task> GetAllListAsync(GetMyFriendsDto input); + Task> GetAllListAsync(GetMyFriendsDto input); - Task CreateAsync(MyFriendCreateDto input); + Task CreateAsync(MyFriendCreateDto input); - Task DeleteAsync(MyFriendOperationDto input); + Task DeleteAsync(MyFriendOperationDto input); - Task AddRequestAsync(MyFriendAddRequestDto input); - } + Task AddRequestAsync(MyFriendAddRequestDto input); } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/GroupAcceptUserDto.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/GroupAcceptUserDto.cs index 68715c65e..e44cbed80 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/GroupAcceptUserDto.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/GroupAcceptUserDto.cs @@ -1,19 +1,18 @@ using System; using System.ComponentModel.DataAnnotations; -namespace LINGYUN.Abp.MessageService.Groups +namespace LINGYUN.Abp.MessageService.Groups; + +public class GroupAcceptUserDto { - public class GroupAcceptUserDto - { - [Required] - public Guid UserId { get; set; } + [Required] + public Guid UserId { get; set; } - [Required] - public long GroupId { get; set; } + [Required] + public long GroupId { get; set; } - public bool AllowAccept { get; set; } = true; + public bool AllowAccept { get; set; } = true; - [StringLength(64)] - public string RejectReason { get; set; } - } + [StringLength(64)] + public string RejectReason { get; set; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/GroupRemoveUserDto.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/GroupRemoveUserDto.cs index 367c3d96a..5b1e60f06 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/GroupRemoveUserDto.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/GroupRemoveUserDto.cs @@ -1,14 +1,13 @@ using System; using System.ComponentModel.DataAnnotations; -namespace LINGYUN.Abp.MessageService.Groups +namespace LINGYUN.Abp.MessageService.Groups; + +public class GroupRemoveUserDto { - public class GroupRemoveUserDto - { - [Required] - public Guid UserId { get; set; } + [Required] + public Guid UserId { get; set; } - [Required] - public long GroupId { get; set; } - } + [Required] + public long GroupId { get; set; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/GroupSearchInput.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/GroupSearchInput.cs index 2eea0849b..6c37a8086 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/GroupSearchInput.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/GroupSearchInput.cs @@ -1,9 +1,8 @@ using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.MessageService.Groups +namespace LINGYUN.Abp.MessageService.Groups; + +public class GroupSearchInput : PagedAndSortedResultRequestDto { - public class GroupSearchInput : PagedAndSortedResultRequestDto - { - public string Filter { get; set; } - } + public string Filter { get; set; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/GroupUserGetByPagedDto.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/GroupUserGetByPagedDto.cs index 2bb8c2797..155f37241 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/GroupUserGetByPagedDto.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/GroupUserGetByPagedDto.cs @@ -1,13 +1,12 @@ using System.ComponentModel.DataAnnotations; using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.MessageService.Groups +namespace LINGYUN.Abp.MessageService.Groups; + +public class GroupUserGetByPagedDto : PagedAndSortedResultRequestDto { - public class GroupUserGetByPagedDto : PagedAndSortedResultRequestDto - { - [Required] - public long GroupId { get; set; } + [Required] + public long GroupId { get; set; } - public string Filter { get; set; } - } + public string Filter { get; set; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/UserJoinGroupDto.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/UserJoinGroupDto.cs index f785a80ec..12636997b 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/UserJoinGroupDto.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/Dto/UserJoinGroupDto.cs @@ -1,14 +1,13 @@ using System.ComponentModel.DataAnnotations; -namespace LINGYUN.Abp.MessageService.Groups +namespace LINGYUN.Abp.MessageService.Groups; + +public class UserJoinGroupDto { - public class UserJoinGroupDto - { - [Required] - public long GroupId { get; set; } + [Required] + public long GroupId { get; set; } - [Required] - [StringLength(100)] - public string JoinInfo { get; set; } - } + [Required] + [StringLength(100)] + public string JoinInfo { get; set; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/IGroupAppService.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/IGroupAppService.cs index deb5e4711..703dad894 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/IGroupAppService.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/IGroupAppService.cs @@ -3,21 +3,20 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; -namespace LINGYUN.Abp.MessageService.Groups +namespace LINGYUN.Abp.MessageService.Groups; + +public interface IGroupAppService : IApplicationService { - public interface IGroupAppService : IApplicationService - { - /// - /// 搜索群组 - /// - /// - /// - Task> SearchAsync(GroupSearchInput input); - /// - /// 获取群组信息 - /// - /// - /// - Task GetAsync(string groupId); - } + /// + /// 搜索群组 + /// + /// + /// + Task> SearchAsync(GroupSearchInput input); + /// + /// 获取群组信息 + /// + /// + /// + Task GetAsync(string groupId); } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/IUserGroupAppService.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/IUserGroupAppService.cs index 90d5fd3dc..c5a30e5e8 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/IUserGroupAppService.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Groups/IUserGroupAppService.cs @@ -3,38 +3,37 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; -namespace LINGYUN.Abp.MessageService.Groups +namespace LINGYUN.Abp.MessageService.Groups; + +public interface IUserGroupAppService : IApplicationService { - public interface IUserGroupAppService : IApplicationService - { - /// - /// 申请加入群组 - /// - /// - /// - Task ApplyJoinGroupAsync(UserJoinGroupDto input); - /// - /// 获取我的群组 - /// - /// - Task> GetMyGroupsAsync(); - /// - /// 获取群组用户 - /// - /// - /// - Task> GetGroupUsersAsync(GroupUserGetByPagedDto input); - /// - /// 处理用户群组申请 - /// - /// - /// - Task GroupAcceptUserAsync(GroupAcceptUserDto input); - /// - /// 群组移除用户 - /// - /// - /// - Task GroupRemoveUserAsync(GroupRemoveUserDto input); - } + /// + /// 申请加入群组 + /// + /// + /// + Task ApplyJoinGroupAsync(UserJoinGroupDto input); + /// + /// 获取我的群组 + /// + /// + Task> GetMyGroupsAsync(); + /// + /// 获取群组用户 + /// + /// + /// + Task> GetGroupUsersAsync(GroupUserGetByPagedDto input); + /// + /// 处理用户群组申请 + /// + /// + /// + Task GroupAcceptUserAsync(GroupAcceptUserDto input); + /// + /// 群组移除用户 + /// + /// + /// + Task GroupRemoveUserAsync(GroupRemoveUserDto input); } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Permissions/MessageServicePermissions.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Permissions/MessageServicePermissions.cs index 62364251c..355bc2ca4 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Permissions/MessageServicePermissions.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Permissions/MessageServicePermissions.cs @@ -1,23 +1,22 @@ -namespace LINGYUN.Abp.MessageService.Permissions +namespace LINGYUN.Abp.MessageService.Permissions; + +public class MessageServicePermissions { - public class MessageServicePermissions - { - public const string GroupName = "MessageService"; + public const string GroupName = "MessageService"; - public class Notification - { - public const string Default = GroupName + ".Notification"; + public class Notification + { + public const string Default = GroupName + ".Notification"; - public const string Delete = Default + ".Delete"; - } + public const string Delete = Default + ".Delete"; + } - public class Hangfire - { - public const string Default = GroupName + ".Hangfire"; + public class Hangfire + { + public const string Default = GroupName + ".Hangfire"; - public const string Dashboard = Default + ".Dashboard"; + public const string Dashboard = Default + ".Dashboard"; - public const string ManageQueue = Default + ".ManageQueue"; - } + public const string ManageQueue = Default + ".ManageQueue"; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Permissions/MessageServicePermissionsDefinitionProvider.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Permissions/MessageServicePermissionsDefinitionProvider.cs index edb536b0b..9c49b4d89 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Permissions/MessageServicePermissionsDefinitionProvider.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Permissions/MessageServicePermissionsDefinitionProvider.cs @@ -2,25 +2,24 @@ using Volo.Abp.Authorization.Permissions; using Volo.Abp.Localization; -namespace LINGYUN.Abp.MessageService.Permissions +namespace LINGYUN.Abp.MessageService.Permissions; + +public class MessageServicePermissionsDefinitionProvider : PermissionDefinitionProvider { - public class MessageServicePermissionsDefinitionProvider : PermissionDefinitionProvider + public override void Define(IPermissionDefinitionContext context) { - public override void Define(IPermissionDefinitionContext context) - { - var group = context.AddGroup(MessageServicePermissions.GroupName, L("Permission:MessageService")); + var group = context.AddGroup(MessageServicePermissions.GroupName, L("Permission:MessageService")); - var noticeGroup = group.AddPermission(MessageServicePermissions.Notification.Default, L("Permission:Notification")); - noticeGroup.AddChild(MessageServicePermissions.Notification.Delete, L("Permission:Delete")); + var noticeGroup = group.AddPermission(MessageServicePermissions.Notification.Default, L("Permission:Notification")); + noticeGroup.AddChild(MessageServicePermissions.Notification.Delete, L("Permission:Delete")); - var hangfirePermission = group.AddPermission(MessageServicePermissions.Hangfire.Default, L("Permission:Hangfire")); - hangfirePermission.AddChild(MessageServicePermissions.Hangfire.Dashboard, L("Permission:Dashboard")); - hangfirePermission.AddChild(MessageServicePermissions.Hangfire.ManageQueue, L("Permission:ManageQueue")); - } + var hangfirePermission = group.AddPermission(MessageServicePermissions.Hangfire.Default, L("Permission:Hangfire")); + hangfirePermission.AddChild(MessageServicePermissions.Hangfire.Dashboard, L("Permission:Dashboard")); + hangfirePermission.AddChild(MessageServicePermissions.Hangfire.ManageQueue, L("Permission:ManageQueue")); + } - private static LocalizableString L(string name) - { - return LocalizableString.Create(name); - } + private static LocalizableString L(string name) + { + return LocalizableString.Create(name); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/LINGYUN.Abp.MessageService.Application.csproj b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/LINGYUN.Abp.MessageService.Application.csproj index 28f790be5..a47aabb7b 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/LINGYUN.Abp.MessageService.Application.csproj +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/LINGYUN.Abp.MessageService.Application.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.MessageService.Application + LINGYUN.Abp.MessageService.Application + false + false + false diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/AbpMessageServiceApplicationAutoMapperProfile.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/AbpMessageServiceApplicationAutoMapperProfile.cs index f2d529324..4d9772091 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/AbpMessageServiceApplicationAutoMapperProfile.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/AbpMessageServiceApplicationAutoMapperProfile.cs @@ -1,11 +1,10 @@ using AutoMapper; -namespace LINGYUN.Abp.MessageService +namespace LINGYUN.Abp.MessageService; + +public class AbpMessageServiceApplicationAutoMapperProfile : Profile { - public class AbpMessageServiceApplicationAutoMapperProfile : Profile + public AbpMessageServiceApplicationAutoMapperProfile() { - public AbpMessageServiceApplicationAutoMapperProfile() - { - } } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/AbpMessageServiceApplicationModule.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/AbpMessageServiceApplicationModule.cs index a3da1eb36..f5bfaa51c 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/AbpMessageServiceApplicationModule.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/AbpMessageServiceApplicationModule.cs @@ -1,19 +1,18 @@ using Volo.Abp.AutoMapper; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.MessageService +namespace LINGYUN.Abp.MessageService; + +[DependsOn( + typeof(AbpMessageServiceApplicationContractsModule), + typeof(AbpMessageServiceDomainModule))] +public class AbpMessageServiceApplicationModule : AbpModule { - [DependsOn( - typeof(AbpMessageServiceApplicationContractsModule), - typeof(AbpMessageServiceDomainModule))] - public class AbpMessageServiceApplicationModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + Configure(options => { - Configure(options => - { - options.AddProfile(validate: true); - }); - } + options.AddProfile(validate: true); + }); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/AbpMessageServiceApplicationServiceBase.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/AbpMessageServiceApplicationServiceBase.cs index f0e47301c..f95ab7a99 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/AbpMessageServiceApplicationServiceBase.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/AbpMessageServiceApplicationServiceBase.cs @@ -1,14 +1,13 @@ using LINGYUN.Abp.MessageService.Localization; using Volo.Abp.Application.Services; -namespace LINGYUN.Abp.MessageService +namespace LINGYUN.Abp.MessageService; + +public abstract class AbpMessageServiceApplicationServiceBase : ApplicationService { - public abstract class AbpMessageServiceApplicationServiceBase : ApplicationService + protected AbpMessageServiceApplicationServiceBase() { - protected AbpMessageServiceApplicationServiceBase() - { - LocalizationResource = typeof(MessageServiceResource); - ObjectMapperContext = typeof(AbpMessageServiceApplicationModule); - } + LocalizationResource = typeof(MessageServiceResource); + ObjectMapperContext = typeof(AbpMessageServiceApplicationModule); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Chat/ChatAppService.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Chat/ChatAppService.cs index e1e4eb89c..a82c05a62 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Chat/ChatAppService.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Chat/ChatAppService.cs @@ -7,97 +7,96 @@ using Volo.Abp.Application.Services; using Volo.Abp.Users; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +[Authorize] +public class ChatAppService : ApplicationService, IChatAppService { - [Authorize] - public class ChatAppService : ApplicationService, IChatAppService - { - protected IMessageSender MessageSender => LazyServiceProvider.LazyGetRequiredService(); + protected IMessageSender MessageSender => LazyServiceProvider.LazyGetRequiredService(); - private readonly IUserGroupStore _userGroupStore; - private readonly IMessageStore _messageStore; + private readonly IUserGroupStore _userGroupStore; + private readonly IMessageStore _messageStore; - public ChatAppService( - IMessageStore messageStore, - IUserGroupStore userGroupStore) - { - _messageStore = messageStore; - _userGroupStore = userGroupStore; - } + public ChatAppService( + IMessageStore messageStore, + IUserGroupStore userGroupStore) + { + _messageStore = messageStore; + _userGroupStore = userGroupStore; + } - public async virtual Task> GetMyChatMessageAsync(UserMessageGetByPagedDto input) - { - var chatMessageCount = await _messageStore - .GetChatMessageCountAsync( - CurrentTenant.Id, - CurrentUser.GetId(), - input.ReceiveUserId, - input.MessageType, - input.Filter); - - var chatMessages = await _messageStore - .GetChatMessageAsync( - CurrentTenant.Id, - CurrentUser.GetId(), - input.ReceiveUserId, - input.MessageType, - input.Filter, - input.Sorting, - input.SkipCount, - input.MaxResultCount); - - return new PagedResultDto(chatMessageCount, chatMessages); - } + public async virtual Task> GetMyChatMessageAsync(UserMessageGetByPagedDto input) + { + var chatMessageCount = await _messageStore + .GetChatMessageCountAsync( + CurrentTenant.Id, + CurrentUser.GetId(), + input.ReceiveUserId, + input.MessageType, + input.Filter); + + var chatMessages = await _messageStore + .GetChatMessageAsync( + CurrentTenant.Id, + CurrentUser.GetId(), + input.ReceiveUserId, + input.MessageType, + input.Filter, + input.Sorting, + input.SkipCount, + input.MaxResultCount); + + return new PagedResultDto(chatMessageCount, chatMessages); + } - public async virtual Task> GetMyLastChatMessageAsync(GetUserLastMessageDto input) - { - var chatMessages = await _messageStore - .GetLastChatMessagesAsync( - CurrentTenant.Id, - CurrentUser.GetId(), - input.State, - input.Sorting, - input.MaxResultCount); - - return new ListResultDto(chatMessages); - } + public async virtual Task> GetMyLastChatMessageAsync(GetUserLastMessageDto input) + { + var chatMessages = await _messageStore + .GetLastChatMessagesAsync( + CurrentTenant.Id, + CurrentUser.GetId(), + input.State, + input.Sorting, + input.MaxResultCount); + + return new ListResultDto(chatMessages); + } - public async virtual Task> GetMyGroupMessageAsync(GroupMessageGetByPagedDto input) + public async virtual Task> GetMyGroupMessageAsync(GroupMessageGetByPagedDto input) + { + if (!await _userGroupStore.MemberHasInGroupAsync(CurrentTenant.Id, input.GroupId, CurrentUser.GetId())) { - if (!await _userGroupStore.MemberHasInGroupAsync(CurrentTenant.Id, input.GroupId, CurrentUser.GetId())) - { - throw new BusinessException(MessageServiceErrorCodes.YouHaveNotJoinedGroup); - } - - var groupMessageCount = await _messageStore - .GetGroupMessageCountAsync( - CurrentTenant.Id, - input.GroupId, - input.MessageType, - input.Filter); - - var groupMessages = await _messageStore - .GetGroupMessageAsync( - CurrentTenant.Id, - input.GroupId, - input.MessageType, - input.Filter, - input.Sorting, - input.SkipCount, - input.MaxResultCount); - - return new PagedResultDto(groupMessageCount, groupMessages); + throw new BusinessException(MessageServiceErrorCodes.YouHaveNotJoinedGroup); } + var groupMessageCount = await _messageStore + .GetGroupMessageCountAsync( + CurrentTenant.Id, + input.GroupId, + input.MessageType, + input.Filter); + + var groupMessages = await _messageStore + .GetGroupMessageAsync( + CurrentTenant.Id, + input.GroupId, + input.MessageType, + input.Filter, + input.Sorting, + input.SkipCount, + input.MaxResultCount); + + return new PagedResultDto(groupMessageCount, groupMessages); + } - public async virtual Task SendMessageAsync(ChatMessage input) - { - // TODO:向其他租户发送消息? - input.TenantId ??= CurrentTenant.Id; - var messageId = await MessageSender.SendMessageAsync(input); + public async virtual Task SendMessageAsync(ChatMessage input) + { + // TODO:向其他租户发送消息? + input.TenantId ??= CurrentTenant.Id; - return new ChatMessageSendResultDto(messageId); - } + var messageId = await MessageSender.SendMessageAsync(input); + + return new ChatMessageSendResultDto(messageId); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Chat/MyFriendAppService.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Chat/MyFriendAppService.cs index 56cf40e63..d39d00a65 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Chat/MyFriendAppService.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Chat/MyFriendAppService.cs @@ -7,71 +7,70 @@ using Volo.Abp.Application.Services; using Volo.Abp.Users; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +[Authorize] +public class MyFriendAppService : ApplicationService, IMyFriendAppService { - [Authorize] - public class MyFriendAppService : ApplicationService, IMyFriendAppService - { - protected IFriendStore FriendStore { get; } + protected IFriendStore FriendStore { get; } - protected IUserChatCardRepository UserChatCardRepository { get; } + protected IUserChatCardRepository UserChatCardRepository { get; } - public MyFriendAppService( - IFriendStore friendStore, - IUserChatCardRepository userChatCardRepository) - { - FriendStore = friendStore; - UserChatCardRepository = userChatCardRepository; + public MyFriendAppService( + IFriendStore friendStore, + IUserChatCardRepository userChatCardRepository) + { + FriendStore = friendStore; + UserChatCardRepository = userChatCardRepository; - LocalizationResource = typeof(MessageServiceResource); - } + LocalizationResource = typeof(MessageServiceResource); + } - public async virtual Task GetAsync(Guid friendId) - { - return await FriendStore.GetMemberAsync(CurrentTenant.Id, CurrentUser.GetId(), friendId); - } + public async virtual Task GetAsync(Guid friendId) + { + return await FriendStore.GetMemberAsync(CurrentTenant.Id, CurrentUser.GetId(), friendId); + } - public async virtual Task CreateAsync(MyFriendCreateDto input) - { - var friendCard = await UserChatCardRepository.GetMemberAsync(input.FriendId); + public async virtual Task CreateAsync(MyFriendCreateDto input) + { + var friendCard = await UserChatCardRepository.GetMemberAsync(input.FriendId); - await FriendStore.AddMemberAsync( - CurrentTenant.Id, - CurrentUser.GetId(), - input.FriendId, friendCard?.NickName ?? friendCard?.UserName ?? input.FriendId.ToString()); - } + await FriendStore.AddMemberAsync( + CurrentTenant.Id, + CurrentUser.GetId(), + input.FriendId, friendCard?.NickName ?? friendCard?.UserName ?? input.FriendId.ToString()); + } - public async virtual Task AddRequestAsync(MyFriendAddRequestDto input) - { - await FriendStore.AddRequestAsync(CurrentTenant.Id, CurrentUser.GetId(), input.FriendId, input.RemarkName, L["AddNewFriendBySearchId"]); - } + public async virtual Task AddRequestAsync(MyFriendAddRequestDto input) + { + await FriendStore.AddRequestAsync(CurrentTenant.Id, CurrentUser.GetId(), input.FriendId, input.RemarkName, L["AddNewFriendBySearchId"]); + } - public async virtual Task DeleteAsync(MyFriendOperationDto input) - { - await FriendStore.RemoveMemberAsync(CurrentTenant.Id, CurrentUser.GetId(), input.FriendId); - } + public async virtual Task DeleteAsync(MyFriendOperationDto input) + { + await FriendStore.RemoveMemberAsync(CurrentTenant.Id, CurrentUser.GetId(), input.FriendId); + } - public async virtual Task> GetAllListAsync(GetMyFriendsDto input) - { - var myFriends = await FriendStore - .GetListAsync( - CurrentTenant.Id, - CurrentUser.GetId(), - input.Sorting); + public async virtual Task> GetAllListAsync(GetMyFriendsDto input) + { + var myFriends = await FriendStore + .GetListAsync( + CurrentTenant.Id, + CurrentUser.GetId(), + input.Sorting); - return new ListResultDto(myFriends); - } + return new ListResultDto(myFriends); + } - public async virtual Task> GetListAsync(MyFriendGetByPagedDto input) - { - var myFrientCount = await FriendStore.GetCountAsync(CurrentTenant.Id, CurrentUser.GetId()); + public async virtual Task> GetListAsync(MyFriendGetByPagedDto input) + { + var myFrientCount = await FriendStore.GetCountAsync(CurrentTenant.Id, CurrentUser.GetId()); - var myFriends = await FriendStore - .GetPagedListAsync(CurrentTenant.Id, CurrentUser.GetId(), - input.Filter, input.Sorting, - input.SkipCount, input.MaxResultCount); + var myFriends = await FriendStore + .GetPagedListAsync(CurrentTenant.Id, CurrentUser.GetId(), + input.Filter, input.Sorting, + input.SkipCount, input.MaxResultCount); - return new PagedResultDto(myFrientCount, myFriends); - } + return new PagedResultDto(myFrientCount, myFriends); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Groups/GroupAppService.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Groups/GroupAppService.cs index fb0f52cde..9a05ad749 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Groups/GroupAppService.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Groups/GroupAppService.cs @@ -3,38 +3,37 @@ using System.Threading.Tasks; using Volo.Abp.Application.Dtos; -namespace LINGYUN.Abp.MessageService.Groups +namespace LINGYUN.Abp.MessageService.Groups; + +[AllowAnonymous] +public class GroupAppService : AbpMessageServiceApplicationServiceBase, IGroupAppService { - [AllowAnonymous] - public class GroupAppService : AbpMessageServiceApplicationServiceBase, IGroupAppService - { - private readonly IGroupStore _groupStore; + private readonly IGroupStore _groupStore; - public GroupAppService( - IGroupStore groupStore) - { - _groupStore = groupStore; - } + public GroupAppService( + IGroupStore groupStore) + { + _groupStore = groupStore; + } - public async virtual Task GetAsync(string groupId) - { - return await _groupStore.GetAsync(CurrentTenant.Id, groupId); - } + public async virtual Task GetAsync(string groupId) + { + return await _groupStore.GetAsync(CurrentTenant.Id, groupId); + } - public async virtual Task> SearchAsync(GroupSearchInput input) - { - var count = await _groupStore.GetCountAsync( - CurrentTenant.Id, - input.Filter); + public async virtual Task> SearchAsync(GroupSearchInput input) + { + var count = await _groupStore.GetCountAsync( + CurrentTenant.Id, + input.Filter); - var groups = await _groupStore.GetListAsync( - CurrentTenant.Id, - input.Filter, - input.Sorting, - input.SkipCount, - input.MaxResultCount); + var groups = await _groupStore.GetListAsync( + CurrentTenant.Id, + input.Filter, + input.Sorting, + input.SkipCount, + input.MaxResultCount); - return new PagedResultDto(count, groups); - } + return new PagedResultDto(count, groups); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Groups/UserGroupAppService.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Groups/UserGroupAppService.cs index c264f84b0..67e8fa25f 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Groups/UserGroupAppService.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Groups/UserGroupAppService.cs @@ -7,80 +7,79 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.Users; -namespace LINGYUN.Abp.MessageService.Groups +namespace LINGYUN.Abp.MessageService.Groups; + +[Authorize] +public class UserGroupAppService : AbpMessageServiceApplicationServiceBase, IUserGroupAppService { - [Authorize] - public class UserGroupAppService : AbpMessageServiceApplicationServiceBase, IUserGroupAppService + private readonly IUserGroupStore _userGroupStore; + + public UserGroupAppService( + IUserGroupStore userGroupStore) { - private readonly IUserGroupStore _userGroupStore; + _userGroupStore = userGroupStore; + } - public UserGroupAppService( - IUserGroupStore userGroupStore) - { - _userGroupStore = userGroupStore; - } + public virtual Task ApplyJoinGroupAsync(UserJoinGroupDto input) + { + throw new NotImplementedException(); + } - public virtual Task ApplyJoinGroupAsync(UserJoinGroupDto input) - { - throw new NotImplementedException(); - } + public async virtual Task> GetGroupUsersAsync(GroupUserGetByPagedDto input) + { + var groupUserCardCount = await _userGroupStore + .GetMembersCountAsync(CurrentTenant.Id, input.GroupId); - public async virtual Task> GetGroupUsersAsync(GroupUserGetByPagedDto input) - { - var groupUserCardCount = await _userGroupStore - .GetMembersCountAsync(CurrentTenant.Id, input.GroupId); + var groupUserCards = await _userGroupStore.GetMembersAsync( + CurrentTenant.Id, + input.GroupId, + input.Sorting, + input.SkipCount, + input.MaxResultCount); - var groupUserCards = await _userGroupStore.GetMembersAsync( - CurrentTenant.Id, - input.GroupId, - input.Sorting, - input.SkipCount, - input.MaxResultCount); + return new PagedResultDto(groupUserCardCount, groupUserCards); + } - return new PagedResultDto(groupUserCardCount, groupUserCards); - } + public async virtual Task> GetMyGroupsAsync() + { + var myGroups = await _userGroupStore.GetUserGroupsAsync(CurrentTenant.Id, CurrentUser.GetId()); - public async virtual Task> GetMyGroupsAsync() - { - var myGroups = await _userGroupStore.GetUserGroupsAsync(CurrentTenant.Id, CurrentUser.GetId()); + return new ListResultDto(myGroups.ToImmutableList()); + } - return new ListResultDto(myGroups.ToImmutableList()); + public async virtual Task GroupAcceptUserAsync(GroupAcceptUserDto input) + { + var myGroupCard = await _userGroupStore + .GetUserGroupCardAsync(CurrentTenant.Id, input.GroupId, CurrentUser.GetId()); + if (myGroupCard == null) + { + // 当前登录用户不再用户组 + throw new UserFriendlyException(""); } - - public async virtual Task GroupAcceptUserAsync(GroupAcceptUserDto input) + if (!myGroupCard.IsAdmin) { - var myGroupCard = await _userGroupStore - .GetUserGroupCardAsync(CurrentTenant.Id, input.GroupId, CurrentUser.GetId()); - if (myGroupCard == null) - { - // 当前登录用户不再用户组 - throw new UserFriendlyException(""); - } - if (!myGroupCard.IsAdmin) - { - // 当前登录用户没有加人权限 - throw new UserFriendlyException(""); - } - await _userGroupStore - .AddUserToGroupAsync(CurrentTenant.Id, input.UserId, input.GroupId, CurrentUser.GetId()); + // 当前登录用户没有加人权限 + throw new UserFriendlyException(""); } + await _userGroupStore + .AddUserToGroupAsync(CurrentTenant.Id, input.UserId, input.GroupId, CurrentUser.GetId()); + } - public async virtual Task GroupRemoveUserAsync(GroupRemoveUserDto input) + public async virtual Task GroupRemoveUserAsync(GroupRemoveUserDto input) + { + var myGroupCard = await _userGroupStore + .GetUserGroupCardAsync(CurrentTenant.Id, input.GroupId, CurrentUser.GetId()); + if (myGroupCard == null) + { + // 当前登录用户不再用户组 + throw new UserFriendlyException(""); + } + if (!myGroupCard.IsAdmin) { - var myGroupCard = await _userGroupStore - .GetUserGroupCardAsync(CurrentTenant.Id, input.GroupId, CurrentUser.GetId()); - if (myGroupCard == null) - { - // 当前登录用户不再用户组 - throw new UserFriendlyException(""); - } - if (!myGroupCard.IsAdmin) - { - // 当前登录用户没有踢人权限 - throw new UserFriendlyException(""); - } - await _userGroupStore - .RemoveUserFormGroupAsync(CurrentTenant.Id, input.UserId, input.GroupId); + // 当前登录用户没有踢人权限 + throw new UserFriendlyException(""); } + await _userGroupStore + .RemoveUserFormGroupAsync(CurrentTenant.Id, input.UserId, input.GroupId); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN.Abp.MessageService.Domain.Shared.csproj b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN.Abp.MessageService.Domain.Shared.csproj index 664151d5a..c40f665b5 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN.Abp.MessageService.Domain.Shared.csproj +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN.Abp.MessageService.Domain.Shared.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.MessageService.Domain.Shared + LINGYUN.Abp.MessageService.Domain.Shared + false + false + false diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/AbpMessageServiceDomainSharedModule.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/AbpMessageServiceDomainSharedModule.cs index 8b1a8c9dd..8c0fe182b 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/AbpMessageServiceDomainSharedModule.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/AbpMessageServiceDomainSharedModule.cs @@ -4,29 +4,28 @@ using Volo.Abp.Modularity; using Volo.Abp.VirtualFileSystem; -namespace LINGYUN.Abp.MessageService +namespace LINGYUN.Abp.MessageService; + +[DependsOn(typeof(AbpLocalizationModule))] +public class AbpMessageServiceDomainSharedModule : AbpModule { - [DependsOn(typeof(AbpLocalizationModule))] - public class AbpMessageServiceDomainSharedModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + Configure(options => { - Configure(options => - { - options.FileSets.AddEmbedded(); - }); + options.FileSets.AddEmbedded(); + }); - Configure(options => - { - options.Resources - .Add("en") - .AddVirtualJson("/LINGYUN/Abp/MessageService/Localization/Resources"); - }); + Configure(options => + { + options.Resources + .Add("en") + .AddVirtualJson("/LINGYUN/Abp/MessageService/Localization/Resources"); + }); - Configure(options => - { - options.MapCodeNamespace(MessageServiceErrorCodes.Namespace, typeof(MessageServiceResource)); - }); - } + Configure(options => + { + options.MapCodeNamespace(MessageServiceErrorCodes.Namespace, typeof(MessageServiceResource)); + }); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Chat/MessageConsts.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Chat/MessageConsts.cs index 56960d9ec..5f64a34a5 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Chat/MessageConsts.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Chat/MessageConsts.cs @@ -1,10 +1,9 @@ -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public class MessageConsts { - public class MessageConsts - { - public const int MaxSendUserNameLength = 64; + public const int MaxSendUserNameLength = 64; - // 1 MB - public const int MaxContentLength = 1024 * 1024; - } + // 1 MB + public const int MaxContentLength = 1024 * 1024; } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Chat/UserChatCardConsts.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Chat/UserChatCardConsts.cs index 9a29d2986..382fae55e 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Chat/UserChatCardConsts.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Chat/UserChatCardConsts.cs @@ -1,13 +1,12 @@ using Volo.Abp.Users; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public class UserChatCardConsts { - public class UserChatCardConsts - { - public static int MaxUserNameLength { get; set; } = AbpUserConsts.MaxUserNameLength; - public static int MaxSignLength { get; set; } = 30; - public static int MaxNickNameLength { get; set; } = AbpUserConsts.MaxUserNameLength; - public static int MaxDescriptionLength { get; set; } = 50; - public static int MaxAvatarUrlLength { get; set; } = 512; - } + public static int MaxUserNameLength { get; set; } = AbpUserConsts.MaxUserNameLength; + public static int MaxSignLength { get; set; } = 30; + public static int MaxNickNameLength { get; set; } = AbpUserConsts.MaxUserNameLength; + public static int MaxDescriptionLength { get; set; } = 50; + public static int MaxAvatarUrlLength { get; set; } = 512; } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Chat/UserChatFriendConsts.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Chat/UserChatFriendConsts.cs index 6960f4e7b..2139189e1 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Chat/UserChatFriendConsts.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Chat/UserChatFriendConsts.cs @@ -1,8 +1,7 @@ -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public static class UserChatFriendConsts { - public static class UserChatFriendConsts - { - public static int MaxRemarkNameLength { get; set; } = UserChatCardConsts.MaxUserNameLength; - public static int MaxDescriptionLength { get; set; } = UserChatCardConsts.MaxDescriptionLength; - } + public static int MaxRemarkNameLength { get; set; } = UserChatCardConsts.MaxUserNameLength; + public static int MaxDescriptionLength { get; set; } = UserChatCardConsts.MaxDescriptionLength; } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Chat/UserChatFriendEto.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Chat/UserChatFriendEto.cs index 795336f55..a27b9f8f0 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Chat/UserChatFriendEto.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Chat/UserChatFriendEto.cs @@ -2,22 +2,21 @@ using System; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public class UserChatFriendEto : IMultiTenant { - public class UserChatFriendEto : IMultiTenant - { - public Guid? TenantId { get; set; } - /// - /// 用户标识 - /// - public Guid UserId { get; set; } - /// - /// 好友标识 - /// - public Guid FrientId { get; set; } - /// - /// 状态 - /// - public UserFriendStatus Status { get; set; } - } + public Guid? TenantId { get; set; } + /// + /// 用户标识 + /// + public Guid UserId { get; set; } + /// + /// 好友标识 + /// + public Guid FrientId { get; set; } + /// + /// 状态 + /// + public UserFriendStatus Status { get; set; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Groups/ChatGroupConsts.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Groups/ChatGroupConsts.cs index 9abf7d7fb..130238116 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Groups/ChatGroupConsts.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Groups/ChatGroupConsts.cs @@ -1,17 +1,16 @@ -namespace LINGYUN.Abp.MessageService.Groups +namespace LINGYUN.Abp.MessageService.Groups; + +public class ChatGroupConsts { - public class ChatGroupConsts - { - public const int MaxNameLength = 20; + public const int MaxNameLength = 20; - public const int MaxTagLength = 512; + public const int MaxTagLength = 512; - public const int MaxAddressLength = 256; + public const int MaxAddressLength = 256; - public const int MaxNoticeLength = 64; + public const int MaxNoticeLength = 64; - public const int MaxDescriptionLength = 128; + public const int MaxDescriptionLength = 128; - public const int MaxAvatarUrlLength = 128; - } + public const int MaxAvatarUrlLength = 128; } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Localization/MessageServiceResource.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Localization/MessageServiceResource.cs index 1efba3552..737da1eb7 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Localization/MessageServiceResource.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Localization/MessageServiceResource.cs @@ -1,9 +1,8 @@ using Volo.Abp.Localization; -namespace LINGYUN.Abp.MessageService.Localization +namespace LINGYUN.Abp.MessageService.Localization; + +[LocalizationResourceName("AbpMessageService")] +public class MessageServiceResource { - [LocalizationResourceName("AbpMessageService")] - public class MessageServiceResource - { - } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/MessageServiceErrorCodes.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/MessageServiceErrorCodes.cs index 031831786..bd8454ea0 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/MessageServiceErrorCodes.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/MessageServiceErrorCodes.cs @@ -1,103 +1,102 @@ -namespace LINGYUN.Abp.MessageService +namespace LINGYUN.Abp.MessageService; + +/// +/// 消息系统错误码设计 +/// 状态码分为两部分 前2位领域 后3位状态 +/// +/// +/// 领域部分: +/// 01 输入 +/// 02 群组 +/// 03 用户 +/// 04 应用 +/// 05 内部 +/// 10 输出 +/// +/// +/// +/// 状态部分: +/// 200-299 成功 +/// 300-399 成功但有后续操作 +/// 400-499 业务异常 +/// 500-599 内部异常 +/// 900-999 输入输出异常 +/// +/// +/// +public class MessageServiceErrorCodes { + public const string Namespace = "LINGYUN.Abp.Message"; /// - /// 消息系统错误码设计 - /// 状态码分为两部分 前2位领域 后3位状态 - /// - /// - /// 领域部分: - /// 01 输入 - /// 02 群组 - /// 03 用户 - /// 04 应用 - /// 05 内部 - /// 10 输出 - /// - /// - /// - /// 状态部分: - /// 200-299 成功 - /// 300-399 成功但有后续操作 - /// 400-499 业务异常 - /// 500-599 内部异常 - /// 900-999 输入输出异常 - /// - /// - /// - public class MessageServiceErrorCodes - { - public const string Namespace = "LINGYUN.Abp.Message"; - /// - /// 试图撤回过期消息 - /// - public const string ExpiredMessageCannotBeReCall = Namespace + ":01303"; - /// - /// 消息不完整 - /// - public const string MessageIncomplete = Namespace + ":01400"; - /// - /// 您还未加入群组,不能进行操作 - /// - public const string YouHaveNotJoinedGroup = Namespace + ":01401"; - /// - /// 已发送群组申请,等待管理员同意 - /// - public const string YouHaveAddingToGroup = Namespace + ":02301"; - /// - /// 你需要验证问题才能加入群聊 - /// - public const string YouNeedValidationQuestingByAddGroup = Namespace + ":02302"; - /// - /// 管理员已开启全员禁言 - /// - public const string GroupNotAllowedToSpeak = Namespace + ":02400"; - /// - /// 管理员已禁止用户发言 - /// - public const string GroupUserHasBlack = Namespace + ":02403"; - /// - /// 管理员不允许匿名发言 - /// - public const string GroupNotAllowedToSpeakAnonymously = Namespace + ":02401"; - /// - /// 群组不存在或已解散 - /// - public const string GroupNotFount = Namespace + ":02404"; - /// - /// 用户已拒接所有消息 - /// - public const string UserHasRejectAllMessage = Namespace + ":03400"; - /// - /// 用户已将发信人拉黑 - /// - public const string UserHasBlack = Namespace + ":03401"; - /// - /// 用户不允许匿名发言 - /// - public const string UserNotAllowedToSpeakAnonymously = Namespace + ":03402"; - /// - /// 用户不接收非好友发言 - /// - public const string UserHasRejectNotFriendMessage = Namespace + ":03403"; - /// - /// 接收消息用户不存在或已注销 - /// - public const string UseNotFount = Namespace + ":03404"; - /// - /// 用户拒绝添加好友 - /// - public const string UseRefuseToAddFriend = Namespace + ":03410"; - /// - /// 对方已是您的好友或已发送验证请求,不能重复操作 - /// - public const string UseHasBeenAddedTheFriendOrSendAuthorization = Namespace + ":03411"; - /// - /// 已发送好友申请,等待对方同意 - /// - public const string YouHaveAddingTheUserToFriend = Namespace + ":03301"; - /// - /// 你需要验证问题才能添加好友 - /// - public const string YouNeedValidationQuestingByAddFriend = Namespace + ":03302"; - } + /// 试图撤回过期消息 + /// + public const string ExpiredMessageCannotBeReCall = Namespace + ":01303"; + /// + /// 消息不完整 + /// + public const string MessageIncomplete = Namespace + ":01400"; + /// + /// 您还未加入群组,不能进行操作 + /// + public const string YouHaveNotJoinedGroup = Namespace + ":01401"; + /// + /// 已发送群组申请,等待管理员同意 + /// + public const string YouHaveAddingToGroup = Namespace + ":02301"; + /// + /// 你需要验证问题才能加入群聊 + /// + public const string YouNeedValidationQuestingByAddGroup = Namespace + ":02302"; + /// + /// 管理员已开启全员禁言 + /// + public const string GroupNotAllowedToSpeak = Namespace + ":02400"; + /// + /// 管理员已禁止用户发言 + /// + public const string GroupUserHasBlack = Namespace + ":02403"; + /// + /// 管理员不允许匿名发言 + /// + public const string GroupNotAllowedToSpeakAnonymously = Namespace + ":02401"; + /// + /// 群组不存在或已解散 + /// + public const string GroupNotFount = Namespace + ":02404"; + /// + /// 用户已拒接所有消息 + /// + public const string UserHasRejectAllMessage = Namespace + ":03400"; + /// + /// 用户已将发信人拉黑 + /// + public const string UserHasBlack = Namespace + ":03401"; + /// + /// 用户不允许匿名发言 + /// + public const string UserNotAllowedToSpeakAnonymously = Namespace + ":03402"; + /// + /// 用户不接收非好友发言 + /// + public const string UserHasRejectNotFriendMessage = Namespace + ":03403"; + /// + /// 接收消息用户不存在或已注销 + /// + public const string UseNotFount = Namespace + ":03404"; + /// + /// 用户拒绝添加好友 + /// + public const string UseRefuseToAddFriend = Namespace + ":03410"; + /// + /// 对方已是您的好友或已发送验证请求,不能重复操作 + /// + public const string UseHasBeenAddedTheFriendOrSendAuthorization = Namespace + ":03411"; + /// + /// 已发送好友申请,等待对方同意 + /// + public const string YouHaveAddingTheUserToFriend = Namespace + ":03301"; + /// + /// 你需要验证问题才能添加好友 + /// + public const string YouNeedValidationQuestingByAddFriend = Namespace + ":03302"; } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/ObjectExtending/MessageServiceModuleExtensionConfiguration.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/ObjectExtending/MessageServiceModuleExtensionConfiguration.cs index 79b16fe9d..48ffa7c92 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/ObjectExtending/MessageServiceModuleExtensionConfiguration.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/ObjectExtending/MessageServiceModuleExtensionConfiguration.cs @@ -1,17 +1,16 @@ using System; using Volo.Abp.ObjectExtending.Modularity; -namespace LINGYUN.Abp.MessageService.ObjectExtending +namespace LINGYUN.Abp.MessageService.ObjectExtending; + +public class MessageServiceModuleExtensionConfiguration : ModuleExtensionConfiguration { - public class MessageServiceModuleExtensionConfiguration : ModuleExtensionConfiguration + public MessageServiceModuleExtensionConfiguration ConfigureMessage( + Action configureAction) { - public MessageServiceModuleExtensionConfiguration ConfigureMessage( - Action configureAction) - { - return this.ConfigureEntity( - MessageServiceModuleExtensionConsts.EntityNames.Message, - configureAction - ); - } + return this.ConfigureEntity( + MessageServiceModuleExtensionConsts.EntityNames.Message, + configureAction + ); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/ObjectExtending/MessageServiceModuleExtensionConfigurationDictionaryExtensions.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/ObjectExtending/MessageServiceModuleExtensionConfigurationDictionaryExtensions.cs index 61ed02e29..5331488ea 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/ObjectExtending/MessageServiceModuleExtensionConfigurationDictionaryExtensions.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/ObjectExtending/MessageServiceModuleExtensionConfigurationDictionaryExtensions.cs @@ -1,18 +1,17 @@ using System; using Volo.Abp.ObjectExtending.Modularity; -namespace LINGYUN.Abp.MessageService.ObjectExtending +namespace LINGYUN.Abp.MessageService.ObjectExtending; + +public static class MessageServiceModuleExtensionConfigurationDictionaryExtensions { - public static class MessageServiceModuleExtensionConfigurationDictionaryExtensions + public static ModuleExtensionConfigurationDictionary ConfigureMessage( + this ModuleExtensionConfigurationDictionary modules, + Action configureAction) { - public static ModuleExtensionConfigurationDictionary ConfigureMessage( - this ModuleExtensionConfigurationDictionary modules, - Action configureAction) - { - return modules.ConfigureModule( - MessageServiceModuleExtensionConsts.ModuleName, - configureAction - ); - } + return modules.ConfigureModule( + MessageServiceModuleExtensionConsts.ModuleName, + configureAction + ); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/ObjectExtending/MessageServiceModuleExtensionConsts.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/ObjectExtending/MessageServiceModuleExtensionConsts.cs index c38cffe54..8b9e2b9f1 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/ObjectExtending/MessageServiceModuleExtensionConsts.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/ObjectExtending/MessageServiceModuleExtensionConsts.cs @@ -1,12 +1,11 @@ -namespace LINGYUN.Abp.MessageService.ObjectExtending +namespace LINGYUN.Abp.MessageService.ObjectExtending; + +public static class MessageServiceModuleExtensionConsts { - public static class MessageServiceModuleExtensionConsts - { - public const string ModuleName = "MessageService"; + public const string ModuleName = "MessageService"; - public static class EntityNames - { - public const string Message = "Message"; - } + public static class EntityNames + { + public const string Message = "Message"; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Settings/MessageServiceSettingDefinitionProvider.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Settings/MessageServiceSettingDefinitionProvider.cs index 870078ddf..20295a38f 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Settings/MessageServiceSettingDefinitionProvider.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Settings/MessageServiceSettingDefinitionProvider.cs @@ -2,31 +2,30 @@ using Volo.Abp.Localization; using Volo.Abp.Settings; -namespace LINGYUN.Abp.MessageService.Settings +namespace LINGYUN.Abp.MessageService.Settings; + +public class MessageServiceSettingDefinitionProvider : SettingDefinitionProvider { - public class MessageServiceSettingDefinitionProvider : SettingDefinitionProvider + public override void Define(ISettingDefinitionContext context) { - public override void Define(ISettingDefinitionContext context) - { - context.Add( - new SettingDefinition( - MessageServiceSettingNames.Messages.RecallExpirationTime, - "2", - L("DisplayName:RecallExpirationTime"), - L("Description:RecallExpirationTime"), - isVisibleToClients: false, - isEncrypted: false) - .WithProviders( - DefaultValueSettingValueProvider.ProviderName, - ConfigurationSettingValueProvider.ProviderName, - GlobalSettingValueProvider.ProviderName, - TenantSettingValueProvider.ProviderName) - ); - } + context.Add( + new SettingDefinition( + MessageServiceSettingNames.Messages.RecallExpirationTime, + "2", + L("DisplayName:RecallExpirationTime"), + L("Description:RecallExpirationTime"), + isVisibleToClients: false, + isEncrypted: false) + .WithProviders( + DefaultValueSettingValueProvider.ProviderName, + ConfigurationSettingValueProvider.ProviderName, + GlobalSettingValueProvider.ProviderName, + TenantSettingValueProvider.ProviderName) + ); + } - protected ILocalizableString L(string name) - { - return LocalizableString.Create(name); - } + protected ILocalizableString L(string name) + { + return LocalizableString.Create(name); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Settings/MessageServiceSettingNames.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Settings/MessageServiceSettingNames.cs index 0ac511abe..ace3bbb7f 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Settings/MessageServiceSettingNames.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Settings/MessageServiceSettingNames.cs @@ -1,25 +1,24 @@ -namespace LINGYUN.Abp.MessageService.Settings +namespace LINGYUN.Abp.MessageService.Settings; + +public class MessageServiceSettingNames { - public class MessageServiceSettingNames - { - public const string GroupName = "Abp.MessageService"; + public const string GroupName = "Abp.MessageService"; - public class Notifications - { - public const string Default = GroupName + ".Notifications"; - /// - /// 清理过期消息批次 - /// - public const string CleanupExpirationBatchCount = Default + ".CleanupExpirationBatchCount"; - } + public class Notifications + { + public const string Default = GroupName + ".Notifications"; + /// + /// 清理过期消息批次 + /// + public const string CleanupExpirationBatchCount = Default + ".CleanupExpirationBatchCount"; + } - public class Messages - { - public const string Default = GroupName + ".Messages"; - /// - /// 撤回消息过期时间(分) - /// - public const string RecallExpirationTime = Default + ".RecallExpirationTime"; - } + public class Messages + { + public const string Default = GroupName + ".Messages"; + /// + /// 撤回消息过期时间(分) + /// + public const string RecallExpirationTime = Default + ".RecallExpirationTime"; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN.Abp.MessageService.Domain.csproj b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN.Abp.MessageService.Domain.csproj index 54c23c27c..e72045bcc 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN.Abp.MessageService.Domain.csproj +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN.Abp.MessageService.Domain.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.MessageService.Domain + LINGYUN.Abp.MessageService.Domain + false + false + false diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/AbpMessageServiceDbProperties.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/AbpMessageServiceDbProperties.cs index 091a3b76b..c772dc2db 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/AbpMessageServiceDbProperties.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/AbpMessageServiceDbProperties.cs @@ -1,11 +1,10 @@ -namespace LINGYUN.Abp.MessageService +namespace LINGYUN.Abp.MessageService; + +public class AbpMessageServiceDbProperties { - public class AbpMessageServiceDbProperties - { - public const string DefaultTablePrefix = "App"; + public const string DefaultTablePrefix = "App"; - public const string DefaultSchema = null; + public const string DefaultSchema = null; - public const string ConnectionStringName = "MessageService"; - } + public const string ConnectionStringName = "MessageService"; } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/AbpMessageServiceDomainModule.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/AbpMessageServiceDomainModule.cs index 24ed289f4..52c35d44f 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/AbpMessageServiceDomainModule.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/AbpMessageServiceDomainModule.cs @@ -10,37 +10,36 @@ using Volo.Abp.Modularity; using Volo.Abp.ObjectExtending.Modularity; -namespace LINGYUN.Abp.MessageService +namespace LINGYUN.Abp.MessageService; + +[DependsOn( + typeof(AbpAutoMapperModule), + typeof(AbpCachingModule), + typeof(AbpNotificationsModule), + typeof(AbpMessageServiceDomainSharedModule))] +public class AbpMessageServiceDomainModule : AbpModule { - [DependsOn( - typeof(AbpAutoMapperModule), - typeof(AbpCachingModule), - typeof(AbpNotificationsModule), - typeof(AbpMessageServiceDomainSharedModule))] - public class AbpMessageServiceDomainModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + Configure(options => { - Configure(options => - { - options.AddProfile(validate: true); - }); - - Configure(options => - { - options.Resources - .Get() - .AddBaseTypes(typeof(AbpIMResource)); - }); - } + options.AddProfile(validate: true); + }); - public override void PostConfigureServices(ServiceConfigurationContext context) + Configure(options => { - ModuleExtensionConfigurationHelper.ApplyEntityConfigurationToEntity( - MessageServiceModuleExtensionConsts.ModuleName, - MessageServiceModuleExtensionConsts.EntityNames.Message, - typeof(Message) - ); - } + options.Resources + .Get() + .AddBaseTypes(typeof(AbpIMResource)); + }); + } + + public override void PostConfigureServices(ServiceConfigurationContext context) + { + ModuleExtensionConfigurationHelper.ApplyEntityConfigurationToEntity( + MessageServiceModuleExtensionConsts.ModuleName, + MessageServiceModuleExtensionConsts.EntityNames.Message, + typeof(Message) + ); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/ChatDataSeeder.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/ChatDataSeeder.cs index bcef93498..92d9a5c4b 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/ChatDataSeeder.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/ChatDataSeeder.cs @@ -8,46 +8,45 @@ using Volo.Abp.Uow; using Volo.Abp.Users; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public class ChatDataSeeder : IChatDataSeeder, ITransientDependency { - public class ChatDataSeeder : IChatDataSeeder, ITransientDependency + protected IClock Clock { get; } + protected ICurrentTenant CurrentTenant { get; } + protected IUserChatCardRepository UserChatCardRepository { get; } + protected IUserChatSettingRepository UserChatSettingRepository { get; } + public ChatDataSeeder( + IClock clock, + ICurrentTenant currentTenant, + IUserChatCardRepository userChatCardRepository, + IUserChatSettingRepository userChatSettingRepository) { - protected IClock Clock { get; } - protected ICurrentTenant CurrentTenant { get; } - protected IUserChatCardRepository UserChatCardRepository { get; } - protected IUserChatSettingRepository UserChatSettingRepository { get; } - public ChatDataSeeder( - IClock clock, - ICurrentTenant currentTenant, - IUserChatCardRepository userChatCardRepository, - IUserChatSettingRepository userChatSettingRepository) - { - Clock = clock; - CurrentTenant = currentTenant; - UserChatCardRepository = userChatCardRepository; - UserChatSettingRepository = userChatSettingRepository; - } + Clock = clock; + CurrentTenant = currentTenant; + UserChatCardRepository = userChatCardRepository; + UserChatSettingRepository = userChatSettingRepository; + } - [UnitOfWork] - public async virtual Task SeedAsync(IUserData user) + [UnitOfWork] + public async virtual Task SeedAsync(IUserData user) + { + using (CurrentTenant.Change(user.TenantId)) { - using (CurrentTenant.Change(user.TenantId)) + var userHasOpendIm = await UserChatSettingRepository.UserHasOpendImAsync(user.Id); + if (!userHasOpendIm) { - var userHasOpendIm = await UserChatSettingRepository.UserHasOpendImAsync(user.Id); - if (!userHasOpendIm) - { - var userChatSetting = new UserChatSetting(user.Id, user.TenantId); + var userChatSetting = new UserChatSetting(user.Id, user.TenantId); - await UserChatSettingRepository.InsertAsync(userChatSetting); + await UserChatSettingRepository.InsertAsync(userChatSetting); - var userChatCard = new UserChatCard(user.Id, user.UserName, IM.Sex.Male, user.UserName, tenantId: user.TenantId) - { - CreationTime = Clock.Now, - CreatorId = user.Id - }; + var userChatCard = new UserChatCard(user.Id, user.UserName, IM.Sex.Male, user.UserName, tenantId: user.TenantId) + { + CreationTime = Clock.Now, + CreatorId = user.Id + }; - await UserChatCardRepository.InsertAsync(userChatCard); - } + await UserChatCardRepository.InsertAsync(userChatCard); } } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/ChatNotificationNames.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/ChatNotificationNames.cs index c1518c28f..bd9525ed5 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/ChatNotificationNames.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/ChatNotificationNames.cs @@ -1,14 +1,13 @@ -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public static class ChatNotificationNames { - public static class ChatNotificationNames - { - public const string GroupName = "LINGYUN.Abp.IM.Chat"; + public const string GroupName = "LINGYUN.Abp.IM.Chat"; - public static class UserFriend - { - public const string Default = GroupName + ".UserFriend"; + public static class UserFriend + { + public const string Default = GroupName + ".UserFriend"; - public const string NeedValidation = Default + ".NeedValidation"; - } + public const string NeedValidation = Default + ".NeedValidation"; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/FriendStore.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/FriendStore.cs index ec8a81369..0cc49847b 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/FriendStore.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/FriendStore.cs @@ -11,269 +11,268 @@ using Volo.Abp.Timing; using Volo.Abp.Uow; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public class FriendStore : IFriendStore, ITransientDependency { - public class FriendStore : IFriendStore, ITransientDependency - { - private readonly IClock _clock; - private readonly ILogger _logger; - private readonly ICurrentTenant _currentTenant; - private readonly IDistributedCache _cache; - private readonly IUserChatFriendRepository _userChatFriendRepository; - private readonly IUserChatSettingRepository _userChatSettingRepository; + private readonly IClock _clock; + private readonly ILogger _logger; + private readonly ICurrentTenant _currentTenant; + private readonly IDistributedCache _cache; + private readonly IUserChatFriendRepository _userChatFriendRepository; + private readonly IUserChatSettingRepository _userChatSettingRepository; - public FriendStore( - IClock clock, - ILogger logger, - ICurrentTenant currentTenant, - IDistributedCache cache, - IUserChatFriendRepository userChatFriendRepository, - IUserChatSettingRepository userChatSettingRepository - ) - { - _clock = clock; - _cache = cache; - _logger = logger; - _currentTenant = currentTenant; - _userChatFriendRepository = userChatFriendRepository; - _userChatSettingRepository = userChatSettingRepository; - } + public FriendStore( + IClock clock, + ILogger logger, + ICurrentTenant currentTenant, + IDistributedCache cache, + IUserChatFriendRepository userChatFriendRepository, + IUserChatSettingRepository userChatSettingRepository + ) + { + _clock = clock; + _cache = cache; + _logger = logger; + _currentTenant = currentTenant; + _userChatFriendRepository = userChatFriendRepository; + _userChatSettingRepository = userChatSettingRepository; + } - public async virtual Task IsFriendAsync( - Guid? tenantId, - Guid userId, - Guid friendId, - CancellationToken cancellationToken = default - ) + public async virtual Task IsFriendAsync( + Guid? tenantId, + Guid userId, + Guid friendId, + CancellationToken cancellationToken = default + ) + { + using (_currentTenant.Change(tenantId)) { - using (_currentTenant.Change(tenantId)) - { - return await _userChatFriendRepository.IsFriendAsync(userId, friendId, cancellationToken); - } + return await _userChatFriendRepository.IsFriendAsync(userId, friendId, cancellationToken); } + } - [UnitOfWork] - public async virtual Task AddMemberAsync( - Guid? tenantId, - Guid userId, - Guid friendId, - string remarkName = "", - bool isStatic = false, - CancellationToken cancellationToken = default) + [UnitOfWork] + public async virtual Task AddMemberAsync( + Guid? tenantId, + Guid userId, + Guid friendId, + string remarkName = "", + bool isStatic = false, + CancellationToken cancellationToken = default) + { + using (_currentTenant.Change(tenantId)) { - using (_currentTenant.Change(tenantId)) + if (!await _userChatFriendRepository.IsAddedAsync(userId, friendId)) { - if (!await _userChatFriendRepository.IsAddedAsync(userId, friendId)) - { - var userFriend = new UserChatFriend(userId, friendId, remarkName); - userFriend.SetStatus(UserFriendStatus.Added); - userFriend.IsStatic = isStatic; + var userFriend = new UserChatFriend(userId, friendId, remarkName); + userFriend.SetStatus(UserFriendStatus.Added); + userFriend.IsStatic = isStatic; - await _userChatFriendRepository.InsertAsync(userFriend); - } + await _userChatFriendRepository.InsertAsync(userFriend); + } - var userChatFriend = await _userChatFriendRepository - .FindByUserFriendIdAsync(friendId, userId); + var userChatFriend = await _userChatFriendRepository + .FindByUserFriendIdAsync(friendId, userId); - userChatFriend.SetStatus(UserFriendStatus.Added); + userChatFriend.SetStatus(UserFriendStatus.Added); - await _userChatFriendRepository.UpdateAsync(userChatFriend, cancellationToken: cancellationToken); - } + await _userChatFriendRepository.UpdateAsync(userChatFriend, cancellationToken: cancellationToken); } + } - [UnitOfWork] - public async virtual Task AddRequestAsync( - Guid? tenantId, - Guid userId, - Guid friendId, - string remarkName = "", - string description = "", - CancellationToken cancellationToken = default) + [UnitOfWork] + public async virtual Task AddRequestAsync( + Guid? tenantId, + Guid userId, + Guid friendId, + string remarkName = "", + string description = "", + CancellationToken cancellationToken = default) + { + using (_currentTenant.Change(tenantId)) { - using (_currentTenant.Change(tenantId)) + if (await _userChatFriendRepository.IsAddedAsync(userId, friendId)) { - if (await _userChatFriendRepository.IsAddedAsync(userId, friendId)) - { - throw new BusinessException(MessageServiceErrorCodes.UseHasBeenAddedTheFriendOrSendAuthorization); - } + throw new BusinessException(MessageServiceErrorCodes.UseHasBeenAddedTheFriendOrSendAuthorization); + } - var status = UserFriendStatus.NeedValidation; - var userChatSetting = await _userChatSettingRepository.FindByUserIdAsync(friendId, cancellationToken); - if (userChatSetting != null) + var status = UserFriendStatus.NeedValidation; + var userChatSetting = await _userChatSettingRepository.FindByUserIdAsync(friendId, cancellationToken); + if (userChatSetting != null) + { + if (!userChatSetting.AllowAddFriend) { - if (!userChatSetting.AllowAddFriend) - { - throw new BusinessException(MessageServiceErrorCodes.UseRefuseToAddFriend); - } - - status = userChatSetting.RequireAddFriendValition - ? UserFriendStatus.NeedValidation - : UserFriendStatus.Added; + throw new BusinessException(MessageServiceErrorCodes.UseRefuseToAddFriend); } - var userChatFriend = new UserChatFriend(userId, friendId, remarkName, description, tenantId) - { - CreationTime = _clock.Now, - CreatorId = userId, - }; - userChatFriend.SetStatus(status); + status = userChatSetting.RequireAddFriendValition + ? UserFriendStatus.NeedValidation + : UserFriendStatus.Added; + } - await _userChatFriendRepository.InsertAsync(userChatFriend, cancellationToken: cancellationToken); + var userChatFriend = new UserChatFriend(userId, friendId, remarkName, description, tenantId) + { + CreationTime = _clock.Now, + CreatorId = userId, + }; + userChatFriend.SetStatus(status); - return new UserAddFriendResult(status); - } - } + await _userChatFriendRepository.InsertAsync(userChatFriend, cancellationToken: cancellationToken); - [UnitOfWork] - public async virtual Task AddShieldMemberAsync( - Guid? tenantId, - Guid userId, - Guid friendId, - CancellationToken cancellationToken = default) - { - await ChangeFriendShieldAsync(tenantId, userId, friendId, true, cancellationToken); + return new UserAddFriendResult(status); } + } + + [UnitOfWork] + public async virtual Task AddShieldMemberAsync( + Guid? tenantId, + Guid userId, + Guid friendId, + CancellationToken cancellationToken = default) + { + await ChangeFriendShieldAsync(tenantId, userId, friendId, true, cancellationToken); + } - public async virtual Task> GetListAsync( - Guid? tenantId, - Guid userId, - string sorting = nameof(UserFriend.UserId), - CancellationToken cancellationToken = default - ) + public async virtual Task> GetListAsync( + Guid? tenantId, + Guid userId, + string sorting = nameof(UserFriend.UserId), + CancellationToken cancellationToken = default + ) + { + using (_currentTenant.Change(tenantId)) { - using (_currentTenant.Change(tenantId)) - { - return await GetAllFriendByCacheItemAsync(userId, sorting, cancellationToken); - } + return await GetAllFriendByCacheItemAsync(userId, sorting, cancellationToken); } + } - public async virtual Task GetCountAsync( - Guid? tenantId, - Guid userId, - string filter = "", - CancellationToken cancellationToken = default) + public async virtual Task GetCountAsync( + Guid? tenantId, + Guid userId, + string filter = "", + CancellationToken cancellationToken = default) + { + using (_currentTenant.Change(tenantId)) { - using (_currentTenant.Change(tenantId)) - { - return await _userChatFriendRepository - .GetMembersCountAsync(userId, filter, cancellationToken); - } + return await _userChatFriendRepository + .GetMembersCountAsync(userId, filter, cancellationToken); } + } - public async virtual Task> GetPagedListAsync( - Guid? tenantId, - Guid userId, - string filter = "", - string sorting = nameof(UserFriend.UserId), - int skipCount = 0, - int maxResultCount = 10, - CancellationToken cancellationToken = default) + public async virtual Task> GetPagedListAsync( + Guid? tenantId, + Guid userId, + string filter = "", + string sorting = nameof(UserFriend.UserId), + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default) + { + using (_currentTenant.Change(tenantId)) { - using (_currentTenant.Change(tenantId)) - { - return await _userChatFriendRepository - .GetMembersAsync(userId, filter, sorting, - skipCount, maxResultCount, cancellationToken); - } + return await _userChatFriendRepository + .GetMembersAsync(userId, filter, sorting, + skipCount, maxResultCount, cancellationToken); } + } - public async virtual Task> GetLastContactListAsync( - Guid? tenantId, - Guid userId, - int skipCount = 0, - int maxResultCount = 10, - CancellationToken cancellationToken = default) + public async virtual Task> GetLastContactListAsync( + Guid? tenantId, + Guid userId, + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default) + { + using (_currentTenant.Change(tenantId)) { - using (_currentTenant.Change(tenantId)) - { - return await _userChatFriendRepository - .GetLastContactMembersAsync(userId, - skipCount, maxResultCount, cancellationToken); - } + return await _userChatFriendRepository + .GetLastContactMembersAsync(userId, + skipCount, maxResultCount, cancellationToken); } + } - public async virtual Task GetMemberAsync( - Guid? tenantId, - Guid userId, - Guid friendId, - CancellationToken cancellationToken = default) + public async virtual Task GetMemberAsync( + Guid? tenantId, + Guid userId, + Guid friendId, + CancellationToken cancellationToken = default) + { + using (_currentTenant.Change(tenantId)) { - using (_currentTenant.Change(tenantId)) - { - return await _userChatFriendRepository - .GetMemberAsync(userId, friendId, cancellationToken); - } + return await _userChatFriendRepository + .GetMemberAsync(userId, friendId, cancellationToken); } + } - [UnitOfWork] - public async virtual Task RemoveMemberAsync( - Guid? tenantId, - Guid userId, - Guid friendId, - CancellationToken cancellationToken = default) + [UnitOfWork] + public async virtual Task RemoveMemberAsync( + Guid? tenantId, + Guid userId, + Guid friendId, + CancellationToken cancellationToken = default) + { + using (_currentTenant.Change(tenantId)) { - using (_currentTenant.Change(tenantId)) + var userChatFriend = await _userChatFriendRepository.FindByUserFriendIdAsync(userId, friendId, cancellationToken); + if (userChatFriend != null) { - var userChatFriend = await _userChatFriendRepository.FindByUserFriendIdAsync(userId, friendId, cancellationToken); - if (userChatFriend != null) - { - await _userChatFriendRepository.DeleteAsync(userChatFriend, cancellationToken: cancellationToken); - } + await _userChatFriendRepository.DeleteAsync(userChatFriend, cancellationToken: cancellationToken); } } + } - [UnitOfWork] - public async virtual Task RemoveShieldMemberAsync( - Guid? tenantId, - Guid userId, - Guid friendId, - CancellationToken cancellationToken = default) - { - await ChangeFriendShieldAsync(tenantId, userId, friendId, false, cancellationToken); - } + [UnitOfWork] + public async virtual Task RemoveShieldMemberAsync( + Guid? tenantId, + Guid userId, + Guid friendId, + CancellationToken cancellationToken = default) + { + await ChangeFriendShieldAsync(tenantId, userId, friendId, false, cancellationToken); + } - protected async virtual Task ChangeFriendShieldAsync( - Guid? tenantId, - Guid userId, - Guid friendId, - bool isBlack = false, - CancellationToken cancellationToken = default) + protected async virtual Task ChangeFriendShieldAsync( + Guid? tenantId, + Guid userId, + Guid friendId, + bool isBlack = false, + CancellationToken cancellationToken = default) + { + using (_currentTenant.Change(tenantId)) { - using (_currentTenant.Change(tenantId)) + var userChatFriend = await _userChatFriendRepository.FindByUserFriendIdAsync(userId, friendId, cancellationToken); + if (userChatFriend != null) { - var userChatFriend = await _userChatFriendRepository.FindByUserFriendIdAsync(userId, friendId, cancellationToken); - if (userChatFriend != null) - { - userChatFriend.Black = isBlack; - await _userChatFriendRepository.UpdateAsync(userChatFriend, cancellationToken: cancellationToken); - } + userChatFriend.Black = isBlack; + await _userChatFriendRepository.UpdateAsync(userChatFriend, cancellationToken: cancellationToken); } } + } - protected async virtual Task> GetAllFriendByCacheItemAsync( - Guid userId, - string sorting = nameof(UserFriend.UserId), - CancellationToken cancellationToken = default - ) - { - var cacheKey = UserFriendCacheItem.CalculateCacheKey(userId.ToString()); - _logger.LogDebug($"FriendStore.GetCacheItemAsync: {cacheKey}"); - - var cacheItem = await _cache.GetAsync(cacheKey, token: cancellationToken); - if (cacheItem != null) - { - _logger.LogDebug($"Found in the cache: {cacheKey}"); - return cacheItem.Friends; - } + protected async virtual Task> GetAllFriendByCacheItemAsync( + Guid userId, + string sorting = nameof(UserFriend.UserId), + CancellationToken cancellationToken = default + ) + { + var cacheKey = UserFriendCacheItem.CalculateCacheKey(userId.ToString()); + _logger.LogDebug($"FriendStore.GetCacheItemAsync: {cacheKey}"); - _logger.LogDebug($"Not found in the cache: {cacheKey}"); - var friends = await _userChatFriendRepository - .GetAllMembersAsync(userId, sorting, cancellationToken); - cacheItem = new UserFriendCacheItem(friends); - _logger.LogDebug($"Set item in the cache: {cacheKey}"); - await _cache.SetAsync(cacheKey, cacheItem, token: cancellationToken); - return friends; + var cacheItem = await _cache.GetAsync(cacheKey, token: cancellationToken); + if (cacheItem != null) + { + _logger.LogDebug($"Found in the cache: {cacheKey}"); + return cacheItem.Friends; } + + _logger.LogDebug($"Not found in the cache: {cacheKey}"); + var friends = await _userChatFriendRepository + .GetAllMembersAsync(userId, sorting, cancellationToken); + cacheItem = new UserFriendCacheItem(friends); + _logger.LogDebug($"Set item in the cache: {cacheKey}"); + await _cache.SetAsync(cacheKey, cacheItem, token: cancellationToken); + return friends; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IChatDataSeeder.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IChatDataSeeder.cs index 03ca8b7e3..e64b82168 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IChatDataSeeder.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IChatDataSeeder.cs @@ -1,11 +1,9 @@ using System.Threading.Tasks; using Volo.Abp.Users; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public interface IChatDataSeeder { - public interface IChatDataSeeder - { - Task SeedAsync( - IUserData user); - } + Task SeedAsync(IUserData user); } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IMessageRepository.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IMessageRepository.cs index a51cc9d38..7c56b1291 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IMessageRepository.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IMessageRepository.cs @@ -5,101 +5,100 @@ using System.Threading; using System.Threading.Tasks; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public interface IMessageRepository { - public interface IMessageRepository - { - Task InsertUserMessageAsync( - UserMessage userMessage, - CancellationToken cancellationToken = default); - - Task UpdateUserMessageAsync( - UserMessage userMessage, - CancellationToken cancellationToken = default); - - Task InsertGroupMessageAsync( - GroupMessage groupMessage, - CancellationToken cancellationToken = default); - - Task UpdateGroupMessageAsync( - GroupMessage groupMessage, - CancellationToken cancellationToken = default); - - Task GetUserMessageAsync( - long id, - CancellationToken cancellationToken = default); - - Task GetGroupMessageAsync( - long id, - CancellationToken cancellationToken = default); - - Task GetUserMessagesCountAsync( - Guid sendUserId, - Guid receiveUserId, - MessageType? type = null, - string filter = "", - CancellationToken cancellationToken = default); - - Task GetCountAsync( - long groupId, - MessageType? type = null, - string filter = "", - CancellationToken cancellationToken = default); - - Task GetCountAsync( - Guid sendUserId, - Guid receiveUserId, - MessageType? type = null, - string filter = "", - CancellationToken cancellationToken = default); - - Task> GetLastMessagesAsync( - Guid userId, - MessageState? state = null, - string sorting = nameof(LastChatMessage.SendTime), - int maxResultCount = 10, - CancellationToken cancellationToken = default); - - Task> GetUserMessagesAsync( - Guid sendUserId, - Guid receiveUserId, - MessageType? type = null, - string filter = "", - string sorting = nameof(UserMessage.MessageId), - int skipCount = 0, - int maxResultCount = 10, - CancellationToken cancellationToken = default); - - Task GetGroupMessagesCountAsync( - long groupId, - MessageType? type = null, - string filter = "", - CancellationToken cancellationToken = default); - - Task> GetGroupMessagesAsync( - long groupId, - MessageType? type = null, - string filter = "", - string sorting = nameof(UserMessage.MessageId), - int skipCount = 0, - int maxResultCount = 10, - CancellationToken cancellationToken = default); - - Task GetUserGroupMessagesCountAsync( - Guid sendUserId, - long groupId, - MessageType? type = null, - string filter = "", - CancellationToken cancellationToken = default); - - Task> GetUserGroupMessagesAsync( - Guid sendUserId, - long groupId, - MessageType? type = null, - string filter = "", - string sorting = nameof(UserMessage.MessageId), - int skipCount = 0, - int maxResultCount = 10, - CancellationToken cancellationToken = default); - } + Task InsertUserMessageAsync( + UserMessage userMessage, + CancellationToken cancellationToken = default); + + Task UpdateUserMessageAsync( + UserMessage userMessage, + CancellationToken cancellationToken = default); + + Task InsertGroupMessageAsync( + GroupMessage groupMessage, + CancellationToken cancellationToken = default); + + Task UpdateGroupMessageAsync( + GroupMessage groupMessage, + CancellationToken cancellationToken = default); + + Task GetUserMessageAsync( + long id, + CancellationToken cancellationToken = default); + + Task GetGroupMessageAsync( + long id, + CancellationToken cancellationToken = default); + + Task GetUserMessagesCountAsync( + Guid sendUserId, + Guid receiveUserId, + MessageType? type = null, + string filter = "", + CancellationToken cancellationToken = default); + + Task GetCountAsync( + long groupId, + MessageType? type = null, + string filter = "", + CancellationToken cancellationToken = default); + + Task GetCountAsync( + Guid sendUserId, + Guid receiveUserId, + MessageType? type = null, + string filter = "", + CancellationToken cancellationToken = default); + + Task> GetLastMessagesAsync( + Guid userId, + MessageState? state = null, + string sorting = nameof(LastChatMessage.SendTime), + int maxResultCount = 10, + CancellationToken cancellationToken = default); + + Task> GetUserMessagesAsync( + Guid sendUserId, + Guid receiveUserId, + MessageType? type = null, + string filter = "", + string sorting = nameof(UserMessage.MessageId), + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default); + + Task GetGroupMessagesCountAsync( + long groupId, + MessageType? type = null, + string filter = "", + CancellationToken cancellationToken = default); + + Task> GetGroupMessagesAsync( + long groupId, + MessageType? type = null, + string filter = "", + string sorting = nameof(UserMessage.MessageId), + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default); + + Task GetUserGroupMessagesCountAsync( + Guid sendUserId, + long groupId, + MessageType? type = null, + string filter = "", + CancellationToken cancellationToken = default); + + Task> GetUserGroupMessagesAsync( + Guid sendUserId, + long groupId, + MessageType? type = null, + string filter = "", + string sorting = nameof(UserMessage.MessageId), + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatCardRepository.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatCardRepository.cs index 64fabcdef..2e966c12a 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatCardRepository.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatCardRepository.cs @@ -5,37 +5,36 @@ using System.Threading.Tasks; using Volo.Abp.Domain.Repositories; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public interface IUserChatCardRepository : IBasicRepository { - public interface IUserChatCardRepository : IBasicRepository - { - Task FindByUserIdAsync( - Guid userId, - CancellationToken cancellationToken = default); + Task FindByUserIdAsync( + Guid userId, + CancellationToken cancellationToken = default); - Task CheckUserIdExistsAsync( - Guid userId, - CancellationToken cancellationToken = default); + Task CheckUserIdExistsAsync( + Guid userId, + CancellationToken cancellationToken = default); - Task GetMemberCountAsync( - string findUserName = "", - int? startAge = null, - int? endAge = null, - Sex? sex = null, - CancellationToken cancellationToken = default); + Task GetMemberCountAsync( + string findUserName = "", + int? startAge = null, + int? endAge = null, + Sex? sex = null, + CancellationToken cancellationToken = default); - Task> GetMembersAsync( - string findUserName = "", - int? startAge = null, - int? endAge = null, - Sex? sex = null, - string sorting = nameof(UserChatCard.UserId), - int skipCount = 0, - int maxResultCount = 10, - CancellationToken cancellationToken = default); + Task> GetMembersAsync( + string findUserName = "", + int? startAge = null, + int? endAge = null, + Sex? sex = null, + string sorting = nameof(UserChatCard.UserId), + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default); - Task GetMemberAsync( - Guid findUserId, - CancellationToken cancellationToken = default); - } + Task GetMemberAsync( + Guid findUserId, + CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatFriendRepository.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatFriendRepository.cs index ca968122b..dc4d0e76e 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatFriendRepository.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatFriendRepository.cs @@ -5,52 +5,51 @@ using System.Threading.Tasks; using Volo.Abp.Domain.Repositories; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public interface IUserChatFriendRepository : IBasicRepository { - public interface IUserChatFriendRepository : IBasicRepository - { - Task IsFriendAsync( - Guid userId, - Guid frientId, - CancellationToken cancellationToken = default); - - Task IsAddedAsync( - Guid userId, - Guid frientId, - CancellationToken cancellationToken = default); - - Task FindByUserFriendIdAsync( - Guid userId, - Guid friendId, - CancellationToken cancellationToken = default); - - Task> GetAllMembersAsync( - Guid userId, - string sorting = nameof(UserChatFriend.RemarkName), - CancellationToken cancellationToken = default); - - Task GetMembersCountAsync( - Guid userId, - string filter = "", - CancellationToken cancellationToken = default); - - Task> GetMembersAsync( - Guid userId, - string filter = "", - string sorting = nameof(UserChatFriend.UserId), - int skipCount = 0, - int maxResultCount = 10, - CancellationToken cancellationToken = default); - - Task> GetLastContactMembersAsync( - Guid userId, - int skipCount = 0, - int maxResultCount = 10, - CancellationToken cancellationToken = default); - - Task GetMemberAsync( - Guid userId, - Guid friendId, - CancellationToken cancellationToken = default); - } + Task IsFriendAsync( + Guid userId, + Guid frientId, + CancellationToken cancellationToken = default); + + Task IsAddedAsync( + Guid userId, + Guid frientId, + CancellationToken cancellationToken = default); + + Task FindByUserFriendIdAsync( + Guid userId, + Guid friendId, + CancellationToken cancellationToken = default); + + Task> GetAllMembersAsync( + Guid userId, + string sorting = nameof(UserChatFriend.RemarkName), + CancellationToken cancellationToken = default); + + Task GetMembersCountAsync( + Guid userId, + string filter = "", + CancellationToken cancellationToken = default); + + Task> GetMembersAsync( + Guid userId, + string filter = "", + string sorting = nameof(UserChatFriend.UserId), + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default); + + Task> GetLastContactMembersAsync( + Guid userId, + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default); + + Task GetMemberAsync( + Guid userId, + Guid friendId, + CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatSettingRepository.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatSettingRepository.cs index 4941ec873..0be3ad289 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatSettingRepository.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatSettingRepository.cs @@ -3,11 +3,10 @@ using System.Threading.Tasks; using Volo.Abp.Domain.Repositories; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public interface IUserChatSettingRepository : IBasicRepository { - public interface IUserChatSettingRepository : IBasicRepository - { - Task UserHasOpendImAsync(Guid userId, CancellationToken cancellationToken = default); - Task FindByUserIdAsync(Guid userId, CancellationToken cancellationToken = default); - } + Task UserHasOpendImAsync(Guid userId, CancellationToken cancellationToken = default); + Task FindByUserIdAsync(Guid userId, CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/Message.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/Message.cs index 2f0acd476..b16875ce9 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/Message.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/Message.cs @@ -4,62 +4,61 @@ using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public abstract class Message : CreationAuditedAggregateRoot, IMultiTenant { - public abstract class Message : CreationAuditedAggregateRoot, IMultiTenant + /// + /// 租户 + /// + public virtual Guid? TenantId { get; protected set; } + /// + /// 消息标识 + /// + public virtual long MessageId { get; protected set; } + /// + /// 发送用户名称 + /// + public virtual string SendUserName { get; protected set; } + /// + /// 内容 + /// + public virtual string Content { get; protected set; } + /// + /// 消息类型 + /// + public virtual MessageType Type { get; protected set; } + /// + /// 消息来源 + /// + public virtual MessageSourceType Source { get; protected set; } + /// + /// 发送状态 + /// + public virtual MessageState State { get; protected set; } + protected Message() { } + protected Message( + long id, + Guid sendUserId, + string sendUserName, + string content, + MessageType type = MessageType.Text, + MessageSourceType source = MessageSourceType.User, + Guid? tenantId = null) { - /// - /// 租户 - /// - public virtual Guid? TenantId { get; protected set; } - /// - /// 消息标识 - /// - public virtual long MessageId { get; protected set; } - /// - /// 发送用户名称 - /// - public virtual string SendUserName { get; protected set; } - /// - /// 内容 - /// - public virtual string Content { get; protected set; } - /// - /// 消息类型 - /// - public virtual MessageType Type { get; protected set; } - /// - /// 消息来源 - /// - public virtual MessageSourceType Source { get; protected set; } - /// - /// 发送状态 - /// - public virtual MessageState State { get; protected set; } - protected Message() { } - protected Message( - long id, - Guid sendUserId, - string sendUserName, - string content, - MessageType type = MessageType.Text, - MessageSourceType source = MessageSourceType.User, - Guid? tenantId = null) - { - MessageId = id; - CreatorId = sendUserId; - SendUserName = sendUserName; - Content = content; - Type = type; - Source = source; - CreationTime = DateTime.Now; - TenantId = tenantId; - ChangeSendState(); - } + MessageId = id; + CreatorId = sendUserId; + SendUserName = sendUserName; + Content = content; + Type = type; + Source = source; + CreationTime = DateTime.Now; + TenantId = tenantId; + ChangeSendState(); + } - public void ChangeSendState(MessageState state = MessageState.Send) - { - State = state; - } + public void ChangeSendState(MessageState state = MessageState.Send) + { + State = state; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/MessageProcessor.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/MessageProcessor.cs index 92d9658cb..b1db6d62e 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/MessageProcessor.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/MessageProcessor.cs @@ -7,81 +7,80 @@ using Volo.Abp.Settings; using Volo.Abp.Timing; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +[Dependency(ReplaceServices = true)] +public class MessageProcessor : IMessageProcessor, ITransientDependency { - [Dependency(ReplaceServices = true)] - public class MessageProcessor : IMessageProcessor, ITransientDependency + private readonly IClock _clock; + private readonly IMessageRepository _repository; + private readonly ISettingProvider _settingProvider; + + public MessageProcessor( + IClock clock, + IMessageRepository repository, + ISettingProvider settingProvider) { - private readonly IClock _clock; - private readonly IMessageRepository _repository; - private readonly ISettingProvider _settingProvider; + _clock = clock; + _repository = repository; + _settingProvider = settingProvider; + } - public MessageProcessor( - IClock clock, - IMessageRepository repository, - ISettingProvider settingProvider) + public async virtual Task ReadAsync(ChatMessage message) + { + if (!message.GroupId.IsNullOrWhiteSpace()) { - _clock = clock; - _repository = repository; - _settingProvider = settingProvider; - } + long messageId = long.Parse(message.MessageId); + var groupMessage = await _repository.GetGroupMessageAsync(messageId); + groupMessage.ChangeSendState(MessageState.Read); - public async virtual Task ReadAsync(ChatMessage message) + await _repository.UpdateGroupMessageAsync(groupMessage); + } + else { - if (!message.GroupId.IsNullOrWhiteSpace()) - { - long messageId = long.Parse(message.MessageId); - var groupMessage = await _repository.GetGroupMessageAsync(messageId); - groupMessage.ChangeSendState(MessageState.Read); + long messageId = long.Parse(message.MessageId); + var userMessage = await _repository.GetUserMessageAsync(messageId); + userMessage.ChangeSendState(MessageState.Read); - await _repository.UpdateGroupMessageAsync(groupMessage); - } - else - { - long messageId = long.Parse(message.MessageId); - var userMessage = await _repository.GetUserMessageAsync(messageId); - userMessage.ChangeSendState(MessageState.Read); - - await _repository.UpdateUserMessageAsync(userMessage); - } + await _repository.UpdateUserMessageAsync(userMessage); } + } - public async virtual Task ReCallAsync(ChatMessage message) - { - var expiration = await _settingProvider.GetAsync( - MessageServiceSettingNames.Messages.RecallExpirationTime, 2d); + public async virtual Task ReCallAsync(ChatMessage message) + { + var expiration = await _settingProvider.GetAsync( + MessageServiceSettingNames.Messages.RecallExpirationTime, 2d); - Func hasExpiredMessage = (Message msg) => - msg.CreationTime.AddMinutes(expiration) < _clock.Now; + Func hasExpiredMessage = (Message msg) => + msg.CreationTime.AddMinutes(expiration) < _clock.Now; - if (!message.GroupId.IsNullOrWhiteSpace()) + if (!message.GroupId.IsNullOrWhiteSpace()) + { + long messageId = long.Parse(message.MessageId); + var groupMessage = await _repository.GetGroupMessageAsync(messageId); + if (hasExpiredMessage(groupMessage)) { - long messageId = long.Parse(message.MessageId); - var groupMessage = await _repository.GetGroupMessageAsync(messageId); - if (hasExpiredMessage(groupMessage)) - { - throw new BusinessException(MessageServiceErrorCodes.ExpiredMessageCannotBeReCall) - .WithData("Time", expiration); - } + throw new BusinessException(MessageServiceErrorCodes.ExpiredMessageCannotBeReCall) + .WithData("Time", expiration); + } - groupMessage.ChangeSendState(MessageState.ReCall); + groupMessage.ChangeSendState(MessageState.ReCall); - await _repository.UpdateGroupMessageAsync(groupMessage); - } - else + await _repository.UpdateGroupMessageAsync(groupMessage); + } + else + { + long messageId = long.Parse(message.MessageId); + var userMessage = await _repository.GetUserMessageAsync(messageId); + if (hasExpiredMessage(userMessage)) { - long messageId = long.Parse(message.MessageId); - var userMessage = await _repository.GetUserMessageAsync(messageId); - if (hasExpiredMessage(userMessage)) - { - throw new BusinessException(MessageServiceErrorCodes.ExpiredMessageCannotBeReCall) - .WithData("Time", expiration); - } + throw new BusinessException(MessageServiceErrorCodes.ExpiredMessageCannotBeReCall) + .WithData("Time", expiration); + } - userMessage.ChangeSendState(MessageState.ReCall); + userMessage.ChangeSendState(MessageState.ReCall); - await _repository.UpdateUserMessageAsync(userMessage); - } + await _repository.UpdateUserMessageAsync(userMessage); } } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/MessageStore.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/MessageStore.cs index 9e3d8ddd0..5e9e12e93 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/MessageStore.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/MessageStore.cs @@ -12,266 +12,265 @@ using Volo.Abp.ObjectMapping; using Volo.Abp.Uow; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public class MessageStore : IMessageStore, ITransientDependency { - public class MessageStore : IMessageStore, ITransientDependency - { - private readonly IFriendStore _friendStore; + private readonly IFriendStore _friendStore; - private readonly IObjectMapper _objectMapper; + private readonly IObjectMapper _objectMapper; - private readonly ICurrentTenant _currentTenant; + private readonly ICurrentTenant _currentTenant; - private readonly IUnitOfWorkManager _unitOfWorkManager; + private readonly IUnitOfWorkManager _unitOfWorkManager; - private readonly IGroupRepository _groupRepository; + private readonly IGroupRepository _groupRepository; - private readonly IMessageRepository _messageRepository; + private readonly IMessageRepository _messageRepository; - private readonly IUserChatSettingRepository _userChatSettingRepository; - public MessageStore( - IFriendStore friendStore, - IObjectMapper objectMapper, - ICurrentTenant currentTenant, - IUnitOfWorkManager unitOfWorkManager, - IGroupRepository groupRepository, - IMessageRepository messageRepository, - IUserChatSettingRepository userChatSettingRepository) - { - _friendStore = friendStore; - _objectMapper = objectMapper; - _currentTenant = currentTenant; - _unitOfWorkManager = unitOfWorkManager; - _groupRepository = groupRepository; - _messageRepository = messageRepository; - _userChatSettingRepository = userChatSettingRepository; - } + private readonly IUserChatSettingRepository _userChatSettingRepository; + public MessageStore( + IFriendStore friendStore, + IObjectMapper objectMapper, + ICurrentTenant currentTenant, + IUnitOfWorkManager unitOfWorkManager, + IGroupRepository groupRepository, + IMessageRepository messageRepository, + IUserChatSettingRepository userChatSettingRepository) + { + _friendStore = friendStore; + _objectMapper = objectMapper; + _currentTenant = currentTenant; + _unitOfWorkManager = unitOfWorkManager; + _groupRepository = groupRepository; + _messageRepository = messageRepository; + _userChatSettingRepository = userChatSettingRepository; + } - public async virtual Task StoreMessageAsync( - ChatMessage chatMessage, - CancellationToken cancellationToken = default) + public async virtual Task StoreMessageAsync( + ChatMessage chatMessage, + CancellationToken cancellationToken = default) + { + using (var unitOfWork = _unitOfWorkManager.Begin()) { - using (var unitOfWork = _unitOfWorkManager.Begin()) + using (_currentTenant.Change(chatMessage.TenantId)) { - using (_currentTenant.Change(chatMessage.TenantId)) + if (!chatMessage.GroupId.IsNullOrWhiteSpace()) + { + long groupId = long.Parse(chatMessage.GroupId); + await StoreGroupMessageAsync(chatMessage, groupId, cancellationToken); + } + else { - if (!chatMessage.GroupId.IsNullOrWhiteSpace()) - { - long groupId = long.Parse(chatMessage.GroupId); - await StoreGroupMessageAsync(chatMessage, groupId, cancellationToken); - } - else - { - await StoreUserMessageAsync(chatMessage, cancellationToken); - } - await unitOfWork.CompleteAsync(cancellationToken); + await StoreUserMessageAsync(chatMessage, cancellationToken); } + await unitOfWork.CompleteAsync(cancellationToken); } } + } - public async virtual Task> GetGroupMessageAsync( - Guid? tenantId, - long groupId, - MessageType? type = null, - string filter = "", - string sorting = nameof(ChatMessage.MessageId), - int skipCount = 0, - int maxResultCount = 10, - CancellationToken cancellationToken = default) + public async virtual Task> GetGroupMessageAsync( + Guid? tenantId, + long groupId, + MessageType? type = null, + string filter = "", + string sorting = nameof(ChatMessage.MessageId), + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default) + { + using (_currentTenant.Change(tenantId)) { - using (_currentTenant.Change(tenantId)) - { - var groupMessages = await _messageRepository - .GetGroupMessagesAsync( - groupId, - type, - filter, - sorting, - skipCount, - maxResultCount, - cancellationToken); - - var chatMessages = _objectMapper.Map, List>(groupMessages); - - return chatMessages; - } + var groupMessages = await _messageRepository + .GetGroupMessagesAsync( + groupId, + type, + filter, + sorting, + skipCount, + maxResultCount, + cancellationToken); + + var chatMessages = _objectMapper.Map, List>(groupMessages); + + return chatMessages; } + } - public async virtual Task> GetChatMessageAsync( - Guid? tenantId, - Guid sendUserId, - Guid receiveUserId, - MessageType? type = null, - string filter = "", - string sorting = nameof(ChatMessage.MessageId), - int skipCount = 0, - int maxResultCount = 10, - CancellationToken cancellationToken = default) + public async virtual Task> GetChatMessageAsync( + Guid? tenantId, + Guid sendUserId, + Guid receiveUserId, + MessageType? type = null, + string filter = "", + string sorting = nameof(ChatMessage.MessageId), + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default) + { + using (_currentTenant.Change(tenantId)) { - using (_currentTenant.Change(tenantId)) - { - var userMessages = await _messageRepository - .GetUserMessagesAsync( - sendUserId, - receiveUserId, - type, - filter, - sorting, - skipCount, - maxResultCount, - cancellationToken); - - var chatMessages = _objectMapper.Map, List>(userMessages); - - return chatMessages; - } + var userMessages = await _messageRepository + .GetUserMessagesAsync( + sendUserId, + receiveUserId, + type, + filter, + sorting, + skipCount, + maxResultCount, + cancellationToken); + + var chatMessages = _objectMapper.Map, List>(userMessages); + + return chatMessages; } + } - public async virtual Task> GetLastChatMessagesAsync( - Guid? tenantId, - Guid userId, - MessageState? state = null, - string sorting = nameof(LastChatMessage.SendTime), - int maxResultCount = 10, - CancellationToken cancellationToken = default - ) + public async virtual Task> GetLastChatMessagesAsync( + Guid? tenantId, + Guid userId, + MessageState? state = null, + string sorting = nameof(LastChatMessage.SendTime), + int maxResultCount = 10, + CancellationToken cancellationToken = default + ) + { + using (_currentTenant.Change(tenantId)) { - using (_currentTenant.Change(tenantId)) - { - //var messages = await _messageRepository - // .GetLastMessagesAsync(userId, state, sorting, maxResultCount, cancellationToken); + //var messages = await _messageRepository + // .GetLastMessagesAsync(userId, state, sorting, maxResultCount, cancellationToken); - //return _objectMapper.Map, List>(messages); + //return _objectMapper.Map, List>(messages); - return await _messageRepository - .GetLastMessagesAsync(userId, state, sorting, maxResultCount, cancellationToken); - } + return await _messageRepository + .GetLastMessagesAsync(userId, state, sorting, maxResultCount, cancellationToken); } + } - public async virtual Task GetGroupMessageCountAsync( - Guid? tenantId, - long groupId, - MessageType? type = null, - string filter = "", - CancellationToken cancellationToken = default) + public async virtual Task GetGroupMessageCountAsync( + Guid? tenantId, + long groupId, + MessageType? type = null, + string filter = "", + CancellationToken cancellationToken = default) + { + using (_currentTenant.Change(tenantId)) { - using (_currentTenant.Change(tenantId)) - { - return await _messageRepository.GetCountAsync(groupId, type, filter, cancellationToken); - } + return await _messageRepository.GetCountAsync(groupId, type, filter, cancellationToken); } + } - public async virtual Task GetChatMessageCountAsync( - Guid? tenantId, - Guid sendUserId, - Guid receiveUserId, - MessageType? type = null, - string filter = "", - CancellationToken cancellationToken = default) + public async virtual Task GetChatMessageCountAsync( + Guid? tenantId, + Guid sendUserId, + Guid receiveUserId, + MessageType? type = null, + string filter = "", + CancellationToken cancellationToken = default) + { + using (_currentTenant.Change(tenantId)) { - using (_currentTenant.Change(tenantId)) - { - return await _messageRepository.GetCountAsync(sendUserId, receiveUserId, type, filter, cancellationToken); - } + return await _messageRepository.GetCountAsync(sendUserId, receiveUserId, type, filter, cancellationToken); } + } - protected async virtual Task StoreUserMessageAsync( - ChatMessage chatMessage, - CancellationToken cancellationToken = default) + protected async virtual Task StoreUserMessageAsync( + ChatMessage chatMessage, + CancellationToken cancellationToken = default) + { + // 检查接收用户 + if (!chatMessage.ToUserId.HasValue) { - // 检查接收用户 - if (!chatMessage.ToUserId.HasValue) - { - throw new BusinessException(MessageServiceErrorCodes.UseNotFount); - } + throw new BusinessException(MessageServiceErrorCodes.UseNotFount); + } - var myFriend = await _friendStore - .GetMemberAsync(chatMessage.TenantId, chatMessage.ToUserId.Value, chatMessage.FormUserId, cancellationToken); + var myFriend = await _friendStore + .GetMemberAsync(chatMessage.TenantId, chatMessage.ToUserId.Value, chatMessage.FormUserId, cancellationToken); - var userChatSetting = await _userChatSettingRepository - .FindByUserIdAsync(chatMessage.ToUserId.Value, cancellationToken); + var userChatSetting = await _userChatSettingRepository + .FindByUserIdAsync(chatMessage.ToUserId.Value, cancellationToken); - if (userChatSetting != null) + if (userChatSetting != null) + { + if (!userChatSetting.AllowReceiveMessage) { - if (!userChatSetting.AllowReceiveMessage) - { - // 当前发送的用户不接收消息 - throw new BusinessException(MessageServiceErrorCodes.UserHasRejectAllMessage); - } - - if (myFriend == null && !chatMessage.IsAnonymous) - { - throw new BusinessException(MessageServiceErrorCodes.UserHasRejectNotFriendMessage); - } + // 当前发送的用户不接收消息 + throw new BusinessException(MessageServiceErrorCodes.UserHasRejectAllMessage); + } - if (chatMessage.IsAnonymous && !userChatSetting.AllowAnonymous) - { - // 当前用户不允许匿名发言 - throw new BusinessException(MessageServiceErrorCodes.UserNotAllowedToSpeakAnonymously); - } + if (myFriend == null && !chatMessage.IsAnonymous) + { + throw new BusinessException(MessageServiceErrorCodes.UserHasRejectNotFriendMessage); } - else + + if (chatMessage.IsAnonymous && !userChatSetting.AllowAnonymous) { - if (myFriend == null) - { - throw new BusinessException(MessageServiceErrorCodes.UserHasRejectNotFriendMessage); - } + // 当前用户不允许匿名发言 + throw new BusinessException(MessageServiceErrorCodes.UserNotAllowedToSpeakAnonymously); } - if (myFriend?.Black == true) + } + else + { + if (myFriend == null) { - throw new BusinessException(MessageServiceErrorCodes.UserHasBlack); + throw new BusinessException(MessageServiceErrorCodes.UserHasRejectNotFriendMessage); } + } + if (myFriend?.Black == true) + { + throw new BusinessException(MessageServiceErrorCodes.UserHasBlack); + } - var message = new UserMessage( - long.Parse(chatMessage.MessageId), - chatMessage.FormUserId, - chatMessage.FormUserName, - chatMessage.ToUserId.Value, - chatMessage.Content, - chatMessage.MessageType, - chatMessage.Source); + var message = new UserMessage( + long.Parse(chatMessage.MessageId), + chatMessage.FormUserId, + chatMessage.FormUserName, + chatMessage.ToUserId.Value, + chatMessage.Content, + chatMessage.MessageType, + chatMessage.Source); - message.ExtraProperties.AddIfNotContains(chatMessage.ExtraProperties); + message.ExtraProperties.AddIfNotContains(chatMessage.ExtraProperties); - await _messageRepository.InsertUserMessageAsync(message, cancellationToken); - } + await _messageRepository.InsertUserMessageAsync(message, cancellationToken); + } - protected async virtual Task StoreGroupMessageAsync( - ChatMessage chatMessage, - long groupId, - CancellationToken cancellationToken = default) + protected async virtual Task StoreGroupMessageAsync( + ChatMessage chatMessage, + long groupId, + CancellationToken cancellationToken = default) + { + var userHasBlacked = await _groupRepository + .UserHasBlackedAsync(groupId, chatMessage.FormUserId, cancellationToken); + if (userHasBlacked) { - var userHasBlacked = await _groupRepository - .UserHasBlackedAsync(groupId, chatMessage.FormUserId, cancellationToken); - if (userHasBlacked) - { - // 当前发送的用户已被拉黑 - throw new BusinessException(MessageServiceErrorCodes.GroupUserHasBlack); - } - var group = await _groupRepository.GetByIdAsync(groupId, cancellationToken); - if (!group.AllowSendMessage) - { - // 当前群组不允许发言 - throw new BusinessException(MessageServiceErrorCodes.GroupNotAllowedToSpeak); - } - if (chatMessage.IsAnonymous && !group.AllowAnonymous) - { - // 当前群组不允许匿名发言 - throw new BusinessException(MessageServiceErrorCodes.GroupNotAllowedToSpeakAnonymously); - } + // 当前发送的用户已被拉黑 + throw new BusinessException(MessageServiceErrorCodes.GroupUserHasBlack); + } + var group = await _groupRepository.GetByIdAsync(groupId, cancellationToken); + if (!group.AllowSendMessage) + { + // 当前群组不允许发言 + throw new BusinessException(MessageServiceErrorCodes.GroupNotAllowedToSpeak); + } + if (chatMessage.IsAnonymous && !group.AllowAnonymous) + { + // 当前群组不允许匿名发言 + throw new BusinessException(MessageServiceErrorCodes.GroupNotAllowedToSpeakAnonymously); + } - var message = new GroupMessage( - long.Parse(chatMessage.MessageId), - chatMessage.FormUserId, - chatMessage.FormUserName, - groupId, - chatMessage.Content, - chatMessage.MessageType, - chatMessage.Source); + var message = new GroupMessage( + long.Parse(chatMessage.MessageId), + chatMessage.FormUserId, + chatMessage.FormUserName, + groupId, + chatMessage.Content, + chatMessage.MessageType, + chatMessage.Source); - message.ExtraProperties.AddIfNotContains(chatMessage.ExtraProperties); + message.ExtraProperties.AddIfNotContains(chatMessage.ExtraProperties); - await _messageRepository.InsertGroupMessageAsync(message, cancellationToken); - } + await _messageRepository.InsertGroupMessageAsync(message, cancellationToken); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserCardFinder.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserCardFinder.cs index c43a60b4f..c2c71ac5e 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserCardFinder.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserCardFinder.cs @@ -5,60 +5,59 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public class UserCardFinder : IUserCardFinder, ITransientDependency { - public class UserCardFinder : IUserCardFinder, ITransientDependency - { - private readonly ICurrentTenant _currentTenant; - private readonly IUserChatCardRepository _userChatCardRepository; + private readonly ICurrentTenant _currentTenant; + private readonly IUserChatCardRepository _userChatCardRepository; - public UserCardFinder( - ICurrentTenant currentTenant, - IUserChatCardRepository userChatCardRepository) - { - _currentTenant = currentTenant; - _userChatCardRepository = userChatCardRepository; - } + public UserCardFinder( + ICurrentTenant currentTenant, + IUserChatCardRepository userChatCardRepository) + { + _currentTenant = currentTenant; + _userChatCardRepository = userChatCardRepository; + } - public async virtual Task GetCountAsync( - Guid? tenantId, - string findUserName = "", - int? startAge = null, - int? endAge = null, - Sex? sex = null) + public async virtual Task GetCountAsync( + Guid? tenantId, + string findUserName = "", + int? startAge = null, + int? endAge = null, + Sex? sex = null) + { + using (_currentTenant.Change(tenantId)) { - using (_currentTenant.Change(tenantId)) - { - return await _userChatCardRepository - .GetMemberCountAsync(findUserName, startAge, endAge, sex); - } + return await _userChatCardRepository + .GetMemberCountAsync(findUserName, startAge, endAge, sex); } + } - public async virtual Task> GetListAsync( - Guid? tenantId, - string findUserName = "", - int? startAge = null, - int? endAge = null, - Sex? sex = null, - string sorting = nameof(UserCard.UserId), - int skipCount = 0, - int maxResultCount = 10) + public async virtual Task> GetListAsync( + Guid? tenantId, + string findUserName = "", + int? startAge = null, + int? endAge = null, + Sex? sex = null, + string sorting = nameof(UserCard.UserId), + int skipCount = 0, + int maxResultCount = 10) + { + using (_currentTenant.Change(tenantId)) { - using (_currentTenant.Change(tenantId)) - { - return await _userChatCardRepository - .GetMembersAsync(findUserName, startAge, endAge, sex, - sorting, skipCount, maxResultCount); - } + return await _userChatCardRepository + .GetMembersAsync(findUserName, startAge, endAge, sex, + sorting, skipCount, maxResultCount); } + } - public async virtual Task GetMemberAsync(Guid? tenantId, Guid findUserId) + public async virtual Task GetMemberAsync(Guid? tenantId, Guid findUserId) + { + using (_currentTenant.Change(tenantId)) { - using (_currentTenant.Change(tenantId)) - { - return await _userChatCardRepository - .GetMemberAsync(findUserId); - } + return await _userChatCardRepository + .GetMemberAsync(findUserId); } } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserChatCard.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserChatCard.cs index 452b754c4..734767fdc 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserChatCard.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserChatCard.cs @@ -5,115 +5,114 @@ using Volo.Abp.MultiTenancy; using Volo.Abp.Timing; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +/// +/// 用户卡片 +/// +public class UserChatCard : AuditedAggregateRoot, IMultiTenant { /// - /// 用户卡片 + /// 租户 /// - public class UserChatCard : AuditedAggregateRoot, IMultiTenant - { - /// - /// 租户 - /// - public virtual Guid? TenantId { get; protected set; } - /// - /// 用户标识 - /// - public virtual Guid UserId { get; protected set; } - /// - /// 用户名 - /// - public virtual string UserName { get; protected set; } - /// - /// 性别 - /// - public virtual Sex Sex { get; set; } - /// - /// 签名 - /// - public virtual string Sign { get; set; } - /// - /// 昵称 - /// - public virtual string NickName { get; set; } - /// - /// 说明 - /// - public virtual string Description { get; set; } - /// - /// 头像地址 - /// - public virtual string AvatarUrl { get; protected set; } - /// - /// 生日 - /// - public virtual DateTime? Birthday { get; protected set; } - /// - /// 年龄 - /// - public virtual int Age { get; protected set; } + public virtual Guid? TenantId { get; protected set; } + /// + /// 用户标识 + /// + public virtual Guid UserId { get; protected set; } + /// + /// 用户名 + /// + public virtual string UserName { get; protected set; } + /// + /// 性别 + /// + public virtual Sex Sex { get; set; } + /// + /// 签名 + /// + public virtual string Sign { get; set; } + /// + /// 昵称 + /// + public virtual string NickName { get; set; } + /// + /// 说明 + /// + public virtual string Description { get; set; } + /// + /// 头像地址 + /// + public virtual string AvatarUrl { get; protected set; } + /// + /// 生日 + /// + public virtual DateTime? Birthday { get; protected set; } + /// + /// 年龄 + /// + public virtual int Age { get; protected set; } - public virtual DateTime? LastOnlineTime { get; protected set; } + public virtual DateTime? LastOnlineTime { get; protected set; } - public virtual UserOnlineState State { get; protected set; } + public virtual UserOnlineState State { get; protected set; } - protected UserChatCard() - { - } + protected UserChatCard() + { + } - public UserChatCard( - Guid userId, - string userName, - Sex sex, - string nickName = null, - string avatarUrl = "", - Guid? tenantId = null) - { - Sex = sex; - UserId = userId; - UserName = userName; - NickName = nickName ?? userName; - AvatarUrl = avatarUrl; - TenantId = tenantId; - } + public UserChatCard( + Guid userId, + string userName, + Sex sex, + string nickName = null, + string avatarUrl = "", + Guid? tenantId = null) + { + Sex = sex; + UserId = userId; + UserName = userName; + NickName = nickName ?? userName; + AvatarUrl = avatarUrl; + TenantId = tenantId; + } - public void SetBirthday(DateTime birthday, IClock clock) - { - Birthday = birthday; + public void SetBirthday(DateTime birthday, IClock clock) + { + Birthday = birthday; - Age = DateTimeHelper.CalcAgrByBirthdate(birthday, clock.Now); - } + Age = DateTimeHelper.CalcAgrByBirthdate(birthday, clock.Now); + } - public void SetAvatarUrl(string url) - { - AvatarUrl = url; - } + public void SetAvatarUrl(string url) + { + AvatarUrl = url; + } - public void ChangeState(IClock clock, UserOnlineState state) + public void ChangeState(IClock clock, UserOnlineState state) + { + State = state; + if (State == UserOnlineState.Online) { - State = state; - if (State == UserOnlineState.Online) - { - LastOnlineTime = clock.Now; - } + LastOnlineTime = clock.Now; } + } - public UserCard ToUserCard() + public UserCard ToUserCard() + { + return new UserCard { - return new UserCard - { - Age = Age, - AvatarUrl = AvatarUrl, - Birthday = Birthday, - Description = Description, - NickName = NickName, - Sex = Sex, - Sign = Sign, - UserId = UserId, - UserName = UserName, - TenantId = TenantId, - Online = State == UserOnlineState.Online, - }; - } + Age = Age, + AvatarUrl = AvatarUrl, + Birthday = Birthday, + Description = Description, + NickName = NickName, + Sex = Sex, + Sign = Sign, + UserId = UserId, + UserName = UserName, + TenantId = TenantId, + Online = State == UserOnlineState.Online, + }; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserChatFriend.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserChatFriend.cs index d40d70732..533e71b55 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserChatFriend.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserChatFriend.cs @@ -3,82 +3,81 @@ using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public class UserChatFriend : CreationAuditedAggregateRoot, IMultiTenant { - public class UserChatFriend : CreationAuditedAggregateRoot, IMultiTenant - { - /// - /// 租户 - /// - public virtual Guid? TenantId { get; protected set; } - /// - /// 用户标识 - /// - public virtual Guid UserId { get; protected set; } - /// - /// 好友标识 - /// - public virtual Guid FrientId { get; protected set; } - /// - /// 系统预置 - /// - public virtual bool IsStatic { get; set; } - /// - /// 已添加黑名单 - /// - public virtual bool Black { get; set; } - /// - /// 消息免打扰 - /// - public virtual bool DontDisturb { get; set; } - /// - /// 特别关注 - /// - public virtual bool SpecialFocus { get; set; } - /// - /// 备注名称 - /// - public virtual string RemarkName { get; set; } - /// - /// 附加说明 - /// - public virtual string Description { get; set; } + /// + /// 租户 + /// + public virtual Guid? TenantId { get; protected set; } + /// + /// 用户标识 + /// + public virtual Guid UserId { get; protected set; } + /// + /// 好友标识 + /// + public virtual Guid FrientId { get; protected set; } + /// + /// 系统预置 + /// + public virtual bool IsStatic { get; set; } + /// + /// 已添加黑名单 + /// + public virtual bool Black { get; set; } + /// + /// 消息免打扰 + /// + public virtual bool DontDisturb { get; set; } + /// + /// 特别关注 + /// + public virtual bool SpecialFocus { get; set; } + /// + /// 备注名称 + /// + public virtual string RemarkName { get; set; } + /// + /// 附加说明 + /// + public virtual string Description { get; set; } - public virtual UserFriendStatus Status { get; protected set; } + public virtual UserFriendStatus Status { get; protected set; } - protected UserChatFriend() - { - } + protected UserChatFriend() + { + } - public UserChatFriend( - Guid userId, - Guid friendId, - string remarkName = "", - string description = "", - Guid? tenantId = null) - { - UserId = userId; - FrientId = friendId; - RemarkName = remarkName; - TenantId = tenantId; - Description = description; - Status = UserFriendStatus.NeedValidation; - } + public UserChatFriend( + Guid userId, + Guid friendId, + string remarkName = "", + string description = "", + Guid? tenantId = null) + { + UserId = userId; + FrientId = friendId; + RemarkName = remarkName; + TenantId = tenantId; + Description = description; + Status = UserFriendStatus.NeedValidation; + } - public void SetStatus(UserFriendStatus status = UserFriendStatus.NeedValidation) + public void SetStatus(UserFriendStatus status = UserFriendStatus.NeedValidation) + { + if (Status == UserFriendStatus.NeedValidation && status == UserFriendStatus.Added) { - if (Status == UserFriendStatus.NeedValidation && status == UserFriendStatus.Added) + // 如果是后续验证通过的需要单独的事件 + AddLocalEvent(new UserChatFriendEto { - // 如果是后续验证通过的需要单独的事件 - AddLocalEvent(new UserChatFriendEto - { - TenantId = TenantId, - UserId = UserId, - FrientId = FrientId, - Status = UserFriendStatus.Added - }); - } - Status = status; + TenantId = TenantId, + UserId = UserId, + FrientId = FrientId, + Status = UserFriendStatus.Added + }); } + Status = status; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserChatFriendGroup.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserChatFriendGroup.cs index f6d811721..7168ce897 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserChatFriendGroup.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserChatFriendGroup.cs @@ -2,25 +2,24 @@ using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public class UserChatFriendGroup : CreationAuditedEntity, IMultiTenant { - public class UserChatFriendGroup : CreationAuditedEntity, IMultiTenant - { - /// - /// 租户 - /// - public virtual Guid? TenantId { get; protected set; } - /// - /// 用户标识 - /// - public virtual Guid UserId { get; protected set; } - /// - /// 分组标识 - /// - public virtual long GroupId { get; protected set; } - /// - /// 显示名称 - /// - public virtual string DisplayName { get; protected set; } - } + /// + /// 租户 + /// + public virtual Guid? TenantId { get; protected set; } + /// + /// 用户标识 + /// + public virtual Guid UserId { get; protected set; } + /// + /// 分组标识 + /// + public virtual long GroupId { get; protected set; } + /// + /// 显示名称 + /// + public virtual string DisplayName { get; protected set; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserChatSetting.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserChatSetting.cs index b6a51ea2f..11906ab6f 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserChatSetting.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserChatSetting.cs @@ -2,51 +2,50 @@ using Volo.Abp.Domain.Entities; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public class UserChatSetting : Entity, IMultiTenant { - public class UserChatSetting : Entity, IMultiTenant + /// + /// 租户 + /// + public virtual Guid? TenantId { get; protected set; } + /// + /// 用户标识 + /// + public virtual Guid UserId { get; protected set; } + /// + /// 允许匿名聊天 + /// + public virtual bool AllowAnonymous { get; set; } + /// + /// 允许添加好友 + /// + public virtual bool AllowAddFriend { get; set; } + /// + /// 添加好友需要验证 + /// + public virtual bool RequireAddFriendValition { get; set; } + /// + /// 允许接收消息 + /// + public virtual bool AllowReceiveMessage { get; set; } + /// + /// 允许发送消息 + /// + public virtual bool AllowSendMessage { get; set; } + protected UserChatSetting() + { + } + public UserChatSetting(Guid userId, Guid? tenantId) + : this() { - /// - /// 租户 - /// - public virtual Guid? TenantId { get; protected set; } - /// - /// 用户标识 - /// - public virtual Guid UserId { get; protected set; } - /// - /// 允许匿名聊天 - /// - public virtual bool AllowAnonymous { get; set; } - /// - /// 允许添加好友 - /// - public virtual bool AllowAddFriend { get; set; } - /// - /// 添加好友需要验证 - /// - public virtual bool RequireAddFriendValition { get; set; } - /// - /// 允许接收消息 - /// - public virtual bool AllowReceiveMessage { get; set; } - /// - /// 允许发送消息 - /// - public virtual bool AllowSendMessage { get; set; } - protected UserChatSetting() - { - } - public UserChatSetting(Guid userId, Guid? tenantId) - : this() - { - UserId = userId; - TenantId = tenantId; - AllowAnonymous = false; - AllowAddFriend = true; - AllowReceiveMessage = true; - AllowSendMessage = true; - RequireAddFriendValition = true; - } + UserId = userId; + TenantId = tenantId; + AllowAnonymous = false; + AllowAddFriend = true; + AllowReceiveMessage = true; + AllowSendMessage = true; + RequireAddFriendValition = true; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserFriendCacheItem.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserFriendCacheItem.cs index 97082ace3..50941048e 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserFriendCacheItem.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserFriendCacheItem.cs @@ -2,26 +2,25 @@ using System; using System.Collections.Generic; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +[Serializable] +public class UserFriendCacheItem { - [Serializable] - public class UserFriendCacheItem - { - public List Friends { get; set; } + public List Friends { get; set; } - public UserFriendCacheItem() - { - Friends = new List(); - } + public UserFriendCacheItem() + { + Friends = new List(); + } - public UserFriendCacheItem(List friends) - { - Friends = friends; - } + public UserFriendCacheItem(List friends) + { + Friends = friends; + } - public static string CalculateCacheKey(string userId) - { - return "uid:" + userId; - } + public static string CalculateCacheKey(string userId) + { + return "uid:" + userId; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserMessage.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserMessage.cs index 20384e8a8..38b4052dd 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserMessage.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserMessage.cs @@ -1,28 +1,27 @@ using LINGYUN.Abp.IM.Messages; using System; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public class UserMessage : Message { - public class UserMessage : Message - { - /// - /// 接收用户标识 - /// - public virtual Guid ReceiveUserId { get; set; } + /// + /// 接收用户标识 + /// + public virtual Guid ReceiveUserId { get; set; } - protected UserMessage() { } - public UserMessage( - long id, - Guid sendUserId, - string sendUserName, - Guid receiveUserId, - string content, - MessageType type = MessageType.Text, - MessageSourceType source = MessageSourceType.User, - Guid? tenantId = null) - : base(id, sendUserId, sendUserName, content, type, source, tenantId) - { - ReceiveUserId = receiveUserId; - } + protected UserMessage() { } + public UserMessage( + long id, + Guid sendUserId, + string sendUserName, + Guid receiveUserId, + string content, + MessageType type = MessageType.Text, + MessageSourceType source = MessageSourceType.User, + Guid? tenantId = null) + : base(id, sendUserId, sendUserName, content, type, source, tenantId) + { + ReceiveUserId = receiveUserId; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserOnlineChanger.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserOnlineChanger.cs index 768cae81f..d323caa9f 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserOnlineChanger.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserOnlineChanger.cs @@ -7,41 +7,40 @@ using Volo.Abp.Timing; using Volo.Abp.Uow; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public class UserOnlineChanger : IUserOnlineChanger, ITransientDependency { - public class UserOnlineChanger : IUserOnlineChanger, ITransientDependency - { - private readonly IClock _clock; - private readonly ICurrentTenant _currentTenant; - private readonly IUnitOfWorkManager _unitOfWorkManager; - private readonly IUserChatCardRepository _userChatCardRepository; + private readonly IClock _clock; + private readonly ICurrentTenant _currentTenant; + private readonly IUnitOfWorkManager _unitOfWorkManager; + private readonly IUserChatCardRepository _userChatCardRepository; - public UserOnlineChanger( - IClock clock, - ICurrentTenant currentTenant, - IUnitOfWorkManager unitOfWorkManager, - IUserChatCardRepository userChatCardRepository) - { - _clock = clock; - _currentTenant = currentTenant; - _unitOfWorkManager = unitOfWorkManager; - _userChatCardRepository = userChatCardRepository; - } + public UserOnlineChanger( + IClock clock, + ICurrentTenant currentTenant, + IUnitOfWorkManager unitOfWorkManager, + IUserChatCardRepository userChatCardRepository) + { + _clock = clock; + _currentTenant = currentTenant; + _unitOfWorkManager = unitOfWorkManager; + _userChatCardRepository = userChatCardRepository; + } - public async virtual Task ChangeAsync( - Guid? tenantId, - Guid userId, - UserOnlineState state, - CancellationToken cancellationToken = default) + public async virtual Task ChangeAsync( + Guid? tenantId, + Guid userId, + UserOnlineState state, + CancellationToken cancellationToken = default) + { + using var unitOfWork = _unitOfWorkManager.Begin(); + using (_currentTenant.Change(tenantId)) { - using var unitOfWork = _unitOfWorkManager.Begin(); - using (_currentTenant.Change(tenantId)) - { - var userChatCard = await _userChatCardRepository.FindByUserIdAsync(userId); - userChatCard?.ChangeState(_clock, state); + var userChatCard = await _userChatCardRepository.FindByUserIdAsync(userId); + userChatCard?.ChangeState(_clock, state); - await unitOfWork.CompleteAsync(); - } + await unitOfWork.CompleteAsync(); } } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/EventBus/Local/UserChatFriendEventHandler.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/EventBus/Local/UserChatFriendEventHandler.cs index ba8c77793..4b5251585 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/EventBus/Local/UserChatFriendEventHandler.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/EventBus/Local/UserChatFriendEventHandler.cs @@ -15,118 +15,117 @@ using Volo.Abp.Localization; using Volo.Abp.Users; -namespace LINGYUN.Abp.MessageService.EventBus.Local +namespace LINGYUN.Abp.MessageService.EventBus.Local; + +public class UserChatFriendEventHandler : + ILocalEventHandler>, + ILocalEventHandler>, + ILocalEventHandler>, + ILocalEventHandler, + ITransientDependency { - public class UserChatFriendEventHandler : - ILocalEventHandler>, - ILocalEventHandler>, - ILocalEventHandler>, - ILocalEventHandler, - ITransientDependency + private IStringLocalizer _stringLocalizer; + private IMessageSender _messageSender; + private INotificationSender _notificationSender; + private IDistributedCache _cache; + private ICurrentUser _currentUser; + + public UserChatFriendEventHandler( + ICurrentUser currentUser, + IMessageSender messageSender, + INotificationSender notificationSender, + IDistributedCache cache, + IStringLocalizer stringLocalizer) { - private IStringLocalizer _stringLocalizer; - private IMessageSender _messageSender; - private INotificationSender _notificationSender; - private IDistributedCache _cache; - private ICurrentUser _currentUser; + _cache = cache; + _currentUser = currentUser; + _messageSender = messageSender; + _stringLocalizer = stringLocalizer; + _notificationSender = notificationSender; + } - public UserChatFriendEventHandler( - ICurrentUser currentUser, - IMessageSender messageSender, - INotificationSender notificationSender, - IDistributedCache cache, - IStringLocalizer stringLocalizer) + public async virtual Task HandleEventAsync(EntityCreatedEventData eventData) + { + switch (eventData.Entity.Status) { - _cache = cache; - _currentUser = currentUser; - _messageSender = messageSender; - _stringLocalizer = stringLocalizer; - _notificationSender = notificationSender; + case IM.Contract.UserFriendStatus.NeedValidation: + await SendFriendValidationNotifierAsync(eventData.Entity); + break; } + await RemoveUserFriendCacheItemAsync(eventData.Entity.UserId); + } - public async virtual Task HandleEventAsync(EntityCreatedEventData eventData) - { - switch (eventData.Entity.Status) - { - case IM.Contract.UserFriendStatus.NeedValidation: - await SendFriendValidationNotifierAsync(eventData.Entity); - break; - } - await RemoveUserFriendCacheItemAsync(eventData.Entity.UserId); - } + public async virtual Task HandleEventAsync(EntityDeletedEventData eventData) + { + await RemoveUserFriendCacheItemAsync(eventData.Entity.UserId); + } - public async virtual Task HandleEventAsync(EntityDeletedEventData eventData) - { - await RemoveUserFriendCacheItemAsync(eventData.Entity.UserId); - } + public async virtual Task HandleEventAsync(EntityUpdatedEventData eventData) + { + await RemoveUserFriendCacheItemAsync(eventData.Entity.UserId); + } - public async virtual Task HandleEventAsync(EntityUpdatedEventData eventData) + public async virtual Task HandleEventAsync(UserChatFriendEto eventData) + { + if (eventData.Status == IM.Contract.UserFriendStatus.Added) { - await RemoveUserFriendCacheItemAsync(eventData.Entity.UserId); + await SendFriendAddedMessageAsync(eventData.UserId, eventData.FrientId, eventData.TenantId); } + } - public async virtual Task HandleEventAsync(UserChatFriendEto eventData) - { - if (eventData.Status == IM.Contract.UserFriendStatus.Added) - { - await SendFriendAddedMessageAsync(eventData.UserId, eventData.FrientId, eventData.TenantId); - } - } + protected async virtual Task SendFriendAddedMessageAsync(Guid userId, Guid friendId, Guid? tenantId = null) + { + // 发送添加好友的第一条消息 - protected async virtual Task SendFriendAddedMessageAsync(Guid userId, Guid friendId, Guid? tenantId = null) + var addNewFirendMessage = new ChatMessage { - // 发送添加好友的第一条消息 + TenantId = tenantId, + FormUserId = _currentUser.GetId(), // 本地事件中可以获取到当前用户信息 + FormUserName = _currentUser.UserName, + SendTime = DateTime.Now, + MessageType = MessageType.Text, + ToUserId = friendId, + Content = _stringLocalizer["Messages:NewFriend"] + }; - var addNewFirendMessage = new ChatMessage - { - TenantId = tenantId, - FormUserId = _currentUser.GetId(), // 本地事件中可以获取到当前用户信息 - FormUserName = _currentUser.UserName, - SendTime = DateTime.Now, - MessageType = MessageType.Text, - ToUserId = friendId, - Content = _stringLocalizer["Messages:NewFriend"] - }; - - await _messageSender.SendMessageAsync(addNewFirendMessage); - } + await _messageSender.SendMessageAsync(addNewFirendMessage); + } - protected async virtual Task SendFriendValidationNotifierAsync(UserChatFriend userChatFriend) - { - // 发送好友验证通知 - var userIdentifer = new UserIdentifier(userChatFriend.FrientId, userChatFriend.RemarkName); + protected async virtual Task SendFriendValidationNotifierAsync(UserChatFriend userChatFriend) + { + // 发送好友验证通知 + var userIdentifer = new UserIdentifier(userChatFriend.FrientId, userChatFriend.RemarkName); - var friendValidationNotifictionData = new NotificationData(); - friendValidationNotifictionData - .WriteLocalizedData( - new LocalizableStringInfo( - LocalizationResourceNameAttribute.GetName(typeof(MessageServiceResource)), - "Notifications:FriendValidation"), - new LocalizableStringInfo( - LocalizationResourceNameAttribute.GetName(typeof(MessageServiceResource)), - "Notifications:RequestAddNewFriend", - new Dictionary { { "name", _currentUser.UserName } }), - DateTime.Now, - _currentUser.UserName, - new LocalizableStringInfo( - LocalizationResourceNameAttribute.GetName(typeof(MessageServiceResource)), - "Notifications:RequestAddNewFriendDetail", - new Dictionary { { "description", userChatFriend.Description } })); - friendValidationNotifictionData.TrySetData("userId", userChatFriend.UserId); - friendValidationNotifictionData.TrySetData("frientId", userChatFriend.FrientId); + var friendValidationNotifictionData = new NotificationData(); + friendValidationNotifictionData + .WriteLocalizedData( + new LocalizableStringInfo( + LocalizationResourceNameAttribute.GetName(typeof(MessageServiceResource)), + "Notifications:FriendValidation"), + new LocalizableStringInfo( + LocalizationResourceNameAttribute.GetName(typeof(MessageServiceResource)), + "Notifications:RequestAddNewFriend", + new Dictionary { { "name", _currentUser.UserName } }), + DateTime.Now, + _currentUser.UserName, + new LocalizableStringInfo( + LocalizationResourceNameAttribute.GetName(typeof(MessageServiceResource)), + "Notifications:RequestAddNewFriendDetail", + new Dictionary { { "description", userChatFriend.Description } })); + friendValidationNotifictionData.TrySetData("userId", userChatFriend.UserId); + friendValidationNotifictionData.TrySetData("frientId", userChatFriend.FrientId); - await _notificationSender - .SendNofiterAsync( - MessageServiceNotificationNames.IM.FriendValidation, - friendValidationNotifictionData, - userIdentifer, - userChatFriend.TenantId); - } + await _notificationSender + .SendNofiterAsync( + MessageServiceNotificationNames.IM.FriendValidation, + friendValidationNotifictionData, + userIdentifer, + userChatFriend.TenantId); + } - protected async virtual Task RemoveUserFriendCacheItemAsync(Guid userId) - { - // 移除好友缓存 - await _cache.RemoveAsync(UserFriendCacheItem.CalculateCacheKey(userId.ToString())); - } + protected async virtual Task RemoveUserFriendCacheItemAsync(Guid userId) + { + // 移除好友缓存 + await _cache.RemoveAsync(UserFriendCacheItem.CalculateCacheKey(userId.ToString())); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/ChatGroup.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/ChatGroup.cs index 517eea6fd..1c77fa346 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/ChatGroup.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/ChatGroup.cs @@ -2,78 +2,77 @@ using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.MessageService.Groups +namespace LINGYUN.Abp.MessageService.Groups; + +/// +/// 聊天群组 +/// +public class ChatGroup : AuditedEntity, IMultiTenant { /// - /// 聊天群组 + /// 租户 + /// + public virtual Guid? TenantId { get; protected set; } + /// + /// 群主 + /// + public virtual Guid AdminUserId { get; protected set; } + /// + /// 群组标识 + /// + public virtual long GroupId { get; protected set; } + /// + /// 群组名称 + /// + public virtual string Name { get; protected set; } + /// + /// 群组标记 + /// + public virtual string Tag { get; protected set; } + /// + /// 群组地址 + /// + public virtual string Address { get; set; } + /// + /// 群组公告 /// - public class ChatGroup : AuditedEntity, IMultiTenant + public virtual string Notice { get; set; } + /// + /// 最大用户数量 + /// + public virtual int MaxUserCount { get; protected set; } + /// + /// 允许匿名聊天 + /// + public virtual bool AllowAnonymous { get; set; } + /// + /// 允许发送消息 + /// + public virtual bool AllowSendMessage { get; set; } + /// + /// 群组说明 + /// + public virtual string Description { get; set; } + /// + /// 群组头像地址 + /// + public virtual string AvatarUrl { get; set; } + protected ChatGroup() + { + } + public ChatGroup( + long id, + Guid adminUserId, + string name, + string tag = "", + string address = "", + int maxUserCount = 200) { - /// - /// 租户 - /// - public virtual Guid? TenantId { get; protected set; } - /// - /// 群主 - /// - public virtual Guid AdminUserId { get; protected set; } - /// - /// 群组标识 - /// - public virtual long GroupId { get; protected set; } - /// - /// 群组名称 - /// - public virtual string Name { get; protected set; } - /// - /// 群组标记 - /// - public virtual string Tag { get; protected set; } - /// - /// 群组地址 - /// - public virtual string Address { get; set; } - /// - /// 群组公告 - /// - public virtual string Notice { get; set; } - /// - /// 最大用户数量 - /// - public virtual int MaxUserCount { get; protected set; } - /// - /// 允许匿名聊天 - /// - public virtual bool AllowAnonymous { get; set; } - /// - /// 允许发送消息 - /// - public virtual bool AllowSendMessage { get; set; } - /// - /// 群组说明 - /// - public virtual string Description { get; set; } - /// - /// 群组头像地址 - /// - public virtual string AvatarUrl { get; set; } - protected ChatGroup() - { - } - public ChatGroup( - long id, - Guid adminUserId, - string name, - string tag = "", - string address = "", - int maxUserCount = 200) - { - GroupId = id; - AdminUserId = adminUserId; - Name = name; - Tag = tag; - Address = address; - MaxUserCount = maxUserCount; - } + GroupId = id; + AdminUserId = adminUserId; + Name = name; + Tag = tag; + Address = address; + MaxUserCount = maxUserCount; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/GroupChatBlack.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/GroupChatBlack.cs index 9ec767e27..12c06ec56 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/GroupChatBlack.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/GroupChatBlack.cs @@ -2,31 +2,30 @@ using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.MessageService.Groups +namespace LINGYUN.Abp.MessageService.Groups; + +/// +/// 用户黑名单 +/// +public class GroupChatBlack : CreationAuditedEntity, IMultiTenant { /// - /// 用户黑名单 + /// 租户 + /// + public virtual Guid? TenantId { get; protected set; } + /// + /// 群组标识 + /// + public virtual long GroupId { get; protected set; } + /// + /// 拉黑的用户 /// - public class GroupChatBlack : CreationAuditedEntity, IMultiTenant + public virtual Guid ShieldUserId { get; protected set; } + protected GroupChatBlack() { } + public GroupChatBlack(long groupId, Guid shieldUserId, Guid? tenantId) { - /// - /// 租户 - /// - public virtual Guid? TenantId { get; protected set; } - /// - /// 群组标识 - /// - public virtual long GroupId { get; protected set; } - /// - /// 拉黑的用户 - /// - public virtual Guid ShieldUserId { get; protected set; } - protected GroupChatBlack() { } - public GroupChatBlack(long groupId, Guid shieldUserId, Guid? tenantId) - { - GroupId = groupId; - ShieldUserId = shieldUserId; - TenantId = tenantId; - } + GroupId = groupId; + ShieldUserId = shieldUserId; + TenantId = tenantId; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/GroupMessage.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/GroupMessage.cs index be37a7405..6f1558aa7 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/GroupMessage.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/GroupMessage.cs @@ -2,28 +2,27 @@ using LINGYUN.Abp.MessageService.Chat; using System; -namespace LINGYUN.Abp.MessageService.Groups +namespace LINGYUN.Abp.MessageService.Groups; + +public class GroupMessage : Message { - public class GroupMessage : Message - { - /// - /// 群组标识 - /// - public virtual long GroupId { get; protected set; } + /// + /// 群组标识 + /// + public virtual long GroupId { get; protected set; } - protected GroupMessage() { } - public GroupMessage( - long id, - Guid sendUserId, - string sendUserName, - long groupId, - string content, - MessageType type = MessageType.Text, - MessageSourceType source = MessageSourceType.User, - Guid? tenantId = null) - : base(id, sendUserId, sendUserName, content, type, source, tenantId) - { - GroupId = groupId; - } + protected GroupMessage() { } + public GroupMessage( + long id, + Guid sendUserId, + string sendUserName, + long groupId, + string content, + MessageType type = MessageType.Text, + MessageSourceType source = MessageSourceType.User, + Guid? tenantId = null) + : base(id, sendUserId, sendUserName, content, type, source, tenantId) + { + GroupId = groupId; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/GroupStore.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/GroupStore.cs index ff593b015..6ff2f4698 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/GroupStore.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/GroupStore.cs @@ -7,66 +7,65 @@ using Volo.Abp.MultiTenancy; using Volo.Abp.ObjectMapping; -namespace LINGYUN.Abp.MessageService.Groups +namespace LINGYUN.Abp.MessageService.Groups; + +public class GroupStore : IGroupStore, ITransientDependency { - public class GroupStore : IGroupStore, ITransientDependency - { - private readonly IObjectMapper _objectMapper; - private readonly ICurrentTenant _currentTenant; - private readonly IGroupRepository _groupRepository; + private readonly IObjectMapper _objectMapper; + private readonly ICurrentTenant _currentTenant; + private readonly IGroupRepository _groupRepository; - public GroupStore( - IObjectMapper objectMapper, - ICurrentTenant currentTenant, - IGroupRepository groupRepository) - { - _objectMapper = objectMapper; - _currentTenant = currentTenant; - _groupRepository = groupRepository; - } + public GroupStore( + IObjectMapper objectMapper, + ICurrentTenant currentTenant, + IGroupRepository groupRepository) + { + _objectMapper = objectMapper; + _currentTenant = currentTenant; + _groupRepository = groupRepository; + } - public async virtual Task GetAsync( - Guid? tenantId, - string groupId, - CancellationToken cancellationToken = default) + public async virtual Task GetAsync( + Guid? tenantId, + string groupId, + CancellationToken cancellationToken = default) + { + using (_currentTenant.Change(tenantId)) { - using (_currentTenant.Change(tenantId)) - { - var group = await _groupRepository.FindByIdAsync(long.Parse(groupId), cancellationToken); - return _objectMapper.Map(group); - } + var group = await _groupRepository.FindByIdAsync(long.Parse(groupId), cancellationToken); + return _objectMapper.Map(group); } + } - public async virtual Task GetCountAsync( - Guid? tenantId, - string filter = null, - CancellationToken cancellationToken = default) + public async virtual Task GetCountAsync( + Guid? tenantId, + string filter = null, + CancellationToken cancellationToken = default) + { + using (_currentTenant.Change(tenantId)) { - using (_currentTenant.Change(tenantId)) - { - return await _groupRepository.GetCountAsync(filter, cancellationToken); - } + return await _groupRepository.GetCountAsync(filter, cancellationToken); } + } - public async virtual Task> GetListAsync( - Guid? tenantId, - string filter = null, - string sorting = nameof(Group.Name), - int skipCount = 0, - int maxResultCount = 10, - CancellationToken cancellationToken = default) + public async virtual Task> GetListAsync( + Guid? tenantId, + string filter = null, + string sorting = nameof(Group.Name), + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default) + { + using (_currentTenant.Change(tenantId)) { - using (_currentTenant.Change(tenantId)) - { - var groups = await _groupRepository.GetListAsync( - filter, - sorting, - skipCount, - maxResultCount, - cancellationToken); + var groups = await _groupRepository.GetListAsync( + filter, + sorting, + skipCount, + maxResultCount, + cancellationToken); - return _objectMapper.Map, List>(groups); - } + return _objectMapper.Map, List>(groups); } } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/IGroupRepository.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/IGroupRepository.cs index bbcdc7588..c76142d4d 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/IGroupRepository.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/IGroupRepository.cs @@ -4,52 +4,51 @@ using System.Threading.Tasks; using Volo.Abp.Domain.Repositories; -namespace LINGYUN.Abp.MessageService.Groups +namespace LINGYUN.Abp.MessageService.Groups; + +public interface IGroupRepository : IBasicRepository { - public interface IGroupRepository : IBasicRepository - { - /// - /// 用户是否已被拉黑 - /// - /// - /// - /// - Task UserHasBlackedAsync( - long id, - Guid formUserId, - CancellationToken cancellationToken = default); + /// + /// 用户是否已被拉黑 + /// + /// + /// + /// + Task UserHasBlackedAsync( + long id, + Guid formUserId, + CancellationToken cancellationToken = default); - Task FindByIdAsync( - long id, - CancellationToken cancellationToken = default); + Task FindByIdAsync( + long id, + CancellationToken cancellationToken = default); - Task> GetGroupAdminAsync( - long id, - CancellationToken cancellationToken = default); + Task> GetGroupAdminAsync( + long id, + CancellationToken cancellationToken = default); - /// - /// 获取群组数 - /// - /// - /// - /// - Task GetCountAsync( - string filter = null, - CancellationToken cancellationToken = default); - /// - /// 获取群组列表 - /// - /// - /// - /// - /// - /// - /// - Task> GetListAsync( - string filter = null, - string sorting = nameof(ChatGroup.Name), - int skipCount = 0, - int maxResultCount = 10, - CancellationToken cancellationToken = default); - } + /// + /// 获取群组数 + /// + /// + /// + /// + Task GetCountAsync( + string filter = null, + CancellationToken cancellationToken = default); + /// + /// 获取群组列表 + /// + /// + /// + /// + /// + /// + /// + Task> GetListAsync( + string filter = null, + string sorting = nameof(ChatGroup.Name), + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/IGroupRepositoryExtensions.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/IGroupRepositoryExtensions.cs index 844fe34ad..243d97d92 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/IGroupRepositoryExtensions.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/IGroupRepositoryExtensions.cs @@ -2,18 +2,17 @@ using System.Threading.Tasks; using Volo.Abp; -namespace LINGYUN.Abp.MessageService.Groups +namespace LINGYUN.Abp.MessageService.Groups; + +public static class IGroupRepositoryExtensions { - public static class IGroupRepositoryExtensions + public static async Task GetByIdAsync( + this IGroupRepository repository, + long id, + CancellationToken cancellationToken = default) { - public static async Task GetByIdAsync( - this IGroupRepository repository, - long id, - CancellationToken cancellationToken = default) - { - var group = await repository.FindByIdAsync(id, cancellationToken); + var group = await repository.FindByIdAsync(id, cancellationToken); - return group ?? throw new BusinessException(MessageServiceErrorCodes.GroupNotFount); - } + return group ?? throw new BusinessException(MessageServiceErrorCodes.GroupNotFount); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/IUserChatGroupRepository.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/IUserChatGroupRepository.cs index 40abdb31e..7c4152fc9 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/IUserChatGroupRepository.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/IUserChatGroupRepository.cs @@ -5,74 +5,73 @@ using System.Threading.Tasks; using Volo.Abp.Domain.Repositories; -namespace LINGYUN.Abp.MessageService.Groups +namespace LINGYUN.Abp.MessageService.Groups; + +public interface IUserChatGroupRepository : IBasicRepository { - public interface IUserChatGroupRepository : IBasicRepository - { - /// - /// 成员是否在群组里 - /// - /// - /// - /// - Task MemberHasInGroupAsync( - long groupId, - Guid userId, - CancellationToken cancellationToken = default); - /// - /// 获取群组成员 - /// - /// - /// - /// - /// - Task GetMemberAsync( - long groupId, - Guid userId, - CancellationToken cancellationToken = default); - /// - /// 获取群组成员数 - /// - /// - /// - /// - Task GetMembersCountAsync( - long groupId, - CancellationToken cancellationToken = default); - /// - /// 获取群组成员列表 - /// - /// - /// - /// - /// - /// - /// - Task> GetMembersAsync( - long groupId, - string sorting = nameof(GroupUserCard.UserId), - int skipCount = 0, - int maxResultCount = 10, - CancellationToken cancellationToken = default); - /// - /// 获取成员所在群组列表 - /// - /// - /// - /// - Task> GetMemberGroupsAsync( - Guid userId, - CancellationToken cancellationToken = default); - /// - /// 从群组中移除成员 - /// - /// - /// - /// - /// - Task RemoveMemberFormGroupAsync( - long groupId, - Guid userId, - CancellationToken cancellationToken = default); - } + /// + /// 成员是否在群组里 + /// + /// + /// + /// + Task MemberHasInGroupAsync( + long groupId, + Guid userId, + CancellationToken cancellationToken = default); + /// + /// 获取群组成员 + /// + /// + /// + /// + /// + Task GetMemberAsync( + long groupId, + Guid userId, + CancellationToken cancellationToken = default); + /// + /// 获取群组成员数 + /// + /// + /// + /// + Task GetMembersCountAsync( + long groupId, + CancellationToken cancellationToken = default); + /// + /// 获取群组成员列表 + /// + /// + /// + /// + /// + /// + /// + Task> GetMembersAsync( + long groupId, + string sorting = nameof(GroupUserCard.UserId), + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default); + /// + /// 获取成员所在群组列表 + /// + /// + /// + /// + Task> GetMemberGroupsAsync( + Guid userId, + CancellationToken cancellationToken = default); + /// + /// 从群组中移除成员 + /// + /// + /// + /// + /// + Task RemoveMemberFormGroupAsync( + long groupId, + Guid userId, + CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/UserChatGroup.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/UserChatGroup.cs index e814250e7..618e916dd 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/UserChatGroup.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/UserChatGroup.cs @@ -2,26 +2,25 @@ using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.MessageService.Groups +namespace LINGYUN.Abp.MessageService.Groups; + +/// +/// 用户群组 +/// +public class UserChatGroup : CreationAuditedEntity, IMultiTenant { /// - /// 用户群组 + /// 租户 /// - public class UserChatGroup : CreationAuditedEntity, IMultiTenant + public virtual Guid? TenantId { get; protected set; } + public virtual Guid UserId { get; protected set; } + public virtual long GroupId { get; protected set; } + protected UserChatGroup() { } + public UserChatGroup(long groupId, Guid userId, Guid acceptUserId, Guid? tenantId = null) { - /// - /// 租户 - /// - public virtual Guid? TenantId { get; protected set; } - public virtual Guid UserId { get; protected set; } - public virtual long GroupId { get; protected set; } - protected UserChatGroup() { } - public UserChatGroup(long groupId, Guid userId, Guid acceptUserId, Guid? tenantId = null) - { - UserId = userId; - GroupId = groupId; - CreatorId = acceptUserId; - TenantId = tenantId; - } + UserId = userId; + GroupId = groupId; + CreatorId = acceptUserId; + TenantId = tenantId; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/UserGroupCard.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/UserGroupCard.cs index 8e5a89b87..47efafdae 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/UserGroupCard.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/UserGroupCard.cs @@ -3,72 +3,71 @@ using Volo.Abp.MultiTenancy; using Volo.Abp.Timing; -namespace LINGYUN.Abp.MessageService.Groups +namespace LINGYUN.Abp.MessageService.Groups; + +/// +/// 用户群组卡片 +/// +public class UserGroupCard : AuditedAggregateRoot, IMultiTenant { /// - /// 用户群组卡片 + /// 租户 + /// + public virtual Guid? TenantId { get; protected set; } + /// + /// 用户标识 + /// + public virtual Guid UserId { get; protected set; } + /// + /// 昵称 + /// + public virtual string NickName { get; set; } + /// + /// 是否管理员 + /// + public virtual bool IsAdmin { get; protected set; } + /// + /// 禁言期止 + /// + public virtual DateTime? SilenceEnd { get; protected set; } + protected UserGroupCard() + { + } + public UserGroupCard( + Guid userId, + string nickName = "", + bool isAdmin = false, + DateTime? silenceEnd = null, + Guid? tenantId = null) + { + UserId = userId; + NickName = nickName; + IsAdmin = isAdmin; + SilenceEnd = silenceEnd; + TenantId = tenantId; + } + /// + /// 设置管理员 + /// + /// + public void SetAdmin(bool admin) + { + IsAdmin = admin; + } + /// + /// 禁言 + /// + /// + /// + public void Silence(IClock clock, double seconds) + { + SilenceEnd = clock.Now.AddSeconds(seconds); + } + /// + /// 解除禁言 /// - public class UserGroupCard : AuditedAggregateRoot, IMultiTenant + public void UnSilence() { - /// - /// 租户 - /// - public virtual Guid? TenantId { get; protected set; } - /// - /// 用户标识 - /// - public virtual Guid UserId { get; protected set; } - /// - /// 昵称 - /// - public virtual string NickName { get; set; } - /// - /// 是否管理员 - /// - public virtual bool IsAdmin { get; protected set; } - /// - /// 禁言期止 - /// - public virtual DateTime? SilenceEnd { get; protected set; } - protected UserGroupCard() - { - } - public UserGroupCard( - Guid userId, - string nickName = "", - bool isAdmin = false, - DateTime? silenceEnd = null, - Guid? tenantId = null) - { - UserId = userId; - NickName = nickName; - IsAdmin = isAdmin; - SilenceEnd = silenceEnd; - TenantId = tenantId; - } - /// - /// 设置管理员 - /// - /// - public void SetAdmin(bool admin) - { - IsAdmin = admin; - } - /// - /// 禁言 - /// - /// - /// - public void Silence(IClock clock, double seconds) - { - SilenceEnd = clock.Now.AddSeconds(seconds); - } - /// - /// 解除禁言 - /// - public void UnSilence() - { - SilenceEnd = null; - } + SilenceEnd = null; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/UserGroupStore.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/UserGroupStore.cs index 4a1f65594..1ca5de304 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/UserGroupStore.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Groups/UserGroupStore.cs @@ -7,136 +7,135 @@ using Volo.Abp.MultiTenancy; using Volo.Abp.Uow; -namespace LINGYUN.Abp.MessageService.Groups +namespace LINGYUN.Abp.MessageService.Groups; + +public class UserGroupStore : IUserGroupStore, ITransientDependency { - public class UserGroupStore : IUserGroupStore, ITransientDependency + private readonly ICurrentTenant _currentTenant; + private readonly IUnitOfWorkManager _unitOfWorkManager; + private readonly IUserChatGroupRepository _userChatGroupRepository; + + public UserGroupStore( + ICurrentTenant currentTenant, + IUnitOfWorkManager unitOfWorkManager, + IUserChatGroupRepository userChatGroupRepository) { - private readonly ICurrentTenant _currentTenant; - private readonly IUnitOfWorkManager _unitOfWorkManager; - private readonly IUserChatGroupRepository _userChatGroupRepository; + _currentTenant = currentTenant; + _unitOfWorkManager = unitOfWorkManager; + _userChatGroupRepository = userChatGroupRepository; + } - public UserGroupStore( - ICurrentTenant currentTenant, - IUnitOfWorkManager unitOfWorkManager, - IUserChatGroupRepository userChatGroupRepository) + public async virtual Task MemberHasInGroupAsync( + Guid? tenantId, + long groupId, + Guid userId, + CancellationToken cancellationToken = default) + { + using (_currentTenant.Change(tenantId)) { - _currentTenant = currentTenant; - _unitOfWorkManager = unitOfWorkManager; - _userChatGroupRepository = userChatGroupRepository; + return await _userChatGroupRepository.MemberHasInGroupAsync(groupId, userId, cancellationToken); } + } - public async virtual Task MemberHasInGroupAsync( - Guid? tenantId, - long groupId, - Guid userId, - CancellationToken cancellationToken = default) + public async virtual Task AddUserToGroupAsync( + Guid? tenantId, + Guid userId, + long groupId, + Guid acceptUserId, + CancellationToken cancellationToken = default) + { + using (var unitOfWork = _unitOfWorkManager.Begin()) { using (_currentTenant.Change(tenantId)) { - return await _userChatGroupRepository.MemberHasInGroupAsync(groupId, userId, cancellationToken); - } - } - - public async virtual Task AddUserToGroupAsync( - Guid? tenantId, - Guid userId, - long groupId, - Guid acceptUserId, - CancellationToken cancellationToken = default) - { - using (var unitOfWork = _unitOfWorkManager.Begin()) - { - using (_currentTenant.Change(tenantId)) + var userHasInGroup = await _userChatGroupRepository.MemberHasInGroupAsync(groupId, userId, cancellationToken); + if (!userHasInGroup) { - var userHasInGroup = await _userChatGroupRepository.MemberHasInGroupAsync(groupId, userId, cancellationToken); - if (!userHasInGroup) - { - var userGroup = new UserChatGroup(groupId, userId, acceptUserId, tenantId); + var userGroup = new UserChatGroup(groupId, userId, acceptUserId, tenantId); - await _userChatGroupRepository.InsertAsync(userGroup, cancellationToken: cancellationToken); + await _userChatGroupRepository.InsertAsync(userGroup, cancellationToken: cancellationToken); - await unitOfWork.CompleteAsync(cancellationToken); - } + await unitOfWork.CompleteAsync(cancellationToken); } } } + } - public async Task GetUserGroupCardAsync( - Guid? tenantId, - long groupId, - Guid userId, - CancellationToken cancellationToken = default) + public async Task GetUserGroupCardAsync( + Guid? tenantId, + long groupId, + Guid userId, + CancellationToken cancellationToken = default) + { + using (_currentTenant.Change(tenantId)) { - using (_currentTenant.Change(tenantId)) - { - var groupUserCard = await _userChatGroupRepository.GetMemberAsync(groupId, userId, cancellationToken); + var groupUserCard = await _userChatGroupRepository.GetMemberAsync(groupId, userId, cancellationToken); - return groupUserCard; - } + return groupUserCard; } + } - public async Task> GetMembersAsync( - Guid? tenantId, - long groupId, - CancellationToken cancellationToken = default) + public async Task> GetMembersAsync( + Guid? tenantId, + long groupId, + CancellationToken cancellationToken = default) + { + using (_currentTenant.Change(tenantId)) { - using (_currentTenant.Change(tenantId)) - { - return await _userChatGroupRepository.GetMembersAsync(groupId, cancellationToken: cancellationToken); - } + return await _userChatGroupRepository.GetMembersAsync(groupId, cancellationToken: cancellationToken); } + } - public async Task> GetUserGroupsAsync( - Guid? tenantId, - Guid userId, - CancellationToken cancellationToken = default) + public async Task> GetUserGroupsAsync( + Guid? tenantId, + Guid userId, + CancellationToken cancellationToken = default) + { + using (_currentTenant.Change(tenantId)) { - using (_currentTenant.Change(tenantId)) - { - return await _userChatGroupRepository.GetMemberGroupsAsync(userId, cancellationToken); - } + return await _userChatGroupRepository.GetMemberGroupsAsync(userId, cancellationToken); } + } - public async Task RemoveUserFormGroupAsync( - Guid? tenantId, - Guid userId, - long groupId, - CancellationToken cancellationToken = default) + public async Task RemoveUserFormGroupAsync( + Guid? tenantId, + Guid userId, + long groupId, + CancellationToken cancellationToken = default) + { + using (var unitOfWork = _unitOfWorkManager.Begin()) { - using (var unitOfWork = _unitOfWorkManager.Begin()) + using (_currentTenant.Change(tenantId)) { - using (_currentTenant.Change(tenantId)) - { - await _userChatGroupRepository.RemoveMemberFormGroupAsync(groupId, userId, cancellationToken); + await _userChatGroupRepository.RemoveMemberFormGroupAsync(groupId, userId, cancellationToken); - await unitOfWork.CompleteAsync(cancellationToken); - } + await unitOfWork.CompleteAsync(cancellationToken); } } + } - public async Task GetMembersCountAsync( - Guid? tenantId, - long groupId, - CancellationToken cancellationToken = default) + public async Task GetMembersCountAsync( + Guid? tenantId, + long groupId, + CancellationToken cancellationToken = default) + { + using (_currentTenant.Change(tenantId)) { - using (_currentTenant.Change(tenantId)) - { - return await _userChatGroupRepository.GetMembersCountAsync(groupId, cancellationToken); - } + return await _userChatGroupRepository.GetMembersCountAsync(groupId, cancellationToken); } + } - public async Task> GetMembersAsync( - Guid? tenantId, - long groupId, - string sorting = nameof(GroupUserCard.UserId), - int skipCount = 0, - int maxResultCount = 10, - CancellationToken cancellationToken = default) + public async Task> GetMembersAsync( + Guid? tenantId, + long groupId, + string sorting = nameof(GroupUserCard.UserId), + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default) + { + using (_currentTenant.Change(tenantId)) { - using (_currentTenant.Change(tenantId)) - { - return await _userChatGroupRepository.GetMembersAsync(groupId, sorting, skipCount, maxResultCount, cancellationToken); - } + return await _userChatGroupRepository.GetMembersAsync(groupId, sorting, skipCount, maxResultCount, cancellationToken); } } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/IMessageDataSeeder.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/IMessageDataSeeder.cs index 761f7c8fd..fa7ae6e09 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/IMessageDataSeeder.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/IMessageDataSeeder.cs @@ -1,10 +1,9 @@ using System; using System.Threading.Tasks; -namespace LINGYUN.Abp.MessageService +namespace LINGYUN.Abp.MessageService; + +public interface IMessageDataSeeder { - public interface IMessageDataSeeder - { - Task SeedAsync(Guid? tenantId = null); - } + Task SeedAsync(Guid? tenantId = null); } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Mapper/MessageServiceDomainAutoMapperProfile.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Mapper/MessageServiceDomainAutoMapperProfile.cs index 1a650b848..4a65347f8 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Mapper/MessageServiceDomainAutoMapperProfile.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Mapper/MessageServiceDomainAutoMapperProfile.cs @@ -7,41 +7,40 @@ using Volo.Abp.Data; using Volo.Abp.ObjectExtending; -namespace LINGYUN.Abp.MessageService.Mapper +namespace LINGYUN.Abp.MessageService.Mapper; + +public class MessageServiceDomainAutoMapperProfile : Profile { - public class MessageServiceDomainAutoMapperProfile : Profile + public MessageServiceDomainAutoMapperProfile() { - public MessageServiceDomainAutoMapperProfile() - { - CreateMessageMap() - .ForMember(dto => dto.Content, map => map.MapFrom(src => src.Content)) - .ForMember(dto => dto.GroupId, map => map.MapFrom(src => src.GroupId.ToString())) - .Ignore(dto => dto.ToUserId); + CreateMessageMap() + .ForMember(dto => dto.Content, map => map.MapFrom(src => src.Content)) + .ForMember(dto => dto.GroupId, map => map.MapFrom(src => src.GroupId.ToString())) + .Ignore(dto => dto.ToUserId); - CreateMessageMap() - .ForMember(dto => dto.ToUserId, map => map.MapFrom(src => src.ReceiveUserId)) - .Ignore(dto => dto.GroupId); + CreateMessageMap() + .ForMember(dto => dto.ToUserId, map => map.MapFrom(src => src.ReceiveUserId)) + .Ignore(dto => dto.GroupId); - CreateMap() - .ForMember(g => g.Id, map => map.MapFrom(src => src.GroupId.ToString())) - .ForMember(g => g.MaxUserLength, map => map.MapFrom(src => src.MaxUserCount)) - .Ignore(g => g.GroupUserCount); - } + CreateMap() + .ForMember(g => g.Id, map => map.MapFrom(src => src.GroupId.ToString())) + .ForMember(g => g.MaxUserLength, map => map.MapFrom(src => src.MaxUserCount)) + .Ignore(g => g.GroupUserCount); + } - protected IMappingExpression CreateMessageMap() - where TSource : Message - where TDestination : ChatMessage - { - return CreateMap() - .ForMember(dto => dto.Content, map => map.MapFrom(src => src.Content)) - .ForMember(dto => dto.MessageId, map => map.MapFrom(src => src.MessageId.ToString())) - .ForMember(dto => dto.FormUserId, map => map.MapFrom(src => src.CreatorId)) - .ForMember(dto => dto.FormUserName, map => map.MapFrom(src => src.SendUserName)) - .ForMember(dto => dto.SendTime, map => map.MapFrom(src => src.CreationTime)) - .ForMember(dto => dto.MessageType, map => map.MapFrom(src => src.Type)) - .ForMember(dto => dto.Source, map => map.MapFrom(src => src.Source)) - .ForMember(dto => dto.IsAnonymous, map => map.MapFrom(src => src.GetProperty(nameof(ChatMessage.IsAnonymous), false))) - .MapExtraProperties(MappingPropertyDefinitionChecks.None); - } + protected IMappingExpression CreateMessageMap() + where TSource : Message + where TDestination : ChatMessage + { + return CreateMap() + .ForMember(dto => dto.Content, map => map.MapFrom(src => src.Content)) + .ForMember(dto => dto.MessageId, map => map.MapFrom(src => src.MessageId.ToString())) + .ForMember(dto => dto.FormUserId, map => map.MapFrom(src => src.CreatorId)) + .ForMember(dto => dto.FormUserName, map => map.MapFrom(src => src.SendUserName)) + .ForMember(dto => dto.SendTime, map => map.MapFrom(src => src.CreationTime)) + .ForMember(dto => dto.MessageType, map => map.MapFrom(src => src.Type)) + .ForMember(dto => dto.Source, map => map.MapFrom(src => src.Source)) + .ForMember(dto => dto.IsAnonymous, map => map.MapFrom(src => src.GetProperty(nameof(ChatMessage.IsAnonymous), false))) + .MapExtraProperties(MappingPropertyDefinitionChecks.None); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/AbpMessageServiceNotificationDefinitionProvider.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/AbpMessageServiceNotificationDefinitionProvider.cs index 74d26f501..62b901673 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/AbpMessageServiceNotificationDefinitionProvider.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/AbpMessageServiceNotificationDefinitionProvider.cs @@ -2,65 +2,64 @@ using LINGYUN.Abp.Notifications; using Volo.Abp.Localization; -namespace LINGYUN.Abp.MessageService.Notifications +namespace LINGYUN.Abp.MessageService.Notifications; + +public class AbpMessageServiceNotificationDefinitionProvider : NotificationDefinitionProvider { - public class AbpMessageServiceNotificationDefinitionProvider : NotificationDefinitionProvider + public override void Define(INotificationDefinitionContext context) { - public override void Define(INotificationDefinitionContext context) - { - var imGroup = context.AddGroup( - MessageServiceNotificationNames.IM.GroupName, - L("Notifications:IM")); - imGroup.AddNotification( - MessageServiceNotificationNames.IM.FriendValidation, - L("Notifications:FriendValidation"), - L("Notifications:FriendValidation"), - notificationType: NotificationType.Application, - lifetime: NotificationLifetime.Persistent, - allowSubscriptionToClients: true) - .WithProviders( - NotificationProviderNames.SignalR); - imGroup.AddNotification( - MessageServiceNotificationNames.IM.NewFriend, - L("Notifications:NewFriend"), - L("Notifications:NewFriend"), - notificationType: NotificationType.Application, - lifetime: NotificationLifetime.Persistent, - allowSubscriptionToClients: true) - .WithProviders( - NotificationProviderNames.SignalR); - imGroup.AddNotification( - MessageServiceNotificationNames.IM.JoinGroup, - L("Notifications:JoinGroup"), - L("Notifications:JoinGroup"), - notificationType: NotificationType.Application, - lifetime: NotificationLifetime.Persistent, - allowSubscriptionToClients: true) - .WithProviders( - NotificationProviderNames.SignalR); - imGroup.AddNotification( - MessageServiceNotificationNames.IM.ExitGroup, - L("Notifications:ExitGroup"), - L("Notifications:ExitGroup"), - notificationType: NotificationType.Application, - lifetime: NotificationLifetime.Persistent, - allowSubscriptionToClients: true) - .WithProviders( - NotificationProviderNames.SignalR); - imGroup.AddNotification( - MessageServiceNotificationNames.IM.DissolveGroup, - L("Notifications:DissolveGroup"), - L("Notifications:DissolveGroup"), - notificationType: NotificationType.Application, - lifetime: NotificationLifetime.Persistent, - allowSubscriptionToClients: true) - .WithProviders( - NotificationProviderNames.SignalR); - } + var imGroup = context.AddGroup( + MessageServiceNotificationNames.IM.GroupName, + L("Notifications:IM")); + imGroup.AddNotification( + MessageServiceNotificationNames.IM.FriendValidation, + L("Notifications:FriendValidation"), + L("Notifications:FriendValidation"), + notificationType: NotificationType.Application, + lifetime: NotificationLifetime.Persistent, + allowSubscriptionToClients: true) + .WithProviders( + NotificationProviderNames.SignalR); + imGroup.AddNotification( + MessageServiceNotificationNames.IM.NewFriend, + L("Notifications:NewFriend"), + L("Notifications:NewFriend"), + notificationType: NotificationType.Application, + lifetime: NotificationLifetime.Persistent, + allowSubscriptionToClients: true) + .WithProviders( + NotificationProviderNames.SignalR); + imGroup.AddNotification( + MessageServiceNotificationNames.IM.JoinGroup, + L("Notifications:JoinGroup"), + L("Notifications:JoinGroup"), + notificationType: NotificationType.Application, + lifetime: NotificationLifetime.Persistent, + allowSubscriptionToClients: true) + .WithProviders( + NotificationProviderNames.SignalR); + imGroup.AddNotification( + MessageServiceNotificationNames.IM.ExitGroup, + L("Notifications:ExitGroup"), + L("Notifications:ExitGroup"), + notificationType: NotificationType.Application, + lifetime: NotificationLifetime.Persistent, + allowSubscriptionToClients: true) + .WithProviders( + NotificationProviderNames.SignalR); + imGroup.AddNotification( + MessageServiceNotificationNames.IM.DissolveGroup, + L("Notifications:DissolveGroup"), + L("Notifications:DissolveGroup"), + notificationType: NotificationType.Application, + lifetime: NotificationLifetime.Persistent, + allowSubscriptionToClients: true) + .WithProviders( + NotificationProviderNames.SignalR); + } - protected LocalizableString L(string name) - { - return LocalizableString.Create(name); - } + protected LocalizableString L(string name) + { + return LocalizableString.Create(name); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/MessageServiceNotificationNames.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/MessageServiceNotificationNames.cs index 7457b5021..dc4f52e3d 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/MessageServiceNotificationNames.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/MessageServiceNotificationNames.cs @@ -1,33 +1,32 @@ -namespace LINGYUN.Abp.MessageService.Notifications -{ - public static class MessageServiceNotificationNames - { - public const string GroupName = "LINGYUN.Abp.Messages"; +namespace LINGYUN.Abp.MessageService.Notifications; - public class IM - { - public const string GroupName = MessageServiceNotificationNames.GroupName + ".IM"; - /// - /// 好友验证通知 - /// - public const string FriendValidation = GroupName + ".FriendValidation"; - /// - /// 新好友通知 - /// - public const string NewFriend = GroupName + ".NewFriend"; - /// - /// 加入群组通知 - /// - public const string JoinGroup = GroupName + ".JoinGroup"; - /// - /// 退出群组通知 - /// - public const string ExitGroup = GroupName + ".ExitGroup"; - /// - /// 群组解散通知 - /// - public const string DissolveGroup = GroupName + ".DissolveGroup"; - } +public static class MessageServiceNotificationNames +{ + public const string GroupName = "LINGYUN.Abp.Messages"; + public class IM + { + public const string GroupName = MessageServiceNotificationNames.GroupName + ".IM"; + /// + /// 好友验证通知 + /// + public const string FriendValidation = GroupName + ".FriendValidation"; + /// + /// 新好友通知 + /// + public const string NewFriend = GroupName + ".NewFriend"; + /// + /// 加入群组通知 + /// + public const string JoinGroup = GroupName + ".JoinGroup"; + /// + /// 退出群组通知 + /// + public const string ExitGroup = GroupName + ".ExitGroup"; + /// + /// 群组解散通知 + /// + public const string DissolveGroup = GroupName + ".DissolveGroup"; } + } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/NullMessageDataSeeder.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/NullMessageDataSeeder.cs index e86d0a35f..9ca6fc061 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/NullMessageDataSeeder.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/NullMessageDataSeeder.cs @@ -2,14 +2,13 @@ using System.Threading.Tasks; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.MessageService +namespace LINGYUN.Abp.MessageService; + +[Dependency(TryRegister = true)] +public class NullMessageDataSeeder : IMessageDataSeeder, ISingletonDependency { - [Dependency(TryRegister = true)] - public class NullMessageDataSeeder : IMessageDataSeeder, ISingletonDependency + public Task SeedAsync(Guid? tenantId = null) { - public Task SeedAsync(Guid? tenantId = null) - { - return Task.CompletedTask; - } + return Task.CompletedTask; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Utils/DateTimeHelper.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Utils/DateTimeHelper.cs index 9aa6f8e34..ae63364aa 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Utils/DateTimeHelper.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Utils/DateTimeHelper.cs @@ -1,17 +1,16 @@ using System; -namespace LINGYUN.Abp.MessageService.Utils +namespace LINGYUN.Abp.MessageService.Utils; + +public static class DateTimeHelper { - public static class DateTimeHelper + public static int CalcAgrByBirthdate(DateTime birthdate, DateTime nowTime) { - public static int CalcAgrByBirthdate(DateTime birthdate, DateTime nowTime) + int age = nowTime.Year - birthdate.Year; + if (nowTime.Month < birthdate.Month || (nowTime.Month == birthdate.Month && nowTime.Day < birthdate.Day)) { - int age = nowTime.Year - birthdate.Year; - if (nowTime.Month < birthdate.Month || (nowTime.Month == birthdate.Month && nowTime.Day < birthdate.Day)) - { - age--; - } - return age < 0 ? 0 : age; + age--; } + return age < 0 ? 0 : age; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN.Abp.MessageService.EntityFrameworkCore.csproj b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN.Abp.MessageService.EntityFrameworkCore.csproj index ffda8651e..09e50d9b5 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN.Abp.MessageService.EntityFrameworkCore.csproj +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN.Abp.MessageService.EntityFrameworkCore.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.MessageService.EntityFrameworkCore + LINGYUN.Abp.MessageService.EntityFrameworkCore + false + false + false diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreMessageRepository.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreMessageRepository.cs index 99b9833d9..0433a0a47 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreMessageRepository.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreMessageRepository.cs @@ -19,501 +19,500 @@ using Volo.Abp.EntityFrameworkCore; using Volo.Abp.Json.SystemTextJson.JsonConverters; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public class EfCoreMessageRepository : EfCoreRepository, + IMessageRepository, ITransientDependency { - public class EfCoreMessageRepository : EfCoreRepository, - IMessageRepository, ITransientDependency + public EfCoreMessageRepository( + IDbContextProvider dbContextProvider) + : base(dbContextProvider) { - public EfCoreMessageRepository( - IDbContextProvider dbContextProvider) - : base(dbContextProvider) - { - } + } - public async virtual Task GetGroupMessageAsync( - long id, - CancellationToken cancellationToken = default) - { - return await (await GetDbContextAsync()).Set() - .Where(x => x.MessageId.Equals(id)) - .AsNoTracking() - .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task GetGroupMessageAsync( + long id, + CancellationToken cancellationToken = default) + { + return await (await GetDbContextAsync()).Set() + .Where(x => x.MessageId.Equals(id)) + .AsNoTracking() + .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task> GetGroupMessagesAsync( - long groupId, - MessageType? type = null, - string filter = "", - string sorting = nameof(UserMessage.MessageId), - int skipCount = 0, - int maxResultCount = 10, - CancellationToken cancellationToken = default) + public async virtual Task> GetGroupMessagesAsync( + long groupId, + MessageType? type = null, + string filter = "", + string sorting = nameof(UserMessage.MessageId), + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default) + { + if (sorting.IsNullOrWhiteSpace()) { - if (sorting.IsNullOrWhiteSpace()) - { - sorting = nameof(GroupMessage.MessageId); - } - var groupMessages = await (await GetDbContextAsync()).Set() - .Distinct() - .Where(x => x.GroupId.Equals(groupId)) - .Where(x => x.State == MessageState.Send || x.State == MessageState.Read) - .WhereIf(type.HasValue, x => x.Type.Equals(type)) - .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Content.Contains(filter) || x.SendUserName.Contains(filter)) - .OrderBy(sorting) - .PageBy(skipCount, maxResultCount) - .AsNoTracking() - .ToListAsync(GetCancellationToken(cancellationToken)); - - return groupMessages; + sorting = nameof(GroupMessage.MessageId); } + var groupMessages = await (await GetDbContextAsync()).Set() + .Distinct() + .Where(x => x.GroupId.Equals(groupId)) + .Where(x => x.State == MessageState.Send || x.State == MessageState.Read) + .WhereIf(type.HasValue, x => x.Type.Equals(type)) + .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Content.Contains(filter) || x.SendUserName.Contains(filter)) + .OrderBy(sorting) + .PageBy(skipCount, maxResultCount) + .AsNoTracking() + .ToListAsync(GetCancellationToken(cancellationToken)); + + return groupMessages; + } - public async virtual Task GetGroupMessagesCountAsync( - long groupId, - MessageType? type = null, - string filter = "", - CancellationToken cancellationToken = default) - { - var groupMessagesCount = await (await GetDbContextAsync()).Set() - .Distinct() - .Where(x => x.GroupId.Equals(groupId)) - .Where(x => x.State == MessageState.Send || x.State == MessageState.Read) - .WhereIf(type.HasValue, x => x.Type.Equals(type)) - .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Content.Contains(filter) || x.SendUserName.Contains(filter)) - .LongCountAsync(GetCancellationToken(cancellationToken)); - return groupMessagesCount; - } + public async virtual Task GetGroupMessagesCountAsync( + long groupId, + MessageType? type = null, + string filter = "", + CancellationToken cancellationToken = default) + { + var groupMessagesCount = await (await GetDbContextAsync()).Set() + .Distinct() + .Where(x => x.GroupId.Equals(groupId)) + .Where(x => x.State == MessageState.Send || x.State == MessageState.Read) + .WhereIf(type.HasValue, x => x.Type.Equals(type)) + .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Content.Contains(filter) || x.SendUserName.Contains(filter)) + .LongCountAsync(GetCancellationToken(cancellationToken)); + return groupMessagesCount; + } - public async virtual Task> GetUserGroupMessagesAsync( - Guid sendUserId, - long groupId, - MessageType? type = null, - string filter = "", - string sorting = nameof(UserMessage.MessageId), - int skipCount = 0, - int maxResultCount = 10, - CancellationToken cancellationToken = default) + public async virtual Task> GetUserGroupMessagesAsync( + Guid sendUserId, + long groupId, + MessageType? type = null, + string filter = "", + string sorting = nameof(UserMessage.MessageId), + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default) + { + if (sorting.IsNullOrWhiteSpace()) { - if (sorting.IsNullOrWhiteSpace()) - { - sorting = nameof(GroupMessage.MessageId); - } - var groupMessages = await (await GetDbContextAsync()).Set() - .Distinct() - .Where(x => x.GroupId.Equals(groupId) && x.CreatorId.Equals(sendUserId)) - .WhereIf(type != null, x => x.Type.Equals(type)) - .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Content.Contains(filter) || x.SendUserName.Contains(filter)) - .OrderBy(sorting) - .PageBy(skipCount, maxResultCount) - .AsNoTracking() - .ToListAsync(GetCancellationToken(cancellationToken)); - - return groupMessages; + sorting = nameof(GroupMessage.MessageId); } + var groupMessages = await (await GetDbContextAsync()).Set() + .Distinct() + .Where(x => x.GroupId.Equals(groupId) && x.CreatorId.Equals(sendUserId)) + .WhereIf(type != null, x => x.Type.Equals(type)) + .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Content.Contains(filter) || x.SendUserName.Contains(filter)) + .OrderBy(sorting) + .PageBy(skipCount, maxResultCount) + .AsNoTracking() + .ToListAsync(GetCancellationToken(cancellationToken)); + + return groupMessages; + } - public async virtual Task GetUserGroupMessagesCountAsync( - Guid sendUserId, - long groupId, - MessageType? type = null, - string filter = "", - CancellationToken cancellationToken = default) - { - var groupMessagesCount = await (await GetDbContextAsync()).Set() - .Where(x => x.GroupId.Equals(groupId) && x.CreatorId.Equals(sendUserId)) - .WhereIf(type != null, x => x.Type.Equals(type)) - .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Content.Contains(filter) || x.SendUserName.Contains(filter)) - .LongCountAsync(GetCancellationToken(cancellationToken)); - return groupMessagesCount; - } + public async virtual Task GetUserGroupMessagesCountAsync( + Guid sendUserId, + long groupId, + MessageType? type = null, + string filter = "", + CancellationToken cancellationToken = default) + { + var groupMessagesCount = await (await GetDbContextAsync()).Set() + .Where(x => x.GroupId.Equals(groupId) && x.CreatorId.Equals(sendUserId)) + .WhereIf(type != null, x => x.Type.Equals(type)) + .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Content.Contains(filter) || x.SendUserName.Contains(filter)) + .LongCountAsync(GetCancellationToken(cancellationToken)); + return groupMessagesCount; + } - public async virtual Task GetCountAsync( - long groupId, - MessageType? type = null, - string filter = "", - CancellationToken cancellationToken = default) - { - return await (await GetDbContextAsync()).Set() - .Where(x => x.GroupId.Equals(groupId)) - .WhereIf(type != null, x => x.Type.Equals(type)) - .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Content.Contains(filter) || x.SendUserName.Contains(filter)) - .LongCountAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task GetCountAsync( + long groupId, + MessageType? type = null, + string filter = "", + CancellationToken cancellationToken = default) + { + return await (await GetDbContextAsync()).Set() + .Where(x => x.GroupId.Equals(groupId)) + .WhereIf(type != null, x => x.Type.Equals(type)) + .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Content.Contains(filter) || x.SendUserName.Contains(filter)) + .LongCountAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task GetCountAsync( - Guid sendUserId, - Guid receiveUserId, - MessageType? type = null, - string filter = "", - CancellationToken cancellationToken = default) - { - return await (await GetDbContextAsync()).Set() - .Where(x => (x.CreatorId.Equals(sendUserId) && x.ReceiveUserId.Equals(receiveUserId)) || - x.CreatorId.Equals(receiveUserId) && x.ReceiveUserId.Equals(sendUserId)) - .WhereIf(type != null, x => x.Type.Equals(type)) - .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Content.Contains(filter) || x.SendUserName.Contains(filter)) - .LongCountAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task GetCountAsync( + Guid sendUserId, + Guid receiveUserId, + MessageType? type = null, + string filter = "", + CancellationToken cancellationToken = default) + { + return await (await GetDbContextAsync()).Set() + .Where(x => (x.CreatorId.Equals(sendUserId) && x.ReceiveUserId.Equals(receiveUserId)) || + x.CreatorId.Equals(receiveUserId) && x.ReceiveUserId.Equals(sendUserId)) + .WhereIf(type != null, x => x.Type.Equals(type)) + .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Content.Contains(filter) || x.SendUserName.Contains(filter)) + .LongCountAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task GetUserMessageAsync( - long id, - CancellationToken cancellationToken = default) - { - return await (await GetDbContextAsync()).Set() - .Where(x => x.MessageId.Equals(id)) - .AsNoTracking() - .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task GetUserMessageAsync( + long id, + CancellationToken cancellationToken = default) + { + return await (await GetDbContextAsync()).Set() + .Where(x => x.MessageId.Equals(id)) + .AsNoTracking() + .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task> GetLastMessagesAsync( - Guid userId, - MessageState? state = null, - string sorting = nameof(LastChatMessage.SendTime), - int maxResultCount = 10, - CancellationToken cancellationToken = default) + public async virtual Task> GetLastMessagesAsync( + Guid userId, + MessageState? state = null, + string sorting = nameof(LastChatMessage.SendTime), + int maxResultCount = 10, + CancellationToken cancellationToken = default) + { + if (sorting.IsNullOrWhiteSpace()) { - if (sorting.IsNullOrWhiteSpace()) + sorting = $"{nameof(LastChatMessage.SendTime)} DESC"; + } + var dbContext = await GetDbContextAsync(); + + #region SQL 原型 + + //var sqlBuilder = new StringBuilder(1280); + //sqlBuilder.AppendLine("SELECT"); + //sqlBuilder.AppendLine(" msg.* "); + //sqlBuilder.AppendLine("FROM"); + //sqlBuilder.AppendLine(" ("); + //sqlBuilder.AppendLine(" SELECT"); + //sqlBuilder.AppendLine(" um.Content,"); + //sqlBuilder.AppendLine(" um.CreationTime,"); + //sqlBuilder.AppendLine(" um.CreatorId,"); + //sqlBuilder.AppendLine(" um.SendUserName,"); + //sqlBuilder.AppendLine(" ac.NickName AS Object,"); + //sqlBuilder.AppendLine(" ac.AvatarUrl,"); + //sqlBuilder.AppendLine(" um.Source,"); + //sqlBuilder.AppendLine(" um.MessageId,"); + //sqlBuilder.AppendLine(" um.Type,"); + //sqlBuilder.AppendLine(" um.TenantId,"); + //sqlBuilder.AppendLine(" um.ReceiveUserId,"); + //sqlBuilder.AppendLine(" '' AS GroupId,"); + //sqlBuilder.AppendLine(" um.ExtraProperties"); + //sqlBuilder.AppendLine(" FROM"); + //sqlBuilder.AppendLine(" ("); + //sqlBuilder.AppendLine(" SELECT"); + //sqlBuilder.AppendLine(" um.* "); + //sqlBuilder.AppendLine(" FROM"); + //sqlBuilder.AppendLine(" appusermessages um"); + //sqlBuilder.AppendLine(" INNER JOIN ( SELECT max( um.MessageId ) AS MessageId FROM appusermessages um"); + //sqlBuilder.AppendLine(" WHERE"); + //sqlBuilder.AppendLine(" um.ReceiveUserId = @ReceiveUserId"); + //if (state.HasValue) + //{ + // sqlBuilder.AppendLine(" AND um.State = @State"); + //} + //if (CurrentTenant.IsAvailable) + //{ + // sqlBuilder.AppendLine(" AND um.TenantId = @TenantId"); + //} + //sqlBuilder.AppendLine(" GROUP BY um.ReceiveUserId ) gum ON um.MessageId = gum.MessageId"); + //sqlBuilder.AppendLine(" ) um"); + //sqlBuilder.AppendLine(" LEFT JOIN appuserchatcards ac ON ac.UserId = um.CreatorId "); + //sqlBuilder.AppendLine(" UNION ALL"); + //sqlBuilder.AppendLine(" SELECT"); + //sqlBuilder.AppendLine(" gm.Content,"); + //sqlBuilder.AppendLine(" gm.CreationTime,"); + //sqlBuilder.AppendLine(" gm.CreatorId,"); + //sqlBuilder.AppendLine(" gm.SendUserName,"); + //sqlBuilder.AppendLine(" ag.Name AS Object,"); + //sqlBuilder.AppendLine(" ag.AvatarUrl,"); + //sqlBuilder.AppendLine(" gm.Source,"); + //sqlBuilder.AppendLine(" gm.MessageId,"); + //sqlBuilder.AppendLine(" gm.Type,"); + //sqlBuilder.AppendLine(" gm.TenantId,"); + //sqlBuilder.AppendLine(" '' AS ReceiveUserId,"); + //sqlBuilder.AppendLine(" gm.GroupId,"); + //sqlBuilder.AppendLine(" gm.ExtraProperties"); + //sqlBuilder.AppendLine(" FROM"); + //sqlBuilder.AppendLine(" appgroupmessages gm"); + //sqlBuilder.AppendLine(" INNER JOIN ("); + //sqlBuilder.AppendLine(" SELECT"); + //sqlBuilder.AppendLine(" max( gm.MessageId ) AS MessageId "); + //sqlBuilder.AppendLine(" FROM"); + //sqlBuilder.AppendLine(" appuserchatcards ac"); + //sqlBuilder.AppendLine(" LEFT JOIN appuserchatgroups acg ON acg.UserId = ac.UserId"); + //sqlBuilder.AppendLine(" LEFT JOIN appgroupmessages gm ON gm.GroupId = acg.GroupId "); + //sqlBuilder.AppendLine(" WHERE"); + //sqlBuilder.AppendLine(" ac.UserId = @ReceiveUserId "); + //if (state.HasValue) + //{ + // sqlBuilder.AppendLine(" AND gm.State = @State"); + //} + //if (CurrentTenant.IsAvailable) + //{ + // sqlBuilder.AppendLine(" AND gm.TenantId = @TenantId"); + //} + //sqlBuilder.AppendLine(" GROUP BY"); + //sqlBuilder.AppendLine(" gm.GroupId"); + //sqlBuilder.AppendLine(" ) ggm ON ggm.MessageId = gm.MessageId "); + //sqlBuilder.AppendLine(" INNER JOIN appchatgroups ag on ag.GroupId = gm.GroupId"); + //sqlBuilder.AppendLine(" ) AS msg"); + //sqlBuilder.AppendLine("ORDER BY "); + //sqlBuilder.AppendLine(" @Sorting"); + //sqlBuilder.AppendLine(" LIMIT @MaxResultCount"); + + //using var dbContection = dbContext.Database.GetDbConnection(); + //await dbContection.OpenAsync(); + //using var command = dbContection.CreateCommand(); + //command.Transaction = dbContext.Database.CurrentTransaction?.GetDbTransaction(); + //command.CommandText = sqlBuilder.ToString(); + + //var receivedUser = command.CreateParameter(); + //receivedUser.DbType = System.Data.DbType.Guid; + //receivedUser.ParameterName = "@ReceiveUserId"; + //receivedUser.Value = userId; + //command.Parameters.Add(receivedUser); + + //var sorttingParam = command.CreateParameter(); + //sorttingParam.DbType = System.Data.DbType.String; + //sorttingParam.ParameterName = "@Sorting"; + //sorttingParam.Value = sorting; + //command.Parameters.Add(sorttingParam); + + //var limitParam = command.CreateParameter(); + //limitParam.DbType = System.Data.DbType.Int32; + //limitParam.ParameterName = "@MaxResultCount"; + //limitParam.Value = maxResultCount; + //command.Parameters.Add(limitParam); + + //if (state.HasValue) + //{ + // var stateParam = command.CreateParameter(); + // stateParam.DbType = System.Data.DbType.Int32; + // stateParam.ParameterName = "@State"; + // stateParam.Value = (int)state.Value; + // command.Parameters.Add(stateParam); + //} + //if (CurrentTenant.IsAvailable) + //{ + // var tenantParam = command.CreateParameter(); + // tenantParam.DbType = System.Data.DbType.Guid; + // tenantParam.ParameterName = "@TenantId"; + // tenantParam.Value = CurrentTenant.Id.Value; + // command.Parameters.Add(tenantParam); + //} + //var messages = new List(); + //using var reader = await command.ExecuteReaderAsync(); + + //T GetValue(DbDataReader reader, int index) + //{ + // var value = reader.GetValue(index); + // if (value == null || value == DBNull.Value) + // { + // return default; + // } + + // var valueType = typeof(T); + // var converter = TypeDescriptor.GetConverter(valueType); + // if (converter.CanConvertFrom(value.GetType())) + // { + // return (T)converter.ConvertFrom(value); + // } + // return (T)Convert.ChangeType(value, typeof(T)); + //}; + + //ExtraPropertyDictionary GetExtraProperties(DbDataReader reader, int index) + //{ + // var value = reader.GetValue(index); + // if (value == null || value == DBNull.Value) + // { + // return new ExtraPropertyDictionary(); + // } + // var extraPropertiesAsJson = value.ToString(); + // if (extraPropertiesAsJson.IsNullOrEmpty() || extraPropertiesAsJson == "{}") + // { + // return new ExtraPropertyDictionary(); + // } + + // var deserializeOptions = new JsonSerializerOptions(); + // deserializeOptions.Converters.Add(new ObjectToInferredTypesConverter()); + + // var dictionary = JsonSerializer.Deserialize(extraPropertiesAsJson, deserializeOptions) ?? + // new ExtraPropertyDictionary(); + + // return dictionary; + //} + + //while (reader.Read()) + //{ + // messages.Add(new LastChatMessage + // { + // Content = GetValue(reader, 0), + // SendTime = GetValue(reader, 1), + // FormUserId = GetValue(reader, 2), + // FormUserName = GetValue(reader, 3), + // Object = GetValue(reader, 4), + // AvatarUrl = GetValue(reader, 5), + // Source = (MessageSourceType)GetValue(reader, 6), + // MessageId = GetValue(reader, 7), + // MessageType = (MessageType)GetValue(reader, 8), + // TenantId = GetValue(reader, 9), + // ToUserId = GetValue(reader, 10), + // GroupId = GetValue(reader, 11), + // ExtraProperties = GetExtraProperties(reader, 12), + // }); + //} + + //return messages; + #endregion + + #region 待 EF 团队解决此问题 + + //// 聚合用户消息 + var aggreUserMsgIdQuery = dbContext.Set() + .Where(msg => msg.ReceiveUserId == userId) + .WhereIf(state.HasValue, x => x.State == state) + .GroupBy(msg => msg.ReceiveUserId) + .Select(msg => new { - sorting = $"{nameof(LastChatMessage.SendTime)} DESC"; - } - var dbContext = await GetDbContextAsync(); - - #region SQL 原型 - - //var sqlBuilder = new StringBuilder(1280); - //sqlBuilder.AppendLine("SELECT"); - //sqlBuilder.AppendLine(" msg.* "); - //sqlBuilder.AppendLine("FROM"); - //sqlBuilder.AppendLine(" ("); - //sqlBuilder.AppendLine(" SELECT"); - //sqlBuilder.AppendLine(" um.Content,"); - //sqlBuilder.AppendLine(" um.CreationTime,"); - //sqlBuilder.AppendLine(" um.CreatorId,"); - //sqlBuilder.AppendLine(" um.SendUserName,"); - //sqlBuilder.AppendLine(" ac.NickName AS Object,"); - //sqlBuilder.AppendLine(" ac.AvatarUrl,"); - //sqlBuilder.AppendLine(" um.Source,"); - //sqlBuilder.AppendLine(" um.MessageId,"); - //sqlBuilder.AppendLine(" um.Type,"); - //sqlBuilder.AppendLine(" um.TenantId,"); - //sqlBuilder.AppendLine(" um.ReceiveUserId,"); - //sqlBuilder.AppendLine(" '' AS GroupId,"); - //sqlBuilder.AppendLine(" um.ExtraProperties"); - //sqlBuilder.AppendLine(" FROM"); - //sqlBuilder.AppendLine(" ("); - //sqlBuilder.AppendLine(" SELECT"); - //sqlBuilder.AppendLine(" um.* "); - //sqlBuilder.AppendLine(" FROM"); - //sqlBuilder.AppendLine(" appusermessages um"); - //sqlBuilder.AppendLine(" INNER JOIN ( SELECT max( um.MessageId ) AS MessageId FROM appusermessages um"); - //sqlBuilder.AppendLine(" WHERE"); - //sqlBuilder.AppendLine(" um.ReceiveUserId = @ReceiveUserId"); - //if (state.HasValue) - //{ - // sqlBuilder.AppendLine(" AND um.State = @State"); - //} - //if (CurrentTenant.IsAvailable) - //{ - // sqlBuilder.AppendLine(" AND um.TenantId = @TenantId"); - //} - //sqlBuilder.AppendLine(" GROUP BY um.ReceiveUserId ) gum ON um.MessageId = gum.MessageId"); - //sqlBuilder.AppendLine(" ) um"); - //sqlBuilder.AppendLine(" LEFT JOIN appuserchatcards ac ON ac.UserId = um.CreatorId "); - //sqlBuilder.AppendLine(" UNION ALL"); - //sqlBuilder.AppendLine(" SELECT"); - //sqlBuilder.AppendLine(" gm.Content,"); - //sqlBuilder.AppendLine(" gm.CreationTime,"); - //sqlBuilder.AppendLine(" gm.CreatorId,"); - //sqlBuilder.AppendLine(" gm.SendUserName,"); - //sqlBuilder.AppendLine(" ag.Name AS Object,"); - //sqlBuilder.AppendLine(" ag.AvatarUrl,"); - //sqlBuilder.AppendLine(" gm.Source,"); - //sqlBuilder.AppendLine(" gm.MessageId,"); - //sqlBuilder.AppendLine(" gm.Type,"); - //sqlBuilder.AppendLine(" gm.TenantId,"); - //sqlBuilder.AppendLine(" '' AS ReceiveUserId,"); - //sqlBuilder.AppendLine(" gm.GroupId,"); - //sqlBuilder.AppendLine(" gm.ExtraProperties"); - //sqlBuilder.AppendLine(" FROM"); - //sqlBuilder.AppendLine(" appgroupmessages gm"); - //sqlBuilder.AppendLine(" INNER JOIN ("); - //sqlBuilder.AppendLine(" SELECT"); - //sqlBuilder.AppendLine(" max( gm.MessageId ) AS MessageId "); - //sqlBuilder.AppendLine(" FROM"); - //sqlBuilder.AppendLine(" appuserchatcards ac"); - //sqlBuilder.AppendLine(" LEFT JOIN appuserchatgroups acg ON acg.UserId = ac.UserId"); - //sqlBuilder.AppendLine(" LEFT JOIN appgroupmessages gm ON gm.GroupId = acg.GroupId "); - //sqlBuilder.AppendLine(" WHERE"); - //sqlBuilder.AppendLine(" ac.UserId = @ReceiveUserId "); - //if (state.HasValue) - //{ - // sqlBuilder.AppendLine(" AND gm.State = @State"); - //} - //if (CurrentTenant.IsAvailable) - //{ - // sqlBuilder.AppendLine(" AND gm.TenantId = @TenantId"); - //} - //sqlBuilder.AppendLine(" GROUP BY"); - //sqlBuilder.AppendLine(" gm.GroupId"); - //sqlBuilder.AppendLine(" ) ggm ON ggm.MessageId = gm.MessageId "); - //sqlBuilder.AppendLine(" INNER JOIN appchatgroups ag on ag.GroupId = gm.GroupId"); - //sqlBuilder.AppendLine(" ) AS msg"); - //sqlBuilder.AppendLine("ORDER BY "); - //sqlBuilder.AppendLine(" @Sorting"); - //sqlBuilder.AppendLine(" LIMIT @MaxResultCount"); - - //using var dbContection = dbContext.Database.GetDbConnection(); - //await dbContection.OpenAsync(); - //using var command = dbContection.CreateCommand(); - //command.Transaction = dbContext.Database.CurrentTransaction?.GetDbTransaction(); - //command.CommandText = sqlBuilder.ToString(); - - //var receivedUser = command.CreateParameter(); - //receivedUser.DbType = System.Data.DbType.Guid; - //receivedUser.ParameterName = "@ReceiveUserId"; - //receivedUser.Value = userId; - //command.Parameters.Add(receivedUser); - - //var sorttingParam = command.CreateParameter(); - //sorttingParam.DbType = System.Data.DbType.String; - //sorttingParam.ParameterName = "@Sorting"; - //sorttingParam.Value = sorting; - //command.Parameters.Add(sorttingParam); - - //var limitParam = command.CreateParameter(); - //limitParam.DbType = System.Data.DbType.Int32; - //limitParam.ParameterName = "@MaxResultCount"; - //limitParam.Value = maxResultCount; - //command.Parameters.Add(limitParam); - - //if (state.HasValue) - //{ - // var stateParam = command.CreateParameter(); - // stateParam.DbType = System.Data.DbType.Int32; - // stateParam.ParameterName = "@State"; - // stateParam.Value = (int)state.Value; - // command.Parameters.Add(stateParam); - //} - //if (CurrentTenant.IsAvailable) - //{ - // var tenantParam = command.CreateParameter(); - // tenantParam.DbType = System.Data.DbType.Guid; - // tenantParam.ParameterName = "@TenantId"; - // tenantParam.Value = CurrentTenant.Id.Value; - // command.Parameters.Add(tenantParam); - //} - //var messages = new List(); - //using var reader = await command.ExecuteReaderAsync(); - - //T GetValue(DbDataReader reader, int index) - //{ - // var value = reader.GetValue(index); - // if (value == null || value == DBNull.Value) - // { - // return default; - // } - - // var valueType = typeof(T); - // var converter = TypeDescriptor.GetConverter(valueType); - // if (converter.CanConvertFrom(value.GetType())) - // { - // return (T)converter.ConvertFrom(value); - // } - // return (T)Convert.ChangeType(value, typeof(T)); - //}; - - //ExtraPropertyDictionary GetExtraProperties(DbDataReader reader, int index) - //{ - // var value = reader.GetValue(index); - // if (value == null || value == DBNull.Value) - // { - // return new ExtraPropertyDictionary(); - // } - // var extraPropertiesAsJson = value.ToString(); - // if (extraPropertiesAsJson.IsNullOrEmpty() || extraPropertiesAsJson == "{}") - // { - // return new ExtraPropertyDictionary(); - // } - - // var deserializeOptions = new JsonSerializerOptions(); - // deserializeOptions.Converters.Add(new ObjectToInferredTypesConverter()); - - // var dictionary = JsonSerializer.Deserialize(extraPropertiesAsJson, deserializeOptions) ?? - // new ExtraPropertyDictionary(); - - // return dictionary; - //} - - //while (reader.Read()) - //{ - // messages.Add(new LastChatMessage - // { - // Content = GetValue(reader, 0), - // SendTime = GetValue(reader, 1), - // FormUserId = GetValue(reader, 2), - // FormUserName = GetValue(reader, 3), - // Object = GetValue(reader, 4), - // AvatarUrl = GetValue(reader, 5), - // Source = (MessageSourceType)GetValue(reader, 6), - // MessageId = GetValue(reader, 7), - // MessageType = (MessageType)GetValue(reader, 8), - // TenantId = GetValue(reader, 9), - // ToUserId = GetValue(reader, 10), - // GroupId = GetValue(reader, 11), - // ExtraProperties = GetExtraProperties(reader, 12), - // }); - //} - - //return messages; - #endregion - - #region 待 EF 团队解决此问题 - - //// 聚合用户消息 - var aggreUserMsgIdQuery = dbContext.Set() - .Where(msg => msg.ReceiveUserId == userId) - .WhereIf(state.HasValue, x => x.State == state) - .GroupBy(msg => msg.ReceiveUserId) - .Select(msg => new - { - MessageId = msg.Max(x => x.MessageId) - }); - var joinUserMsg = from um in dbContext.Set() - join aum in aggreUserMsgIdQuery - on um.MessageId equals aum.MessageId - join ucc in dbContext.Set() - on um.CreatorId equals ucc.UserId - select new LastChatMessage - { - Content = Convert.ToString(um.Content), - SendTime = um.CreationTime, - FormUserId = um.CreatorId.Value, - FormUserName = Convert.ToString(um.SendUserName), - Object = Convert.ToString(ucc.NickName), - AvatarUrl = Convert.ToString(ucc.AvatarUrl), - Source = um.Source, - MessageId = Convert.ToString(um.MessageId), - MessageType = um.Type, - TenantId = um.TenantId, - ToUserId = Convert.ToString(um.ReceiveUserId), - GroupId = Convert.ToString(""), - }; - // 聚合群组消息 - var aggreGroupMsgIdQuery = from ucc in dbContext.Set() - join ucg in dbContext.Set() - on ucc.UserId equals ucg.UserId - join gm in dbContext.Set() - on ucg.GroupId equals gm.GroupId - where ucc.UserId.Equals(userId) - group gm by gm.GroupId into ggm - select new - { - MessageId = ggm.Max(gm => gm.MessageId), - }; - - var joinGroupMsg = from gm in dbContext.Set() - join agm in aggreGroupMsgIdQuery - on gm.MessageId equals agm.MessageId - join cg in dbContext.Set() - on gm.GroupId equals cg.GroupId - select new LastChatMessage - { - Content = Convert.ToString(gm.Content), - SendTime = gm.CreationTime, - FormUserId = gm.CreatorId.Value, - FormUserName = Convert.ToString(gm.SendUserName), - Object = Convert.ToString(cg.Name), - AvatarUrl = Convert.ToString(cg.AvatarUrl), - Source = gm.Source, - MessageId = Convert.ToString(gm.MessageId), - MessageType = gm.Type, - TenantId = gm.TenantId, - ToUserId = Convert.ToString(""), - GroupId = Convert.ToString(gm.GroupId) - }; - - return await joinUserMsg - .Concat(joinGroupMsg) - .OrderBy(sorting) - .Take(maxResultCount) - .ToListAsync(GetCancellationToken(cancellationToken)); - - #endregion + MessageId = msg.Max(x => x.MessageId) + }); + var joinUserMsg = from um in dbContext.Set() + join aum in aggreUserMsgIdQuery + on um.MessageId equals aum.MessageId + join ucc in dbContext.Set() + on um.CreatorId equals ucc.UserId + select new LastChatMessage + { + Content = Convert.ToString(um.Content), + SendTime = um.CreationTime, + FormUserId = um.CreatorId.Value, + FormUserName = Convert.ToString(um.SendUserName), + Object = Convert.ToString(ucc.NickName), + AvatarUrl = Convert.ToString(ucc.AvatarUrl), + Source = um.Source, + MessageId = Convert.ToString(um.MessageId), + MessageType = um.Type, + TenantId = um.TenantId, + ToUserId = Convert.ToString(um.ReceiveUserId), + GroupId = Convert.ToString(""), + }; + // 聚合群组消息 + var aggreGroupMsgIdQuery = from ucc in dbContext.Set() + join ucg in dbContext.Set() + on ucc.UserId equals ucg.UserId + join gm in dbContext.Set() + on ucg.GroupId equals gm.GroupId + where ucc.UserId.Equals(userId) + group gm by gm.GroupId into ggm + select new + { + MessageId = ggm.Max(gm => gm.MessageId), + }; + + var joinGroupMsg = from gm in dbContext.Set() + join agm in aggreGroupMsgIdQuery + on gm.MessageId equals agm.MessageId + join cg in dbContext.Set() + on gm.GroupId equals cg.GroupId + select new LastChatMessage + { + Content = Convert.ToString(gm.Content), + SendTime = gm.CreationTime, + FormUserId = gm.CreatorId.Value, + FormUserName = Convert.ToString(gm.SendUserName), + Object = Convert.ToString(cg.Name), + AvatarUrl = Convert.ToString(cg.AvatarUrl), + Source = gm.Source, + MessageId = Convert.ToString(gm.MessageId), + MessageType = gm.Type, + TenantId = gm.TenantId, + ToUserId = Convert.ToString(""), + GroupId = Convert.ToString(gm.GroupId) + }; + + return await joinUserMsg + .Concat(joinGroupMsg) + .OrderBy(sorting) + .Take(maxResultCount) + .ToListAsync(GetCancellationToken(cancellationToken)); + + #endregion - } + } - public async virtual Task> GetUserMessagesAsync( - Guid sendUserId, - Guid receiveUserId, - MessageType? type = null, - string filter = "", - string sorting = nameof(UserMessage.MessageId), - int skipCount = 0, - int maxResultCount = 10, - CancellationToken cancellationToken = default) + public async virtual Task> GetUserMessagesAsync( + Guid sendUserId, + Guid receiveUserId, + MessageType? type = null, + string filter = "", + string sorting = nameof(UserMessage.MessageId), + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default) + { + if (sorting.IsNullOrWhiteSpace()) { - if (sorting.IsNullOrWhiteSpace()) - { - sorting = nameof(UserMessage.MessageId); - } - var userMessages = await (await GetDbContextAsync()).Set() - .Where(x => (x.CreatorId.Equals(sendUserId) && x.ReceiveUserId.Equals(receiveUserId)) || - x.CreatorId.Equals(receiveUserId) && x.ReceiveUserId.Equals(sendUserId)) - .WhereIf(type.HasValue, x => x.Type.Equals(type)) - .Where(x => x.State == MessageState.Send || x.State == MessageState.Read) - .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Content.Contains(filter) || x.SendUserName.Contains(filter)) - .OrderBy(sorting) - .PageBy(skipCount, maxResultCount) - .AsNoTracking() - .ToListAsync(GetCancellationToken(cancellationToken)); - - return userMessages; + sorting = nameof(UserMessage.MessageId); } + var userMessages = await (await GetDbContextAsync()).Set() + .Where(x => (x.CreatorId.Equals(sendUserId) && x.ReceiveUserId.Equals(receiveUserId)) || + x.CreatorId.Equals(receiveUserId) && x.ReceiveUserId.Equals(sendUserId)) + .WhereIf(type.HasValue, x => x.Type.Equals(type)) + .Where(x => x.State == MessageState.Send || x.State == MessageState.Read) + .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Content.Contains(filter) || x.SendUserName.Contains(filter)) + .OrderBy(sorting) + .PageBy(skipCount, maxResultCount) + .AsNoTracking() + .ToListAsync(GetCancellationToken(cancellationToken)); + + return userMessages; + } - public async virtual Task GetUserMessagesCountAsync( - Guid sendUserId, - Guid receiveUserId, - MessageType? type = null, - string filter = "", - CancellationToken cancellationToken = default) - { - var userMessagesCount = await (await GetDbContextAsync()).Set() - .Where(x => (x.CreatorId.Equals(sendUserId) && x.ReceiveUserId.Equals(receiveUserId)) || - x.CreatorId.Equals(receiveUserId) && x.ReceiveUserId.Equals(sendUserId)) - .WhereIf(type.HasValue, x => x.Type.Equals(type)) - .Where(x => x.State == MessageState.Send || x.State == MessageState.Read) - .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Content.Contains(filter) || x.SendUserName.Contains(filter)) - .LongCountAsync(GetCancellationToken(cancellationToken)); - - return userMessagesCount; - } + public async virtual Task GetUserMessagesCountAsync( + Guid sendUserId, + Guid receiveUserId, + MessageType? type = null, + string filter = "", + CancellationToken cancellationToken = default) + { + var userMessagesCount = await (await GetDbContextAsync()).Set() + .Where(x => (x.CreatorId.Equals(sendUserId) && x.ReceiveUserId.Equals(receiveUserId)) || + x.CreatorId.Equals(receiveUserId) && x.ReceiveUserId.Equals(sendUserId)) + .WhereIf(type.HasValue, x => x.Type.Equals(type)) + .Where(x => x.State == MessageState.Send || x.State == MessageState.Read) + .WhereIf(!filter.IsNullOrWhiteSpace(), x => x.Content.Contains(filter) || x.SendUserName.Contains(filter)) + .LongCountAsync(GetCancellationToken(cancellationToken)); + + return userMessagesCount; + } - public async virtual Task InsertGroupMessageAsync( - GroupMessage groupMessage, - CancellationToken cancellationToken = default) - { - await (await GetDbContextAsync()).Set() - .AddAsync(groupMessage, GetCancellationToken(cancellationToken)); - } + public async virtual Task InsertGroupMessageAsync( + GroupMessage groupMessage, + CancellationToken cancellationToken = default) + { + await (await GetDbContextAsync()).Set() + .AddAsync(groupMessage, GetCancellationToken(cancellationToken)); + } - public async virtual Task UpdateGroupMessageAsync( - GroupMessage groupMessage, - CancellationToken cancellationToken = default) - { - (await GetDbContextAsync()).Set().Update(groupMessage); - } + public async virtual Task UpdateGroupMessageAsync( + GroupMessage groupMessage, + CancellationToken cancellationToken = default) + { + (await GetDbContextAsync()).Set().Update(groupMessage); + } - public async virtual Task InsertUserMessageAsync( - UserMessage userMessage, - CancellationToken cancellationToken = default) - { - await (await GetDbContextAsync()).Set() - .AddAsync(userMessage, GetCancellationToken(cancellationToken)); - } + public async virtual Task InsertUserMessageAsync( + UserMessage userMessage, + CancellationToken cancellationToken = default) + { + await (await GetDbContextAsync()).Set() + .AddAsync(userMessage, GetCancellationToken(cancellationToken)); + } - public async virtual Task UpdateUserMessageAsync( - UserMessage userMessage, - CancellationToken cancellationToken = default) - { - (await GetDbContextAsync()).Set().Update(userMessage); - } + public async virtual Task UpdateUserMessageAsync( + UserMessage userMessage, + CancellationToken cancellationToken = default) + { + (await GetDbContextAsync()).Set().Update(userMessage); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatCardRepository.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatCardRepository.cs index 1b3e890d3..b2cea8b6e 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatCardRepository.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatCardRepository.cs @@ -10,78 +10,77 @@ using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public class EfCoreUserChatCardRepository : EfCoreRepository, IUserChatCardRepository { - public class EfCoreUserChatCardRepository : EfCoreRepository, IUserChatCardRepository + public EfCoreUserChatCardRepository( + IDbContextProvider dbContextProvider) + : base(dbContextProvider) { - public EfCoreUserChatCardRepository( - IDbContextProvider dbContextProvider) - : base(dbContextProvider) - { - } + } - public async virtual Task FindByUserIdAsync( - Guid userId, - CancellationToken cancellationToken = default) - { - return await (await GetDbSetAsync()) - .Where(ucc => ucc.UserId == userId) - .FirstAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task FindByUserIdAsync( + Guid userId, + CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()) + .Where(ucc => ucc.UserId == userId) + .FirstAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task CheckUserIdExistsAsync(Guid userId, CancellationToken cancellationToken = default) - { - return await (await GetDbSetAsync()) - .AnyAsync(ucc => ucc.UserId == userId, - GetCancellationToken(cancellationToken)); - } + public async virtual Task CheckUserIdExistsAsync(Guid userId, CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()) + .AnyAsync(ucc => ucc.UserId == userId, + GetCancellationToken(cancellationToken)); + } - public async virtual Task GetMemberAsync(Guid findUserId, CancellationToken cancellationToken = default) - { - return await (await GetDbSetAsync()) - .Where(ucc => ucc.UserId == findUserId) - .Select(ucc => ucc.ToUserCard()) - .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task GetMemberAsync(Guid findUserId, CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()) + .Where(ucc => ucc.UserId == findUserId) + .Select(ucc => ucc.ToUserCard()) + .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task GetMemberCountAsync( - string findUserName = "", - int? startAge = null, - int? endAge = null, - Sex? sex = null, - CancellationToken cancellationToken = default) - { - return await (await GetDbSetAsync()) - .WhereIf(!findUserName.IsNullOrWhiteSpace(), ucc => ucc.UserName.Contains(findUserName)) - .WhereIf(startAge.HasValue, ucc => ucc.Age >= startAge.Value) - .WhereIf(endAge.HasValue, ucc => ucc.Age <= endAge.Value) - .WhereIf(sex.HasValue, ucc => ucc.Sex == sex) - .CountAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task GetMemberCountAsync( + string findUserName = "", + int? startAge = null, + int? endAge = null, + Sex? sex = null, + CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()) + .WhereIf(!findUserName.IsNullOrWhiteSpace(), ucc => ucc.UserName.Contains(findUserName)) + .WhereIf(startAge.HasValue, ucc => ucc.Age >= startAge.Value) + .WhereIf(endAge.HasValue, ucc => ucc.Age <= endAge.Value) + .WhereIf(sex.HasValue, ucc => ucc.Sex == sex) + .CountAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task> GetMembersAsync( - string findUserName = "", - int? startAge = null, - int? endAge = null, - Sex? sex = null, - string sorting = nameof(UserChatCard.UserId), - int skipCount = 0, - int maxResultCount = 10, - CancellationToken cancellationToken = default) + public async virtual Task> GetMembersAsync( + string findUserName = "", + int? startAge = null, + int? endAge = null, + Sex? sex = null, + string sorting = nameof(UserChatCard.UserId), + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default) + { + if (sorting.IsNullOrWhiteSpace()) { - if (sorting.IsNullOrWhiteSpace()) - { - sorting = nameof(UserChatCard.UserId); - } - return await (await GetDbSetAsync()) - .WhereIf(!findUserName.IsNullOrWhiteSpace(), ucc => ucc.UserName.Contains(findUserName)) - .WhereIf(startAge.HasValue, ucc => ucc.Age >= startAge.Value) - .WhereIf(endAge.HasValue, ucc => ucc.Age <= endAge.Value) - .WhereIf(sex.HasValue, ucc => ucc.Sex == sex) - .OrderBy(sorting) - .PageBy(skipCount, maxResultCount) - .Select(ucc => ucc.ToUserCard()) - .ToListAsync(GetCancellationToken(cancellationToken)); + sorting = nameof(UserChatCard.UserId); } + return await (await GetDbSetAsync()) + .WhereIf(!findUserName.IsNullOrWhiteSpace(), ucc => ucc.UserName.Contains(findUserName)) + .WhereIf(startAge.HasValue, ucc => ucc.Age >= startAge.Value) + .WhereIf(endAge.HasValue, ucc => ucc.Age <= endAge.Value) + .WhereIf(sex.HasValue, ucc => ucc.Sex == sex) + .OrderBy(sorting) + .PageBy(skipCount, maxResultCount) + .Select(ucc => ucc.ToUserCard()) + .ToListAsync(GetCancellationToken(cancellationToken)); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatFriendRepository.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatFriendRepository.cs index d3ff0c5fe..f6bef66fe 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatFriendRepository.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatFriendRepository.cs @@ -11,224 +11,223 @@ using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public class EfCoreUserChatFriendRepository : EfCoreRepository, IUserChatFriendRepository { - public class EfCoreUserChatFriendRepository : EfCoreRepository, IUserChatFriendRepository + public EfCoreUserChatFriendRepository( + IDbContextProvider dbContextProvider) + : base(dbContextProvider) { - public EfCoreUserChatFriendRepository( - IDbContextProvider dbContextProvider) - : base(dbContextProvider) - { - } + } - public async virtual Task FindByUserFriendIdAsync(Guid userId, Guid friendId, CancellationToken cancellationToken = default) - { - return await (await GetDbSetAsync()) - .Where(ucf => ucf.UserId == userId && ucf.FrientId == friendId) - .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task FindByUserFriendIdAsync(Guid userId, Guid friendId, CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()) + .Where(ucf => ucf.UserId == userId && ucf.FrientId == friendId) + .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task> GetAllMembersAsync( - Guid userId, - string sorting = nameof(UserChatFriend.RemarkName), - CancellationToken cancellationToken = default) + public async virtual Task> GetAllMembersAsync( + Guid userId, + string sorting = nameof(UserChatFriend.RemarkName), + CancellationToken cancellationToken = default) + { + if (sorting.IsNullOrWhiteSpace()) { - if (sorting.IsNullOrWhiteSpace()) - { - sorting = nameof(UserChatFriend.RemarkName); - } - var dbContext = await GetDbContextAsync(); - var userFriendQuery = from ucf in dbContext.Set() - join ucc in dbContext.Set() - // on ucf.FrientId equals ucc.UserId // 查询双向好友的 - on ucf.UserId equals ucc.UserId - where ucf.UserId == userId && ucf.Status == UserFriendStatus.Added - select new UserFriend - { - Age = ucc.Age, - AvatarUrl = ucc.AvatarUrl, - Birthday = ucc.Birthday, - Black = ucf.Black, - Description = ucc.Description, - DontDisturb = ucf.DontDisturb, - FriendId = ucf.FrientId, - NickName = ucc.NickName, - RemarkName = ucf.RemarkName ?? ucc.NickName, - Sex = ucc.Sex, - Sign = ucc.Sign, - SpecialFocus = ucf.SpecialFocus, - TenantId = ucf.TenantId, - UserId = ucf.UserId, - UserName = ucc.UserName, - Online = ucc.State == UserOnlineState.Online, - }; - - return await userFriendQuery - .OrderBy(sorting) - .ToListAsync(GetCancellationToken(cancellationToken)); + sorting = nameof(UserChatFriend.RemarkName); } + var dbContext = await GetDbContextAsync(); + var userFriendQuery = from ucf in dbContext.Set() + join ucc in dbContext.Set() + // on ucf.FrientId equals ucc.UserId // 查询双向好友的 + on ucf.UserId equals ucc.UserId + where ucf.UserId == userId && ucf.Status == UserFriendStatus.Added + select new UserFriend + { + Age = ucc.Age, + AvatarUrl = ucc.AvatarUrl, + Birthday = ucc.Birthday, + Black = ucf.Black, + Description = ucc.Description, + DontDisturb = ucf.DontDisturb, + FriendId = ucf.FrientId, + NickName = ucc.NickName, + RemarkName = ucf.RemarkName ?? ucc.NickName, + Sex = ucc.Sex, + Sign = ucc.Sign, + SpecialFocus = ucf.SpecialFocus, + TenantId = ucf.TenantId, + UserId = ucf.UserId, + UserName = ucc.UserName, + Online = ucc.State == UserOnlineState.Online, + }; + + return await userFriendQuery + .OrderBy(sorting) + .ToListAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task GetMemberAsync(Guid userId, Guid friendId, CancellationToken cancellationToken = default) - { - var dbContext = await GetDbContextAsync(); - var userFriendQuery = from ucf in dbContext.Set() - join ucc in dbContext.Set() - on ucf.FrientId equals ucc.UserId - where ucf.UserId == userId && ucf.FrientId == friendId && ucf.Status == UserFriendStatus.Added - select new UserFriend - { - Age = ucc.Age, - AvatarUrl = ucc.AvatarUrl, - Birthday = ucc.Birthday, - Black = ucf.Black, - Description = ucc.Description, - DontDisturb = ucf.DontDisturb, - FriendId = ucf.FrientId, - NickName = ucc.NickName, - RemarkName = ucf.RemarkName, - Sex = ucc.Sex, - Sign = ucc.Sign, - SpecialFocus = ucf.SpecialFocus, - TenantId = ucf.TenantId, - UserId = ucf.UserId, - UserName = ucc.UserName, - Online = ucc.State == UserOnlineState.Online, - }; - - return await userFriendQuery - .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task GetMemberAsync(Guid userId, Guid friendId, CancellationToken cancellationToken = default) + { + var dbContext = await GetDbContextAsync(); + var userFriendQuery = from ucf in dbContext.Set() + join ucc in dbContext.Set() + on ucf.FrientId equals ucc.UserId + where ucf.UserId == userId && ucf.FrientId == friendId && ucf.Status == UserFriendStatus.Added + select new UserFriend + { + Age = ucc.Age, + AvatarUrl = ucc.AvatarUrl, + Birthday = ucc.Birthday, + Black = ucf.Black, + Description = ucc.Description, + DontDisturb = ucf.DontDisturb, + FriendId = ucf.FrientId, + NickName = ucc.NickName, + RemarkName = ucf.RemarkName, + Sex = ucc.Sex, + Sign = ucc.Sign, + SpecialFocus = ucf.SpecialFocus, + TenantId = ucf.TenantId, + UserId = ucf.UserId, + UserName = ucc.UserName, + Online = ucc.State == UserOnlineState.Online, + }; + + return await userFriendQuery + .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task> GetMembersAsync( - Guid userId, - string filter = "", - string sorting = nameof(UserChatFriend.UserId), - int skipCount = 0, - int maxResultCount = 10, - CancellationToken cancellationToken = default) + public async virtual Task> GetMembersAsync( + Guid userId, + string filter = "", + string sorting = nameof(UserChatFriend.UserId), + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default) + { + if (sorting.IsNullOrWhiteSpace()) { - if (sorting.IsNullOrWhiteSpace()) - { - sorting = nameof(UserChatFriend.UserId); - } - var dbContext = await GetDbContextAsync(); - // 过滤用户资料 - var userChatCardQuery = dbContext.Set() - .WhereIf(!filter.IsNullOrWhiteSpace(), ucc => ucc.UserName.Contains(filter) || ucc.NickName.Contains(filter)); - - // 过滤好友资料 - var userChatFriendQuery = dbContext.Set() - .Where(ucf => ucf.Status == UserFriendStatus.Added) - .WhereIf(!filter.IsNullOrWhiteSpace(), ucf => ucf.RemarkName.Contains(filter)); - - // 组合查询 - var userFriendQuery = from ucf in userChatFriendQuery - join ucc in userChatCardQuery // TODO: Need LEFT JOIN? - on ucf.FrientId equals ucc.UserId - where ucf.UserId == userId - select new UserFriend - { - Age = ucc.Age, - AvatarUrl = ucc.AvatarUrl, - Birthday = ucc.Birthday, - Black = ucf.Black, - Description = ucc.Description, - DontDisturb = ucf.DontDisturb, - FriendId = ucf.FrientId, - NickName = ucc.NickName, - RemarkName = ucf.RemarkName, - Sex = ucc.Sex, - Sign = ucc.Sign, - SpecialFocus = ucf.SpecialFocus, - TenantId = ucf.TenantId, - UserId = ucf.UserId, - UserName = ucc.UserName, - Online = ucc.State == UserOnlineState.Online, - }; - - return await userFriendQuery - .OrderBy(sorting) - .PageBy(skipCount, maxResultCount) - .ToListAsync(GetCancellationToken(cancellationToken)); + sorting = nameof(UserChatFriend.UserId); } + var dbContext = await GetDbContextAsync(); + // 过滤用户资料 + var userChatCardQuery = dbContext.Set() + .WhereIf(!filter.IsNullOrWhiteSpace(), ucc => ucc.UserName.Contains(filter) || ucc.NickName.Contains(filter)); + + // 过滤好友资料 + var userChatFriendQuery = dbContext.Set() + .Where(ucf => ucf.Status == UserFriendStatus.Added) + .WhereIf(!filter.IsNullOrWhiteSpace(), ucf => ucf.RemarkName.Contains(filter)); + + // 组合查询 + var userFriendQuery = from ucf in userChatFriendQuery + join ucc in userChatCardQuery // TODO: Need LEFT JOIN? + on ucf.FrientId equals ucc.UserId + where ucf.UserId == userId + select new UserFriend + { + Age = ucc.Age, + AvatarUrl = ucc.AvatarUrl, + Birthday = ucc.Birthday, + Black = ucf.Black, + Description = ucc.Description, + DontDisturb = ucf.DontDisturb, + FriendId = ucf.FrientId, + NickName = ucc.NickName, + RemarkName = ucf.RemarkName, + Sex = ucc.Sex, + Sign = ucc.Sign, + SpecialFocus = ucf.SpecialFocus, + TenantId = ucf.TenantId, + UserId = ucf.UserId, + UserName = ucc.UserName, + Online = ucc.State == UserOnlineState.Online, + }; + + return await userFriendQuery + .OrderBy(sorting) + .PageBy(skipCount, maxResultCount) + .ToListAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task> GetLastContactMembersAsync( - Guid userId, - int skipCount = 0, - int maxResultCount = 10, - CancellationToken cancellationToken = default) - { - var dbContext = await GetDbContextAsync(); - var userReceiveMsgQuery = dbContext.Set() - .Where(um => um.ReceiveUserId == userId); - - var userFriendQuery = from ucf in dbContext.Set() - join ucc in dbContext.Set() - on ucf.FrientId equals ucc.UserId - join um in userReceiveMsgQuery - on ucc.UserId equals um.CreatorId - where ucf.UserId == userId && ucf.Status == UserFriendStatus.Added - orderby um.CreationTime descending // 消息创建时间倒序 - select new UserFriend - { - Age = ucc.Age, - AvatarUrl = ucc.AvatarUrl, - Birthday = ucc.Birthday, - Black = ucf.Black, - Description = ucc.Description, - DontDisturb = ucf.DontDisturb, - FriendId = ucf.FrientId, - NickName = ucc.NickName, - RemarkName = ucf.RemarkName, - Sex = ucc.Sex, - Sign = ucc.Sign, - SpecialFocus = ucf.SpecialFocus, - TenantId = ucf.TenantId, - UserId = ucf.UserId, - UserName = ucc.UserName, - Online = ucc.State == UserOnlineState.Online, - }; - - return await userFriendQuery - .PageBy(skipCount, maxResultCount) - .ToListAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task> GetLastContactMembersAsync( + Guid userId, + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default) + { + var dbContext = await GetDbContextAsync(); + var userReceiveMsgQuery = dbContext.Set() + .Where(um => um.ReceiveUserId == userId); + + var userFriendQuery = from ucf in dbContext.Set() + join ucc in dbContext.Set() + on ucf.FrientId equals ucc.UserId + join um in userReceiveMsgQuery + on ucc.UserId equals um.CreatorId + where ucf.UserId == userId && ucf.Status == UserFriendStatus.Added + orderby um.CreationTime descending // 消息创建时间倒序 + select new UserFriend + { + Age = ucc.Age, + AvatarUrl = ucc.AvatarUrl, + Birthday = ucc.Birthday, + Black = ucf.Black, + Description = ucc.Description, + DontDisturb = ucf.DontDisturb, + FriendId = ucf.FrientId, + NickName = ucc.NickName, + RemarkName = ucf.RemarkName, + Sex = ucc.Sex, + Sign = ucc.Sign, + SpecialFocus = ucf.SpecialFocus, + TenantId = ucf.TenantId, + UserId = ucf.UserId, + UserName = ucc.UserName, + Online = ucc.State == UserOnlineState.Online, + }; + + return await userFriendQuery + .PageBy(skipCount, maxResultCount) + .ToListAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task GetMembersCountAsync(Guid userId, string filter = "", CancellationToken cancellationToken = default) - { - var dbContext = await GetDbContextAsync(); - var userChatCardQuery = dbContext.Set() - .WhereIf(!filter.IsNullOrWhiteSpace(), ucc => ucc.UserName.Contains(filter) || ucc.NickName.Contains(filter)); - - var userChatFriendQuery = dbContext.Set() - .Where(ucf => ucf.Status == UserFriendStatus.Added) - .WhereIf(!filter.IsNullOrWhiteSpace(), ucf => ucf.RemarkName.Contains(filter)); - - var userFriendQuery = from ucf in userChatFriendQuery - join ucc in userChatCardQuery - on ucf.FrientId equals ucc.UserId - where ucf.UserId == userId - select ucc; - - return await userFriendQuery - .CountAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task GetMembersCountAsync(Guid userId, string filter = "", CancellationToken cancellationToken = default) + { + var dbContext = await GetDbContextAsync(); + var userChatCardQuery = dbContext.Set() + .WhereIf(!filter.IsNullOrWhiteSpace(), ucc => ucc.UserName.Contains(filter) || ucc.NickName.Contains(filter)); + + var userChatFriendQuery = dbContext.Set() + .Where(ucf => ucf.Status == UserFriendStatus.Added) + .WhereIf(!filter.IsNullOrWhiteSpace(), ucf => ucf.RemarkName.Contains(filter)); + + var userFriendQuery = from ucf in userChatFriendQuery + join ucc in userChatCardQuery + on ucf.FrientId equals ucc.UserId + where ucf.UserId == userId + select ucc; + + return await userFriendQuery + .CountAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task IsFriendAsync( - Guid userId, - Guid frientId, - CancellationToken cancellationToken = default) - { - return await (await GetDbSetAsync()) - .AnyAsync(ucf => ucf.UserId == userId && ucf.FrientId == frientId && ucf.Status == UserFriendStatus.Added, - GetCancellationToken(cancellationToken)); - } + public async virtual Task IsFriendAsync( + Guid userId, + Guid frientId, + CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()) + .AnyAsync(ucf => ucf.UserId == userId && ucf.FrientId == frientId && ucf.Status == UserFriendStatus.Added, + GetCancellationToken(cancellationToken)); + } - public async virtual Task IsAddedAsync(Guid userId, Guid frientId, CancellationToken cancellationToken = default) - { - return await (await GetDbSetAsync()) - .AnyAsync(ucf => ucf.UserId == userId && ucf.FrientId == frientId, - GetCancellationToken(cancellationToken)); - } + public async virtual Task IsAddedAsync(Guid userId, Guid frientId, CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()) + .AnyAsync(ucf => ucf.UserId == userId && ucf.FrientId == frientId, + GetCancellationToken(cancellationToken)); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatSettingRepository.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatSettingRepository.cs index a1a64f6ed..7e12bebe2 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatSettingRepository.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatSettingRepository.cs @@ -8,28 +8,27 @@ using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +public class EfCoreUserChatSettingRepository : EfCoreRepository, + IUserChatSettingRepository, ITransientDependency { - public class EfCoreUserChatSettingRepository : EfCoreRepository, - IUserChatSettingRepository, ITransientDependency + public EfCoreUserChatSettingRepository( + IDbContextProvider dbContextProvider) + : base(dbContextProvider) { - public EfCoreUserChatSettingRepository( - IDbContextProvider dbContextProvider) - : base(dbContextProvider) - { - } + } - public async Task FindByUserIdAsync(Guid userId, CancellationToken cancellationToken = default) - { - return await (await GetDbSetAsync()).Where(x => x.UserId.Equals(userId)) - .AsNoTracking() - .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); - } + public async Task FindByUserIdAsync(Guid userId, CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()).Where(x => x.UserId.Equals(userId)) + .AsNoTracking() + .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); + } - public async Task UserHasOpendImAsync(Guid userId, CancellationToken cancellationToken = default) - { - return await (await GetDbSetAsync()) - .AnyAsync(x => x.UserId.Equals(userId), GetCancellationToken(cancellationToken)); - } + public async Task UserHasOpendImAsync(Guid userId, CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()) + .AnyAsync(x => x.UserId.Equals(userId), GetCancellationToken(cancellationToken)); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/AbpMessageServiceEntityFrameworkCoreModule.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/AbpMessageServiceEntityFrameworkCoreModule.cs index a2d06f9e0..3c7aec6e3 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/AbpMessageServiceEntityFrameworkCoreModule.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/AbpMessageServiceEntityFrameworkCoreModule.cs @@ -4,26 +4,25 @@ using Volo.Abp.EntityFrameworkCore; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.MessageService.EntityFrameworkCore +namespace LINGYUN.Abp.MessageService.EntityFrameworkCore; + +[DependsOn( + typeof(AbpMessageServiceDomainModule), + typeof(AbpEntityFrameworkCoreModule))] +public class AbpMessageServiceEntityFrameworkCoreModule : AbpModule { - [DependsOn( - typeof(AbpMessageServiceDomainModule), - typeof(AbpEntityFrameworkCoreModule))] - public class AbpMessageServiceEntityFrameworkCoreModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + context.Services.AddAbpDbContext(options => { - context.Services.AddAbpDbContext(options => - { - options.AddDefaultRepositories(); + options.AddDefaultRepositories(); - options.AddRepository(); - options.AddRepository(); - options.AddRepository(); - options.AddRepository(); + options.AddRepository(); + options.AddRepository(); + options.AddRepository(); + options.AddRepository(); - options.AddRepository(); - }); - } + options.AddRepository(); + }); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/IMessageServiceDbContext.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/IMessageServiceDbContext.cs index 485f5a4a3..80b9e62d1 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/IMessageServiceDbContext.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/IMessageServiceDbContext.cs @@ -4,19 +4,18 @@ using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; -namespace LINGYUN.Abp.MessageService.EntityFrameworkCore +namespace LINGYUN.Abp.MessageService.EntityFrameworkCore; + +[ConnectionStringName(AbpMessageServiceDbProperties.ConnectionStringName)] +public interface IMessageServiceDbContext : IEfCoreDbContext { - [ConnectionStringName(AbpMessageServiceDbProperties.ConnectionStringName)] - public interface IMessageServiceDbContext : IEfCoreDbContext - { - DbSet UserMessages { get; } - DbSet GroupMessages { get; } - DbSet UserChatFriends { get; } - DbSet UserChatSettings { get; } - DbSet GroupChatBlacks { get; } - DbSet ChatGroups { get; } - DbSet UserChatGroups { get; } - DbSet UserChatCards { get; } - DbSet UserGroupCards { get; } - } + DbSet UserMessages { get; } + DbSet GroupMessages { get; } + DbSet UserChatFriends { get; } + DbSet UserChatSettings { get; } + DbSet GroupChatBlacks { get; } + DbSet ChatGroups { get; } + DbSet UserChatGroups { get; } + DbSet UserChatCards { get; } + DbSet UserGroupCards { get; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/MessageServiceDbContext.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/MessageServiceDbContext.cs index 0aa6e8da1..ec308a3de 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/MessageServiceDbContext.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/MessageServiceDbContext.cs @@ -4,34 +4,33 @@ using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; -namespace LINGYUN.Abp.MessageService.EntityFrameworkCore +namespace LINGYUN.Abp.MessageService.EntityFrameworkCore; + +[ConnectionStringName(AbpMessageServiceDbProperties.ConnectionStringName)] +public class MessageServiceDbContext : AbpDbContext, IMessageServiceDbContext { - [ConnectionStringName(AbpMessageServiceDbProperties.ConnectionStringName)] - public class MessageServiceDbContext : AbpDbContext, IMessageServiceDbContext + public DbSet UserMessages { get; set; } + public DbSet GroupMessages { get; set; } + public DbSet UserChatFriends { get; set; } + public DbSet UserChatSettings { get; set; } + public DbSet GroupChatBlacks { get; set; } + public DbSet ChatGroups { get; set; } + public DbSet UserChatGroups { get; set; } + public DbSet UserChatCards { get; set; } + public DbSet UserGroupCards { get; set; } + + public MessageServiceDbContext(DbContextOptions options) + : base(options) + { + } + protected override void OnModelCreating(ModelBuilder modelBuilder) { - public DbSet UserMessages { get; set; } - public DbSet GroupMessages { get; set; } - public DbSet UserChatFriends { get; set; } - public DbSet UserChatSettings { get; set; } - public DbSet GroupChatBlacks { get; set; } - public DbSet ChatGroups { get; set; } - public DbSet UserChatGroups { get; set; } - public DbSet UserChatCards { get; set; } - public DbSet UserGroupCards { get; set; } + base.OnModelCreating(modelBuilder); - public MessageServiceDbContext(DbContextOptions options) - : base(options) - { - } - protected override void OnModelCreating(ModelBuilder modelBuilder) + modelBuilder.ConfigureMessageService(options => { - base.OnModelCreating(modelBuilder); - - modelBuilder.ConfigureMessageService(options => - { - options.TablePrefix = AbpMessageServiceDbProperties.DefaultTablePrefix; - options.Schema = AbpMessageServiceDbProperties.DefaultSchema; - }); - } + options.TablePrefix = AbpMessageServiceDbProperties.DefaultTablePrefix; + options.Schema = AbpMessageServiceDbProperties.DefaultSchema; + }); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/MessageServiceDbContextModelCreatingExtensions.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/MessageServiceDbContextModelCreatingExtensions.cs index f6fc471df..ffa2f13dc 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/MessageServiceDbContextModelCreatingExtensions.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/MessageServiceDbContextModelCreatingExtensions.cs @@ -5,145 +5,144 @@ using Volo.Abp; using Volo.Abp.EntityFrameworkCore.Modeling; -namespace LINGYUN.Abp.MessageService.EntityFrameworkCore +namespace LINGYUN.Abp.MessageService.EntityFrameworkCore; + +public static class MessageServiceDbContextModelCreatingExtensions { - public static class MessageServiceDbContextModelCreatingExtensions + public static void ConfigureMessageService( + this ModelBuilder builder, + Action optionsAction = null) { - public static void ConfigureMessageService( - this ModelBuilder builder, - Action optionsAction = null) - { - Check.NotNull(builder, nameof(builder)); + Check.NotNull(builder, nameof(builder)); - var options = new MessageServiceModelBuilderConfigurationOptions(); + var options = new MessageServiceModelBuilderConfigurationOptions(); - optionsAction?.Invoke(options); + optionsAction?.Invoke(options); - builder.Entity(b => - { - b.ToTable(options.TablePrefix + "UserMessages", options.Schema); + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "UserMessages", options.Schema); - b.Property(p => p.SendUserName).HasMaxLength(MessageConsts.MaxSendUserNameLength).IsRequired(); - b.Property(p => p.Content).HasMaxLength(MessageConsts.MaxContentLength).IsRequired(); + b.Property(p => p.SendUserName).HasMaxLength(MessageConsts.MaxSendUserNameLength).IsRequired(); + b.Property(p => p.Content).HasMaxLength(MessageConsts.MaxContentLength).IsRequired(); - b.ConfigureByConvention(); + b.ConfigureByConvention(); - b.HasIndex(p => new { p.TenantId, p.ReceiveUserId }); - }); + b.HasIndex(p => new { p.TenantId, p.ReceiveUserId }); + }); - builder.Entity(b => - { - b.ToTable(options.TablePrefix + "GroupMessages", options.Schema); + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "GroupMessages", options.Schema); - b.Property(p => p.SendUserName).HasMaxLength(MessageConsts.MaxSendUserNameLength).IsRequired(); - b.Property(p => p.Content).HasMaxLength(MessageConsts.MaxContentLength).IsRequired(); + b.Property(p => p.SendUserName).HasMaxLength(MessageConsts.MaxSendUserNameLength).IsRequired(); + b.Property(p => p.Content).HasMaxLength(MessageConsts.MaxContentLength).IsRequired(); - b.ConfigureByConvention(); + b.ConfigureByConvention(); - b.HasIndex(p => new { p.TenantId, p.GroupId }); - }); + b.HasIndex(p => new { p.TenantId, p.GroupId }); + }); - builder.Entity(b => - { - b.ToTable(options.TablePrefix + "UserChatFriends", options.Schema); + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "UserChatFriends", options.Schema); - b.Property(p => p.RemarkName).HasMaxLength(UserChatFriendConsts.MaxRemarkNameLength); - b.Property(p => p.Description).HasMaxLength(UserChatFriendConsts.MaxDescriptionLength); + b.Property(p => p.RemarkName).HasMaxLength(UserChatFriendConsts.MaxRemarkNameLength); + b.Property(p => p.Description).HasMaxLength(UserChatFriendConsts.MaxDescriptionLength); - b.ConfigureByConvention(); + b.ConfigureByConvention(); - b.HasIndex(p => new { p.TenantId, p.UserId, p.FrientId }); - }); + b.HasIndex(p => new { p.TenantId, p.UserId, p.FrientId }); + }); - builder.Entity(b => - { - b.ToTable(options.TablePrefix + "UserChatCards", options.Schema); + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "UserChatCards", options.Schema); - b.Property(p => p.UserName).HasMaxLength(UserChatCardConsts.MaxUserNameLength).IsRequired(); + b.Property(p => p.UserName).HasMaxLength(UserChatCardConsts.MaxUserNameLength).IsRequired(); - b.Property(p => p.AvatarUrl).HasMaxLength(UserChatCardConsts.MaxAvatarUrlLength); - b.Property(p => p.Description).HasMaxLength(UserChatCardConsts.MaxDescriptionLength); - b.Property(p => p.NickName).HasMaxLength(UserChatCardConsts.MaxNickNameLength); - b.Property(p => p.Sign).HasMaxLength(UserChatCardConsts.MaxSignLength); + b.Property(p => p.AvatarUrl).HasMaxLength(UserChatCardConsts.MaxAvatarUrlLength); + b.Property(p => p.Description).HasMaxLength(UserChatCardConsts.MaxDescriptionLength); + b.Property(p => p.NickName).HasMaxLength(UserChatCardConsts.MaxNickNameLength); + b.Property(p => p.Sign).HasMaxLength(UserChatCardConsts.MaxSignLength); - b.ConfigureByConvention(); + b.ConfigureByConvention(); - b.HasIndex(p => new { p.TenantId, p.UserId }); - }); + b.HasIndex(p => new { p.TenantId, p.UserId }); + }); - builder.Entity(b => - { - b.ToTable(options.TablePrefix + "UserGroupCards", options.Schema); + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "UserGroupCards", options.Schema); - b.Property(p => p.NickName).HasMaxLength(UserChatCardConsts.MaxNickNameLength); + b.Property(p => p.NickName).HasMaxLength(UserChatCardConsts.MaxNickNameLength); - b.ConfigureByConvention(); + b.ConfigureByConvention(); - b.HasIndex(p => new { p.TenantId, p.UserId }); - }); + b.HasIndex(p => new { p.TenantId, p.UserId }); + }); - builder.Entity(b => - { - b.ToTable(options.TablePrefix + "UserChatSettings", options.Schema); + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "UserChatSettings", options.Schema); - b.ConfigureByConvention(); + b.ConfigureByConvention(); - b.HasIndex(p => new { p.TenantId, p.UserId }); - }); + b.HasIndex(p => new { p.TenantId, p.UserId }); + }); - //builder.Entity(b => - //{ - // b.ToTable(options.TablePrefix + "UserSpecialFocuss", options.Schema); + //builder.Entity(b => + //{ + // b.ToTable(options.TablePrefix + "UserSpecialFocuss", options.Schema); - // b.ConfigureMultiTenant(); + // b.ConfigureMultiTenant(); - // b.HasIndex(p => new { p.TenantId, p.UserId }); - //}); + // b.HasIndex(p => new { p.TenantId, p.UserId }); + //}); - //builder.Entity(b => - //{ - // b.ToTable(options.TablePrefix + "UserChatBlacks", options.Schema); + //builder.Entity(b => + //{ + // b.ToTable(options.TablePrefix + "UserChatBlacks", options.Schema); - // b.ConfigureMultiTenant(); + // b.ConfigureMultiTenant(); - // b.HasIndex(p => new { p.TenantId, p.UserId }); - //}); + // b.HasIndex(p => new { p.TenantId, p.UserId }); + //}); - builder.Entity(b => - { - b.ToTable(options.TablePrefix + "GroupChatBlacks", options.Schema); + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "GroupChatBlacks", options.Schema); - b.ConfigureByConvention(); + b.ConfigureByConvention(); - b.HasIndex(p => new { p.TenantId, p.GroupId }); - }); + b.HasIndex(p => new { p.TenantId, p.GroupId }); + }); - builder.Entity(b => - { - b.ToTable(options.TablePrefix + "ChatGroups", options.Schema); + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "ChatGroups", options.Schema); - b.Property(p => p.Name).HasMaxLength(ChatGroupConsts.MaxNameLength).IsRequired(); + b.Property(p => p.Name).HasMaxLength(ChatGroupConsts.MaxNameLength).IsRequired(); - b.Property(p => p.Tag).HasMaxLength(ChatGroupConsts.MaxTagLength); - b.Property(p => p.Notice).HasMaxLength(ChatGroupConsts.MaxNoticeLength); - b.Property(p => p.Address).HasMaxLength(ChatGroupConsts.MaxAddressLength); - b.Property(p => p.Description).HasMaxLength(ChatGroupConsts.MaxDescriptionLength); - b.Property(p => p.AvatarUrl).HasMaxLength(ChatGroupConsts.MaxAvatarUrlLength); + b.Property(p => p.Tag).HasMaxLength(ChatGroupConsts.MaxTagLength); + b.Property(p => p.Notice).HasMaxLength(ChatGroupConsts.MaxNoticeLength); + b.Property(p => p.Address).HasMaxLength(ChatGroupConsts.MaxAddressLength); + b.Property(p => p.Description).HasMaxLength(ChatGroupConsts.MaxDescriptionLength); + b.Property(p => p.AvatarUrl).HasMaxLength(ChatGroupConsts.MaxAvatarUrlLength); - b.ConfigureByConvention(); + b.ConfigureByConvention(); - b.HasIndex(p => new { p.TenantId, p.Name }); - }); + b.HasIndex(p => new { p.TenantId, p.Name }); + }); - builder.Entity(b => - { - b.ToTable(options.TablePrefix + "UserChatGroups", options.Schema); + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "UserChatGroups", options.Schema); - b.ConfigureByConvention(); + b.ConfigureByConvention(); - b.HasIndex(p => new { p.TenantId, p.GroupId, p.UserId }); - }); - } + b.HasIndex(p => new { p.TenantId, p.GroupId, p.UserId }); + }); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/MessageServiceModelBuilderConfigurationOptions.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/MessageServiceModelBuilderConfigurationOptions.cs index 049ae7d54..abc6f6904 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/MessageServiceModelBuilderConfigurationOptions.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/MessageServiceModelBuilderConfigurationOptions.cs @@ -1,18 +1,17 @@ using JetBrains.Annotations; using Volo.Abp.EntityFrameworkCore.Modeling; -namespace LINGYUN.Abp.MessageService.EntityFrameworkCore +namespace LINGYUN.Abp.MessageService.EntityFrameworkCore; + +public class MessageServiceModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions { - public class MessageServiceModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions + public MessageServiceModelBuilderConfigurationOptions( + [NotNull] string tablePrefix = AbpMessageServiceDbProperties.DefaultTablePrefix, + [CanBeNull] string schema = AbpMessageServiceDbProperties.DefaultSchema) + : base( + tablePrefix, + schema) { - public MessageServiceModelBuilderConfigurationOptions( - [NotNull] string tablePrefix = AbpMessageServiceDbProperties.DefaultTablePrefix, - [CanBeNull] string schema = AbpMessageServiceDbProperties.DefaultSchema) - : base( - tablePrefix, - schema) - { - } } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Groups/EfCoreGroupRepository.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Groups/EfCoreGroupRepository.cs index 1f5b2b625..f9a032f66 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Groups/EfCoreGroupRepository.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Groups/EfCoreGroupRepository.cs @@ -11,79 +11,78 @@ using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; -namespace LINGYUN.Abp.MessageService.Groups +namespace LINGYUN.Abp.MessageService.Groups; + +public class EfCoreGroupRepository : EfCoreRepository, + IGroupRepository, ITransientDependency { - public class EfCoreGroupRepository : EfCoreRepository, - IGroupRepository, ITransientDependency + public EfCoreGroupRepository( + IDbContextProvider dbContextProvider) + : base(dbContextProvider) { - public EfCoreGroupRepository( - IDbContextProvider dbContextProvider) - : base(dbContextProvider) - { - } + } - public async virtual Task GetCountAsync( - string filter = null, - CancellationToken cancellationToken = default) - { - return await (await GetDbSetAsync()) - .WhereIf(!filter.IsNullOrWhiteSpace(), x => - x.Name.Contains(filter) || x.Tag.Contains(filter)) - .CountAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task GetCountAsync( + string filter = null, + CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()) + .WhereIf(!filter.IsNullOrWhiteSpace(), x => + x.Name.Contains(filter) || x.Tag.Contains(filter)) + .CountAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task> GetListAsync( - string filter = null, - string sorting = nameof(ChatGroup.Name), - int skipCount = 0, - int maxResultCount = 10, - CancellationToken cancellationToken = default) + public async virtual Task> GetListAsync( + string filter = null, + string sorting = nameof(ChatGroup.Name), + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default) + { + if (sorting.IsNullOrWhiteSpace()) { - if (sorting.IsNullOrWhiteSpace()) - { - sorting = nameof(ChatGroup.Name); - } - return await (await GetDbSetAsync()) - .WhereIf(!filter.IsNullOrWhiteSpace(), x => - x.Name.Contains(filter) || x.Tag.Contains(filter)) - .OrderBy(sorting) - .PageBy(skipCount, maxResultCount) - .ToListAsync(GetCancellationToken(cancellationToken)); + sorting = nameof(ChatGroup.Name); } + return await (await GetDbSetAsync()) + .WhereIf(!filter.IsNullOrWhiteSpace(), x => + x.Name.Contains(filter) || x.Tag.Contains(filter)) + .OrderBy(sorting) + .PageBy(skipCount, maxResultCount) + .ToListAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task FindByIdAsync( - long id, - CancellationToken cancellationToken = default) - { - return await (await GetDbSetAsync()) - .Where(x => x.GroupId.Equals(id)) - .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task FindByIdAsync( + long id, + CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()) + .Where(x => x.GroupId.Equals(id)) + .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task> GetGroupAdminAsync( - long id, - CancellationToken cancellationToken = default) - { - var dbContext = await GetDbContextAsync(); - var groupAdmins = await (from gp in dbContext.Set() - join ucg in dbContext.Set() - on gp.GroupId equals ucg.GroupId - join ugc in dbContext.Set() - on ucg.UserId equals ugc.UserId - where ugc.IsAdmin - select ugc) - .ToListAsync(GetCancellationToken(cancellationToken)); - return groupAdmins; - } + public async virtual Task> GetGroupAdminAsync( + long id, + CancellationToken cancellationToken = default) + { + var dbContext = await GetDbContextAsync(); + var groupAdmins = await (from gp in dbContext.Set() + join ucg in dbContext.Set() + on gp.GroupId equals ucg.GroupId + join ugc in dbContext.Set() + on ucg.UserId equals ugc.UserId + where ugc.IsAdmin + select ugc) + .ToListAsync(GetCancellationToken(cancellationToken)); + return groupAdmins; + } - public async virtual Task UserHasBlackedAsync( - long id, - Guid formUserId, - CancellationToken cancellationToken = default) - { - var userHasBlack = await (await GetDbContextAsync()).Set() - .AnyAsync(x => x.GroupId.Equals(id) && x.ShieldUserId.Equals(formUserId), GetCancellationToken(cancellationToken)); - return userHasBlack; - } + public async virtual Task UserHasBlackedAsync( + long id, + Guid formUserId, + CancellationToken cancellationToken = default) + { + var userHasBlack = await (await GetDbContextAsync()).Set() + .AnyAsync(x => x.GroupId.Equals(id) && x.ShieldUserId.Equals(formUserId), GetCancellationToken(cancellationToken)); + return userHasBlack; } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Groups/EfCoreUserChatGroupRepository.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Groups/EfCoreUserChatGroupRepository.cs index c62722ce9..366c2c6f3 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Groups/EfCoreUserChatGroupRepository.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Groups/EfCoreUserChatGroupRepository.cs @@ -12,163 +12,162 @@ using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; -namespace LINGYUN.Abp.MessageService.Groups +namespace LINGYUN.Abp.MessageService.Groups; + +public class EfCoreUserChatGroupRepository : EfCoreRepository, + IUserChatGroupRepository, ITransientDependency { - public class EfCoreUserChatGroupRepository : EfCoreRepository, - IUserChatGroupRepository, ITransientDependency + public EfCoreUserChatGroupRepository( + IDbContextProvider dbContextProvider) : base(dbContextProvider) { - public EfCoreUserChatGroupRepository( - IDbContextProvider dbContextProvider) : base(dbContextProvider) - { - } + } - public async virtual Task GetMemberAsync( - long groupId, - Guid userId, - CancellationToken cancellationToken = default) - { - var dbContext = await GetDbContextAsync(); - var cardQuery = from gp in dbContext.Set() - join ucg in dbContext.Set() - on gp.GroupId equals ucg.GroupId - join ugc in dbContext.Set() - on ucg.UserId equals ugc.UserId - join uc in dbContext.Set() - on ugc.UserId equals uc.UserId - where gp.GroupId == groupId && ugc.UserId == userId - select new GroupUserCard - { - TenantId = uc.TenantId, - UserId = uc.UserId, - UserName = uc.UserName, - Age = uc.Age, - AvatarUrl = uc.AvatarUrl, - IsAdmin = ugc.IsAdmin, - IsSuperAdmin = gp.AdminUserId == uc.UserId, - GroupId = gp.GroupId, - Birthday = uc.Birthday, - Description = uc.Description, - NickName = ugc.NickName ?? uc.NickName, - Sex = uc.Sex, - Sign = uc.Sign - }; + public async virtual Task GetMemberAsync( + long groupId, + Guid userId, + CancellationToken cancellationToken = default) + { + var dbContext = await GetDbContextAsync(); + var cardQuery = from gp in dbContext.Set() + join ucg in dbContext.Set() + on gp.GroupId equals ucg.GroupId + join ugc in dbContext.Set() + on ucg.UserId equals ugc.UserId + join uc in dbContext.Set() + on ugc.UserId equals uc.UserId + where gp.GroupId == groupId && ugc.UserId == userId + select new GroupUserCard + { + TenantId = uc.TenantId, + UserId = uc.UserId, + UserName = uc.UserName, + Age = uc.Age, + AvatarUrl = uc.AvatarUrl, + IsAdmin = ugc.IsAdmin, + IsSuperAdmin = gp.AdminUserId == uc.UserId, + GroupId = gp.GroupId, + Birthday = uc.Birthday, + Description = uc.Description, + NickName = ugc.NickName ?? uc.NickName, + Sex = uc.Sex, + Sign = uc.Sign + }; - return await cardQuery - .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); - } + return await cardQuery + .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task> GetMembersAsync( - long groupId, - string sorting = nameof(UserChatCard.UserId), - int skipCount = 0, - int maxResultCount = 10, - CancellationToken cancellationToken = default) + public async virtual Task> GetMembersAsync( + long groupId, + string sorting = nameof(UserChatCard.UserId), + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default) + { + if (sorting.IsNullOrWhiteSpace()) { - if (sorting.IsNullOrWhiteSpace()) - { - sorting = nameof(UserChatCard.UserId); - } - var dbContext = await GetDbContextAsync(); - var cardQuery = from gp in dbContext.Set() - join ucg in dbContext.Set() - on gp.GroupId equals ucg.GroupId - join ugc in dbContext.Set() - on ucg.UserId equals ugc.UserId - join uc in dbContext.Set() - on ugc.UserId equals uc.UserId - where gp.GroupId == groupId - select new GroupUserCard - { - TenantId = uc.TenantId, - UserId = uc.UserId, - UserName = uc.UserName, - Age = uc.Age, - AvatarUrl = uc.AvatarUrl, - IsAdmin = ugc.IsAdmin, - IsSuperAdmin = gp.AdminUserId == uc.UserId, - GroupId = gp.GroupId, - Birthday = uc.Birthday, - Description = uc.Description, - NickName = ugc.NickName ?? uc.NickName, - Sex = uc.Sex, - Sign = uc.Sign - }; - - return await cardQuery - .OrderBy(sorting) - .PageBy(skipCount, maxResultCount) - .ToListAsync(GetCancellationToken(cancellationToken)); + sorting = nameof(UserChatCard.UserId); } + var dbContext = await GetDbContextAsync(); + var cardQuery = from gp in dbContext.Set() + join ucg in dbContext.Set() + on gp.GroupId equals ucg.GroupId + join ugc in dbContext.Set() + on ucg.UserId equals ugc.UserId + join uc in dbContext.Set() + on ugc.UserId equals uc.UserId + where gp.GroupId == groupId + select new GroupUserCard + { + TenantId = uc.TenantId, + UserId = uc.UserId, + UserName = uc.UserName, + Age = uc.Age, + AvatarUrl = uc.AvatarUrl, + IsAdmin = ugc.IsAdmin, + IsSuperAdmin = gp.AdminUserId == uc.UserId, + GroupId = gp.GroupId, + Birthday = uc.Birthday, + Description = uc.Description, + NickName = ugc.NickName ?? uc.NickName, + Sex = uc.Sex, + Sign = uc.Sign + }; - public async virtual Task GetMembersCountAsync( - long groupId, - CancellationToken cancellationToken = default) - { - var dbContext = await GetDbContextAsync(); - var cardQuery = from gp in dbContext.Set() - join ucg in dbContext.Set() - on gp.GroupId equals ucg.GroupId - join ugc in dbContext.Set() - on ucg.UserId equals ugc.UserId - join uc in dbContext.Set() - on ugc.UserId equals uc.UserId - where gp.GroupId == groupId - select ucg; + return await cardQuery + .OrderBy(sorting) + .PageBy(skipCount, maxResultCount) + .ToListAsync(GetCancellationToken(cancellationToken)); + } - return await cardQuery - .CountAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task GetMembersCountAsync( + long groupId, + CancellationToken cancellationToken = default) + { + var dbContext = await GetDbContextAsync(); + var cardQuery = from gp in dbContext.Set() + join ucg in dbContext.Set() + on gp.GroupId equals ucg.GroupId + join ugc in dbContext.Set() + on ucg.UserId equals ugc.UserId + join uc in dbContext.Set() + on ugc.UserId equals uc.UserId + where gp.GroupId == groupId + select ucg; - public async virtual Task MemberHasInGroupAsync( - long groupId, - Guid userId, - CancellationToken cancellationToken = default) - { - return await (await GetDbContextAsync()).Set() - .AnyAsync(ucg => ucg.GroupId == groupId && ucg.UserId == userId, - GetCancellationToken(cancellationToken)); - } + return await cardQuery + .CountAsync(GetCancellationToken(cancellationToken)); + } - public async virtual Task> GetMemberGroupsAsync( - Guid userId, - CancellationToken cancellationToken = default) - { - var dbContext = await GetDbContextAsync(); - var groupQuery = from gp in dbContext.Set() - join ucg in dbContext.Set() - on gp.GroupId equals ucg.GroupId - where ucg.UserId.Equals(userId) - group ucg by new - { - gp.AvatarUrl, - gp.AllowAnonymous, - gp.AllowSendMessage, - gp.MaxUserCount, - gp.Name, - gp.GroupId, - } - into cg - select new Group - { - AvatarUrl = cg.Key.AvatarUrl, - AllowAnonymous = cg.Key.AllowAnonymous, - AllowSendMessage = cg.Key.AllowSendMessage, - MaxUserLength = cg.Key.MaxUserCount, - Name = cg.Key.Name, - Id = cg.Key.GroupId.ToString(), - GroupUserCount = cg.Count() - }; + public async virtual Task MemberHasInGroupAsync( + long groupId, + Guid userId, + CancellationToken cancellationToken = default) + { + return await (await GetDbContextAsync()).Set() + .AnyAsync(ucg => ucg.GroupId == groupId && ucg.UserId == userId, + GetCancellationToken(cancellationToken)); + } - return await groupQuery - .ToListAsync(GetCancellationToken(cancellationToken)); - } + public async virtual Task> GetMemberGroupsAsync( + Guid userId, + CancellationToken cancellationToken = default) + { + var dbContext = await GetDbContextAsync(); + var groupQuery = from gp in dbContext.Set() + join ucg in dbContext.Set() + on gp.GroupId equals ucg.GroupId + where ucg.UserId.Equals(userId) + group ucg by new + { + gp.AvatarUrl, + gp.AllowAnonymous, + gp.AllowSendMessage, + gp.MaxUserCount, + gp.Name, + gp.GroupId, + } + into cg + select new Group + { + AvatarUrl = cg.Key.AvatarUrl, + AllowAnonymous = cg.Key.AllowAnonymous, + AllowSendMessage = cg.Key.AllowSendMessage, + MaxUserLength = cg.Key.MaxUserCount, + Name = cg.Key.Name, + Id = cg.Key.GroupId.ToString(), + GroupUserCount = cg.Count() + }; - public async virtual Task RemoveMemberFormGroupAsync( - long groupId, - Guid userId, - CancellationToken cancellationToken = default) - { - await DeleteAsync(ucg => ucg.GroupId == groupId && ucg.UserId == userId, cancellationToken: GetCancellationToken(cancellationToken)); - } + return await groupQuery + .ToListAsync(GetCancellationToken(cancellationToken)); + } + + public async virtual Task RemoveMemberFormGroupAsync( + long groupId, + Guid userId, + CancellationToken cancellationToken = default) + { + await DeleteAsync(ucg => ucg.GroupId == groupId && ucg.UserId == userId, cancellationToken: GetCancellationToken(cancellationToken)); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi.Client/LINGYUN.Abp.MessageService.HttpApi.Client.csproj b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi.Client/LINGYUN.Abp.MessageService.HttpApi.Client.csproj index f23cd3594..f06737238 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi.Client/LINGYUN.Abp.MessageService.HttpApi.Client.csproj +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi.Client/LINGYUN.Abp.MessageService.HttpApi.Client.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.MessageService.HttpApi.Client + LINGYUN.Abp.MessageService.HttpApi.Client + false + false + false diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi.Client/LINGYUN/Abp/MessageService/AbpMessageServiceHttpApiClientModule.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi.Client/LINGYUN/Abp/MessageService/AbpMessageServiceHttpApiClientModule.cs index 9ecf88a18..df26d54db 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi.Client/LINGYUN/Abp/MessageService/AbpMessageServiceHttpApiClientModule.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi.Client/LINGYUN/Abp/MessageService/AbpMessageServiceHttpApiClientModule.cs @@ -2,19 +2,18 @@ using Volo.Abp.Http.Client; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.MessageService +namespace LINGYUN.Abp.MessageService; + +[DependsOn( + typeof(AbpMessageServiceApplicationContractsModule), + typeof(AbpHttpClientModule))] +public class AbpMessageServiceHttpApiClientModule : AbpModule { - [DependsOn( - typeof(AbpMessageServiceApplicationContractsModule), - typeof(AbpHttpClientModule))] - public class AbpMessageServiceHttpApiClientModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddHttpClientProxies( - typeof(AbpMessageServiceApplicationContractsModule).Assembly, - AbpMessageServiceConsts.RemoteServiceName - ); - } + context.Services.AddHttpClientProxies( + typeof(AbpMessageServiceApplicationContractsModule).Assembly, + AbpMessageServiceConsts.RemoteServiceName + ); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN.Abp.MessageService.HttpApi.csproj b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN.Abp.MessageService.HttpApi.csproj index 760d006c2..7734f574f 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN.Abp.MessageService.HttpApi.csproj +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN.Abp.MessageService.HttpApi.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.MessageService.HttpApi + LINGYUN.Abp.MessageService.HttpApi + false + false + false diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/AbpMessageServiceHttpApiModule.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/AbpMessageServiceHttpApiModule.cs index ec7bc689d..bc62d7f83 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/AbpMessageServiceHttpApiModule.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/AbpMessageServiceHttpApiModule.cs @@ -4,27 +4,26 @@ using Volo.Abp.AspNetCore.Mvc.Localization; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.MessageService +namespace LINGYUN.Abp.MessageService; + +[DependsOn( + typeof(AbpMessageServiceApplicationContractsModule), + typeof(AbpAspNetCoreMvcModule) + )] +public class AbpMessageServiceHttpApiModule : AbpModule { - [DependsOn( - typeof(AbpMessageServiceApplicationContractsModule), - typeof(AbpAspNetCoreMvcModule) - )] - public class AbpMessageServiceHttpApiModule : AbpModule + public override void PreConfigureServices(ServiceConfigurationContext context) { - public override void PreConfigureServices(ServiceConfigurationContext context) + PreConfigure(mvcBuilder => { - PreConfigure(mvcBuilder => - { - mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpMessageServiceHttpApiModule).Assembly); - }); + mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpMessageServiceHttpApiModule).Assembly); + }); - PreConfigure(options => - { - options.AddAssemblyResource( - typeof(MessageServiceResource), // 用于本地化的资源 - typeof(AbpMessageServiceApplicationContractsModule).Assembly); // Dto所在程序集 - }); - } + PreConfigure(options => + { + options.AddAssemblyResource( + typeof(MessageServiceResource), // 用于本地化的资源 + typeof(AbpMessageServiceApplicationContractsModule).Assembly); // Dto所在程序集 + }); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Chat/ChatController.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Chat/ChatController.cs index e1fb98fbe..10faf610c 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Chat/ChatController.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Chat/ChatController.cs @@ -5,45 +5,44 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.AspNetCore.Mvc; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +[RemoteService(Name = AbpMessageServiceConsts.RemoteServiceName)] +[Route("api/im/chat")] +public class ChatController : AbpControllerBase, IChatAppService { - [RemoteService(Name = AbpMessageServiceConsts.RemoteServiceName)] - [Route("api/im/chat")] - public class ChatController : AbpControllerBase, IChatAppService - { - private readonly IChatAppService _chatAppService; + private readonly IChatAppService _chatAppService; - public ChatController(IChatAppService chatAppService) - { - _chatAppService = chatAppService; - } + public ChatController(IChatAppService chatAppService) + { + _chatAppService = chatAppService; + } - [HttpGet] - [Route("group/messages")] - public async virtual Task> GetMyGroupMessageAsync(GroupMessageGetByPagedDto input) - { - return await _chatAppService.GetMyGroupMessageAsync(input); - } + [HttpGet] + [Route("group/messages")] + public async virtual Task> GetMyGroupMessageAsync(GroupMessageGetByPagedDto input) + { + return await _chatAppService.GetMyGroupMessageAsync(input); + } - [HttpGet] - [Route("my-messages")] - public async virtual Task> GetMyChatMessageAsync(UserMessageGetByPagedDto input) - { - return await _chatAppService.GetMyChatMessageAsync(input); - } + [HttpGet] + [Route("my-messages")] + public async virtual Task> GetMyChatMessageAsync(UserMessageGetByPagedDto input) + { + return await _chatAppService.GetMyChatMessageAsync(input); + } - [HttpGet] - [Route("my-last-messages")] - public async virtual Task> GetMyLastChatMessageAsync(GetUserLastMessageDto input) - { - return await _chatAppService.GetMyLastChatMessageAsync(input); - } + [HttpGet] + [Route("my-last-messages")] + public async virtual Task> GetMyLastChatMessageAsync(GetUserLastMessageDto input) + { + return await _chatAppService.GetMyLastChatMessageAsync(input); + } - [HttpPost] - [Route("send-message")] - public async virtual Task SendMessageAsync(ChatMessage input) - { - return await _chatAppService.SendMessageAsync(input); - } + [HttpPost] + [Route("send-message")] + public async virtual Task SendMessageAsync(ChatMessage input) + { + return await _chatAppService.SendMessageAsync(input); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Chat/MyFriendController.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Chat/MyFriendController.cs index 6a837ad91..bd65d0f26 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Chat/MyFriendController.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Chat/MyFriendController.cs @@ -6,56 +6,55 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.AspNetCore.Mvc; -namespace LINGYUN.Abp.MessageService.Chat +namespace LINGYUN.Abp.MessageService.Chat; + +[RemoteService(Name = AbpMessageServiceConsts.RemoteServiceName)] +[Route("api/im/my-friends")] +public class MyFriendController : AbpControllerBase, IMyFriendAppService { - [RemoteService(Name = AbpMessageServiceConsts.RemoteServiceName)] - [Route("api/im/my-friends")] - public class MyFriendController : AbpControllerBase, IMyFriendAppService + protected IMyFriendAppService MyFriendAppService { get; } + + public MyFriendController(IMyFriendAppService myFriendAppService) + { + MyFriendAppService = myFriendAppService; + } + + [HttpPost] + public async virtual Task CreateAsync(MyFriendCreateDto input) + { + await MyFriendAppService.CreateAsync(input); + } + + [HttpPost] + [Route("add-request")] + public async virtual Task AddRequestAsync(MyFriendAddRequestDto input) + { + await MyFriendAppService.AddRequestAsync(input); + } + + [HttpDelete] + public async virtual Task DeleteAsync(MyFriendOperationDto input) + { + await MyFriendAppService.DeleteAsync(input); + } + + [HttpGet] + [Route("{friendId}")] + public async virtual Task GetAsync(Guid friendId) + { + return await MyFriendAppService.GetAsync(friendId); + } + + [HttpGet] + [Route("all")] + public async virtual Task> GetAllListAsync(GetMyFriendsDto input) + { + return await MyFriendAppService.GetAllListAsync(input); + } + + [HttpGet] + public async virtual Task> GetListAsync(MyFriendGetByPagedDto input) { - protected IMyFriendAppService MyFriendAppService { get; } - - public MyFriendController(IMyFriendAppService myFriendAppService) - { - MyFriendAppService = myFriendAppService; - } - - [HttpPost] - public async virtual Task CreateAsync(MyFriendCreateDto input) - { - await MyFriendAppService.CreateAsync(input); - } - - [HttpPost] - [Route("add-request")] - public async virtual Task AddRequestAsync(MyFriendAddRequestDto input) - { - await MyFriendAppService.AddRequestAsync(input); - } - - [HttpDelete] - public async virtual Task DeleteAsync(MyFriendOperationDto input) - { - await MyFriendAppService.DeleteAsync(input); - } - - [HttpGet] - [Route("{friendId}")] - public async virtual Task GetAsync(Guid friendId) - { - return await MyFriendAppService.GetAsync(friendId); - } - - [HttpGet] - [Route("all")] - public async virtual Task> GetAllListAsync(GetMyFriendsDto input) - { - return await MyFriendAppService.GetAllListAsync(input); - } - - [HttpGet] - public async virtual Task> GetListAsync(MyFriendGetByPagedDto input) - { - return await MyFriendAppService.GetListAsync(input); - } + return await MyFriendAppService.GetListAsync(input); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Groups/GroupController.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Groups/GroupController.cs index 587b2a62d..44d8b52be 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Groups/GroupController.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Groups/GroupController.cs @@ -5,31 +5,30 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.AspNetCore.Mvc; -namespace LINGYUN.Abp.MessageService.Groups +namespace LINGYUN.Abp.MessageService.Groups; + +[RemoteService(Name = AbpMessageServiceConsts.RemoteServiceName)] +[Route("api/im/groups")] +public class GroupController : AbpControllerBase, IGroupAppService { - [RemoteService(Name = AbpMessageServiceConsts.RemoteServiceName)] - [Route("api/im/groups")] - public class GroupController : AbpControllerBase, IGroupAppService - { - private readonly IGroupAppService _service; + private readonly IGroupAppService _service; - public GroupController(IGroupAppService service) - { - _service = service; - } + public GroupController(IGroupAppService service) + { + _service = service; + } - [HttpGet] - [Route("{groupId}")] - public async virtual Task GetAsync(string groupId) - { - return await _service.GetAsync(groupId); - } + [HttpGet] + [Route("{groupId}")] + public async virtual Task GetAsync(string groupId) + { + return await _service.GetAsync(groupId); + } - [HttpGet] - [Route("search")] - public async virtual Task> SearchAsync(GroupSearchInput input) - { - return await _service.SearchAsync(input); - } + [HttpGet] + [Route("search")] + public async virtual Task> SearchAsync(GroupSearchInput input) + { + return await _service.SearchAsync(input); } } diff --git a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Groups/UserGroupController.cs b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Groups/UserGroupController.cs index 2cbacff90..640e561ee 100644 --- a/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Groups/UserGroupController.cs +++ b/aspnet-core/modules/realtime-message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Groups/UserGroupController.cs @@ -5,51 +5,50 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.AspNetCore.Mvc; -namespace LINGYUN.Abp.MessageService.Groups +namespace LINGYUN.Abp.MessageService.Groups; + +[RemoteService(Name = AbpMessageServiceConsts.RemoteServiceName)] +[Route("api/im/user-groups")] +public class UserGroupController : AbpControllerBase, IUserGroupAppService { - [RemoteService(Name = AbpMessageServiceConsts.RemoteServiceName)] - [Route("api/im/user-groups")] - public class UserGroupController : AbpControllerBase, IUserGroupAppService + private readonly IUserGroupAppService _service; + + public UserGroupController(IUserGroupAppService service) + { + _service = service; + } + + [HttpPost] + [Route("join")] + public async virtual Task ApplyJoinGroupAsync(UserJoinGroupDto input) + { + await _service.ApplyJoinGroupAsync(input); + } + + [HttpGet] + public async virtual Task> GetGroupUsersAsync(GroupUserGetByPagedDto input) + { + return await _service.GetGroupUsersAsync(input); + } + + [HttpGet] + [Route("me")] + public async virtual Task> GetMyGroupsAsync() + { + return await _service.GetMyGroupsAsync(); + } + + [HttpPut] + [Route("accept")] + public async virtual Task GroupAcceptUserAsync(GroupAcceptUserDto input) + { + await _service.GroupAcceptUserAsync(input); + } + + [HttpPut] + [Route("remove")] + public async virtual Task GroupRemoveUserAsync(GroupRemoveUserDto input) { - private readonly IUserGroupAppService _service; - - public UserGroupController(IUserGroupAppService service) - { - _service = service; - } - - [HttpPost] - [Route("join")] - public async virtual Task ApplyJoinGroupAsync(UserJoinGroupDto input) - { - await _service.ApplyJoinGroupAsync(input); - } - - [HttpGet] - public async virtual Task> GetGroupUsersAsync(GroupUserGetByPagedDto input) - { - return await _service.GetGroupUsersAsync(input); - } - - [HttpGet] - [Route("me")] - public async virtual Task> GetMyGroupsAsync() - { - return await _service.GetMyGroupsAsync(); - } - - [HttpPut] - [Route("accept")] - public async virtual Task GroupAcceptUserAsync(GroupAcceptUserDto input) - { - await _service.GroupAcceptUserAsync(input); - } - - [HttpPut] - [Route("remove")] - public async virtual Task GroupRemoveUserAsync(GroupRemoveUserDto input) - { - await _service.GroupRemoveUserAsync(input); - } + await _service.GroupRemoveUserAsync(input); } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN.Abp.ExceptionHandling.Notifications.csproj b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN.Abp.ExceptionHandling.Notifications.csproj index 47dc6b26c..102630a99 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN.Abp.ExceptionHandling.Notifications.csproj +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN.Abp.ExceptionHandling.Notifications.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.ExceptionHandling.Notifications + LINGYUN.Abp.ExceptionHandling.Notifications + false + false + false diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpNotificationsExceptionHandlingModule.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpNotificationsExceptionHandlingModule.cs index 9f75c4e75..4a4c53dd8 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpNotificationsExceptionHandlingModule.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpNotificationsExceptionHandlingModule.cs @@ -1,12 +1,11 @@ using LINGYUN.Abp.Notifications.Common; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.ExceptionHandling.Notifications +namespace LINGYUN.Abp.ExceptionHandling.Notifications; + +[DependsOn( + typeof(AbpExceptionHandlingModule), + typeof(AbpNotificationsCommonModule))] +public class AbpNotificationsExceptionHandlingModule : AbpModule { - [DependsOn( - typeof(AbpExceptionHandlingModule), - typeof(AbpNotificationsCommonModule))] - public class AbpNotificationsExceptionHandlingModule : AbpModule - { - } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpNotificationsExceptionSubscriber.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpNotificationsExceptionSubscriber.cs index 8707089fd..a20394e7a 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpNotificationsExceptionSubscriber.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpNotificationsExceptionSubscriber.cs @@ -6,39 +6,38 @@ using System.Threading.Tasks; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.ExceptionHandling.Notifications +namespace LINGYUN.Abp.ExceptionHandling.Notifications; + +public class AbpNotificationsExceptionSubscriber : AbpExceptionSubscriberBase { - public class AbpNotificationsExceptionSubscriber : AbpExceptionSubscriberBase + protected ICurrentTenant CurrentTenant { get; } + public AbpNotificationsExceptionSubscriber( + ICurrentTenant currentTenant, + IServiceScopeFactory serviceScopeFactory, + IOptions options) + : base(serviceScopeFactory, options) { - protected ICurrentTenant CurrentTenant { get; } - public AbpNotificationsExceptionSubscriber( - ICurrentTenant currentTenant, - IServiceScopeFactory serviceScopeFactory, - IOptions options) - : base(serviceScopeFactory, options) - { - CurrentTenant = currentTenant; - } + CurrentTenant = currentTenant; + } - protected override async Task SendErrorNotifierAsync(ExceptionSendNotifierContext context) - { - var notificationSender = context.ServiceProvider.GetRequiredService(); - // 发送错误模板消息 - await notificationSender.SendNofiterAsync( + protected override async Task SendErrorNotifierAsync(ExceptionSendNotifierContext context) + { + var notificationSender = context.ServiceProvider.GetRequiredService(); + // 发送错误模板消息 + await notificationSender.SendNofiterAsync( + NotificationsCommonNotificationNames.ExceptionHandling, + new NotificationTemplate( NotificationsCommonNotificationNames.ExceptionHandling, - new NotificationTemplate( - NotificationsCommonNotificationNames.ExceptionHandling, - formUser: "System", - data: new Dictionary - { - { "header", "An application exception has occurred" }, - { "footer", $"Copyright to LY Colin © {DateTime.Now.Year}" }, - { "loglevel", context.LogLevel.ToString() }, - { "stackTrace", context.Exception.ToString() }, - }), - user: null, - CurrentTenant.Id, - NotificationSeverity.Error); - } + formUser: "System", + data: new Dictionary + { + { "header", "An application exception has occurred" }, + { "footer", $"Copyright to LY Colin © {DateTime.Now.Year}" }, + { "loglevel", context.LogLevel.ToString() }, + { "stackTrace", context.Exception.ToString() }, + }), + user: null, + CurrentTenant.Id, + NotificationSeverity.Error); } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN.Abp.Notifications.Application.Contracts.csproj b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN.Abp.Notifications.Application.Contracts.csproj index ac5dee7c1..d2ac10719 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN.Abp.Notifications.Application.Contracts.csproj +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN.Abp.Notifications.Application.Contracts.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Notifications.Application.Contracts + LINGYUN.Abp.Notifications.Application.Contracts + false + false + false diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/AbpNotificationsRemoteServiceConsts.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/AbpNotificationsRemoteServiceConsts.cs index 93f2d92e5..0526a0a68 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/AbpNotificationsRemoteServiceConsts.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/AbpNotificationsRemoteServiceConsts.cs @@ -1,9 +1,8 @@ -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public class AbpNotificationsRemoteServiceConsts { - public class AbpNotificationsRemoteServiceConsts - { - public const string RemoteServiceName = "Notifications"; + public const string RemoteServiceName = "Notifications"; - public const string ModuleName = "notifications"; - } + public const string ModuleName = "notifications"; } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationDto.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationDto.cs index 9b8bddae4..d8df23af7 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationDto.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationDto.cs @@ -1,30 +1,29 @@ -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public class NotificationDto { - public class NotificationDto - { - /// - /// 通知名称 - /// - public string Name { get; set; } - /// - /// 显示名称 - /// - public string DisplayName { get; set; } - /// - /// 说明 - /// - public string Description { get; set; } - /// - /// 存活类型 - /// - public NotificationLifetime Lifetime { get; set; } - /// - /// 通知类型 - /// - public NotificationType Type { get; set; } - /// - /// 通知内容类型 - /// - public NotificationContentType ContentType { get; set; } - } + /// + /// 通知名称 + /// + public string Name { get; set; } + /// + /// 显示名称 + /// + public string DisplayName { get; set; } + /// + /// 说明 + /// + public string Description { get; set; } + /// + /// 存活类型 + /// + public NotificationLifetime Lifetime { get; set; } + /// + /// 通知类型 + /// + public NotificationType Type { get; set; } + /// + /// 通知内容类型 + /// + public NotificationContentType ContentType { get; set; } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationGetByIdDto.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationGetByIdDto.cs index a34de8266..a1a5016ea 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationGetByIdDto.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationGetByIdDto.cs @@ -1,12 +1,11 @@ using System.ComponentModel; using System.ComponentModel.DataAnnotations; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public class NotificationGetByIdDto { - public class NotificationGetByIdDto - { - [Required] - [DisplayName("Notifications:Id")] - public long NotificationId { get; set; } - } + [Required] + [DisplayName("Notifications:Id")] + public long NotificationId { get; set; } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationGroupDto.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationGroupDto.cs index 0908004f5..498d42b20 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationGroupDto.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Dto/NotificationGroupDto.cs @@ -1,11 +1,10 @@ using System.Collections.Generic; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public class NotificationGroupDto { - public class NotificationGroupDto - { - public string Name { get; set; } - public string DisplayName { get; set; } - public List Notifications { get; set; } = new List(); - } + public string Name { get; set; } + public string DisplayName { get; set; } + public List Notifications { get; set; } = new List(); } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Permissions/NotificationsPermissions.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Permissions/NotificationsPermissions.cs index a0aa7d299..f7ef5041f 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Permissions/NotificationsPermissions.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Permissions/NotificationsPermissions.cs @@ -1,32 +1,31 @@ -namespace LINGYUN.Abp.Notifications.Permissions +namespace LINGYUN.Abp.Notifications.Permissions; + +public class NotificationsPermissions { - public class NotificationsPermissions - { - public const string GroupName = "Notifications"; + public const string GroupName = "Notifications"; - public static class Notification - { - public const string Default = GroupName + ".Notification"; + public static class Notification + { + public const string Default = GroupName + ".Notification"; - public const string Delete = Default + ".Delete"; - } + public const string Delete = Default + ".Delete"; + } - public static class GroupDefinition - { - public const string Default = GroupName + ".GroupDefinitions"; + public static class GroupDefinition + { + public const string Default = GroupName + ".GroupDefinitions"; - public const string Create = Default + ".Create"; - public const string Update = Default + ".Update"; - public const string Delete = Default + ".Delete"; - } + public const string Create = Default + ".Create"; + public const string Update = Default + ".Update"; + public const string Delete = Default + ".Delete"; + } - public static class Definition - { - public const string Default = GroupName + ".Definitions"; + public static class Definition + { + public const string Default = GroupName + ".Definitions"; - public const string Create = Default + ".Create"; - public const string Update = Default + ".Update"; - public const string Delete = Default + ".Delete"; - } + public const string Create = Default + ".Create"; + public const string Update = Default + ".Update"; + public const string Delete = Default + ".Delete"; } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Permissions/NotificationsPermissionsDefinitionProvider.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Permissions/NotificationsPermissionsDefinitionProvider.cs index 9cbcec475..ab7751da6 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Permissions/NotificationsPermissionsDefinitionProvider.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application.Contracts/LINGYUN/Abp/Notifications/Permissions/NotificationsPermissionsDefinitionProvider.cs @@ -3,55 +3,54 @@ using Volo.Abp.Localization; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.Notifications.Permissions +namespace LINGYUN.Abp.Notifications.Permissions; + +public class NotificationsPermissionsDefinitionProvider : PermissionDefinitionProvider { - public class NotificationsPermissionsDefinitionProvider : PermissionDefinitionProvider + public override void Define(IPermissionDefinitionContext context) { - public override void Define(IPermissionDefinitionContext context) - { - var group = context.AddGroup(NotificationsPermissions.GroupName, L("Permission:Notifications")); + var group = context.AddGroup(NotificationsPermissions.GroupName, L("Permission:Notifications")); - var groupDefinition = group.AddPermission( - NotificationsPermissions.GroupDefinition.Default, - L("Permission:GroupDefinitions"), - MultiTenancySides.Host); - groupDefinition.AddChild( - NotificationsPermissions.GroupDefinition.Create, - L("Permission:Create"), - MultiTenancySides.Host); - groupDefinition.AddChild( - NotificationsPermissions.GroupDefinition.Update, - L("Permission:Edit"), - MultiTenancySides.Host); - groupDefinition.AddChild( - NotificationsPermissions.GroupDefinition.Delete, - L("Permission:Delete"), - MultiTenancySides.Host); + var groupDefinition = group.AddPermission( + NotificationsPermissions.GroupDefinition.Default, + L("Permission:GroupDefinitions"), + MultiTenancySides.Host); + groupDefinition.AddChild( + NotificationsPermissions.GroupDefinition.Create, + L("Permission:Create"), + MultiTenancySides.Host); + groupDefinition.AddChild( + NotificationsPermissions.GroupDefinition.Update, + L("Permission:Edit"), + MultiTenancySides.Host); + groupDefinition.AddChild( + NotificationsPermissions.GroupDefinition.Delete, + L("Permission:Delete"), + MultiTenancySides.Host); - var definition = group.AddPermission( - NotificationsPermissions.Definition.Default, - L("Permission:NotificationDefinitions"), - MultiTenancySides.Host); - definition.AddChild( - NotificationsPermissions.Definition.Create, - L("Permission:Create"), - MultiTenancySides.Host); - definition.AddChild( - NotificationsPermissions.Definition.Update, - L("Permission:Edit"), - MultiTenancySides.Host); - definition.AddChild( - NotificationsPermissions.Definition.Delete, - L("Permission:Delete"), - MultiTenancySides.Host); + var definition = group.AddPermission( + NotificationsPermissions.Definition.Default, + L("Permission:NotificationDefinitions"), + MultiTenancySides.Host); + definition.AddChild( + NotificationsPermissions.Definition.Create, + L("Permission:Create"), + MultiTenancySides.Host); + definition.AddChild( + NotificationsPermissions.Definition.Update, + L("Permission:Edit"), + MultiTenancySides.Host); + definition.AddChild( + NotificationsPermissions.Definition.Delete, + L("Permission:Delete"), + MultiTenancySides.Host); - var noticeGroup = group.AddPermission(NotificationsPermissions.Notification.Default, L("Permission:Notification")); - noticeGroup.AddChild(NotificationsPermissions.Notification.Delete, L("Permission:Delete")); - } + var noticeGroup = group.AddPermission(NotificationsPermissions.Notification.Default, L("Permission:Notification")); + noticeGroup.AddChild(NotificationsPermissions.Notification.Delete, L("Permission:Delete")); + } - private static LocalizableString L(string name) - { - return LocalizableString.Create(name); - } + private static LocalizableString L(string name) + { + return LocalizableString.Create(name); } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN.Abp.Notifications.Application.csproj b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN.Abp.Notifications.Application.csproj index fa3b7c7b6..dbb18b571 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN.Abp.Notifications.Application.csproj +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN.Abp.Notifications.Application.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.Notifications.Application + LINGYUN.Abp.Notifications.Application + false + false + false diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/AbpNotificationsApplicationAutoMapperProfile.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/AbpNotificationsApplicationAutoMapperProfile.cs index 8a175392b..479671877 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/AbpNotificationsApplicationAutoMapperProfile.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Application/LINGYUN/Abp/Notifications/AbpNotificationsApplicationAutoMapperProfile.cs @@ -1,26 +1,25 @@ using AutoMapper; using System; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public class AbpNotificationsApplicationAutoMapperProfile : Profile { - public class AbpNotificationsApplicationAutoMapperProfile : Profile + public AbpNotificationsApplicationAutoMapperProfile() { - public AbpNotificationsApplicationAutoMapperProfile() - { - CreateMap() - .ForMember(dto => dto.Id, map => map.MapFrom(src => src.Id.ToString())) - .ForMember(dto => dto.Lifetime, map => map.Ignore()) - .ForMember(dto => dto.Data, map => map.MapFrom((src, nfi) => + CreateMap() + .ForMember(dto => dto.Id, map => map.MapFrom(src => src.Id.ToString())) + .ForMember(dto => dto.Lifetime, map => map.Ignore()) + .ForMember(dto => dto.Data, map => map.MapFrom((src, nfi) => + { + var dataType = Type.GetType(src.NotificationTypeName); + var data = Activator.CreateInstance(dataType); + if (data is NotificationData notificationData) { - var dataType = Type.GetType(src.NotificationTypeName); - var data = Activator.CreateInstance(dataType); - if (data is NotificationData notificationData) - { - notificationData.ExtraProperties = src.ExtraProperties; - return notificationData; - } - return new NotificationData(); - })); - } + notificationData.ExtraProperties = src.ExtraProperties; + return notificationData; + } + return new NotificationData(); + })); } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Common/LINGYUN.Abp.Notifications.Common.csproj b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Common/LINGYUN.Abp.Notifications.Common.csproj index 44216f277..ba2e5c55e 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Common/LINGYUN.Abp.Notifications.Common.csproj +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Common/LINGYUN.Abp.Notifications.Common.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Notifications.Common + LINGYUN.Abp.Notifications.Common + false + false + false diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/NotificationsCommonNotificationNames.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/NotificationsCommonNotificationNames.cs index 1a86dcd2b..7be0785e7 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/NotificationsCommonNotificationNames.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/NotificationsCommonNotificationNames.cs @@ -1,11 +1,10 @@ -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public class NotificationsCommonNotificationNames { - public class NotificationsCommonNotificationNames - { - public const string GroupName = "LINGYUN.Abp.Notifications.Primitives"; - /// - /// 异常处理 - /// - public const string ExceptionHandling = GroupName + ".ExceptionHandling"; - } + public const string GroupName = "LINGYUN.Abp.Notifications.Primitives"; + /// + /// 异常处理 + /// + public const string ExceptionHandling = GroupName + ".ExceptionHandling"; } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Common/Volo/Abp/MultiTenancy/TenantNotificationNames.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Common/Volo/Abp/MultiTenancy/TenantNotificationNames.cs index e7bea5455..bdaf9e5b1 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Common/Volo/Abp/MultiTenancy/TenantNotificationNames.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Common/Volo/Abp/MultiTenancy/TenantNotificationNames.cs @@ -1,9 +1,8 @@ -namespace Volo.Abp.MultiTenancy +namespace Volo.Abp.MultiTenancy; + +public class TenantNotificationNames { - public class TenantNotificationNames - { - public const string GroupName = "Volo.Abp.MultiTenancy"; + public const string GroupName = "Volo.Abp.MultiTenancy"; - public const string NewTenantRegistered = GroupName + ".NewTenantRegistered"; - } + public const string NewTenantRegistered = GroupName + ".NewTenantRegistered"; } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Common/Volo/Abp/Users/UserNotificationNames.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Common/Volo/Abp/Users/UserNotificationNames.cs index 877517c08..134487818 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Common/Volo/Abp/Users/UserNotificationNames.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Common/Volo/Abp/Users/UserNotificationNames.cs @@ -1,9 +1,8 @@ -namespace Volo.Abp.Users +namespace Volo.Abp.Users; + +public class UserNotificationNames { - public class UserNotificationNames - { - public const string GroupName = "Volo.Abp.Users"; + public const string GroupName = "Volo.Abp.Users"; - public const string WelcomeToApplication = GroupName + ".WelcomeToApplication"; - } + public const string WelcomeToApplication = GroupName + ".WelcomeToApplication"; } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN.Abp.Notifications.Core.csproj b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN.Abp.Notifications.Core.csproj index 757c02949..495867401 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN.Abp.Notifications.Core.csproj +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN.Abp.Notifications.Core.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Notifications.Core + LINGYUN.Abp.Notifications.Core + false + false + false diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/AbpNotificationsOptions.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/AbpNotificationsOptions.cs index f03091e4a..a88701015 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/AbpNotificationsOptions.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/AbpNotificationsOptions.cs @@ -1,25 +1,24 @@ using System.Collections.Generic; using Volo.Abp.Collections; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public class AbpNotificationsOptions { - public class AbpNotificationsOptions - { - /// - /// 自定义通知集合 - /// - public ITypeList DefinitionProviders { get; } + /// + /// 自定义通知集合 + /// + public ITypeList DefinitionProviders { get; } - public HashSet DeletedNotifications { get; } + public HashSet DeletedNotifications { get; } - public HashSet DeletedNotificationGroups { get; } + public HashSet DeletedNotificationGroups { get; } - public AbpNotificationsOptions() - { - DefinitionProviders = new TypeList(); + public AbpNotificationsOptions() + { + DefinitionProviders = new TypeList(); - DeletedNotifications = new HashSet(); - DeletedNotificationGroups = new HashSet(); - } + DeletedNotifications = new HashSet(); + DeletedNotificationGroups = new HashSet(); } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/INotificationDefinitionContext.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/INotificationDefinitionContext.cs index a225abd3f..2d583e56a 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/INotificationDefinitionContext.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/INotificationDefinitionContext.cs @@ -1,18 +1,17 @@ using JetBrains.Annotations; using Volo.Abp.Localization; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public interface INotificationDefinitionContext { - public interface INotificationDefinitionContext - { - NotificationGroupDefinition AddGroup( - [NotNull] string name, - ILocalizableString displayName = null, - ILocalizableString description = null, - bool allowSubscriptionToClients = true); + NotificationGroupDefinition AddGroup( + [NotNull] string name, + ILocalizableString displayName = null, + ILocalizableString description = null, + bool allowSubscriptionToClients = true); - NotificationGroupDefinition GetGroupOrNull(string name); + NotificationGroupDefinition GetGroupOrNull(string name); - void RemoveGroup(string name); - } + void RemoveGroup(string name); } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/INotificationDefinitionManager.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/INotificationDefinitionManager.cs index a2a0812b3..4793bf3f4 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/INotificationDefinitionManager.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/INotificationDefinitionManager.cs @@ -2,19 +2,18 @@ using System.Collections.Generic; using System.Threading.Tasks; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public interface INotificationDefinitionManager { - public interface INotificationDefinitionManager - { - [NotNull] - Task GetAsync([NotNull] string name); + [NotNull] + Task GetAsync([NotNull] string name); - Task> GetNotificationsAsync(); + Task> GetNotificationsAsync(); - Task GetOrNullAsync(string name); + Task GetOrNullAsync(string name); - Task GetGroupOrNullAsync(string name); + Task GetGroupOrNullAsync(string name); - Task> GetGroupsAsync(); - } + Task> GetGroupsAsync(); } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/INotificationDefinitionProvider.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/INotificationDefinitionProvider.cs index 7c86ddda0..95c2764af 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/INotificationDefinitionProvider.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/INotificationDefinitionProvider.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public interface INotificationDefinitionProvider { - public interface INotificationDefinitionProvider - { - void Define(INotificationDefinitionContext context); - } + void Define(INotificationDefinitionContext context); } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationData.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationData.cs index b20d23094..23b5ed729 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationData.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationData.cs @@ -4,170 +4,169 @@ using Volo.Abp.Data; using Volo.Abp.EventBus; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +/// +/// 通知数据 +/// +/// +/// TODO: 2020-10-29 针对不同语言的用户,如果在发布时期就本地化语言是错误的设计 +/// 把通知的标题和内容设计为 让客户端自行本地化 +/// +[Serializable] +[EventName("notifications")] +public class NotificationData : IHasExtraProperties { /// - /// 通知数据 + /// 用来标识是否需要本地化的信息 /// - /// - /// TODO: 2020-10-29 针对不同语言的用户,如果在发布时期就本地化语言是错误的设计 - /// 把通知的标题和内容设计为 让客户端自行本地化 - /// - [Serializable] - [EventName("notifications")] - public class NotificationData : IHasExtraProperties - { - /// - /// 用来标识是否需要本地化的信息 - /// - public const string LocalizerKey = "L"; - /// - /// 用于本地化文化 - /// - public const string CultureKey = "C"; + public const string LocalizerKey = "L"; + /// + /// 用于本地化文化 + /// + public const string CultureKey = "C"; - public virtual string Type => GetType().FullName; + public virtual string Type => GetType().FullName; - public object this[string key] + public object this[string key] + { + get { - get - { - return this.GetProperty(key); - } - set - { - this.SetProperty(key, value); - } + return this.GetProperty(key); + } + set + { + this.SetProperty(key, value); } + } - public ExtraPropertyDictionary ExtraProperties { get; set; } + public ExtraPropertyDictionary ExtraProperties { get; set; } - public NotificationData() - { - ExtraProperties = new ExtraPropertyDictionary(); - this.SetDefaultsForExtraProperties(); + public NotificationData() + { + ExtraProperties = new ExtraPropertyDictionary(); + this.SetDefaultsForExtraProperties(); - TrySetData(LocalizerKey, false); - } - /// - /// 写入本地化的消息数据 - /// - /// - /// - /// - /// - /// - /// - public NotificationData WriteLocalizedData( - LocalizableStringInfo title, - LocalizableStringInfo message, - DateTime createTime, - string formUser, - LocalizableStringInfo description = null, - string culture = null) - { - TrySetData("title", title); - TrySetData("message", message); - TrySetData("formUser", formUser); - TrySetData("createTime", createTime); - TrySetData(LocalizerKey, true); - TrySetData(CultureKey, culture ?? "en"); - if (description != null) - { - TrySetData("description", description); - } - return this; - } - /// - /// 写入标准数据 - /// - /// 标题 - /// 内容 - /// 创建时间 - /// 来源用户 - /// 附加说明 - /// - public NotificationData WriteStandardData(string title, string message, DateTime createTime, string formUser, string description = "") + TrySetData(LocalizerKey, false); + } + /// + /// 写入本地化的消息数据 + /// + /// + /// + /// + /// + /// + /// + public NotificationData WriteLocalizedData( + LocalizableStringInfo title, + LocalizableStringInfo message, + DateTime createTime, + string formUser, + LocalizableStringInfo description = null, + string culture = null) + { + TrySetData("title", title); + TrySetData("message", message); + TrySetData("formUser", formUser); + TrySetData("createTime", createTime); + TrySetData(LocalizerKey, true); + TrySetData(CultureKey, culture ?? "en"); + if (description != null) { - TrySetData("title", title); - TrySetData("message", message); TrySetData("description", description); - TrySetData("formUser", formUser); - TrySetData("createTime", createTime); - TrySetData(LocalizerKey, false); - return this; - } - /// - /// 写入标准数据 - /// - /// 数据前缀 - /// 标识 - /// 数据内容 - /// - public NotificationData WriteStandardData(string prefix, string key, object value) - { - TrySetData(string.Concat(prefix, key), value); - TrySetData(LocalizerKey, false); - return this; - } - /// - /// 转换为标准数据 - /// - /// 原始数据 - /// - public static NotificationData ToStandardData(NotificationData sourceData) - { - var data = new NotificationData(); - data.TrySetData("title", sourceData.TryGetData("title")); - data.TrySetData("message", sourceData.TryGetData("message")); - data.TrySetData("description", sourceData.TryGetData("description")); - data.TrySetData("formUser", sourceData.TryGetData("formUser")); - data.TrySetData("createTime", sourceData.TryGetData("createTime")); - data.TrySetData(LocalizerKey, sourceData.TryGetData(LocalizerKey)); - return data; } - /// - /// 转换为标准数据 - /// - /// 数据前缀 - /// 原始数据 - /// - public static NotificationData ToStandardData(string prefix, NotificationData sourceData) - { - var data = ToStandardData(sourceData); + return this; + } + /// + /// 写入标准数据 + /// + /// 标题 + /// 内容 + /// 创建时间 + /// 来源用户 + /// 附加说明 + /// + public NotificationData WriteStandardData(string title, string message, DateTime createTime, string formUser, string description = "") + { + TrySetData("title", title); + TrySetData("message", message); + TrySetData("description", description); + TrySetData("formUser", formUser); + TrySetData("createTime", createTime); + TrySetData(LocalizerKey, false); + return this; + } + /// + /// 写入标准数据 + /// + /// 数据前缀 + /// 标识 + /// 数据内容 + /// + public NotificationData WriteStandardData(string prefix, string key, object value) + { + TrySetData(string.Concat(prefix, key), value); + TrySetData(LocalizerKey, false); + return this; + } + /// + /// 转换为标准数据 + /// + /// 原始数据 + /// + public static NotificationData ToStandardData(NotificationData sourceData) + { + var data = new NotificationData(); + data.TrySetData("title", sourceData.TryGetData("title")); + data.TrySetData("message", sourceData.TryGetData("message")); + data.TrySetData("description", sourceData.TryGetData("description")); + data.TrySetData("formUser", sourceData.TryGetData("formUser")); + data.TrySetData("createTime", sourceData.TryGetData("createTime")); + data.TrySetData(LocalizerKey, sourceData.TryGetData(LocalizerKey)); + return data; + } + /// + /// 转换为标准数据 + /// + /// 数据前缀 + /// 原始数据 + /// + public static NotificationData ToStandardData(string prefix, NotificationData sourceData) + { + var data = ToStandardData(sourceData); - foreach (var property in sourceData.ExtraProperties) + foreach (var property in sourceData.ExtraProperties) + { + if (property.Key.StartsWith(prefix)) { - if (property.Key.StartsWith(prefix)) - { - var key = property.Key.Replace(prefix, ""); - data.TrySetData(key, property.Value); - } + var key = property.Key.Replace(prefix, ""); + data.TrySetData(key, property.Value); } - return data; } + return data; + } - public object TryGetData(string key) - { - return this.GetProperty(key); - } - public void TrySetData(string key, object value) - { - this.SetProperty(key, value); - } - /// - /// 需要本地化 - /// - /// - public bool NeedLocalizer() + public object TryGetData(string key) + { + return this.GetProperty(key); + } + public void TrySetData(string key, object value) + { + this.SetProperty(key, value); + } + /// + /// 需要本地化 + /// + /// + public bool NeedLocalizer() + { + var localizer = TryGetData(LocalizerKey); + if (localizer != null && + bool.TryParse(localizer.ToString(), out var isLocalizer)) { - var localizer = TryGetData(LocalizerKey); - if (localizer != null && - bool.TryParse(localizer.ToString(), out var isLocalizer)) - { - return isLocalizer; - } - return false; + return isLocalizer; } + return false; } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinition.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinition.cs index a109ab170..1af202706 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinition.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinition.cs @@ -10,146 +10,145 @@ * INotificationSender指定接收者,未指定才会查询所有订阅用户,已指定发布者,直接发布(检验是否订阅) */ -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public class NotificationDefinition { - public class NotificationDefinition + /// + /// 通知名称 + /// + [NotNull] + public string Name { get; set; } + /// + /// 通知显示名称 + /// + [NotNull] + public ILocalizableString DisplayName { - /// - /// 通知名称 - /// - [NotNull] - public string Name { get; set; } - /// - /// 通知显示名称 - /// - [NotNull] - public ILocalizableString DisplayName - { - get => _displayName; - set => _displayName = Check.NotNull(value, nameof(value)); - } - private ILocalizableString _displayName; - /// - /// 通知说明 - /// - [CanBeNull] - public ILocalizableString Description { get; set; } - /// - /// 允许客户端显示订阅 - /// - public bool AllowSubscriptionToClients { get; set; } - /// - /// 存活类型 - /// - public NotificationLifetime NotificationLifetime { get; set; } - /// - /// 通知类型 - /// - public NotificationType NotificationType { get; set; } - /// - /// 通知内容类型 - /// - public NotificationContentType ContentType { get; set; } - /// - /// 通知提供者 - /// - public List Providers { get; } - /// - /// 通知模板 - /// - public TemplateDefinition Template { get; private set; } - /// - /// 额外属性 - /// - [NotNull] - public Dictionary Properties { get; } - - public object this[string name] { - get => Properties.GetOrDefault(name); - set => Properties[name] = value; - } + get => _displayName; + set => _displayName = Check.NotNull(value, nameof(value)); + } + private ILocalizableString _displayName; + /// + /// 通知说明 + /// + [CanBeNull] + public ILocalizableString Description { get; set; } + /// + /// 允许客户端显示订阅 + /// + public bool AllowSubscriptionToClients { get; set; } + /// + /// 存活类型 + /// + public NotificationLifetime NotificationLifetime { get; set; } + /// + /// 通知类型 + /// + public NotificationType NotificationType { get; set; } + /// + /// 通知内容类型 + /// + public NotificationContentType ContentType { get; set; } + /// + /// 通知提供者 + /// + public List Providers { get; } + /// + /// 通知模板 + /// + public TemplateDefinition Template { get; private set; } + /// + /// 额外属性 + /// + [NotNull] + public Dictionary Properties { get; } + + public object this[string name] { + get => Properties.GetOrDefault(name); + set => Properties[name] = value; + } + + public NotificationDefinition( + string name, + ILocalizableString displayName = null, + ILocalizableString description = null, + NotificationType notificationType = NotificationType.Application, + NotificationLifetime lifetime = NotificationLifetime.Persistent, + NotificationContentType contentType = NotificationContentType.Text, + bool allowSubscriptionToClients = false) + { + Name = name; + DisplayName = displayName ?? new FixedLocalizableString(name); + Description = description; + NotificationLifetime = lifetime; + NotificationType = notificationType; + ContentType = contentType; + AllowSubscriptionToClients = allowSubscriptionToClients; + + Providers = new List(); + Properties = new Dictionary(); + } - public NotificationDefinition( - string name, - ILocalizableString displayName = null, - ILocalizableString description = null, - NotificationType notificationType = NotificationType.Application, - NotificationLifetime lifetime = NotificationLifetime.Persistent, - NotificationContentType contentType = NotificationContentType.Text, - bool allowSubscriptionToClients = false) + public virtual NotificationDefinition WithProviders(params string[] providers) + { + if (!providers.IsNullOrEmpty()) { - Name = name; - DisplayName = displayName ?? new FixedLocalizableString(name); - Description = description; - NotificationLifetime = lifetime; - NotificationType = notificationType; - ContentType = contentType; - AllowSubscriptionToClients = allowSubscriptionToClients; - - Providers = new List(); - Properties = new Dictionary(); + Providers.AddIfNotContains(providers); } - public virtual NotificationDefinition WithProviders(params string[] providers) - { - if (!providers.IsNullOrEmpty()) - { - Providers.AddIfNotContains(providers); - } + return this; + } - return this; - } + public virtual NotificationDefinition WithTemplate( + Type localizationResource = null, + bool isLayout = false, + string layout = null, + string defaultCultureName = null) + { + Template = new TemplateDefinition( + Name, + localizationResource, + DisplayName, + isLayout, + layout, + defaultCultureName); + + return this; + } - public virtual NotificationDefinition WithTemplate( - Type localizationResource = null, - bool isLayout = false, - string layout = null, - string defaultCultureName = null) + public virtual NotificationDefinition WithTemplate(Action setup) + { + if (Template != null) { - Template = new TemplateDefinition( - Name, - localizationResource, - DisplayName, - isLayout, - layout, - defaultCultureName); - - return this; + setup(Template); } - - public virtual NotificationDefinition WithTemplate(Action setup) + else { - if (Template != null) - { - setup(Template); - } - else - { - var template = new TemplateDefinition(Name); - setup(template); - - Template = template; - } - - return this; - } + var template = new TemplateDefinition(Name); + setup(template); - public virtual NotificationDefinition WithTemplate(TemplateDefinition template) - { Template = template; - - return this; } - public virtual NotificationDefinition WithProperty(string key, object value) - { - Properties[key] = value; - return this; - } + return this; + } - public override string ToString() - { - return $"[{nameof(NotificationDefinition)} {Name}]"; - } + public virtual NotificationDefinition WithTemplate(TemplateDefinition template) + { + Template = template; + + return this; + } + + public virtual NotificationDefinition WithProperty(string key, object value) + { + Properties[key] = value; + return this; + } + + public override string ToString() + { + return $"[{nameof(NotificationDefinition)} {Name}]"; } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinitionContext.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinitionContext.cs index 52dc2dc8e..40f1f7841 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinitionContext.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinitionContext.cs @@ -3,55 +3,54 @@ using Volo.Abp; using Volo.Abp.Localization; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public class NotificationDefinitionContext : INotificationDefinitionContext { - public class NotificationDefinitionContext : INotificationDefinitionContext + internal Dictionary Groups { get; } + + public NotificationDefinitionContext() { - internal Dictionary Groups { get; } + Groups = new Dictionary(); + } - public NotificationDefinitionContext() - { - Groups = new Dictionary(); - } + public NotificationGroupDefinition AddGroup( + [NotNull] string name, + ILocalizableString displayName = null, + ILocalizableString description = null, + bool allowSubscriptionToClients = true) + { + Check.NotNull(name, nameof(name)); - public NotificationGroupDefinition AddGroup( - [NotNull] string name, - ILocalizableString displayName = null, - ILocalizableString description = null, - bool allowSubscriptionToClients = true) + if (Groups.ContainsKey(name)) { - Check.NotNull(name, nameof(name)); - - if (Groups.ContainsKey(name)) - { - throw new AbpException($"There is already an existing notification group with name: {name}"); - } - - return Groups[name] = new NotificationGroupDefinition(name, displayName, description, allowSubscriptionToClients); + throw new AbpException($"There is already an existing notification group with name: {name}"); } - public NotificationGroupDefinition GetGroupOrNull(string name) - { - Check.NotNull(name, nameof(name)); + return Groups[name] = new NotificationGroupDefinition(name, displayName, description, allowSubscriptionToClients); + } - if (!Groups.ContainsKey(name)) - { - return null; - } + public NotificationGroupDefinition GetGroupOrNull(string name) + { + Check.NotNull(name, nameof(name)); - return Groups[name]; + if (!Groups.ContainsKey(name)) + { + return null; } - public void RemoveGroup(string name) - { - Check.NotNull(name, nameof(name)); + return Groups[name]; + } - if (!Groups.ContainsKey(name)) - { - throw new AbpException($"Undefined notification group: '{name}'."); - } + public void RemoveGroup(string name) + { + Check.NotNull(name, nameof(name)); - Groups.Remove(name); + if (!Groups.ContainsKey(name)) + { + throw new AbpException($"Undefined notification group: '{name}'."); } + + Groups.Remove(name); } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinitionManager.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinitionManager.cs index dd75694e2..2eb85fbd6 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinitionManager.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinitionManager.cs @@ -5,74 +5,73 @@ using Volo.Abp; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public class NotificationDefinitionManager : INotificationDefinitionManager, ITransientDependency { - public class NotificationDefinitionManager : INotificationDefinitionManager, ITransientDependency + private readonly IStaticNotificationDefinitionStore _staticStore; + private readonly IDynamicNotificationDefinitionStore _dynamicStore; + + public NotificationDefinitionManager( + IStaticNotificationDefinitionStore staticStore, + IDynamicNotificationDefinitionStore dynamicStore) { - private readonly IStaticNotificationDefinitionStore _staticStore; - private readonly IDynamicNotificationDefinitionStore _dynamicStore; + _staticStore = staticStore; + _dynamicStore = dynamicStore; + } - public NotificationDefinitionManager( - IStaticNotificationDefinitionStore staticStore, - IDynamicNotificationDefinitionStore dynamicStore) + public async virtual Task GetAsync(string name) + { + var notification = await GetOrNullAsync(name); + if (notification == null) { - _staticStore = staticStore; - _dynamicStore = dynamicStore; + throw new AbpException("Undefined notification: " + name); } - public async virtual Task GetAsync(string name) - { - var notification = await GetOrNullAsync(name); - if (notification == null) - { - throw new AbpException("Undefined notification: " + name); - } - - return notification; - } + return notification; + } - public async virtual Task GetOrNullAsync(string name) - { - Check.NotNull(name, nameof(name)); + public async virtual Task GetOrNullAsync(string name) + { + Check.NotNull(name, nameof(name)); - return await _staticStore.GetOrNullAsync(name) ?? - await _dynamicStore.GetOrNullAsync(name); - } + return await _staticStore.GetOrNullAsync(name) ?? + await _dynamicStore.GetOrNullAsync(name); + } - public async virtual Task> GetNotificationsAsync() - { - var staticNotifications = await _staticStore.GetNotificationsAsync(); - var staticNotificationNames = staticNotifications - .Select(p => p.Name) - .ToImmutableHashSet(); + public async virtual Task> GetNotificationsAsync() + { + var staticNotifications = await _staticStore.GetNotificationsAsync(); + var staticNotificationNames = staticNotifications + .Select(p => p.Name) + .ToImmutableHashSet(); - var dynamicNotifications = await _dynamicStore.GetNotificationsAsync(); + var dynamicNotifications = await _dynamicStore.GetNotificationsAsync(); - return staticNotifications - .Concat(dynamicNotifications.Where(d => !staticNotificationNames.Contains(d.Name))) - .ToImmutableList(); - } + return staticNotifications + .Concat(dynamicNotifications.Where(d => !staticNotificationNames.Contains(d.Name))) + .ToImmutableList(); + } - public async virtual Task GetGroupOrNullAsync(string name) - { - Check.NotNull(name, nameof(name)); + public async virtual Task GetGroupOrNullAsync(string name) + { + Check.NotNull(name, nameof(name)); - return await _staticStore.GetGroupOrNullAsync(name) ?? - await _dynamicStore.GetGroupOrNullAsync(name); - } + return await _staticStore.GetGroupOrNullAsync(name) ?? + await _dynamicStore.GetGroupOrNullAsync(name); + } - public async virtual Task> GetGroupsAsync() - { - var staticGroups = await _staticStore.GetGroupsAsync(); - var staticGroupNames = staticGroups - .Select(p => p.Name) - .ToImmutableHashSet(); + public async virtual Task> GetGroupsAsync() + { + var staticGroups = await _staticStore.GetGroupsAsync(); + var staticGroupNames = staticGroups + .Select(p => p.Name) + .ToImmutableHashSet(); - var dynamicGroups = await _dynamicStore.GetGroupsAsync(); + var dynamicGroups = await _dynamicStore.GetGroupsAsync(); - return staticGroups - .Concat(dynamicGroups.Where(d => !staticGroupNames.Contains(d.Name))) - .ToImmutableList(); - } + return staticGroups + .Concat(dynamicGroups.Where(d => !staticGroupNames.Contains(d.Name))) + .ToImmutableList(); } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinitionProvider.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinitionProvider.cs index f921ae5f4..bffbdc273 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinitionProvider.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinitionProvider.cs @@ -1,9 +1,8 @@ using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public abstract class NotificationDefinitionProvider : INotificationDefinitionProvider, ITransientDependency { - public abstract class NotificationDefinitionProvider : INotificationDefinitionProvider, ITransientDependency - { - public abstract void Define(INotificationDefinitionContext context); - } + public abstract void Define(INotificationDefinitionContext context); } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationEto.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationEto.cs index 70aca56c7..c2615c23c 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationEto.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationEto.cs @@ -4,56 +4,55 @@ using Volo.Abp.EventBus; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +[Serializable] +[GenericEventName(Prefix = "abp.realtime.")] +public class NotificationEto : RealTimeEto, IMultiTenant { - [Serializable] - [GenericEventName(Prefix = "abp.realtime.")] - public class NotificationEto : RealTimeEto, IMultiTenant + /// + /// 通知标识 + /// 自动计算 + /// + public long Id { get; set; } + /// + /// 租户 + /// + public Guid? TenantId { get; set; } + /// + /// 通知名称 + /// + public string Name { get; set; } + /// + /// 创建时间 + /// + public DateTime CreationTime { get; set; } + /// + /// 紧急级别 + /// + public NotificationSeverity Severity { get; set; } + /// + /// 指定的接收用户信息集合 + /// + /// + /// 注:
+ /// 如果指定了用户列表,应该在事件订阅程序中通过此集合过滤订阅用户
+ /// 如果未指定用户列表,应该在事件订阅程序中过滤所有订阅此通知的用户 + ///
+ public List Users { get; set; } = new List(); + /// + /// 用户指定通知提供程序列表 + /// + /// + /// 注:
+ /// 如果指定了通知提供程序,将只使用特定的提供程序发布通知 + ///
+ public List UseProviders { get; set; } = new List(); + public NotificationEto() : base() { - /// - /// 通知标识 - /// 自动计算 - /// - public long Id { get; set; } - /// - /// 租户 - /// - public Guid? TenantId { get; set; } - /// - /// 通知名称 - /// - public string Name { get; set; } - /// - /// 创建时间 - /// - public DateTime CreationTime { get; set; } - /// - /// 紧急级别 - /// - public NotificationSeverity Severity { get; set; } - /// - /// 指定的接收用户信息集合 - /// - /// - /// 注:
- /// 如果指定了用户列表,应该在事件订阅程序中通过此集合过滤订阅用户
- /// 如果未指定用户列表,应该在事件订阅程序中过滤所有订阅此通知的用户 - ///
- public List Users { get; set; } = new List(); - /// - /// 用户指定通知提供程序列表 - /// - /// - /// 注:
- /// 如果指定了通知提供程序,将只使用特定的提供程序发布通知 - ///
- public List UseProviders { get; set; } = new List(); - public NotificationEto() : base() - { - } + } - public NotificationEto(T data) : base(data) - { - } + public NotificationEto(T data) : base(data) + { } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationEventData.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationEventData.cs index 6db27fd5a..b6ab48749 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationEventData.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationEventData.cs @@ -2,51 +2,50 @@ using System.Collections.Generic; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public class NotificationEventData : IMultiTenant { - public class NotificationEventData : IMultiTenant + /// + /// 租户 + /// + public Guid? TenantId { get; set; } + /// + /// 通知名称 + /// + public string Name { get; set; } + /// + /// 用来标识一个应用程序 + /// + /// + /// tips: 可以通过它来特定于应用程序的边界 + /// + public string Application { get; set; } + /// + /// 数据 + /// + public NotificationData Data { get; set; } + /// + /// 创建时间 + /// + public DateTime CreationTime { get; set; } + /// + /// 紧急级别 + /// + public NotificationSeverity Severity { get; set; } + /// + /// 指定的接收用户信息集合 + /// + /// + /// 注:
+ /// 如果指定了用户列表,应该在事件订阅程序中通过此集合过滤订阅用户
+ /// 如果未指定用户列表,应该在事件订阅程序中过滤所有订阅此通知的用户 + ///
+ public List Users { get; set; } + public NotificationEventData() { - /// - /// 租户 - /// - public Guid? TenantId { get; set; } - /// - /// 通知名称 - /// - public string Name { get; set; } - /// - /// 用来标识一个应用程序 - /// - /// - /// tips: 可以通过它来特定于应用程序的边界 - /// - public string Application { get; set; } - /// - /// 数据 - /// - public NotificationData Data { get; set; } - /// - /// 创建时间 - /// - public DateTime CreationTime { get; set; } - /// - /// 紧急级别 - /// - public NotificationSeverity Severity { get; set; } - /// - /// 指定的接收用户信息集合 - /// - /// - /// 注:
- /// 如果指定了用户列表,应该在事件订阅程序中通过此集合过滤订阅用户
- /// 如果未指定用户列表,应该在事件订阅程序中过滤所有订阅此通知的用户 - ///
- public List Users { get; set; } - public NotificationEventData() - { - Application = "Abp"; + Application = "Abp"; - Users = new List(); - } + Users = new List(); } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationGroupDefinition.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationGroupDefinition.cs index 013993c3e..18fcfe906 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationGroupDefinition.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationGroupDefinition.cs @@ -5,95 +5,94 @@ using Volo.Abp; using Volo.Abp.Localization; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public class NotificationGroupDefinition { - public class NotificationGroupDefinition + /// + /// 通知组名称 + /// + [NotNull] + public string Name { get; set; } + /// + /// 通知组显示名称 + /// + [NotNull] + public ILocalizableString DisplayName { - /// - /// 通知组名称 - /// - [NotNull] - public string Name { get; set; } - /// - /// 通知组显示名称 - /// - [NotNull] - public ILocalizableString DisplayName - { - get => _displayName; - set => _displayName = Check.NotNull(value, nameof(value)); - } - private ILocalizableString _displayName; - /// - /// 通知组说明 - /// - [CanBeNull] - public ILocalizableString Description { get; set; } - public bool AllowSubscriptionToClients { get; set; } - public IReadOnlyList Notifications => _notifications.ToImmutableList(); - private readonly List _notifications; + get => _displayName; + set => _displayName = Check.NotNull(value, nameof(value)); + } + private ILocalizableString _displayName; + /// + /// 通知组说明 + /// + [CanBeNull] + public ILocalizableString Description { get; set; } + public bool AllowSubscriptionToClients { get; set; } + public IReadOnlyList Notifications => _notifications.ToImmutableList(); + private readonly List _notifications; - public Dictionary Properties { get; } + public Dictionary Properties { get; } - public object this[string name] { - get => Properties.GetOrDefault(name); - set => Properties[name] = value; - } + public object this[string name] { + get => Properties.GetOrDefault(name); + set => Properties[name] = value; + } - public static NotificationGroupDefinition Create( - string name, - ILocalizableString displayName = null, - ILocalizableString description = null, - bool allowSubscriptionToClients = false) - { - return new NotificationGroupDefinition(name, displayName, description, allowSubscriptionToClients); - } + public static NotificationGroupDefinition Create( + string name, + ILocalizableString displayName = null, + ILocalizableString description = null, + bool allowSubscriptionToClients = false) + { + return new NotificationGroupDefinition(name, displayName, description, allowSubscriptionToClients); + } - protected internal NotificationGroupDefinition( - string name, - ILocalizableString displayName = null, - ILocalizableString description = null, - bool allowSubscriptionToClients = false) - { - Name = name; - DisplayName = displayName ?? new FixedLocalizableString(Name); - Description = description; - AllowSubscriptionToClients = allowSubscriptionToClients; + protected internal NotificationGroupDefinition( + string name, + ILocalizableString displayName = null, + ILocalizableString description = null, + bool allowSubscriptionToClients = false) + { + Name = name; + DisplayName = displayName ?? new FixedLocalizableString(Name); + Description = description; + AllowSubscriptionToClients = allowSubscriptionToClients; - _notifications = new List(); + _notifications = new List(); - Properties = new Dictionary(); - } + Properties = new Dictionary(); + } - public virtual NotificationDefinition AddNotification( - string name, - ILocalizableString displayName = null, - ILocalizableString description = null, - NotificationType notificationType = NotificationType.Application, - NotificationLifetime lifetime = NotificationLifetime.Persistent, - NotificationContentType contentType = NotificationContentType.Text, - bool allowSubscriptionToClients = false) - { - var notification = new NotificationDefinition( - name, - displayName, - description, - notificationType, - lifetime, - contentType, - allowSubscriptionToClients - ); + public virtual NotificationDefinition AddNotification( + string name, + ILocalizableString displayName = null, + ILocalizableString description = null, + NotificationType notificationType = NotificationType.Application, + NotificationLifetime lifetime = NotificationLifetime.Persistent, + NotificationContentType contentType = NotificationContentType.Text, + bool allowSubscriptionToClients = false) + { + var notification = new NotificationDefinition( + name, + displayName, + description, + notificationType, + lifetime, + contentType, + allowSubscriptionToClients + ); - _notifications.Add(notification); + _notifications.Add(notification); - return notification; - } + return notification; + } - public NotificationDefinition GetNotificationOrNull([NotNull] string name) - { - Check.NotNull(name, nameof(name)); + public NotificationDefinition GetNotificationOrNull([NotNull] string name) + { + Check.NotNull(name, nameof(name)); - return _notifications.FirstOrDefault(x => x.Name == name); - } + return _notifications.FirstOrDefault(x => x.Name == name); } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationInfo.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationInfo.cs index 3ad1a33e5..86df68f40 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationInfo.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationInfo.cs @@ -1,40 +1,39 @@ using System; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public class NotificationInfo { - public class NotificationInfo + public Guid? TenantId { get; set; } + public string Name { get; set; } + public string Id { get; set; } + public NotificationData Data { get; set; } + public DateTime CreationTime { get; set; } + public NotificationLifetime Lifetime { get; set; } + public NotificationType Type { get; set; } + public NotificationContentType ContentType { get; set; } + public NotificationSeverity Severity { get; set; } + public NotificationInfo() { - public Guid? TenantId { get; set; } - public string Name { get; set; } - public string Id { get; set; } - public NotificationData Data { get; set; } - public DateTime CreationTime { get; set; } - public NotificationLifetime Lifetime { get; set; } - public NotificationType Type { get; set; } - public NotificationContentType ContentType { get; set; } - public NotificationSeverity Severity { get; set; } - public NotificationInfo() - { - Data = new NotificationData(); - Lifetime = NotificationLifetime.Persistent; - Type = NotificationType.Application; - ContentType = NotificationContentType.Text; - Severity = NotificationSeverity.Info; + Data = new NotificationData(); + Lifetime = NotificationLifetime.Persistent; + Type = NotificationType.Application; + ContentType = NotificationContentType.Text; + Severity = NotificationSeverity.Info; - CreationTime = DateTime.Now; - } + CreationTime = DateTime.Now; + } - public void SetId(long id) + public void SetId(long id) + { + if (Id.IsNullOrWhiteSpace()) { - if (Id.IsNullOrWhiteSpace()) - { - Id = id.ToString(); - } + Id = id.ToString(); } + } - public long GetId() - { - return long.Parse(Id); - } + public long GetId() + { + return long.Parse(Id); } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationLifetime.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationLifetime.cs index 6127ca0f1..832dad263 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationLifetime.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationLifetime.cs @@ -1,18 +1,17 @@ -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +/// +/// 通知存活时间 +/// 发送之后取消用户订阅,类似于微信小程序 +/// +public enum NotificationLifetime { /// - /// 通知存活时间 - /// 发送之后取消用户订阅,类似于微信小程序 + /// 持久化 /// - public enum NotificationLifetime - { - /// - /// 持久化 - /// - Persistent = 0, - /// - /// 一次性 - /// - OnlyOne = 1 - } + Persistent = 0, + /// + /// 一次性 + /// + OnlyOne = 1 } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationReadState.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationReadState.cs index b1319e865..cb3f4caa6 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationReadState.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationReadState.cs @@ -1,17 +1,16 @@ -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +/// +/// 读取状态 +/// +public enum NotificationReadState { /// - /// 读取状态 + /// 已读 /// - public enum NotificationReadState - { - /// - /// 已读 - /// - Read = 0, - /// - /// 未读 - /// - UnRead = 1 - } + Read = 0, + /// + /// 未读 + /// + UnRead = 1 } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationSeverity.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationSeverity.cs index 0b13ccfb4..f0405485b 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationSeverity.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationSeverity.cs @@ -1,29 +1,28 @@ -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +/// +/// 严重级别 +/// +public enum NotificationSeverity : sbyte { /// - /// 严重级别 + /// 成功 /// - public enum NotificationSeverity : sbyte - { - /// - /// 成功 - /// - Success = 0, - /// - /// 信息 - /// - Info = 10, - /// - /// 警告 - /// - Warn = 20, - /// - /// 错误 - /// - Error = 30, - /// - /// 致命错误 - /// - Fatal = 40 - } + Success = 0, + /// + /// 信息 + /// + Info = 10, + /// + /// 警告 + /// + Warn = 20, + /// + /// 错误 + /// + Error = 30, + /// + /// 致命错误 + /// + Fatal = 40 } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationSubscriptionInfo.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationSubscriptionInfo.cs index b4bcb5f79..9c9fbf425 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationSubscriptionInfo.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationSubscriptionInfo.cs @@ -1,12 +1,11 @@ using System; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public class NotificationSubscriptionInfo { - public class NotificationSubscriptionInfo - { - public Guid? TenantId { get; set; } - public Guid UserId { get; set; } - public string UserName { get; set; } - public string NotificationName { get; set; } - } + public Guid? TenantId { get; set; } + public Guid UserId { get; set; } + public string UserName { get; set; } + public string NotificationName { get; set; } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationType.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationType.cs index 65366b681..0e476f421 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationType.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationType.cs @@ -1,25 +1,24 @@ -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +/// +/// 通知类型 +/// +public enum NotificationType { /// - /// 通知类型 + /// 应用(仅对当前租户) /// - public enum NotificationType - { - /// - /// 应用(仅对当前租户) - /// - Application = 0, - /// - /// 系统通知(全局发布) - /// - System = 10, - /// - /// 用户(对应用户,受租户控制) - /// - User = 20, - /// - /// 服务端回调,用户不应进行处理 - /// - ServiceCallback = 30, - } + Application = 0, + /// + /// 系统通知(全局发布) + /// + System = 10, + /// + /// 用户(对应用户,受租户控制) + /// + User = 20, + /// + /// 服务端回调,用户不应进行处理 + /// + ServiceCallback = 30, } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/UserIdentifier.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/UserIdentifier.cs index c41edecfa..dda4b9a92 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/UserIdentifier.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/UserIdentifier.cs @@ -1,30 +1,29 @@ using System; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +/// +/// 用户信息 +/// +public class UserIdentifier { /// - /// 用户信息 + /// 用户标识 /// - public class UserIdentifier - { - /// - /// 用户标识 - /// - public Guid UserId { get; set; } - /// - /// 用户名 - /// - public string UserName { get; set; } + public Guid UserId { get; set; } + /// + /// 用户名 + /// + public string UserName { get; set; } - public UserIdentifier() - { + public UserIdentifier() + { - } + } - public UserIdentifier(Guid userId, string userName) - { - UserId = userId; - UserName = userName; - } + public UserIdentifier(Guid userId, string userName) + { + UserId = userId; + UserName = userName; } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN.Abp.Notifications.Domain.Shared.csproj b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN.Abp.Notifications.Domain.Shared.csproj index 1d1c3e4b9..dabaede29 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN.Abp.Notifications.Domain.Shared.csproj +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN.Abp.Notifications.Domain.Shared.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Notifications.Domain.Shared + LINGYUN.Abp.Notifications.Domain.Shared + false + false + false diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/NotificationConsts.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/NotificationConsts.cs index 9d379fcfc..277e5934e 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/NotificationConsts.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/NotificationConsts.cs @@ -1,13 +1,12 @@ -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public class NotificationConsts { - public class NotificationConsts - { - public const int MaxCateGoryLength = 50; + public const int MaxCateGoryLength = 50; - public const int MaxNameLength = 255; + public const int MaxNameLength = 255; - public const int MaxDataLength = 1024 * 1024; + public const int MaxDataLength = 1024 * 1024; - public const int MaxTypeNameLength = 512; - } + public const int MaxTypeNameLength = 512; } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/NotificationsErrorCodes.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/NotificationsErrorCodes.cs index 2b77f9701..b3d074a2a 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/NotificationsErrorCodes.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/NotificationsErrorCodes.cs @@ -1,59 +1,58 @@ -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +/// +/// 消息系统错误码设计 +/// 状态码分为两部分 前2位领域 后3位状态 +///
+/// 领域部分: +/// +/// 000-019 输入 +/// 020-029 群组 +/// 030-039 用户 +/// 040-049 应用 +/// 050-059 内部 +/// 100-199 输出 +/// +/// +/// 状态部分: +/// +/// 200-299 成功 +/// 300-399 成功但有后续操作 +/// 400-499 业务异常 +/// 500-599 内部异常 +/// 900-999 输入输出异常 +/// +/// +///
+public class NotificationsErrorCodes { + public const string Namespace = "Notifications"; /// - /// 消息系统错误码设计 - /// 状态码分为两部分 前2位领域 后3位状态 - ///
- /// 领域部分: - /// - /// 000-019 输入 - /// 020-029 群组 - /// 030-039 用户 - /// 040-049 应用 - /// 050-059 内部 - /// 100-199 输出 - /// - /// - /// 状态部分: - /// - /// 200-299 成功 - /// 300-399 成功但有后续操作 - /// 400-499 业务异常 - /// 500-599 内部异常 - /// 900-999 输入输出异常 - /// - /// + /// 通知模板不存在! ///
- public class NotificationsErrorCodes - { - public const string Namespace = "Notifications"; - /// - /// 通知模板不存在! - /// - public const string NotificationTemplateNotFound = Namespace + ":001404"; + public const string NotificationTemplateNotFound = Namespace + ":001404"; - public static class GroupDefinition - { - private const string Prefix = Namespace + ":002"; + public static class GroupDefinition + { + private const string Prefix = Namespace + ":002"; - public const string StaticGroupNotAllowedChanged = Prefix + "400"; + public const string StaticGroupNotAllowedChanged = Prefix + "400"; - public const string AlreayNameExists = Prefix + "403"; + public const string AlreayNameExists = Prefix + "403"; - public const string NameNotFount = Prefix + "404"; - } + public const string NameNotFount = Prefix + "404"; + } - public static class Definition - { - private const string Prefix = Namespace + ":003"; + public static class Definition + { + private const string Prefix = Namespace + ":003"; - public const string StaticFeatureNotAllowedChanged = Prefix + "400"; + public const string StaticFeatureNotAllowedChanged = Prefix + "400"; - public const string FailedGetGroup = Prefix + "401"; + public const string FailedGetGroup = Prefix + "401"; - public const string AlreayNameExists = Prefix + "403"; + public const string AlreayNameExists = Prefix + "403"; - public const string NameNotFount = Prefix + "404"; - } + public const string NameNotFount = Prefix + "404"; } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/SubscribeConsts.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/SubscribeConsts.cs index a596c4322..739ccd555 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/SubscribeConsts.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain.Shared/LINGYUN/Abp/Notifications/SubscribeConsts.cs @@ -1,9 +1,8 @@ -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public class SubscribeConsts { - public class SubscribeConsts - { - public static int MaxNotificationNameLength { get; set; } = NotificationConsts.MaxNameLength; + public static int MaxNotificationNameLength { get; set; } = NotificationConsts.MaxNameLength; - public static int MaxUserNameLength { get; set; } = 128; - } + public static int MaxUserNameLength { get; set; } = 128; } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN.Abp.Notifications.Domain.csproj b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN.Abp.Notifications.Domain.csproj index 7cdff4896..69adeda64 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN.Abp.Notifications.Domain.csproj +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN.Abp.Notifications.Domain.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.Notifications.Domain + LINGYUN.Abp.Notifications.Domain + false + false + false diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/AbpNotificationNames.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/AbpNotificationNames.cs index e18313861..d78751ac9 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/AbpNotificationNames.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/AbpNotificationNames.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public static class AbpNotificationNames { - public static class AbpNotificationNames - { - public const string GroupName = "LINGYUN.Abp.Notifications"; - } + public const string GroupName = "LINGYUN.Abp.Notifications"; } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/AbpNotificationsDbProperties.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/AbpNotificationsDbProperties.cs index 0fee22aea..b93beb280 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/AbpNotificationsDbProperties.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/AbpNotificationsDbProperties.cs @@ -1,11 +1,10 @@ -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public class AbpNotificationsDbProperties { - public class AbpNotificationsDbProperties - { - public const string DefaultTablePrefix = "App"; + public const string DefaultTablePrefix = "App"; - public const string DefaultSchema = null; + public const string DefaultSchema = null; - public const string ConnectionStringName = "Notifications"; - } + public const string ConnectionStringName = "Notifications"; } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/AbpNotificationsDomainAutoMapperProfile.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/AbpNotificationsDomainAutoMapperProfile.cs index ab17be6ee..fedff66b7 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/AbpNotificationsDomainAutoMapperProfile.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/AbpNotificationsDomainAutoMapperProfile.cs @@ -1,53 +1,52 @@ using AutoMapper; using System; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public class AbpNotificationsDomainAutoMapperProfile : Profile { - public class AbpNotificationsDomainAutoMapperProfile : Profile + public AbpNotificationsDomainAutoMapperProfile() { - public AbpNotificationsDomainAutoMapperProfile() - { - CreateMap() - .ForMember(dto => dto.Id, map => map.MapFrom(src => src.NotificationId.ToString())) - .ForMember(dto => dto.Name, map => map.MapFrom(src => src.NotificationName)) - .ForMember(dto => dto.Lifetime, map => map.Ignore()) - .ForMember(dto => dto.Type, map => map.MapFrom(src => src.Type)) - .ForMember(dto => dto.ContentType, map => map.MapFrom(src => src.ContentType)) - .ForMember(dto => dto.Severity, map => map.MapFrom(src => src.Severity)) - .ForMember(dto => dto.CreationTime, map => map.MapFrom(src => src.CreationTime)) - .ForMember(dto => dto.Data, map => map.MapFrom((src, nfi) => + CreateMap() + .ForMember(dto => dto.Id, map => map.MapFrom(src => src.NotificationId.ToString())) + .ForMember(dto => dto.Name, map => map.MapFrom(src => src.NotificationName)) + .ForMember(dto => dto.Lifetime, map => map.Ignore()) + .ForMember(dto => dto.Type, map => map.MapFrom(src => src.Type)) + .ForMember(dto => dto.ContentType, map => map.MapFrom(src => src.ContentType)) + .ForMember(dto => dto.Severity, map => map.MapFrom(src => src.Severity)) + .ForMember(dto => dto.CreationTime, map => map.MapFrom(src => src.CreationTime)) + .ForMember(dto => dto.Data, map => map.MapFrom((src, nfi) => + { + var dataType = Type.GetType(src.NotificationTypeName); + var data = Activator.CreateInstance(dataType); + if (data is NotificationData notificationData) { - var dataType = Type.GetType(src.NotificationTypeName); - var data = Activator.CreateInstance(dataType); - if (data is NotificationData notificationData) - { - notificationData.ExtraProperties = src.ExtraProperties; - return notificationData; - } - return new NotificationData(); - })); + notificationData.ExtraProperties = src.ExtraProperties; + return notificationData; + } + return new NotificationData(); + })); - CreateMap() - .ForMember(dto => dto.Id, map => map.MapFrom(src => src.Id.ToString())) - .ForMember(dto => dto.Name, map => map.MapFrom(src => src.Name)) - .ForMember(dto => dto.Lifetime, map => map.Ignore()) - .ForMember(dto => dto.Type, map => map.MapFrom(src => src.Type)) - .ForMember(dto => dto.ContentType, map => map.MapFrom(src => src.ContentType)) - .ForMember(dto => dto.Severity, map => map.MapFrom(src => src.Severity)) - .ForMember(dto => dto.CreationTime, map => map.MapFrom(src => src.CreationTime)) - .ForMember(dto => dto.Data, map => map.MapFrom((src, nfi) => + CreateMap() + .ForMember(dto => dto.Id, map => map.MapFrom(src => src.Id.ToString())) + .ForMember(dto => dto.Name, map => map.MapFrom(src => src.Name)) + .ForMember(dto => dto.Lifetime, map => map.Ignore()) + .ForMember(dto => dto.Type, map => map.MapFrom(src => src.Type)) + .ForMember(dto => dto.ContentType, map => map.MapFrom(src => src.ContentType)) + .ForMember(dto => dto.Severity, map => map.MapFrom(src => src.Severity)) + .ForMember(dto => dto.CreationTime, map => map.MapFrom(src => src.CreationTime)) + .ForMember(dto => dto.Data, map => map.MapFrom((src, nfi) => + { + var dataType = Type.GetType(src.NotificationTypeName); + var data = Activator.CreateInstance(dataType); + if (data is NotificationData notificationData) { - var dataType = Type.GetType(src.NotificationTypeName); - var data = Activator.CreateInstance(dataType); - if (data is NotificationData notificationData) - { - notificationData.ExtraProperties = src.ExtraProperties; - return notificationData; - } - return new NotificationData(); - })); + notificationData.ExtraProperties = src.ExtraProperties; + return notificationData; + } + return new NotificationData(); + })); - CreateMap(); - } + CreateMap(); } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/INotificationRepository.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/INotificationRepository.cs index 8b22d0fd8..7d318c6db 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/INotificationRepository.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/INotificationRepository.cs @@ -3,16 +3,15 @@ using System.Threading.Tasks; using Volo.Abp.Domain.Repositories; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public interface INotificationRepository : IBasicRepository { - public interface INotificationRepository : IBasicRepository - { - Task GetByIdAsync( - long notificationId, - CancellationToken cancellationToken = default); + Task GetByIdAsync( + long notificationId, + CancellationToken cancellationToken = default); - Task> GetExpritionAsync( - int batchCount, - CancellationToken cancellationToken = default); - } + Task> GetExpritionAsync( + int batchCount, + CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/IUserNotificationRepository.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/IUserNotificationRepository.cs index 0c00a1fe9..18bfb256e 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/IUserNotificationRepository.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/IUserNotificationRepository.cs @@ -4,44 +4,43 @@ using System.Threading.Tasks; using Volo.Abp.Domain.Repositories; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public interface IUserNotificationRepository : IBasicRepository { - public interface IUserNotificationRepository : IBasicRepository - { - Task AnyAsync( - Guid userId, - long notificationId, - CancellationToken cancellationToken = default); + Task AnyAsync( + Guid userId, + long notificationId, + CancellationToken cancellationToken = default); - Task GetByIdAsync( - Guid userId, - long notificationId, - CancellationToken cancellationToken = default); + Task GetByIdAsync( + Guid userId, + long notificationId, + CancellationToken cancellationToken = default); - Task> GetListAsync( - Guid userId, - IEnumerable notificationIds, - CancellationToken cancellationToken = default); + Task> GetListAsync( + Guid userId, + IEnumerable notificationIds, + CancellationToken cancellationToken = default); - Task> GetNotificationsAsync( - Guid userId, - NotificationReadState? readState = null, - int maxResultCount = 10, - CancellationToken cancellationToken = default); + Task> GetNotificationsAsync( + Guid userId, + NotificationReadState? readState = null, + int maxResultCount = 10, + CancellationToken cancellationToken = default); - Task GetCountAsync( - Guid userId, - string filter = "", - NotificationReadState? readState = null, - CancellationToken cancellationToken = default); + Task GetCountAsync( + Guid userId, + string filter = "", + NotificationReadState? readState = null, + CancellationToken cancellationToken = default); - Task> GetListAsync( - Guid userId, - string filter = "", - string sorting = nameof(Notification.CreationTime), - NotificationReadState? readState = null, - int skipCount = 0, - int maxResultCount = 10, - CancellationToken cancellationToken = default); - } + Task> GetListAsync( + Guid userId, + string filter = "", + string sorting = nameof(Notification.CreationTime), + NotificationReadState? readState = null, + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/IUserSubscribeRepository.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/IUserSubscribeRepository.cs index 570abf531..8063b179c 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/IUserSubscribeRepository.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/IUserSubscribeRepository.cs @@ -4,63 +4,62 @@ using System.Threading.Tasks; using Volo.Abp.Domain.Repositories; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public interface IUserSubscribeRepository : IBasicRepository { - public interface IUserSubscribeRepository : IBasicRepository - { - Task UserSubscribeExistsAysnc( - string notificationName, - Guid userId, - CancellationToken cancellationToken = default); + Task UserSubscribeExistsAysnc( + string notificationName, + Guid userId, + CancellationToken cancellationToken = default); - Task GetUserSubscribeAsync( - string notificationName, - Guid userId, - CancellationToken cancellationToken = default); + Task GetUserSubscribeAsync( + string notificationName, + Guid userId, + CancellationToken cancellationToken = default); - Task> GetUserSubscribesAsync( - string notificationName, - IEnumerable userIds = null, - CancellationToken cancellationToken = default); + Task> GetUserSubscribesAsync( + string notificationName, + IEnumerable userIds = null, + CancellationToken cancellationToken = default); - Task> GetUserSubscribesAsync( - Guid userId, - CancellationToken cancellationToken = default); + Task> GetUserSubscribesAsync( + Guid userId, + CancellationToken cancellationToken = default); - Task> GetUserSubscribesByNameAsync( - string userName, - CancellationToken cancellationToken = default); + Task> GetUserSubscribesByNameAsync( + string userName, + CancellationToken cancellationToken = default); - Task> GetUserSubscribesAsync( - string notificationName, - CancellationToken cancellationToken = default); + Task> GetUserSubscribesAsync( + string notificationName, + CancellationToken cancellationToken = default); - Task InsertUserSubscriptionAsync( - IEnumerable userSubscribes, - CancellationToken cancellationToken = default); + Task InsertUserSubscriptionAsync( + IEnumerable userSubscribes, + CancellationToken cancellationToken = default); - Task DeleteUserSubscriptionAsync( - IEnumerable userSubscribes, - CancellationToken cancellationToken = default); + Task DeleteUserSubscriptionAsync( + IEnumerable userSubscribes, + CancellationToken cancellationToken = default); - Task DeleteUserSubscriptionAsync( - string notificationName, - IEnumerable userIds, - CancellationToken cancellationToken = default); + Task DeleteUserSubscriptionAsync( + string notificationName, + IEnumerable userIds, + CancellationToken cancellationToken = default); - Task DeleteUserSubscriptionAsync( - string notificationName, - CancellationToken cancellationToken = default); + Task DeleteUserSubscriptionAsync( + string notificationName, + CancellationToken cancellationToken = default); - Task> GetUserSubscribesAsync( - Guid userId, - string sorting = nameof(UserSubscribe.Id), - int skipCount = 1, - int maxResultCount = 10, - CancellationToken cancellationToken = default); + Task> GetUserSubscribesAsync( + Guid userId, + string sorting = nameof(UserSubscribe.Id), + int skipCount = 1, + int maxResultCount = 10, + CancellationToken cancellationToken = default); - Task GetCountAsync( - Guid userId, - CancellationToken cancellationToken = default); - } + Task GetCountAsync( + Guid userId, + CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/Notification.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/Notification.cs index 253addbb1..3d8b6b6ba 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/Notification.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/Notification.cs @@ -4,57 +4,56 @@ using Volo.Abp.Domain.Entities; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public class Notification : Entity, IMultiTenant, IHasCreationTime, IHasExtraProperties { - public class Notification : Entity, IMultiTenant, IHasCreationTime, IHasExtraProperties - { - public virtual Guid? TenantId { get; protected set; } - public virtual NotificationSeverity Severity { get; protected set; } - public virtual NotificationType Type { get; set; } - public virtual NotificationContentType ContentType { get; set; } - public virtual long NotificationId { get; protected set; } - public virtual string NotificationName { get; protected set; } - public virtual string NotificationTypeName { get; protected set; } - public virtual DateTime? ExpirationTime { get; set; } - public virtual DateTime CreationTime { get; set; } - public virtual ExtraPropertyDictionary ExtraProperties { get; protected set; } + public virtual Guid? TenantId { get; protected set; } + public virtual NotificationSeverity Severity { get; protected set; } + public virtual NotificationType Type { get; set; } + public virtual NotificationContentType ContentType { get; set; } + public virtual long NotificationId { get; protected set; } + public virtual string NotificationName { get; protected set; } + public virtual string NotificationTypeName { get; protected set; } + public virtual DateTime? ExpirationTime { get; set; } + public virtual DateTime CreationTime { get; set; } + public virtual ExtraPropertyDictionary ExtraProperties { get; protected set; } - protected Notification() - { - ExtraProperties = new ExtraPropertyDictionary(); - this.SetDefaultsForExtraProperties(); - } + protected Notification() + { + ExtraProperties = new ExtraPropertyDictionary(); + this.SetDefaultsForExtraProperties(); + } - public Notification(long id) : this() - { - Id = id; - } + public Notification(long id) : this() + { + Id = id; + } - public Notification( - long id, - string name, - string dataType, - NotificationData data, - NotificationSeverity severity = NotificationSeverity.Info, - Guid? tenantId = null) : this() - { - NotificationId = id; - Severity = severity; - NotificationName = name; - NotificationTypeName = dataType; - Type = NotificationType.Application; - ContentType = NotificationContentType.Text; - TenantId = tenantId; + public Notification( + long id, + string name, + string dataType, + NotificationData data, + NotificationSeverity severity = NotificationSeverity.Info, + Guid? tenantId = null) : this() + { + NotificationId = id; + Severity = severity; + NotificationName = name; + NotificationTypeName = dataType; + Type = NotificationType.Application; + ContentType = NotificationContentType.Text; + TenantId = tenantId; - SetData(data); - } + SetData(data); + } - public void SetData(NotificationData data) + public void SetData(NotificationData data) + { + foreach (var property in data.ExtraProperties) { - foreach (var property in data.ExtraProperties) - { - this.SetProperty(property.Key, property.Value); - } + this.SetProperty(property.Key, property.Value); } } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationStore.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationStore.cs index bae38ffeb..a00dd76ce 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationStore.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/NotificationStore.cs @@ -11,429 +11,428 @@ using Volo.Abp.Timing; using Volo.Abp.Uow; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +[Dependency(ServiceLifetime.Transient, ReplaceServices = true)] +[ExposeServices(typeof(INotificationStore))] +public class NotificationStore : INotificationStore { - [Dependency(ServiceLifetime.Transient, ReplaceServices = true)] - [ExposeServices(typeof(INotificationStore))] - public class NotificationStore : INotificationStore - { - private readonly IClock _clock; + private readonly IClock _clock; - private readonly IObjectMapper _objectMapper; + private readonly IObjectMapper _objectMapper; - private readonly ICurrentTenant _currentTenant; + private readonly ICurrentTenant _currentTenant; - private readonly IUnitOfWorkManager _unitOfWorkManager; + private readonly IUnitOfWorkManager _unitOfWorkManager; - private readonly INotificationRepository _notificationRepository; + private readonly INotificationRepository _notificationRepository; - private readonly IUserNotificationRepository _userNotificationRepository; + private readonly IUserNotificationRepository _userNotificationRepository; - private readonly IUserSubscribeRepository _userSubscribeRepository; + private readonly IUserSubscribeRepository _userSubscribeRepository; - private readonly AbpNotificationsPublishOptions _options; + private readonly AbpNotificationsPublishOptions _options; - public NotificationStore( - IClock clock, - IObjectMapper objectMapper, - ICurrentTenant currentTenant, - IUnitOfWorkManager unitOfWorkManager, - INotificationRepository notificationRepository, - IUserSubscribeRepository userSubscribeRepository, - IUserNotificationRepository userNotificationRepository, - IOptions options - ) - { - _clock = clock; - _objectMapper = objectMapper; - _currentTenant = currentTenant; - _unitOfWorkManager = unitOfWorkManager; - _notificationRepository = notificationRepository; - _userSubscribeRepository = userSubscribeRepository; - _userNotificationRepository = userNotificationRepository; - - _options = options.Value; - } + public NotificationStore( + IClock clock, + IObjectMapper objectMapper, + ICurrentTenant currentTenant, + IUnitOfWorkManager unitOfWorkManager, + INotificationRepository notificationRepository, + IUserSubscribeRepository userSubscribeRepository, + IUserNotificationRepository userNotificationRepository, + IOptions options + ) + { + _clock = clock; + _objectMapper = objectMapper; + _currentTenant = currentTenant; + _unitOfWorkManager = unitOfWorkManager; + _notificationRepository = notificationRepository; + _userSubscribeRepository = userSubscribeRepository; + _userNotificationRepository = userNotificationRepository; + + _options = options.Value; + } - public async virtual Task ChangeUserNotificationReadStateAsync( - Guid? tenantId, - Guid userId, - long notificationId, - NotificationReadState readState, - CancellationToken cancellationToken = default) - { - await ChangeUserNotificationsReadStateAsync( - tenantId, userId, new long[] { notificationId }, readState, cancellationToken); - } + public async virtual Task ChangeUserNotificationReadStateAsync( + Guid? tenantId, + Guid userId, + long notificationId, + NotificationReadState readState, + CancellationToken cancellationToken = default) + { + await ChangeUserNotificationsReadStateAsync( + tenantId, userId, new long[] { notificationId }, readState, cancellationToken); + } - public async virtual Task ChangeUserNotificationsReadStateAsync( - Guid? tenantId, - Guid userId, - IEnumerable notificationIds, - NotificationReadState readState, - CancellationToken cancellationToken = default) + public async virtual Task ChangeUserNotificationsReadStateAsync( + Guid? tenantId, + Guid userId, + IEnumerable notificationIds, + NotificationReadState readState, + CancellationToken cancellationToken = default) + { + using (var unitOfWork = _unitOfWorkManager.Begin()) + using (_currentTenant.Change(tenantId)) { - using (var unitOfWork = _unitOfWorkManager.Begin()) - using (_currentTenant.Change(tenantId)) + var notifications = await _userNotificationRepository.GetListAsync(userId, notificationIds); + if (notifications.Any()) { - var notifications = await _userNotificationRepository.GetListAsync(userId, notificationIds); - if (notifications.Any()) - { - notifications.ForEach(notification => notification.ChangeReadState(readState)); + notifications.ForEach(notification => notification.ChangeReadState(readState)); - await _userNotificationRepository.UpdateManyAsync(notifications); + await _userNotificationRepository.UpdateManyAsync(notifications); - await unitOfWork.CompleteAsync(); - } + await unitOfWork.CompleteAsync(); } } + } - public async virtual Task DeleteNotificationAsync( - NotificationInfo notification, - CancellationToken cancellationToken = default) + public async virtual Task DeleteNotificationAsync( + NotificationInfo notification, + CancellationToken cancellationToken = default) + { + using (var unitOfWork = _unitOfWorkManager.Begin()) + using (_currentTenant.Change(notification.TenantId)) { - using (var unitOfWork = _unitOfWorkManager.Begin()) - using (_currentTenant.Change(notification.TenantId)) - { - var notify = await _notificationRepository.GetByIdAsync(notification.GetId(), cancellationToken); - await _notificationRepository.DeleteAsync(notify.Id, cancellationToken: cancellationToken); + var notify = await _notificationRepository.GetByIdAsync(notification.GetId(), cancellationToken); + await _notificationRepository.DeleteAsync(notify.Id, cancellationToken: cancellationToken); - await unitOfWork.CompleteAsync(cancellationToken); - } + await unitOfWork.CompleteAsync(cancellationToken); } + } - public async virtual Task DeleteNotificationAsync( - int batchCount, - CancellationToken cancellationToken = default) + public async virtual Task DeleteNotificationAsync( + int batchCount, + CancellationToken cancellationToken = default) + { + using (var unitOfWork = _unitOfWorkManager.Begin()) { - using (var unitOfWork = _unitOfWorkManager.Begin()) - { - var notitications = await _notificationRepository.GetExpritionAsync(batchCount, cancellationToken); + var notitications = await _notificationRepository.GetExpritionAsync(batchCount, cancellationToken); - await _notificationRepository.DeleteManyAsync(notitications); + await _notificationRepository.DeleteManyAsync(notitications); - await unitOfWork.CompleteAsync(cancellationToken); - } + await unitOfWork.CompleteAsync(cancellationToken); } + } - public async virtual Task DeleteUserNotificationAsync( - Guid? tenantId, - Guid userId, - long notificationId, - CancellationToken cancellationToken = default) + public async virtual Task DeleteUserNotificationAsync( + Guid? tenantId, + Guid userId, + long notificationId, + CancellationToken cancellationToken = default) + { + using (var unitOfWork = _unitOfWorkManager.Begin()) + using (_currentTenant.Change(tenantId)) { - using (var unitOfWork = _unitOfWorkManager.Begin()) - using (_currentTenant.Change(tenantId)) - { - var notify = await _userNotificationRepository - .GetByIdAsync(userId, notificationId, cancellationToken); - await _userNotificationRepository - .DeleteAsync(notify.Id, cancellationToken: cancellationToken); + var notify = await _userNotificationRepository + .GetByIdAsync(userId, notificationId, cancellationToken); + await _userNotificationRepository + .DeleteAsync(notify.Id, cancellationToken: cancellationToken); - await unitOfWork.CompleteAsync(cancellationToken); - } + await unitOfWork.CompleteAsync(cancellationToken); } + } - public async virtual Task DeleteAllUserSubscriptionAsync( - Guid? tenantId, - string notificationName, - CancellationToken cancellationToken = default) + public async virtual Task DeleteAllUserSubscriptionAsync( + Guid? tenantId, + string notificationName, + CancellationToken cancellationToken = default) + { + using (var unitOfWork = _unitOfWorkManager.Begin()) + using (_currentTenant.Change(tenantId)) { - using (var unitOfWork = _unitOfWorkManager.Begin()) - using (_currentTenant.Change(tenantId)) - { - await _userSubscribeRepository - .DeleteUserSubscriptionAsync(notificationName, cancellationToken); + await _userSubscribeRepository + .DeleteUserSubscriptionAsync(notificationName, cancellationToken); - await unitOfWork.CompleteAsync(cancellationToken); - } + await unitOfWork.CompleteAsync(cancellationToken); } + } - public async virtual Task DeleteUserSubscriptionAsync( - Guid? tenantId, - Guid userId, - string notificationName, - CancellationToken cancellationToken = default) + public async virtual Task DeleteUserSubscriptionAsync( + Guid? tenantId, + Guid userId, + string notificationName, + CancellationToken cancellationToken = default) + { + using (var unitOfWork = _unitOfWorkManager.Begin()) + using (_currentTenant.Change(tenantId)) { - using (var unitOfWork = _unitOfWorkManager.Begin()) - using (_currentTenant.Change(tenantId)) - { - var userSubscribe = await _userSubscribeRepository - .GetUserSubscribeAsync(notificationName, userId, cancellationToken); - await _userSubscribeRepository - .DeleteAsync(userSubscribe.Id, cancellationToken: cancellationToken); + var userSubscribe = await _userSubscribeRepository + .GetUserSubscribeAsync(notificationName, userId, cancellationToken); + await _userSubscribeRepository + .DeleteAsync(userSubscribe.Id, cancellationToken: cancellationToken); - await unitOfWork.CompleteAsync(cancellationToken); - } + await unitOfWork.CompleteAsync(cancellationToken); } + } - public async virtual Task DeleteUserSubscriptionAsync( - Guid? tenantId, - IEnumerable identifiers, - string notificationName, - CancellationToken cancellationToken = default) + public async virtual Task DeleteUserSubscriptionAsync( + Guid? tenantId, + IEnumerable identifiers, + string notificationName, + CancellationToken cancellationToken = default) + { + using (var unitOfWork = _unitOfWorkManager.Begin()) + using (_currentTenant.Change(tenantId)) { - using (var unitOfWork = _unitOfWorkManager.Begin()) - using (_currentTenant.Change(tenantId)) - { - await _userSubscribeRepository - .DeleteUserSubscriptionAsync(notificationName, identifiers.Select(ids => ids.UserId), cancellationToken); + await _userSubscribeRepository + .DeleteUserSubscriptionAsync(notificationName, identifiers.Select(ids => ids.UserId), cancellationToken); - await unitOfWork.CompleteAsync(cancellationToken); - } + await unitOfWork.CompleteAsync(cancellationToken); } + } - public async virtual Task GetNotificationOrNullAsync( - Guid? tenantId, - long notificationId, - CancellationToken cancellationToken = default) + public async virtual Task GetNotificationOrNullAsync( + Guid? tenantId, + long notificationId, + CancellationToken cancellationToken = default) + { + using (_currentTenant.Change(tenantId)) { - using (_currentTenant.Change(tenantId)) - { - var notification = await _notificationRepository - .GetByIdAsync(notificationId, cancellationToken); + var notification = await _notificationRepository + .GetByIdAsync(notificationId, cancellationToken); - return _objectMapper.Map(notification); - } + return _objectMapper.Map(notification); } + } - public async virtual Task> GetUserSubscriptionsAsync( - Guid? tenantId, - string notificationName, - IEnumerable identifiers = null, - CancellationToken cancellationToken = default) + public async virtual Task> GetUserSubscriptionsAsync( + Guid? tenantId, + string notificationName, + IEnumerable identifiers = null, + CancellationToken cancellationToken = default) + { + using (_currentTenant.Change(tenantId)) { - using (_currentTenant.Change(tenantId)) - { - var userIds = identifiers?.Select(ids => ids.UserId); - var userSubscriptions = await _userSubscribeRepository - .GetUserSubscribesAsync(notificationName, userIds, cancellationToken); + var userIds = identifiers?.Select(ids => ids.UserId); + var userSubscriptions = await _userSubscribeRepository + .GetUserSubscribesAsync(notificationName, userIds, cancellationToken); - return _objectMapper.Map, List>(userSubscriptions); - } + return _objectMapper.Map, List>(userSubscriptions); } + } - public async virtual Task> GetUserNotificationsAsync( - Guid? tenantId, - Guid userId, - NotificationReadState? readState = null, - int maxResultCount = 10, - CancellationToken cancellationToken = default) + public async virtual Task> GetUserNotificationsAsync( + Guid? tenantId, + Guid userId, + NotificationReadState? readState = null, + int maxResultCount = 10, + CancellationToken cancellationToken = default) + { + using (_currentTenant.Change(tenantId)) { - using (_currentTenant.Change(tenantId)) - { - var notifications = await _userNotificationRepository - .GetNotificationsAsync(userId, readState, maxResultCount, cancellationToken); + var notifications = await _userNotificationRepository + .GetNotificationsAsync(userId, readState, maxResultCount, cancellationToken); - return _objectMapper.Map, List>(notifications); - } + return _objectMapper.Map, List>(notifications); } + } - public async virtual Task GetUserNotificationsCountAsync( - Guid? tenantId, - Guid userId, - string filter = "", - NotificationReadState? readState = null, - CancellationToken cancellationToken = default) + public async virtual Task GetUserNotificationsCountAsync( + Guid? tenantId, + Guid userId, + string filter = "", + NotificationReadState? readState = null, + CancellationToken cancellationToken = default) + { + using (_currentTenant.Change(tenantId)) { - using (_currentTenant.Change(tenantId)) - { - return await _userNotificationRepository - .GetCountAsync(userId, filter, readState, cancellationToken); - } + return await _userNotificationRepository + .GetCountAsync(userId, filter, readState, cancellationToken); } + } - public async virtual Task> GetUserNotificationsAsync( - Guid? tenantId, - Guid userId, - string filter = "", - string sorting = nameof(NotificationInfo.CreationTime), - NotificationReadState? readState = null, - int skipCount = 1, - int maxResultCount = 10, - CancellationToken cancellationToken = default) + public async virtual Task> GetUserNotificationsAsync( + Guid? tenantId, + Guid userId, + string filter = "", + string sorting = nameof(NotificationInfo.CreationTime), + NotificationReadState? readState = null, + int skipCount = 1, + int maxResultCount = 10, + CancellationToken cancellationToken = default) + { + using (_currentTenant.Change(tenantId)) { - using (_currentTenant.Change(tenantId)) - { - var notifications = await _userNotificationRepository - .GetListAsync(userId, filter, sorting, readState, skipCount, maxResultCount, cancellationToken); + var notifications = await _userNotificationRepository + .GetListAsync(userId, filter, sorting, readState, skipCount, maxResultCount, cancellationToken); - return _objectMapper.Map, List>(notifications); - } + return _objectMapper.Map, List>(notifications); } + } - public async virtual Task> GetUserSubscriptionsAsync( - Guid? tenantId, - Guid userId, - CancellationToken cancellationToken = default) + public async virtual Task> GetUserSubscriptionsAsync( + Guid? tenantId, + Guid userId, + CancellationToken cancellationToken = default) + { + using (_currentTenant.Change(tenantId)) { - using (_currentTenant.Change(tenantId)) - { - var userSubscriptionNames = await _userSubscribeRepository - .GetUserSubscribesAsync(userId, cancellationToken); + var userSubscriptionNames = await _userSubscribeRepository + .GetUserSubscribesAsync(userId, cancellationToken); - var userSubscriptions = new List(); + var userSubscriptions = new List(); - userSubscriptionNames.ForEach(name => userSubscriptions.Add( - new NotificationSubscriptionInfo - { - UserId = userId, - TenantId = tenantId, - NotificationName = name - })); + userSubscriptionNames.ForEach(name => userSubscriptions.Add( + new NotificationSubscriptionInfo + { + UserId = userId, + TenantId = tenantId, + NotificationName = name + })); - return userSubscriptions; - } + return userSubscriptions; } + } - public async virtual Task> GetUserSubscriptionsAsync( - Guid? tenantId, - string userName, - CancellationToken cancellationToken = default) + public async virtual Task> GetUserSubscriptionsAsync( + Guid? tenantId, + string userName, + CancellationToken cancellationToken = default) + { + using (_currentTenant.Change(tenantId)) { - using (_currentTenant.Change(tenantId)) - { - var userSubscriptions = await _userSubscribeRepository - .GetUserSubscribesByNameAsync(userName, cancellationToken); + var userSubscriptions = await _userSubscribeRepository + .GetUserSubscribesByNameAsync(userName, cancellationToken); - var userSubscriptionInfos = new List(); + var userSubscriptionInfos = new List(); - userSubscriptions.ForEach(us => userSubscriptionInfos.Add( - new NotificationSubscriptionInfo - { - UserId = us.UserId, - TenantId = us.TenantId, - NotificationName = us.NotificationName - })); + userSubscriptions.ForEach(us => userSubscriptionInfos.Add( + new NotificationSubscriptionInfo + { + UserId = us.UserId, + TenantId = us.TenantId, + NotificationName = us.NotificationName + })); - return userSubscriptionInfos; - } + return userSubscriptionInfos; } + } - public async virtual Task InsertNotificationAsync( - NotificationInfo notification, - CancellationToken cancellationToken = default) + public async virtual Task InsertNotificationAsync( + NotificationInfo notification, + CancellationToken cancellationToken = default) + { + using (var unitOfWork = _unitOfWorkManager.Begin()) + using (_currentTenant.Change(notification.TenantId)) { - using (var unitOfWork = _unitOfWorkManager.Begin()) - using (_currentTenant.Change(notification.TenantId)) + var notify = new Notification( + notification.GetId(), + notification.Name, + notification.Data.GetType().AssemblyQualifiedName, + notification.Data, + notification.Severity, + notification.TenantId) { - var notify = new Notification( - notification.GetId(), - notification.Name, - notification.Data.GetType().AssemblyQualifiedName, - notification.Data, - notification.Severity, - notification.TenantId) - { - CreationTime = _clock.Now, - Type = notification.Type, - ContentType = notification.ContentType, - ExpirationTime = _clock.Now.Add(_options.ExpirationTime) - }; + CreationTime = _clock.Now, + Type = notification.Type, + ContentType = notification.ContentType, + ExpirationTime = _clock.Now.Add(_options.ExpirationTime) + }; - await _notificationRepository.InsertAsync(notify, cancellationToken: cancellationToken); + await _notificationRepository.InsertAsync(notify, cancellationToken: cancellationToken); - notification.SetId(notify.NotificationId); + notification.SetId(notify.NotificationId); - await unitOfWork.CompleteAsync(cancellationToken); - } + await unitOfWork.CompleteAsync(cancellationToken); } + } - public async virtual Task InsertUserNotificationAsync( - NotificationInfo notification, - Guid userId, - CancellationToken cancellationToken = default) + public async virtual Task InsertUserNotificationAsync( + NotificationInfo notification, + Guid userId, + CancellationToken cancellationToken = default) + { + using (var unitOfWork = _unitOfWorkManager.Begin()) + using (_currentTenant.Change(notification.TenantId)) { - using (var unitOfWork = _unitOfWorkManager.Begin()) - using (_currentTenant.Change(notification.TenantId)) - { - var userNotification = new UserNotification(notification.GetId(), userId, notification.TenantId); - await _userNotificationRepository - .InsertAsync(userNotification, cancellationToken: cancellationToken); + var userNotification = new UserNotification(notification.GetId(), userId, notification.TenantId); + await _userNotificationRepository + .InsertAsync(userNotification, cancellationToken: cancellationToken); - await unitOfWork.CompleteAsync(cancellationToken); - } + await unitOfWork.CompleteAsync(cancellationToken); } + } - public async virtual Task InsertUserSubscriptionAsync( - Guid? tenantId, - UserIdentifier identifier, - string notificationName, - CancellationToken cancellationToken = default) + public async virtual Task InsertUserSubscriptionAsync( + Guid? tenantId, + UserIdentifier identifier, + string notificationName, + CancellationToken cancellationToken = default) + { + using (var unitOfWork = _unitOfWorkManager.Begin()) + using (_currentTenant.Change(tenantId)) { - using (var unitOfWork = _unitOfWorkManager.Begin()) - using (_currentTenant.Change(tenantId)) - { - var userSubscription = new UserSubscribe(notificationName, identifier.UserId, identifier.UserName, tenantId) - { - CreationTime = _clock.Now - }; + var userSubscription = new UserSubscribe(notificationName, identifier.UserId, identifier.UserName, tenantId) + { + CreationTime = _clock.Now + }; - await _userSubscribeRepository - .InsertAsync(userSubscription, cancellationToken: cancellationToken); + await _userSubscribeRepository + .InsertAsync(userSubscription, cancellationToken: cancellationToken); - await unitOfWork.CompleteAsync(cancellationToken); - } + await unitOfWork.CompleteAsync(cancellationToken); } + } - public async virtual Task InsertUserSubscriptionAsync( - Guid? tenantId, - IEnumerable identifiers, - string notificationName, - CancellationToken cancellationToken = default) + public async virtual Task InsertUserSubscriptionAsync( + Guid? tenantId, + IEnumerable identifiers, + string notificationName, + CancellationToken cancellationToken = default) + { + using (var unitOfWork = _unitOfWorkManager.Begin()) + using (_currentTenant.Change(tenantId)) { - using (var unitOfWork = _unitOfWorkManager.Begin()) - using (_currentTenant.Change(tenantId)) - { - var userSubscribes = new List(); + var userSubscribes = new List(); - foreach (var identifier in identifiers) - { - userSubscribes.Add(new UserSubscribe(notificationName, identifier.UserId, identifier.UserName, tenantId)); - } + foreach (var identifier in identifiers) + { + userSubscribes.Add(new UserSubscribe(notificationName, identifier.UserId, identifier.UserName, tenantId)); + } - await _userSubscribeRepository - .InsertUserSubscriptionAsync(userSubscribes, cancellationToken); + await _userSubscribeRepository + .InsertUserSubscriptionAsync(userSubscribes, cancellationToken); - await unitOfWork.CompleteAsync(cancellationToken); - } + await unitOfWork.CompleteAsync(cancellationToken); } + } - public async virtual Task IsSubscribedAsync( - Guid? tenantId, - Guid userId, - string notificationName, - CancellationToken cancellationToken = default) - { - using (_currentTenant.Change(tenantId)) - return await _userSubscribeRepository - .UserSubscribeExistsAysnc(notificationName, userId, cancellationToken); - } + public async virtual Task IsSubscribedAsync( + Guid? tenantId, + Guid userId, + string notificationName, + CancellationToken cancellationToken = default) + { + using (_currentTenant.Change(tenantId)) + return await _userSubscribeRepository + .UserSubscribeExistsAysnc(notificationName, userId, cancellationToken); + } - public async virtual Task InsertUserNotificationsAsync( - NotificationInfo notification, - IEnumerable userIds, - CancellationToken cancellationToken = default) + public async virtual Task InsertUserNotificationsAsync( + NotificationInfo notification, + IEnumerable userIds, + CancellationToken cancellationToken = default) + { + using (var unitOfWork = _unitOfWorkManager.Begin()) + using (_currentTenant.Change(notification.TenantId)) { - using (var unitOfWork = _unitOfWorkManager.Begin()) - using (_currentTenant.Change(notification.TenantId)) + var userNofitications = new List(); + foreach (var userId in userIds) { - var userNofitications = new List(); - foreach (var userId in userIds) + // 重复检查 + // TODO:如果存在很多个订阅用户,这是个隐患 + if (!await _userNotificationRepository.AnyAsync(userId, notification.GetId(), cancellationToken)) { - // 重复检查 - // TODO:如果存在很多个订阅用户,这是个隐患 - if (!await _userNotificationRepository.AnyAsync(userId, notification.GetId(), cancellationToken)) - { - var userNofitication = new UserNotification(notification.GetId(), userId, notification.TenantId); - userNofitications.Add(userNofitication); - } + var userNofitication = new UserNotification(notification.GetId(), userId, notification.TenantId); + userNofitications.Add(userNofitication); } - await _userNotificationRepository.InsertManyAsync(userNofitications, cancellationToken: cancellationToken); - - await unitOfWork.CompleteAsync(cancellationToken); } + await _userNotificationRepository.InsertManyAsync(userNofitications, cancellationToken: cancellationToken); + + await unitOfWork.CompleteAsync(cancellationToken); } } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/Subscribe.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/Subscribe.cs index 3499e0937..c376d24cc 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/Subscribe.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/Subscribe.cs @@ -3,20 +3,19 @@ using Volo.Abp.Domain.Entities; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public abstract class Subscribe : Entity, IMultiTenant, IHasCreationTime { - public abstract class Subscribe : Entity, IMultiTenant, IHasCreationTime - { - public virtual Guid? TenantId { get; protected set; } - public virtual DateTime CreationTime { get; set; } - public virtual string NotificationName { get; protected set; } + public virtual Guid? TenantId { get; protected set; } + public virtual DateTime CreationTime { get; set; } + public virtual string NotificationName { get; protected set; } - protected Subscribe() { } + protected Subscribe() { } - protected Subscribe(string notificationName, Guid? tenantId = null) - { - NotificationName = notificationName; - TenantId = tenantId; - } + protected Subscribe(string notificationName, Guid? tenantId = null) + { + NotificationName = notificationName; + TenantId = tenantId; } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/UserNotification.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/UserNotification.cs index 80f5c5027..db55c02df 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/UserNotification.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/UserNotification.cs @@ -2,26 +2,25 @@ using Volo.Abp.Domain.Entities; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public class UserNotification : Entity, IMultiTenant { - public class UserNotification : Entity, IMultiTenant + public virtual Guid? TenantId { get; protected set; } + public virtual Guid UserId { get; protected set; } + public virtual long NotificationId { get; protected set; } + public virtual NotificationReadState ReadStatus { get; protected set; } + protected UserNotification() { } + public UserNotification(long notificationId, Guid userId, Guid? tenantId = null) { - public virtual Guid? TenantId { get; protected set; } - public virtual Guid UserId { get; protected set; } - public virtual long NotificationId { get; protected set; } - public virtual NotificationReadState ReadStatus { get; protected set; } - protected UserNotification() { } - public UserNotification(long notificationId, Guid userId, Guid? tenantId = null) - { - UserId = userId; - NotificationId = notificationId; - ReadStatus = NotificationReadState.UnRead; - TenantId = tenantId; - } + UserId = userId; + NotificationId = notificationId; + ReadStatus = NotificationReadState.UnRead; + TenantId = tenantId; + } - public void ChangeReadState(NotificationReadState readStatus) - { - ReadStatus = readStatus; - } + public void ChangeReadState(NotificationReadState readStatus) + { + ReadStatus = readStatus; } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/UserSubscribe.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/UserSubscribe.cs index 5b2efd784..0ca9aa2fa 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/UserSubscribe.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Domain/LINGYUN/Abp/Notifications/UserSubscribe.cs @@ -1,18 +1,17 @@ using System; using Volo.Abp.Auditing; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public class UserSubscribe : Subscribe, IHasCreationTime { - public class UserSubscribe : Subscribe, IHasCreationTime + public virtual Guid UserId { get; set; } + public virtual string UserName { get; set; } + protected UserSubscribe() { } + public UserSubscribe(string notificationName, Guid userId, string userName, Guid? tenantId = null) + : base(notificationName, tenantId) { - public virtual Guid UserId { get; set; } - public virtual string UserName { get; set; } - protected UserSubscribe() { } - public UserSubscribe(string notificationName, Guid userId, string userName, Guid? tenantId = null) - : base(notificationName, tenantId) - { - UserId = userId; - UserName = userName; - } + UserId = userId; + UserName = userName; } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Emailing/LINGYUN.Abp.Notifications.Emailing.csproj b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Emailing/LINGYUN.Abp.Notifications.Emailing.csproj index a428cd2d7..72f6fe2b0 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Emailing/LINGYUN.Abp.Notifications.Emailing.csproj +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Emailing/LINGYUN.Abp.Notifications.Emailing.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.Notifications.Emailing + LINGYUN.Abp.Notifications.Emailing + false + false + false diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN.Abp.Notifications.EntityFrameworkCore.csproj b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN.Abp.Notifications.EntityFrameworkCore.csproj index 4eba141ca..f66aafb31 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN.Abp.Notifications.EntityFrameworkCore.csproj +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN.Abp.Notifications.EntityFrameworkCore.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.ExceptionHandling.EntityFrameworkCore + LINGYUN.Abp.ExceptionHandling.EntityFrameworkCore + false + false + false diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/AbpNotificationsModelBuilderConfigurationOptions.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/AbpNotificationsModelBuilderConfigurationOptions.cs index d05a07bce..2c090bd3c 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/AbpNotificationsModelBuilderConfigurationOptions.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/AbpNotificationsModelBuilderConfigurationOptions.cs @@ -1,18 +1,17 @@ using JetBrains.Annotations; using Volo.Abp.EntityFrameworkCore.Modeling; -namespace LINGYUN.Abp.Notifications.EntityFrameworkCore +namespace LINGYUN.Abp.Notifications.EntityFrameworkCore; + +public class AbpNotificationsModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions { - public class AbpNotificationsModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions + public AbpNotificationsModelBuilderConfigurationOptions( + [NotNull] string tablePrefix = AbpNotificationsDbProperties.DefaultTablePrefix, + [CanBeNull] string schema = AbpNotificationsDbProperties.DefaultSchema) + : base( + tablePrefix, + schema) { - public AbpNotificationsModelBuilderConfigurationOptions( - [NotNull] string tablePrefix = AbpNotificationsDbProperties.DefaultTablePrefix, - [CanBeNull] string schema = AbpNotificationsDbProperties.DefaultSchema) - : base( - tablePrefix, - schema) - { - } } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/NotificationsDbContextModelCreatingExtensions.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/NotificationsDbContextModelCreatingExtensions.cs index a7afaa381..8923a3b0c 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/NotificationsDbContextModelCreatingExtensions.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.EntityFrameworkCore/LINGYUN/Abp/Notifications/EntityFrameworkCore/NotificationsDbContextModelCreatingExtensions.cs @@ -4,113 +4,112 @@ using Volo.Abp; using Volo.Abp.EntityFrameworkCore.Modeling; -namespace LINGYUN.Abp.Notifications.EntityFrameworkCore +namespace LINGYUN.Abp.Notifications.EntityFrameworkCore; + +public static class NotificationsDbContextModelCreatingExtensions { - public static class NotificationsDbContextModelCreatingExtensions + public static void ConfigureNotifications( + this ModelBuilder builder, + Action optionsAction = null) { - public static void ConfigureNotifications( - this ModelBuilder builder, - Action optionsAction = null) + Check.NotNull(builder, nameof(builder)); + + var options = new AbpNotificationsModelBuilderConfigurationOptions(); + + optionsAction?.Invoke(options); + + builder.Entity(b => { - Check.NotNull(builder, nameof(builder)); + b.ToTable(options.TablePrefix + "Notifications", options.Schema); + + b.Property(p => p.NotificationName).HasMaxLength(NotificationConsts.MaxNameLength).IsRequired(); + b.Property(p => p.NotificationTypeName).HasMaxLength(NotificationConsts.MaxTypeNameLength).IsRequired(); + //b.Property(p => p.NotificationData).HasMaxLength(NotificationConsts.MaxDataLength).IsRequired(); + + b.Property(p => p.ContentType) + .HasDefaultValue(NotificationContentType.Text); - var options = new AbpNotificationsModelBuilderConfigurationOptions(); + b.ConfigureByConvention(); - optionsAction?.Invoke(options); + b.HasIndex(p => new { p.TenantId, p.NotificationName }); + }); - builder.Entity(b => - { - b.ToTable(options.TablePrefix + "Notifications", options.Schema); + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "UserNotifications", options.Schema); + + b.ConfigureByConvention(); - b.Property(p => p.NotificationName).HasMaxLength(NotificationConsts.MaxNameLength).IsRequired(); - b.Property(p => p.NotificationTypeName).HasMaxLength(NotificationConsts.MaxTypeNameLength).IsRequired(); - //b.Property(p => p.NotificationData).HasMaxLength(NotificationConsts.MaxDataLength).IsRequired(); + b.HasIndex(p => new { p.TenantId, p.UserId, p.NotificationId }) + .HasDatabaseName("IX_Tenant_User_Notification_Id"); + }); - b.Property(p => p.ContentType) - .HasDefaultValue(NotificationContentType.Text); + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "UserSubscribes", options.Schema); - b.ConfigureByConvention(); + b.Property(p => p.NotificationName).HasMaxLength(SubscribeConsts.MaxNotificationNameLength).IsRequired(); + b.Property(p => p.UserName) + .HasMaxLength(SubscribeConsts.MaxUserNameLength) + .HasDefaultValue("/")// 不是必须的 + .IsRequired(); - b.HasIndex(p => new { p.TenantId, p.NotificationName }); - }); + b.ConfigureByConvention(); - builder.Entity(b => - { - b.ToTable(options.TablePrefix + "UserNotifications", options.Schema); + b.HasIndex(p => new { p.TenantId, p.UserId, p.NotificationName }) + .HasDatabaseName("IX_Tenant_User_Notification_Name") + .IsUnique(); + }); + } - b.ConfigureByConvention(); + public static void ConfigureNotificationsDefinition( + this ModelBuilder builder, + Action optionsAction = null) + { + Check.NotNull(builder, nameof(builder)); - b.HasIndex(p => new { p.TenantId, p.UserId, p.NotificationId }) - .HasDatabaseName("IX_Tenant_User_Notification_Id"); - }); + var options = new AbpNotificationsModelBuilderConfigurationOptions(); - builder.Entity(b => - { - b.ToTable(options.TablePrefix + "UserSubscribes", options.Schema); + optionsAction?.Invoke(options); - b.Property(p => p.NotificationName).HasMaxLength(SubscribeConsts.MaxNotificationNameLength).IsRequired(); - b.Property(p => p.UserName) - .HasMaxLength(SubscribeConsts.MaxUserNameLength) - .HasDefaultValue("/")// 不是必须的 - .IsRequired(); + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "NotificationDefinitionGroups", options.Schema); + b.Property(p => p.Name) + .HasMaxLength(NotificationDefinitionGroupRecordConsts.MaxNameLength) + .IsRequired(); - b.ConfigureByConvention(); + b.Property(p => p.DisplayName) + .HasMaxLength(NotificationDefinitionGroupRecordConsts.MaxDisplayNameLength); + b.Property(p => p.Description) + .HasMaxLength(NotificationDefinitionGroupRecordConsts.MaxDescriptionLength); - b.HasIndex(p => new { p.TenantId, p.UserId, p.NotificationName }) - .HasDatabaseName("IX_Tenant_User_Notification_Name") - .IsUnique(); - }); - } + b.ConfigureByConvention(); + }); - public static void ConfigureNotificationsDefinition( - this ModelBuilder builder, - Action optionsAction = null) + builder.Entity(b => { - Check.NotNull(builder, nameof(builder)); - - var options = new AbpNotificationsModelBuilderConfigurationOptions(); - - optionsAction?.Invoke(options); - - builder.Entity(b => - { - b.ToTable(options.TablePrefix + "NotificationDefinitionGroups", options.Schema); - b.Property(p => p.Name) - .HasMaxLength(NotificationDefinitionGroupRecordConsts.MaxNameLength) - .IsRequired(); - - b.Property(p => p.DisplayName) - .HasMaxLength(NotificationDefinitionGroupRecordConsts.MaxDisplayNameLength); - b.Property(p => p.Description) - .HasMaxLength(NotificationDefinitionGroupRecordConsts.MaxDescriptionLength); - - b.ConfigureByConvention(); - }); - - builder.Entity(b => - { - b.ToTable(options.TablePrefix + "NotificationDefinitions", options.Schema); - b.Property(p => p.Name) - .HasMaxLength(NotificationDefinitionRecordConsts.MaxNameLength) - .IsRequired(); - b.Property(p => p.GroupName) - .HasMaxLength(NotificationDefinitionGroupRecordConsts.MaxNameLength) - .IsRequired(); - - b.Property(p => p.DisplayName) - .HasMaxLength(NotificationDefinitionRecordConsts.MaxDisplayNameLength); - b.Property(p => p.Description) - .HasMaxLength(NotificationDefinitionRecordConsts.MaxDescriptionLength); - b.Property(p => p.Providers) - .HasMaxLength(NotificationDefinitionRecordConsts.MaxProvidersLength); - b.Property(p => p.Template) - .HasMaxLength(NotificationDefinitionRecordConsts.MaxTemplateLength); - - b.Property(p => p.ContentType) - .HasDefaultValue(NotificationContentType.Text); - - b.ConfigureByConvention(); - }); - } + b.ToTable(options.TablePrefix + "NotificationDefinitions", options.Schema); + b.Property(p => p.Name) + .HasMaxLength(NotificationDefinitionRecordConsts.MaxNameLength) + .IsRequired(); + b.Property(p => p.GroupName) + .HasMaxLength(NotificationDefinitionGroupRecordConsts.MaxNameLength) + .IsRequired(); + + b.Property(p => p.DisplayName) + .HasMaxLength(NotificationDefinitionRecordConsts.MaxDisplayNameLength); + b.Property(p => p.Description) + .HasMaxLength(NotificationDefinitionRecordConsts.MaxDescriptionLength); + b.Property(p => p.Providers) + .HasMaxLength(NotificationDefinitionRecordConsts.MaxProvidersLength); + b.Property(p => p.Template) + .HasMaxLength(NotificationDefinitionRecordConsts.MaxTemplateLength); + + b.Property(p => p.ContentType) + .HasDefaultValue(NotificationContentType.Text); + + b.ConfigureByConvention(); + }); } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi/LINGYUN.Abp.Notifications.HttpApi.csproj b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi/LINGYUN.Abp.Notifications.HttpApi.csproj index ed71bed58..6c06598d6 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi/LINGYUN.Abp.Notifications.HttpApi.csproj +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi/LINGYUN.Abp.Notifications.HttpApi.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.ExceptionHandling.HttpApi + LINGYUN.Abp.ExceptionHandling.HttpApi + false + false + false diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.PushPlus/LINGYUN.Abp.Notifications.PushPlus.csproj b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.PushPlus/LINGYUN.Abp.Notifications.PushPlus.csproj index abd4fe5fa..ef2dea96e 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.PushPlus/LINGYUN.Abp.Notifications.PushPlus.csproj +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.PushPlus/LINGYUN.Abp.Notifications.PushPlus.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Notifications.PushPlus + LINGYUN.Abp.Notifications.PushPlus + false + false + false diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.SignalR/LINGYUN.Abp.Notifications.SignalR.csproj b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.SignalR/LINGYUN.Abp.Notifications.SignalR.csproj index fa1afbac0..c401009c1 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.SignalR/LINGYUN.Abp.Notifications.SignalR.csproj +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.SignalR/LINGYUN.Abp.Notifications.SignalR.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.Notifications.SignalR + LINGYUN.Abp.Notifications.SignalR + false + false + false diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/AbpNotificationsSignalRModule.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/AbpNotificationsSignalRModule.cs index 64a9ebc44..e69768a1f 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/AbpNotificationsSignalRModule.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/AbpNotificationsSignalRModule.cs @@ -1,22 +1,21 @@ using Volo.Abp.AspNetCore.SignalR; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.Notifications.SignalR +namespace LINGYUN.Abp.Notifications.SignalR; + +[DependsOn( + typeof(AbpNotificationsModule), + typeof(AbpAspNetCoreSignalRModule))] +public class AbpNotificationsSignalRModule : AbpModule { - [DependsOn( - typeof(AbpNotificationsModule), - typeof(AbpAspNetCoreSignalRModule))] - public class AbpNotificationsSignalRModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + Configure(options => { - Configure(options => - { - options.PublishProviders.Add(); - options.NotificationDataMappings - .MappingDefault(SignalRNotificationPublishProvider.ProviderName, - data => data.ToSignalRData()); - }); - } + options.PublishProviders.Add(); + options.NotificationDataMappings + .MappingDefault(SignalRNotificationPublishProvider.ProviderName, + data => data.ToSignalRData()); + }); } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/AbpNotificationsSignalROptions.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/AbpNotificationsSignalROptions.cs index 9f005457a..c56d9da61 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/AbpNotificationsSignalROptions.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/AbpNotificationsSignalROptions.cs @@ -1,15 +1,14 @@ -namespace LINGYUN.Abp.Notifications.SignalR +namespace LINGYUN.Abp.Notifications.SignalR; + +public class AbpNotificationsSignalROptions { - public class AbpNotificationsSignalROptions - { - /// - /// 自定义的客户端订阅通知方法名称 - /// - public string MethodName { get; set; } + /// + /// 自定义的客户端订阅通知方法名称 + /// + public string MethodName { get; set; } - public AbpNotificationsSignalROptions() - { - MethodName = "get-notification"; - } + public AbpNotificationsSignalROptions() + { + MethodName = "get-notification"; } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/Hubs/NotificationsHub.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/Hubs/NotificationsHub.cs index 16ec15648..8c109c935 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/Hubs/NotificationsHub.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/Hubs/NotificationsHub.cs @@ -8,75 +8,74 @@ using Volo.Abp.Uow; using Volo.Abp.Users; -namespace LINGYUN.Abp.Notifications.SignalR.Hubs +namespace LINGYUN.Abp.Notifications.SignalR.Hubs; + +[Authorize] +public class NotificationsHub : AbpHub { - [Authorize] - public class NotificationsHub : AbpHub + protected INotificationStore NotificationStore => LazyServiceProvider.LazyGetRequiredService(); + + public override async Task OnConnectedAsync() { - protected INotificationStore NotificationStore => LazyServiceProvider.LazyGetRequiredService(); + await base.OnConnectedAsync(); - public override async Task OnConnectedAsync() + if (CurrentTenant.IsAvailable) { - await base.OnConnectedAsync(); - - if (CurrentTenant.IsAvailable) - { - // 以租户为分组,将用户加入租户通讯组 - await Groups.AddToGroupAsync(Context.ConnectionId, CurrentTenant.GetId().ToString()); - } - else - { - await Groups.AddToGroupAsync(Context.ConnectionId, "Global"); - } + // 以租户为分组,将用户加入租户通讯组 + await Groups.AddToGroupAsync(Context.ConnectionId, CurrentTenant.GetId().ToString()); } - - public override async Task OnDisconnectedAsync(Exception exception) + else { - await base.OnDisconnectedAsync(exception); - - - if (CurrentTenant.IsAvailable) - { - // 以租户为分组,将移除租户通讯组 - await Groups.RemoveFromGroupAsync(Context.ConnectionId, CurrentTenant.GetId().ToString()); - } - else - { - await Groups.RemoveFromGroupAsync(Context.ConnectionId, "Global"); - } + await Groups.AddToGroupAsync(Context.ConnectionId, "Global"); } + } - // [HubMethodName("MySubscriptions")] - [HubMethodName("my-subscriptions")] - public async virtual Task> GetMySubscriptionsAsync() - { - var subscriptions = await NotificationStore - .GetUserSubscriptionsAsync(CurrentTenant.Id, CurrentUser.GetId()); + public override async Task OnDisconnectedAsync(Exception exception) + { + await base.OnDisconnectedAsync(exception); - return new ListResultDto(subscriptions); - } - [UnitOfWork] - // [HubMethodName("GetNotification")] - [HubMethodName("get-notifications")] - public async virtual Task> GetNotificationAsync() + if (CurrentTenant.IsAvailable) { - var userNotifications = await NotificationStore - .GetUserNotificationsAsync(CurrentTenant.Id, CurrentUser.GetId(), NotificationReadState.UnRead, 10); - - return new ListResultDto(userNotifications); + // 以租户为分组,将移除租户通讯组 + await Groups.RemoveFromGroupAsync(Context.ConnectionId, CurrentTenant.GetId().ToString()); } - - // [HubMethodName("ChangeState")] - [HubMethodName("change-state")] - public async virtual Task ChangeStateAsync(string id, NotificationReadState readState = NotificationReadState.Read) + else { - await NotificationStore - .ChangeUserNotificationReadStateAsync( - CurrentTenant.Id, - CurrentUser.GetId(), - long.Parse(id), - readState); + await Groups.RemoveFromGroupAsync(Context.ConnectionId, "Global"); } } + + // [HubMethodName("MySubscriptions")] + [HubMethodName("my-subscriptions")] + public async virtual Task> GetMySubscriptionsAsync() + { + var subscriptions = await NotificationStore + .GetUserSubscriptionsAsync(CurrentTenant.Id, CurrentUser.GetId()); + + return new ListResultDto(subscriptions); + } + + [UnitOfWork] + // [HubMethodName("GetNotification")] + [HubMethodName("get-notifications")] + public async virtual Task> GetNotificationAsync() + { + var userNotifications = await NotificationStore + .GetUserNotificationsAsync(CurrentTenant.Id, CurrentUser.GetId(), NotificationReadState.UnRead, 10); + + return new ListResultDto(userNotifications); + } + + // [HubMethodName("ChangeState")] + [HubMethodName("change-state")] + public async virtual Task ChangeStateAsync(string id, NotificationReadState readState = NotificationReadState.Read) + { + await NotificationStore + .ChangeUserNotificationReadStateAsync( + CurrentTenant.Id, + CurrentUser.GetId(), + long.Parse(id), + readState); + } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/NotificationDataExtensions.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/NotificationDataExtensions.cs index 6ed42c100..c1bdcc0b0 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/NotificationDataExtensions.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/NotificationDataExtensions.cs @@ -1,10 +1,9 @@ -namespace LINGYUN.Abp.Notifications.SignalR +namespace LINGYUN.Abp.Notifications.SignalR; + +internal static class NotificationDataExtensions { - internal static class NotificationDataExtensions + public static NotificationData ToSignalRData(this NotificationData data) { - public static NotificationData ToSignalRData(this NotificationData data) - { - return data; - } + return data; } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/SignalRNotificationPublishProvider.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/SignalRNotificationPublishProvider.cs index 84504aba9..03542f70b 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/SignalRNotificationPublishProvider.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/SignalRNotificationPublishProvider.cs @@ -8,51 +8,50 @@ using System.Threading; using System.Threading.Tasks; -namespace LINGYUN.Abp.Notifications.SignalR +namespace LINGYUN.Abp.Notifications.SignalR; + +public class SignalRNotificationPublishProvider : NotificationPublishProvider { - public class SignalRNotificationPublishProvider : NotificationPublishProvider - { - public const string ProviderName = NotificationProviderNames.SignalR; - public override string Name => ProviderName; + public const string ProviderName = NotificationProviderNames.SignalR; + public override string Name => ProviderName; + + private readonly IHubContext _hubContext; - private readonly IHubContext _hubContext; + private readonly AbpNotificationsSignalROptions _options; + public SignalRNotificationPublishProvider( + IHubContext hubContext, + IOptions options) + { + _options = options.Value; + _hubContext = hubContext; + } - private readonly AbpNotificationsSignalROptions _options; - public SignalRNotificationPublishProvider( - IHubContext hubContext, - IOptions options) + protected async override Task PublishAsync( + NotificationInfo notification, + IEnumerable identifiers, + CancellationToken cancellationToken = default) + { + if (identifiers?.Count() == 0) { - _options = options.Value; - _hubContext = hubContext; - } + var groupName = notification.TenantId?.ToString() ?? "Global"; - protected async override Task PublishAsync( - NotificationInfo notification, - IEnumerable identifiers, - CancellationToken cancellationToken = default) + var singalRGroup = _hubContext.Clients.Group(groupName); + // 租户通知群发 + Logger.LogDebug($"Found a singalr group, begin senging notifications"); + await singalRGroup.SendAsync(_options.MethodName, notification, cancellationToken); + } + else { - if (identifiers?.Count() == 0) + try { - var groupName = notification.TenantId?.ToString() ?? "Global"; - - var singalRGroup = _hubContext.Clients.Group(groupName); - // 租户通知群发 - Logger.LogDebug($"Found a singalr group, begin senging notifications"); - await singalRGroup.SendAsync(_options.MethodName, notification, cancellationToken); + var onlineClients = _hubContext.Clients.Users(identifiers.Select(x => x.UserId.ToString())); + Logger.LogDebug($"Found a singalr client, begin senging notifications"); + await onlineClients.SendAsync(_options.MethodName, notification, cancellationToken); } - else + catch (Exception ex) { - try - { - var onlineClients = _hubContext.Clients.Users(identifiers.Select(x => x.UserId.ToString())); - Logger.LogDebug($"Found a singalr client, begin senging notifications"); - await onlineClients.SendAsync(_options.MethodName, notification, cancellationToken); - } - catch (Exception ex) - { - Logger.LogWarning("Could not send notifications to all users"); - Logger.LogWarning("Send to user notifications error: {0}", ex.Message); - } + Logger.LogWarning("Could not send notifications to all users"); + Logger.LogWarning("Send to user notifications error: {0}", ex.Message); } } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN.Abp.Notifications.Sms.csproj b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN.Abp.Notifications.Sms.csproj index c3b19acfe..585887f06 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN.Abp.Notifications.Sms.csproj +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN.Abp.Notifications.Sms.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Notifications.Sms + LINGYUN.Abp.Notifications.Sms + false + false + false diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/AbpNotificationsSmsModule.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/AbpNotificationsSmsModule.cs index 9f12489fe..525e1b486 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/AbpNotificationsSmsModule.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/AbpNotificationsSmsModule.cs @@ -2,32 +2,31 @@ using Volo.Abp.Modularity; using Volo.Abp.Sms; -namespace LINGYUN.Abp.Notifications.Sms +namespace LINGYUN.Abp.Notifications.Sms; + +[DependsOn( + typeof(AbpNotificationsModule), + typeof(AbpSmsModule))] +public class AbpNotificationsSmsModule : AbpModule { - [DependsOn( - typeof(AbpNotificationsModule), - typeof(AbpSmsModule))] - public class AbpNotificationsSmsModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + var preSmsActions = context.Services.GetPreConfigureActions(); + Configure(options => { - var preSmsActions = context.Services.GetPreConfigureActions(); - Configure(options => - { - preSmsActions.Configure(options); - }); + preSmsActions.Configure(options); + }); - Configure(options => - { - options.PublishProviders.Add(); + Configure(options => + { + options.PublishProviders.Add(); - var smsOptions = preSmsActions.Configure(); + var smsOptions = preSmsActions.Configure(); - options.NotificationDataMappings - .MappingDefault( - SmsNotificationPublishProvider.ProviderName, - data => NotificationData.ToStandardData(smsOptions.TemplateParamsPrefix, data)); - }); - } + options.NotificationDataMappings + .MappingDefault( + SmsNotificationPublishProvider.ProviderName, + data => NotificationData.ToStandardData(smsOptions.TemplateParamsPrefix, data)); + }); } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/AbpNotificationsSmsOptions.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/AbpNotificationsSmsOptions.cs index 2855637e3..1c323efb5 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/AbpNotificationsSmsOptions.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/AbpNotificationsSmsOptions.cs @@ -1,10 +1,9 @@ -namespace LINGYUN.Abp.Notifications.Sms +namespace LINGYUN.Abp.Notifications.Sms; + +public class AbpNotificationsSmsOptions { - public class AbpNotificationsSmsOptions - { - /// - /// 短信模板变量前缀 - /// - public string TemplateParamsPrefix { get; set; } = "[sms]"; - } + /// + /// 短信模板变量前缀 + /// + public string TemplateParamsPrefix { get; set; } = "[sms]"; } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/ISmsNotificationSender.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/ISmsNotificationSender.cs index 38b4b9d7b..49ffe7f0d 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/ISmsNotificationSender.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/ISmsNotificationSender.cs @@ -1,21 +1,20 @@ using System.Threading.Tasks; -namespace LINGYUN.Abp.Notifications.Sms +namespace LINGYUN.Abp.Notifications.Sms; + +/// +/// 短信通知发送接口 +/// +/// +/// 重写实现自定义的短信消息处理 +/// +public interface ISmsNotificationSender { /// - /// 短信通知发送接口 + /// 发送通知 /// - /// - /// 重写实现自定义的短信消息处理 - /// - public interface ISmsNotificationSender - { - /// - /// 发送通知 - /// - /// 通知数据 - /// 手机号列表,多个手机号通过,分隔 - /// - Task SendAsync(NotificationInfo notification, string phoneNumbers); - } + /// 通知数据 + /// 手机号列表,多个手机号通过,分隔 + /// + Task SendAsync(NotificationInfo notification, string phoneNumbers); } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/IUserPhoneFinder.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/IUserPhoneFinder.cs index 3ca5919a5..bef2927e2 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/IUserPhoneFinder.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/IUserPhoneFinder.cs @@ -3,12 +3,11 @@ using System.Threading; using System.Threading.Tasks; -namespace LINGYUN.Abp.Notifications.Sms +namespace LINGYUN.Abp.Notifications.Sms; + +public interface IUserPhoneFinder { - public interface IUserPhoneFinder - { - Task> FindByUserIdsAsync( - IEnumerable userIds, - CancellationToken cancellation = default); - } + Task> FindByUserIdsAsync( + IEnumerable userIds, + CancellationToken cancellation = default); } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/NullUserPhoneFinder.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/NullUserPhoneFinder.cs index 91057f028..f36eb7017 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/NullUserPhoneFinder.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/NullUserPhoneFinder.cs @@ -4,15 +4,14 @@ using System.Threading.Tasks; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.Notifications.Sms +namespace LINGYUN.Abp.Notifications.Sms; + +public class NullUserPhoneFinder : IUserPhoneFinder, ISingletonDependency { - public class NullUserPhoneFinder : IUserPhoneFinder, ISingletonDependency + public Task> FindByUserIdsAsync(IEnumerable userIds, CancellationToken cancellation = default) { - public Task> FindByUserIdsAsync(IEnumerable userIds, CancellationToken cancellation = default) - { - IEnumerable emptyPhoneList = new string[0]; + IEnumerable emptyPhoneList = new string[0]; - return Task.FromResult(emptyPhoneList); - } + return Task.FromResult(emptyPhoneList); } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/SmsNotificationPublishProvider.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/SmsNotificationPublishProvider.cs index 1231ee3c0..3a5933f48 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/SmsNotificationPublishProvider.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/SmsNotificationPublishProvider.cs @@ -4,43 +4,42 @@ using System.Threading; using System.Threading.Tasks; -namespace LINGYUN.Abp.Notifications.Sms +namespace LINGYUN.Abp.Notifications.Sms; + +public class SmsNotificationPublishProvider : NotificationPublishProvider { - public class SmsNotificationPublishProvider : NotificationPublishProvider - { - public const string ProviderName = NotificationProviderNames.Sms; + public const string ProviderName = NotificationProviderNames.Sms; + + protected IUserPhoneFinder UserPhoneFinder => ServiceProvider.LazyGetRequiredService(); + protected ISmsNotificationSender Sender { get; } + + protected AbpNotificationsSmsOptions Options { get; } - protected IUserPhoneFinder UserPhoneFinder => ServiceProvider.LazyGetRequiredService(); - protected ISmsNotificationSender Sender { get; } + public SmsNotificationPublishProvider( + ISmsNotificationSender sender, + IOptions options) + { + Sender = sender; + Options = options.Value; + } - protected AbpNotificationsSmsOptions Options { get; } + public override string Name => ProviderName; - public SmsNotificationPublishProvider( - ISmsNotificationSender sender, - IOptions options) + protected override async Task PublishAsync( + NotificationInfo notification, + IEnumerable identifiers, + CancellationToken cancellationToken = default) + { + if (!identifiers.Any()) { - Sender = sender; - Options = options.Value; + return; } - public override string Name => ProviderName; - - protected override async Task PublishAsync( - NotificationInfo notification, - IEnumerable identifiers, - CancellationToken cancellationToken = default) + var sendToPhones = await UserPhoneFinder.FindByUserIdsAsync(identifiers.Select(usr => usr.UserId), cancellationToken); + if (!sendToPhones.Any()) { - if (!identifiers.Any()) - { - return; - } - - var sendToPhones = await UserPhoneFinder.FindByUserIdsAsync(identifiers.Select(usr => usr.UserId), cancellationToken); - if (!sendToPhones.Any()) - { - return; - } - await Sender.SendAsync(notification, sendToPhones.JoinAsString(",")); + return; } + await Sender.SendAsync(notification, sendToPhones.JoinAsString(",")); } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/SmsNotificationSender.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/SmsNotificationSender.cs index f0687afef..4ec8ed79e 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/SmsNotificationSender.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/SmsNotificationSender.cs @@ -5,45 +5,44 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.Sms; -namespace LINGYUN.Abp.Notifications.Sms +namespace LINGYUN.Abp.Notifications.Sms; + +/// +/// 短信通知的默认实现者 +/// +public class SmsNotificationSender : ISmsNotificationSender, ITransientDependency { + public ILogger Logger { protected get; set; } + protected ISmsSender SmsSender { get; } + + public SmsNotificationSender(ISmsSender smsSender) + { + SmsSender = smsSender; + + Logger = NullLogger.Instance; + } + /// - /// 短信通知的默认实现者 + /// 发送通知 /// - public class SmsNotificationSender : ISmsNotificationSender, ITransientDependency + /// + /// + /// + public async virtual Task SendAsync(NotificationInfo notification, string phoneNumbers) { - public ILogger Logger { protected get; set; } - protected ISmsSender SmsSender { get; } - - public SmsNotificationSender(ISmsSender smsSender) + var templateCode = notification.Data.TryGetData("TemplateCode"); + if (templateCode == null) { - SmsSender = smsSender; - - Logger = NullLogger.Instance; + Logger.LogWarning("sms template code is empty, can not send sms message!"); + return; } + var message = new SmsMessage(phoneNumbers, "SmsNotification"); - /// - /// 发送通知 - /// - /// - /// - /// - public async virtual Task SendAsync(NotificationInfo notification, string phoneNumbers) - { - var templateCode = notification.Data.TryGetData("TemplateCode"); - if (templateCode == null) - { - Logger.LogWarning("sms template code is empty, can not send sms message!"); - return; - } - var message = new SmsMessage(phoneNumbers, "SmsNotification"); + // TODO: 后期增强功能,增加短信模板、通知模板功能 + message.Properties.Add("TemplateCode", templateCode); + message.Properties.Add("SignName", notification.Data.TryGetData("SignName")); + message.Properties.AddIfNotContains(notification.Data.ExtraProperties); - // TODO: 后期增强功能,增加短信模板、通知模板功能 - message.Properties.Add("TemplateCode", templateCode); - message.Properties.Add("SignName", notification.Data.TryGetData("SignName")); - message.Properties.AddIfNotContains(notification.Data.ExtraProperties); - - await SmsSender.SendAsync(message); - } + await SmsSender.SendAsync(message); } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.TuiJuhe/LINGYUN.Abp.Notifications.TuiJuhe.csproj b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.TuiJuhe/LINGYUN.Abp.Notifications.TuiJuhe.csproj index c3c138517..3fe8ec842 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.TuiJuhe/LINGYUN.Abp.Notifications.TuiJuhe.csproj +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.TuiJuhe/LINGYUN.Abp.Notifications.TuiJuhe.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Notifications.TuiJuhe + LINGYUN.Abp.Notifications.TuiJuhe + false + false + false diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.MiniProgram/LINGYUN.Abp.Notifications.WeChat.MiniProgram.csproj b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.MiniProgram/LINGYUN.Abp.Notifications.WeChat.MiniProgram.csproj index 2071c29f8..3bbee81d2 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.MiniProgram/LINGYUN.Abp.Notifications.WeChat.MiniProgram.csproj +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.MiniProgram/LINGYUN.Abp.Notifications.WeChat.MiniProgram.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + net8.0 + LINGYUN.Abp.Notifications.WeChat.MiniProgram + LINGYUN.Abp.Notifications.WeChat.MiniProgram + false + false + false diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.MiniProgram/LINGYUN/Abp/Notifications/WeChat/MiniProgram/AbpNotificationsWeChatMiniProgramModule.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.MiniProgram/LINGYUN/Abp/Notifications/WeChat/MiniProgram/AbpNotificationsWeChatMiniProgramModule.cs index 18c6bcc80..1e016f9ba 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.MiniProgram/LINGYUN/Abp/Notifications/WeChat/MiniProgram/AbpNotificationsWeChatMiniProgramModule.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.MiniProgram/LINGYUN/Abp/Notifications/WeChat/MiniProgram/AbpNotificationsWeChatMiniProgramModule.cs @@ -2,31 +2,30 @@ using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Modularity; -namespace LINGYUN.Abp.Notifications.WeChat.MiniProgram +namespace LINGYUN.Abp.Notifications.WeChat.MiniProgram; + +[DependsOn( + typeof(AbpWeChatMiniProgramModule), + typeof(AbpNotificationsModule))] +public class AbpNotificationsWeChatMiniProgramModule : AbpModule { - [DependsOn( - typeof(AbpWeChatMiniProgramModule), - typeof(AbpNotificationsModule))] - public class AbpNotificationsWeChatMiniProgramModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) - { - var preActions = context.Services.GetPreConfigureActions(); + var preActions = context.Services.GetPreConfigureActions(); - Configure(options => - { - preActions.Configure(options); - }); + Configure(options => + { + preActions.Configure(options); + }); - Configure(options => - { - options.PublishProviders.Add(); + Configure(options => + { + options.PublishProviders.Add(); - var wechatOptions = preActions.Configure(); - options.NotificationDataMappings - .MappingDefault(WeChatMiniProgramNotificationPublishProvider.ProviderName, - data => NotificationData.ToStandardData(wechatOptions.DefaultMsgPrefix, data)); - }); - } + var wechatOptions = preActions.Configure(); + options.NotificationDataMappings + .MappingDefault(WeChatMiniProgramNotificationPublishProvider.ProviderName, + data => NotificationData.ToStandardData(wechatOptions.DefaultMsgPrefix, data)); + }); } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.MiniProgram/LINGYUN/Abp/Notifications/WeChat/MiniProgram/AbpNotificationsWeChatMiniProgramOptions.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.MiniProgram/LINGYUN/Abp/Notifications/WeChat/MiniProgram/AbpNotificationsWeChatMiniProgramOptions.cs index 74d74129d..4653717ba 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.MiniProgram/LINGYUN/Abp/Notifications/WeChat/MiniProgram/AbpNotificationsWeChatMiniProgramOptions.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.MiniProgram/LINGYUN/Abp/Notifications/WeChat/MiniProgram/AbpNotificationsWeChatMiniProgramOptions.cs @@ -1,25 +1,24 @@ -namespace LINGYUN.Abp.Notifications.WeChat.MiniProgram +namespace LINGYUN.Abp.Notifications.WeChat.MiniProgram; + +/// +/// TODO: 后期改进,配置项集成到 +/// +public class AbpNotificationsWeChatMiniProgramOptions { /// - /// TODO: 后期改进,配置项集成到 + /// 默认消息头部标记 /// - public class AbpNotificationsWeChatMiniProgramOptions - { - /// - /// 默认消息头部标记 - /// - public string DefaultMsgPrefix { get; set; } = "[wmp]"; - /// - /// 默认小程序模板 - /// - public string DefaultTemplateId { get; set; } - /// - /// 默认跳转小程序类型 - /// - public string DefaultState { get; set; } = "developer"; - /// - /// 默认小程序语言 - /// - public string DefaultLanguage { get; set; } = "zh_CN"; - } + public string DefaultMsgPrefix { get; set; } = "[wmp]"; + /// + /// 默认小程序模板 + /// + public string DefaultTemplateId { get; set; } + /// + /// 默认跳转小程序类型 + /// + public string DefaultState { get; set; } = "developer"; + /// + /// 默认小程序语言 + /// + public string DefaultLanguage { get; set; } = "zh_CN"; } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.MiniProgram/LINGYUN/Abp/Notifications/WeChat/MiniProgram/WeChatMiniProgramNotificationPublishProvider.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.MiniProgram/LINGYUN/Abp/Notifications/WeChat/MiniProgram/WeChatMiniProgramNotificationPublishProvider.cs index b6060aa59..bb02fbd1b 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.MiniProgram/LINGYUN/Abp/Notifications/WeChat/MiniProgram/WeChatMiniProgramNotificationPublishProvider.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.MiniProgram/LINGYUN/Abp/Notifications/WeChat/MiniProgram/WeChatMiniProgramNotificationPublishProvider.cs @@ -9,116 +9,115 @@ using System.Threading.Tasks; using Volo.Abp.Features; -namespace LINGYUN.Abp.Notifications.WeChat.MiniProgram +namespace LINGYUN.Abp.Notifications.WeChat.MiniProgram; + +/// +/// 微信小程序消息推送提供者 +/// +public class WeChatMiniProgramNotificationPublishProvider : NotificationPublishProvider { - /// - /// 微信小程序消息推送提供者 - /// - public class WeChatMiniProgramNotificationPublishProvider : NotificationPublishProvider + public const string ProviderName = NotificationProviderNames.WechatMiniProgram; + public override string Name => ProviderName; + protected IFeatureChecker FeatureChecker { get; } + protected ISubscribeMessager SubscribeMessager { get; } + protected AbpNotificationsWeChatMiniProgramOptions Options { get; } + public WeChatMiniProgramNotificationPublishProvider( + IFeatureChecker featureChecker, + ISubscribeMessager subscribeMessager, + IOptions options) + { + Options = options.Value; + FeatureChecker = featureChecker; + SubscribeMessager = subscribeMessager; + } + + protected async override Task CanPublishAsync(NotificationInfo notification, CancellationToken cancellationToken = default) { - public const string ProviderName = NotificationProviderNames.WechatMiniProgram; - public override string Name => ProviderName; - protected IFeatureChecker FeatureChecker { get; } - protected ISubscribeMessager SubscribeMessager { get; } - protected AbpNotificationsWeChatMiniProgramOptions Options { get; } - public WeChatMiniProgramNotificationPublishProvider( - IFeatureChecker featureChecker, - ISubscribeMessager subscribeMessager, - IOptions options) + if (!await FeatureChecker.IsEnabledAsync(true, + WeChatMiniProgramFeatures.Enable, + WeChatMiniProgramFeatures.Messages.Enable)) { - Options = options.Value; - FeatureChecker = featureChecker; - SubscribeMessager = subscribeMessager; + Logger.LogWarning( + "{0} cannot push messages because the feature {1} is not enabled", + Name, + WeChatMiniProgramFeatures.Messages.Enable); + return false; } + return true; + } + + protected async override Task PublishAsync(NotificationInfo notification, IEnumerable identifiers, CancellationToken cancellationToken = default) + { + // step1 默认微信openid绑定的就是username, + // 如果不是,需要自行处理openid获取逻辑 + + // step2 调用微信消息推送接口 - protected async override Task CanPublishAsync(NotificationInfo notification, CancellationToken cancellationToken = default) + // 微信不支持推送到所有用户 + // 在小程序里用户订阅消息后通过 api/subscribes/subscribe 接口订阅对应模板消息 + foreach (var identifier in identifiers) { - if (!await FeatureChecker.IsEnabledAsync(true, - WeChatMiniProgramFeatures.Enable, - WeChatMiniProgramFeatures.Messages.Enable)) - { - Logger.LogWarning( - "{0} cannot push messages because the feature {1} is not enabled", - Name, - WeChatMiniProgramFeatures.Messages.Enable); - return false; - } - return true; + await SendWeChatTemplateMessagAsync(notification, identifier, cancellationToken); } + } - protected async override Task PublishAsync(NotificationInfo notification, IEnumerable identifiers, CancellationToken cancellationToken = default) + protected async virtual Task SendWeChatTemplateMessagAsync(NotificationInfo notification, UserIdentifier identifier, CancellationToken cancellationToken = default) + { + var templateId = GetOrDefaultTemplateId(notification.Data); + if (templateId.IsNullOrWhiteSpace()) { - // step1 默认微信openid绑定的就是username, - // 如果不是,需要自行处理openid获取逻辑 + Logger.LogWarning("Wechat weapp template id be empty, can not send notification!"); + return; + } - // step2 调用微信消息推送接口 + Logger.LogDebug($"Get wechat weapp template id: {templateId}"); - // 微信不支持推送到所有用户 - // 在小程序里用户订阅消息后通过 api/subscribes/subscribe 接口订阅对应模板消息 - foreach (var identifier in identifiers) - { - await SendWeChatTemplateMessagAsync(notification, identifier, cancellationToken); - } - } + var redirect = GetOrDefault(notification.Data, "RedirectPage", null); + Logger.LogDebug($"Get wechat weapp redirect page: {redirect ?? "null"}"); - protected async virtual Task SendWeChatTemplateMessagAsync(NotificationInfo notification, UserIdentifier identifier, CancellationToken cancellationToken = default) + var weAppState = GetOrDefault(notification.Data, "WeAppState", Options.DefaultState); + Logger.LogDebug($"Get wechat weapp state: {weAppState ?? null}"); + + var weAppLang = GetOrDefault(notification.Data, "WeAppLanguage", Options.DefaultLanguage); + Logger.LogDebug($"Get wechat weapp language: {weAppLang ?? null}"); + + // TODO: 如果微信端发布通知,请组装好 openid 字段在通知数据内容里面 + var openId = GetOrDefault(notification.Data, AbpWeChatClaimTypes.OpenId, ""); + + if (openId.IsNullOrWhiteSpace()) { - var templateId = GetOrDefaultTemplateId(notification.Data); - if (templateId.IsNullOrWhiteSpace()) - { - Logger.LogWarning("Wechat weapp template id be empty, can not send notification!"); - return; - } - - Logger.LogDebug($"Get wechat weapp template id: {templateId}"); - - var redirect = GetOrDefault(notification.Data, "RedirectPage", null); - Logger.LogDebug($"Get wechat weapp redirect page: {redirect ?? "null"}"); - - var weAppState = GetOrDefault(notification.Data, "WeAppState", Options.DefaultState); - Logger.LogDebug($"Get wechat weapp state: {weAppState ?? null}"); - - var weAppLang = GetOrDefault(notification.Data, "WeAppLanguage", Options.DefaultLanguage); - Logger.LogDebug($"Get wechat weapp language: {weAppLang ?? null}"); - - // TODO: 如果微信端发布通知,请组装好 openid 字段在通知数据内容里面 - var openId = GetOrDefault(notification.Data, AbpWeChatClaimTypes.OpenId, ""); - - if (openId.IsNullOrWhiteSpace()) - { - // 发送小程序订阅消息 - await SubscribeMessager - .SendAsync( - identifier.UserId, templateId, redirect, weAppLang, - weAppState, notification.Data.ExtraProperties, cancellationToken); - } - else - { - var weChatWeAppNotificationData = new SubscribeMessage(templateId, redirect, weAppState, weAppLang); - // 写入模板数据 - weChatWeAppNotificationData.WriteData(notification.Data.ExtraProperties); - - Logger.LogDebug($"Sending wechat weapp notification: {notification.Name}"); - - // 发送小程序订阅消息 - await SubscribeMessager.SendAsync(weChatWeAppNotificationData, cancellationToken); - } + // 发送小程序订阅消息 + await SubscribeMessager + .SendAsync( + identifier.UserId, templateId, redirect, weAppLang, + weAppState, notification.Data.ExtraProperties, cancellationToken); } - - protected string GetOrDefaultTemplateId(NotificationData data) + else { - return GetOrDefault(data, "TemplateId", Options.DefaultTemplateId); + var weChatWeAppNotificationData = new SubscribeMessage(templateId, redirect, weAppState, weAppLang); + // 写入模板数据 + weChatWeAppNotificationData.WriteData(notification.Data.ExtraProperties); + + Logger.LogDebug($"Sending wechat weapp notification: {notification.Name}"); + + // 发送小程序订阅消息 + await SubscribeMessager.SendAsync(weChatWeAppNotificationData, cancellationToken); } + } - protected string GetOrDefault(NotificationData data, string key, string defaultValue) + protected string GetOrDefaultTemplateId(NotificationData data) + { + return GetOrDefault(data, "TemplateId", Options.DefaultTemplateId); + } + + protected string GetOrDefault(NotificationData data, string key, string defaultValue) + { + if (data.ExtraProperties.TryGetValue(key, out var value)) { - if (data.ExtraProperties.TryGetValue(key, out var value)) - { - // 取得了数据就删除对应键值 - // data.Properties.Remove(key); - return value.ToString(); - } - return defaultValue; + // 取得了数据就删除对应键值 + // data.Properties.Remove(key); + return value.ToString(); } + return defaultValue; } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.Work/LINGYUN.Abp.Notifications.WeChat.Work.csproj b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.Work/LINGYUN.Abp.Notifications.WeChat.Work.csproj index 77c9c19a9..52c490474 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.Work/LINGYUN.Abp.Notifications.WeChat.Work.csproj +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WeChat.Work/LINGYUN.Abp.Notifications.WeChat.Work.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + net8.0 + LINGYUN.Abp.Notifications.WeChat.Work + LINGYUN.Abp.Notifications.WeChat.Work + false + false + false diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WxPusher/LINGYUN.Abp.Notifications.WxPusher.csproj b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WxPusher/LINGYUN.Abp.Notifications.WxPusher.csproj index 12474988c..7d83545eb 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WxPusher/LINGYUN.Abp.Notifications.WxPusher.csproj +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.WxPusher/LINGYUN.Abp.Notifications.WxPusher.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Notifications.WxPusher + LINGYUN.Abp.Notifications.WxPusher + false + false + false diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN.Abp.Notifications.csproj b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN.Abp.Notifications.csproj index 9eaf01f30..54b2a2447 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN.Abp.Notifications.csproj +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN.Abp.Notifications.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Notifications + LINGYUN.Abp.Notifications + false + false + false diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/AbpNotificationsModule.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/AbpNotificationsModule.cs index 14ec7f2cd..c8a015343 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/AbpNotificationsModule.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/AbpNotificationsModule.cs @@ -8,32 +8,30 @@ using Volo.Abp.TextTemplating; using Volo.Abp.VirtualFileSystem; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +[DependsOn( + typeof(AbpNotificationsCoreModule), + typeof(AbpBackgroundWorkersModule), + typeof(AbpBackgroundJobsAbstractionsModule), + typeof(AbpIdGeneratorModule), + typeof(AbpLocalizationModule), + typeof(AbpEventBusModule), + typeof(AbpTextTemplatingCoreModule))] +public class AbpNotificationsModule : AbpModule { - // TODO: 需要重命名 AbpNotificationsModule - [DependsOn( - typeof(AbpNotificationsCoreModule), - typeof(AbpBackgroundWorkersModule), - typeof(AbpBackgroundJobsAbstractionsModule), - typeof(AbpIdGeneratorModule), - typeof(AbpLocalizationModule), - typeof(AbpEventBusModule), - typeof(AbpTextTemplatingCoreModule))] - public class AbpNotificationsModule : AbpModule + public override void ConfigureServices(ServiceConfigurationContext context) { - public override void ConfigureServices(ServiceConfigurationContext context) + Configure(options => { - Configure(options => - { - options.FileSets.AddEmbedded(); - }); + options.FileSets.AddEmbedded(); + }); - Configure(options => - { - options.Resources - .Get() - .AddVirtualJson("/LINGYUN/Abp/Notifications/Localization/Resources"); - }); - } + Configure(options => + { + options.Resources + .Get() + .AddVirtualJson("/LINGYUN/Abp/Notifications/Localization/Resources"); + }); } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/DefaultNotificationDataSerializer.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/DefaultNotificationDataSerializer.cs index de8d79c88..16ce6037f 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/DefaultNotificationDataSerializer.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/DefaultNotificationDataSerializer.cs @@ -14,18 +14,24 @@ public NotificationData Serialize(NotificationData source) if (source.NeedLocalizer()) { // 潜在的空对象引用修复 - if (source.ExtraProperties.TryGetValue("title", out var title) && title != null) + if (source.ExtraProperties.TryGetValue("title", out var title) && + title != null && + title is not LocalizableStringInfo) { var titleObj = JsonConvert.DeserializeObject(title.ToString()); source.TrySetData("title", titleObj); } - if (source.ExtraProperties.TryGetValue("message", out var message) && message != null) + if (source.ExtraProperties.TryGetValue("message", out var message) && + message != null && + message is not LocalizableStringInfo) { var messageObj = JsonConvert.DeserializeObject(message.ToString()); source.TrySetData("message", messageObj); } - if (source.ExtraProperties.TryGetValue("description", out var description) && description != null) + if (source.ExtraProperties.TryGetValue("description", out var description) && + description != null && + description is not LocalizableStringInfo) { var descriptionObj = JsonConvert.DeserializeObject(description.ToString()); source.TrySetData("description", descriptionObj); diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationPublishProvider.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationPublishProvider.cs index 279236098..c738a7440 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationPublishProvider.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationPublishProvider.cs @@ -1,25 +1,24 @@ using System.Collections.Generic; using System.Threading.Tasks; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +/// +/// 通知发布提供者接口 +/// +public interface INotificationPublishProvider { /// - /// 通知发布提供者接口 + /// 名称 + /// + string Name { get; } + /// + /// 发布通知 /// - public interface INotificationPublishProvider - { - /// - /// 名称 - /// - string Name { get; } - /// - /// 发布通知 - /// - /// 通知信息 - /// 接收用户列表 - /// - Task PublishAsync( - NotificationInfo notification, - IEnumerable identifiers); - } + /// 通知信息 + /// 接收用户列表 + /// + Task PublishAsync( + NotificationInfo notification, + IEnumerable identifiers); } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationPublishProviderManager.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationPublishProviderManager.cs index 630b932c9..af7924c65 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationPublishProviderManager.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationPublishProviderManager.cs @@ -1,9 +1,8 @@ using System.Collections.Generic; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public interface INotificationPublishProviderManager { - public interface INotificationPublishProviderManager - { - List Providers { get; } - } + List Providers { get; } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationSender.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationSender.cs index 6c536386b..b3aef5a5e 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationSender.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationSender.cs @@ -2,46 +2,45 @@ using System.Collections.Generic; using System.Threading.Tasks; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +/// +/// 发送通知接口 +/// +public interface INotificationSender { /// - /// 发送通知接口 + /// 发送通知 + /// + /// 名称 + /// 数据 + /// 用户列表,为空标识发给所有订阅用户 + /// 租户 + /// 严重级别 + /// 使用通知提供程序 + /// 通知标识 + Task SendNofiterAsync( + string name, + NotificationData data, + IEnumerable users = null, + Guid? tenantId = null, + NotificationSeverity severity = NotificationSeverity.Info, + IEnumerable useProviders = null); + /// + /// 发送模板通知 /// - public interface INotificationSender - { - /// - /// 发送通知 - /// - /// 名称 - /// 数据 - /// 用户列表,为空标识发给所有订阅用户 - /// 租户 - /// 严重级别 - /// 使用通知提供程序 - /// 通知标识 - Task SendNofiterAsync( - string name, - NotificationData data, - IEnumerable users = null, - Guid? tenantId = null, - NotificationSeverity severity = NotificationSeverity.Info, - IEnumerable useProviders = null); - /// - /// 发送模板通知 - /// - /// 名称 - /// 模板对象 - /// 用户列表,为空标识发给所有订阅用户 - /// 租户 - /// 严重级别 - /// 使用通知提供程序 - /// - Task SendNofiterAsync( - string name, - NotificationTemplate template, - IEnumerable users = null, - Guid? tenantId = null, - NotificationSeverity severity = NotificationSeverity.Info, - IEnumerable useProviders = null); - } + /// 名称 + /// 模板对象 + /// 用户列表,为空标识发给所有订阅用户 + /// 租户 + /// 严重级别 + /// 使用通知提供程序 + /// + Task SendNofiterAsync( + string name, + NotificationTemplate template, + IEnumerable users = null, + Guid? tenantId = null, + NotificationSeverity severity = NotificationSeverity.Info, + IEnumerable useProviders = null); } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationStore.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationStore.cs index 2794d3fc2..7871a7423 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationStore.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationStore.cs @@ -3,130 +3,129 @@ using System.Threading; using System.Threading.Tasks; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public interface INotificationStore { - public interface INotificationStore - { - Task InsertUserSubscriptionAsync( - Guid? tenantId, - UserIdentifier identifier, - string notificationName, - CancellationToken cancellationToken = default); - - Task InsertUserSubscriptionAsync( - Guid? tenantId, - IEnumerable identifiers, - string notificationName, - CancellationToken cancellationToken = default); - - Task DeleteUserSubscriptionAsync( - Guid? tenantId, - Guid userId, - string notificationName, - CancellationToken cancellationToken = default); - - Task DeleteAllUserSubscriptionAsync( - Guid? tenantId, - string notificationName, - CancellationToken cancellationToken = default); - - Task DeleteUserSubscriptionAsync( - Guid? tenantId, - IEnumerable identifiers, - string notificationName, - CancellationToken cancellationToken = default); - - Task> GetUserSubscriptionsAsync( - Guid? tenantId, - string notificationName, - IEnumerable identifiers = null, - CancellationToken cancellationToken = default); - - Task> GetUserSubscriptionsAsync( - Guid? tenantId, - Guid userId, - CancellationToken cancellationToken = default); - - Task> GetUserSubscriptionsAsync( - Guid? tenantId, - string userName, - CancellationToken cancellationToken = default); - - Task IsSubscribedAsync( - Guid? tenantId, - Guid userId, - string notificationName, - CancellationToken cancellationToken = default); - - Task InsertNotificationAsync( - NotificationInfo notification, - CancellationToken cancellationToken = default); - - Task DeleteNotificationAsync( - NotificationInfo notification, - CancellationToken cancellationToken = default); - - Task DeleteNotificationAsync( - int batchCount, - CancellationToken cancellationToken = default); - - Task InsertUserNotificationAsync( - NotificationInfo notification, - Guid userId, - CancellationToken cancellationToken = default); - - Task InsertUserNotificationsAsync( - NotificationInfo notification, - IEnumerable userIds, - CancellationToken cancellationToken = default); - - Task DeleteUserNotificationAsync( - Guid? tenantId, - Guid userId, - long notificationId, - CancellationToken cancellationToken = default); - - Task GetNotificationOrNullAsync( - Guid? tenantId, - long notificationId, - CancellationToken cancellationToken = default); - - Task> GetUserNotificationsAsync( - Guid? tenantId, - Guid userId, - NotificationReadState? readState = null, - int maxResultCount = 10, - CancellationToken cancellationToken = default); - - Task GetUserNotificationsCountAsync( - Guid? tenantId, - Guid userId, - string filter = "", - NotificationReadState? readState = null, - CancellationToken cancellationToken = default); - - Task> GetUserNotificationsAsync( - Guid? tenantId, - Guid userId, - string filter = "", - string sorting = nameof(NotificationInfo.CreationTime), - NotificationReadState? readState = null, - int skipCount = 1, - int maxResultCount = 10, - CancellationToken cancellationToken = default); - - Task ChangeUserNotificationReadStateAsync( - Guid? tenantId, - Guid userId, - long notificationId, - NotificationReadState readState, - CancellationToken cancellationToken = default); - - Task ChangeUserNotificationsReadStateAsync( - Guid? tenantId, - Guid userId, - IEnumerable notificationIds, - NotificationReadState readState, - CancellationToken cancellationToken = default); - } + Task InsertUserSubscriptionAsync( + Guid? tenantId, + UserIdentifier identifier, + string notificationName, + CancellationToken cancellationToken = default); + + Task InsertUserSubscriptionAsync( + Guid? tenantId, + IEnumerable identifiers, + string notificationName, + CancellationToken cancellationToken = default); + + Task DeleteUserSubscriptionAsync( + Guid? tenantId, + Guid userId, + string notificationName, + CancellationToken cancellationToken = default); + + Task DeleteAllUserSubscriptionAsync( + Guid? tenantId, + string notificationName, + CancellationToken cancellationToken = default); + + Task DeleteUserSubscriptionAsync( + Guid? tenantId, + IEnumerable identifiers, + string notificationName, + CancellationToken cancellationToken = default); + + Task> GetUserSubscriptionsAsync( + Guid? tenantId, + string notificationName, + IEnumerable identifiers = null, + CancellationToken cancellationToken = default); + + Task> GetUserSubscriptionsAsync( + Guid? tenantId, + Guid userId, + CancellationToken cancellationToken = default); + + Task> GetUserSubscriptionsAsync( + Guid? tenantId, + string userName, + CancellationToken cancellationToken = default); + + Task IsSubscribedAsync( + Guid? tenantId, + Guid userId, + string notificationName, + CancellationToken cancellationToken = default); + + Task InsertNotificationAsync( + NotificationInfo notification, + CancellationToken cancellationToken = default); + + Task DeleteNotificationAsync( + NotificationInfo notification, + CancellationToken cancellationToken = default); + + Task DeleteNotificationAsync( + int batchCount, + CancellationToken cancellationToken = default); + + Task InsertUserNotificationAsync( + NotificationInfo notification, + Guid userId, + CancellationToken cancellationToken = default); + + Task InsertUserNotificationsAsync( + NotificationInfo notification, + IEnumerable userIds, + CancellationToken cancellationToken = default); + + Task DeleteUserNotificationAsync( + Guid? tenantId, + Guid userId, + long notificationId, + CancellationToken cancellationToken = default); + + Task GetNotificationOrNullAsync( + Guid? tenantId, + long notificationId, + CancellationToken cancellationToken = default); + + Task> GetUserNotificationsAsync( + Guid? tenantId, + Guid userId, + NotificationReadState? readState = null, + int maxResultCount = 10, + CancellationToken cancellationToken = default); + + Task GetUserNotificationsCountAsync( + Guid? tenantId, + Guid userId, + string filter = "", + NotificationReadState? readState = null, + CancellationToken cancellationToken = default); + + Task> GetUserNotificationsAsync( + Guid? tenantId, + Guid userId, + string filter = "", + string sorting = nameof(NotificationInfo.CreationTime), + NotificationReadState? readState = null, + int skipCount = 1, + int maxResultCount = 10, + CancellationToken cancellationToken = default); + + Task ChangeUserNotificationReadStateAsync( + Guid? tenantId, + Guid userId, + long notificationId, + NotificationReadState readState, + CancellationToken cancellationToken = default); + + Task ChangeUserNotificationsReadStateAsync( + Guid? tenantId, + Guid userId, + IEnumerable notificationIds, + NotificationReadState readState, + CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationSubscriptionManager.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationSubscriptionManager.cs index 04b32eaea..fd0c9f661 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationSubscriptionManager.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationSubscriptionManager.cs @@ -3,114 +3,113 @@ using System.Threading; using System.Threading.Tasks; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +/// +/// 通知订阅管理器 +/// +public interface INotificationSubscriptionManager { /// - /// 通知订阅管理器 + /// 是否已订阅 + /// + /// 租户 + /// 用户标识 + /// 通知名称 + /// + Task IsSubscribedAsync( + Guid? tenantId, + Guid userId, + string notificationName, + CancellationToken cancellationToken = default); + /// + /// 订阅通知 + /// + /// 租户 + /// 用户标识 + /// 通知名称 + /// + Task SubscribeAsync( + Guid? tenantId, + UserIdentifier identifier, + string notificationName, + CancellationToken cancellationToken = default); + /// + /// 订阅通知 + /// + /// 租户 + /// 用户标识列表 + /// 通知名称 + /// + Task SubscribeAsync( + Guid? tenantId, + IEnumerable identifiers, + string notificationName, + CancellationToken cancellationToken = default); + /// + /// 取消所有用户订阅 + /// + /// 租户 + /// 通知名称 + /// + Task UnsubscribeAllAsync( + Guid? tenantId, + string notificationName, + CancellationToken cancellationToken = default); + /// + /// 取消订阅 + /// + /// 租户 + /// 用户标识 + /// 通知名称 + /// + Task UnsubscribeAsync( + Guid? tenantId, + UserIdentifier identifier, + string notificationName, + CancellationToken cancellationToken = default); + /// + /// 取消订阅 + /// + /// 租户 + /// 用户标识列表 + /// 通知名称 + /// + Task UnsubscribeAsync( + Guid? tenantId, + IEnumerable identifiers, + string notificationName, + CancellationToken cancellationToken = default); + /// + /// 获取通知被订阅用户列表 + /// + /// 租户 + /// 通知名称 + /// 需要检查的用户列表 + /// + Task> GetUsersSubscriptionsAsync( + Guid? tenantId, + string notificationName, + IEnumerable identifiers = null, + CancellationToken cancellationToken = default); + /// + /// 获取用户订阅列表 + /// + /// 租户 + /// 用户标识 + /// + Task> GetUserSubscriptionsAsync( + Guid? tenantId, + Guid userId, + CancellationToken cancellationToken = default); + /// + /// 获取用户订阅列表 /// - public interface INotificationSubscriptionManager - { - /// - /// 是否已订阅 - /// - /// 租户 - /// 用户标识 - /// 通知名称 - /// - Task IsSubscribedAsync( - Guid? tenantId, - Guid userId, - string notificationName, - CancellationToken cancellationToken = default); - /// - /// 订阅通知 - /// - /// 租户 - /// 用户标识 - /// 通知名称 - /// - Task SubscribeAsync( - Guid? tenantId, - UserIdentifier identifier, - string notificationName, - CancellationToken cancellationToken = default); - /// - /// 订阅通知 - /// - /// 租户 - /// 用户标识列表 - /// 通知名称 - /// - Task SubscribeAsync( - Guid? tenantId, - IEnumerable identifiers, - string notificationName, - CancellationToken cancellationToken = default); - /// - /// 取消所有用户订阅 - /// - /// 租户 - /// 通知名称 - /// - Task UnsubscribeAllAsync( - Guid? tenantId, - string notificationName, - CancellationToken cancellationToken = default); - /// - /// 取消订阅 - /// - /// 租户 - /// 用户标识 - /// 通知名称 - /// - Task UnsubscribeAsync( - Guid? tenantId, - UserIdentifier identifier, - string notificationName, - CancellationToken cancellationToken = default); - /// - /// 取消订阅 - /// - /// 租户 - /// 用户标识列表 - /// 通知名称 - /// - Task UnsubscribeAsync( - Guid? tenantId, - IEnumerable identifiers, - string notificationName, - CancellationToken cancellationToken = default); - /// - /// 获取通知被订阅用户列表 - /// - /// 租户 - /// 通知名称 - /// 需要检查的用户列表 - /// - Task> GetUsersSubscriptionsAsync( - Guid? tenantId, - string notificationName, - IEnumerable identifiers = null, - CancellationToken cancellationToken = default); - /// - /// 获取用户订阅列表 - /// - /// 租户 - /// 用户标识 - /// - Task> GetUserSubscriptionsAsync( - Guid? tenantId, - Guid userId, - CancellationToken cancellationToken = default); - /// - /// 获取用户订阅列表 - /// - /// 租户 - /// 用户名 - /// - Task> GetUserSubscriptionsAsync( - Guid? tenantId, - string userName, - CancellationToken cancellationToken = default); - } + /// 租户 + /// 用户名 + /// + Task> GetUserSubscriptionsAsync( + Guid? tenantId, + string userName, + CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Internal/NotificationSender.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Internal/NotificationSender.cs index 5d97b20bc..20cf7f307 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Internal/NotificationSender.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Internal/NotificationSender.cs @@ -11,105 +11,104 @@ using Volo.Abp.Timing; using Volo.Abp.Uow; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +/// +/// 默认实现通过分布式事件发送通知 +/// 可替换实现来发送实时通知 +/// +public class NotificationSender : INotificationSender, ITransientDependency { /// - /// 默认实现通过分布式事件发送通知 - /// 可替换实现来发送实时通知 + /// Reference to . + /// + protected IClock Clock { get; } + /// + /// Reference to . + /// + public ILogger Logger { get; set; } + /// + /// Reference to . + /// + public IDistributedEventBus DistributedEventBus { get; } + /// + /// Reference to . /// - public class NotificationSender : INotificationSender, ITransientDependency + protected IDistributedIdGenerator DistributedIdGenerator { get; } + /// + /// Reference to . + /// + protected IUnitOfWorkManager UnitOfWorkManager { get; } + + protected AbpNotificationsPublishOptions Options { get; } + public NotificationSender( + IClock clock, + IDistributedEventBus distributedEventBus, + IDistributedIdGenerator distributedIdGenerator, + IUnitOfWorkManager unitOfWorkManager, + IOptions options) { - /// - /// Reference to . - /// - protected IClock Clock { get; } - /// - /// Reference to . - /// - public ILogger Logger { get; set; } - /// - /// Reference to . - /// - public IDistributedEventBus DistributedEventBus { get; } - /// - /// Reference to . - /// - protected IDistributedIdGenerator DistributedIdGenerator { get; } - /// - /// Reference to . - /// - protected IUnitOfWorkManager UnitOfWorkManager { get; } + Clock = clock; + Options = options.Value; + DistributedEventBus = distributedEventBus; + DistributedIdGenerator = distributedIdGenerator; + UnitOfWorkManager = unitOfWorkManager; + Logger = NullLogger.Instance; + } - protected AbpNotificationsPublishOptions Options { get; } - public NotificationSender( - IClock clock, - IDistributedEventBus distributedEventBus, - IDistributedIdGenerator distributedIdGenerator, - IUnitOfWorkManager unitOfWorkManager, - IOptions options) - { - Clock = clock; - Options = options.Value; - DistributedEventBus = distributedEventBus; - DistributedIdGenerator = distributedIdGenerator; - UnitOfWorkManager = unitOfWorkManager; - Logger = NullLogger.Instance; - } + public async virtual Task SendNofiterAsync( + string name, + NotificationData data, + IEnumerable users = null, + Guid? tenantId = null, + NotificationSeverity severity = NotificationSeverity.Info, + IEnumerable useProviders = null) + { + return await PublishNofiterAsync(name, data, users, tenantId, severity, useProviders); + } - public async virtual Task SendNofiterAsync( - string name, - NotificationData data, - IEnumerable users = null, - Guid? tenantId = null, - NotificationSeverity severity = NotificationSeverity.Info, - IEnumerable useProviders = null) - { - return await PublishNofiterAsync(name, data, users, tenantId, severity, useProviders); - } + public async virtual Task SendNofiterAsync( + string name, + NotificationTemplate template, + IEnumerable users = null, + Guid? tenantId = null, + NotificationSeverity severity = NotificationSeverity.Info, + IEnumerable useProviders = null) + { + return await PublishNofiterAsync(name, template, users, tenantId, severity, useProviders); + } - public async virtual Task SendNofiterAsync( - string name, - NotificationTemplate template, - IEnumerable users = null, - Guid? tenantId = null, - NotificationSeverity severity = NotificationSeverity.Info, - IEnumerable useProviders = null) + protected async virtual Task PublishNofiterAsync( + string name, + TData data, + IEnumerable users = null, + Guid? tenantId = null, + NotificationSeverity severity = NotificationSeverity.Info, + IEnumerable useProviders = null) + { + var eto = new NotificationEto(data) { - return await PublishNofiterAsync(name, template, users, tenantId, severity, useProviders); - } + Id = DistributedIdGenerator.Create(), + TenantId = tenantId, + Users = users?.ToList() ?? new List(), + Name = name, + CreationTime = Clock.Now, + Severity = severity, + UseProviders = useProviders?.ToList() ?? new List() + }; - protected async virtual Task PublishNofiterAsync( - string name, - TData data, - IEnumerable users = null, - Guid? tenantId = null, - NotificationSeverity severity = NotificationSeverity.Info, - IEnumerable useProviders = null) + if (UnitOfWorkManager.Current != null) { - var eto = new NotificationEto(data) - { - Id = DistributedIdGenerator.Create(), - TenantId = tenantId, - Users = users?.ToList() ?? new List(), - Name = name, - CreationTime = Clock.Now, - Severity = severity, - UseProviders = useProviders?.ToList() ?? new List() - }; - - if (UnitOfWorkManager.Current != null) - { - UnitOfWorkManager.Current.OnCompleted(async () => - { - await DistributedEventBus.PublishAsync(eto); - }); - } - else + UnitOfWorkManager.Current.OnCompleted(async () => { await DistributedEventBus.PublishAsync(eto); - } - - return eto.Id.ToString(); + }); } + else + { + await DistributedEventBus.PublishAsync(eto); + } + + return eto.Id.ToString(); } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Internal/NotificationSubscriptionManager.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Internal/NotificationSubscriptionManager.cs index aedef2807..5b3e870ed 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Internal/NotificationSubscriptionManager.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Internal/NotificationSubscriptionManager.cs @@ -4,101 +4,100 @@ using System.Threading.Tasks; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.Notifications.Internal +namespace LINGYUN.Abp.Notifications.Internal; + +internal class NotificationSubscriptionManager : INotificationSubscriptionManager, ITransientDependency { - internal class NotificationSubscriptionManager : INotificationSubscriptionManager, ITransientDependency - { - private readonly INotificationStore _store; + private readonly INotificationStore _store; - public NotificationSubscriptionManager( - INotificationStore store) - { - _store = store; - } + public NotificationSubscriptionManager( + INotificationStore store) + { + _store = store; + } - public async virtual Task> GetUsersSubscriptionsAsync( - Guid? tenantId, - string notificationName, - IEnumerable identifiers = null, - CancellationToken cancellationToken = default) - { - return await _store.GetUserSubscriptionsAsync(tenantId, notificationName, identifiers, cancellationToken); - } + public async virtual Task> GetUsersSubscriptionsAsync( + Guid? tenantId, + string notificationName, + IEnumerable identifiers = null, + CancellationToken cancellationToken = default) + { + return await _store.GetUserSubscriptionsAsync(tenantId, notificationName, identifiers, cancellationToken); + } - public async virtual Task> GetUserSubscriptionsAsync( - Guid? tenantId, - Guid userId, - CancellationToken cancellationToken = default) - { - return await _store.GetUserSubscriptionsAsync(tenantId, userId, cancellationToken); - } + public async virtual Task> GetUserSubscriptionsAsync( + Guid? tenantId, + Guid userId, + CancellationToken cancellationToken = default) + { + return await _store.GetUserSubscriptionsAsync(tenantId, userId, cancellationToken); + } - public async virtual Task> GetUserSubscriptionsAsync( - Guid? tenantId, - string userName, - CancellationToken cancellationToken = default) - { - return await _store.GetUserSubscriptionsAsync(tenantId, userName, cancellationToken); - } + public async virtual Task> GetUserSubscriptionsAsync( + Guid? tenantId, + string userName, + CancellationToken cancellationToken = default) + { + return await _store.GetUserSubscriptionsAsync(tenantId, userName, cancellationToken); + } - public async virtual Task IsSubscribedAsync( - Guid? tenantId, - Guid userId, - string notificationName, - CancellationToken cancellationToken = default) - { - return await _store.IsSubscribedAsync(tenantId, userId, notificationName, cancellationToken); - } + public async virtual Task IsSubscribedAsync( + Guid? tenantId, + Guid userId, + string notificationName, + CancellationToken cancellationToken = default) + { + return await _store.IsSubscribedAsync(tenantId, userId, notificationName, cancellationToken); + } - public async virtual Task SubscribeAsync( - Guid? tenantId, - UserIdentifier identifier, - string notificationName, - CancellationToken cancellationToken = default) + public async virtual Task SubscribeAsync( + Guid? tenantId, + UserIdentifier identifier, + string notificationName, + CancellationToken cancellationToken = default) + { + if (await IsSubscribedAsync(tenantId, identifier.UserId, notificationName, cancellationToken)) { - if (await IsSubscribedAsync(tenantId, identifier.UserId, notificationName, cancellationToken)) - { - return; - } - await _store.InsertUserSubscriptionAsync(tenantId, identifier, notificationName, cancellationToken); + return; } + await _store.InsertUserSubscriptionAsync(tenantId, identifier, notificationName, cancellationToken); + } - public async virtual Task SubscribeAsync( - Guid? tenantId, - IEnumerable identifiers, - string notificationName, - CancellationToken cancellationToken = default) + public async virtual Task SubscribeAsync( + Guid? tenantId, + IEnumerable identifiers, + string notificationName, + CancellationToken cancellationToken = default) + { + foreach(var identifier in identifiers) { - foreach(var identifier in identifiers) - { - await SubscribeAsync(tenantId, identifier, notificationName, cancellationToken); - } + await SubscribeAsync(tenantId, identifier, notificationName, cancellationToken); } + } - public async virtual Task UnsubscribeAsync( - Guid? tenantId, - UserIdentifier identifier, - string notificationName, - CancellationToken cancellationToken = default) - { - await _store.DeleteUserSubscriptionAsync(tenantId, identifier.UserId, notificationName, cancellationToken); - } + public async virtual Task UnsubscribeAsync( + Guid? tenantId, + UserIdentifier identifier, + string notificationName, + CancellationToken cancellationToken = default) + { + await _store.DeleteUserSubscriptionAsync(tenantId, identifier.UserId, notificationName, cancellationToken); + } - public async virtual Task UnsubscribeAllAsync( - Guid? tenantId, - string notificationName, - CancellationToken cancellationToken = default) - { - await _store.DeleteAllUserSubscriptionAsync(tenantId, notificationName, cancellationToken); - } + public async virtual Task UnsubscribeAllAsync( + Guid? tenantId, + string notificationName, + CancellationToken cancellationToken = default) + { + await _store.DeleteAllUserSubscriptionAsync(tenantId, notificationName, cancellationToken); + } - public async virtual Task UnsubscribeAsync( - Guid? tenantId, - IEnumerable identifiers, - string notificationName, - CancellationToken cancellationToken = default) - { - await _store.DeleteUserSubscriptionAsync(tenantId, identifiers, notificationName, cancellationToken); - } + public async virtual Task UnsubscribeAsync( + Guid? tenantId, + IEnumerable identifiers, + string notificationName, + CancellationToken cancellationToken = default) + { + await _store.DeleteUserSubscriptionAsync(tenantId, identifiers, notificationName, cancellationToken); } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDataMappingDictionary.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDataMappingDictionary.cs index 3ed2b7186..1a0d870ce 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDataMappingDictionary.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDataMappingDictionary.cs @@ -2,59 +2,58 @@ using System.Collections.Generic; using System.Linq; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public class NotificationDataMappingDictionary : Dictionary> { - public class NotificationDataMappingDictionary : Dictionary> + public static string DefaultKey { get; set; } = "Default"; + /// + /// 处理某个通知的数据 + /// 特定于一个提供程序 + /// + /// + /// + /// + public void Mapping(string provider, string name, Func func) { - public static string DefaultKey { get; set; } = "Default"; - /// - /// 处理某个通知的数据 - /// 特定于一个提供程序 - /// - /// - /// - /// - public void Mapping(string provider, string name, Func func) + if (!ContainsKey(provider)) { - if (!ContainsKey(provider)) - { - this[provider] = new List(); - } + this[provider] = new List(); + } - var mapItem = this[provider].FirstOrDefault(item => item.Name.Equals(name)); + var mapItem = this[provider].FirstOrDefault(item => item.Name.Equals(name)); - if (mapItem == null) - { - this[provider].Add(new NotificationDataMappingDictionaryItem(name, func)); - } - else - { - mapItem.Replace(func); - } + if (mapItem == null) + { + this[provider].Add(new NotificationDataMappingDictionaryItem(name, func)); } - /// - /// 处理所有通知的数据 - /// 特定于一个提供程序 - /// - /// - /// - public void MappingDefault(string provider, Func func) + else { - Mapping(provider, DefaultKey, func); + mapItem.Replace(func); } - /// - /// 获取需要处理数据的方法 - /// - /// - /// - /// - public NotificationDataMappingDictionaryItem GetMapItemOrDefault(string provider, string name) + } + /// + /// 处理所有通知的数据 + /// 特定于一个提供程序 + /// + /// + /// + public void MappingDefault(string provider, Func func) + { + Mapping(provider, DefaultKey, func); + } + /// + /// 获取需要处理数据的方法 + /// + /// + /// + /// + public NotificationDataMappingDictionaryItem GetMapItemOrDefault(string provider, string name) + { + if (ContainsKey(provider)) { - if (ContainsKey(provider)) - { - return this[provider].GetOrNullDefault(name); - } - return null; + return this[provider].GetOrNullDefault(name); } + return null; } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDataMappingDictionaryItem.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDataMappingDictionaryItem.cs index fcfc96a41..d652ee1c5 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDataMappingDictionaryItem.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDataMappingDictionaryItem.cs @@ -1,27 +1,26 @@ using System; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public class NotificationDataMappingDictionaryItem { - public class NotificationDataMappingDictionaryItem - { - /// - /// 通知名称 - /// - public string Name { get; } - /// - /// 转换方法 - /// - public Func MappingFunc { get; private set; } + /// + /// 通知名称 + /// + public string Name { get; } + /// + /// 转换方法 + /// + public Func MappingFunc { get; private set; } - public NotificationDataMappingDictionaryItem(string name, Func func) - { - Name = name; - MappingFunc = func; - } + public NotificationDataMappingDictionaryItem(string name, Func func) + { + Name = name; + MappingFunc = func; + } - public void Replace(Func func) - { - MappingFunc = func; - } + public void Replace(Func func) + { + MappingFunc = func; } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDataMappingDictionaryItemExtensions.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDataMappingDictionaryItemExtensions.cs index a6beb0832..d3d8bb25a 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDataMappingDictionaryItemExtensions.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDataMappingDictionaryItemExtensions.cs @@ -1,20 +1,19 @@ using System.Collections.Generic; using System.Linq; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public static class NotificationDataMappingDictionaryItemExtensions { - public static class NotificationDataMappingDictionaryItemExtensions + public static NotificationDataMappingDictionaryItem GetOrNullDefault( + this IEnumerable items, + string name) { - public static NotificationDataMappingDictionaryItem GetOrNullDefault( - this IEnumerable items, - string name) + var item = items.FirstOrDefault(i => i.Name.Equals(name)); + if (item == null) { - var item = items.FirstOrDefault(i => i.Name.Equals(name)); - if (item == null) - { - return items.FirstOrDefault(i => i.Name.Equals(NotificationDataMappingDictionary.DefaultKey)); - } - return item; + return items.FirstOrDefault(i => i.Name.Equals(NotificationDataMappingDictionary.DefaultKey)); } + return item; } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationPublishProvider.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationPublishProvider.cs index f8d1d34c2..2ef369a25 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationPublishProvider.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationPublishProvider.cs @@ -7,50 +7,49 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.Threading; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public abstract class NotificationPublishProvider : INotificationPublishProvider, ITransientDependency { - public abstract class NotificationPublishProvider : INotificationPublishProvider, ITransientDependency - { - public abstract string Name { get; } + public abstract string Name { get; } - public IAbpLazyServiceProvider ServiceProvider { protected get; set; } + public IAbpLazyServiceProvider ServiceProvider { protected get; set; } - public ILoggerFactory LoggerFactory => ServiceProvider.LazyGetRequiredService(); + public ILoggerFactory LoggerFactory => ServiceProvider.LazyGetRequiredService(); - protected ILogger Logger => _lazyLogger.Value; - private Lazy _lazyLogger => new Lazy(() => LoggerFactory?.CreateLogger(GetType().FullName) ?? NullLogger.Instance, true); + protected ILogger Logger => _lazyLogger.Value; + private Lazy _lazyLogger => new Lazy(() => LoggerFactory?.CreateLogger(GetType().FullName) ?? NullLogger.Instance, true); - public ICancellationTokenProvider CancellationTokenProvider => ServiceProvider.LazyGetService(NullCancellationTokenProvider.Instance); + public ICancellationTokenProvider CancellationTokenProvider => ServiceProvider.LazyGetService(NullCancellationTokenProvider.Instance); - public async Task PublishAsync( - NotificationInfo notification, - IEnumerable identifiers) - { - if (await CanPublishAsync(notification)) - { - await PublishAsync( - notification, - identifiers, - GetCancellationToken()); - } - } - protected virtual Task CanPublishAsync( - NotificationInfo notification, - CancellationToken cancellationToken = default) - { - return Task.FromResult(true); - } - protected virtual CancellationToken GetCancellationToken(CancellationToken cancellationToken = default) + public async Task PublishAsync( + NotificationInfo notification, + IEnumerable identifiers) + { + if (await CanPublishAsync(notification)) { - return CancellationTokenProvider.FallbackToProvider(cancellationToken); + await PublishAsync( + notification, + identifiers, + GetCancellationToken()); } - /// - /// 重写实现通知发布 - /// - /// - /// - /// - /// - protected abstract Task PublishAsync(NotificationInfo notification, IEnumerable identifiers, CancellationToken cancellationToken = default); } + protected virtual Task CanPublishAsync( + NotificationInfo notification, + CancellationToken cancellationToken = default) + { + return Task.FromResult(true); + } + protected virtual CancellationToken GetCancellationToken(CancellationToken cancellationToken = default) + { + return CancellationTokenProvider.FallbackToProvider(cancellationToken); + } + /// + /// 重写实现通知发布 + /// + /// + /// + /// + /// + protected abstract Task PublishAsync(NotificationInfo notification, IEnumerable identifiers, CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationPublishProviderManager.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationPublishProviderManager.cs index 456455f28..164fb2ed5 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationPublishProviderManager.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationPublishProviderManager.cs @@ -5,25 +5,24 @@ using System.Linq; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +public class NotificationPublishProviderManager : INotificationPublishProviderManager, ISingletonDependency { - public class NotificationPublishProviderManager : INotificationPublishProviderManager, ISingletonDependency - { - public List Providers => _lazyProviders.Value; + public List Providers => _lazyProviders.Value; - private readonly Lazy> _lazyProviders; + private readonly Lazy> _lazyProviders; - public NotificationPublishProviderManager( - IServiceProvider serviceProvider, - IOptions options) - { - _lazyProviders = new Lazy>( - () => options.Value - .PublishProviders - .Select(type => serviceProvider.GetRequiredService(type) as INotificationPublishProvider) - .ToList(), - true - ); - } + public NotificationPublishProviderManager( + IServiceProvider serviceProvider, + IOptions options) + { + _lazyProviders = new Lazy>( + () => options.Value + .PublishProviders + .Select(type => serviceProvider.GetRequiredService(type) as INotificationPublishProvider) + .ToList(), + true + ); } } diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NullNotificationStore.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NullNotificationStore.cs index 41daa7636..5033a5e5f 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NullNotificationStore.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NullNotificationStore.cs @@ -4,196 +4,195 @@ using System.Threading.Tasks; using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.Notifications +namespace LINGYUN.Abp.Notifications; + +[Dependency(TryRegister = true)] +public class NullNotificationStore : INotificationStore, ISingletonDependency { - [Dependency(TryRegister = true)] - public class NullNotificationStore : INotificationStore, ISingletonDependency - { - public readonly static INotificationStore Instance = new NullNotificationStore(); - - public Task ChangeUserNotificationReadStateAsync( - Guid? tenantId, - Guid userId, - long notificationId, - NotificationReadState readState, - CancellationToken cancellationToken = default) - { - return Task.CompletedTask; - } - - public Task ChangeUserNotificationsReadStateAsync( - Guid? tenantId, - Guid userId, - IEnumerable notificationIds, - NotificationReadState readState, - CancellationToken cancellationToken = default) - { - return Task.CompletedTask; - } - - public Task DeleteAllUserSubscriptionAsync( - Guid? tenantId, - string notificationName, - CancellationToken cancellationToken = default) - { - return Task.CompletedTask; - } - - public Task DeleteNotificationAsync( - NotificationInfo notification, - CancellationToken cancellationToken = default) - { - return Task.CompletedTask; - } - - public Task DeleteNotificationAsync( - int batchCount, - CancellationToken cancellationToken = default) - { - return Task.CompletedTask; - } - - public Task DeleteUserNotificationAsync( - Guid? tenantId, - Guid userId, - long notificationId, - CancellationToken cancellationToken = default) - { - return Task.CompletedTask; - } - - public Task DeleteUserSubscriptionAsync( - Guid? tenantId, - Guid userId, - string notificationName, - CancellationToken cancellationToken = default) - { - return Task.CompletedTask; - } - - public Task DeleteUserSubscriptionAsync( - Guid? tenantId, - IEnumerable identifiers, - string notificationName, - CancellationToken cancellationToken = default) - { - return Task.CompletedTask; - } - - public Task GetNotificationOrNullAsync( - Guid? tenantId, - long notificationId, - CancellationToken cancellationToken = default) - { - return Task.FromResult(new NotificationInfo()); - } - - public Task> GetUserSubscriptionsAsync( - Guid? tenantId, - string notificationName, - IEnumerable identifiers, - CancellationToken cancellationToken = default) - { - return Task.FromResult(new List()); - } - - public Task> GetUserNotificationsAsync( - Guid? tenantId, - Guid userId, - NotificationReadState? readState = null, - int maxResultCount = 10, - CancellationToken cancellationToken = default) - { - return Task.FromResult(new List()); - } - - public Task GetUserNotificationsCountAsync( - Guid? tenantId, - Guid userId, - string filter = "", - NotificationReadState? readState = null, - CancellationToken cancellationToken = default) - { - return Task.FromResult(0); - } - - public Task> GetUserNotificationsAsync( - Guid? tenantId, - Guid userId, - string filter = "", - string sorting = nameof(NotificationInfo.CreationTime), - NotificationReadState? readState = null, - int skipCount = 1, - int maxResultCount = 10, - CancellationToken cancellationToken = default) - { - return Task.FromResult(new List()); - } - - public Task> GetUserSubscriptionsAsync( - Guid? tenantId, - Guid userId, - CancellationToken cancellationToken = default) - { - return Task.FromResult(new List()); - } - - public Task> GetUserSubscriptionsAsync( - Guid? tenantId, - string userName, - CancellationToken cancellationToken = default) - { - return Task.FromResult(new List()); - } - - public Task InsertNotificationAsync( - NotificationInfo notification, - CancellationToken cancellationToken = default) - { - return Task.CompletedTask; - } - - public Task InsertUserNotificationAsync( - NotificationInfo notification, - Guid userId, - CancellationToken cancellationToken = default) - { - return Task.CompletedTask; - } - - public Task InsertUserNotificationsAsync( - NotificationInfo notification, - IEnumerable userIds, - CancellationToken cancellationToken = default) - { - return Task.CompletedTask; - } - - public Task InsertUserSubscriptionAsync( - Guid? tenantId, - UserIdentifier identifier, - string notificationName, - CancellationToken cancellationToken = default) - { - return Task.CompletedTask; - } - - public Task InsertUserSubscriptionAsync( - Guid? tenantId, - IEnumerable identifiers, - string notificationName, - CancellationToken cancellationToken = default) - { - return Task.CompletedTask; - } - - public Task IsSubscribedAsync( - Guid? tenantId, - Guid userId, - string notificationName, - CancellationToken cancellationToken = default) - { - return Task.FromResult(false); - } + public readonly static INotificationStore Instance = new NullNotificationStore(); + + public Task ChangeUserNotificationReadStateAsync( + Guid? tenantId, + Guid userId, + long notificationId, + NotificationReadState readState, + CancellationToken cancellationToken = default) + { + return Task.CompletedTask; + } + + public Task ChangeUserNotificationsReadStateAsync( + Guid? tenantId, + Guid userId, + IEnumerable notificationIds, + NotificationReadState readState, + CancellationToken cancellationToken = default) + { + return Task.CompletedTask; + } + + public Task DeleteAllUserSubscriptionAsync( + Guid? tenantId, + string notificationName, + CancellationToken cancellationToken = default) + { + return Task.CompletedTask; + } + + public Task DeleteNotificationAsync( + NotificationInfo notification, + CancellationToken cancellationToken = default) + { + return Task.CompletedTask; + } + + public Task DeleteNotificationAsync( + int batchCount, + CancellationToken cancellationToken = default) + { + return Task.CompletedTask; + } + + public Task DeleteUserNotificationAsync( + Guid? tenantId, + Guid userId, + long notificationId, + CancellationToken cancellationToken = default) + { + return Task.CompletedTask; + } + + public Task DeleteUserSubscriptionAsync( + Guid? tenantId, + Guid userId, + string notificationName, + CancellationToken cancellationToken = default) + { + return Task.CompletedTask; + } + + public Task DeleteUserSubscriptionAsync( + Guid? tenantId, + IEnumerable identifiers, + string notificationName, + CancellationToken cancellationToken = default) + { + return Task.CompletedTask; + } + + public Task GetNotificationOrNullAsync( + Guid? tenantId, + long notificationId, + CancellationToken cancellationToken = default) + { + return Task.FromResult(new NotificationInfo()); + } + + public Task> GetUserSubscriptionsAsync( + Guid? tenantId, + string notificationName, + IEnumerable identifiers, + CancellationToken cancellationToken = default) + { + return Task.FromResult(new List()); + } + + public Task> GetUserNotificationsAsync( + Guid? tenantId, + Guid userId, + NotificationReadState? readState = null, + int maxResultCount = 10, + CancellationToken cancellationToken = default) + { + return Task.FromResult(new List()); + } + + public Task GetUserNotificationsCountAsync( + Guid? tenantId, + Guid userId, + string filter = "", + NotificationReadState? readState = null, + CancellationToken cancellationToken = default) + { + return Task.FromResult(0); + } + + public Task> GetUserNotificationsAsync( + Guid? tenantId, + Guid userId, + string filter = "", + string sorting = nameof(NotificationInfo.CreationTime), + NotificationReadState? readState = null, + int skipCount = 1, + int maxResultCount = 10, + CancellationToken cancellationToken = default) + { + return Task.FromResult(new List()); + } + + public Task> GetUserSubscriptionsAsync( + Guid? tenantId, + Guid userId, + CancellationToken cancellationToken = default) + { + return Task.FromResult(new List()); + } + + public Task> GetUserSubscriptionsAsync( + Guid? tenantId, + string userName, + CancellationToken cancellationToken = default) + { + return Task.FromResult(new List()); + } + + public Task InsertNotificationAsync( + NotificationInfo notification, + CancellationToken cancellationToken = default) + { + return Task.CompletedTask; + } + + public Task InsertUserNotificationAsync( + NotificationInfo notification, + Guid userId, + CancellationToken cancellationToken = default) + { + return Task.CompletedTask; + } + + public Task InsertUserNotificationsAsync( + NotificationInfo notification, + IEnumerable userIds, + CancellationToken cancellationToken = default) + { + return Task.CompletedTask; + } + + public Task InsertUserSubscriptionAsync( + Guid? tenantId, + UserIdentifier identifier, + string notificationName, + CancellationToken cancellationToken = default) + { + return Task.CompletedTask; + } + + public Task InsertUserSubscriptionAsync( + Guid? tenantId, + IEnumerable identifiers, + string notificationName, + CancellationToken cancellationToken = default) + { + return Task.CompletedTask; + } + + public Task IsSubscribedAsync( + Guid? tenantId, + Guid userId, + string notificationName, + CancellationToken cancellationToken = default) + { + return Task.FromResult(false); } } diff --git a/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application.Contracts/LINGYUN.Abp.RulesEngineManagement.Application.Contracts.csproj b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application.Contracts/LINGYUN.Abp.RulesEngineManagement.Application.Contracts.csproj index 1070af714..6ac902b48 100644 --- a/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application.Contracts/LINGYUN.Abp.RulesEngineManagement.Application.Contracts.csproj +++ b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application.Contracts/LINGYUN.Abp.RulesEngineManagement.Application.Contracts.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.RulesEngineManagement.Application.Contracts + LINGYUN.Abp.RulesEngineManagement.Application.Contracts + false + false + false diff --git a/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application/LINGYUN.Abp.RulesEngineManagement.Application.csproj b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application/LINGYUN.Abp.RulesEngineManagement.Application.csproj index f5d3a5bfd..e921111f0 100644 --- a/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application/LINGYUN.Abp.RulesEngineManagement.Application.csproj +++ b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Application/LINGYUN.Abp.RulesEngineManagement.Application.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + net8.0 + LINGYUN.Abp.RulesEngineManagement.Application + LINGYUN.Abp.RulesEngineManagement.Application + false + false + false diff --git a/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain.Shared/LINGYUN.Abp.RulesEngineManagement.Domain.Shared.csproj b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain.Shared/LINGYUN.Abp.RulesEngineManagement.Domain.Shared.csproj index e0e168782..ffa696599 100644 --- a/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain.Shared/LINGYUN.Abp.RulesEngineManagement.Domain.Shared.csproj +++ b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain.Shared/LINGYUN.Abp.RulesEngineManagement.Domain.Shared.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.RulesEngineManagement.Domain.Shared + LINGYUN.Abp.RulesEngineManagement.Domain.Shared + false + false + false diff --git a/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain/LINGYUN.Abp.RulesEngineManagement.Domain.csproj b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain/LINGYUN.Abp.RulesEngineManagement.Domain.csproj index 66093b482..d3007df33 100644 --- a/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain/LINGYUN.Abp.RulesEngineManagement.Domain.csproj +++ b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.Domain/LINGYUN.Abp.RulesEngineManagement.Domain.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.RulesEngineManagement.Domain + LINGYUN.Abp.RulesEngineManagement.Domain + false + false + false diff --git a/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.EntityFrameworkCore/LINGYUN.Abp.RulesEngineManagement.EntityFrameworkCore.csproj b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.EntityFrameworkCore/LINGYUN.Abp.RulesEngineManagement.EntityFrameworkCore.csproj index 260ecca15..6fd261b93 100644 --- a/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.EntityFrameworkCore/LINGYUN.Abp.RulesEngineManagement.EntityFrameworkCore.csproj +++ b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.EntityFrameworkCore/LINGYUN.Abp.RulesEngineManagement.EntityFrameworkCore.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.RulesEngineManagement.EntityFrameworkCore + LINGYUN.Abp.RulesEngineManagement.EntityFrameworkCore + false + false + false diff --git a/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.HttpApi/LINGYUN.Abp.RulesEngineManagement.HttpApi.csproj b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.HttpApi/LINGYUN.Abp.RulesEngineManagement.HttpApi.csproj index 333ae63ea..89ee953d6 100644 --- a/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.HttpApi/LINGYUN.Abp.RulesEngineManagement.HttpApi.csproj +++ b/aspnet-core/modules/rules-management/rules-engine/LINGYUN.Abp.RulesEngineManagement.HttpApi/LINGYUN.Abp.RulesEngineManagement.HttpApi.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.RulesEngineManagement.HttpApi + LINGYUN.Abp.RulesEngineManagement.HttpApi + false + false + false diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.MultiTenancy.Saas/LINGYUN.Abp.MultiTenancy.Saas.csproj b/aspnet-core/modules/saas/LINGYUN.Abp.MultiTenancy.Saas/LINGYUN.Abp.MultiTenancy.Saas.csproj index 313956067..91f5f364e 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.MultiTenancy.Saas/LINGYUN.Abp.MultiTenancy.Saas.csproj +++ b/aspnet-core/modules/saas/LINGYUN.Abp.MultiTenancy.Saas/LINGYUN.Abp.MultiTenancy.Saas.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.MultiTenancy.Saas + LINGYUN.Abp.MultiTenancy.Saas + false + false + false diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN.Abp.Saas.Application.Contracts.csproj b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN.Abp.Saas.Application.Contracts.csproj index ba8a63ff8..35fb16b50 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN.Abp.Saas.Application.Contracts.csproj +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application.Contracts/LINGYUN.Abp.Saas.Application.Contracts.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Saas.Application.Contracts + LINGYUN.Abp.Saas.Application.Contracts + false + false + false diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application/LINGYUN.Abp.Saas.Application.csproj b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application/LINGYUN.Abp.Saas.Application.csproj index 388c733c1..c0aca6f02 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application/LINGYUN.Abp.Saas.Application.csproj +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Application/LINGYUN.Abp.Saas.Application.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.Saas.Application + LINGYUN.Abp.Saas.Application + false + false + false diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain.Shared/LINGYUN.Abp.Saas.Domain.Shared.csproj b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain.Shared/LINGYUN.Abp.Saas.Domain.Shared.csproj index d09d6dc14..50f7b5a3d 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain.Shared/LINGYUN.Abp.Saas.Domain.Shared.csproj +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain.Shared/LINGYUN.Abp.Saas.Domain.Shared.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Saas.Domain.Shared + LINGYUN.Abp.Saas.Domain.Shared + false + false + false diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain.Shared/LINGYUN/Abp/Saas/Localization/Resources/en.json b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain.Shared/LINGYUN/Abp/Saas/Localization/Resources/en.json index 325bd5831..4054a2cb5 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain.Shared/LINGYUN/Abp/Saas/Localization/Resources/en.json +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain.Shared/LINGYUN/Abp/Saas/Localization/Resources/en.json @@ -47,6 +47,8 @@ "Features:ExpiredRecoveryTimeDesc": "If the resource expiration is not handled for a long time, tenant resources will be reclaimed", "TenantNotFoundById": "Tenant: {0} not found!", "TenantNotFoundByName": "Tenant: {0} not found!", - "UnActived": "UnActived" + "UnActived": "UnActived", + "RecycleStrategy:Reserve": "Reserve", + "RecycleStrategy:Recycle": "Recycle" } } \ No newline at end of file diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain.Shared/LINGYUN/Abp/Saas/Localization/Resources/zh-Hans.json b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain.Shared/LINGYUN/Abp/Saas/Localization/Resources/zh-Hans.json index 0e0ee4f7d..cce383bb1 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain.Shared/LINGYUN/Abp/Saas/Localization/Resources/zh-Hans.json +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain.Shared/LINGYUN/Abp/Saas/Localization/Resources/zh-Hans.json @@ -47,6 +47,8 @@ "Features:ExpiredRecoveryTimeDesc": "当资源超期多久没有处理, 将回收租户资源", "TenantNotFoundById": "租户: {0} 不存在!", "TenantNotFoundByName": "租户: {0} 不存在!", - "UnActived": "未启用" + "UnActived": "未启用", + "RecycleStrategy:Reserve": "保留", + "RecycleStrategy:Recycle": "回收" } } \ No newline at end of file diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN.Abp.Saas.Domain.csproj b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN.Abp.Saas.Domain.csproj index 42884f0f8..2f727e8bb 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN.Abp.Saas.Domain.csproj +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Domain/LINGYUN.Abp.Saas.Domain.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.Saas.Domain + LINGYUN.Abp.Saas.Domain + false + false + false diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.EntityFrameworkCore/LINGYUN.Abp.Saas.EntityFrameworkCore.csproj b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.EntityFrameworkCore/LINGYUN.Abp.Saas.EntityFrameworkCore.csproj index cca9e04d1..e32f69299 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.EntityFrameworkCore/LINGYUN.Abp.Saas.EntityFrameworkCore.csproj +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.EntityFrameworkCore/LINGYUN.Abp.Saas.EntityFrameworkCore.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.Saas.EntityFrameworkCore + LINGYUN.Abp.Saas.EntityFrameworkCore + false + false + false diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.HttpApi.Client/LINGYUN.Abp.Saas.HttpApi.Client.csproj b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.HttpApi.Client/LINGYUN.Abp.Saas.HttpApi.Client.csproj index 8b45c78a8..d42637048 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.HttpApi.Client/LINGYUN.Abp.Saas.HttpApi.Client.csproj +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.HttpApi.Client/LINGYUN.Abp.Saas.HttpApi.Client.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Saas.HttpApi.Client + LINGYUN.Abp.Saas.HttpApi.Client + false + false + false diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.HttpApi/LINGYUN.Abp.Saas.HttpApi.csproj b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.HttpApi/LINGYUN.Abp.Saas.HttpApi.csproj index bfe1cb194..ced81f427 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.HttpApi/LINGYUN.Abp.Saas.HttpApi.csproj +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.HttpApi/LINGYUN.Abp.Saas.HttpApi.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.Saas.HttpApi + LINGYUN.Abp.Saas.HttpApi + false + false + false diff --git a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Jobs/LINGYUN.Abp.Saas.Jobs.csproj b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Jobs/LINGYUN.Abp.Saas.Jobs.csproj index bdfa25ae8..d820c0fe9 100644 --- a/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Jobs/LINGYUN.Abp.Saas.Jobs.csproj +++ b/aspnet-core/modules/saas/LINGYUN.Abp.Saas.Jobs/LINGYUN.Abp.Saas.Jobs.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.Saas.Jobs + LINGYUN.Abp.Saas.Jobs + false + false + false diff --git a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN.Abp.SettingManagement.Application.csproj b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN.Abp.SettingManagement.Application.csproj index be43b33a2..ad71f7c5d 100644 --- a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN.Abp.SettingManagement.Application.csproj +++ b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN.Abp.SettingManagement.Application.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.SettingManagement.Application + LINGYUN.Abp.SettingManagement.Application + false + false + false diff --git a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/SettingAppService.cs b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/SettingAppService.cs index ab47f06e5..b187fd163 100644 --- a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/SettingAppService.cs +++ b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/SettingAppService.cs @@ -1,4 +1,5 @@ -using Microsoft.AspNetCore.Authorization; +using LINGYUN.Abp.Identity; +using Microsoft.AspNetCore.Authorization; using Microsoft.Extensions.Options; using System.Linq; using System.Threading.Tasks; @@ -281,6 +282,28 @@ await SettingManager.GetOrNullAsync(IdentitySettingNames.SignIn.RequireConfirmed #endregion + #region 会话 + + var sessionSetting = identitySetting.AddSetting(L["DisplayName:Identity.Session"], L["Description:Identity.Session"]); + sessionSetting.AddDetail( + await SettingDefinitionManager.GetAsync(LINGYUN.Abp.Identity.Settings.IdentitySettingNames.Session.ConcurrentLoginStrategy), + StringLocalizerFactory, + await SettingManager.GetOrNullAsync(LINGYUN.Abp.Identity.Settings.IdentitySettingNames.Session.ConcurrentLoginStrategy, providerName, providerKey), + ValueType.Option, + providerName) + .AddOption(L["ConcurrentLoginStrategy:None"], ConcurrentLoginStrategy.None.ToString()) + .AddOption(L["ConcurrentLoginStrategy:LogoutFromSameTypeDevicesLimit"], ConcurrentLoginStrategy.LogoutFromSameTypeDevicesLimit.ToString()) + .AddOption(L["ConcurrentLoginStrategy:LogoutFromSameTypeDevices"], ConcurrentLoginStrategy.LogoutFromSameTypeDevices.ToString()) + .AddOption(L["ConcurrentLoginStrategy:LogoutFromAllDevices"], ConcurrentLoginStrategy.LogoutFromAllDevices.ToString()); + sessionSetting.AddDetail( + await SettingDefinitionManager.GetAsync(LINGYUN.Abp.Identity.Settings.IdentitySettingNames.Session.LogoutFromSameTypeDevicesLimit), + StringLocalizerFactory, + await SettingManager.GetOrNullAsync(LINGYUN.Abp.Identity.Settings.IdentitySettingNames.Session.LogoutFromSameTypeDevicesLimit, providerName, providerKey), + ValueType.Number, + providerName); + + #endregion + #region 密码 var passwordSetting = identitySetting.AddSetting(L["DisplayName:Identity.Password"], L["Description:Identity.Password"]); diff --git a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.HttpApi/LINGYUN.Abp.SettingManagement.HttpApi.csproj b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.HttpApi/LINGYUN.Abp.SettingManagement.HttpApi.csproj index c94da9630..dd60205ef 100644 --- a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.HttpApi/LINGYUN.Abp.SettingManagement.HttpApi.csproj +++ b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.HttpApi/LINGYUN.Abp.SettingManagement.HttpApi.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.SettingManagement.HttpApi + LINGYUN.Abp.SettingManagement.HttpApi + false + false + false diff --git a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.HttpApi/LINGYUN/Abp/SettingManagement/AbpSettingManagementHttpApiModule.cs b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.HttpApi/LINGYUN/Abp/SettingManagement/AbpSettingManagementHttpApiModule.cs index 9df35a1e2..b86d79496 100644 --- a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.HttpApi/LINGYUN/Abp/SettingManagement/AbpSettingManagementHttpApiModule.cs +++ b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.HttpApi/LINGYUN/Abp/SettingManagement/AbpSettingManagementHttpApiModule.cs @@ -5,32 +5,31 @@ using Volo.Abp.Modularity; using Volo.Abp.SettingManagement.Localization; -namespace LINGYUN.Abp.SettingManagement +namespace LINGYUN.Abp.SettingManagement; + +[DependsOn( + typeof(AbpSettingManagementApplicationModule), + typeof(AbpAspNetCoreMvcModule) + )] +public class AbpSettingManagementHttpApiModule : AbpModule { - [DependsOn( - typeof(AbpSettingManagementApplicationModule), - typeof(AbpAspNetCoreMvcModule) - )] - public class AbpSettingManagementHttpApiModule : AbpModule + public override void PreConfigureServices(ServiceConfigurationContext context) { - public override void PreConfigureServices(ServiceConfigurationContext context) + PreConfigure(mvcBuilder => { - PreConfigure(mvcBuilder => - { - mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpSettingManagementHttpApiModule).Assembly); - }); - } + mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpSettingManagementHttpApiModule).Assembly); + }); + } - public override void ConfigureServices(ServiceConfigurationContext context) + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => { - Configure(options => - { - options.Resources - .Get() - .AddBaseTypes( - typeof(AbpUiResource) - ); - }); - } + options.Resources + .Get() + .AddBaseTypes( + typeof(AbpUiResource) + ); + }); } } diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN.Abp.BackgroundTasks.Abstractions.csproj b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN.Abp.BackgroundTasks.Abstractions.csproj index 1a3213a64..19435a590 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN.Abp.BackgroundTasks.Abstractions.csproj +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Abstractions/LINGYUN.Abp.BackgroundTasks.Abstractions.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.BackgroundTasks.Abstractions + LINGYUN.Abp.BackgroundTasks.Abstractions + false + false + false diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN.Abp.BackgroundTasks.Activities.csproj b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN.Abp.BackgroundTasks.Activities.csproj index 20e84f53e..7bb3614a3 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN.Abp.BackgroundTasks.Activities.csproj +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Activities/LINGYUN.Abp.BackgroundTasks.Activities.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.BackgroundTasks.Activities + LINGYUN.Abp.BackgroundTasks.Activities + false + false + false diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.DistributedLocking/LINGYUN.Abp.BackgroundTasks.DistributedLocking.csproj b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.DistributedLocking/LINGYUN.Abp.BackgroundTasks.DistributedLocking.csproj index 8bcc55f07..d6c07b718 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.DistributedLocking/LINGYUN.Abp.BackgroundTasks.DistributedLocking.csproj +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.DistributedLocking/LINGYUN.Abp.BackgroundTasks.DistributedLocking.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.BackgroundTasks.DistributedLocking + LINGYUN.Abp.BackgroundTasks.DistributedLocking + false + false + false diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.EventBus/LINGYUN.Abp.BackgroundTasks.EventBus.csproj b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.EventBus/LINGYUN.Abp.BackgroundTasks.EventBus.csproj index cc8a56baa..f9d994251 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.EventBus/LINGYUN.Abp.BackgroundTasks.EventBus.csproj +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.EventBus/LINGYUN.Abp.BackgroundTasks.EventBus.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.BackgroundTasks.EventBus + LINGYUN.Abp.BackgroundTasks.EventBus + false + false + false diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.ExceptionHandling/LINGYUN.Abp.BackgroundTasks.ExceptionHandling.csproj b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.ExceptionHandling/LINGYUN.Abp.BackgroundTasks.ExceptionHandling.csproj index 0556b7575..3280ee543 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.ExceptionHandling/LINGYUN.Abp.BackgroundTasks.ExceptionHandling.csproj +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.ExceptionHandling/LINGYUN.Abp.BackgroundTasks.ExceptionHandling.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.BackgroundTasks.ExceptionHandling + LINGYUN.Abp.BackgroundTasks.ExceptionHandling + false + false + false diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Jobs/LINGYUN.Abp.BackgroundTasks.Jobs.csproj b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Jobs/LINGYUN.Abp.BackgroundTasks.Jobs.csproj index 6e6561c9a..f629319c2 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Jobs/LINGYUN.Abp.BackgroundTasks.Jobs.csproj +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Jobs/LINGYUN.Abp.BackgroundTasks.Jobs.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.BackgroundTasks.Jobs + LINGYUN.Abp.BackgroundTasks.Jobs + false + false + false diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Notifications/LINGYUN.Abp.BackgroundTasks.Notifications.csproj b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Notifications/LINGYUN.Abp.BackgroundTasks.Notifications.csproj index f91a36243..70f87735f 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Notifications/LINGYUN.Abp.BackgroundTasks.Notifications.csproj +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Notifications/LINGYUN.Abp.BackgroundTasks.Notifications.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.BackgroundTasks.Notifications + LINGYUN.Abp.BackgroundTasks.Notifications + false + false + false diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN.Abp.BackgroundTasks.Quartz.csproj b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN.Abp.BackgroundTasks.Quartz.csproj index 89ad07e79..b872e6bea 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN.Abp.BackgroundTasks.Quartz.csproj +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN.Abp.BackgroundTasks.Quartz.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.BackgroundTasks.Quartz + LINGYUN.Abp.BackgroundTasks.Quartz + false + false + false diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.TaskManagement/LINGYUN.Abp.BackgroundTasks.TaskManagement.csproj b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.TaskManagement/LINGYUN.Abp.BackgroundTasks.TaskManagement.csproj index 49331bbd6..d97ea12bc 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.TaskManagement/LINGYUN.Abp.BackgroundTasks.TaskManagement.csproj +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.TaskManagement/LINGYUN.Abp.BackgroundTasks.TaskManagement.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.BackgroundTasks.TaskManagement + LINGYUN.Abp.BackgroundTasks.TaskManagement + false + false + false diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN.Abp.BackgroundTasks.csproj b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN.Abp.BackgroundTasks.csproj index 553623e2c..37475d8ae 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN.Abp.BackgroundTasks.csproj +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN.Abp.BackgroundTasks.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.BackgroundTasks + LINGYUN.Abp.BackgroundTasks + false + false + false diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.Elasticsearch.Jobs/LINGYUN.Abp.Elasticsearch.Jobs.csproj b/aspnet-core/modules/task-management/LINGYUN.Abp.Elasticsearch.Jobs/LINGYUN.Abp.Elasticsearch.Jobs.csproj index 92f234e26..c7783d8a5 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.Elasticsearch.Jobs/LINGYUN.Abp.Elasticsearch.Jobs.csproj +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.Elasticsearch.Jobs/LINGYUN.Abp.Elasticsearch.Jobs.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Elasticsearch.Jobs + LINGYUN.Abp.Elasticsearch.Jobs + false + false + false diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.Notifications.Jobs/LINGYUN.Abp.Notifications.Jobs.csproj b/aspnet-core/modules/task-management/LINGYUN.Abp.Notifications.Jobs/LINGYUN.Abp.Notifications.Jobs.csproj index 091158cc2..6c2544795 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.Notifications.Jobs/LINGYUN.Abp.Notifications.Jobs.csproj +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.Notifications.Jobs/LINGYUN.Abp.Notifications.Jobs.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Notifications.Jobs + LINGYUN.Abp.Notifications.Jobs + false + false + false diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN.Abp.TaskManagement.Application.Contracts.csproj b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN.Abp.TaskManagement.Application.Contracts.csproj index f1b371a62..7c8c267b6 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN.Abp.TaskManagement.Application.Contracts.csproj +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN.Abp.TaskManagement.Application.Contracts.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.TaskManagement.Application.Contracts + LINGYUN.Abp.TaskManagement.Application.Contracts + false + false + false diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application/LINGYUN.Abp.TaskManagement.Application.csproj b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application/LINGYUN.Abp.TaskManagement.Application.csproj index 230e97321..eb5171c04 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application/LINGYUN.Abp.TaskManagement.Application.csproj +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application/LINGYUN.Abp.TaskManagement.Application.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.TaskManagement.Application + LINGYUN.Abp.TaskManagement.Application + false + false + false diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain.Shared/LINGYUN.Abp.TaskManagement.Domain.Shared.csproj b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain.Shared/LINGYUN.Abp.TaskManagement.Domain.Shared.csproj index 2ff9ae157..e53b10ec2 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain.Shared/LINGYUN.Abp.TaskManagement.Domain.Shared.csproj +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain.Shared/LINGYUN.Abp.TaskManagement.Domain.Shared.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.BackgroundTasks.Domain.Shared + LINGYUN.Abp.BackgroundTasks.Domain.Shared + false + false + false diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN.Abp.TaskManagement.Domain.csproj b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN.Abp.TaskManagement.Domain.csproj index 146d5e03c..2fad771da 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN.Abp.TaskManagement.Domain.csproj +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Domain/LINGYUN.Abp.TaskManagement.Domain.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.BackgroundTasks.Domain + LINGYUN.Abp.BackgroundTasks.Domain + false + false + false diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.EntityFrameworkCore/LINGYUN.Abp.TaskManagement.EntityFrameworkCore.csproj b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.EntityFrameworkCore/LINGYUN.Abp.TaskManagement.EntityFrameworkCore.csproj index 4e47e29ce..836e5f45b 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.EntityFrameworkCore/LINGYUN.Abp.TaskManagement.EntityFrameworkCore.csproj +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.EntityFrameworkCore/LINGYUN.Abp.TaskManagement.EntityFrameworkCore.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.BackgroundTasks.EntityFrameworkCore + LINGYUN.Abp.BackgroundTasks.EntityFrameworkCore + false + false + false diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.HttpApi.Client/LINGYUN.Abp.TaskManagement.HttpApi.Client.csproj b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.HttpApi.Client/LINGYUN.Abp.TaskManagement.HttpApi.Client.csproj index 20e814f32..55c525f16 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.HttpApi.Client/LINGYUN.Abp.TaskManagement.HttpApi.Client.csproj +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.HttpApi.Client/LINGYUN.Abp.TaskManagement.HttpApi.Client.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.TaskManagement.HttpApi.Client + LINGYUN.Abp.TaskManagement.HttpApi.Client + false + false + false diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.HttpApi/LINGYUN.Abp.TaskManagement.HttpApi.csproj b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.HttpApi/LINGYUN.Abp.TaskManagement.HttpApi.csproj index b556e4786..6a6bad9a6 100644 --- a/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.HttpApi/LINGYUN.Abp.TaskManagement.HttpApi.csproj +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.HttpApi/LINGYUN.Abp.TaskManagement.HttpApi.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.BackgroundTasks.HttpApi + LINGYUN.Abp.BackgroundTasks.HttpApi + false + false + false diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN.Abp.TextTemplating.Application.Contracts.csproj b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN.Abp.TextTemplating.Application.Contracts.csproj index 5ec7a31f2..b66a79989 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN.Abp.TextTemplating.Application.Contracts.csproj +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application.Contracts/LINGYUN.Abp.TextTemplating.Application.Contracts.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.TextTemplating.Application.Contracts + LINGYUN.Abp.TextTemplating.Application.Contracts + false + false + false diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/LINGYUN.Abp.TextTemplating.Application.csproj b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/LINGYUN.Abp.TextTemplating.Application.csproj index b9458b7e2..473e11ebc 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/LINGYUN.Abp.TextTemplating.Application.csproj +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Application/LINGYUN.Abp.TextTemplating.Application.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.TextTemplating.Application + LINGYUN.Abp.TextTemplating.Application + false + false + false diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN.Abp.TextTemplating.Domain.Shared.csproj b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN.Abp.TextTemplating.Domain.Shared.csproj index 9dc2f23d0..4baf3178f 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN.Abp.TextTemplating.Domain.Shared.csproj +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain.Shared/LINGYUN.Abp.TextTemplating.Domain.Shared.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.TextTemplating.Domain.Shared + LINGYUN.Abp.TextTemplating.Domain.Shared + false + false + false diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN.Abp.TextTemplating.Domain.csproj b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN.Abp.TextTemplating.Domain.csproj index 464f7a617..71f1679b7 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN.Abp.TextTemplating.Domain.csproj +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Domain/LINGYUN.Abp.TextTemplating.Domain.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.TextTemplating.Domain + LINGYUN.Abp.TextTemplating.Domain + false + false + false diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/LINGYUN.Abp.TextTemplating.EntityFrameworkCore.csproj b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/LINGYUN.Abp.TextTemplating.EntityFrameworkCore.csproj index e8a534552..b63a34127 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/LINGYUN.Abp.TextTemplating.EntityFrameworkCore.csproj +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.EntityFrameworkCore/LINGYUN.Abp.TextTemplating.EntityFrameworkCore.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.TextTemplating.EntityFrameworkCore + LINGYUN.Abp.TextTemplating.EntityFrameworkCore + false + false + false diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi.Client/LINGYUN.Abp.TextTemplating.HttpApi.Client.csproj b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi.Client/LINGYUN.Abp.TextTemplating.HttpApi.Client.csproj index 590a9686e..7e8b6a9aa 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi.Client/LINGYUN.Abp.TextTemplating.HttpApi.Client.csproj +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi.Client/LINGYUN.Abp.TextTemplating.HttpApi.Client.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.TextTemplating.HttpApi.Client + LINGYUN.Abp.TextTemplating.HttpApi.Client + false + false + false diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi/LINGYUN.Abp.TextTemplating.HttpApi.csproj b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi/LINGYUN.Abp.TextTemplating.HttpApi.csproj index 2c0b414d9..b4fb3b0f9 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi/LINGYUN.Abp.TextTemplating.HttpApi.csproj +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.HttpApi/LINGYUN.Abp.TextTemplating.HttpApi.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.TextTemplating.HttpApi + LINGYUN.Abp.TextTemplating.HttpApi + false + false + false diff --git a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Scriban/LINGYUN.Abp.TextTemplating.Scriban.csproj b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Scriban/LINGYUN.Abp.TextTemplating.Scriban.csproj index 903171620..d9cf881cd 100644 --- a/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Scriban/LINGYUN.Abp.TextTemplating.Scriban.csproj +++ b/aspnet-core/modules/text-templating/LINGYUN.Abp.TextTemplating.Scriban/LINGYUN.Abp.TextTemplating.Scriban.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.TextTemplating.Scriban + LINGYUN.Abp.TextTemplating.Scriban + false + false + false enable Nullable diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.ClientProxies/LINGYUN.Abp.Webhooks.ClientProxies.csproj b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.ClientProxies/LINGYUN.Abp.Webhooks.ClientProxies.csproj index 4ca431fbf..9f14df1fb 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.ClientProxies/LINGYUN.Abp.Webhooks.ClientProxies.csproj +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.ClientProxies/LINGYUN.Abp.Webhooks.ClientProxies.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Webhooks.ClientProxies + LINGYUN.Abp.Webhooks.ClientProxies + false + false + false diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN.Abp.Webhooks.Core.csproj b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN.Abp.Webhooks.Core.csproj index 79b8d6468..936131ef0 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN.Abp.Webhooks.Core.csproj +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN.Abp.Webhooks.Core.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Webhooks.Core + LINGYUN.Abp.Webhooks.Core + false + false + false diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/IWebhookDefinitionContext.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/IWebhookDefinitionContext.cs index c170ede3d..b714ce636 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/IWebhookDefinitionContext.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/IWebhookDefinitionContext.cs @@ -1,16 +1,15 @@ using JetBrains.Annotations; using Volo.Abp.Localization; -namespace LINGYUN.Abp.Webhooks +namespace LINGYUN.Abp.Webhooks; + +public interface IWebhookDefinitionContext { - public interface IWebhookDefinitionContext - { - WebhookGroupDefinition AddGroup( - [NotNull] string name, - ILocalizableString displayName = null); + WebhookGroupDefinition AddGroup( + [NotNull] string name, + ILocalizableString displayName = null); - WebhookGroupDefinition GetGroupOrNull(string name); + WebhookGroupDefinition GetGroupOrNull(string name); - void RemoveGroup(string name); - } + void RemoveGroup(string name); } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/IWebhookDefinitionManager.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/IWebhookDefinitionManager.cs index 50500caa1..d2a4c5304 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/IWebhookDefinitionManager.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/IWebhookDefinitionManager.cs @@ -3,50 +3,49 @@ using System.Collections.Generic; using System.Threading.Tasks; -namespace LINGYUN.Abp.Webhooks +namespace LINGYUN.Abp.Webhooks; + +public interface IWebhookDefinitionManager { - public interface IWebhookDefinitionManager - { - /// - /// Gets a webhook definition by name. - /// Returns null if there is no webhook definition with given name. - /// - Task GetOrNullAsync(string name); - - /// - /// Gets a webhook definition by name. - /// Throws exception if there is no webhook definition with given name. - /// - [NotNull] - Task GetAsync(string name); - - /// - /// Gets all webhook definitions. - /// - Task> GetWebhooksAsync(); - - /// - /// Gets a webhook group definition by name. - /// Returns null if there is no webhook group definition with given name. - /// - Task GetGroupOrNullAsync(string name); - - /// - /// Gets a webhook definition by name. - /// Throws exception if there is no webhook group definition with given name. - /// - [NotNull] - Task GetGroupAsync(string name); - - /// - /// Gets all webhook group definitions. - /// - /// - Task> GetGroupsAsync(); - - /// - /// Checks if given webhook name is available for given tenant. - /// - Task IsAvailableAsync(Guid? tenantId, string name); - } + /// + /// Gets a webhook definition by name. + /// Returns null if there is no webhook definition with given name. + /// + Task GetOrNullAsync(string name); + + /// + /// Gets a webhook definition by name. + /// Throws exception if there is no webhook definition with given name. + /// + [NotNull] + Task GetAsync(string name); + + /// + /// Gets all webhook definitions. + /// + Task> GetWebhooksAsync(); + + /// + /// Gets a webhook group definition by name. + /// Returns null if there is no webhook group definition with given name. + /// + Task GetGroupOrNullAsync(string name); + + /// + /// Gets a webhook definition by name. + /// Throws exception if there is no webhook group definition with given name. + /// + [NotNull] + Task GetGroupAsync(string name); + + /// + /// Gets all webhook group definitions. + /// + /// + Task> GetGroupsAsync(); + + /// + /// Checks if given webhook name is available for given tenant. + /// + Task IsAvailableAsync(Guid? tenantId, string name); } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/IWebhookDefinitionProvider.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/IWebhookDefinitionProvider.cs index 9e0ee161b..b4c7bdce7 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/IWebhookDefinitionProvider.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/IWebhookDefinitionProvider.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.Webhooks +namespace LINGYUN.Abp.Webhooks; + +public interface IWebhookDefinitionProvider { - public interface IWebhookDefinitionProvider - { - void Define(IWebhookDefinitionContext context); - } + void Define(IWebhookDefinitionContext context); } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookDefinition.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookDefinition.cs index c2d1c27d2..059cc57b4 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookDefinition.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookDefinition.cs @@ -2,76 +2,75 @@ using System.Collections.Generic; using Volo.Abp.Localization; -namespace LINGYUN.Abp.Webhooks +namespace LINGYUN.Abp.Webhooks; + +public class WebhookDefinition { - public class WebhookDefinition - { - /// - /// Unique name of the webhook. - /// - public string Name { get; } - - // - /// Group name of the webhook. - /// - public string GroupName { get; internal set; } - - /// - /// Display name of the webhook. - /// Optional. - /// - public ILocalizableString DisplayName { get; set; } - - /// - /// Description for the webhook. - /// Optional. - /// - public ILocalizableString Description { get; set; } - - public List RequiredFeatures { get; set; } - - public Dictionary Properties { get; } - - public object this[string name] { - get => Properties.GetOrDefault(name); - set => Properties[name] = value; - } + /// + /// Unique name of the webhook. + /// + public string Name { get; } - public WebhookDefinition(string name, ILocalizableString displayName = null, ILocalizableString description = null) - { - if (name.IsNullOrWhiteSpace()) - { - throw new ArgumentNullException(nameof(name), $"{nameof(name)} can not be null, empty or whitespace!"); - } + // + /// Group name of the webhook. + /// + public string GroupName { get; internal set; } - Name = name.Trim(); - DisplayName = displayName; - Description = description; + /// + /// Display name of the webhook. + /// Optional. + /// + public ILocalizableString DisplayName { get; set; } - RequiredFeatures = new List(); - Properties = new Dictionary(); - } + /// + /// Description for the webhook. + /// Optional. + /// + public ILocalizableString Description { get; set; } - public WebhookDefinition WithFeature(params string[] features) - { - if (!features.IsNullOrEmpty()) - { - RequiredFeatures.AddRange(features); - } + public List RequiredFeatures { get; set; } - return this; - } + public Dictionary Properties { get; } + + public object this[string name] { + get => Properties.GetOrDefault(name); + set => Properties[name] = value; + } - public WebhookDefinition WithProperty(string key, object value) + public WebhookDefinition(string name, ILocalizableString displayName = null, ILocalizableString description = null) + { + if (name.IsNullOrWhiteSpace()) { - Properties[key] = value; - return this; + throw new ArgumentNullException(nameof(name), $"{nameof(name)} can not be null, empty or whitespace!"); } + Name = name.Trim(); + DisplayName = displayName; + Description = description; - public override string ToString() + RequiredFeatures = new List(); + Properties = new Dictionary(); + } + + public WebhookDefinition WithFeature(params string[] features) + { + if (!features.IsNullOrEmpty()) { - return $"[{nameof(WebhookDefinition)} {Name}]"; + RequiredFeatures.AddRange(features); } + + return this; + } + + public WebhookDefinition WithProperty(string key, object value) + { + Properties[key] = value; + return this; + } + + + public override string ToString() + { + return $"[{nameof(WebhookDefinition)} {Name}]"; } } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookDefinitionContext.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookDefinitionContext.cs index 20887def3..6302158d8 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookDefinitionContext.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookDefinitionContext.cs @@ -3,53 +3,52 @@ using Volo.Abp; using Volo.Abp.Localization; -namespace LINGYUN.Abp.Webhooks +namespace LINGYUN.Abp.Webhooks; + +public class WebhookDefinitionContext : IWebhookDefinitionContext { - public class WebhookDefinitionContext : IWebhookDefinitionContext + protected IDictionary Groups { get; } + + public WebhookDefinitionContext(IDictionary webhooks) { - protected IDictionary Groups { get; } + Groups = webhooks; + } - public WebhookDefinitionContext(IDictionary webhooks) - { - Groups = webhooks; - } + public WebhookGroupDefinition AddGroup( + [NotNull] string name, + ILocalizableString displayName = null) + { + Check.NotNull(name, nameof(name)); - public WebhookGroupDefinition AddGroup( - [NotNull] string name, - ILocalizableString displayName = null) + if (Groups.ContainsKey(name)) { - Check.NotNull(name, nameof(name)); - - if (Groups.ContainsKey(name)) - { - throw new AbpException($"There is already an existing webhook group with name: {name}"); - } - - return Groups[name] = new WebhookGroupDefinition(name, displayName); + throw new AbpException($"There is already an existing webhook group with name: {name}"); } - public WebhookGroupDefinition GetGroupOrNull([NotNull] string name) - { - Check.NotNull(name, nameof(name)); + return Groups[name] = new WebhookGroupDefinition(name, displayName); + } - if (!Groups.ContainsKey(name)) - { - return null; - } + public WebhookGroupDefinition GetGroupOrNull([NotNull] string name) + { + Check.NotNull(name, nameof(name)); - return Groups[name]; + if (!Groups.ContainsKey(name)) + { + return null; } - public void RemoveGroup(string name) - { - Check.NotNull(name, nameof(name)); + return Groups[name]; + } - if (!Groups.ContainsKey(name)) - { - throw new AbpException($"Undefined notification webhook group: '{name}'."); - } + public void RemoveGroup(string name) + { + Check.NotNull(name, nameof(name)); - Groups.Remove(name); + if (!Groups.ContainsKey(name)) + { + throw new AbpException($"Undefined notification webhook group: '{name}'."); } + + Groups.Remove(name); } } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookDefinitionManager.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookDefinitionManager.cs index d0bf8649b..36b5593e6 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookDefinitionManager.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookDefinitionManager.cs @@ -9,120 +9,119 @@ using Volo.Abp.Features; using Volo.Abp.MultiTenancy; -namespace LINGYUN.Abp.Webhooks +namespace LINGYUN.Abp.Webhooks; + +internal class WebhookDefinitionManager : IWebhookDefinitionManager, ISingletonDependency { - internal class WebhookDefinitionManager : IWebhookDefinitionManager, ISingletonDependency + private readonly IServiceProvider _serviceProvider; + private readonly IStaticWebhookDefinitionStore _staticStore; + private readonly IDynamicWebhookDefinitionStore _dynamicStore; + + public WebhookDefinitionManager( + IServiceProvider serviceProvider, + IStaticWebhookDefinitionStore staticStore, + IDynamicWebhookDefinitionStore dynamicStore) + { + _serviceProvider = serviceProvider; + _staticStore = staticStore; + _dynamicStore = dynamicStore; + } + + public async virtual Task GetOrNullAsync(string name) { - private readonly IServiceProvider _serviceProvider; - private readonly IStaticWebhookDefinitionStore _staticStore; - private readonly IDynamicWebhookDefinitionStore _dynamicStore; - - public WebhookDefinitionManager( - IServiceProvider serviceProvider, - IStaticWebhookDefinitionStore staticStore, - IDynamicWebhookDefinitionStore dynamicStore) + Check.NotNull(name, nameof(name)); + + return await _staticStore.GetOrNullAsync(name) ?? + await _dynamicStore.GetOrNullAsync(name); + } + + public async virtual Task GetAsync(string name) + { + var webhook = await GetOrNullAsync(name); + if (webhook == null) { - _serviceProvider = serviceProvider; - _staticStore = staticStore; - _dynamicStore = dynamicStore; + throw new AbpException("Undefined webhook: " + name); } - public async virtual Task GetOrNullAsync(string name) - { - Check.NotNull(name, nameof(name)); + return webhook; + } - return await _staticStore.GetOrNullAsync(name) ?? - await _dynamicStore.GetOrNullAsync(name); - } + public async virtual Task> GetWebhooksAsync() + { + var staticWebhooks = await _staticStore.GetWebhooksAsync(); + var staticWebhookNames = staticWebhooks + .Select(p => p.Name) + .ToImmutableHashSet(); - public async virtual Task GetAsync(string name) - { - var webhook = await GetOrNullAsync(name); - if (webhook == null) - { - throw new AbpException("Undefined webhook: " + name); - } + var dynamicWebhooks = await _dynamicStore.GetWebhooksAsync(); - return webhook; - } + return staticWebhooks + .Concat(dynamicWebhooks.Where(d => !staticWebhookNames.Contains(d.Name))) + .ToImmutableList(); + } - public async virtual Task> GetWebhooksAsync() - { - var staticWebhooks = await _staticStore.GetWebhooksAsync(); - var staticWebhookNames = staticWebhooks - .Select(p => p.Name) - .ToImmutableHashSet(); + public async virtual Task GetGroupOrNullAsync(string name) + { + Check.NotNull(name, nameof(name)); - var dynamicWebhooks = await _dynamicStore.GetWebhooksAsync(); + return await _staticStore.GetGroupOrNullAsync(name) ?? + await _dynamicStore.GetGroupOrNullAsync(name); + } - return staticWebhooks - .Concat(dynamicWebhooks.Where(d => !staticWebhookNames.Contains(d.Name))) - .ToImmutableList(); + public async virtual Task GetGroupAsync(string name) + { + var webhookGroup = await GetGroupOrNullAsync(name); + if (webhookGroup == null) + { + throw new AbpException("Undefined webhook group: " + name); } - public async virtual Task GetGroupOrNullAsync(string name) - { - Check.NotNull(name, nameof(name)); + return webhookGroup; + } - return await _staticStore.GetGroupOrNullAsync(name) ?? - await _dynamicStore.GetGroupOrNullAsync(name); - } + public async virtual Task> GetGroupsAsync() + { + var staticGroups = await _staticStore.GetGroupsAsync(); + var staticGroupNames = staticGroups + .Select(p => p.Name) + .ToImmutableHashSet(); - public async virtual Task GetGroupAsync(string name) - { - var webhookGroup = await GetGroupOrNullAsync(name); - if (webhookGroup == null) - { - throw new AbpException("Undefined webhook group: " + name); - } + var dynamicGroups = await _dynamicStore.GetGroupsAsync(); - return webhookGroup; - } + return staticGroups + .Concat(dynamicGroups.Where(d => !staticGroupNames.Contains(d.Name))) + .ToImmutableList(); + } - public async virtual Task> GetGroupsAsync() + public async Task IsAvailableAsync(Guid? tenantId, string name) + { + if (tenantId == null) // host allowed to subscribe all webhooks { - var staticGroups = await _staticStore.GetGroupsAsync(); - var staticGroupNames = staticGroups - .Select(p => p.Name) - .ToImmutableHashSet(); + return true; + } - var dynamicGroups = await _dynamicStore.GetGroupsAsync(); + var webhookDefinition = await GetOrNullAsync(name); - return staticGroups - .Concat(dynamicGroups.Where(d => !staticGroupNames.Contains(d.Name))) - .ToImmutableList(); + if (webhookDefinition == null) + { + return false; } - public async Task IsAvailableAsync(Guid? tenantId, string name) + if (webhookDefinition.RequiredFeatures?.Any() == false) { - if (tenantId == null) // host allowed to subscribe all webhooks - { - return true; - } - - var webhookDefinition = await GetOrNullAsync(name); + return true; + } - if (webhookDefinition == null) + var currentTenant = _serviceProvider.GetRequiredService(); + var featureChecker = _serviceProvider.GetRequiredService(); + using (currentTenant.Change(tenantId)) + { + if (!await featureChecker.IsEnabledAsync(true, webhookDefinition.RequiredFeatures.ToArray())) { return false; } - - if (webhookDefinition.RequiredFeatures?.Any() == false) - { - return true; - } - - var currentTenant = _serviceProvider.GetRequiredService(); - var featureChecker = _serviceProvider.GetRequiredService(); - using (currentTenant.Change(tenantId)) - { - if (!await featureChecker.IsEnabledAsync(true, webhookDefinition.RequiredFeatures.ToArray())) - { - return false; - } - } - - return true; } + + return true; } } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookDefinitionProvider.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookDefinitionProvider.cs index 28b520405..ee2ef4ca0 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookDefinitionProvider.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookDefinitionProvider.cs @@ -1,13 +1,12 @@ using Volo.Abp.DependencyInjection; -namespace LINGYUN.Abp.Webhooks +namespace LINGYUN.Abp.Webhooks; + +public abstract class WebhookDefinitionProvider : IWebhookDefinitionProvider, ITransientDependency { - public abstract class WebhookDefinitionProvider : IWebhookDefinitionProvider, ITransientDependency - { - /// - /// Used to add/manipulate webhook definitions. - /// - /// Context, - public abstract void Define(IWebhookDefinitionContext context); - } + /// + /// Used to add/manipulate webhook definitions. + /// + /// Context, + public abstract void Define(IWebhookDefinitionContext context); } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookEvent.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookEvent.cs index bd32fa76d..e8aaddc45 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookEvent.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookEvent.cs @@ -1,30 +1,26 @@ using System; -namespace LINGYUN.Abp.Webhooks +namespace LINGYUN.Abp.Webhooks; + +public class WebhookEvent { + public Guid Id { get; set; } + /// - /// Store created web hooks. To see who get that webhook check with and you can get + /// Webhook unique name /// - public class WebhookEvent - { - public Guid Id { get; set; } - - /// - /// Webhook unique name - /// - public string WebhookName { get; set; } + public string WebhookName { get; set; } - /// - /// Webhook data as JSON string. - /// - public string Data { get; set; } + /// + /// Webhook data as JSON string. + /// + public string Data { get; set; } - public DateTime CreationTime { get; set; } + public DateTime CreationTime { get; set; } - public Guid? TenantId { get; set; } + public Guid? TenantId { get; set; } - public bool IsDeleted { get; set; } + public bool IsDeleted { get; set; } - public DateTime? DeletionTime { get; set; } - } + public DateTime? DeletionTime { get; set; } } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookHeader.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookHeader.cs index 8ec3dae22..f93ee302c 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookHeader.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookHeader.cs @@ -1,25 +1,24 @@ using System; using System.Collections.Generic; -namespace LINGYUN.Abp.Webhooks +namespace LINGYUN.Abp.Webhooks; + +[Serializable] +public class WebhookHeader { - [Serializable] - public class WebhookHeader - { - /// - /// If true, webhook will only contain given headers. If false given headers will be added to predefined headers in subscription. - /// Default is false - /// - public bool UseOnlyGivenHeaders { get; set; } - - /// - /// That headers will be sent with the webhook. - /// - public IDictionary Headers { get; set; } + /// + /// If true, webhook will only contain given headers. If false given headers will be added to predefined headers in subscription. + /// Default is false + /// + public bool UseOnlyGivenHeaders { get; set; } + + /// + /// That headers will be sent with the webhook. + /// + public IDictionary Headers { get; set; } - public WebhookHeader() - { - Headers = new Dictionary(); - } + public WebhookHeader() + { + Headers = new Dictionary(); } } \ No newline at end of file diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookPayload.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookPayload.cs index ff287cbd0..ba073130b 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookPayload.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Core/LINGYUN/Abp/Webhooks/WebhookPayload.cs @@ -1,35 +1,34 @@ using System; -namespace LINGYUN.Abp.Webhooks +namespace LINGYUN.Abp.Webhooks; + +public class WebhookPayload { - public class WebhookPayload - { - public string Id { get; set; } + public string Id { get; set; } - public string WebhookEvent { get; set; } + public string WebhookEvent { get; set; } - public int Attempt { get; set; } + public int Attempt { get; set; } - public dynamic Data { get; set; } + public dynamic Data { get; set; } - public DateTime CreationTimeUtc { get; set; } + public DateTime CreationTimeUtc { get; set; } - public WebhookPayload(string id, string webhookEvent, int attempt) + public WebhookPayload(string id, string webhookEvent, int attempt) + { + if (id.IsNullOrWhiteSpace()) { - if (id.IsNullOrWhiteSpace()) - { - throw new ArgumentNullException(nameof(id)); - } - - if (webhookEvent.IsNullOrWhiteSpace()) - { - throw new ArgumentNullException(nameof(webhookEvent)); - } - - Id = id; - WebhookEvent = webhookEvent; - Attempt = attempt; - CreationTimeUtc = DateTime.UtcNow; + throw new ArgumentNullException(nameof(id)); } + + if (webhookEvent.IsNullOrWhiteSpace()) + { + throw new ArgumentNullException(nameof(webhookEvent)); + } + + Id = id; + WebhookEvent = webhookEvent; + Attempt = attempt; + CreationTimeUtc = DateTime.UtcNow; } } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.EventBus/LINGYUN.Abp.Webhooks.EventBus.csproj b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.EventBus/LINGYUN.Abp.Webhooks.EventBus.csproj index 359bef37a..8ec195e94 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.EventBus/LINGYUN.Abp.Webhooks.EventBus.csproj +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.EventBus/LINGYUN.Abp.Webhooks.EventBus.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Webhooks.EventBus + LINGYUN.Abp.Webhooks.EventBus + false + false + false diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Identity/LINGYUN.Abp.Webhooks.Identity.csproj b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Identity/LINGYUN.Abp.Webhooks.Identity.csproj index 170732b2a..f02805456 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Identity/LINGYUN.Abp.Webhooks.Identity.csproj +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Identity/LINGYUN.Abp.Webhooks.Identity.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Webhooks.Identity + LINGYUN.Abp.Webhooks.Identity + false + false + false diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Saas/LINGYUN.Abp.Webhooks.Saas.csproj b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Saas/LINGYUN.Abp.Webhooks.Saas.csproj index d79e68a12..1a83c4259 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Saas/LINGYUN.Abp.Webhooks.Saas.csproj +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks.Saas/LINGYUN.Abp.Webhooks.Saas.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Webhooks.Saas + LINGYUN.Abp.Webhooks.Saas + false + false + false diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN.Abp.Webhooks.csproj b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN.Abp.Webhooks.csproj index d07f98d2f..a3e86a686 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN.Abp.Webhooks.csproj +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN.Abp.Webhooks.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.Webhooks + LINGYUN.Abp.Webhooks + false + false + false diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/BackgroundJobs/WebhookSenderJob.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/BackgroundJobs/WebhookSenderJob.cs index c648d890f..f89056bc1 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/BackgroundJobs/WebhookSenderJob.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/BackgroundJobs/WebhookSenderJob.cs @@ -41,7 +41,7 @@ public override async Task ExecuteAsync(WebhookSenderArgs args) } catch (Exception e) { - Logger.LogWarning("An error occured while sending webhook with try once.", e); + Logger.LogWarning(e, "An error occured while sending webhook with try once."); // ignored } } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/DefaultWebhookSender.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/DefaultWebhookSender.cs index 23e3a26cf..ceadcf024 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/DefaultWebhookSender.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.Webhooks/LINGYUN/Abp/Webhooks/DefaultWebhookSender.cs @@ -84,7 +84,7 @@ public async Task SendWebhookAsync(WebhookSenderArgs webhookSenderArgs) } catch (Exception e) { - Logger.LogError("An error occured while sending a webhook request", e); + Logger.LogError(e, "An error occured while sending a webhook request"); } finally { diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN.Abp.WebhooksManagement.Application.Contracts.csproj b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN.Abp.WebhooksManagement.Application.Contracts.csproj index 9a9ba5d9b..2b9aefa5d 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN.Abp.WebhooksManagement.Application.Contracts.csproj +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application.Contracts/LINGYUN.Abp.WebhooksManagement.Application.Contracts.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.WebhooksManagement.Application.Contracts + LINGYUN.Abp.WebhooksManagement.Application.Contracts + false + false + false diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN.Abp.WebhooksManagement.Application.csproj b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN.Abp.WebhooksManagement.Application.csproj index 20d6ce00d..7c2b2af5f 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN.Abp.WebhooksManagement.Application.csproj +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN.Abp.WebhooksManagement.Application.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.WebhooksManagement.Application + LINGYUN.Abp.WebhooksManagement.Application + false + false + false diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/Extensions/WebhookSubscriptionExtensions.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/Extensions/WebhookSubscriptionExtensions.cs index bf6e75e59..dbcf7a7a1 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/Extensions/WebhookSubscriptionExtensions.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/Extensions/WebhookSubscriptionExtensions.cs @@ -1,46 +1,45 @@ using Newtonsoft.Json; using System.Linq; -namespace LINGYUN.Abp.WebhooksManagement.Extensions +namespace LINGYUN.Abp.WebhooksManagement.Extensions; + +public static class WebhookSubscriptionExtensions { - public static class WebhookSubscriptionExtensions + public static WebhookSubscriptionDto ToWebhookSubscriptionDto(this WebhookSubscription webhookSubscription) { - public static WebhookSubscriptionDto ToWebhookSubscriptionDto(this WebhookSubscription webhookSubscription) + return new WebhookSubscriptionDto { - return new WebhookSubscriptionDto - { - Id = webhookSubscription.Id, - TenantId = webhookSubscription.TenantId, - IsActive = webhookSubscription.IsActive, - Secret = webhookSubscription.Secret, - WebhookUri = webhookSubscription.WebhookUri, - Webhooks = webhookSubscription.GetSubscribedWebhooks(), - Headers = webhookSubscription.GetWebhookHeaders(), - CreationTime = webhookSubscription.CreationTime, - CreatorId = webhookSubscription.CreatorId, - Description = webhookSubscription.Description, - ConcurrencyStamp = webhookSubscription.ConcurrencyStamp, - }; - } + Id = webhookSubscription.Id, + TenantId = webhookSubscription.TenantId, + IsActive = webhookSubscription.IsActive, + Secret = webhookSubscription.Secret, + WebhookUri = webhookSubscription.WebhookUri, + Webhooks = webhookSubscription.GetSubscribedWebhooks(), + Headers = webhookSubscription.GetWebhookHeaders(), + CreationTime = webhookSubscription.CreationTime, + CreatorId = webhookSubscription.CreatorId, + Description = webhookSubscription.Description, + ConcurrencyStamp = webhookSubscription.ConcurrencyStamp, + }; + } - public static string ToSubscribedWebhooksString(this WebhookSubscriptionCreateOrUpdateInput webhookSubscription) + public static string ToSubscribedWebhooksString(this WebhookSubscriptionCreateOrUpdateInput webhookSubscription) + { + if (webhookSubscription.Webhooks.Any()) { - if (webhookSubscription.Webhooks.Any()) - { - return JsonConvert.SerializeObject(webhookSubscription.Webhooks); - } - - return null; + return JsonConvert.SerializeObject(webhookSubscription.Webhooks); } - public static string ToWebhookHeadersString(this WebhookSubscriptionCreateOrUpdateInput webhookSubscription) - { - if (webhookSubscription.Headers.Any()) - { - return JsonConvert.SerializeObject(webhookSubscription.Headers); - } + return null; + } - return null; + public static string ToWebhookHeadersString(this WebhookSubscriptionCreateOrUpdateInput webhookSubscription) + { + if (webhookSubscription.Headers.Any()) + { + return JsonConvert.SerializeObject(webhookSubscription.Headers); } + + return null; } } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Dapr.Client/LINGYUN.Abp.WebhooksManagement.Dapr.Client.csproj b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Dapr.Client/LINGYUN.Abp.WebhooksManagement.Dapr.Client.csproj index af2e28d17..2272b55d8 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Dapr.Client/LINGYUN.Abp.WebhooksManagement.Dapr.Client.csproj +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Dapr.Client/LINGYUN.Abp.WebhooksManagement.Dapr.Client.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.WebhooksManagement.Dapr.Client + LINGYUN.Abp.WebhooksManagement.Dapr.Client + false + false + false diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain.Shared/LINGYUN.Abp.WebhooksManagement.Domain.Shared.csproj b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain.Shared/LINGYUN.Abp.WebhooksManagement.Domain.Shared.csproj index bca488b5f..63bad3b59 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain.Shared/LINGYUN.Abp.WebhooksManagement.Domain.Shared.csproj +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain.Shared/LINGYUN.Abp.WebhooksManagement.Domain.Shared.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.WebhooksManagement.Domain.Shared + LINGYUN.Abp.WebhooksManagement.Domain.Shared + false + false + false diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN.Abp.WebhooksManagement.Domain.csproj b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN.Abp.WebhooksManagement.Domain.csproj index 35a8bd86b..e66ce8fef 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN.Abp.WebhooksManagement.Domain.csproj +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN.Abp.WebhooksManagement.Domain.csproj @@ -4,7 +4,12 @@ - netstandard2.1 + net8.0 + LINGYUN.Abp.WebhooksManagement.Domain + LINGYUN.Abp.WebhooksManagement.Domain + false + false + false diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/Extensions/WebhookSubscriptionExtensions.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/Extensions/WebhookSubscriptionExtensions.cs index 3630b3760..d59ff4e4e 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/Extensions/WebhookSubscriptionExtensions.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/Extensions/WebhookSubscriptionExtensions.cs @@ -2,28 +2,27 @@ using Newtonsoft.Json; using System.Linq; -namespace LINGYUN.Abp.WebhooksManagement.Extensions +namespace LINGYUN.Abp.WebhooksManagement.Extensions; + +public static class WebhookSubscriptionExtensions { - public static class WebhookSubscriptionExtensions + public static string ToSubscribedWebhooksString(this WebhookSubscriptionInfo webhookSubscription) { - public static string ToSubscribedWebhooksString(this WebhookSubscriptionInfo webhookSubscription) + if (webhookSubscription.Webhooks.Any()) { - if (webhookSubscription.Webhooks.Any()) - { - return JsonConvert.SerializeObject(webhookSubscription.Webhooks); - } - - return null; + return JsonConvert.SerializeObject(webhookSubscription.Webhooks); } - public static string ToWebhookHeadersString(this WebhookSubscriptionInfo webhookSubscription) - { - if (webhookSubscription.Headers.Any()) - { - return JsonConvert.SerializeObject(webhookSubscription.Headers); - } + return null; + } - return null; + public static string ToWebhookHeadersString(this WebhookSubscriptionInfo webhookSubscription) + { + if (webhookSubscription.Headers.Any()) + { + return JsonConvert.SerializeObject(webhookSubscription.Headers); } + + return null; } } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/Extensions/WebhookSubscriptionInfoExtensions.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/Extensions/WebhookSubscriptionInfoExtensions.cs index 8068dfa10..fc5acccf4 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/Extensions/WebhookSubscriptionInfoExtensions.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/Extensions/WebhookSubscriptionInfoExtensions.cs @@ -3,173 +3,172 @@ using System; using System.Collections.Generic; -namespace LINGYUN.Abp.WebhooksManagement.Extensions +namespace LINGYUN.Abp.WebhooksManagement.Extensions; + +public static class WebhookSubscriptionInfoExtensions { - public static class WebhookSubscriptionInfoExtensions + /// + /// Return List of subscribed webhooks definitions + /// + /// + public static List GetSubscribedWebhooks(this WebhookSubscription webhookSubscription) { - /// - /// Return List of subscribed webhooks definitions - /// - /// - public static List GetSubscribedWebhooks(this WebhookSubscription webhookSubscription) + if (webhookSubscription.Webhooks.IsNullOrWhiteSpace()) { - if (webhookSubscription.Webhooks.IsNullOrWhiteSpace()) - { - return new List(); - } - - return JsonConvert.DeserializeObject>(webhookSubscription.Webhooks); + return new List(); } - /// - /// Adds webhook subscription to if not exists - /// - /// - /// webhook unique name - public static void SubscribeWebhook(this WebhookSubscription webhookSubscription, string name) + return JsonConvert.DeserializeObject>(webhookSubscription.Webhooks); + } + + /// + /// Adds webhook subscription to if not exists + /// + /// + /// webhook unique name + public static void SubscribeWebhook(this WebhookSubscription webhookSubscription, string name) + { + name = name.Trim(); + if (name.IsNullOrWhiteSpace()) { - name = name.Trim(); - if (name.IsNullOrWhiteSpace()) - { - throw new ArgumentNullException(nameof(name), $"{nameof(name)} can not be null, empty or whitespace!"); - } - - var webhookDefinitions = webhookSubscription.GetSubscribedWebhooks(); - if (webhookDefinitions.Contains(name)) - { - return; - } - - webhookDefinitions.Add(name); - webhookSubscription.SetWebhooks(JsonConvert.SerializeObject(webhookDefinitions)); + throw new ArgumentNullException(nameof(name), $"{nameof(name)} can not be null, empty or whitespace!"); } - /// - /// Removes webhook subscription from if exists - /// - /// - /// webhook unique name - public static void UnsubscribeWebhook(this WebhookSubscription webhookSubscription, string name) + var webhookDefinitions = webhookSubscription.GetSubscribedWebhooks(); + if (webhookDefinitions.Contains(name)) { - name = name.Trim(); - if (name.IsNullOrWhiteSpace()) - { - throw new ArgumentNullException(nameof(name), $"{nameof(name)} can not be null, empty or whitespace!"); - } - - var webhookDefinitions = webhookSubscription.GetSubscribedWebhooks(); - if (!webhookDefinitions.Contains(name)) - { - return; - } - - webhookDefinitions.Remove(name); - webhookSubscription.SetWebhooks(JsonConvert.SerializeObject(webhookDefinitions)); + return; } - /// - /// Clears all - /// - /// - public static void RemoveAllSubscribedWebhooks(this WebhookSubscription webhookSubscription) + webhookDefinitions.Add(name); + webhookSubscription.SetWebhooks(JsonConvert.SerializeObject(webhookDefinitions)); + } + + /// + /// Removes webhook subscription from if exists + /// + /// + /// webhook unique name + public static void UnsubscribeWebhook(this WebhookSubscription webhookSubscription, string name) + { + name = name.Trim(); + if (name.IsNullOrWhiteSpace()) { - webhookSubscription.SetWebhooks(null); + throw new ArgumentNullException(nameof(name), $"{nameof(name)} can not be null, empty or whitespace!"); } - /// - /// if subscribed to given webhook - /// - /// - public static bool IsSubscribed(this WebhookSubscription webhookSubscription, string webhookName) + var webhookDefinitions = webhookSubscription.GetSubscribedWebhooks(); + if (!webhookDefinitions.Contains(name)) { - if (webhookSubscription.Webhooks.IsNullOrWhiteSpace()) - { - return false; - } - - return webhookSubscription.GetSubscribedWebhooks().Contains(webhookName); + return; } - /// - /// Returns additional webhook headers - /// - /// - public static IDictionary GetWebhookHeaders(this WebhookSubscription webhookSubscription) - { - if (webhookSubscription.Headers.IsNullOrWhiteSpace()) - { - return new Dictionary(); - } + webhookDefinitions.Remove(name); + webhookSubscription.SetWebhooks(JsonConvert.SerializeObject(webhookDefinitions)); + } - return JsonConvert.DeserializeObject>(webhookSubscription.Headers); - } + /// + /// Clears all + /// + /// + public static void RemoveAllSubscribedWebhooks(this WebhookSubscription webhookSubscription) + { + webhookSubscription.SetWebhooks(null); + } - /// - /// Adds webhook subscription to if not exists - /// - public static void AddWebhookHeader(this WebhookSubscription webhookSubscription, string key, string value) + /// + /// if subscribed to given webhook + /// + /// + public static bool IsSubscribed(this WebhookSubscription webhookSubscription, string webhookName) + { + if (webhookSubscription.Webhooks.IsNullOrWhiteSpace()) { - if (key.IsNullOrWhiteSpace() ) - { - throw new ArgumentNullException(nameof(key), $"{nameof(key)} can not be null, empty or whitespace!"); - } - - if (value.IsNullOrWhiteSpace()) - { - throw new ArgumentNullException(nameof(value), $"{nameof(value)} can not be null, empty or whitespace!"); - } + return false; + } - var headers = webhookSubscription.GetWebhookHeaders(); - headers[key] = value; + return webhookSubscription.GetSubscribedWebhooks().Contains(webhookName); + } - webhookSubscription.SetHeaders(JsonConvert.SerializeObject(headers)); + /// + /// Returns additional webhook headers + /// + /// + public static IDictionary GetWebhookHeaders(this WebhookSubscription webhookSubscription) + { + if (webhookSubscription.Headers.IsNullOrWhiteSpace()) + { + return new Dictionary(); } - /// - /// Adds webhook subscription to if not exists - /// - /// - /// Key of header - public static void RemoveWebhookHeader(this WebhookSubscription webhookSubscription, string header) + return JsonConvert.DeserializeObject>(webhookSubscription.Headers); + } + + /// + /// Adds webhook subscription to if not exists + /// + public static void AddWebhookHeader(this WebhookSubscription webhookSubscription, string key, string value) + { + if (key.IsNullOrWhiteSpace() ) { - if (header.IsNullOrWhiteSpace()) - { - throw new ArgumentNullException(nameof(header), $"{nameof(header)} can not be null, empty or whitespace!"); - } + throw new ArgumentNullException(nameof(key), $"{nameof(key)} can not be null, empty or whitespace!"); + } - var headers = webhookSubscription.GetWebhookHeaders(); + if (value.IsNullOrWhiteSpace()) + { + throw new ArgumentNullException(nameof(value), $"{nameof(value)} can not be null, empty or whitespace!"); + } - if (!headers.ContainsKey(header)) - { - return; - } + var headers = webhookSubscription.GetWebhookHeaders(); + headers[key] = value; - headers.Remove(header); + webhookSubscription.SetHeaders(JsonConvert.SerializeObject(headers)); + } - webhookSubscription.SetHeaders(JsonConvert.SerializeObject(headers)); + /// + /// Adds webhook subscription to if not exists + /// + /// + /// Key of header + public static void RemoveWebhookHeader(this WebhookSubscription webhookSubscription, string header) + { + if (header.IsNullOrWhiteSpace()) + { + throw new ArgumentNullException(nameof(header), $"{nameof(header)} can not be null, empty or whitespace!"); } - /// - /// Clears all - /// - /// - public static void RemoveAllWebhookHeaders(this WebhookSubscription webhookSubscription) + var headers = webhookSubscription.GetWebhookHeaders(); + + if (!headers.ContainsKey(header)) { - webhookSubscription.SetHeaders(null); + return; } - public static WebhookSubscriptionInfo ToWebhookSubscriptionInfo(this WebhookSubscription webhookSubscription) + headers.Remove(header); + + webhookSubscription.SetHeaders(JsonConvert.SerializeObject(headers)); + } + + /// + /// Clears all + /// + /// + public static void RemoveAllWebhookHeaders(this WebhookSubscription webhookSubscription) + { + webhookSubscription.SetHeaders(null); + } + + public static WebhookSubscriptionInfo ToWebhookSubscriptionInfo(this WebhookSubscription webhookSubscription) + { + return new WebhookSubscriptionInfo { - return new WebhookSubscriptionInfo - { - Id = webhookSubscription.Id, - TenantId = webhookSubscription.TenantId, - IsActive = webhookSubscription.IsActive, - Secret = webhookSubscription.Secret, - WebhookUri = webhookSubscription.WebhookUri, - Webhooks = webhookSubscription.GetSubscribedWebhooks(), - Headers = webhookSubscription.GetWebhookHeaders() - }; - } + Id = webhookSubscription.Id, + TenantId = webhookSubscription.TenantId, + IsActive = webhookSubscription.IsActive, + Secret = webhookSubscription.Secret, + WebhookUri = webhookSubscription.WebhookUri, + Webhooks = webhookSubscription.GetSubscribedWebhooks(), + Headers = webhookSubscription.GetWebhookHeaders() + }; } } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/Settings/WebhooksManagementSettingDefinitionProvider.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/Settings/WebhooksManagementSettingDefinitionProvider.cs index e3aa21264..c0b99db5c 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/Settings/WebhooksManagementSettingDefinitionProvider.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/Settings/WebhooksManagementSettingDefinitionProvider.cs @@ -1,11 +1,10 @@ using Volo.Abp.Settings; -namespace LINGYUN.Abp.WebhooksManagement.Settings +namespace LINGYUN.Abp.WebhooksManagement.Settings; + +public class WebhooksManagementSettingDefinitionProvider : SettingDefinitionProvider { - public class WebhooksManagementSettingDefinitionProvider : SettingDefinitionProvider + public override void Define(ISettingDefinitionContext context) { - public override void Define(ISettingDefinitionContext context) - { - } } } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/Settings/WebhooksManagementSettings.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/Settings/WebhooksManagementSettings.cs index 1de9fcda9..0d0308786 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/Settings/WebhooksManagementSettings.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/Settings/WebhooksManagementSettings.cs @@ -1,7 +1,6 @@ -namespace LINGYUN.Abp.WebhooksManagement.Settings +namespace LINGYUN.Abp.WebhooksManagement.Settings; + +public static class WebhooksManagementSettings { - public static class WebhooksManagementSettings - { - public const string GroupName = "WebhooksManagement"; - } + public const string GroupName = "WebhooksManagement"; } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore.csproj b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore.csproj index 761338817..d23dd6144 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore.csproj +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore + LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore + false + false + false diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.HttpApi.Client/LINGYUN.Abp.WebhooksManagement.HttpApi.Client.csproj b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.HttpApi.Client/LINGYUN.Abp.WebhooksManagement.HttpApi.Client.csproj index 3b5112138..2105870f9 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.HttpApi.Client/LINGYUN.Abp.WebhooksManagement.HttpApi.Client.csproj +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.HttpApi.Client/LINGYUN.Abp.WebhooksManagement.HttpApi.Client.csproj @@ -4,7 +4,12 @@ - netstandard2.0 + netstandard2.0;netstandard2.1;net8.0 + LINGYUN.Abp.WebhooksManagement.HttpApi.Client + LINGYUN.Abp.WebhooksManagement.HttpApi.Client + false + false + false diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.HttpApi/LINGYUN.Abp.WebhooksManagement.HttpApi.csproj b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.HttpApi/LINGYUN.Abp.WebhooksManagement.HttpApi.csproj index c5795af97..89e4a4e9d 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.HttpApi/LINGYUN.Abp.WebhooksManagement.HttpApi.csproj +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.HttpApi/LINGYUN.Abp.WebhooksManagement.HttpApi.csproj @@ -5,6 +5,11 @@ net8.0 + LINGYUN.Abp.WebhooksManagement.HttpApi + LINGYUN.Abp.WebhooksManagement.HttpApi + false + false + false diff --git a/aspnet-core/services/LY.MicroService.Applications.Single/Authentication/AbpCookieAuthenticationHandler.cs b/aspnet-core/services/LY.MicroService.Applications.Single/Authentication/AbpCookieAuthenticationHandler.cs new file mode 100644 index 000000000..dda2758a7 --- /dev/null +++ b/aspnet-core/services/LY.MicroService.Applications.Single/Authentication/AbpCookieAuthenticationHandler.cs @@ -0,0 +1,85 @@ +using Microsoft.AspNetCore.Authentication; +using Microsoft.AspNetCore.Authentication.Cookies; +using Microsoft.Extensions.Options; +using System.Text.Encodings.Web; +using Volo.Abp.Http; + +namespace LY.MicroService.Applications.Single.Authentication; + +public class AbpCookieAuthenticationHandler : CookieAuthenticationHandler +{ + public AbpCookieAuthenticationHandler( + IOptionsMonitor options, + ILoggerFactory logger, + UrlEncoder encoder) : base(options, logger, encoder) + { + } + + public AbpCookieAuthenticationHandler( + IOptionsMonitor options, + ILoggerFactory logger, + UrlEncoder encoder, + ISystemClock clock) : base(options, logger, encoder, clock) + { + } + protected override Task InitializeEventsAsync() + { + var events = new CookieAuthenticationEvents + { + OnRedirectToLogin = ctx => + { + if (ctx.Request.CanAccept(MimeTypes.Application.Json)) + { + ctx.Response.Headers.Location = ctx.RedirectUri; + ctx.Response.StatusCode = 401; + } + else + { + ctx.Response.Redirect(ctx.RedirectUri); + } + return Task.CompletedTask; + }, + OnRedirectToAccessDenied = ctx => + { + if (ctx.Request.CanAccept(MimeTypes.Application.Json)) + { + ctx.Response.Headers.Location = ctx.RedirectUri; + ctx.Response.StatusCode = 403; + } + else + { + ctx.Response.Redirect(ctx.RedirectUri); + } + return Task.CompletedTask; + }, + OnRedirectToLogout = ctx => + { + if (ctx.Request.CanAccept(MimeTypes.Application.Json)) + { + ctx.Response.Headers.Location = ctx.RedirectUri; + } + else + { + ctx.Response.Redirect(ctx.RedirectUri); + } + return Task.CompletedTask; + }, + OnRedirectToReturnUrl = ctx => + { + if (ctx.Request.CanAccept(MimeTypes.Application.Json)) + { + ctx.Response.Headers.Location = ctx.RedirectUri; + } + else + { + ctx.Response.Redirect(ctx.RedirectUri); + } + return Task.CompletedTask; + } + }; + + Events = events; + + return Task.CompletedTask; + } +} diff --git a/aspnet-core/services/LY.MicroService.Applications.Single/LY.MicroService.Applications.Single.csproj b/aspnet-core/services/LY.MicroService.Applications.Single/LY.MicroService.Applications.Single.csproj index 214e3e960..83a4abe87 100644 --- a/aspnet-core/services/LY.MicroService.Applications.Single/LY.MicroService.Applications.Single.csproj +++ b/aspnet-core/services/LY.MicroService.Applications.Single/LY.MicroService.Applications.Single.csproj @@ -17,6 +17,8 @@ + + @@ -28,6 +30,7 @@ + @@ -130,25 +133,33 @@ + + + - + + + + + + diff --git a/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.Configure.cs b/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.Configure.cs index 7cd9298de..ca7c31f5e 100644 --- a/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.Configure.cs +++ b/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.Configure.cs @@ -1,11 +1,11 @@ using Elsa; using Elsa.Options; -using LINGYUN.Abp.AspNetCore.HttpOverrides.Forwarded; +using LINGYUN.Abp.Aliyun.Localization; using LINGYUN.Abp.BackgroundTasks; using LINGYUN.Abp.ExceptionHandling; using LINGYUN.Abp.ExceptionHandling.Emailing; using LINGYUN.Abp.Idempotent; -using LINGYUN.Abp.IdentityServer; +using LINGYUN.Abp.Identity.Session; using LINGYUN.Abp.IdentityServer.IdentityResources; using LINGYUN.Abp.Localization.CultureMap; using LINGYUN.Abp.Notifications; @@ -13,20 +13,22 @@ using LINGYUN.Abp.Saas; using LINGYUN.Abp.Serilog.Enrichers.Application; using LINGYUN.Abp.Serilog.Enrichers.UniqueId; +using LINGYUN.Abp.Tencent.Localization; using LINGYUN.Abp.TextTemplating; using LINGYUN.Abp.WebhooksManagement; using LINGYUN.Abp.WeChat.Common.Messages.Handlers; +using LINGYUN.Abp.WeChat.Localization; using LINGYUN.Abp.Wrapper; +using LINGYUN.Platform.Localization; +using LY.MicroService.Applications.Single.Authentication; using LY.MicroService.Applications.Single.IdentityResources; -using LY.MicroService.Applications.Single.WeChat.Official.Messages; using Medallion.Threading; using Medallion.Threading.Redis; +using Microsoft.AspNetCore.Authentication.Cookies; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Cors; using Microsoft.AspNetCore.DataProtection; -using Microsoft.AspNetCore.HttpOverrides; using Microsoft.AspNetCore.Identity; -using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Server.Kestrel.Core; using Microsoft.Extensions.Caching.StackExchangeRedis; using Microsoft.IdentityModel.Logging; @@ -41,6 +43,7 @@ using System.Text.Unicode; using Volo.Abp; using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.AntiForgery; using Volo.Abp.AspNetCore.Mvc.UI.Bundling; using Volo.Abp.Auditing; using Volo.Abp.Authorization.Permissions; @@ -51,17 +54,22 @@ using Volo.Abp.FeatureManagement; using Volo.Abp.Features; using Volo.Abp.GlobalFeatures; +using Volo.Abp.Http; +using Volo.Abp.Http.Client; +using Volo.Abp.Identity.Localization; using Volo.Abp.IdentityServer; +using Volo.Abp.IdentityServer.Localization; using Volo.Abp.Json; using Volo.Abp.Json.SystemTextJson; using Volo.Abp.Localization; using Volo.Abp.MultiTenancy; using Volo.Abp.OpenIddict; +using Volo.Abp.OpenIddict.Localization; using Volo.Abp.PermissionManagement; using Volo.Abp.Quartz; using Volo.Abp.Security.Claims; using Volo.Abp.SettingManagement; -using Volo.Abp.TextTemplating; +using Volo.Abp.SettingManagement.Localization; using Volo.Abp.Threading; using Volo.Abp.UI.Navigation.Urls; using Volo.Abp.VirtualFileSystem; @@ -83,16 +91,6 @@ private void PreConfigureFeature() }); } - private void PreConfigureForwardedHeaders() - { - PreConfigure(options => - { - options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto; - options.KnownNetworks.Clear(); - options.KnownProxies.Clear(); - }); - } - private void PreConfigureApp(IConfiguration configuration) { AbpSerilogEnrichersConsts.ApplicationName = ApplicationName; @@ -122,6 +120,8 @@ private void PreConfigureAuthServer(IConfiguration configuration) options.UseLocalServer(); options.UseAspNetCore(); + + options.UseDataProtection(); }); }); } @@ -158,6 +158,12 @@ private void PreConfigureCertificate(IConfiguration configuration, IWebHostEnvir { builder.AddSigningCertificate(certificate); builder.AddEncryptionCertificate(certificate); + + builder.UseDataProtection(); + + // 禁用https + builder.UseAspNetCore() + .DisableTransportSecurityRequirement(); }); } else @@ -174,6 +180,45 @@ private void PreConfigureCertificate(IConfiguration configuration, IWebHostEnvir } } } + else + { + if (configuration.GetValue("AuthServer:UseOpenIddict")) + { + PreConfigure(options => + { + //https://documentation.openiddict.com/configuration/encryption-and-signing-credentials.html + options.AddDevelopmentEncryptionAndSigningCertificate = false; + }); + + PreConfigure(builder => + { + //https://documentation.openiddict.com/configuration/encryption-and-signing-credentials.html + using (var algorithm = RSA.Create(keySizeInBits: 2048)) + { + var subject = new X500DistinguishedName("CN=Fabrikam Encryption Certificate"); + var request = new CertificateRequest(subject, algorithm, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1); + request.CertificateExtensions.Add(new X509KeyUsageExtension(X509KeyUsageFlags.DigitalSignature, critical: true)); + var certificate = request.CreateSelfSigned(DateTimeOffset.UtcNow, DateTimeOffset.UtcNow.AddYears(2)); + builder.AddSigningCertificate(certificate); + } + + using (var algorithm = RSA.Create(keySizeInBits: 2048)) + { + var subject = new X500DistinguishedName("CN=Fabrikam Signing Certificate"); + var request = new CertificateRequest(subject, algorithm, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1); + request.CertificateExtensions.Add(new X509KeyUsageExtension(X509KeyUsageFlags.KeyEncipherment, critical: true)); + var certificate = request.CreateSelfSigned(DateTimeOffset.UtcNow, DateTimeOffset.UtcNow.AddYears(2)); + builder.AddEncryptionCertificate(certificate); + } + + builder.UseDataProtection(); + + // 禁用https + builder.UseAspNetCore() + .DisableTransportSecurityRequirement(); + }); + } + } } private void PreConfigureQuartz(IConfiguration configuration) @@ -622,6 +667,10 @@ private void ConfigureIdentity(IConfiguration configuration) { options.IsDynamicClaimsEnabled = true; }); + Configure(options => + { + options.IsCleanupEnabled = true; + }); } private void ConfigureMvcUiTheme() @@ -657,6 +706,16 @@ private void ConfigureLocalization() "vben-admin-ui", new NameValue("zh_CN", "zh-Hans")); + options.Resources.Get() + .AddBaseTypes( + typeof(IdentityResource), + typeof(AliyunResource), + typeof(TencentCloudResource), + typeof(WeChatResource), + typeof(PlatformResource), + typeof(AbpOpenIddictResource), + typeof(AbpIdentityServerResource)); + options.UseAllPersistence(); }); @@ -678,9 +737,29 @@ private void ConfigureWrapper() Configure(options => { options.IsEnabled = true; + // options.IsWrapUnauthorizedEnabled = true; options.IgnoreNamespaces.Add("Elsa"); - options.IgnoreNamespaces.Add("LINGYUN.Abp.OssManagement"); - options.IgnoreNamespaces.Add("LINGYUN.Abp.WeChat"); + }); + } + + private void PreConfigureWrapper() + { + //PreConfigure(options => + //{ + // options.ProxyRequestActions.Add( + // (appid, httprequestmessage) => + // { + // httprequestmessage.Headers.TryAddWithoutValidation(AbpHttpWrapConsts.AbpDontWrapResult, "true"); + // }); + //}); + + PreConfigure(options => + { + options.ProxyClientActions.Add( + (_, _, client) => + { + client.DefaultRequestHeaders.TryAddWithoutValidation(AbpHttpWrapConsts.AbpDontWrapResult, "true"); + }); }); } @@ -711,6 +790,13 @@ private void ConfigureUrls(IConfiguration configuration) private void ConfigureSecurity(IServiceCollection services, IConfiguration configuration, bool isDevelopment = false) { + Configure(options => + { + options.AutoValidate = false; + }); + + services.Replace(ServiceLifetime.Scoped); + services.AddAuthentication() .AddJwtBearer(options => { @@ -733,11 +819,6 @@ private void ConfigureSecurity(IServiceCollection services, IConfiguration confi }; }); - if (isDevelopment) - { - services.AddAlwaysAllowAuthorization(); - } - if (!isDevelopment) { var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]); diff --git a/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs b/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs index a96a673be..f21aef8b8 100644 --- a/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs +++ b/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs @@ -34,9 +34,15 @@ using LINGYUN.Abp.Features.LimitValidation.Redis.Client; using LINGYUN.Abp.Http.Client.Wrapper; using LINGYUN.Abp.Identity; +using LINGYUN.Abp.Identity.AspNetCore.Session; using LINGYUN.Abp.Identity.EntityFrameworkCore; +using LINGYUN.Abp.Identity.Notifications; using LINGYUN.Abp.Identity.OrganizaztionUnits; +using LINGYUN.Abp.Identity.Session.AspNetCore; using LINGYUN.Abp.Identity.WeChat; +using LINGYUN.Abp.IdentityServer; +using LINGYUN.Abp.IdentityServer.EntityFrameworkCore; +using LINGYUN.Abp.IdentityServer.Session; using LINGYUN.Abp.IdGenerator; using LINGYUN.Abp.IM.SignalR; using LINGYUN.Abp.Localization.CultureMap; @@ -55,6 +61,7 @@ using LINGYUN.Abp.OpenApi.Authorization; using LINGYUN.Abp.OpenIddict; using LINGYUN.Abp.OpenIddict.AspNetCore; +using LINGYUN.Abp.OpenIddict.AspNetCore.Session; using LINGYUN.Abp.OpenIddict.Portal; using LINGYUN.Abp.OpenIddict.Sms; using LINGYUN.Abp.OpenIddict.WeChat; @@ -95,6 +102,7 @@ using LINGYUN.Platform.Settings.VueVbenAdmin; using LINGYUN.Platform.Theme.VueVbenAdmin; using LY.MicroService.Applications.Single.EntityFrameworkCore; +using Microsoft.AspNetCore.Authorization; using Volo.Abp; using Volo.Abp.Account.Web; using Volo.Abp.AspNetCore.Authentication.JwtBearer; @@ -103,10 +111,10 @@ using Volo.Abp.AspNetCore.Serilog; using Volo.Abp.Autofac; using Volo.Abp.Caching.StackExchangeRedis; +using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore.MySQL; using Volo.Abp.EventBus; using Volo.Abp.FeatureManagement.EntityFrameworkCore; -using Volo.Abp.Identity.AspNetCore; using Volo.Abp.Modularity; using Volo.Abp.OpenIddict.EntityFrameworkCore; using Volo.Abp.PermissionManagement.EntityFrameworkCore; @@ -114,6 +122,7 @@ using Volo.Abp.PermissionManagement.IdentityServer; using Volo.Abp.SettingManagement; using Volo.Abp.SettingManagement.EntityFrameworkCore; +using Volo.Abp.Threading; namespace LY.MicroService.Applications.Single; @@ -127,15 +136,13 @@ namespace LY.MicroService.Applications.Single; typeof(AbpCachingManagementStackExchangeRedisModule), typeof(AbpCachingManagementApplicationModule), typeof(AbpCachingManagementHttpApiModule), - typeof(AbpIdentityAspNetCoreModule), + typeof(AbpIdentityAspNetCoreSessionModule), + typeof(AbpIdentitySessionAspNetCoreModule), + typeof(AbpIdentityNotificationsModule), typeof(AbpIdentityDomainModule), typeof(AbpIdentityApplicationModule), typeof(AbpIdentityHttpApiModule), typeof(AbpIdentityEntityFrameworkCoreModule), - //typeof(AbpIdentityServerDomainModule), - //typeof(AbpIdentityServerApplicationModule), - //typeof(AbpIdentityServerHttpApiModule), - //typeof(AbpIdentityServerEntityFrameworkCoreModule), typeof(AbpLocalizationManagementDomainModule), typeof(AbpLocalizationManagementApplicationModule), typeof(AbpLocalizationManagementHttpApiModule), @@ -150,7 +157,14 @@ namespace LY.MicroService.Applications.Single; typeof(AbpNotificationsApplicationModule), typeof(AbpNotificationsHttpApiModule), typeof(AbpNotificationsEntityFrameworkCoreModule), + + //typeof(AbpIdentityServerSessionModule), + //typeof(AbpIdentityServerApplicationModule), + //typeof(AbpIdentityServerHttpApiModule), + //typeof(AbpIdentityServerEntityFrameworkCoreModule), + typeof(AbpOpenIddictAspNetCoreModule), + typeof(AbpOpenIddictAspNetCoreSessionModule), typeof(AbpOpenIddictApplicationModule), typeof(AbpOpenIddictHttpApiModule), typeof(AbpOpenIddictEntityFrameworkCoreModule), @@ -158,6 +172,7 @@ namespace LY.MicroService.Applications.Single; typeof(AbpOpenIddictPortalModule), typeof(AbpOpenIddictWeChatModule), typeof(AbpOpenIddictWeChatWorkModule), + typeof(AbpOssManagementDomainModule), typeof(AbpOssManagementApplicationModule), typeof(AbpOssManagementHttpApiModule), @@ -200,7 +215,7 @@ namespace LY.MicroService.Applications.Single; typeof(AbpPermissionManagementApplicationModule), typeof(AbpPermissionManagementHttpApiModule), typeof(AbpPermissionManagementDomainIdentityModule), - typeof(AbpPermissionManagementDomainIdentityServerModule), + // typeof(AbpPermissionManagementDomainIdentityServerModule), typeof(AbpPermissionManagementEntityFrameworkCoreModule), typeof(AbpPermissionManagementDomainOrganizationUnitsModule), // 组织机构权限管理 typeof(SingleMigrationsEntityFrameworkCoreModule), @@ -274,9 +289,9 @@ public override void PreConfigureServices(ServiceConfigurationContext context) var configuration = context.Services.GetConfiguration(); var hostingEnvironment = context.Services.GetHostingEnvironment(); + PreConfigureWrapper(); PreConfigureFeature(); PreConfigureIdentity(); - PreConfigureForwardedHeaders(); PreConfigureApp(configuration); PreConfigureQuartz(configuration); PreConfigureAuthServer(configuration); @@ -322,49 +337,13 @@ public override void ConfigureServices(ServiceConfigurationContext context) ConfigureSecurity(context.Services, configuration, hostingEnvironment.IsDevelopment()); } - //public override void OnApplicationInitialization(ApplicationInitializationContext context) - //{ - // var app = context.GetApplicationBuilder(); - // var configuration = context.GetConfiguration(); + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + AsyncHelper.RunSync(async () => await OnApplicationInitializationAsync(context)); + } - // app.UseCookiePolicy(); - // // 本地化 - // app.UseMapRequestLocalization(); - // // http调用链 - // app.UseCorrelationId(); - // // 虚拟文件系统 - // app.UseStaticFiles(); - // // 路由 - // app.UseRouting(); - // // 跨域 - // app.UseCors(DefaultCorsPolicyName); - // // 认证 - // app.UseAuthentication(); - // if (configuration.GetValue("AuthServer:UseOpenIddict")) - // { - // app.UseAbpOpenIddictValidation(); - // } - // else - // { - // // jwt - // app.UseJwtTokenMiddleware(); - // app.UseIdentityServer(); - // } - // // 多租户 - // app.UseMultiTenancy(); - // // 授权 - // app.UseAuthorization(); - // // Swagger - // app.UseSwagger(); - // // Swagger可视化界面 - // app.UseSwaggerUI(options => - // { - // options.SwaggerEndpoint("/swagger/v1/swagger.json", "Support App API"); - // }); - // // 审计日志 - // app.UseAuditing(); - // app.UseAbpSerilogEnrichers(); - // // 路由 - // app.UseConfiguredEndpoints(); - //} + public async override Task OnApplicationInitializationAsync(ApplicationInitializationContext context) + { + await context.ServiceProvider.GetRequiredService().SeedAsync(); ; + } } diff --git a/aspnet-core/services/LY.MicroService.Applications.Single/Program.cs b/aspnet-core/services/LY.MicroService.Applications.Single/Program.cs index 8b7ee6cdb..bb6316cd8 100644 --- a/aspnet-core/services/LY.MicroService.Applications.Single/Program.cs +++ b/aspnet-core/services/LY.MicroService.Applications.Single/Program.cs @@ -1,3 +1,4 @@ +using LINGYUN.Abp.Identity.Session.AspNetCore; using LY.MicroService.Applications.Single; using Microsoft.AspNetCore.Cors; using Serilog; @@ -56,7 +57,7 @@ await builder.AddApplicationAsync(options { app.UseDeveloperExceptionPage(); } - +// app.UseAbpExceptionHandling(); app.UseCookiePolicy(); app.UseMapRequestLocalization(); app.UseCorrelationId(); @@ -64,9 +65,9 @@ await builder.AddApplicationAsync(options app.UseRouting(); app.UseCors(); app.UseAuthentication(); -app.UseAbpClaimsMap(); -app.UseDynamicClaims(); app.UseAbpOpenIddictValidation(); +app.UseAbpSession(); +app.UseDynamicClaims(); app.UseMultiTenancy(); app.UseAuthorization(); app.UseSwagger(); diff --git a/aspnet-core/services/LY.MicroService.Applications.Single/Properties/launchSettings.json b/aspnet-core/services/LY.MicroService.Applications.Single/Properties/launchSettings.json index b9fee327d..2831e6761 100644 --- a/aspnet-core/services/LY.MicroService.Applications.Single/Properties/launchSettings.json +++ b/aspnet-core/services/LY.MicroService.Applications.Single/Properties/launchSettings.json @@ -14,7 +14,7 @@ "launchBrowser": false, "applicationUrl": "http://0.0.0.0:30001", "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Production" + "ASPNETCORE_ENVIRONMENT": "Development" } } } diff --git a/aspnet-core/services/LY.MicroService.Applications.Single/appsettings.Development.json b/aspnet-core/services/LY.MicroService.Applications.Single/appsettings.Development.json index 61451ebf0..41c4e391f 100644 --- a/aspnet-core/services/LY.MicroService.Applications.Single/appsettings.Development.json +++ b/aspnet-core/services/LY.MicroService.Applications.Single/appsettings.Development.json @@ -1,11 +1,5 @@ { "App": { - "Forwarded": { - "ForwardedHeaders": 5, - "KnownProxies": [ - "127.0.0.1" - ] - }, "CorsOrigins": "http://127.0.0.1:3100" }, "Auditing": { @@ -20,22 +14,23 @@ } }, "ConnectionStrings": { - "Default": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456", - "AbpAuditLogging": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456", - "AbpOpenIddict": "Server=127.0.0.1;Database=IdentityServer-V70;User Id=root;Password=123456", - "AbpIdentity": "Server=127.0.0.1;Database=IdentityServer-V70;User Id=root;Password=123456", - "AbpIdentityServer": "Server=127.0.0.1;Database=IdentityServer-V70;User Id=root;Password=123456", - "AbpSaas": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456", - "AbpTenantManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456", - "AbpFeatureManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456", - "AbpSettingManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456", - "AbpPermissionManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456", - "AbpLocalizationManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456", - "AbpTextTemplating": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456", - "TaskManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456", - "Workflow": "Server=127.0.0.1;Database=Workflow-V70;User Id=root;Password=123456", - "Notifications": "Server=127.0.0.1;Database=Messages-V70;User Id=root;Password=123456", - "MessageService": "Server=127.0.0.1;Database=Messages-V70;User Id=root;Password=123456" + "Default": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None", + "AbpAuditLogging": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None", + "AbpOpenIddict": "Server=127.0.0.1;Database=IdentityServer-V70;User Id=root;Password=123456;SslMode=None", + "AbpIdentity": "Server=127.0.0.1;Database=IdentityServer-V70;User Id=root;Password=123456;SslMode=None", + "AbpIdentityServer": "Server=127.0.0.1;Database=IdentityServer-V70;User Id=root;Password=123456;SslMode=None", + "AbpSaas": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None", + "AbpTenantManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None", + "AbpFeatureManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None", + "AbpSettingManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None", + "AbpPermissionManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None", + "AbpLocalizationManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None", + "AbpTextTemplating": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None", + "AppPlatform": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None", + "TaskManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None", + "Workflow": "Server=127.0.0.1;Database=Workflow-V70;User Id=root;Password=123456;SslMode=None", + "Notifications": "Server=127.0.0.1;Database=Messages-V70;User Id=root;Password=123456;SslMode=None", + "MessageService": "Server=127.0.0.1;Database=Messages-V70;User Id=root;Password=123456;SslMode=None" }, "DistributedLock": { "IsEnabled": true, @@ -105,11 +100,12 @@ } }, "Redis": { + "IsEnabled": true, "Configuration": "127.0.0.1,defaultDatabase=15", "InstanceName": "LINGYUN.Abp.Application" }, "AuthServer": { - "UseOpenIddict": false, + "UseOpenIddict": true, "Authority": "http://127.0.0.1:30000/", "ApiName": "lingyun-abp-application", "SwaggerClientId": "InternalServiceClient", diff --git a/aspnet-core/services/LY.MicroService.Applications.Single/appsettings.json b/aspnet-core/services/LY.MicroService.Applications.Single/appsettings.json index a613c88ab..45cf023f2 100644 --- a/aspnet-core/services/LY.MicroService.Applications.Single/appsettings.json +++ b/aspnet-core/services/LY.MicroService.Applications.Single/appsettings.json @@ -1,4 +1,7 @@ { + "Forwarded": { + "ForwardedHeaders": "XForwardedFor,XForwardedProto" + }, "StringEncryption": { "DefaultPassPhrase": "s46c5q55nxpeS8Ra", "InitVectorBytes": "s83ng0abvd02js84", diff --git a/aspnet-core/services/LY.MicroService.Applications.Single/gulpfile.js b/aspnet-core/services/LY.MicroService.Applications.Single/gulpfile.js index 5dcf4c5c6..bec4d578f 100644 --- a/aspnet-core/services/LY.MicroService.Applications.Single/gulpfile.js +++ b/aspnet-core/services/LY.MicroService.Applications.Single/gulpfile.js @@ -4,6 +4,7 @@ var gulp = require("gulp"), path = require('path'), copyResources = require('./node_modules/@abp/aspnetcore.mvc.ui/gulp/copy-resources.js'); -exports.default = function(){ - return copyResources(path.resolve('./')); +exports.default = function(done){ + copyResources(path.resolve('./')); + done(); }; \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/AuthServerHttpApiHostModule.Configure.cs b/aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/AuthServerHttpApiHostModule.Configure.cs index 61ddade80..23062ed72 100644 --- a/aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/AuthServerHttpApiHostModule.Configure.cs +++ b/aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/AuthServerHttpApiHostModule.Configure.cs @@ -1,10 +1,12 @@ using DotNetCore.CAP; using LINGYUN.Abp.ExceptionHandling; using LINGYUN.Abp.ExceptionHandling.Emailing; +using LINGYUN.Abp.Identity.Session; using LINGYUN.Abp.Localization.CultureMap; using LINGYUN.Abp.OpenIddict.Permissions; using LINGYUN.Abp.Serilog.Enrichers.Application; using LINGYUN.Abp.Serilog.Enrichers.UniqueId; +using LINGYUN.Abp.Wrapper; using Medallion.Threading; using Medallion.Threading.Redis; using Microsoft.AspNetCore.Authentication.JwtBearer; @@ -35,6 +37,7 @@ using Volo.Abp.EntityFrameworkCore; using Volo.Abp.FeatureManagement; using Volo.Abp.GlobalFeatures; +using Volo.Abp.Http.Client; using Volo.Abp.Identity.Localization; using Volo.Abp.Json; using Volo.Abp.Json.SystemTextJson; @@ -351,6 +354,10 @@ private void ConfigureIdentity() { options.IsDynamicClaimsEnabled = true; }); + Configure(options => + { + options.IsCleanupEnabled = true; + }); } private void ConfigureSwagger(IServiceCollection services) @@ -425,8 +432,7 @@ private void ConfigureCors(IServiceCollection services, IConfiguration configura .ToArray() ) .WithAbpExposedHeaders() - // 引用 LINGYUN.Abp.AspNetCore.Mvc.Wrapper 包时可替换为 WithAbpWrapExposedHeaders - .WithExposedHeaders("_AbpWrapResult", "_AbpDontWrapResult") + .WithAbpWrapExposedHeaders() .SetIsOriginAllowedToAllowWildcardSubdomains() .AllowAnyHeader() .AllowAnyMethod() @@ -452,4 +458,33 @@ private void ConfigureSecurity(IServiceCollection services, IConfiguration confi .PersistKeysToStackExchangeRedis(redis, "LINGYUN.Abp.Application:DataProtection:Protection-Keys"); } } + + private void ConfigureWrapper() + { + Configure(options => + { + options.IsEnabled = true; + }); + } + + private void PreConfigureWrapper() + { + //PreConfigure(options => + //{ + // options.ProxyRequestActions.Add( + // (appid, httprequestmessage) => + // { + // httprequestmessage.Headers.TryAddWithoutValidation(AbpHttpWrapConsts.AbpDontWrapResult, "true"); + // }); + //}); + // 服务间调用不包装 + PreConfigure(options => + { + options.ProxyClientActions.Add( + (_, _, client) => + { + client.DefaultRequestHeaders.TryAddWithoutValidation(AbpHttpWrapConsts.AbpDontWrapResult, "true"); + }); + }); + } } diff --git a/aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/AuthServerHttpApiHostModule.cs b/aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/AuthServerHttpApiHostModule.cs index 7e0dbba99..aa4896c23 100644 --- a/aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/AuthServerHttpApiHostModule.cs +++ b/aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/AuthServerHttpApiHostModule.cs @@ -1,6 +1,7 @@ using LINGYUN.Abp.Account; using LINGYUN.Abp.AspNetCore.HttpOverrides; using LINGYUN.Abp.AspNetCore.Mvc.Localization; +using LINGYUN.Abp.AspNetCore.Mvc.Wrapper; using LINGYUN.Abp.AuditLogging.Elasticsearch; using LINGYUN.Abp.Authorization.OrganizationUnits; using LINGYUN.Abp.Claims.Mapping; @@ -8,6 +9,8 @@ using LINGYUN.Abp.ExceptionHandling.Emailing; using LINGYUN.Abp.Identity; using LINGYUN.Abp.Identity.EntityFrameworkCore; +using LINGYUN.Abp.Identity.Notifications; +using LINGYUN.Abp.Identity.Session.AspNetCore; using LINGYUN.Abp.Localization.CultureMap; using LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore; using LINGYUN.Abp.OpenIddict; @@ -21,12 +24,14 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Volo.Abp; +using Volo.Abp.AspNetCore.Authentication.JwtBearer; using Volo.Abp.AspNetCore.MultiTenancy; using Volo.Abp.AspNetCore.Serilog; using Volo.Abp.Autofac; using Volo.Abp.Caching.StackExchangeRedis; using Volo.Abp.EntityFrameworkCore.MySQL; using Volo.Abp.FeatureManagement.EntityFrameworkCore; +using Volo.Abp.Http.Client; using Volo.Abp.Modularity; using Volo.Abp.OpenIddict.EntityFrameworkCore; using Volo.Abp.PermissionManagement.EntityFrameworkCore; @@ -42,6 +47,7 @@ namespace LY.MicroService.AuthServer; typeof(AbpAspNetCoreMvcLocalizationModule), typeof(AbpAccountApplicationModule), typeof(AbpAccountHttpApiModule), + typeof(AbpIdentityNotificationsModule), typeof(AbpIdentityApplicationModule), typeof(AbpIdentityHttpApiModule), typeof(AbpIdentityEntityFrameworkCoreModule), @@ -57,11 +63,15 @@ namespace LY.MicroService.AuthServer; typeof(AbpAuthorizationOrganizationUnitsModule), typeof(AbpAuditLoggingElasticsearchModule), typeof(AbpEmailingExceptionHandlingModule), + typeof(AbpAspNetCoreAuthenticationJwtBearerModule), + typeof(AbpIdentitySessionAspNetCoreModule), typeof(AbpCAPEventBusModule), + typeof(AbpHttpClientModule), typeof(AbpAliyunSmsModule), typeof(AbpCachingStackExchangeRedisModule), typeof(AbpLocalizationCultureMapModule), typeof(AbpAspNetCoreHttpOverridesModule), + typeof(AbpAspNetCoreMvcWrapperModule), typeof(AbpClaimsMappingModule), typeof(AbpAutofacModule) )] @@ -71,6 +81,7 @@ public override void PreConfigureServices(ServiceConfigurationContext context) { var configuration = context.Services.GetConfiguration(); + PreConfigureWrapper(); PreConfigureFeature(); PreForwardedHeaders(); PreConfigureApp(configuration); @@ -83,6 +94,7 @@ public override void ConfigureServices(ServiceConfigurationContext context) var hostingEnvironment = context.Services.GetHostingEnvironment(); var configuration = context.Services.GetConfiguration(); + ConfigureWrapper(); ConfigureIdentity(); ConfigureDbContext(); ConfigureLocalization(); @@ -120,6 +132,10 @@ public override void OnApplicationInitialization(ApplicationInitializationContex app.UseCors(DefaultCorsPolicyName); // 认证 app.UseAuthentication(); + app.UseJwtTokenMiddleware(); + // 会话 + app.UseAbpSession(); + // 动态身份 app.UseDynamicClaims(); // 多租户 app.UseMultiTenancy(); diff --git a/aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/LY.MicroService.AuthServer.HttpApi.Host.csproj b/aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/LY.MicroService.AuthServer.HttpApi.Host.csproj index 7e2310557..672a67c5e 100644 --- a/aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/LY.MicroService.AuthServer.HttpApi.Host.csproj +++ b/aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/LY.MicroService.AuthServer.HttpApi.Host.csproj @@ -38,11 +38,13 @@ + + @@ -62,12 +64,15 @@ + + + diff --git a/aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/appsettings.json b/aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/appsettings.json index 4025fd25c..932439784 100644 --- a/aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/appsettings.json +++ b/aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/appsettings.json @@ -5,6 +5,9 @@ "Forwarded": { "ForwardedHeaders": "XForwardedFor,XForwardedProto" }, + "App": { + "CorsOrigins": "http://localhost:3100" + }, "StringEncryption": { "DefaultPassPhrase": "s46c5q55nxpeS8Ra", "InitVectorBytes": "s83ng0abvd02js84", diff --git a/aspnet-core/services/LY.MicroService.AuthServer/AuthServerModule.Configure.cs b/aspnet-core/services/LY.MicroService.AuthServer/AuthServerModule.Configure.cs index f26e0d48a..f8500b1fc 100644 --- a/aspnet-core/services/LY.MicroService.AuthServer/AuthServerModule.Configure.cs +++ b/aspnet-core/services/LY.MicroService.AuthServer/AuthServerModule.Configure.cs @@ -2,8 +2,10 @@ using LINGYUN.Abp.Localization.CultureMap; using LINGYUN.Abp.Serilog.Enrichers.Application; using LINGYUN.Abp.Serilog.Enrichers.UniqueId; +using LY.MicroService.AuthServer.Authentication; using Medallion.Threading; using Medallion.Threading.Redis; +using Microsoft.AspNetCore.Authentication.Cookies; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Cors; using Microsoft.AspNetCore.DataProtection; @@ -14,8 +16,10 @@ using Microsoft.Extensions.Caching.StackExchangeRedis; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Hosting; using Microsoft.IdentityModel.Logging; +using OpenIddict.Validation.AspNetCore; using OpenTelemetry.Metrics; using OpenTelemetry.Resources; using OpenTelemetry.Trace; @@ -39,6 +43,7 @@ using Volo.Abp.Localization; using Volo.Abp.MultiTenancy; using Volo.Abp.OpenIddict; +using Volo.Abp.Security.Claims; using Volo.Abp.Threading; using Volo.Abp.Timing; using Volo.Abp.UI.Navigation.Urls; @@ -109,6 +114,8 @@ private void PreConfigureAuth() options.UseLocalServer(); options.UseAspNetCore(); + + options.UseDataProtection(); }); }); } @@ -139,6 +146,8 @@ private void PreConfigureCertificate(IConfiguration configuration, IWebHostEnvir builder.AddSigningCertificate(cer); builder.AddEncryptionCertificate(cer); + + builder.UseDataProtection(); }); } } @@ -171,6 +180,9 @@ private void PreConfigureCertificate(IConfiguration configuration, IWebHostEnvir builder.AddEncryptionCertificate(certificate); } + + builder.UseDataProtection(); + // 禁用https builder.UseAspNetCore() .DisableTransportSecurityRequirement(); @@ -317,6 +329,11 @@ private void ConfigureIdentity(IConfiguration configuration) identityConfiguration.Bind(options); } }); + Configure(options => + { + options.IsDynamicClaimsEnabled = true; + options.IsRemoteRefreshEnabled = false; + }); } private void ConfigureVirtualFileSystem() { @@ -391,6 +408,17 @@ private void ConfigureUrls(IConfiguration configuration) } private void ConfigureSecurity(IServiceCollection services, IConfiguration configuration, bool isDevelopment = false) { + services + .AddAuthentication() + .AddCookie(CookieAuthenticationDefaults.AuthenticationScheme, options => + { + options.ExpireTimeSpan = TimeSpan.FromDays(365); + }) + .AddJwtBearer(options => + { + configuration.GetSection("AuthServer").Bind(options); + }); + if (!isDevelopment) { var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]); @@ -399,8 +427,9 @@ private void ConfigureSecurity(IServiceCollection services, IConfiguration confi .SetApplicationName("LINGYUN.Abp.Application") .PersistKeysToStackExchangeRedis(redis, "LINGYUN.Abp.Application:DataProtection:Protection-Keys"); } - services.AddSameSiteCookiePolicy(); + // 处理cookie中过时的ajax请求判断 + services.Replace(ServiceDescriptor.Scoped()); } private void ConfigureMultiTenancy(IConfiguration configuration) { @@ -437,8 +466,7 @@ private void ConfigureCors(IServiceCollection services, IConfiguration configura .ToArray() ) .WithAbpExposedHeaders() - // 引用 LINGYUN.Abp.AspNetCore.Mvc.Wrapper 包时可替换为 WithAbpWrapExposedHeaders - .WithExposedHeaders("_AbpWrapResult", "_AbpDontWrapResult") + .WithAbpWrapExposedHeaders() .SetIsOriginAllowedToAllowWildcardSubdomains() .AllowAnyHeader() .AllowAnyMethod() diff --git a/aspnet-core/services/LY.MicroService.AuthServer/AuthServerModule.cs b/aspnet-core/services/LY.MicroService.AuthServer/AuthServerModule.cs index b95afdc53..76fced4b8 100644 --- a/aspnet-core/services/LY.MicroService.AuthServer/AuthServerModule.cs +++ b/aspnet-core/services/LY.MicroService.AuthServer/AuthServerModule.cs @@ -1,15 +1,19 @@ -using DotNetCore.CAP; -using LINGYUN.Abp.Account; +using LINGYUN.Abp.Account; using LINGYUN.Abp.AspNetCore.HttpOverrides; +using LINGYUN.Abp.AspNetCore.Mvc.Wrapper; using LINGYUN.Abp.AuditLogging.Elasticsearch; using LINGYUN.Abp.Authentication.QQ; using LINGYUN.Abp.Authentication.WeChat; using LINGYUN.Abp.Data.DbMigrator; using LINGYUN.Abp.EventBus.CAP; +using LINGYUN.Abp.Identity.AspNetCore.Session; using LINGYUN.Abp.Identity.EntityFrameworkCore; +using LINGYUN.Abp.Identity.Notifications; using LINGYUN.Abp.Identity.OrganizaztionUnits; +using LINGYUN.Abp.Identity.Session.AspNetCore; using LINGYUN.Abp.Localization.CultureMap; using LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore; +using LINGYUN.Abp.OpenIddict.AspNetCore.Session; using LINGYUN.Abp.OpenIddict.LinkUser; using LINGYUN.Abp.OpenIddict.Portal; using LINGYUN.Abp.OpenIddict.Sms; @@ -23,20 +27,17 @@ using LY.MicroService.AuthServer.EntityFrameworkCore; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.HttpOverrides; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Volo.Abp; using Volo.Abp.Account.Web; using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite; -using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; using Volo.Abp.AspNetCore.Serilog; using Volo.Abp.Autofac; using Volo.Abp.Caching.StackExchangeRedis; using Volo.Abp.EntityFrameworkCore.MySQL; using Volo.Abp.FeatureManagement.EntityFrameworkCore; using Volo.Abp.Identity; -using Volo.Abp.Identity.AspNetCore; using Volo.Abp.Modularity; using Volo.Abp.OpenIddict.EntityFrameworkCore; using Volo.Abp.PermissionManagement.EntityFrameworkCore; @@ -57,7 +58,9 @@ namespace LY.MicroService.AuthServer; typeof(AbpEntityFrameworkCoreMySQLModule), typeof(AbpIdentityEntityFrameworkCoreModule), typeof(AbpIdentityApplicationModule), - typeof(AbpIdentityAspNetCoreModule), + typeof(AbpIdentityAspNetCoreSessionModule), + typeof(AbpIdentityNotificationsModule), + typeof(AbpOpenIddictAspNetCoreSessionModule), typeof(AbpOpenIddictEntityFrameworkCoreModule), typeof(AbpOpenIddictSmsModule), typeof(AbpOpenIddictWeChatModule), @@ -78,6 +81,7 @@ namespace LY.MicroService.AuthServer; typeof(AbpDataDbMigratorModule), typeof(AbpAuditLoggingElasticsearchModule), // 放在 AbpIdentity 模块之后,避免被覆盖 typeof(AbpLocalizationCultureMapModule), + typeof(AbpAspNetCoreMvcWrapperModule), typeof(AbpAspNetCoreHttpOverridesModule), typeof(AbpCAPEventBusModule), typeof(AbpAliyunSmsModule) @@ -137,7 +141,7 @@ public override void OnApplicationInitialization(ApplicationInitializationContex } else { - app.UseErrorPage(); + // app.UseErrorPage(); app.UseHsts(); } // app.UseHttpsRedirection(); @@ -146,10 +150,10 @@ public override void OnApplicationInitialization(ApplicationInitializationContex app.UseStaticFiles(); app.UseRouting(); app.UseCors(DefaultCorsPolicyName); - app.UseWeChatSignature(); app.UseAuthentication(); - app.UseDynamicClaims(); app.UseAbpOpenIddictValidation(); + app.UseAbpSession(); + app.UseDynamicClaims(); app.UseMultiTenancy(); app.UseAuthorization(); app.UseAuditing(); diff --git a/aspnet-core/services/LY.MicroService.AuthServer/Authentication/AbpCookieAuthenticationHandler.cs b/aspnet-core/services/LY.MicroService.AuthServer/Authentication/AbpCookieAuthenticationHandler.cs new file mode 100644 index 000000000..57b7ffbb8 --- /dev/null +++ b/aspnet-core/services/LY.MicroService.AuthServer/Authentication/AbpCookieAuthenticationHandler.cs @@ -0,0 +1,89 @@ +using Microsoft.AspNetCore.Authentication; +using Microsoft.AspNetCore.Authentication.Cookies; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; +using System.Text.Encodings.Web; +using System.Threading.Tasks; +using Volo.Abp.Http; + +namespace LY.MicroService.AuthServer.Authentication; + +public class AbpCookieAuthenticationHandler : CookieAuthenticationHandler +{ + public AbpCookieAuthenticationHandler( + IOptionsMonitor options, + ILoggerFactory logger, + UrlEncoder encoder) : base(options, logger, encoder) + { + } + + public AbpCookieAuthenticationHandler( + IOptionsMonitor options, + ILoggerFactory logger, + UrlEncoder encoder, + ISystemClock clock) : base(options, logger, encoder, clock) + { + } + protected override Task InitializeEventsAsync() + { + var events = new CookieAuthenticationEvents + { + OnRedirectToLogin = ctx => + { + if (ctx.Request.CanAccept(MimeTypes.Application.Json)) + { + ctx.Response.Headers.Location = ctx.RedirectUri; + ctx.Response.StatusCode = 401; + } + else + { + ctx.Response.Redirect(ctx.RedirectUri); + } + return Task.CompletedTask; + }, + OnRedirectToAccessDenied = ctx => + { + if (ctx.Request.CanAccept(MimeTypes.Application.Json)) + { + ctx.Response.Headers.Location = ctx.RedirectUri; + ctx.Response.StatusCode = 403; + } + else + { + ctx.Response.Redirect(ctx.RedirectUri); + } + return Task.CompletedTask; + }, + OnRedirectToLogout = ctx => + { + if (ctx.Request.CanAccept(MimeTypes.Application.Json)) + { + ctx.Response.Headers.Location = ctx.RedirectUri; + } + else + { + ctx.Response.Redirect(ctx.RedirectUri); + } + return Task.CompletedTask; + }, + OnRedirectToReturnUrl = ctx => + { + if (ctx.Request.CanAccept(MimeTypes.Application.Json)) + { + ctx.Response.Headers.Location = ctx.RedirectUri; + } + else + { + ctx.Response.Redirect(ctx.RedirectUri); + } + return Task.CompletedTask; + } + }; + + Events = events; + + return Task.CompletedTask; + } +} + diff --git a/aspnet-core/services/LY.MicroService.AuthServer/LY.MicroService.AuthServer.csproj b/aspnet-core/services/LY.MicroService.AuthServer/LY.MicroService.AuthServer.csproj index 81859c18a..8e958ed6e 100644 --- a/aspnet-core/services/LY.MicroService.AuthServer/LY.MicroService.AuthServer.csproj +++ b/aspnet-core/services/LY.MicroService.AuthServer/LY.MicroService.AuthServer.csproj @@ -18,6 +18,8 @@ + + @@ -66,14 +68,20 @@ + + + + + + diff --git a/aspnet-core/services/LY.MicroService.AuthServer/Pages/Account/TwoFactorSupportedLoginModel.cs b/aspnet-core/services/LY.MicroService.AuthServer/Pages/Account/TwoFactorSupportedLoginModel.cs index b85ef4a8a..3d5a2f9e0 100644 --- a/aspnet-core/services/LY.MicroService.AuthServer/Pages/Account/TwoFactorSupportedLoginModel.cs +++ b/aspnet-core/services/LY.MicroService.AuthServer/Pages/Account/TwoFactorSupportedLoginModel.cs @@ -1,35 +1,40 @@ -using Microsoft.AspNetCore.Authentication; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Options; +using Microsoft.AspNetCore.Authentication; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Options; +using OpenIddict.Server.AspNetCore; +using OpenIddict.Server; using System.Collections.Generic; -using System.Threading.Tasks; -using Volo.Abp.Account.Web; -using Volo.Abp.Account.Web.Pages.Account; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Identity; +using System.Threading.Tasks; +using Volo.Abp.Account.Web; +using Volo.Abp.Account.Web.Pages.Account; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Identity; using Volo.Abp.OpenIddict; -using IdentityOptions = Microsoft.AspNetCore.Identity.IdentityOptions; - -namespace LY.MicroService.AuthServer.Pages.Account -{ - /// - /// 重写登录模型,实现双因素登录 - /// - [Dependency(ReplaceServices = true)] - [ExposeServices(typeof(LoginModel), typeof(OpenIddictSupportedLoginModel))] - public class TwoFactorSupportedLoginModel : OpenIddictSupportedLoginModel - { - public TwoFactorSupportedLoginModel( - IAuthenticationSchemeProvider schemeProvider, - IOptions accountOptions, - IOptions identityOptions, - IdentityDynamicClaimsPrincipalContributorCache identityDynamicClaimsPrincipalContributorCache, - AbpOpenIddictRequestHelper openIddictRequestHelper) - : base(schemeProvider, accountOptions, identityOptions, identityDynamicClaimsPrincipalContributorCache, openIddictRequestHelper) - { - - } - +using IdentityOptions = Microsoft.AspNetCore.Identity.IdentityOptions; +using System.Diagnostics; +using Volo.Abp.Account.Settings; +using Volo.Abp.Settings; +using LINGYUN.Abp.Identity.Session; + +namespace LY.MicroService.AuthServer.Pages.Account +{ + /// + /// 重写登录模型,实现双因素登录 + /// + [Dependency(ReplaceServices = true)] + [ExposeServices(typeof(LoginModel), typeof(OpenIddictSupportedLoginModel))] + public class TwoFactorSupportedLoginModel : OpenIddictSupportedLoginModel + { + public TwoFactorSupportedLoginModel( + IAuthenticationSchemeProvider schemeProvider, + IOptions accountOptions, + IOptions identityOptions, + IdentityDynamicClaimsPrincipalContributorCache identityDynamicClaimsPrincipalContributorCache, + AbpOpenIddictRequestHelper openIddictRequestHelper) + : base(schemeProvider, accountOptions, identityOptions, identityDynamicClaimsPrincipalContributorCache, openIddictRequestHelper) + { + } + protected async override Task> GetExternalProviders() { var providers = await base.GetExternalProviders(); @@ -49,17 +54,17 @@ protected async override Task> GetExternalProviders( } return providers; - } - - protected override Task TwoFactorLoginResultAsync() - { - // 重定向双因素认证页面 - return Task.FromResult(RedirectToPage("SendCode", new - { - returnUrl = ReturnUrl, - returnUrlHash = ReturnUrlHash, - rememberMe = LoginInput.RememberMe - })); - } - } -} + } + + protected override Task TwoFactorLoginResultAsync() + { + // 重定向双因素认证页面 + return Task.FromResult(RedirectToPage("SendCode", new + { + returnUrl = ReturnUrl, + returnUrlHash = ReturnUrlHash, + rememberMe = LoginInput.RememberMe + })); + } + } +} diff --git a/aspnet-core/services/LY.MicroService.AuthServer/Pages/Account/VerifyCode.cshtml.cs b/aspnet-core/services/LY.MicroService.AuthServer/Pages/Account/VerifyCode.cshtml.cs index f920f3ebf..0d4881dbc 100644 --- a/aspnet-core/services/LY.MicroService.AuthServer/Pages/Account/VerifyCode.cshtml.cs +++ b/aspnet-core/services/LY.MicroService.AuthServer/Pages/Account/VerifyCode.cshtml.cs @@ -1,14 +1,18 @@ +using LINGYUN.Abp.Identity.Session; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using System.ComponentModel.DataAnnotations; using System.Threading.Tasks; using Volo.Abp.Account.Localization; using Volo.Abp.Account.Web.Pages.Account; +using Volo.Abp.Identity; namespace LY.MicroService.AuthServer.Pages.Account { public class VerifyCodeModel : AccountPageModel { + protected IdentityDynamicClaimsPrincipalContributorCache IdentityDynamicClaimsPrincipalContributorCache { get; } + [BindProperty] public VerifyCodeInputModel Input { get; set; } /// @@ -36,8 +40,11 @@ public class VerifyCodeModel : AccountPageModel [BindProperty(SupportsGet = true)] public bool RememberMe { get; set; } - public VerifyCodeModel() + public VerifyCodeModel( + IdentityDynamicClaimsPrincipalContributorCache identityDynamicClaimsPrincipalContributorCache) { + IdentityDynamicClaimsPrincipalContributorCache = identityDynamicClaimsPrincipalContributorCache; + LocalizationResourceType = typeof(AccountResource); } @@ -61,6 +68,9 @@ public virtual async Task OnPostAsync() var result = await SignInManager.TwoFactorSignInAsync(Provider, Input.VerifyCode, RememberMe, Input.RememberBrowser); if (result.Succeeded) { + // Clear the dynamic claims cache. + await IdentityDynamicClaimsPrincipalContributorCache.ClearAsync(user.Id, user.TenantId); + return await RedirectSafelyAsync(ReturnUrl, ReturnUrlHash); } if (result.IsLockedOut) diff --git a/aspnet-core/services/LY.MicroService.AuthServer/gulpfile.js b/aspnet-core/services/LY.MicroService.AuthServer/gulpfile.js index 5dcf4c5c6..bec4d578f 100644 --- a/aspnet-core/services/LY.MicroService.AuthServer/gulpfile.js +++ b/aspnet-core/services/LY.MicroService.AuthServer/gulpfile.js @@ -4,6 +4,7 @@ var gulp = require("gulp"), path = require('path'), copyResources = require('./node_modules/@abp/aspnetcore.mvc.ui/gulp/copy-resources.js'); -exports.default = function(){ - return copyResources(path.resolve('./')); +exports.default = function(done){ + copyResources(path.resolve('./')); + done(); }; \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/package.json b/aspnet-core/services/LY.MicroService.AuthServer/package.json index dcfb9b6c8..08594b23a 100644 --- a/aspnet-core/services/LY.MicroService.AuthServer/package.json +++ b/aspnet-core/services/LY.MicroService.AuthServer/package.json @@ -1,8 +1,8 @@ { - "version": "8.1.0", - "name": "my-app-auth-server", + "version": "8.2.0", + "name": "my-app-authserver", "private": true, "dependencies": { - "@abp/aspnetcore.mvc.ui.theme.leptonxlite": "3.1.0" + "@abp/aspnetcore.mvc.ui.theme.leptonxlite": "3.2.0" } } \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/css/all.css b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/css/all.css index 17be51da2..7e4dfe1e8 100644 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/css/all.css +++ b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/css/all.css @@ -1,4586 +1,8030 @@ -/*! - * Font Awesome Free 5.13.1 by @fontawesome - https://fontawesome.com - * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) - */ -.fa, -.fas, -.far, -.fal, -.fad, -.fab { - -moz-osx-font-smoothing: grayscale; - -webkit-font-smoothing: antialiased; - display: inline-block; - font-style: normal; - font-variant: normal; - text-rendering: auto; - line-height: 1; } - -.fa-lg { - font-size: 1.33333em; - line-height: 0.75em; - vertical-align: -.0667em; } - -.fa-xs { - font-size: .75em; } - -.fa-sm { - font-size: .875em; } - -.fa-1x { - font-size: 1em; } - -.fa-2x { - font-size: 2em; } - -.fa-3x { - font-size: 3em; } - -.fa-4x { - font-size: 4em; } - -.fa-5x { - font-size: 5em; } - -.fa-6x { - font-size: 6em; } - -.fa-7x { - font-size: 7em; } - -.fa-8x { - font-size: 8em; } - -.fa-9x { - font-size: 9em; } - -.fa-10x { - font-size: 10em; } - -.fa-fw { - text-align: center; - width: 1.25em; } - -.fa-ul { - list-style-type: none; - margin-left: 2.5em; - padding-left: 0; } - .fa-ul > li { - position: relative; } - -.fa-li { - left: -2em; - position: absolute; - text-align: center; - width: 2em; - line-height: inherit; } - -.fa-border { - border: solid 0.08em #eee; - border-radius: .1em; - padding: .2em .25em .15em; } - -.fa-pull-left { - float: left; } - -.fa-pull-right { - float: right; } - -.fa.fa-pull-left, -.fas.fa-pull-left, -.far.fa-pull-left, -.fal.fa-pull-left, -.fab.fa-pull-left { - margin-right: .3em; } - -.fa.fa-pull-right, -.fas.fa-pull-right, -.far.fa-pull-right, -.fal.fa-pull-right, -.fab.fa-pull-right { - margin-left: .3em; } - -.fa-spin { - -webkit-animation: fa-spin 2s infinite linear; - animation: fa-spin 2s infinite linear; } - -.fa-pulse { - -webkit-animation: fa-spin 1s infinite steps(8); - animation: fa-spin 1s infinite steps(8); } - -@-webkit-keyframes fa-spin { - 0% { - -webkit-transform: rotate(0deg); - transform: rotate(0deg); } - 100% { - -webkit-transform: rotate(360deg); - transform: rotate(360deg); } } - -@keyframes fa-spin { - 0% { - -webkit-transform: rotate(0deg); - transform: rotate(0deg); } - 100% { - -webkit-transform: rotate(360deg); - transform: rotate(360deg); } } - -.fa-rotate-90 { - -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)"; - -webkit-transform: rotate(90deg); - transform: rotate(90deg); } - -.fa-rotate-180 { - -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)"; - -webkit-transform: rotate(180deg); - transform: rotate(180deg); } - -.fa-rotate-270 { - -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)"; - -webkit-transform: rotate(270deg); - transform: rotate(270deg); } - -.fa-flip-horizontal { - -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)"; - -webkit-transform: scale(-1, 1); - transform: scale(-1, 1); } - -.fa-flip-vertical { - -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"; - -webkit-transform: scale(1, -1); - transform: scale(1, -1); } - -.fa-flip-both, .fa-flip-horizontal.fa-flip-vertical { - -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"; - -webkit-transform: scale(-1, -1); - transform: scale(-1, -1); } - -:root .fa-rotate-90, -:root .fa-rotate-180, -:root .fa-rotate-270, -:root .fa-flip-horizontal, -:root .fa-flip-vertical, -:root .fa-flip-both { - -webkit-filter: none; - filter: none; } - -.fa-stack { - display: inline-block; - height: 2em; - line-height: 2em; - position: relative; - vertical-align: middle; - width: 2.5em; } - -.fa-stack-1x, -.fa-stack-2x { - left: 0; - position: absolute; - text-align: center; - width: 100%; } - -.fa-stack-1x { - line-height: inherit; } - -.fa-stack-2x { - font-size: 2em; } - -.fa-inverse { - color: #fff; } - -/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen -readers do not read off random characters that represent icons */ -.fa-500px:before { - content: "\f26e"; } - -.fa-accessible-icon:before { - content: "\f368"; } - -.fa-accusoft:before { - content: "\f369"; } - -.fa-acquisitions-incorporated:before { - content: "\f6af"; } - -.fa-ad:before { - content: "\f641"; } - -.fa-address-book:before { - content: "\f2b9"; } - -.fa-address-card:before { - content: "\f2bb"; } - -.fa-adjust:before { - content: "\f042"; } - -.fa-adn:before { - content: "\f170"; } - -.fa-adobe:before { - content: "\f778"; } - -.fa-adversal:before { - content: "\f36a"; } - -.fa-affiliatetheme:before { - content: "\f36b"; } - -.fa-air-freshener:before { - content: "\f5d0"; } - -.fa-airbnb:before { - content: "\f834"; } - -.fa-algolia:before { - content: "\f36c"; } - -.fa-align-center:before { - content: "\f037"; } - -.fa-align-justify:before { - content: "\f039"; } - -.fa-align-left:before { - content: "\f036"; } - -.fa-align-right:before { - content: "\f038"; } - -.fa-alipay:before { - content: "\f642"; } - -.fa-allergies:before { - content: "\f461"; } - -.fa-amazon:before { - content: "\f270"; } - -.fa-amazon-pay:before { - content: "\f42c"; } - -.fa-ambulance:before { - content: "\f0f9"; } - -.fa-american-sign-language-interpreting:before { - content: "\f2a3"; } - -.fa-amilia:before { - content: "\f36d"; } - -.fa-anchor:before { - content: "\f13d"; } - -.fa-android:before { - content: "\f17b"; } - -.fa-angellist:before { - content: "\f209"; } - -.fa-angle-double-down:before { - content: "\f103"; } - -.fa-angle-double-left:before { - content: "\f100"; } - -.fa-angle-double-right:before { - content: "\f101"; } - -.fa-angle-double-up:before { - content: "\f102"; } - -.fa-angle-down:before { - content: "\f107"; } - -.fa-angle-left:before { - content: "\f104"; } - -.fa-angle-right:before { - content: "\f105"; } - -.fa-angle-up:before { - content: "\f106"; } - -.fa-angry:before { - content: "\f556"; } - -.fa-angrycreative:before { - content: "\f36e"; } - -.fa-angular:before { - content: "\f420"; } - -.fa-ankh:before { - content: "\f644"; } - -.fa-app-store:before { - content: "\f36f"; } - -.fa-app-store-ios:before { - content: "\f370"; } - -.fa-apper:before { - content: "\f371"; } - -.fa-apple:before { - content: "\f179"; } - -.fa-apple-alt:before { - content: "\f5d1"; } - -.fa-apple-pay:before { - content: "\f415"; } - -.fa-archive:before { - content: "\f187"; } - -.fa-archway:before { - content: "\f557"; } - -.fa-arrow-alt-circle-down:before { - content: "\f358"; } - -.fa-arrow-alt-circle-left:before { - content: "\f359"; } - -.fa-arrow-alt-circle-right:before { - content: "\f35a"; } - -.fa-arrow-alt-circle-up:before { - content: "\f35b"; } - -.fa-arrow-circle-down:before { - content: "\f0ab"; } - -.fa-arrow-circle-left:before { - content: "\f0a8"; } - -.fa-arrow-circle-right:before { - content: "\f0a9"; } - -.fa-arrow-circle-up:before { - content: "\f0aa"; } - -.fa-arrow-down:before { - content: "\f063"; } - -.fa-arrow-left:before { - content: "\f060"; } - -.fa-arrow-right:before { - content: "\f061"; } - -.fa-arrow-up:before { - content: "\f062"; } - -.fa-arrows-alt:before { - content: "\f0b2"; } - -.fa-arrows-alt-h:before { - content: "\f337"; } - -.fa-arrows-alt-v:before { - content: "\f338"; } - -.fa-artstation:before { - content: "\f77a"; } - -.fa-assistive-listening-systems:before { - content: "\f2a2"; } - -.fa-asterisk:before { - content: "\f069"; } - -.fa-asymmetrik:before { - content: "\f372"; } - -.fa-at:before { - content: "\f1fa"; } - -.fa-atlas:before { - content: "\f558"; } - -.fa-atlassian:before { - content: "\f77b"; } - -.fa-atom:before { - content: "\f5d2"; } - -.fa-audible:before { - content: "\f373"; } - -.fa-audio-description:before { - content: "\f29e"; } - -.fa-autoprefixer:before { - content: "\f41c"; } - -.fa-avianex:before { - content: "\f374"; } - -.fa-aviato:before { - content: "\f421"; } - -.fa-award:before { - content: "\f559"; } - -.fa-aws:before { - content: "\f375"; } - -.fa-baby:before { - content: "\f77c"; } - -.fa-baby-carriage:before { - content: "\f77d"; } - -.fa-backspace:before { - content: "\f55a"; } - -.fa-backward:before { - content: "\f04a"; } - -.fa-bacon:before { - content: "\f7e5"; } - -.fa-bacteria:before { - content: "\f959"; } - -.fa-bacterium:before { - content: "\f95a"; } - -.fa-bahai:before { - content: "\f666"; } - -.fa-balance-scale:before { - content: "\f24e"; } - -.fa-balance-scale-left:before { - content: "\f515"; } - -.fa-balance-scale-right:before { - content: "\f516"; } - -.fa-ban:before { - content: "\f05e"; } - -.fa-band-aid:before { - content: "\f462"; } - -.fa-bandcamp:before { - content: "\f2d5"; } - -.fa-barcode:before { - content: "\f02a"; } - -.fa-bars:before { - content: "\f0c9"; } - -.fa-baseball-ball:before { - content: "\f433"; } - -.fa-basketball-ball:before { - content: "\f434"; } - -.fa-bath:before { - content: "\f2cd"; } - -.fa-battery-empty:before { - content: "\f244"; } - -.fa-battery-full:before { - content: "\f240"; } - -.fa-battery-half:before { - content: "\f242"; } - -.fa-battery-quarter:before { - content: "\f243"; } - -.fa-battery-three-quarters:before { - content: "\f241"; } - -.fa-battle-net:before { - content: "\f835"; } - -.fa-bed:before { - content: "\f236"; } - -.fa-beer:before { - content: "\f0fc"; } - -.fa-behance:before { - content: "\f1b4"; } - -.fa-behance-square:before { - content: "\f1b5"; } - -.fa-bell:before { - content: "\f0f3"; } - -.fa-bell-slash:before { - content: "\f1f6"; } - -.fa-bezier-curve:before { - content: "\f55b"; } - -.fa-bible:before { - content: "\f647"; } - -.fa-bicycle:before { - content: "\f206"; } - -.fa-biking:before { - content: "\f84a"; } - -.fa-bimobject:before { - content: "\f378"; } - -.fa-binoculars:before { - content: "\f1e5"; } - -.fa-biohazard:before { - content: "\f780"; } - -.fa-birthday-cake:before { - content: "\f1fd"; } - -.fa-bitbucket:before { - content: "\f171"; } - -.fa-bitcoin:before { - content: "\f379"; } - -.fa-bity:before { - content: "\f37a"; } - -.fa-black-tie:before { - content: "\f27e"; } - -.fa-blackberry:before { - content: "\f37b"; } - -.fa-blender:before { - content: "\f517"; } - -.fa-blender-phone:before { - content: "\f6b6"; } - -.fa-blind:before { - content: "\f29d"; } - -.fa-blog:before { - content: "\f781"; } - -.fa-blogger:before { - content: "\f37c"; } - -.fa-blogger-b:before { - content: "\f37d"; } - -.fa-bluetooth:before { - content: "\f293"; } - -.fa-bluetooth-b:before { - content: "\f294"; } - -.fa-bold:before { - content: "\f032"; } - -.fa-bolt:before { - content: "\f0e7"; } - -.fa-bomb:before { - content: "\f1e2"; } - -.fa-bone:before { - content: "\f5d7"; } - -.fa-bong:before { - content: "\f55c"; } - -.fa-book:before { - content: "\f02d"; } - -.fa-book-dead:before { - content: "\f6b7"; } - -.fa-book-medical:before { - content: "\f7e6"; } - -.fa-book-open:before { - content: "\f518"; } - -.fa-book-reader:before { - content: "\f5da"; } - -.fa-bookmark:before { - content: "\f02e"; } - -.fa-bootstrap:before { - content: "\f836"; } - -.fa-border-all:before { - content: "\f84c"; } - -.fa-border-none:before { - content: "\f850"; } - -.fa-border-style:before { - content: "\f853"; } - -.fa-bowling-ball:before { - content: "\f436"; } - -.fa-box:before { - content: "\f466"; } - -.fa-box-open:before { - content: "\f49e"; } - -.fa-box-tissue:before { - content: "\f95b"; } - -.fa-boxes:before { - content: "\f468"; } - -.fa-braille:before { - content: "\f2a1"; } - -.fa-brain:before { - content: "\f5dc"; } - -.fa-bread-slice:before { - content: "\f7ec"; } - -.fa-briefcase:before { - content: "\f0b1"; } - -.fa-briefcase-medical:before { - content: "\f469"; } - -.fa-broadcast-tower:before { - content: "\f519"; } - -.fa-broom:before { - content: "\f51a"; } - -.fa-brush:before { - content: "\f55d"; } - -.fa-btc:before { - content: "\f15a"; } - -.fa-buffer:before { - content: "\f837"; } - -.fa-bug:before { - content: "\f188"; } - -.fa-building:before { - content: "\f1ad"; } - -.fa-bullhorn:before { - content: "\f0a1"; } - -.fa-bullseye:before { - content: "\f140"; } - -.fa-burn:before { - content: "\f46a"; } - -.fa-buromobelexperte:before { - content: "\f37f"; } - -.fa-bus:before { - content: "\f207"; } - -.fa-bus-alt:before { - content: "\f55e"; } - -.fa-business-time:before { - content: "\f64a"; } - -.fa-buy-n-large:before { - content: "\f8a6"; } - -.fa-buysellads:before { - content: "\f20d"; } - -.fa-calculator:before { - content: "\f1ec"; } - -.fa-calendar:before { - content: "\f133"; } - -.fa-calendar-alt:before { - content: "\f073"; } - -.fa-calendar-check:before { - content: "\f274"; } - -.fa-calendar-day:before { - content: "\f783"; } - -.fa-calendar-minus:before { - content: "\f272"; } - -.fa-calendar-plus:before { - content: "\f271"; } - -.fa-calendar-times:before { - content: "\f273"; } - -.fa-calendar-week:before { - content: "\f784"; } - -.fa-camera:before { - content: "\f030"; } - -.fa-camera-retro:before { - content: "\f083"; } - -.fa-campground:before { - content: "\f6bb"; } - -.fa-canadian-maple-leaf:before { - content: "\f785"; } - -.fa-candy-cane:before { - content: "\f786"; } - -.fa-cannabis:before { - content: "\f55f"; } - -.fa-capsules:before { - content: "\f46b"; } - -.fa-car:before { - content: "\f1b9"; } - -.fa-car-alt:before { - content: "\f5de"; } - -.fa-car-battery:before { - content: "\f5df"; } - -.fa-car-crash:before { - content: "\f5e1"; } - -.fa-car-side:before { - content: "\f5e4"; } - -.fa-caravan:before { - content: "\f8ff"; } - -.fa-caret-down:before { - content: "\f0d7"; } - -.fa-caret-left:before { - content: "\f0d9"; } - -.fa-caret-right:before { - content: "\f0da"; } - -.fa-caret-square-down:before { - content: "\f150"; } - -.fa-caret-square-left:before { - content: "\f191"; } - -.fa-caret-square-right:before { - content: "\f152"; } - -.fa-caret-square-up:before { - content: "\f151"; } - -.fa-caret-up:before { - content: "\f0d8"; } - -.fa-carrot:before { - content: "\f787"; } - -.fa-cart-arrow-down:before { - content: "\f218"; } - -.fa-cart-plus:before { - content: "\f217"; } - -.fa-cash-register:before { - content: "\f788"; } - -.fa-cat:before { - content: "\f6be"; } - -.fa-cc-amazon-pay:before { - content: "\f42d"; } - -.fa-cc-amex:before { - content: "\f1f3"; } - -.fa-cc-apple-pay:before { - content: "\f416"; } - -.fa-cc-diners-club:before { - content: "\f24c"; } - -.fa-cc-discover:before { - content: "\f1f2"; } - -.fa-cc-jcb:before { - content: "\f24b"; } - -.fa-cc-mastercard:before { - content: "\f1f1"; } - -.fa-cc-paypal:before { - content: "\f1f4"; } - -.fa-cc-stripe:before { - content: "\f1f5"; } - -.fa-cc-visa:before { - content: "\f1f0"; } - -.fa-centercode:before { - content: "\f380"; } - -.fa-centos:before { - content: "\f789"; } - -.fa-certificate:before { - content: "\f0a3"; } - -.fa-chair:before { - content: "\f6c0"; } - -.fa-chalkboard:before { - content: "\f51b"; } - -.fa-chalkboard-teacher:before { - content: "\f51c"; } - -.fa-charging-station:before { - content: "\f5e7"; } - -.fa-chart-area:before { - content: "\f1fe"; } - -.fa-chart-bar:before { - content: "\f080"; } - -.fa-chart-line:before { - content: "\f201"; } - -.fa-chart-pie:before { - content: "\f200"; } - -.fa-check:before { - content: "\f00c"; } - -.fa-check-circle:before { - content: "\f058"; } - -.fa-check-double:before { - content: "\f560"; } - -.fa-check-square:before { - content: "\f14a"; } - -.fa-cheese:before { - content: "\f7ef"; } - -.fa-chess:before { - content: "\f439"; } - -.fa-chess-bishop:before { - content: "\f43a"; } - -.fa-chess-board:before { - content: "\f43c"; } - -.fa-chess-king:before { - content: "\f43f"; } - -.fa-chess-knight:before { - content: "\f441"; } - -.fa-chess-pawn:before { - content: "\f443"; } - -.fa-chess-queen:before { - content: "\f445"; } - -.fa-chess-rook:before { - content: "\f447"; } - -.fa-chevron-circle-down:before { - content: "\f13a"; } - -.fa-chevron-circle-left:before { - content: "\f137"; } - -.fa-chevron-circle-right:before { - content: "\f138"; } - -.fa-chevron-circle-up:before { - content: "\f139"; } - -.fa-chevron-down:before { - content: "\f078"; } - -.fa-chevron-left:before { - content: "\f053"; } - -.fa-chevron-right:before { - content: "\f054"; } - -.fa-chevron-up:before { - content: "\f077"; } - -.fa-child:before { - content: "\f1ae"; } - -.fa-chrome:before { - content: "\f268"; } - -.fa-chromecast:before { - content: "\f838"; } - -.fa-church:before { - content: "\f51d"; } - -.fa-circle:before { - content: "\f111"; } - -.fa-circle-notch:before { - content: "\f1ce"; } - -.fa-city:before { - content: "\f64f"; } - -.fa-clinic-medical:before { - content: "\f7f2"; } - -.fa-clipboard:before { - content: "\f328"; } - -.fa-clipboard-check:before { - content: "\f46c"; } - -.fa-clipboard-list:before { - content: "\f46d"; } - -.fa-clock:before { - content: "\f017"; } - -.fa-clone:before { - content: "\f24d"; } - -.fa-closed-captioning:before { - content: "\f20a"; } - -.fa-cloud:before { - content: "\f0c2"; } - -.fa-cloud-download-alt:before { - content: "\f381"; } - -.fa-cloud-meatball:before { - content: "\f73b"; } - -.fa-cloud-moon:before { - content: "\f6c3"; } - -.fa-cloud-moon-rain:before { - content: "\f73c"; } - -.fa-cloud-rain:before { - content: "\f73d"; } - -.fa-cloud-showers-heavy:before { - content: "\f740"; } - -.fa-cloud-sun:before { - content: "\f6c4"; } - -.fa-cloud-sun-rain:before { - content: "\f743"; } - -.fa-cloud-upload-alt:before { - content: "\f382"; } - -.fa-cloudscale:before { - content: "\f383"; } - -.fa-cloudsmith:before { - content: "\f384"; } - -.fa-cloudversify:before { - content: "\f385"; } - -.fa-cocktail:before { - content: "\f561"; } - -.fa-code:before { - content: "\f121"; } - -.fa-code-branch:before { - content: "\f126"; } - -.fa-codepen:before { - content: "\f1cb"; } - -.fa-codiepie:before { - content: "\f284"; } - -.fa-coffee:before { - content: "\f0f4"; } - -.fa-cog:before { - content: "\f013"; } - -.fa-cogs:before { - content: "\f085"; } - -.fa-coins:before { - content: "\f51e"; } - -.fa-columns:before { - content: "\f0db"; } - -.fa-comment:before { - content: "\f075"; } - -.fa-comment-alt:before { - content: "\f27a"; } - -.fa-comment-dollar:before { - content: "\f651"; } - -.fa-comment-dots:before { - content: "\f4ad"; } - -.fa-comment-medical:before { - content: "\f7f5"; } - -.fa-comment-slash:before { - content: "\f4b3"; } - -.fa-comments:before { - content: "\f086"; } - -.fa-comments-dollar:before { - content: "\f653"; } - -.fa-compact-disc:before { - content: "\f51f"; } - -.fa-compass:before { - content: "\f14e"; } - -.fa-compress:before { - content: "\f066"; } - -.fa-compress-alt:before { - content: "\f422"; } - -.fa-compress-arrows-alt:before { - content: "\f78c"; } - -.fa-concierge-bell:before { - content: "\f562"; } - -.fa-confluence:before { - content: "\f78d"; } - -.fa-connectdevelop:before { - content: "\f20e"; } - -.fa-contao:before { - content: "\f26d"; } - -.fa-cookie:before { - content: "\f563"; } - -.fa-cookie-bite:before { - content: "\f564"; } - -.fa-copy:before { - content: "\f0c5"; } - -.fa-copyright:before { - content: "\f1f9"; } - -.fa-cotton-bureau:before { - content: "\f89e"; } - -.fa-couch:before { - content: "\f4b8"; } - -.fa-cpanel:before { - content: "\f388"; } - -.fa-creative-commons:before { - content: "\f25e"; } - -.fa-creative-commons-by:before { - content: "\f4e7"; } - -.fa-creative-commons-nc:before { - content: "\f4e8"; } - -.fa-creative-commons-nc-eu:before { - content: "\f4e9"; } - -.fa-creative-commons-nc-jp:before { - content: "\f4ea"; } - -.fa-creative-commons-nd:before { - content: "\f4eb"; } - -.fa-creative-commons-pd:before { - content: "\f4ec"; } - -.fa-creative-commons-pd-alt:before { - content: "\f4ed"; } - -.fa-creative-commons-remix:before { - content: "\f4ee"; } - -.fa-creative-commons-sa:before { - content: "\f4ef"; } - -.fa-creative-commons-sampling:before { - content: "\f4f0"; } - -.fa-creative-commons-sampling-plus:before { - content: "\f4f1"; } - -.fa-creative-commons-share:before { - content: "\f4f2"; } - -.fa-creative-commons-zero:before { - content: "\f4f3"; } - -.fa-credit-card:before { - content: "\f09d"; } - -.fa-critical-role:before { - content: "\f6c9"; } - -.fa-crop:before { - content: "\f125"; } - -.fa-crop-alt:before { - content: "\f565"; } - -.fa-cross:before { - content: "\f654"; } - -.fa-crosshairs:before { - content: "\f05b"; } - -.fa-crow:before { - content: "\f520"; } - -.fa-crown:before { - content: "\f521"; } - -.fa-crutch:before { - content: "\f7f7"; } - -.fa-css3:before { - content: "\f13c"; } - -.fa-css3-alt:before { - content: "\f38b"; } - -.fa-cube:before { - content: "\f1b2"; } - -.fa-cubes:before { - content: "\f1b3"; } - -.fa-cut:before { - content: "\f0c4"; } - -.fa-cuttlefish:before { - content: "\f38c"; } - -.fa-d-and-d:before { - content: "\f38d"; } - -.fa-d-and-d-beyond:before { - content: "\f6ca"; } - -.fa-dailymotion:before { - content: "\f952"; } - -.fa-dashcube:before { - content: "\f210"; } - -.fa-database:before { - content: "\f1c0"; } - -.fa-deaf:before { - content: "\f2a4"; } - -.fa-deezer:before { - content: "\f977"; } - -.fa-delicious:before { - content: "\f1a5"; } - -.fa-democrat:before { - content: "\f747"; } - -.fa-deploydog:before { - content: "\f38e"; } - -.fa-deskpro:before { - content: "\f38f"; } - -.fa-desktop:before { - content: "\f108"; } - -.fa-dev:before { - content: "\f6cc"; } - -.fa-deviantart:before { - content: "\f1bd"; } - -.fa-dharmachakra:before { - content: "\f655"; } - -.fa-dhl:before { - content: "\f790"; } - -.fa-diagnoses:before { - content: "\f470"; } - -.fa-diaspora:before { - content: "\f791"; } - -.fa-dice:before { - content: "\f522"; } - -.fa-dice-d20:before { - content: "\f6cf"; } - -.fa-dice-d6:before { - content: "\f6d1"; } - -.fa-dice-five:before { - content: "\f523"; } - -.fa-dice-four:before { - content: "\f524"; } - -.fa-dice-one:before { - content: "\f525"; } - -.fa-dice-six:before { - content: "\f526"; } - -.fa-dice-three:before { - content: "\f527"; } - -.fa-dice-two:before { - content: "\f528"; } - -.fa-digg:before { - content: "\f1a6"; } - -.fa-digital-ocean:before { - content: "\f391"; } - -.fa-digital-tachograph:before { - content: "\f566"; } - -.fa-directions:before { - content: "\f5eb"; } - -.fa-discord:before { - content: "\f392"; } - -.fa-discourse:before { - content: "\f393"; } - -.fa-disease:before { - content: "\f7fa"; } - -.fa-divide:before { - content: "\f529"; } - -.fa-dizzy:before { - content: "\f567"; } - -.fa-dna:before { - content: "\f471"; } - -.fa-dochub:before { - content: "\f394"; } - -.fa-docker:before { - content: "\f395"; } - -.fa-dog:before { - content: "\f6d3"; } - -.fa-dollar-sign:before { - content: "\f155"; } - -.fa-dolly:before { - content: "\f472"; } - -.fa-dolly-flatbed:before { - content: "\f474"; } - -.fa-donate:before { - content: "\f4b9"; } - -.fa-door-closed:before { - content: "\f52a"; } - -.fa-door-open:before { - content: "\f52b"; } - -.fa-dot-circle:before { - content: "\f192"; } - -.fa-dove:before { - content: "\f4ba"; } - -.fa-download:before { - content: "\f019"; } - -.fa-draft2digital:before { - content: "\f396"; } - -.fa-drafting-compass:before { - content: "\f568"; } - -.fa-dragon:before { - content: "\f6d5"; } - -.fa-draw-polygon:before { - content: "\f5ee"; } - -.fa-dribbble:before { - content: "\f17d"; } - -.fa-dribbble-square:before { - content: "\f397"; } - -.fa-dropbox:before { - content: "\f16b"; } - -.fa-drum:before { - content: "\f569"; } - -.fa-drum-steelpan:before { - content: "\f56a"; } - -.fa-drumstick-bite:before { - content: "\f6d7"; } - -.fa-drupal:before { - content: "\f1a9"; } - -.fa-dumbbell:before { - content: "\f44b"; } - -.fa-dumpster:before { - content: "\f793"; } - -.fa-dumpster-fire:before { - content: "\f794"; } - -.fa-dungeon:before { - content: "\f6d9"; } - -.fa-dyalog:before { - content: "\f399"; } - -.fa-earlybirds:before { - content: "\f39a"; } - -.fa-ebay:before { - content: "\f4f4"; } - -.fa-edge:before { - content: "\f282"; } - -.fa-edge-legacy:before { - content: "\f978"; } - -.fa-edit:before { - content: "\f044"; } - -.fa-egg:before { - content: "\f7fb"; } - -.fa-eject:before { - content: "\f052"; } - -.fa-elementor:before { - content: "\f430"; } - -.fa-ellipsis-h:before { - content: "\f141"; } - -.fa-ellipsis-v:before { - content: "\f142"; } - -.fa-ello:before { - content: "\f5f1"; } - -.fa-ember:before { - content: "\f423"; } - -.fa-empire:before { - content: "\f1d1"; } - -.fa-envelope:before { - content: "\f0e0"; } - -.fa-envelope-open:before { - content: "\f2b6"; } - -.fa-envelope-open-text:before { - content: "\f658"; } - -.fa-envelope-square:before { - content: "\f199"; } - -.fa-envira:before { - content: "\f299"; } - -.fa-equals:before { - content: "\f52c"; } - -.fa-eraser:before { - content: "\f12d"; } - -.fa-erlang:before { - content: "\f39d"; } - -.fa-ethereum:before { - content: "\f42e"; } - -.fa-ethernet:before { - content: "\f796"; } - -.fa-etsy:before { - content: "\f2d7"; } - -.fa-euro-sign:before { - content: "\f153"; } - -.fa-evernote:before { - content: "\f839"; } - -.fa-exchange-alt:before { - content: "\f362"; } - -.fa-exclamation:before { - content: "\f12a"; } - -.fa-exclamation-circle:before { - content: "\f06a"; } - -.fa-exclamation-triangle:before { - content: "\f071"; } - -.fa-expand:before { - content: "\f065"; } - -.fa-expand-alt:before { - content: "\f424"; } - -.fa-expand-arrows-alt:before { - content: "\f31e"; } - -.fa-expeditedssl:before { - content: "\f23e"; } - -.fa-external-link-alt:before { - content: "\f35d"; } - -.fa-external-link-square-alt:before { - content: "\f360"; } - -.fa-eye:before { - content: "\f06e"; } - -.fa-eye-dropper:before { - content: "\f1fb"; } - -.fa-eye-slash:before { - content: "\f070"; } - -.fa-facebook:before { - content: "\f09a"; } - -.fa-facebook-f:before { - content: "\f39e"; } - -.fa-facebook-messenger:before { - content: "\f39f"; } - -.fa-facebook-square:before { - content: "\f082"; } - -.fa-fan:before { - content: "\f863"; } - -.fa-fantasy-flight-games:before { - content: "\f6dc"; } - -.fa-fast-backward:before { - content: "\f049"; } - -.fa-fast-forward:before { - content: "\f050"; } - -.fa-faucet:before { - content: "\f905"; } - -.fa-fax:before { - content: "\f1ac"; } - -.fa-feather:before { - content: "\f52d"; } - -.fa-feather-alt:before { - content: "\f56b"; } - -.fa-fedex:before { - content: "\f797"; } - -.fa-fedora:before { - content: "\f798"; } - -.fa-female:before { - content: "\f182"; } - -.fa-fighter-jet:before { - content: "\f0fb"; } - -.fa-figma:before { - content: "\f799"; } - -.fa-file:before { - content: "\f15b"; } - -.fa-file-alt:before { - content: "\f15c"; } - -.fa-file-archive:before { - content: "\f1c6"; } - -.fa-file-audio:before { - content: "\f1c7"; } - -.fa-file-code:before { - content: "\f1c9"; } - -.fa-file-contract:before { - content: "\f56c"; } - -.fa-file-csv:before { - content: "\f6dd"; } - -.fa-file-download:before { - content: "\f56d"; } - -.fa-file-excel:before { - content: "\f1c3"; } - -.fa-file-export:before { - content: "\f56e"; } - -.fa-file-image:before { - content: "\f1c5"; } - -.fa-file-import:before { - content: "\f56f"; } - -.fa-file-invoice:before { - content: "\f570"; } - -.fa-file-invoice-dollar:before { - content: "\f571"; } - -.fa-file-medical:before { - content: "\f477"; } - -.fa-file-medical-alt:before { - content: "\f478"; } - -.fa-file-pdf:before { - content: "\f1c1"; } - -.fa-file-powerpoint:before { - content: "\f1c4"; } - -.fa-file-prescription:before { - content: "\f572"; } - -.fa-file-signature:before { - content: "\f573"; } - -.fa-file-upload:before { - content: "\f574"; } - -.fa-file-video:before { - content: "\f1c8"; } - -.fa-file-word:before { - content: "\f1c2"; } - -.fa-fill:before { - content: "\f575"; } - -.fa-fill-drip:before { - content: "\f576"; } - -.fa-film:before { - content: "\f008"; } - -.fa-filter:before { - content: "\f0b0"; } - -.fa-fingerprint:before { - content: "\f577"; } - -.fa-fire:before { - content: "\f06d"; } - -.fa-fire-alt:before { - content: "\f7e4"; } - -.fa-fire-extinguisher:before { - content: "\f134"; } - -.fa-firefox:before { - content: "\f269"; } - -.fa-firefox-browser:before { - content: "\f907"; } - -.fa-first-aid:before { - content: "\f479"; } - -.fa-first-order:before { - content: "\f2b0"; } - -.fa-first-order-alt:before { - content: "\f50a"; } - -.fa-firstdraft:before { - content: "\f3a1"; } - -.fa-fish:before { - content: "\f578"; } - -.fa-fist-raised:before { - content: "\f6de"; } - -.fa-flag:before { - content: "\f024"; } - -.fa-flag-checkered:before { - content: "\f11e"; } - -.fa-flag-usa:before { - content: "\f74d"; } - -.fa-flask:before { - content: "\f0c3"; } - -.fa-flickr:before { - content: "\f16e"; } - -.fa-flipboard:before { - content: "\f44d"; } - -.fa-flushed:before { - content: "\f579"; } - -.fa-fly:before { - content: "\f417"; } - -.fa-folder:before { - content: "\f07b"; } - -.fa-folder-minus:before { - content: "\f65d"; } - -.fa-folder-open:before { - content: "\f07c"; } - -.fa-folder-plus:before { - content: "\f65e"; } - -.fa-font:before { - content: "\f031"; } - -.fa-font-awesome:before { - content: "\f2b4"; } - -.fa-font-awesome-alt:before { - content: "\f35c"; } - -.fa-font-awesome-flag:before { - content: "\f425"; } - -.fa-font-awesome-logo-full:before { - content: "\f4e6"; } - -.fa-fonticons:before { - content: "\f280"; } - -.fa-fonticons-fi:before { - content: "\f3a2"; } - -.fa-football-ball:before { - content: "\f44e"; } - -.fa-fort-awesome:before { - content: "\f286"; } - -.fa-fort-awesome-alt:before { - content: "\f3a3"; } - -.fa-forumbee:before { - content: "\f211"; } - -.fa-forward:before { - content: "\f04e"; } - -.fa-foursquare:before { - content: "\f180"; } - -.fa-free-code-camp:before { - content: "\f2c5"; } - -.fa-freebsd:before { - content: "\f3a4"; } - -.fa-frog:before { - content: "\f52e"; } - -.fa-frown:before { - content: "\f119"; } - -.fa-frown-open:before { - content: "\f57a"; } - -.fa-fulcrum:before { - content: "\f50b"; } - -.fa-funnel-dollar:before { - content: "\f662"; } - -.fa-futbol:before { - content: "\f1e3"; } - -.fa-galactic-republic:before { - content: "\f50c"; } - -.fa-galactic-senate:before { - content: "\f50d"; } - -.fa-gamepad:before { - content: "\f11b"; } - -.fa-gas-pump:before { - content: "\f52f"; } - -.fa-gavel:before { - content: "\f0e3"; } - -.fa-gem:before { - content: "\f3a5"; } - -.fa-genderless:before { - content: "\f22d"; } - -.fa-get-pocket:before { - content: "\f265"; } - -.fa-gg:before { - content: "\f260"; } - -.fa-gg-circle:before { - content: "\f261"; } - -.fa-ghost:before { - content: "\f6e2"; } - -.fa-gift:before { - content: "\f06b"; } - -.fa-gifts:before { - content: "\f79c"; } - -.fa-git:before { - content: "\f1d3"; } - -.fa-git-alt:before { - content: "\f841"; } - -.fa-git-square:before { - content: "\f1d2"; } - -.fa-github:before { - content: "\f09b"; } - -.fa-github-alt:before { - content: "\f113"; } - -.fa-github-square:before { - content: "\f092"; } - -.fa-gitkraken:before { - content: "\f3a6"; } - -.fa-gitlab:before { - content: "\f296"; } - -.fa-gitter:before { - content: "\f426"; } - -.fa-glass-cheers:before { - content: "\f79f"; } - -.fa-glass-martini:before { - content: "\f000"; } - -.fa-glass-martini-alt:before { - content: "\f57b"; } - -.fa-glass-whiskey:before { - content: "\f7a0"; } - -.fa-glasses:before { - content: "\f530"; } - -.fa-glide:before { - content: "\f2a5"; } - -.fa-glide-g:before { - content: "\f2a6"; } - -.fa-globe:before { - content: "\f0ac"; } - -.fa-globe-africa:before { - content: "\f57c"; } - -.fa-globe-americas:before { - content: "\f57d"; } - -.fa-globe-asia:before { - content: "\f57e"; } - -.fa-globe-europe:before { - content: "\f7a2"; } - -.fa-gofore:before { - content: "\f3a7"; } - -.fa-golf-ball:before { - content: "\f450"; } - -.fa-goodreads:before { - content: "\f3a8"; } - -.fa-goodreads-g:before { - content: "\f3a9"; } - -.fa-google:before { - content: "\f1a0"; } - -.fa-google-drive:before { - content: "\f3aa"; } - -.fa-google-pay:before { - content: "\f979"; } - -.fa-google-play:before { - content: "\f3ab"; } - -.fa-google-plus:before { - content: "\f2b3"; } - -.fa-google-plus-g:before { - content: "\f0d5"; } - -.fa-google-plus-square:before { - content: "\f0d4"; } - -.fa-google-wallet:before { - content: "\f1ee"; } - -.fa-gopuram:before { - content: "\f664"; } - -.fa-graduation-cap:before { - content: "\f19d"; } - -.fa-gratipay:before { - content: "\f184"; } - -.fa-grav:before { - content: "\f2d6"; } - -.fa-greater-than:before { - content: "\f531"; } - -.fa-greater-than-equal:before { - content: "\f532"; } - -.fa-grimace:before { - content: "\f57f"; } - -.fa-grin:before { - content: "\f580"; } - -.fa-grin-alt:before { - content: "\f581"; } - -.fa-grin-beam:before { - content: "\f582"; } - -.fa-grin-beam-sweat:before { - content: "\f583"; } - -.fa-grin-hearts:before { - content: "\f584"; } - -.fa-grin-squint:before { - content: "\f585"; } - -.fa-grin-squint-tears:before { - content: "\f586"; } - -.fa-grin-stars:before { - content: "\f587"; } - -.fa-grin-tears:before { - content: "\f588"; } - -.fa-grin-tongue:before { - content: "\f589"; } - -.fa-grin-tongue-squint:before { - content: "\f58a"; } - -.fa-grin-tongue-wink:before { - content: "\f58b"; } - -.fa-grin-wink:before { - content: "\f58c"; } - -.fa-grip-horizontal:before { - content: "\f58d"; } - -.fa-grip-lines:before { - content: "\f7a4"; } - -.fa-grip-lines-vertical:before { - content: "\f7a5"; } - -.fa-grip-vertical:before { - content: "\f58e"; } - -.fa-gripfire:before { - content: "\f3ac"; } - -.fa-grunt:before { - content: "\f3ad"; } - -.fa-guitar:before { - content: "\f7a6"; } - -.fa-gulp:before { - content: "\f3ae"; } - -.fa-h-square:before { - content: "\f0fd"; } - -.fa-hacker-news:before { - content: "\f1d4"; } - -.fa-hacker-news-square:before { - content: "\f3af"; } - -.fa-hackerrank:before { - content: "\f5f7"; } - -.fa-hamburger:before { - content: "\f805"; } - -.fa-hammer:before { - content: "\f6e3"; } - -.fa-hamsa:before { - content: "\f665"; } - -.fa-hand-holding:before { - content: "\f4bd"; } - -.fa-hand-holding-heart:before { - content: "\f4be"; } - -.fa-hand-holding-medical:before { - content: "\f95c"; } - -.fa-hand-holding-usd:before { - content: "\f4c0"; } - -.fa-hand-holding-water:before { - content: "\f4c1"; } - -.fa-hand-lizard:before { - content: "\f258"; } - -.fa-hand-middle-finger:before { - content: "\f806"; } - -.fa-hand-paper:before { - content: "\f256"; } - -.fa-hand-peace:before { - content: "\f25b"; } - -.fa-hand-point-down:before { - content: "\f0a7"; } - -.fa-hand-point-left:before { - content: "\f0a5"; } - -.fa-hand-point-right:before { - content: "\f0a4"; } - -.fa-hand-point-up:before { - content: "\f0a6"; } - -.fa-hand-pointer:before { - content: "\f25a"; } - -.fa-hand-rock:before { - content: "\f255"; } - -.fa-hand-scissors:before { - content: "\f257"; } - -.fa-hand-sparkles:before { - content: "\f95d"; } - -.fa-hand-spock:before { - content: "\f259"; } - -.fa-hands:before { - content: "\f4c2"; } - -.fa-hands-helping:before { - content: "\f4c4"; } - -.fa-hands-wash:before { - content: "\f95e"; } - -.fa-handshake:before { - content: "\f2b5"; } - -.fa-handshake-alt-slash:before { - content: "\f95f"; } - -.fa-handshake-slash:before { - content: "\f960"; } - -.fa-hanukiah:before { - content: "\f6e6"; } - -.fa-hard-hat:before { - content: "\f807"; } - -.fa-hashtag:before { - content: "\f292"; } - -.fa-hat-cowboy:before { - content: "\f8c0"; } - -.fa-hat-cowboy-side:before { - content: "\f8c1"; } - -.fa-hat-wizard:before { - content: "\f6e8"; } - -.fa-hdd:before { - content: "\f0a0"; } - -.fa-head-side-cough:before { - content: "\f961"; } - -.fa-head-side-cough-slash:before { - content: "\f962"; } - -.fa-head-side-mask:before { - content: "\f963"; } - -.fa-head-side-virus:before { - content: "\f964"; } - -.fa-heading:before { - content: "\f1dc"; } - -.fa-headphones:before { - content: "\f025"; } - -.fa-headphones-alt:before { - content: "\f58f"; } - -.fa-headset:before { - content: "\f590"; } - -.fa-heart:before { - content: "\f004"; } - -.fa-heart-broken:before { - content: "\f7a9"; } - -.fa-heartbeat:before { - content: "\f21e"; } - -.fa-helicopter:before { - content: "\f533"; } - -.fa-highlighter:before { - content: "\f591"; } - -.fa-hiking:before { - content: "\f6ec"; } - -.fa-hippo:before { - content: "\f6ed"; } - -.fa-hips:before { - content: "\f452"; } - -.fa-hire-a-helper:before { - content: "\f3b0"; } - -.fa-history:before { - content: "\f1da"; } - -.fa-hockey-puck:before { - content: "\f453"; } - -.fa-holly-berry:before { - content: "\f7aa"; } - -.fa-home:before { - content: "\f015"; } - -.fa-hooli:before { - content: "\f427"; } - -.fa-hornbill:before { - content: "\f592"; } - -.fa-horse:before { - content: "\f6f0"; } - -.fa-horse-head:before { - content: "\f7ab"; } - -.fa-hospital:before { - content: "\f0f8"; } - -.fa-hospital-alt:before { - content: "\f47d"; } - -.fa-hospital-symbol:before { - content: "\f47e"; } - -.fa-hospital-user:before { - content: "\f80d"; } - -.fa-hot-tub:before { - content: "\f593"; } - -.fa-hotdog:before { - content: "\f80f"; } - -.fa-hotel:before { - content: "\f594"; } - -.fa-hotjar:before { - content: "\f3b1"; } - -.fa-hourglass:before { - content: "\f254"; } - -.fa-hourglass-end:before { - content: "\f253"; } - -.fa-hourglass-half:before { - content: "\f252"; } - -.fa-hourglass-start:before { - content: "\f251"; } - -.fa-house-damage:before { - content: "\f6f1"; } - -.fa-house-user:before { - content: "\f965"; } - -.fa-houzz:before { - content: "\f27c"; } - -.fa-hryvnia:before { - content: "\f6f2"; } - -.fa-html5:before { - content: "\f13b"; } - -.fa-hubspot:before { - content: "\f3b2"; } - -.fa-i-cursor:before { - content: "\f246"; } - -.fa-ice-cream:before { - content: "\f810"; } - -.fa-icicles:before { - content: "\f7ad"; } - -.fa-icons:before { - content: "\f86d"; } - -.fa-id-badge:before { - content: "\f2c1"; } - -.fa-id-card:before { - content: "\f2c2"; } - -.fa-id-card-alt:before { - content: "\f47f"; } - -.fa-ideal:before { - content: "\f913"; } - -.fa-igloo:before { - content: "\f7ae"; } - -.fa-image:before { - content: "\f03e"; } - -.fa-images:before { - content: "\f302"; } - -.fa-imdb:before { - content: "\f2d8"; } - -.fa-inbox:before { - content: "\f01c"; } - -.fa-indent:before { - content: "\f03c"; } - -.fa-industry:before { - content: "\f275"; } - -.fa-infinity:before { - content: "\f534"; } - -.fa-info:before { - content: "\f129"; } - -.fa-info-circle:before { - content: "\f05a"; } - -.fa-instagram:before { - content: "\f16d"; } - -.fa-instagram-square:before { - content: "\f955"; } - -.fa-intercom:before { - content: "\f7af"; } - -.fa-internet-explorer:before { - content: "\f26b"; } - -.fa-invision:before { - content: "\f7b0"; } - -.fa-ioxhost:before { - content: "\f208"; } - -.fa-italic:before { - content: "\f033"; } - -.fa-itch-io:before { - content: "\f83a"; } - -.fa-itunes:before { - content: "\f3b4"; } - -.fa-itunes-note:before { - content: "\f3b5"; } - -.fa-java:before { - content: "\f4e4"; } - -.fa-jedi:before { - content: "\f669"; } - -.fa-jedi-order:before { - content: "\f50e"; } - -.fa-jenkins:before { - content: "\f3b6"; } - -.fa-jira:before { - content: "\f7b1"; } - -.fa-joget:before { - content: "\f3b7"; } - -.fa-joint:before { - content: "\f595"; } - -.fa-joomla:before { - content: "\f1aa"; } - -.fa-journal-whills:before { - content: "\f66a"; } - -.fa-js:before { - content: "\f3b8"; } - -.fa-js-square:before { - content: "\f3b9"; } - -.fa-jsfiddle:before { - content: "\f1cc"; } - -.fa-kaaba:before { - content: "\f66b"; } - -.fa-kaggle:before { - content: "\f5fa"; } - -.fa-key:before { - content: "\f084"; } - -.fa-keybase:before { - content: "\f4f5"; } - -.fa-keyboard:before { - content: "\f11c"; } - -.fa-keycdn:before { - content: "\f3ba"; } - -.fa-khanda:before { - content: "\f66d"; } - -.fa-kickstarter:before { - content: "\f3bb"; } - -.fa-kickstarter-k:before { - content: "\f3bc"; } - -.fa-kiss:before { - content: "\f596"; } - -.fa-kiss-beam:before { - content: "\f597"; } - -.fa-kiss-wink-heart:before { - content: "\f598"; } - -.fa-kiwi-bird:before { - content: "\f535"; } - -.fa-korvue:before { - content: "\f42f"; } - -.fa-landmark:before { - content: "\f66f"; } - -.fa-language:before { - content: "\f1ab"; } - -.fa-laptop:before { - content: "\f109"; } - -.fa-laptop-code:before { - content: "\f5fc"; } - -.fa-laptop-house:before { - content: "\f966"; } - -.fa-laptop-medical:before { - content: "\f812"; } - -.fa-laravel:before { - content: "\f3bd"; } - -.fa-lastfm:before { - content: "\f202"; } - -.fa-lastfm-square:before { - content: "\f203"; } - -.fa-laugh:before { - content: "\f599"; } - -.fa-laugh-beam:before { - content: "\f59a"; } - -.fa-laugh-squint:before { - content: "\f59b"; } - -.fa-laugh-wink:before { - content: "\f59c"; } - -.fa-layer-group:before { - content: "\f5fd"; } - -.fa-leaf:before { - content: "\f06c"; } - -.fa-leanpub:before { - content: "\f212"; } - -.fa-lemon:before { - content: "\f094"; } - -.fa-less:before { - content: "\f41d"; } - -.fa-less-than:before { - content: "\f536"; } - -.fa-less-than-equal:before { - content: "\f537"; } - -.fa-level-down-alt:before { - content: "\f3be"; } - -.fa-level-up-alt:before { - content: "\f3bf"; } - -.fa-life-ring:before { - content: "\f1cd"; } - -.fa-lightbulb:before { - content: "\f0eb"; } - -.fa-line:before { - content: "\f3c0"; } - -.fa-link:before { - content: "\f0c1"; } - -.fa-linkedin:before { - content: "\f08c"; } - -.fa-linkedin-in:before { - content: "\f0e1"; } - -.fa-linode:before { - content: "\f2b8"; } - -.fa-linux:before { - content: "\f17c"; } - -.fa-lira-sign:before { - content: "\f195"; } - -.fa-list:before { - content: "\f03a"; } - -.fa-list-alt:before { - content: "\f022"; } - -.fa-list-ol:before { - content: "\f0cb"; } - -.fa-list-ul:before { - content: "\f0ca"; } - -.fa-location-arrow:before { - content: "\f124"; } - -.fa-lock:before { - content: "\f023"; } - -.fa-lock-open:before { - content: "\f3c1"; } - -.fa-long-arrow-alt-down:before { - content: "\f309"; } - -.fa-long-arrow-alt-left:before { - content: "\f30a"; } - -.fa-long-arrow-alt-right:before { - content: "\f30b"; } - -.fa-long-arrow-alt-up:before { - content: "\f30c"; } - -.fa-low-vision:before { - content: "\f2a8"; } - -.fa-luggage-cart:before { - content: "\f59d"; } - -.fa-lungs:before { - content: "\f604"; } - -.fa-lungs-virus:before { - content: "\f967"; } - -.fa-lyft:before { - content: "\f3c3"; } - -.fa-magento:before { - content: "\f3c4"; } - -.fa-magic:before { - content: "\f0d0"; } - -.fa-magnet:before { - content: "\f076"; } - -.fa-mail-bulk:before { - content: "\f674"; } - -.fa-mailchimp:before { - content: "\f59e"; } - -.fa-male:before { - content: "\f183"; } - -.fa-mandalorian:before { - content: "\f50f"; } - -.fa-map:before { - content: "\f279"; } - -.fa-map-marked:before { - content: "\f59f"; } - -.fa-map-marked-alt:before { - content: "\f5a0"; } - -.fa-map-marker:before { - content: "\f041"; } - -.fa-map-marker-alt:before { - content: "\f3c5"; } - -.fa-map-pin:before { - content: "\f276"; } - -.fa-map-signs:before { - content: "\f277"; } - -.fa-markdown:before { - content: "\f60f"; } - -.fa-marker:before { - content: "\f5a1"; } - -.fa-mars:before { - content: "\f222"; } - -.fa-mars-double:before { - content: "\f227"; } - -.fa-mars-stroke:before { - content: "\f229"; } - -.fa-mars-stroke-h:before { - content: "\f22b"; } - -.fa-mars-stroke-v:before { - content: "\f22a"; } - -.fa-mask:before { - content: "\f6fa"; } - -.fa-mastodon:before { - content: "\f4f6"; } - -.fa-maxcdn:before { - content: "\f136"; } - -.fa-mdb:before { - content: "\f8ca"; } - -.fa-medal:before { - content: "\f5a2"; } - -.fa-medapps:before { - content: "\f3c6"; } - -.fa-medium:before { - content: "\f23a"; } - -.fa-medium-m:before { - content: "\f3c7"; } - -.fa-medkit:before { - content: "\f0fa"; } - -.fa-medrt:before { - content: "\f3c8"; } - -.fa-meetup:before { - content: "\f2e0"; } - -.fa-megaport:before { - content: "\f5a3"; } - -.fa-meh:before { - content: "\f11a"; } - -.fa-meh-blank:before { - content: "\f5a4"; } - -.fa-meh-rolling-eyes:before { - content: "\f5a5"; } - -.fa-memory:before { - content: "\f538"; } - -.fa-mendeley:before { - content: "\f7b3"; } - -.fa-menorah:before { - content: "\f676"; } - -.fa-mercury:before { - content: "\f223"; } - -.fa-meteor:before { - content: "\f753"; } - -.fa-microblog:before { - content: "\f91a"; } - -.fa-microchip:before { - content: "\f2db"; } - -.fa-microphone:before { - content: "\f130"; } - -.fa-microphone-alt:before { - content: "\f3c9"; } - -.fa-microphone-alt-slash:before { - content: "\f539"; } - -.fa-microphone-slash:before { - content: "\f131"; } - -.fa-microscope:before { - content: "\f610"; } - -.fa-microsoft:before { - content: "\f3ca"; } - -.fa-minus:before { - content: "\f068"; } - -.fa-minus-circle:before { - content: "\f056"; } - -.fa-minus-square:before { - content: "\f146"; } - -.fa-mitten:before { - content: "\f7b5"; } - -.fa-mix:before { - content: "\f3cb"; } - -.fa-mixcloud:before { - content: "\f289"; } - -.fa-mixer:before { - content: "\f956"; } - -.fa-mizuni:before { - content: "\f3cc"; } - -.fa-mobile:before { - content: "\f10b"; } - -.fa-mobile-alt:before { - content: "\f3cd"; } - -.fa-modx:before { - content: "\f285"; } - -.fa-monero:before { - content: "\f3d0"; } - -.fa-money-bill:before { - content: "\f0d6"; } - -.fa-money-bill-alt:before { - content: "\f3d1"; } - -.fa-money-bill-wave:before { - content: "\f53a"; } - -.fa-money-bill-wave-alt:before { - content: "\f53b"; } - -.fa-money-check:before { - content: "\f53c"; } - -.fa-money-check-alt:before { - content: "\f53d"; } - -.fa-monument:before { - content: "\f5a6"; } - -.fa-moon:before { - content: "\f186"; } - -.fa-mortar-pestle:before { - content: "\f5a7"; } - -.fa-mosque:before { - content: "\f678"; } - -.fa-motorcycle:before { - content: "\f21c"; } - -.fa-mountain:before { - content: "\f6fc"; } - -.fa-mouse:before { - content: "\f8cc"; } - -.fa-mouse-pointer:before { - content: "\f245"; } - -.fa-mug-hot:before { - content: "\f7b6"; } - -.fa-music:before { - content: "\f001"; } - -.fa-napster:before { - content: "\f3d2"; } - -.fa-neos:before { - content: "\f612"; } - -.fa-network-wired:before { - content: "\f6ff"; } - -.fa-neuter:before { - content: "\f22c"; } - -.fa-newspaper:before { - content: "\f1ea"; } - -.fa-nimblr:before { - content: "\f5a8"; } - -.fa-node:before { - content: "\f419"; } - -.fa-node-js:before { - content: "\f3d3"; } - -.fa-not-equal:before { - content: "\f53e"; } - -.fa-notes-medical:before { - content: "\f481"; } - -.fa-npm:before { - content: "\f3d4"; } - -.fa-ns8:before { - content: "\f3d5"; } - -.fa-nutritionix:before { - content: "\f3d6"; } - -.fa-object-group:before { - content: "\f247"; } - -.fa-object-ungroup:before { - content: "\f248"; } - -.fa-odnoklassniki:before { - content: "\f263"; } - -.fa-odnoklassniki-square:before { - content: "\f264"; } - -.fa-oil-can:before { - content: "\f613"; } - -.fa-old-republic:before { - content: "\f510"; } - -.fa-om:before { - content: "\f679"; } - -.fa-opencart:before { - content: "\f23d"; } - -.fa-openid:before { - content: "\f19b"; } - -.fa-opera:before { - content: "\f26a"; } - -.fa-optin-monster:before { - content: "\f23c"; } - -.fa-orcid:before { - content: "\f8d2"; } - -.fa-osi:before { - content: "\f41a"; } - -.fa-otter:before { - content: "\f700"; } - -.fa-outdent:before { - content: "\f03b"; } - -.fa-page4:before { - content: "\f3d7"; } - -.fa-pagelines:before { - content: "\f18c"; } - -.fa-pager:before { - content: "\f815"; } - -.fa-paint-brush:before { - content: "\f1fc"; } - -.fa-paint-roller:before { - content: "\f5aa"; } - -.fa-palette:before { - content: "\f53f"; } - -.fa-palfed:before { - content: "\f3d8"; } - -.fa-pallet:before { - content: "\f482"; } - -.fa-paper-plane:before { - content: "\f1d8"; } - -.fa-paperclip:before { - content: "\f0c6"; } - -.fa-parachute-box:before { - content: "\f4cd"; } - -.fa-paragraph:before { - content: "\f1dd"; } - -.fa-parking:before { - content: "\f540"; } - -.fa-passport:before { - content: "\f5ab"; } - -.fa-pastafarianism:before { - content: "\f67b"; } - -.fa-paste:before { - content: "\f0ea"; } - -.fa-patreon:before { - content: "\f3d9"; } - -.fa-pause:before { - content: "\f04c"; } - -.fa-pause-circle:before { - content: "\f28b"; } - -.fa-paw:before { - content: "\f1b0"; } - -.fa-paypal:before { - content: "\f1ed"; } - -.fa-peace:before { - content: "\f67c"; } - -.fa-pen:before { - content: "\f304"; } - -.fa-pen-alt:before { - content: "\f305"; } - -.fa-pen-fancy:before { - content: "\f5ac"; } - -.fa-pen-nib:before { - content: "\f5ad"; } - -.fa-pen-square:before { - content: "\f14b"; } - -.fa-pencil-alt:before { - content: "\f303"; } - -.fa-pencil-ruler:before { - content: "\f5ae"; } - -.fa-penny-arcade:before { - content: "\f704"; } - -.fa-people-arrows:before { - content: "\f968"; } - -.fa-people-carry:before { - content: "\f4ce"; } - -.fa-pepper-hot:before { - content: "\f816"; } - -.fa-percent:before { - content: "\f295"; } - -.fa-percentage:before { - content: "\f541"; } - -.fa-periscope:before { - content: "\f3da"; } - -.fa-person-booth:before { - content: "\f756"; } - -.fa-phabricator:before { - content: "\f3db"; } - -.fa-phoenix-framework:before { - content: "\f3dc"; } - -.fa-phoenix-squadron:before { - content: "\f511"; } - -.fa-phone:before { - content: "\f095"; } - -.fa-phone-alt:before { - content: "\f879"; } - -.fa-phone-slash:before { - content: "\f3dd"; } - -.fa-phone-square:before { - content: "\f098"; } - -.fa-phone-square-alt:before { - content: "\f87b"; } - -.fa-phone-volume:before { - content: "\f2a0"; } - -.fa-photo-video:before { - content: "\f87c"; } - -.fa-php:before { - content: "\f457"; } - -.fa-pied-piper:before { - content: "\f2ae"; } - -.fa-pied-piper-alt:before { - content: "\f1a8"; } - -.fa-pied-piper-hat:before { - content: "\f4e5"; } - -.fa-pied-piper-pp:before { - content: "\f1a7"; } - -.fa-pied-piper-square:before { - content: "\f91e"; } - -.fa-piggy-bank:before { - content: "\f4d3"; } - -.fa-pills:before { - content: "\f484"; } - -.fa-pinterest:before { - content: "\f0d2"; } - -.fa-pinterest-p:before { - content: "\f231"; } - -.fa-pinterest-square:before { - content: "\f0d3"; } - -.fa-pizza-slice:before { - content: "\f818"; } - -.fa-place-of-worship:before { - content: "\f67f"; } - -.fa-plane:before { - content: "\f072"; } - -.fa-plane-arrival:before { - content: "\f5af"; } - -.fa-plane-departure:before { - content: "\f5b0"; } - -.fa-plane-slash:before { - content: "\f969"; } - -.fa-play:before { - content: "\f04b"; } - -.fa-play-circle:before { - content: "\f144"; } - -.fa-playstation:before { - content: "\f3df"; } - -.fa-plug:before { - content: "\f1e6"; } - -.fa-plus:before { - content: "\f067"; } - -.fa-plus-circle:before { - content: "\f055"; } - -.fa-plus-square:before { - content: "\f0fe"; } - -.fa-podcast:before { - content: "\f2ce"; } - -.fa-poll:before { - content: "\f681"; } - -.fa-poll-h:before { - content: "\f682"; } - -.fa-poo:before { - content: "\f2fe"; } - -.fa-poo-storm:before { - content: "\f75a"; } - -.fa-poop:before { - content: "\f619"; } - -.fa-portrait:before { - content: "\f3e0"; } - -.fa-pound-sign:before { - content: "\f154"; } - -.fa-power-off:before { - content: "\f011"; } - -.fa-pray:before { - content: "\f683"; } - -.fa-praying-hands:before { - content: "\f684"; } - -.fa-prescription:before { - content: "\f5b1"; } - -.fa-prescription-bottle:before { - content: "\f485"; } - -.fa-prescription-bottle-alt:before { - content: "\f486"; } - -.fa-print:before { - content: "\f02f"; } - -.fa-procedures:before { - content: "\f487"; } - -.fa-product-hunt:before { - content: "\f288"; } - -.fa-project-diagram:before { - content: "\f542"; } - -.fa-pump-medical:before { - content: "\f96a"; } - -.fa-pump-soap:before { - content: "\f96b"; } - -.fa-pushed:before { - content: "\f3e1"; } - -.fa-puzzle-piece:before { - content: "\f12e"; } - -.fa-python:before { - content: "\f3e2"; } - -.fa-qq:before { - content: "\f1d6"; } - -.fa-qrcode:before { - content: "\f029"; } - -.fa-question:before { - content: "\f128"; } - -.fa-question-circle:before { - content: "\f059"; } - -.fa-quidditch:before { - content: "\f458"; } - -.fa-quinscape:before { - content: "\f459"; } - -.fa-quora:before { - content: "\f2c4"; } - -.fa-quote-left:before { - content: "\f10d"; } - -.fa-quote-right:before { - content: "\f10e"; } - -.fa-quran:before { - content: "\f687"; } - -.fa-r-project:before { - content: "\f4f7"; } - -.fa-radiation:before { - content: "\f7b9"; } - -.fa-radiation-alt:before { - content: "\f7ba"; } - -.fa-rainbow:before { - content: "\f75b"; } - -.fa-random:before { - content: "\f074"; } - -.fa-raspberry-pi:before { - content: "\f7bb"; } - -.fa-ravelry:before { - content: "\f2d9"; } - -.fa-react:before { - content: "\f41b"; } - -.fa-reacteurope:before { - content: "\f75d"; } - -.fa-readme:before { - content: "\f4d5"; } - -.fa-rebel:before { - content: "\f1d0"; } - -.fa-receipt:before { - content: "\f543"; } - -.fa-record-vinyl:before { - content: "\f8d9"; } - -.fa-recycle:before { - content: "\f1b8"; } - -.fa-red-river:before { - content: "\f3e3"; } - -.fa-reddit:before { - content: "\f1a1"; } - -.fa-reddit-alien:before { - content: "\f281"; } - -.fa-reddit-square:before { - content: "\f1a2"; } - -.fa-redhat:before { - content: "\f7bc"; } - -.fa-redo:before { - content: "\f01e"; } - -.fa-redo-alt:before { - content: "\f2f9"; } - -.fa-registered:before { - content: "\f25d"; } - -.fa-remove-format:before { - content: "\f87d"; } - -.fa-renren:before { - content: "\f18b"; } - -.fa-reply:before { - content: "\f3e5"; } - -.fa-reply-all:before { - content: "\f122"; } - -.fa-replyd:before { - content: "\f3e6"; } - -.fa-republican:before { - content: "\f75e"; } - -.fa-researchgate:before { - content: "\f4f8"; } - -.fa-resolving:before { - content: "\f3e7"; } - -.fa-restroom:before { - content: "\f7bd"; } - -.fa-retweet:before { - content: "\f079"; } - -.fa-rev:before { - content: "\f5b2"; } - -.fa-ribbon:before { - content: "\f4d6"; } - -.fa-ring:before { - content: "\f70b"; } - -.fa-road:before { - content: "\f018"; } - -.fa-robot:before { - content: "\f544"; } - -.fa-rocket:before { - content: "\f135"; } - -.fa-rocketchat:before { - content: "\f3e8"; } - -.fa-rockrms:before { - content: "\f3e9"; } - -.fa-route:before { - content: "\f4d7"; } - -.fa-rss:before { - content: "\f09e"; } - -.fa-rss-square:before { - content: "\f143"; } - -.fa-ruble-sign:before { - content: "\f158"; } - -.fa-ruler:before { - content: "\f545"; } - -.fa-ruler-combined:before { - content: "\f546"; } - -.fa-ruler-horizontal:before { - content: "\f547"; } - -.fa-ruler-vertical:before { - content: "\f548"; } - -.fa-running:before { - content: "\f70c"; } - -.fa-rupee-sign:before { - content: "\f156"; } - -.fa-rust:before { - content: "\f97a"; } - -.fa-sad-cry:before { - content: "\f5b3"; } - -.fa-sad-tear:before { - content: "\f5b4"; } - -.fa-safari:before { - content: "\f267"; } - -.fa-salesforce:before { - content: "\f83b"; } - -.fa-sass:before { - content: "\f41e"; } - -.fa-satellite:before { - content: "\f7bf"; } - -.fa-satellite-dish:before { - content: "\f7c0"; } - -.fa-save:before { - content: "\f0c7"; } - -.fa-schlix:before { - content: "\f3ea"; } - -.fa-school:before { - content: "\f549"; } - -.fa-screwdriver:before { - content: "\f54a"; } - -.fa-scribd:before { - content: "\f28a"; } - -.fa-scroll:before { - content: "\f70e"; } - -.fa-sd-card:before { - content: "\f7c2"; } - -.fa-search:before { - content: "\f002"; } - -.fa-search-dollar:before { - content: "\f688"; } - -.fa-search-location:before { - content: "\f689"; } - -.fa-search-minus:before { - content: "\f010"; } - -.fa-search-plus:before { - content: "\f00e"; } - -.fa-searchengin:before { - content: "\f3eb"; } - -.fa-seedling:before { - content: "\f4d8"; } - -.fa-sellcast:before { - content: "\f2da"; } - -.fa-sellsy:before { - content: "\f213"; } - -.fa-server:before { - content: "\f233"; } - -.fa-servicestack:before { - content: "\f3ec"; } - -.fa-shapes:before { - content: "\f61f"; } - -.fa-share:before { - content: "\f064"; } - -.fa-share-alt:before { - content: "\f1e0"; } - -.fa-share-alt-square:before { - content: "\f1e1"; } - -.fa-share-square:before { - content: "\f14d"; } - -.fa-shekel-sign:before { - content: "\f20b"; } - -.fa-shield-alt:before { - content: "\f3ed"; } - -.fa-shield-virus:before { - content: "\f96c"; } - -.fa-ship:before { - content: "\f21a"; } - -.fa-shipping-fast:before { - content: "\f48b"; } - -.fa-shirtsinbulk:before { - content: "\f214"; } - -.fa-shoe-prints:before { - content: "\f54b"; } - -.fa-shopify:before { - content: "\f957"; } - -.fa-shopping-bag:before { - content: "\f290"; } - -.fa-shopping-basket:before { - content: "\f291"; } - -.fa-shopping-cart:before { - content: "\f07a"; } - -.fa-shopware:before { - content: "\f5b5"; } - -.fa-shower:before { - content: "\f2cc"; } - -.fa-shuttle-van:before { - content: "\f5b6"; } - -.fa-sign:before { - content: "\f4d9"; } - -.fa-sign-in-alt:before { - content: "\f2f6"; } - -.fa-sign-language:before { - content: "\f2a7"; } - -.fa-sign-out-alt:before { - content: "\f2f5"; } - -.fa-signal:before { - content: "\f012"; } - -.fa-signature:before { - content: "\f5b7"; } - -.fa-sim-card:before { - content: "\f7c4"; } - -.fa-simplybuilt:before { - content: "\f215"; } - -.fa-sink:before { - content: "\f96d"; } - -.fa-sistrix:before { - content: "\f3ee"; } - -.fa-sitemap:before { - content: "\f0e8"; } - -.fa-sith:before { - content: "\f512"; } - -.fa-skating:before { - content: "\f7c5"; } - -.fa-sketch:before { - content: "\f7c6"; } - -.fa-skiing:before { - content: "\f7c9"; } - -.fa-skiing-nordic:before { - content: "\f7ca"; } - -.fa-skull:before { - content: "\f54c"; } - -.fa-skull-crossbones:before { - content: "\f714"; } - -.fa-skyatlas:before { - content: "\f216"; } - -.fa-skype:before { - content: "\f17e"; } - -.fa-slack:before { - content: "\f198"; } - -.fa-slack-hash:before { - content: "\f3ef"; } - -.fa-slash:before { - content: "\f715"; } - -.fa-sleigh:before { - content: "\f7cc"; } - -.fa-sliders-h:before { - content: "\f1de"; } - -.fa-slideshare:before { - content: "\f1e7"; } - -.fa-smile:before { - content: "\f118"; } - -.fa-smile-beam:before { - content: "\f5b8"; } - -.fa-smile-wink:before { - content: "\f4da"; } - -.fa-smog:before { - content: "\f75f"; } - -.fa-smoking:before { - content: "\f48d"; } - -.fa-smoking-ban:before { - content: "\f54d"; } - -.fa-sms:before { - content: "\f7cd"; } - -.fa-snapchat:before { - content: "\f2ab"; } - -.fa-snapchat-ghost:before { - content: "\f2ac"; } - -.fa-snapchat-square:before { - content: "\f2ad"; } - -.fa-snowboarding:before { - content: "\f7ce"; } - -.fa-snowflake:before { - content: "\f2dc"; } - -.fa-snowman:before { - content: "\f7d0"; } - -.fa-snowplow:before { - content: "\f7d2"; } - -.fa-soap:before { - content: "\f96e"; } - -.fa-socks:before { - content: "\f696"; } - -.fa-solar-panel:before { - content: "\f5ba"; } - -.fa-sort:before { - content: "\f0dc"; } - -.fa-sort-alpha-down:before { - content: "\f15d"; } - -.fa-sort-alpha-down-alt:before { - content: "\f881"; } - -.fa-sort-alpha-up:before { - content: "\f15e"; } - -.fa-sort-alpha-up-alt:before { - content: "\f882"; } - -.fa-sort-amount-down:before { - content: "\f160"; } - -.fa-sort-amount-down-alt:before { - content: "\f884"; } - -.fa-sort-amount-up:before { - content: "\f161"; } - -.fa-sort-amount-up-alt:before { - content: "\f885"; } - -.fa-sort-down:before { - content: "\f0dd"; } - -.fa-sort-numeric-down:before { - content: "\f162"; } - -.fa-sort-numeric-down-alt:before { - content: "\f886"; } - -.fa-sort-numeric-up:before { - content: "\f163"; } - -.fa-sort-numeric-up-alt:before { - content: "\f887"; } - -.fa-sort-up:before { - content: "\f0de"; } - -.fa-soundcloud:before { - content: "\f1be"; } - -.fa-sourcetree:before { - content: "\f7d3"; } - -.fa-spa:before { - content: "\f5bb"; } - -.fa-space-shuttle:before { - content: "\f197"; } - -.fa-speakap:before { - content: "\f3f3"; } - -.fa-speaker-deck:before { - content: "\f83c"; } - -.fa-spell-check:before { - content: "\f891"; } - -.fa-spider:before { - content: "\f717"; } - -.fa-spinner:before { - content: "\f110"; } - -.fa-splotch:before { - content: "\f5bc"; } - -.fa-spotify:before { - content: "\f1bc"; } - -.fa-spray-can:before { - content: "\f5bd"; } - -.fa-square:before { - content: "\f0c8"; } - -.fa-square-full:before { - content: "\f45c"; } - -.fa-square-root-alt:before { - content: "\f698"; } - -.fa-squarespace:before { - content: "\f5be"; } - -.fa-stack-exchange:before { - content: "\f18d"; } - -.fa-stack-overflow:before { - content: "\f16c"; } - -.fa-stackpath:before { - content: "\f842"; } - -.fa-stamp:before { - content: "\f5bf"; } - -.fa-star:before { - content: "\f005"; } - -.fa-star-and-crescent:before { - content: "\f699"; } - -.fa-star-half:before { - content: "\f089"; } - -.fa-star-half-alt:before { - content: "\f5c0"; } - -.fa-star-of-david:before { - content: "\f69a"; } - -.fa-star-of-life:before { - content: "\f621"; } - -.fa-staylinked:before { - content: "\f3f5"; } - -.fa-steam:before { - content: "\f1b6"; } - -.fa-steam-square:before { - content: "\f1b7"; } - -.fa-steam-symbol:before { - content: "\f3f6"; } - -.fa-step-backward:before { - content: "\f048"; } - -.fa-step-forward:before { - content: "\f051"; } - -.fa-stethoscope:before { - content: "\f0f1"; } - -.fa-sticker-mule:before { - content: "\f3f7"; } - -.fa-sticky-note:before { - content: "\f249"; } - -.fa-stop:before { - content: "\f04d"; } - -.fa-stop-circle:before { - content: "\f28d"; } - -.fa-stopwatch:before { - content: "\f2f2"; } - -.fa-stopwatch-20:before { - content: "\f96f"; } - -.fa-store:before { - content: "\f54e"; } - -.fa-store-alt:before { - content: "\f54f"; } - -.fa-store-alt-slash:before { - content: "\f970"; } - -.fa-store-slash:before { - content: "\f971"; } - -.fa-strava:before { - content: "\f428"; } - -.fa-stream:before { - content: "\f550"; } - -.fa-street-view:before { - content: "\f21d"; } - -.fa-strikethrough:before { - content: "\f0cc"; } - -.fa-stripe:before { - content: "\f429"; } - -.fa-stripe-s:before { - content: "\f42a"; } - -.fa-stroopwafel:before { - content: "\f551"; } - -.fa-studiovinari:before { - content: "\f3f8"; } - -.fa-stumbleupon:before { - content: "\f1a4"; } - -.fa-stumbleupon-circle:before { - content: "\f1a3"; } - -.fa-subscript:before { - content: "\f12c"; } - -.fa-subway:before { - content: "\f239"; } - -.fa-suitcase:before { - content: "\f0f2"; } - -.fa-suitcase-rolling:before { - content: "\f5c1"; } - -.fa-sun:before { - content: "\f185"; } - -.fa-superpowers:before { - content: "\f2dd"; } - -.fa-superscript:before { - content: "\f12b"; } - -.fa-supple:before { - content: "\f3f9"; } - -.fa-surprise:before { - content: "\f5c2"; } - -.fa-suse:before { - content: "\f7d6"; } - -.fa-swatchbook:before { - content: "\f5c3"; } - -.fa-swift:before { - content: "\f8e1"; } - -.fa-swimmer:before { - content: "\f5c4"; } - -.fa-swimming-pool:before { - content: "\f5c5"; } - -.fa-symfony:before { - content: "\f83d"; } - -.fa-synagogue:before { - content: "\f69b"; } - -.fa-sync:before { - content: "\f021"; } - -.fa-sync-alt:before { - content: "\f2f1"; } - -.fa-syringe:before { - content: "\f48e"; } - -.fa-table:before { - content: "\f0ce"; } - -.fa-table-tennis:before { - content: "\f45d"; } - -.fa-tablet:before { - content: "\f10a"; } - -.fa-tablet-alt:before { - content: "\f3fa"; } - -.fa-tablets:before { - content: "\f490"; } - -.fa-tachometer-alt:before { - content: "\f3fd"; } - -.fa-tag:before { - content: "\f02b"; } - -.fa-tags:before { - content: "\f02c"; } - -.fa-tape:before { - content: "\f4db"; } - -.fa-tasks:before { - content: "\f0ae"; } - -.fa-taxi:before { - content: "\f1ba"; } - -.fa-teamspeak:before { - content: "\f4f9"; } - -.fa-teeth:before { - content: "\f62e"; } - -.fa-teeth-open:before { - content: "\f62f"; } - -.fa-telegram:before { - content: "\f2c6"; } - -.fa-telegram-plane:before { - content: "\f3fe"; } - -.fa-temperature-high:before { - content: "\f769"; } - -.fa-temperature-low:before { - content: "\f76b"; } - -.fa-tencent-weibo:before { - content: "\f1d5"; } - -.fa-tenge:before { - content: "\f7d7"; } - -.fa-terminal:before { - content: "\f120"; } - -.fa-text-height:before { - content: "\f034"; } - -.fa-text-width:before { - content: "\f035"; } - -.fa-th:before { - content: "\f00a"; } - -.fa-th-large:before { - content: "\f009"; } - -.fa-th-list:before { - content: "\f00b"; } - -.fa-the-red-yeti:before { - content: "\f69d"; } - -.fa-theater-masks:before { - content: "\f630"; } - -.fa-themeco:before { - content: "\f5c6"; } - -.fa-themeisle:before { - content: "\f2b2"; } - -.fa-thermometer:before { - content: "\f491"; } - -.fa-thermometer-empty:before { - content: "\f2cb"; } - -.fa-thermometer-full:before { - content: "\f2c7"; } - -.fa-thermometer-half:before { - content: "\f2c9"; } - -.fa-thermometer-quarter:before { - content: "\f2ca"; } - -.fa-thermometer-three-quarters:before { - content: "\f2c8"; } - -.fa-think-peaks:before { - content: "\f731"; } - -.fa-thumbs-down:before { - content: "\f165"; } - -.fa-thumbs-up:before { - content: "\f164"; } - -.fa-thumbtack:before { - content: "\f08d"; } - -.fa-ticket-alt:before { - content: "\f3ff"; } - -.fa-tiktok:before { - content: "\f97b"; } - -.fa-times:before { - content: "\f00d"; } - -.fa-times-circle:before { - content: "\f057"; } - -.fa-tint:before { - content: "\f043"; } - -.fa-tint-slash:before { - content: "\f5c7"; } - -.fa-tired:before { - content: "\f5c8"; } - -.fa-toggle-off:before { - content: "\f204"; } - -.fa-toggle-on:before { - content: "\f205"; } - -.fa-toilet:before { - content: "\f7d8"; } - -.fa-toilet-paper:before { - content: "\f71e"; } - -.fa-toilet-paper-slash:before { - content: "\f972"; } - -.fa-toolbox:before { - content: "\f552"; } - -.fa-tools:before { - content: "\f7d9"; } - -.fa-tooth:before { - content: "\f5c9"; } - -.fa-torah:before { - content: "\f6a0"; } - -.fa-torii-gate:before { - content: "\f6a1"; } - -.fa-tractor:before { - content: "\f722"; } - -.fa-trade-federation:before { - content: "\f513"; } - -.fa-trademark:before { - content: "\f25c"; } - -.fa-traffic-light:before { - content: "\f637"; } - -.fa-trailer:before { - content: "\f941"; } - -.fa-train:before { - content: "\f238"; } - -.fa-tram:before { - content: "\f7da"; } - -.fa-transgender:before { - content: "\f224"; } - -.fa-transgender-alt:before { - content: "\f225"; } - -.fa-trash:before { - content: "\f1f8"; } - -.fa-trash-alt:before { - content: "\f2ed"; } - -.fa-trash-restore:before { - content: "\f829"; } - -.fa-trash-restore-alt:before { - content: "\f82a"; } - -.fa-tree:before { - content: "\f1bb"; } - -.fa-trello:before { - content: "\f181"; } - -.fa-tripadvisor:before { - content: "\f262"; } - -.fa-trophy:before { - content: "\f091"; } - -.fa-truck:before { - content: "\f0d1"; } - -.fa-truck-loading:before { - content: "\f4de"; } - -.fa-truck-monster:before { - content: "\f63b"; } - -.fa-truck-moving:before { - content: "\f4df"; } - -.fa-truck-pickup:before { - content: "\f63c"; } - -.fa-tshirt:before { - content: "\f553"; } - -.fa-tty:before { - content: "\f1e4"; } - -.fa-tumblr:before { - content: "\f173"; } - -.fa-tumblr-square:before { - content: "\f174"; } - -.fa-tv:before { - content: "\f26c"; } - -.fa-twitch:before { - content: "\f1e8"; } - -.fa-twitter:before { - content: "\f099"; } - -.fa-twitter-square:before { - content: "\f081"; } - -.fa-typo3:before { - content: "\f42b"; } - -.fa-uber:before { - content: "\f402"; } - -.fa-ubuntu:before { - content: "\f7df"; } - -.fa-uikit:before { - content: "\f403"; } - -.fa-umbraco:before { - content: "\f8e8"; } - -.fa-umbrella:before { - content: "\f0e9"; } - -.fa-umbrella-beach:before { - content: "\f5ca"; } - -.fa-underline:before { - content: "\f0cd"; } - -.fa-undo:before { - content: "\f0e2"; } - -.fa-undo-alt:before { - content: "\f2ea"; } - -.fa-uniregistry:before { - content: "\f404"; } - -.fa-unity:before { - content: "\f949"; } - -.fa-universal-access:before { - content: "\f29a"; } - -.fa-university:before { - content: "\f19c"; } - -.fa-unlink:before { - content: "\f127"; } - -.fa-unlock:before { - content: "\f09c"; } - -.fa-unlock-alt:before { - content: "\f13e"; } - -.fa-unsplash:before { - content: "\f97c"; } - -.fa-untappd:before { - content: "\f405"; } - -.fa-upload:before { - content: "\f093"; } - -.fa-ups:before { - content: "\f7e0"; } - -.fa-usb:before { - content: "\f287"; } - -.fa-user:before { - content: "\f007"; } - -.fa-user-alt:before { - content: "\f406"; } - -.fa-user-alt-slash:before { - content: "\f4fa"; } - -.fa-user-astronaut:before { - content: "\f4fb"; } - -.fa-user-check:before { - content: "\f4fc"; } - -.fa-user-circle:before { - content: "\f2bd"; } - -.fa-user-clock:before { - content: "\f4fd"; } - -.fa-user-cog:before { - content: "\f4fe"; } - -.fa-user-edit:before { - content: "\f4ff"; } - -.fa-user-friends:before { - content: "\f500"; } - -.fa-user-graduate:before { - content: "\f501"; } - -.fa-user-injured:before { - content: "\f728"; } - -.fa-user-lock:before { - content: "\f502"; } - -.fa-user-md:before { - content: "\f0f0"; } - -.fa-user-minus:before { - content: "\f503"; } - -.fa-user-ninja:before { - content: "\f504"; } - -.fa-user-nurse:before { - content: "\f82f"; } - -.fa-user-plus:before { - content: "\f234"; } - -.fa-user-secret:before { - content: "\f21b"; } - -.fa-user-shield:before { - content: "\f505"; } - -.fa-user-slash:before { - content: "\f506"; } - -.fa-user-tag:before { - content: "\f507"; } - -.fa-user-tie:before { - content: "\f508"; } - -.fa-user-times:before { - content: "\f235"; } - -.fa-users:before { - content: "\f0c0"; } - -.fa-users-cog:before { - content: "\f509"; } - -.fa-users-slash:before { - content: "\f973"; } - -.fa-usps:before { - content: "\f7e1"; } - -.fa-ussunnah:before { - content: "\f407"; } - -.fa-utensil-spoon:before { - content: "\f2e5"; } - -.fa-utensils:before { - content: "\f2e7"; } - -.fa-vaadin:before { - content: "\f408"; } - -.fa-vector-square:before { - content: "\f5cb"; } - -.fa-venus:before { - content: "\f221"; } - -.fa-venus-double:before { - content: "\f226"; } - -.fa-venus-mars:before { - content: "\f228"; } - -.fa-viacoin:before { - content: "\f237"; } - -.fa-viadeo:before { - content: "\f2a9"; } - -.fa-viadeo-square:before { - content: "\f2aa"; } - -.fa-vial:before { - content: "\f492"; } - -.fa-vials:before { - content: "\f493"; } - -.fa-viber:before { - content: "\f409"; } - -.fa-video:before { - content: "\f03d"; } - -.fa-video-slash:before { - content: "\f4e2"; } - -.fa-vihara:before { - content: "\f6a7"; } - -.fa-vimeo:before { - content: "\f40a"; } - -.fa-vimeo-square:before { - content: "\f194"; } - -.fa-vimeo-v:before { - content: "\f27d"; } - -.fa-vine:before { - content: "\f1ca"; } - -.fa-virus:before { - content: "\f974"; } - -.fa-virus-slash:before { - content: "\f975"; } - -.fa-viruses:before { - content: "\f976"; } - -.fa-vk:before { - content: "\f189"; } - -.fa-vnv:before { - content: "\f40b"; } - -.fa-voicemail:before { - content: "\f897"; } - -.fa-volleyball-ball:before { - content: "\f45f"; } - -.fa-volume-down:before { - content: "\f027"; } - -.fa-volume-mute:before { - content: "\f6a9"; } - -.fa-volume-off:before { - content: "\f026"; } - -.fa-volume-up:before { - content: "\f028"; } - -.fa-vote-yea:before { - content: "\f772"; } - -.fa-vr-cardboard:before { - content: "\f729"; } - -.fa-vuejs:before { - content: "\f41f"; } - -.fa-walking:before { - content: "\f554"; } - -.fa-wallet:before { - content: "\f555"; } - -.fa-warehouse:before { - content: "\f494"; } - -.fa-water:before { - content: "\f773"; } - -.fa-wave-square:before { - content: "\f83e"; } - -.fa-waze:before { - content: "\f83f"; } - -.fa-weebly:before { - content: "\f5cc"; } - -.fa-weibo:before { - content: "\f18a"; } - -.fa-weight:before { - content: "\f496"; } - -.fa-weight-hanging:before { - content: "\f5cd"; } - -.fa-weixin:before { - content: "\f1d7"; } - -.fa-whatsapp:before { - content: "\f232"; } - -.fa-whatsapp-square:before { - content: "\f40c"; } - -.fa-wheelchair:before { - content: "\f193"; } - -.fa-whmcs:before { - content: "\f40d"; } - -.fa-wifi:before { - content: "\f1eb"; } - -.fa-wikipedia-w:before { - content: "\f266"; } - -.fa-wind:before { - content: "\f72e"; } - -.fa-window-close:before { - content: "\f410"; } - -.fa-window-maximize:before { - content: "\f2d0"; } - -.fa-window-minimize:before { - content: "\f2d1"; } - -.fa-window-restore:before { - content: "\f2d2"; } - -.fa-windows:before { - content: "\f17a"; } - -.fa-wine-bottle:before { - content: "\f72f"; } - -.fa-wine-glass:before { - content: "\f4e3"; } - -.fa-wine-glass-alt:before { - content: "\f5ce"; } - -.fa-wix:before { - content: "\f5cf"; } - -.fa-wizards-of-the-coast:before { - content: "\f730"; } - -.fa-wolf-pack-battalion:before { - content: "\f514"; } - -.fa-won-sign:before { - content: "\f159"; } - -.fa-wordpress:before { - content: "\f19a"; } - -.fa-wordpress-simple:before { - content: "\f411"; } - -.fa-wpbeginner:before { - content: "\f297"; } - -.fa-wpexplorer:before { - content: "\f2de"; } - -.fa-wpforms:before { - content: "\f298"; } - -.fa-wpressr:before { - content: "\f3e4"; } - -.fa-wrench:before { - content: "\f0ad"; } - -.fa-x-ray:before { - content: "\f497"; } - -.fa-xbox:before { - content: "\f412"; } - -.fa-xing:before { - content: "\f168"; } - -.fa-xing-square:before { - content: "\f169"; } - -.fa-y-combinator:before { - content: "\f23b"; } - -.fa-yahoo:before { - content: "\f19e"; } - -.fa-yammer:before { - content: "\f840"; } - -.fa-yandex:before { - content: "\f413"; } - -.fa-yandex-international:before { - content: "\f414"; } - -.fa-yarn:before { - content: "\f7e3"; } - -.fa-yelp:before { - content: "\f1e9"; } - -.fa-yen-sign:before { - content: "\f157"; } - -.fa-yin-yang:before { - content: "\f6ad"; } - -.fa-yoast:before { - content: "\f2b1"; } - -.fa-youtube:before { - content: "\f167"; } - -.fa-youtube-square:before { - content: "\f431"; } - -.fa-zhihu:before { - content: "\f63f"; } - -.sr-only { - border: 0; - clip: rect(0, 0, 0, 0); - height: 1px; - margin: -1px; - overflow: hidden; - padding: 0; - position: absolute; - width: 1px; } - -.sr-only-focusable:active, .sr-only-focusable:focus { - clip: auto; - height: auto; - margin: 0; - overflow: visible; - position: static; - width: auto; } -@font-face { - font-family: 'Font Awesome 5 Brands'; - font-style: normal; - font-weight: 400; - font-display: block; - src: url("../webfonts/fa-brands-400.eot"); - src: url("../webfonts/fa-brands-400.eot?#iefix") format("embedded-opentype"), url("../webfonts/fa-brands-400.woff2") format("woff2"), url("../webfonts/fa-brands-400.woff") format("woff"), url("../webfonts/fa-brands-400.ttf") format("truetype"), url("../webfonts/fa-brands-400.svg#fontawesome") format("svg"); } - -.fab { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } -@font-face { - font-family: 'Font Awesome 5 Free'; - font-style: normal; - font-weight: 400; - font-display: block; - src: url("../webfonts/fa-regular-400.eot"); - src: url("../webfonts/fa-regular-400.eot?#iefix") format("embedded-opentype"), url("../webfonts/fa-regular-400.woff2") format("woff2"), url("../webfonts/fa-regular-400.woff") format("woff"), url("../webfonts/fa-regular-400.ttf") format("truetype"), url("../webfonts/fa-regular-400.svg#fontawesome") format("svg"); } - -.far { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } -@font-face { - font-family: 'Font Awesome 5 Free'; - font-style: normal; - font-weight: 900; - font-display: block; - src: url("../webfonts/fa-solid-900.eot"); - src: url("../webfonts/fa-solid-900.eot?#iefix") format("embedded-opentype"), url("../webfonts/fa-solid-900.woff2") format("woff2"), url("../webfonts/fa-solid-900.woff") format("woff"), url("../webfonts/fa-solid-900.ttf") format("truetype"), url("../webfonts/fa-solid-900.svg#fontawesome") format("svg"); } - -.fa, -.fas { - font-family: 'Font Awesome 5 Free'; - font-weight: 900; } +/*! + * Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com + * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) + * Copyright 2024 Fonticons, Inc. + */ +.fa { + font-family: var(--fa-style-family, "Font Awesome 6 Free"); + font-weight: var(--fa-style, 900); } + +.fa, +.fa-classic, +.fa-sharp, +.fas, +.fa-solid, +.far, +.fa-regular, +.fab, +.fa-brands { + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + display: var(--fa-display, inline-block); + font-style: normal; + font-variant: normal; + line-height: 1; + text-rendering: auto; } + +.fas, +.fa-classic, +.fa-solid, +.far, +.fa-regular { + font-family: 'Font Awesome 6 Free'; } + +.fab, +.fa-brands { + font-family: 'Font Awesome 6 Brands'; } + +.fa-1x { + font-size: 1em; } + +.fa-2x { + font-size: 2em; } + +.fa-3x { + font-size: 3em; } + +.fa-4x { + font-size: 4em; } + +.fa-5x { + font-size: 5em; } + +.fa-6x { + font-size: 6em; } + +.fa-7x { + font-size: 7em; } + +.fa-8x { + font-size: 8em; } + +.fa-9x { + font-size: 9em; } + +.fa-10x { + font-size: 10em; } + +.fa-2xs { + font-size: 0.625em; + line-height: 0.1em; + vertical-align: 0.225em; } + +.fa-xs { + font-size: 0.75em; + line-height: 0.08333em; + vertical-align: 0.125em; } + +.fa-sm { + font-size: 0.875em; + line-height: 0.07143em; + vertical-align: 0.05357em; } + +.fa-lg { + font-size: 1.25em; + line-height: 0.05em; + vertical-align: -0.075em; } + +.fa-xl { + font-size: 1.5em; + line-height: 0.04167em; + vertical-align: -0.125em; } + +.fa-2xl { + font-size: 2em; + line-height: 0.03125em; + vertical-align: -0.1875em; } + +.fa-fw { + text-align: center; + width: 1.25em; } + +.fa-ul { + list-style-type: none; + margin-left: var(--fa-li-margin, 2.5em); + padding-left: 0; } + .fa-ul > li { + position: relative; } + +.fa-li { + left: calc(var(--fa-li-width, 2em) * -1); + position: absolute; + text-align: center; + width: var(--fa-li-width, 2em); + line-height: inherit; } + +.fa-border { + border-color: var(--fa-border-color, #eee); + border-radius: var(--fa-border-radius, 0.1em); + border-style: var(--fa-border-style, solid); + border-width: var(--fa-border-width, 0.08em); + padding: var(--fa-border-padding, 0.2em 0.25em 0.15em); } + +.fa-pull-left { + float: left; + margin-right: var(--fa-pull-margin, 0.3em); } + +.fa-pull-right { + float: right; + margin-left: var(--fa-pull-margin, 0.3em); } + +.fa-beat { + -webkit-animation-name: fa-beat; + animation-name: fa-beat; + -webkit-animation-delay: var(--fa-animation-delay, 0s); + animation-delay: var(--fa-animation-delay, 0s); + -webkit-animation-direction: var(--fa-animation-direction, normal); + animation-direction: var(--fa-animation-direction, normal); + -webkit-animation-duration: var(--fa-animation-duration, 1s); + animation-duration: var(--fa-animation-duration, 1s); + -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + -webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out); + animation-timing-function: var(--fa-animation-timing, ease-in-out); } + +.fa-bounce { + -webkit-animation-name: fa-bounce; + animation-name: fa-bounce; + -webkit-animation-delay: var(--fa-animation-delay, 0s); + animation-delay: var(--fa-animation-delay, 0s); + -webkit-animation-direction: var(--fa-animation-direction, normal); + animation-direction: var(--fa-animation-direction, normal); + -webkit-animation-duration: var(--fa-animation-duration, 1s); + animation-duration: var(--fa-animation-duration, 1s); + -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1)); + animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1)); } + +.fa-fade { + -webkit-animation-name: fa-fade; + animation-name: fa-fade; + -webkit-animation-delay: var(--fa-animation-delay, 0s); + animation-delay: var(--fa-animation-delay, 0s); + -webkit-animation-direction: var(--fa-animation-direction, normal); + animation-direction: var(--fa-animation-direction, normal); + -webkit-animation-duration: var(--fa-animation-duration, 1s); + animation-duration: var(--fa-animation-duration, 1s); + -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); + animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); } + +.fa-beat-fade { + -webkit-animation-name: fa-beat-fade; + animation-name: fa-beat-fade; + -webkit-animation-delay: var(--fa-animation-delay, 0s); + animation-delay: var(--fa-animation-delay, 0s); + -webkit-animation-direction: var(--fa-animation-direction, normal); + animation-direction: var(--fa-animation-direction, normal); + -webkit-animation-duration: var(--fa-animation-duration, 1s); + animation-duration: var(--fa-animation-duration, 1s); + -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); + animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); } + +.fa-flip { + -webkit-animation-name: fa-flip; + animation-name: fa-flip; + -webkit-animation-delay: var(--fa-animation-delay, 0s); + animation-delay: var(--fa-animation-delay, 0s); + -webkit-animation-direction: var(--fa-animation-direction, normal); + animation-direction: var(--fa-animation-direction, normal); + -webkit-animation-duration: var(--fa-animation-duration, 1s); + animation-duration: var(--fa-animation-duration, 1s); + -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + -webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out); + animation-timing-function: var(--fa-animation-timing, ease-in-out); } + +.fa-shake { + -webkit-animation-name: fa-shake; + animation-name: fa-shake; + -webkit-animation-delay: var(--fa-animation-delay, 0s); + animation-delay: var(--fa-animation-delay, 0s); + -webkit-animation-direction: var(--fa-animation-direction, normal); + animation-direction: var(--fa-animation-direction, normal); + -webkit-animation-duration: var(--fa-animation-duration, 1s); + animation-duration: var(--fa-animation-duration, 1s); + -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + -webkit-animation-timing-function: var(--fa-animation-timing, linear); + animation-timing-function: var(--fa-animation-timing, linear); } + +.fa-spin { + -webkit-animation-name: fa-spin; + animation-name: fa-spin; + -webkit-animation-delay: var(--fa-animation-delay, 0s); + animation-delay: var(--fa-animation-delay, 0s); + -webkit-animation-direction: var(--fa-animation-direction, normal); + animation-direction: var(--fa-animation-direction, normal); + -webkit-animation-duration: var(--fa-animation-duration, 2s); + animation-duration: var(--fa-animation-duration, 2s); + -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + -webkit-animation-timing-function: var(--fa-animation-timing, linear); + animation-timing-function: var(--fa-animation-timing, linear); } + +.fa-spin-reverse { + --fa-animation-direction: reverse; } + +.fa-pulse, +.fa-spin-pulse { + -webkit-animation-name: fa-spin; + animation-name: fa-spin; + -webkit-animation-direction: var(--fa-animation-direction, normal); + animation-direction: var(--fa-animation-direction, normal); + -webkit-animation-duration: var(--fa-animation-duration, 1s); + animation-duration: var(--fa-animation-duration, 1s); + -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + -webkit-animation-timing-function: var(--fa-animation-timing, steps(8)); + animation-timing-function: var(--fa-animation-timing, steps(8)); } + +@media (prefers-reduced-motion: reduce) { + .fa-beat, + .fa-bounce, + .fa-fade, + .fa-beat-fade, + .fa-flip, + .fa-pulse, + .fa-shake, + .fa-spin, + .fa-spin-pulse { + -webkit-animation-delay: -1ms; + animation-delay: -1ms; + -webkit-animation-duration: 1ms; + animation-duration: 1ms; + -webkit-animation-iteration-count: 1; + animation-iteration-count: 1; + -webkit-transition-delay: 0s; + transition-delay: 0s; + -webkit-transition-duration: 0s; + transition-duration: 0s; } } + +@-webkit-keyframes fa-beat { + 0%, 90% { + -webkit-transform: scale(1); + transform: scale(1); } + 45% { + -webkit-transform: scale(var(--fa-beat-scale, 1.25)); + transform: scale(var(--fa-beat-scale, 1.25)); } } + +@keyframes fa-beat { + 0%, 90% { + -webkit-transform: scale(1); + transform: scale(1); } + 45% { + -webkit-transform: scale(var(--fa-beat-scale, 1.25)); + transform: scale(var(--fa-beat-scale, 1.25)); } } + +@-webkit-keyframes fa-bounce { + 0% { + -webkit-transform: scale(1, 1) translateY(0); + transform: scale(1, 1) translateY(0); } + 10% { + -webkit-transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); + transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); } + 30% { + -webkit-transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); + transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); } + 50% { + -webkit-transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); + transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); } + 57% { + -webkit-transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); + transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); } + 64% { + -webkit-transform: scale(1, 1) translateY(0); + transform: scale(1, 1) translateY(0); } + 100% { + -webkit-transform: scale(1, 1) translateY(0); + transform: scale(1, 1) translateY(0); } } + +@keyframes fa-bounce { + 0% { + -webkit-transform: scale(1, 1) translateY(0); + transform: scale(1, 1) translateY(0); } + 10% { + -webkit-transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); + transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); } + 30% { + -webkit-transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); + transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); } + 50% { + -webkit-transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); + transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); } + 57% { + -webkit-transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); + transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); } + 64% { + -webkit-transform: scale(1, 1) translateY(0); + transform: scale(1, 1) translateY(0); } + 100% { + -webkit-transform: scale(1, 1) translateY(0); + transform: scale(1, 1) translateY(0); } } + +@-webkit-keyframes fa-fade { + 50% { + opacity: var(--fa-fade-opacity, 0.4); } } + +@keyframes fa-fade { + 50% { + opacity: var(--fa-fade-opacity, 0.4); } } + +@-webkit-keyframes fa-beat-fade { + 0%, 100% { + opacity: var(--fa-beat-fade-opacity, 0.4); + -webkit-transform: scale(1); + transform: scale(1); } + 50% { + opacity: 1; + -webkit-transform: scale(var(--fa-beat-fade-scale, 1.125)); + transform: scale(var(--fa-beat-fade-scale, 1.125)); } } + +@keyframes fa-beat-fade { + 0%, 100% { + opacity: var(--fa-beat-fade-opacity, 0.4); + -webkit-transform: scale(1); + transform: scale(1); } + 50% { + opacity: 1; + -webkit-transform: scale(var(--fa-beat-fade-scale, 1.125)); + transform: scale(var(--fa-beat-fade-scale, 1.125)); } } + +@-webkit-keyframes fa-flip { + 50% { + -webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); + transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); } } + +@keyframes fa-flip { + 50% { + -webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); + transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); } } + +@-webkit-keyframes fa-shake { + 0% { + -webkit-transform: rotate(-15deg); + transform: rotate(-15deg); } + 4% { + -webkit-transform: rotate(15deg); + transform: rotate(15deg); } + 8%, 24% { + -webkit-transform: rotate(-18deg); + transform: rotate(-18deg); } + 12%, 28% { + -webkit-transform: rotate(18deg); + transform: rotate(18deg); } + 16% { + -webkit-transform: rotate(-22deg); + transform: rotate(-22deg); } + 20% { + -webkit-transform: rotate(22deg); + transform: rotate(22deg); } + 32% { + -webkit-transform: rotate(-12deg); + transform: rotate(-12deg); } + 36% { + -webkit-transform: rotate(12deg); + transform: rotate(12deg); } + 40%, 100% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); } } + +@keyframes fa-shake { + 0% { + -webkit-transform: rotate(-15deg); + transform: rotate(-15deg); } + 4% { + -webkit-transform: rotate(15deg); + transform: rotate(15deg); } + 8%, 24% { + -webkit-transform: rotate(-18deg); + transform: rotate(-18deg); } + 12%, 28% { + -webkit-transform: rotate(18deg); + transform: rotate(18deg); } + 16% { + -webkit-transform: rotate(-22deg); + transform: rotate(-22deg); } + 20% { + -webkit-transform: rotate(22deg); + transform: rotate(22deg); } + 32% { + -webkit-transform: rotate(-12deg); + transform: rotate(-12deg); } + 36% { + -webkit-transform: rotate(12deg); + transform: rotate(12deg); } + 40%, 100% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); } } + +@-webkit-keyframes fa-spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); } + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); } } + +@keyframes fa-spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); } + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); } } + +.fa-rotate-90 { + -webkit-transform: rotate(90deg); + transform: rotate(90deg); } + +.fa-rotate-180 { + -webkit-transform: rotate(180deg); + transform: rotate(180deg); } + +.fa-rotate-270 { + -webkit-transform: rotate(270deg); + transform: rotate(270deg); } + +.fa-flip-horizontal { + -webkit-transform: scale(-1, 1); + transform: scale(-1, 1); } + +.fa-flip-vertical { + -webkit-transform: scale(1, -1); + transform: scale(1, -1); } + +.fa-flip-both, +.fa-flip-horizontal.fa-flip-vertical { + -webkit-transform: scale(-1, -1); + transform: scale(-1, -1); } + +.fa-rotate-by { + -webkit-transform: rotate(var(--fa-rotate-angle, 0)); + transform: rotate(var(--fa-rotate-angle, 0)); } + +.fa-stack { + display: inline-block; + height: 2em; + line-height: 2em; + position: relative; + vertical-align: middle; + width: 2.5em; } + +.fa-stack-1x, +.fa-stack-2x { + left: 0; + position: absolute; + text-align: center; + width: 100%; + z-index: var(--fa-stack-z-index, auto); } + +.fa-stack-1x { + line-height: inherit; } + +.fa-stack-2x { + font-size: 2em; } + +.fa-inverse { + color: var(--fa-inverse, #fff); } + +/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen +readers do not read off random characters that represent icons */ + +.fa-0::before { + content: "\30"; } + +.fa-1::before { + content: "\31"; } + +.fa-2::before { + content: "\32"; } + +.fa-3::before { + content: "\33"; } + +.fa-4::before { + content: "\34"; } + +.fa-5::before { + content: "\35"; } + +.fa-6::before { + content: "\36"; } + +.fa-7::before { + content: "\37"; } + +.fa-8::before { + content: "\38"; } + +.fa-9::before { + content: "\39"; } + +.fa-fill-drip::before { + content: "\f576"; } + +.fa-arrows-to-circle::before { + content: "\e4bd"; } + +.fa-circle-chevron-right::before { + content: "\f138"; } + +.fa-chevron-circle-right::before { + content: "\f138"; } + +.fa-at::before { + content: "\40"; } + +.fa-trash-can::before { + content: "\f2ed"; } + +.fa-trash-alt::before { + content: "\f2ed"; } + +.fa-text-height::before { + content: "\f034"; } + +.fa-user-xmark::before { + content: "\f235"; } + +.fa-user-times::before { + content: "\f235"; } + +.fa-stethoscope::before { + content: "\f0f1"; } + +.fa-message::before { + content: "\f27a"; } + +.fa-comment-alt::before { + content: "\f27a"; } + +.fa-info::before { + content: "\f129"; } + +.fa-down-left-and-up-right-to-center::before { + content: "\f422"; } + +.fa-compress-alt::before { + content: "\f422"; } + +.fa-explosion::before { + content: "\e4e9"; } + +.fa-file-lines::before { + content: "\f15c"; } + +.fa-file-alt::before { + content: "\f15c"; } + +.fa-file-text::before { + content: "\f15c"; } + +.fa-wave-square::before { + content: "\f83e"; } + +.fa-ring::before { + content: "\f70b"; } + +.fa-building-un::before { + content: "\e4d9"; } + +.fa-dice-three::before { + content: "\f527"; } + +.fa-calendar-days::before { + content: "\f073"; } + +.fa-calendar-alt::before { + content: "\f073"; } + +.fa-anchor-circle-check::before { + content: "\e4aa"; } + +.fa-building-circle-arrow-right::before { + content: "\e4d1"; } + +.fa-volleyball::before { + content: "\f45f"; } + +.fa-volleyball-ball::before { + content: "\f45f"; } + +.fa-arrows-up-to-line::before { + content: "\e4c2"; } + +.fa-sort-down::before { + content: "\f0dd"; } + +.fa-sort-desc::before { + content: "\f0dd"; } + +.fa-circle-minus::before { + content: "\f056"; } + +.fa-minus-circle::before { + content: "\f056"; } + +.fa-door-open::before { + content: "\f52b"; } + +.fa-right-from-bracket::before { + content: "\f2f5"; } + +.fa-sign-out-alt::before { + content: "\f2f5"; } + +.fa-atom::before { + content: "\f5d2"; } + +.fa-soap::before { + content: "\e06e"; } + +.fa-icons::before { + content: "\f86d"; } + +.fa-heart-music-camera-bolt::before { + content: "\f86d"; } + +.fa-microphone-lines-slash::before { + content: "\f539"; } + +.fa-microphone-alt-slash::before { + content: "\f539"; } + +.fa-bridge-circle-check::before { + content: "\e4c9"; } + +.fa-pump-medical::before { + content: "\e06a"; } + +.fa-fingerprint::before { + content: "\f577"; } + +.fa-hand-point-right::before { + content: "\f0a4"; } + +.fa-magnifying-glass-location::before { + content: "\f689"; } + +.fa-search-location::before { + content: "\f689"; } + +.fa-forward-step::before { + content: "\f051"; } + +.fa-step-forward::before { + content: "\f051"; } + +.fa-face-smile-beam::before { + content: "\f5b8"; } + +.fa-smile-beam::before { + content: "\f5b8"; } + +.fa-flag-checkered::before { + content: "\f11e"; } + +.fa-football::before { + content: "\f44e"; } + +.fa-football-ball::before { + content: "\f44e"; } + +.fa-school-circle-exclamation::before { + content: "\e56c"; } + +.fa-crop::before { + content: "\f125"; } + +.fa-angles-down::before { + content: "\f103"; } + +.fa-angle-double-down::before { + content: "\f103"; } + +.fa-users-rectangle::before { + content: "\e594"; } + +.fa-people-roof::before { + content: "\e537"; } + +.fa-people-line::before { + content: "\e534"; } + +.fa-beer-mug-empty::before { + content: "\f0fc"; } + +.fa-beer::before { + content: "\f0fc"; } + +.fa-diagram-predecessor::before { + content: "\e477"; } + +.fa-arrow-up-long::before { + content: "\f176"; } + +.fa-long-arrow-up::before { + content: "\f176"; } + +.fa-fire-flame-simple::before { + content: "\f46a"; } + +.fa-burn::before { + content: "\f46a"; } + +.fa-person::before { + content: "\f183"; } + +.fa-male::before { + content: "\f183"; } + +.fa-laptop::before { + content: "\f109"; } + +.fa-file-csv::before { + content: "\f6dd"; } + +.fa-menorah::before { + content: "\f676"; } + +.fa-truck-plane::before { + content: "\e58f"; } + +.fa-record-vinyl::before { + content: "\f8d9"; } + +.fa-face-grin-stars::before { + content: "\f587"; } + +.fa-grin-stars::before { + content: "\f587"; } + +.fa-bong::before { + content: "\f55c"; } + +.fa-spaghetti-monster-flying::before { + content: "\f67b"; } + +.fa-pastafarianism::before { + content: "\f67b"; } + +.fa-arrow-down-up-across-line::before { + content: "\e4af"; } + +.fa-spoon::before { + content: "\f2e5"; } + +.fa-utensil-spoon::before { + content: "\f2e5"; } + +.fa-jar-wheat::before { + content: "\e517"; } + +.fa-envelopes-bulk::before { + content: "\f674"; } + +.fa-mail-bulk::before { + content: "\f674"; } + +.fa-file-circle-exclamation::before { + content: "\e4eb"; } + +.fa-circle-h::before { + content: "\f47e"; } + +.fa-hospital-symbol::before { + content: "\f47e"; } + +.fa-pager::before { + content: "\f815"; } + +.fa-address-book::before { + content: "\f2b9"; } + +.fa-contact-book::before { + content: "\f2b9"; } + +.fa-strikethrough::before { + content: "\f0cc"; } + +.fa-k::before { + content: "\4b"; } + +.fa-landmark-flag::before { + content: "\e51c"; } + +.fa-pencil::before { + content: "\f303"; } + +.fa-pencil-alt::before { + content: "\f303"; } + +.fa-backward::before { + content: "\f04a"; } + +.fa-caret-right::before { + content: "\f0da"; } + +.fa-comments::before { + content: "\f086"; } + +.fa-paste::before { + content: "\f0ea"; } + +.fa-file-clipboard::before { + content: "\f0ea"; } + +.fa-code-pull-request::before { + content: "\e13c"; } + +.fa-clipboard-list::before { + content: "\f46d"; } + +.fa-truck-ramp-box::before { + content: "\f4de"; } + +.fa-truck-loading::before { + content: "\f4de"; } + +.fa-user-check::before { + content: "\f4fc"; } + +.fa-vial-virus::before { + content: "\e597"; } + +.fa-sheet-plastic::before { + content: "\e571"; } + +.fa-blog::before { + content: "\f781"; } + +.fa-user-ninja::before { + content: "\f504"; } + +.fa-person-arrow-up-from-line::before { + content: "\e539"; } + +.fa-scroll-torah::before { + content: "\f6a0"; } + +.fa-torah::before { + content: "\f6a0"; } + +.fa-broom-ball::before { + content: "\f458"; } + +.fa-quidditch::before { + content: "\f458"; } + +.fa-quidditch-broom-ball::before { + content: "\f458"; } + +.fa-toggle-off::before { + content: "\f204"; } + +.fa-box-archive::before { + content: "\f187"; } + +.fa-archive::before { + content: "\f187"; } + +.fa-person-drowning::before { + content: "\e545"; } + +.fa-arrow-down-9-1::before { + content: "\f886"; } + +.fa-sort-numeric-desc::before { + content: "\f886"; } + +.fa-sort-numeric-down-alt::before { + content: "\f886"; } + +.fa-face-grin-tongue-squint::before { + content: "\f58a"; } + +.fa-grin-tongue-squint::before { + content: "\f58a"; } + +.fa-spray-can::before { + content: "\f5bd"; } + +.fa-truck-monster::before { + content: "\f63b"; } + +.fa-w::before { + content: "\57"; } + +.fa-earth-africa::before { + content: "\f57c"; } + +.fa-globe-africa::before { + content: "\f57c"; } + +.fa-rainbow::before { + content: "\f75b"; } + +.fa-circle-notch::before { + content: "\f1ce"; } + +.fa-tablet-screen-button::before { + content: "\f3fa"; } + +.fa-tablet-alt::before { + content: "\f3fa"; } + +.fa-paw::before { + content: "\f1b0"; } + +.fa-cloud::before { + content: "\f0c2"; } + +.fa-trowel-bricks::before { + content: "\e58a"; } + +.fa-face-flushed::before { + content: "\f579"; } + +.fa-flushed::before { + content: "\f579"; } + +.fa-hospital-user::before { + content: "\f80d"; } + +.fa-tent-arrow-left-right::before { + content: "\e57f"; } + +.fa-gavel::before { + content: "\f0e3"; } + +.fa-legal::before { + content: "\f0e3"; } + +.fa-binoculars::before { + content: "\f1e5"; } + +.fa-microphone-slash::before { + content: "\f131"; } + +.fa-box-tissue::before { + content: "\e05b"; } + +.fa-motorcycle::before { + content: "\f21c"; } + +.fa-bell-concierge::before { + content: "\f562"; } + +.fa-concierge-bell::before { + content: "\f562"; } + +.fa-pen-ruler::before { + content: "\f5ae"; } + +.fa-pencil-ruler::before { + content: "\f5ae"; } + +.fa-people-arrows::before { + content: "\e068"; } + +.fa-people-arrows-left-right::before { + content: "\e068"; } + +.fa-mars-and-venus-burst::before { + content: "\e523"; } + +.fa-square-caret-right::before { + content: "\f152"; } + +.fa-caret-square-right::before { + content: "\f152"; } + +.fa-scissors::before { + content: "\f0c4"; } + +.fa-cut::before { + content: "\f0c4"; } + +.fa-sun-plant-wilt::before { + content: "\e57a"; } + +.fa-toilets-portable::before { + content: "\e584"; } + +.fa-hockey-puck::before { + content: "\f453"; } + +.fa-table::before { + content: "\f0ce"; } + +.fa-magnifying-glass-arrow-right::before { + content: "\e521"; } + +.fa-tachograph-digital::before { + content: "\f566"; } + +.fa-digital-tachograph::before { + content: "\f566"; } + +.fa-users-slash::before { + content: "\e073"; } + +.fa-clover::before { + content: "\e139"; } + +.fa-reply::before { + content: "\f3e5"; } + +.fa-mail-reply::before { + content: "\f3e5"; } + +.fa-star-and-crescent::before { + content: "\f699"; } + +.fa-house-fire::before { + content: "\e50c"; } + +.fa-square-minus::before { + content: "\f146"; } + +.fa-minus-square::before { + content: "\f146"; } + +.fa-helicopter::before { + content: "\f533"; } + +.fa-compass::before { + content: "\f14e"; } + +.fa-square-caret-down::before { + content: "\f150"; } + +.fa-caret-square-down::before { + content: "\f150"; } + +.fa-file-circle-question::before { + content: "\e4ef"; } + +.fa-laptop-code::before { + content: "\f5fc"; } + +.fa-swatchbook::before { + content: "\f5c3"; } + +.fa-prescription-bottle::before { + content: "\f485"; } + +.fa-bars::before { + content: "\f0c9"; } + +.fa-navicon::before { + content: "\f0c9"; } + +.fa-people-group::before { + content: "\e533"; } + +.fa-hourglass-end::before { + content: "\f253"; } + +.fa-hourglass-3::before { + content: "\f253"; } + +.fa-heart-crack::before { + content: "\f7a9"; } + +.fa-heart-broken::before { + content: "\f7a9"; } + +.fa-square-up-right::before { + content: "\f360"; } + +.fa-external-link-square-alt::before { + content: "\f360"; } + +.fa-face-kiss-beam::before { + content: "\f597"; } + +.fa-kiss-beam::before { + content: "\f597"; } + +.fa-film::before { + content: "\f008"; } + +.fa-ruler-horizontal::before { + content: "\f547"; } + +.fa-people-robbery::before { + content: "\e536"; } + +.fa-lightbulb::before { + content: "\f0eb"; } + +.fa-caret-left::before { + content: "\f0d9"; } + +.fa-circle-exclamation::before { + content: "\f06a"; } + +.fa-exclamation-circle::before { + content: "\f06a"; } + +.fa-school-circle-xmark::before { + content: "\e56d"; } + +.fa-arrow-right-from-bracket::before { + content: "\f08b"; } + +.fa-sign-out::before { + content: "\f08b"; } + +.fa-circle-chevron-down::before { + content: "\f13a"; } + +.fa-chevron-circle-down::before { + content: "\f13a"; } + +.fa-unlock-keyhole::before { + content: "\f13e"; } + +.fa-unlock-alt::before { + content: "\f13e"; } + +.fa-cloud-showers-heavy::before { + content: "\f740"; } + +.fa-headphones-simple::before { + content: "\f58f"; } + +.fa-headphones-alt::before { + content: "\f58f"; } + +.fa-sitemap::before { + content: "\f0e8"; } + +.fa-circle-dollar-to-slot::before { + content: "\f4b9"; } + +.fa-donate::before { + content: "\f4b9"; } + +.fa-memory::before { + content: "\f538"; } + +.fa-road-spikes::before { + content: "\e568"; } + +.fa-fire-burner::before { + content: "\e4f1"; } + +.fa-flag::before { + content: "\f024"; } + +.fa-hanukiah::before { + content: "\f6e6"; } + +.fa-feather::before { + content: "\f52d"; } + +.fa-volume-low::before { + content: "\f027"; } + +.fa-volume-down::before { + content: "\f027"; } + +.fa-comment-slash::before { + content: "\f4b3"; } + +.fa-cloud-sun-rain::before { + content: "\f743"; } + +.fa-compress::before { + content: "\f066"; } + +.fa-wheat-awn::before { + content: "\e2cd"; } + +.fa-wheat-alt::before { + content: "\e2cd"; } + +.fa-ankh::before { + content: "\f644"; } + +.fa-hands-holding-child::before { + content: "\e4fa"; } + +.fa-asterisk::before { + content: "\2a"; } + +.fa-square-check::before { + content: "\f14a"; } + +.fa-check-square::before { + content: "\f14a"; } + +.fa-peseta-sign::before { + content: "\e221"; } + +.fa-heading::before { + content: "\f1dc"; } + +.fa-header::before { + content: "\f1dc"; } + +.fa-ghost::before { + content: "\f6e2"; } + +.fa-list::before { + content: "\f03a"; } + +.fa-list-squares::before { + content: "\f03a"; } + +.fa-square-phone-flip::before { + content: "\f87b"; } + +.fa-phone-square-alt::before { + content: "\f87b"; } + +.fa-cart-plus::before { + content: "\f217"; } + +.fa-gamepad::before { + content: "\f11b"; } + +.fa-circle-dot::before { + content: "\f192"; } + +.fa-dot-circle::before { + content: "\f192"; } + +.fa-face-dizzy::before { + content: "\f567"; } + +.fa-dizzy::before { + content: "\f567"; } + +.fa-egg::before { + content: "\f7fb"; } + +.fa-house-medical-circle-xmark::before { + content: "\e513"; } + +.fa-campground::before { + content: "\f6bb"; } + +.fa-folder-plus::before { + content: "\f65e"; } + +.fa-futbol::before { + content: "\f1e3"; } + +.fa-futbol-ball::before { + content: "\f1e3"; } + +.fa-soccer-ball::before { + content: "\f1e3"; } + +.fa-paintbrush::before { + content: "\f1fc"; } + +.fa-paint-brush::before { + content: "\f1fc"; } + +.fa-lock::before { + content: "\f023"; } + +.fa-gas-pump::before { + content: "\f52f"; } + +.fa-hot-tub-person::before { + content: "\f593"; } + +.fa-hot-tub::before { + content: "\f593"; } + +.fa-map-location::before { + content: "\f59f"; } + +.fa-map-marked::before { + content: "\f59f"; } + +.fa-house-flood-water::before { + content: "\e50e"; } + +.fa-tree::before { + content: "\f1bb"; } + +.fa-bridge-lock::before { + content: "\e4cc"; } + +.fa-sack-dollar::before { + content: "\f81d"; } + +.fa-pen-to-square::before { + content: "\f044"; } + +.fa-edit::before { + content: "\f044"; } + +.fa-car-side::before { + content: "\f5e4"; } + +.fa-share-nodes::before { + content: "\f1e0"; } + +.fa-share-alt::before { + content: "\f1e0"; } + +.fa-heart-circle-minus::before { + content: "\e4ff"; } + +.fa-hourglass-half::before { + content: "\f252"; } + +.fa-hourglass-2::before { + content: "\f252"; } + +.fa-microscope::before { + content: "\f610"; } + +.fa-sink::before { + content: "\e06d"; } + +.fa-bag-shopping::before { + content: "\f290"; } + +.fa-shopping-bag::before { + content: "\f290"; } + +.fa-arrow-down-z-a::before { + content: "\f881"; } + +.fa-sort-alpha-desc::before { + content: "\f881"; } + +.fa-sort-alpha-down-alt::before { + content: "\f881"; } + +.fa-mitten::before { + content: "\f7b5"; } + +.fa-person-rays::before { + content: "\e54d"; } + +.fa-users::before { + content: "\f0c0"; } + +.fa-eye-slash::before { + content: "\f070"; } + +.fa-flask-vial::before { + content: "\e4f3"; } + +.fa-hand::before { + content: "\f256"; } + +.fa-hand-paper::before { + content: "\f256"; } + +.fa-om::before { + content: "\f679"; } + +.fa-worm::before { + content: "\e599"; } + +.fa-house-circle-xmark::before { + content: "\e50b"; } + +.fa-plug::before { + content: "\f1e6"; } + +.fa-chevron-up::before { + content: "\f077"; } + +.fa-hand-spock::before { + content: "\f259"; } + +.fa-stopwatch::before { + content: "\f2f2"; } + +.fa-face-kiss::before { + content: "\f596"; } + +.fa-kiss::before { + content: "\f596"; } + +.fa-bridge-circle-xmark::before { + content: "\e4cb"; } + +.fa-face-grin-tongue::before { + content: "\f589"; } + +.fa-grin-tongue::before { + content: "\f589"; } + +.fa-chess-bishop::before { + content: "\f43a"; } + +.fa-face-grin-wink::before { + content: "\f58c"; } + +.fa-grin-wink::before { + content: "\f58c"; } + +.fa-ear-deaf::before { + content: "\f2a4"; } + +.fa-deaf::before { + content: "\f2a4"; } + +.fa-deafness::before { + content: "\f2a4"; } + +.fa-hard-of-hearing::before { + content: "\f2a4"; } + +.fa-road-circle-check::before { + content: "\e564"; } + +.fa-dice-five::before { + content: "\f523"; } + +.fa-square-rss::before { + content: "\f143"; } + +.fa-rss-square::before { + content: "\f143"; } + +.fa-land-mine-on::before { + content: "\e51b"; } + +.fa-i-cursor::before { + content: "\f246"; } + +.fa-stamp::before { + content: "\f5bf"; } + +.fa-stairs::before { + content: "\e289"; } + +.fa-i::before { + content: "\49"; } + +.fa-hryvnia-sign::before { + content: "\f6f2"; } + +.fa-hryvnia::before { + content: "\f6f2"; } + +.fa-pills::before { + content: "\f484"; } + +.fa-face-grin-wide::before { + content: "\f581"; } + +.fa-grin-alt::before { + content: "\f581"; } + +.fa-tooth::before { + content: "\f5c9"; } + +.fa-v::before { + content: "\56"; } + +.fa-bangladeshi-taka-sign::before { + content: "\e2e6"; } + +.fa-bicycle::before { + content: "\f206"; } + +.fa-staff-snake::before { + content: "\e579"; } + +.fa-rod-asclepius::before { + content: "\e579"; } + +.fa-rod-snake::before { + content: "\e579"; } + +.fa-staff-aesculapius::before { + content: "\e579"; } + +.fa-head-side-cough-slash::before { + content: "\e062"; } + +.fa-truck-medical::before { + content: "\f0f9"; } + +.fa-ambulance::before { + content: "\f0f9"; } + +.fa-wheat-awn-circle-exclamation::before { + content: "\e598"; } + +.fa-snowman::before { + content: "\f7d0"; } + +.fa-mortar-pestle::before { + content: "\f5a7"; } + +.fa-road-barrier::before { + content: "\e562"; } + +.fa-school::before { + content: "\f549"; } + +.fa-igloo::before { + content: "\f7ae"; } + +.fa-joint::before { + content: "\f595"; } + +.fa-angle-right::before { + content: "\f105"; } + +.fa-horse::before { + content: "\f6f0"; } + +.fa-q::before { + content: "\51"; } + +.fa-g::before { + content: "\47"; } + +.fa-notes-medical::before { + content: "\f481"; } + +.fa-temperature-half::before { + content: "\f2c9"; } + +.fa-temperature-2::before { + content: "\f2c9"; } + +.fa-thermometer-2::before { + content: "\f2c9"; } + +.fa-thermometer-half::before { + content: "\f2c9"; } + +.fa-dong-sign::before { + content: "\e169"; } + +.fa-capsules::before { + content: "\f46b"; } + +.fa-poo-storm::before { + content: "\f75a"; } + +.fa-poo-bolt::before { + content: "\f75a"; } + +.fa-face-frown-open::before { + content: "\f57a"; } + +.fa-frown-open::before { + content: "\f57a"; } + +.fa-hand-point-up::before { + content: "\f0a6"; } + +.fa-money-bill::before { + content: "\f0d6"; } + +.fa-bookmark::before { + content: "\f02e"; } + +.fa-align-justify::before { + content: "\f039"; } + +.fa-umbrella-beach::before { + content: "\f5ca"; } + +.fa-helmet-un::before { + content: "\e503"; } + +.fa-bullseye::before { + content: "\f140"; } + +.fa-bacon::before { + content: "\f7e5"; } + +.fa-hand-point-down::before { + content: "\f0a7"; } + +.fa-arrow-up-from-bracket::before { + content: "\e09a"; } + +.fa-folder::before { + content: "\f07b"; } + +.fa-folder-blank::before { + content: "\f07b"; } + +.fa-file-waveform::before { + content: "\f478"; } + +.fa-file-medical-alt::before { + content: "\f478"; } + +.fa-radiation::before { + content: "\f7b9"; } + +.fa-chart-simple::before { + content: "\e473"; } + +.fa-mars-stroke::before { + content: "\f229"; } + +.fa-vial::before { + content: "\f492"; } + +.fa-gauge::before { + content: "\f624"; } + +.fa-dashboard::before { + content: "\f624"; } + +.fa-gauge-med::before { + content: "\f624"; } + +.fa-tachometer-alt-average::before { + content: "\f624"; } + +.fa-wand-magic-sparkles::before { + content: "\e2ca"; } + +.fa-magic-wand-sparkles::before { + content: "\e2ca"; } + +.fa-e::before { + content: "\45"; } + +.fa-pen-clip::before { + content: "\f305"; } + +.fa-pen-alt::before { + content: "\f305"; } + +.fa-bridge-circle-exclamation::before { + content: "\e4ca"; } + +.fa-user::before { + content: "\f007"; } + +.fa-school-circle-check::before { + content: "\e56b"; } + +.fa-dumpster::before { + content: "\f793"; } + +.fa-van-shuttle::before { + content: "\f5b6"; } + +.fa-shuttle-van::before { + content: "\f5b6"; } + +.fa-building-user::before { + content: "\e4da"; } + +.fa-square-caret-left::before { + content: "\f191"; } + +.fa-caret-square-left::before { + content: "\f191"; } + +.fa-highlighter::before { + content: "\f591"; } + +.fa-key::before { + content: "\f084"; } + +.fa-bullhorn::before { + content: "\f0a1"; } + +.fa-globe::before { + content: "\f0ac"; } + +.fa-synagogue::before { + content: "\f69b"; } + +.fa-person-half-dress::before { + content: "\e548"; } + +.fa-road-bridge::before { + content: "\e563"; } + +.fa-location-arrow::before { + content: "\f124"; } + +.fa-c::before { + content: "\43"; } + +.fa-tablet-button::before { + content: "\f10a"; } + +.fa-building-lock::before { + content: "\e4d6"; } + +.fa-pizza-slice::before { + content: "\f818"; } + +.fa-money-bill-wave::before { + content: "\f53a"; } + +.fa-chart-area::before { + content: "\f1fe"; } + +.fa-area-chart::before { + content: "\f1fe"; } + +.fa-house-flag::before { + content: "\e50d"; } + +.fa-person-circle-minus::before { + content: "\e540"; } + +.fa-ban::before { + content: "\f05e"; } + +.fa-cancel::before { + content: "\f05e"; } + +.fa-camera-rotate::before { + content: "\e0d8"; } + +.fa-spray-can-sparkles::before { + content: "\f5d0"; } + +.fa-air-freshener::before { + content: "\f5d0"; } + +.fa-star::before { + content: "\f005"; } + +.fa-repeat::before { + content: "\f363"; } + +.fa-cross::before { + content: "\f654"; } + +.fa-box::before { + content: "\f466"; } + +.fa-venus-mars::before { + content: "\f228"; } + +.fa-arrow-pointer::before { + content: "\f245"; } + +.fa-mouse-pointer::before { + content: "\f245"; } + +.fa-maximize::before { + content: "\f31e"; } + +.fa-expand-arrows-alt::before { + content: "\f31e"; } + +.fa-charging-station::before { + content: "\f5e7"; } + +.fa-shapes::before { + content: "\f61f"; } + +.fa-triangle-circle-square::before { + content: "\f61f"; } + +.fa-shuffle::before { + content: "\f074"; } + +.fa-random::before { + content: "\f074"; } + +.fa-person-running::before { + content: "\f70c"; } + +.fa-running::before { + content: "\f70c"; } + +.fa-mobile-retro::before { + content: "\e527"; } + +.fa-grip-lines-vertical::before { + content: "\f7a5"; } + +.fa-spider::before { + content: "\f717"; } + +.fa-hands-bound::before { + content: "\e4f9"; } + +.fa-file-invoice-dollar::before { + content: "\f571"; } + +.fa-plane-circle-exclamation::before { + content: "\e556"; } + +.fa-x-ray::before { + content: "\f497"; } + +.fa-spell-check::before { + content: "\f891"; } + +.fa-slash::before { + content: "\f715"; } + +.fa-computer-mouse::before { + content: "\f8cc"; } + +.fa-mouse::before { + content: "\f8cc"; } + +.fa-arrow-right-to-bracket::before { + content: "\f090"; } + +.fa-sign-in::before { + content: "\f090"; } + +.fa-shop-slash::before { + content: "\e070"; } + +.fa-store-alt-slash::before { + content: "\e070"; } + +.fa-server::before { + content: "\f233"; } + +.fa-virus-covid-slash::before { + content: "\e4a9"; } + +.fa-shop-lock::before { + content: "\e4a5"; } + +.fa-hourglass-start::before { + content: "\f251"; } + +.fa-hourglass-1::before { + content: "\f251"; } + +.fa-blender-phone::before { + content: "\f6b6"; } + +.fa-building-wheat::before { + content: "\e4db"; } + +.fa-person-breastfeeding::before { + content: "\e53a"; } + +.fa-right-to-bracket::before { + content: "\f2f6"; } + +.fa-sign-in-alt::before { + content: "\f2f6"; } + +.fa-venus::before { + content: "\f221"; } + +.fa-passport::before { + content: "\f5ab"; } + +.fa-heart-pulse::before { + content: "\f21e"; } + +.fa-heartbeat::before { + content: "\f21e"; } + +.fa-people-carry-box::before { + content: "\f4ce"; } + +.fa-people-carry::before { + content: "\f4ce"; } + +.fa-temperature-high::before { + content: "\f769"; } + +.fa-microchip::before { + content: "\f2db"; } + +.fa-crown::before { + content: "\f521"; } + +.fa-weight-hanging::before { + content: "\f5cd"; } + +.fa-xmarks-lines::before { + content: "\e59a"; } + +.fa-file-prescription::before { + content: "\f572"; } + +.fa-weight-scale::before { + content: "\f496"; } + +.fa-weight::before { + content: "\f496"; } + +.fa-user-group::before { + content: "\f500"; } + +.fa-user-friends::before { + content: "\f500"; } + +.fa-arrow-up-a-z::before { + content: "\f15e"; } + +.fa-sort-alpha-up::before { + content: "\f15e"; } + +.fa-chess-knight::before { + content: "\f441"; } + +.fa-face-laugh-squint::before { + content: "\f59b"; } + +.fa-laugh-squint::before { + content: "\f59b"; } + +.fa-wheelchair::before { + content: "\f193"; } + +.fa-circle-arrow-up::before { + content: "\f0aa"; } + +.fa-arrow-circle-up::before { + content: "\f0aa"; } + +.fa-toggle-on::before { + content: "\f205"; } + +.fa-person-walking::before { + content: "\f554"; } + +.fa-walking::before { + content: "\f554"; } + +.fa-l::before { + content: "\4c"; } + +.fa-fire::before { + content: "\f06d"; } + +.fa-bed-pulse::before { + content: "\f487"; } + +.fa-procedures::before { + content: "\f487"; } + +.fa-shuttle-space::before { + content: "\f197"; } + +.fa-space-shuttle::before { + content: "\f197"; } + +.fa-face-laugh::before { + content: "\f599"; } + +.fa-laugh::before { + content: "\f599"; } + +.fa-folder-open::before { + content: "\f07c"; } + +.fa-heart-circle-plus::before { + content: "\e500"; } + +.fa-code-fork::before { + content: "\e13b"; } + +.fa-city::before { + content: "\f64f"; } + +.fa-microphone-lines::before { + content: "\f3c9"; } + +.fa-microphone-alt::before { + content: "\f3c9"; } + +.fa-pepper-hot::before { + content: "\f816"; } + +.fa-unlock::before { + content: "\f09c"; } + +.fa-colon-sign::before { + content: "\e140"; } + +.fa-headset::before { + content: "\f590"; } + +.fa-store-slash::before { + content: "\e071"; } + +.fa-road-circle-xmark::before { + content: "\e566"; } + +.fa-user-minus::before { + content: "\f503"; } + +.fa-mars-stroke-up::before { + content: "\f22a"; } + +.fa-mars-stroke-v::before { + content: "\f22a"; } + +.fa-champagne-glasses::before { + content: "\f79f"; } + +.fa-glass-cheers::before { + content: "\f79f"; } + +.fa-clipboard::before { + content: "\f328"; } + +.fa-house-circle-exclamation::before { + content: "\e50a"; } + +.fa-file-arrow-up::before { + content: "\f574"; } + +.fa-file-upload::before { + content: "\f574"; } + +.fa-wifi::before { + content: "\f1eb"; } + +.fa-wifi-3::before { + content: "\f1eb"; } + +.fa-wifi-strong::before { + content: "\f1eb"; } + +.fa-bath::before { + content: "\f2cd"; } + +.fa-bathtub::before { + content: "\f2cd"; } + +.fa-underline::before { + content: "\f0cd"; } + +.fa-user-pen::before { + content: "\f4ff"; } + +.fa-user-edit::before { + content: "\f4ff"; } + +.fa-signature::before { + content: "\f5b7"; } + +.fa-stroopwafel::before { + content: "\f551"; } + +.fa-bold::before { + content: "\f032"; } + +.fa-anchor-lock::before { + content: "\e4ad"; } + +.fa-building-ngo::before { + content: "\e4d7"; } + +.fa-manat-sign::before { + content: "\e1d5"; } + +.fa-not-equal::before { + content: "\f53e"; } + +.fa-border-top-left::before { + content: "\f853"; } + +.fa-border-style::before { + content: "\f853"; } + +.fa-map-location-dot::before { + content: "\f5a0"; } + +.fa-map-marked-alt::before { + content: "\f5a0"; } + +.fa-jedi::before { + content: "\f669"; } + +.fa-square-poll-vertical::before { + content: "\f681"; } + +.fa-poll::before { + content: "\f681"; } + +.fa-mug-hot::before { + content: "\f7b6"; } + +.fa-car-battery::before { + content: "\f5df"; } + +.fa-battery-car::before { + content: "\f5df"; } + +.fa-gift::before { + content: "\f06b"; } + +.fa-dice-two::before { + content: "\f528"; } + +.fa-chess-queen::before { + content: "\f445"; } + +.fa-glasses::before { + content: "\f530"; } + +.fa-chess-board::before { + content: "\f43c"; } + +.fa-building-circle-check::before { + content: "\e4d2"; } + +.fa-person-chalkboard::before { + content: "\e53d"; } + +.fa-mars-stroke-right::before { + content: "\f22b"; } + +.fa-mars-stroke-h::before { + content: "\f22b"; } + +.fa-hand-back-fist::before { + content: "\f255"; } + +.fa-hand-rock::before { + content: "\f255"; } + +.fa-square-caret-up::before { + content: "\f151"; } + +.fa-caret-square-up::before { + content: "\f151"; } + +.fa-cloud-showers-water::before { + content: "\e4e4"; } + +.fa-chart-bar::before { + content: "\f080"; } + +.fa-bar-chart::before { + content: "\f080"; } + +.fa-hands-bubbles::before { + content: "\e05e"; } + +.fa-hands-wash::before { + content: "\e05e"; } + +.fa-less-than-equal::before { + content: "\f537"; } + +.fa-train::before { + content: "\f238"; } + +.fa-eye-low-vision::before { + content: "\f2a8"; } + +.fa-low-vision::before { + content: "\f2a8"; } + +.fa-crow::before { + content: "\f520"; } + +.fa-sailboat::before { + content: "\e445"; } + +.fa-window-restore::before { + content: "\f2d2"; } + +.fa-square-plus::before { + content: "\f0fe"; } + +.fa-plus-square::before { + content: "\f0fe"; } + +.fa-torii-gate::before { + content: "\f6a1"; } + +.fa-frog::before { + content: "\f52e"; } + +.fa-bucket::before { + content: "\e4cf"; } + +.fa-image::before { + content: "\f03e"; } + +.fa-microphone::before { + content: "\f130"; } + +.fa-cow::before { + content: "\f6c8"; } + +.fa-caret-up::before { + content: "\f0d8"; } + +.fa-screwdriver::before { + content: "\f54a"; } + +.fa-folder-closed::before { + content: "\e185"; } + +.fa-house-tsunami::before { + content: "\e515"; } + +.fa-square-nfi::before { + content: "\e576"; } + +.fa-arrow-up-from-ground-water::before { + content: "\e4b5"; } + +.fa-martini-glass::before { + content: "\f57b"; } + +.fa-glass-martini-alt::before { + content: "\f57b"; } + +.fa-rotate-left::before { + content: "\f2ea"; } + +.fa-rotate-back::before { + content: "\f2ea"; } + +.fa-rotate-backward::before { + content: "\f2ea"; } + +.fa-undo-alt::before { + content: "\f2ea"; } + +.fa-table-columns::before { + content: "\f0db"; } + +.fa-columns::before { + content: "\f0db"; } + +.fa-lemon::before { + content: "\f094"; } + +.fa-head-side-mask::before { + content: "\e063"; } + +.fa-handshake::before { + content: "\f2b5"; } + +.fa-gem::before { + content: "\f3a5"; } + +.fa-dolly::before { + content: "\f472"; } + +.fa-dolly-box::before { + content: "\f472"; } + +.fa-smoking::before { + content: "\f48d"; } + +.fa-minimize::before { + content: "\f78c"; } + +.fa-compress-arrows-alt::before { + content: "\f78c"; } + +.fa-monument::before { + content: "\f5a6"; } + +.fa-snowplow::before { + content: "\f7d2"; } + +.fa-angles-right::before { + content: "\f101"; } + +.fa-angle-double-right::before { + content: "\f101"; } + +.fa-cannabis::before { + content: "\f55f"; } + +.fa-circle-play::before { + content: "\f144"; } + +.fa-play-circle::before { + content: "\f144"; } + +.fa-tablets::before { + content: "\f490"; } + +.fa-ethernet::before { + content: "\f796"; } + +.fa-euro-sign::before { + content: "\f153"; } + +.fa-eur::before { + content: "\f153"; } + +.fa-euro::before { + content: "\f153"; } + +.fa-chair::before { + content: "\f6c0"; } + +.fa-circle-check::before { + content: "\f058"; } + +.fa-check-circle::before { + content: "\f058"; } + +.fa-circle-stop::before { + content: "\f28d"; } + +.fa-stop-circle::before { + content: "\f28d"; } + +.fa-compass-drafting::before { + content: "\f568"; } + +.fa-drafting-compass::before { + content: "\f568"; } + +.fa-plate-wheat::before { + content: "\e55a"; } + +.fa-icicles::before { + content: "\f7ad"; } + +.fa-person-shelter::before { + content: "\e54f"; } + +.fa-neuter::before { + content: "\f22c"; } + +.fa-id-badge::before { + content: "\f2c1"; } + +.fa-marker::before { + content: "\f5a1"; } + +.fa-face-laugh-beam::before { + content: "\f59a"; } + +.fa-laugh-beam::before { + content: "\f59a"; } + +.fa-helicopter-symbol::before { + content: "\e502"; } + +.fa-universal-access::before { + content: "\f29a"; } + +.fa-circle-chevron-up::before { + content: "\f139"; } + +.fa-chevron-circle-up::before { + content: "\f139"; } + +.fa-lari-sign::before { + content: "\e1c8"; } + +.fa-volcano::before { + content: "\f770"; } + +.fa-person-walking-dashed-line-arrow-right::before { + content: "\e553"; } + +.fa-sterling-sign::before { + content: "\f154"; } + +.fa-gbp::before { + content: "\f154"; } + +.fa-pound-sign::before { + content: "\f154"; } + +.fa-viruses::before { + content: "\e076"; } + +.fa-square-person-confined::before { + content: "\e577"; } + +.fa-user-tie::before { + content: "\f508"; } + +.fa-arrow-down-long::before { + content: "\f175"; } + +.fa-long-arrow-down::before { + content: "\f175"; } + +.fa-tent-arrow-down-to-line::before { + content: "\e57e"; } + +.fa-certificate::before { + content: "\f0a3"; } + +.fa-reply-all::before { + content: "\f122"; } + +.fa-mail-reply-all::before { + content: "\f122"; } + +.fa-suitcase::before { + content: "\f0f2"; } + +.fa-person-skating::before { + content: "\f7c5"; } + +.fa-skating::before { + content: "\f7c5"; } + +.fa-filter-circle-dollar::before { + content: "\f662"; } + +.fa-funnel-dollar::before { + content: "\f662"; } + +.fa-camera-retro::before { + content: "\f083"; } + +.fa-circle-arrow-down::before { + content: "\f0ab"; } + +.fa-arrow-circle-down::before { + content: "\f0ab"; } + +.fa-file-import::before { + content: "\f56f"; } + +.fa-arrow-right-to-file::before { + content: "\f56f"; } + +.fa-square-arrow-up-right::before { + content: "\f14c"; } + +.fa-external-link-square::before { + content: "\f14c"; } + +.fa-box-open::before { + content: "\f49e"; } + +.fa-scroll::before { + content: "\f70e"; } + +.fa-spa::before { + content: "\f5bb"; } + +.fa-location-pin-lock::before { + content: "\e51f"; } + +.fa-pause::before { + content: "\f04c"; } + +.fa-hill-avalanche::before { + content: "\e507"; } + +.fa-temperature-empty::before { + content: "\f2cb"; } + +.fa-temperature-0::before { + content: "\f2cb"; } + +.fa-thermometer-0::before { + content: "\f2cb"; } + +.fa-thermometer-empty::before { + content: "\f2cb"; } + +.fa-bomb::before { + content: "\f1e2"; } + +.fa-registered::before { + content: "\f25d"; } + +.fa-address-card::before { + content: "\f2bb"; } + +.fa-contact-card::before { + content: "\f2bb"; } + +.fa-vcard::before { + content: "\f2bb"; } + +.fa-scale-unbalanced-flip::before { + content: "\f516"; } + +.fa-balance-scale-right::before { + content: "\f516"; } + +.fa-subscript::before { + content: "\f12c"; } + +.fa-diamond-turn-right::before { + content: "\f5eb"; } + +.fa-directions::before { + content: "\f5eb"; } + +.fa-burst::before { + content: "\e4dc"; } + +.fa-house-laptop::before { + content: "\e066"; } + +.fa-laptop-house::before { + content: "\e066"; } + +.fa-face-tired::before { + content: "\f5c8"; } + +.fa-tired::before { + content: "\f5c8"; } + +.fa-money-bills::before { + content: "\e1f3"; } + +.fa-smog::before { + content: "\f75f"; } + +.fa-crutch::before { + content: "\f7f7"; } + +.fa-cloud-arrow-up::before { + content: "\f0ee"; } + +.fa-cloud-upload::before { + content: "\f0ee"; } + +.fa-cloud-upload-alt::before { + content: "\f0ee"; } + +.fa-palette::before { + content: "\f53f"; } + +.fa-arrows-turn-right::before { + content: "\e4c0"; } + +.fa-vest::before { + content: "\e085"; } + +.fa-ferry::before { + content: "\e4ea"; } + +.fa-arrows-down-to-people::before { + content: "\e4b9"; } + +.fa-seedling::before { + content: "\f4d8"; } + +.fa-sprout::before { + content: "\f4d8"; } + +.fa-left-right::before { + content: "\f337"; } + +.fa-arrows-alt-h::before { + content: "\f337"; } + +.fa-boxes-packing::before { + content: "\e4c7"; } + +.fa-circle-arrow-left::before { + content: "\f0a8"; } + +.fa-arrow-circle-left::before { + content: "\f0a8"; } + +.fa-group-arrows-rotate::before { + content: "\e4f6"; } + +.fa-bowl-food::before { + content: "\e4c6"; } + +.fa-candy-cane::before { + content: "\f786"; } + +.fa-arrow-down-wide-short::before { + content: "\f160"; } + +.fa-sort-amount-asc::before { + content: "\f160"; } + +.fa-sort-amount-down::before { + content: "\f160"; } + +.fa-cloud-bolt::before { + content: "\f76c"; } + +.fa-thunderstorm::before { + content: "\f76c"; } + +.fa-text-slash::before { + content: "\f87d"; } + +.fa-remove-format::before { + content: "\f87d"; } + +.fa-face-smile-wink::before { + content: "\f4da"; } + +.fa-smile-wink::before { + content: "\f4da"; } + +.fa-file-word::before { + content: "\f1c2"; } + +.fa-file-powerpoint::before { + content: "\f1c4"; } + +.fa-arrows-left-right::before { + content: "\f07e"; } + +.fa-arrows-h::before { + content: "\f07e"; } + +.fa-house-lock::before { + content: "\e510"; } + +.fa-cloud-arrow-down::before { + content: "\f0ed"; } + +.fa-cloud-download::before { + content: "\f0ed"; } + +.fa-cloud-download-alt::before { + content: "\f0ed"; } + +.fa-children::before { + content: "\e4e1"; } + +.fa-chalkboard::before { + content: "\f51b"; } + +.fa-blackboard::before { + content: "\f51b"; } + +.fa-user-large-slash::before { + content: "\f4fa"; } + +.fa-user-alt-slash::before { + content: "\f4fa"; } + +.fa-envelope-open::before { + content: "\f2b6"; } + +.fa-handshake-simple-slash::before { + content: "\e05f"; } + +.fa-handshake-alt-slash::before { + content: "\e05f"; } + +.fa-mattress-pillow::before { + content: "\e525"; } + +.fa-guarani-sign::before { + content: "\e19a"; } + +.fa-arrows-rotate::before { + content: "\f021"; } + +.fa-refresh::before { + content: "\f021"; } + +.fa-sync::before { + content: "\f021"; } + +.fa-fire-extinguisher::before { + content: "\f134"; } + +.fa-cruzeiro-sign::before { + content: "\e152"; } + +.fa-greater-than-equal::before { + content: "\f532"; } + +.fa-shield-halved::before { + content: "\f3ed"; } + +.fa-shield-alt::before { + content: "\f3ed"; } + +.fa-book-atlas::before { + content: "\f558"; } + +.fa-atlas::before { + content: "\f558"; } + +.fa-virus::before { + content: "\e074"; } + +.fa-envelope-circle-check::before { + content: "\e4e8"; } + +.fa-layer-group::before { + content: "\f5fd"; } + +.fa-arrows-to-dot::before { + content: "\e4be"; } + +.fa-archway::before { + content: "\f557"; } + +.fa-heart-circle-check::before { + content: "\e4fd"; } + +.fa-house-chimney-crack::before { + content: "\f6f1"; } + +.fa-house-damage::before { + content: "\f6f1"; } + +.fa-file-zipper::before { + content: "\f1c6"; } + +.fa-file-archive::before { + content: "\f1c6"; } + +.fa-square::before { + content: "\f0c8"; } + +.fa-martini-glass-empty::before { + content: "\f000"; } + +.fa-glass-martini::before { + content: "\f000"; } + +.fa-couch::before { + content: "\f4b8"; } + +.fa-cedi-sign::before { + content: "\e0df"; } + +.fa-italic::before { + content: "\f033"; } + +.fa-table-cells-column-lock::before { + content: "\e678"; } + +.fa-church::before { + content: "\f51d"; } + +.fa-comments-dollar::before { + content: "\f653"; } + +.fa-democrat::before { + content: "\f747"; } + +.fa-z::before { + content: "\5a"; } + +.fa-person-skiing::before { + content: "\f7c9"; } + +.fa-skiing::before { + content: "\f7c9"; } + +.fa-road-lock::before { + content: "\e567"; } + +.fa-a::before { + content: "\41"; } + +.fa-temperature-arrow-down::before { + content: "\e03f"; } + +.fa-temperature-down::before { + content: "\e03f"; } + +.fa-feather-pointed::before { + content: "\f56b"; } + +.fa-feather-alt::before { + content: "\f56b"; } + +.fa-p::before { + content: "\50"; } + +.fa-snowflake::before { + content: "\f2dc"; } + +.fa-newspaper::before { + content: "\f1ea"; } + +.fa-rectangle-ad::before { + content: "\f641"; } + +.fa-ad::before { + content: "\f641"; } + +.fa-circle-arrow-right::before { + content: "\f0a9"; } + +.fa-arrow-circle-right::before { + content: "\f0a9"; } + +.fa-filter-circle-xmark::before { + content: "\e17b"; } + +.fa-locust::before { + content: "\e520"; } + +.fa-sort::before { + content: "\f0dc"; } + +.fa-unsorted::before { + content: "\f0dc"; } + +.fa-list-ol::before { + content: "\f0cb"; } + +.fa-list-1-2::before { + content: "\f0cb"; } + +.fa-list-numeric::before { + content: "\f0cb"; } + +.fa-person-dress-burst::before { + content: "\e544"; } + +.fa-money-check-dollar::before { + content: "\f53d"; } + +.fa-money-check-alt::before { + content: "\f53d"; } + +.fa-vector-square::before { + content: "\f5cb"; } + +.fa-bread-slice::before { + content: "\f7ec"; } + +.fa-language::before { + content: "\f1ab"; } + +.fa-face-kiss-wink-heart::before { + content: "\f598"; } + +.fa-kiss-wink-heart::before { + content: "\f598"; } + +.fa-filter::before { + content: "\f0b0"; } + +.fa-question::before { + content: "\3f"; } + +.fa-file-signature::before { + content: "\f573"; } + +.fa-up-down-left-right::before { + content: "\f0b2"; } + +.fa-arrows-alt::before { + content: "\f0b2"; } + +.fa-house-chimney-user::before { + content: "\e065"; } + +.fa-hand-holding-heart::before { + content: "\f4be"; } + +.fa-puzzle-piece::before { + content: "\f12e"; } + +.fa-money-check::before { + content: "\f53c"; } + +.fa-star-half-stroke::before { + content: "\f5c0"; } + +.fa-star-half-alt::before { + content: "\f5c0"; } + +.fa-code::before { + content: "\f121"; } + +.fa-whiskey-glass::before { + content: "\f7a0"; } + +.fa-glass-whiskey::before { + content: "\f7a0"; } + +.fa-building-circle-exclamation::before { + content: "\e4d3"; } + +.fa-magnifying-glass-chart::before { + content: "\e522"; } + +.fa-arrow-up-right-from-square::before { + content: "\f08e"; } + +.fa-external-link::before { + content: "\f08e"; } + +.fa-cubes-stacked::before { + content: "\e4e6"; } + +.fa-won-sign::before { + content: "\f159"; } + +.fa-krw::before { + content: "\f159"; } + +.fa-won::before { + content: "\f159"; } + +.fa-virus-covid::before { + content: "\e4a8"; } + +.fa-austral-sign::before { + content: "\e0a9"; } + +.fa-f::before { + content: "\46"; } + +.fa-leaf::before { + content: "\f06c"; } + +.fa-road::before { + content: "\f018"; } + +.fa-taxi::before { + content: "\f1ba"; } + +.fa-cab::before { + content: "\f1ba"; } + +.fa-person-circle-plus::before { + content: "\e541"; } + +.fa-chart-pie::before { + content: "\f200"; } + +.fa-pie-chart::before { + content: "\f200"; } + +.fa-bolt-lightning::before { + content: "\e0b7"; } + +.fa-sack-xmark::before { + content: "\e56a"; } + +.fa-file-excel::before { + content: "\f1c3"; } + +.fa-file-contract::before { + content: "\f56c"; } + +.fa-fish-fins::before { + content: "\e4f2"; } + +.fa-building-flag::before { + content: "\e4d5"; } + +.fa-face-grin-beam::before { + content: "\f582"; } + +.fa-grin-beam::before { + content: "\f582"; } + +.fa-object-ungroup::before { + content: "\f248"; } + +.fa-poop::before { + content: "\f619"; } + +.fa-location-pin::before { + content: "\f041"; } + +.fa-map-marker::before { + content: "\f041"; } + +.fa-kaaba::before { + content: "\f66b"; } + +.fa-toilet-paper::before { + content: "\f71e"; } + +.fa-helmet-safety::before { + content: "\f807"; } + +.fa-hard-hat::before { + content: "\f807"; } + +.fa-hat-hard::before { + content: "\f807"; } + +.fa-eject::before { + content: "\f052"; } + +.fa-circle-right::before { + content: "\f35a"; } + +.fa-arrow-alt-circle-right::before { + content: "\f35a"; } + +.fa-plane-circle-check::before { + content: "\e555"; } + +.fa-face-rolling-eyes::before { + content: "\f5a5"; } + +.fa-meh-rolling-eyes::before { + content: "\f5a5"; } + +.fa-object-group::before { + content: "\f247"; } + +.fa-chart-line::before { + content: "\f201"; } + +.fa-line-chart::before { + content: "\f201"; } + +.fa-mask-ventilator::before { + content: "\e524"; } + +.fa-arrow-right::before { + content: "\f061"; } + +.fa-signs-post::before { + content: "\f277"; } + +.fa-map-signs::before { + content: "\f277"; } + +.fa-cash-register::before { + content: "\f788"; } + +.fa-person-circle-question::before { + content: "\e542"; } + +.fa-h::before { + content: "\48"; } + +.fa-tarp::before { + content: "\e57b"; } + +.fa-screwdriver-wrench::before { + content: "\f7d9"; } + +.fa-tools::before { + content: "\f7d9"; } + +.fa-arrows-to-eye::before { + content: "\e4bf"; } + +.fa-plug-circle-bolt::before { + content: "\e55b"; } + +.fa-heart::before { + content: "\f004"; } + +.fa-mars-and-venus::before { + content: "\f224"; } + +.fa-house-user::before { + content: "\e1b0"; } + +.fa-home-user::before { + content: "\e1b0"; } + +.fa-dumpster-fire::before { + content: "\f794"; } + +.fa-house-crack::before { + content: "\e3b1"; } + +.fa-martini-glass-citrus::before { + content: "\f561"; } + +.fa-cocktail::before { + content: "\f561"; } + +.fa-face-surprise::before { + content: "\f5c2"; } + +.fa-surprise::before { + content: "\f5c2"; } + +.fa-bottle-water::before { + content: "\e4c5"; } + +.fa-circle-pause::before { + content: "\f28b"; } + +.fa-pause-circle::before { + content: "\f28b"; } + +.fa-toilet-paper-slash::before { + content: "\e072"; } + +.fa-apple-whole::before { + content: "\f5d1"; } + +.fa-apple-alt::before { + content: "\f5d1"; } + +.fa-kitchen-set::before { + content: "\e51a"; } + +.fa-r::before { + content: "\52"; } + +.fa-temperature-quarter::before { + content: "\f2ca"; } + +.fa-temperature-1::before { + content: "\f2ca"; } + +.fa-thermometer-1::before { + content: "\f2ca"; } + +.fa-thermometer-quarter::before { + content: "\f2ca"; } + +.fa-cube::before { + content: "\f1b2"; } + +.fa-bitcoin-sign::before { + content: "\e0b4"; } + +.fa-shield-dog::before { + content: "\e573"; } + +.fa-solar-panel::before { + content: "\f5ba"; } + +.fa-lock-open::before { + content: "\f3c1"; } + +.fa-elevator::before { + content: "\e16d"; } + +.fa-money-bill-transfer::before { + content: "\e528"; } + +.fa-money-bill-trend-up::before { + content: "\e529"; } + +.fa-house-flood-water-circle-arrow-right::before { + content: "\e50f"; } + +.fa-square-poll-horizontal::before { + content: "\f682"; } + +.fa-poll-h::before { + content: "\f682"; } + +.fa-circle::before { + content: "\f111"; } + +.fa-backward-fast::before { + content: "\f049"; } + +.fa-fast-backward::before { + content: "\f049"; } + +.fa-recycle::before { + content: "\f1b8"; } + +.fa-user-astronaut::before { + content: "\f4fb"; } + +.fa-plane-slash::before { + content: "\e069"; } + +.fa-trademark::before { + content: "\f25c"; } + +.fa-basketball::before { + content: "\f434"; } + +.fa-basketball-ball::before { + content: "\f434"; } + +.fa-satellite-dish::before { + content: "\f7c0"; } + +.fa-circle-up::before { + content: "\f35b"; } + +.fa-arrow-alt-circle-up::before { + content: "\f35b"; } + +.fa-mobile-screen-button::before { + content: "\f3cd"; } + +.fa-mobile-alt::before { + content: "\f3cd"; } + +.fa-volume-high::before { + content: "\f028"; } + +.fa-volume-up::before { + content: "\f028"; } + +.fa-users-rays::before { + content: "\e593"; } + +.fa-wallet::before { + content: "\f555"; } + +.fa-clipboard-check::before { + content: "\f46c"; } + +.fa-file-audio::before { + content: "\f1c7"; } + +.fa-burger::before { + content: "\f805"; } + +.fa-hamburger::before { + content: "\f805"; } + +.fa-wrench::before { + content: "\f0ad"; } + +.fa-bugs::before { + content: "\e4d0"; } + +.fa-rupee-sign::before { + content: "\f156"; } + +.fa-rupee::before { + content: "\f156"; } + +.fa-file-image::before { + content: "\f1c5"; } + +.fa-circle-question::before { + content: "\f059"; } + +.fa-question-circle::before { + content: "\f059"; } + +.fa-plane-departure::before { + content: "\f5b0"; } + +.fa-handshake-slash::before { + content: "\e060"; } + +.fa-book-bookmark::before { + content: "\e0bb"; } + +.fa-code-branch::before { + content: "\f126"; } + +.fa-hat-cowboy::before { + content: "\f8c0"; } + +.fa-bridge::before { + content: "\e4c8"; } + +.fa-phone-flip::before { + content: "\f879"; } + +.fa-phone-alt::before { + content: "\f879"; } + +.fa-truck-front::before { + content: "\e2b7"; } + +.fa-cat::before { + content: "\f6be"; } + +.fa-anchor-circle-exclamation::before { + content: "\e4ab"; } + +.fa-truck-field::before { + content: "\e58d"; } + +.fa-route::before { + content: "\f4d7"; } + +.fa-clipboard-question::before { + content: "\e4e3"; } + +.fa-panorama::before { + content: "\e209"; } + +.fa-comment-medical::before { + content: "\f7f5"; } + +.fa-teeth-open::before { + content: "\f62f"; } + +.fa-file-circle-minus::before { + content: "\e4ed"; } + +.fa-tags::before { + content: "\f02c"; } + +.fa-wine-glass::before { + content: "\f4e3"; } + +.fa-forward-fast::before { + content: "\f050"; } + +.fa-fast-forward::before { + content: "\f050"; } + +.fa-face-meh-blank::before { + content: "\f5a4"; } + +.fa-meh-blank::before { + content: "\f5a4"; } + +.fa-square-parking::before { + content: "\f540"; } + +.fa-parking::before { + content: "\f540"; } + +.fa-house-signal::before { + content: "\e012"; } + +.fa-bars-progress::before { + content: "\f828"; } + +.fa-tasks-alt::before { + content: "\f828"; } + +.fa-faucet-drip::before { + content: "\e006"; } + +.fa-cart-flatbed::before { + content: "\f474"; } + +.fa-dolly-flatbed::before { + content: "\f474"; } + +.fa-ban-smoking::before { + content: "\f54d"; } + +.fa-smoking-ban::before { + content: "\f54d"; } + +.fa-terminal::before { + content: "\f120"; } + +.fa-mobile-button::before { + content: "\f10b"; } + +.fa-house-medical-flag::before { + content: "\e514"; } + +.fa-basket-shopping::before { + content: "\f291"; } + +.fa-shopping-basket::before { + content: "\f291"; } + +.fa-tape::before { + content: "\f4db"; } + +.fa-bus-simple::before { + content: "\f55e"; } + +.fa-bus-alt::before { + content: "\f55e"; } + +.fa-eye::before { + content: "\f06e"; } + +.fa-face-sad-cry::before { + content: "\f5b3"; } + +.fa-sad-cry::before { + content: "\f5b3"; } + +.fa-audio-description::before { + content: "\f29e"; } + +.fa-person-military-to-person::before { + content: "\e54c"; } + +.fa-file-shield::before { + content: "\e4f0"; } + +.fa-user-slash::before { + content: "\f506"; } + +.fa-pen::before { + content: "\f304"; } + +.fa-tower-observation::before { + content: "\e586"; } + +.fa-file-code::before { + content: "\f1c9"; } + +.fa-signal::before { + content: "\f012"; } + +.fa-signal-5::before { + content: "\f012"; } + +.fa-signal-perfect::before { + content: "\f012"; } + +.fa-bus::before { + content: "\f207"; } + +.fa-heart-circle-xmark::before { + content: "\e501"; } + +.fa-house-chimney::before { + content: "\e3af"; } + +.fa-home-lg::before { + content: "\e3af"; } + +.fa-window-maximize::before { + content: "\f2d0"; } + +.fa-face-frown::before { + content: "\f119"; } + +.fa-frown::before { + content: "\f119"; } + +.fa-prescription::before { + content: "\f5b1"; } + +.fa-shop::before { + content: "\f54f"; } + +.fa-store-alt::before { + content: "\f54f"; } + +.fa-floppy-disk::before { + content: "\f0c7"; } + +.fa-save::before { + content: "\f0c7"; } + +.fa-vihara::before { + content: "\f6a7"; } + +.fa-scale-unbalanced::before { + content: "\f515"; } + +.fa-balance-scale-left::before { + content: "\f515"; } + +.fa-sort-up::before { + content: "\f0de"; } + +.fa-sort-asc::before { + content: "\f0de"; } + +.fa-comment-dots::before { + content: "\f4ad"; } + +.fa-commenting::before { + content: "\f4ad"; } + +.fa-plant-wilt::before { + content: "\e5aa"; } + +.fa-diamond::before { + content: "\f219"; } + +.fa-face-grin-squint::before { + content: "\f585"; } + +.fa-grin-squint::before { + content: "\f585"; } + +.fa-hand-holding-dollar::before { + content: "\f4c0"; } + +.fa-hand-holding-usd::before { + content: "\f4c0"; } + +.fa-bacterium::before { + content: "\e05a"; } + +.fa-hand-pointer::before { + content: "\f25a"; } + +.fa-drum-steelpan::before { + content: "\f56a"; } + +.fa-hand-scissors::before { + content: "\f257"; } + +.fa-hands-praying::before { + content: "\f684"; } + +.fa-praying-hands::before { + content: "\f684"; } + +.fa-arrow-rotate-right::before { + content: "\f01e"; } + +.fa-arrow-right-rotate::before { + content: "\f01e"; } + +.fa-arrow-rotate-forward::before { + content: "\f01e"; } + +.fa-redo::before { + content: "\f01e"; } + +.fa-biohazard::before { + content: "\f780"; } + +.fa-location-crosshairs::before { + content: "\f601"; } + +.fa-location::before { + content: "\f601"; } + +.fa-mars-double::before { + content: "\f227"; } + +.fa-child-dress::before { + content: "\e59c"; } + +.fa-users-between-lines::before { + content: "\e591"; } + +.fa-lungs-virus::before { + content: "\e067"; } + +.fa-face-grin-tears::before { + content: "\f588"; } + +.fa-grin-tears::before { + content: "\f588"; } + +.fa-phone::before { + content: "\f095"; } + +.fa-calendar-xmark::before { + content: "\f273"; } + +.fa-calendar-times::before { + content: "\f273"; } + +.fa-child-reaching::before { + content: "\e59d"; } + +.fa-head-side-virus::before { + content: "\e064"; } + +.fa-user-gear::before { + content: "\f4fe"; } + +.fa-user-cog::before { + content: "\f4fe"; } + +.fa-arrow-up-1-9::before { + content: "\f163"; } + +.fa-sort-numeric-up::before { + content: "\f163"; } + +.fa-door-closed::before { + content: "\f52a"; } + +.fa-shield-virus::before { + content: "\e06c"; } + +.fa-dice-six::before { + content: "\f526"; } + +.fa-mosquito-net::before { + content: "\e52c"; } + +.fa-bridge-water::before { + content: "\e4ce"; } + +.fa-person-booth::before { + content: "\f756"; } + +.fa-text-width::before { + content: "\f035"; } + +.fa-hat-wizard::before { + content: "\f6e8"; } + +.fa-pen-fancy::before { + content: "\f5ac"; } + +.fa-person-digging::before { + content: "\f85e"; } + +.fa-digging::before { + content: "\f85e"; } + +.fa-trash::before { + content: "\f1f8"; } + +.fa-gauge-simple::before { + content: "\f629"; } + +.fa-gauge-simple-med::before { + content: "\f629"; } + +.fa-tachometer-average::before { + content: "\f629"; } + +.fa-book-medical::before { + content: "\f7e6"; } + +.fa-poo::before { + content: "\f2fe"; } + +.fa-quote-right::before { + content: "\f10e"; } + +.fa-quote-right-alt::before { + content: "\f10e"; } + +.fa-shirt::before { + content: "\f553"; } + +.fa-t-shirt::before { + content: "\f553"; } + +.fa-tshirt::before { + content: "\f553"; } + +.fa-cubes::before { + content: "\f1b3"; } + +.fa-divide::before { + content: "\f529"; } + +.fa-tenge-sign::before { + content: "\f7d7"; } + +.fa-tenge::before { + content: "\f7d7"; } + +.fa-headphones::before { + content: "\f025"; } + +.fa-hands-holding::before { + content: "\f4c2"; } + +.fa-hands-clapping::before { + content: "\e1a8"; } + +.fa-republican::before { + content: "\f75e"; } + +.fa-arrow-left::before { + content: "\f060"; } + +.fa-person-circle-xmark::before { + content: "\e543"; } + +.fa-ruler::before { + content: "\f545"; } + +.fa-align-left::before { + content: "\f036"; } + +.fa-dice-d6::before { + content: "\f6d1"; } + +.fa-restroom::before { + content: "\f7bd"; } + +.fa-j::before { + content: "\4a"; } + +.fa-users-viewfinder::before { + content: "\e595"; } + +.fa-file-video::before { + content: "\f1c8"; } + +.fa-up-right-from-square::before { + content: "\f35d"; } + +.fa-external-link-alt::before { + content: "\f35d"; } + +.fa-table-cells::before { + content: "\f00a"; } + +.fa-th::before { + content: "\f00a"; } + +.fa-file-pdf::before { + content: "\f1c1"; } + +.fa-book-bible::before { + content: "\f647"; } + +.fa-bible::before { + content: "\f647"; } + +.fa-o::before { + content: "\4f"; } + +.fa-suitcase-medical::before { + content: "\f0fa"; } + +.fa-medkit::before { + content: "\f0fa"; } + +.fa-user-secret::before { + content: "\f21b"; } + +.fa-otter::before { + content: "\f700"; } + +.fa-person-dress::before { + content: "\f182"; } + +.fa-female::before { + content: "\f182"; } + +.fa-comment-dollar::before { + content: "\f651"; } + +.fa-business-time::before { + content: "\f64a"; } + +.fa-briefcase-clock::before { + content: "\f64a"; } + +.fa-table-cells-large::before { + content: "\f009"; } + +.fa-th-large::before { + content: "\f009"; } + +.fa-book-tanakh::before { + content: "\f827"; } + +.fa-tanakh::before { + content: "\f827"; } + +.fa-phone-volume::before { + content: "\f2a0"; } + +.fa-volume-control-phone::before { + content: "\f2a0"; } + +.fa-hat-cowboy-side::before { + content: "\f8c1"; } + +.fa-clipboard-user::before { + content: "\f7f3"; } + +.fa-child::before { + content: "\f1ae"; } + +.fa-lira-sign::before { + content: "\f195"; } + +.fa-satellite::before { + content: "\f7bf"; } + +.fa-plane-lock::before { + content: "\e558"; } + +.fa-tag::before { + content: "\f02b"; } + +.fa-comment::before { + content: "\f075"; } + +.fa-cake-candles::before { + content: "\f1fd"; } + +.fa-birthday-cake::before { + content: "\f1fd"; } + +.fa-cake::before { + content: "\f1fd"; } + +.fa-envelope::before { + content: "\f0e0"; } + +.fa-angles-up::before { + content: "\f102"; } + +.fa-angle-double-up::before { + content: "\f102"; } + +.fa-paperclip::before { + content: "\f0c6"; } + +.fa-arrow-right-to-city::before { + content: "\e4b3"; } + +.fa-ribbon::before { + content: "\f4d6"; } + +.fa-lungs::before { + content: "\f604"; } + +.fa-arrow-up-9-1::before { + content: "\f887"; } + +.fa-sort-numeric-up-alt::before { + content: "\f887"; } + +.fa-litecoin-sign::before { + content: "\e1d3"; } + +.fa-border-none::before { + content: "\f850"; } + +.fa-circle-nodes::before { + content: "\e4e2"; } + +.fa-parachute-box::before { + content: "\f4cd"; } + +.fa-indent::before { + content: "\f03c"; } + +.fa-truck-field-un::before { + content: "\e58e"; } + +.fa-hourglass::before { + content: "\f254"; } + +.fa-hourglass-empty::before { + content: "\f254"; } + +.fa-mountain::before { + content: "\f6fc"; } + +.fa-user-doctor::before { + content: "\f0f0"; } + +.fa-user-md::before { + content: "\f0f0"; } + +.fa-circle-info::before { + content: "\f05a"; } + +.fa-info-circle::before { + content: "\f05a"; } + +.fa-cloud-meatball::before { + content: "\f73b"; } + +.fa-camera::before { + content: "\f030"; } + +.fa-camera-alt::before { + content: "\f030"; } + +.fa-square-virus::before { + content: "\e578"; } + +.fa-meteor::before { + content: "\f753"; } + +.fa-car-on::before { + content: "\e4dd"; } + +.fa-sleigh::before { + content: "\f7cc"; } + +.fa-arrow-down-1-9::before { + content: "\f162"; } + +.fa-sort-numeric-asc::before { + content: "\f162"; } + +.fa-sort-numeric-down::before { + content: "\f162"; } + +.fa-hand-holding-droplet::before { + content: "\f4c1"; } + +.fa-hand-holding-water::before { + content: "\f4c1"; } + +.fa-water::before { + content: "\f773"; } + +.fa-calendar-check::before { + content: "\f274"; } + +.fa-braille::before { + content: "\f2a1"; } + +.fa-prescription-bottle-medical::before { + content: "\f486"; } + +.fa-prescription-bottle-alt::before { + content: "\f486"; } + +.fa-landmark::before { + content: "\f66f"; } + +.fa-truck::before { + content: "\f0d1"; } + +.fa-crosshairs::before { + content: "\f05b"; } + +.fa-person-cane::before { + content: "\e53c"; } + +.fa-tent::before { + content: "\e57d"; } + +.fa-vest-patches::before { + content: "\e086"; } + +.fa-check-double::before { + content: "\f560"; } + +.fa-arrow-down-a-z::before { + content: "\f15d"; } + +.fa-sort-alpha-asc::before { + content: "\f15d"; } + +.fa-sort-alpha-down::before { + content: "\f15d"; } + +.fa-money-bill-wheat::before { + content: "\e52a"; } + +.fa-cookie::before { + content: "\f563"; } + +.fa-arrow-rotate-left::before { + content: "\f0e2"; } + +.fa-arrow-left-rotate::before { + content: "\f0e2"; } + +.fa-arrow-rotate-back::before { + content: "\f0e2"; } + +.fa-arrow-rotate-backward::before { + content: "\f0e2"; } + +.fa-undo::before { + content: "\f0e2"; } + +.fa-hard-drive::before { + content: "\f0a0"; } + +.fa-hdd::before { + content: "\f0a0"; } + +.fa-face-grin-squint-tears::before { + content: "\f586"; } + +.fa-grin-squint-tears::before { + content: "\f586"; } + +.fa-dumbbell::before { + content: "\f44b"; } + +.fa-rectangle-list::before { + content: "\f022"; } + +.fa-list-alt::before { + content: "\f022"; } + +.fa-tarp-droplet::before { + content: "\e57c"; } + +.fa-house-medical-circle-check::before { + content: "\e511"; } + +.fa-person-skiing-nordic::before { + content: "\f7ca"; } + +.fa-skiing-nordic::before { + content: "\f7ca"; } + +.fa-calendar-plus::before { + content: "\f271"; } + +.fa-plane-arrival::before { + content: "\f5af"; } + +.fa-circle-left::before { + content: "\f359"; } + +.fa-arrow-alt-circle-left::before { + content: "\f359"; } + +.fa-train-subway::before { + content: "\f239"; } + +.fa-subway::before { + content: "\f239"; } + +.fa-chart-gantt::before { + content: "\e0e4"; } + +.fa-indian-rupee-sign::before { + content: "\e1bc"; } + +.fa-indian-rupee::before { + content: "\e1bc"; } + +.fa-inr::before { + content: "\e1bc"; } + +.fa-crop-simple::before { + content: "\f565"; } + +.fa-crop-alt::before { + content: "\f565"; } + +.fa-money-bill-1::before { + content: "\f3d1"; } + +.fa-money-bill-alt::before { + content: "\f3d1"; } + +.fa-left-long::before { + content: "\f30a"; } + +.fa-long-arrow-alt-left::before { + content: "\f30a"; } + +.fa-dna::before { + content: "\f471"; } + +.fa-virus-slash::before { + content: "\e075"; } + +.fa-minus::before { + content: "\f068"; } + +.fa-subtract::before { + content: "\f068"; } + +.fa-chess::before { + content: "\f439"; } + +.fa-arrow-left-long::before { + content: "\f177"; } + +.fa-long-arrow-left::before { + content: "\f177"; } + +.fa-plug-circle-check::before { + content: "\e55c"; } + +.fa-street-view::before { + content: "\f21d"; } + +.fa-franc-sign::before { + content: "\e18f"; } + +.fa-volume-off::before { + content: "\f026"; } + +.fa-hands-asl-interpreting::before { + content: "\f2a3"; } + +.fa-american-sign-language-interpreting::before { + content: "\f2a3"; } + +.fa-asl-interpreting::before { + content: "\f2a3"; } + +.fa-hands-american-sign-language-interpreting::before { + content: "\f2a3"; } + +.fa-gear::before { + content: "\f013"; } + +.fa-cog::before { + content: "\f013"; } + +.fa-droplet-slash::before { + content: "\f5c7"; } + +.fa-tint-slash::before { + content: "\f5c7"; } + +.fa-mosque::before { + content: "\f678"; } + +.fa-mosquito::before { + content: "\e52b"; } + +.fa-star-of-david::before { + content: "\f69a"; } + +.fa-person-military-rifle::before { + content: "\e54b"; } + +.fa-cart-shopping::before { + content: "\f07a"; } + +.fa-shopping-cart::before { + content: "\f07a"; } + +.fa-vials::before { + content: "\f493"; } + +.fa-plug-circle-plus::before { + content: "\e55f"; } + +.fa-place-of-worship::before { + content: "\f67f"; } + +.fa-grip-vertical::before { + content: "\f58e"; } + +.fa-arrow-turn-up::before { + content: "\f148"; } + +.fa-level-up::before { + content: "\f148"; } + +.fa-u::before { + content: "\55"; } + +.fa-square-root-variable::before { + content: "\f698"; } + +.fa-square-root-alt::before { + content: "\f698"; } + +.fa-clock::before { + content: "\f017"; } + +.fa-clock-four::before { + content: "\f017"; } + +.fa-backward-step::before { + content: "\f048"; } + +.fa-step-backward::before { + content: "\f048"; } + +.fa-pallet::before { + content: "\f482"; } + +.fa-faucet::before { + content: "\e005"; } + +.fa-baseball-bat-ball::before { + content: "\f432"; } + +.fa-s::before { + content: "\53"; } + +.fa-timeline::before { + content: "\e29c"; } + +.fa-keyboard::before { + content: "\f11c"; } + +.fa-caret-down::before { + content: "\f0d7"; } + +.fa-house-chimney-medical::before { + content: "\f7f2"; } + +.fa-clinic-medical::before { + content: "\f7f2"; } + +.fa-temperature-three-quarters::before { + content: "\f2c8"; } + +.fa-temperature-3::before { + content: "\f2c8"; } + +.fa-thermometer-3::before { + content: "\f2c8"; } + +.fa-thermometer-three-quarters::before { + content: "\f2c8"; } + +.fa-mobile-screen::before { + content: "\f3cf"; } + +.fa-mobile-android-alt::before { + content: "\f3cf"; } + +.fa-plane-up::before { + content: "\e22d"; } + +.fa-piggy-bank::before { + content: "\f4d3"; } + +.fa-battery-half::before { + content: "\f242"; } + +.fa-battery-3::before { + content: "\f242"; } + +.fa-mountain-city::before { + content: "\e52e"; } + +.fa-coins::before { + content: "\f51e"; } + +.fa-khanda::before { + content: "\f66d"; } + +.fa-sliders::before { + content: "\f1de"; } + +.fa-sliders-h::before { + content: "\f1de"; } + +.fa-folder-tree::before { + content: "\f802"; } + +.fa-network-wired::before { + content: "\f6ff"; } + +.fa-map-pin::before { + content: "\f276"; } + +.fa-hamsa::before { + content: "\f665"; } + +.fa-cent-sign::before { + content: "\e3f5"; } + +.fa-flask::before { + content: "\f0c3"; } + +.fa-person-pregnant::before { + content: "\e31e"; } + +.fa-wand-sparkles::before { + content: "\f72b"; } + +.fa-ellipsis-vertical::before { + content: "\f142"; } + +.fa-ellipsis-v::before { + content: "\f142"; } + +.fa-ticket::before { + content: "\f145"; } + +.fa-power-off::before { + content: "\f011"; } + +.fa-right-long::before { + content: "\f30b"; } + +.fa-long-arrow-alt-right::before { + content: "\f30b"; } + +.fa-flag-usa::before { + content: "\f74d"; } + +.fa-laptop-file::before { + content: "\e51d"; } + +.fa-tty::before { + content: "\f1e4"; } + +.fa-teletype::before { + content: "\f1e4"; } + +.fa-diagram-next::before { + content: "\e476"; } + +.fa-person-rifle::before { + content: "\e54e"; } + +.fa-house-medical-circle-exclamation::before { + content: "\e512"; } + +.fa-closed-captioning::before { + content: "\f20a"; } + +.fa-person-hiking::before { + content: "\f6ec"; } + +.fa-hiking::before { + content: "\f6ec"; } + +.fa-venus-double::before { + content: "\f226"; } + +.fa-images::before { + content: "\f302"; } + +.fa-calculator::before { + content: "\f1ec"; } + +.fa-people-pulling::before { + content: "\e535"; } + +.fa-n::before { + content: "\4e"; } + +.fa-cable-car::before { + content: "\f7da"; } + +.fa-tram::before { + content: "\f7da"; } + +.fa-cloud-rain::before { + content: "\f73d"; } + +.fa-building-circle-xmark::before { + content: "\e4d4"; } + +.fa-ship::before { + content: "\f21a"; } + +.fa-arrows-down-to-line::before { + content: "\e4b8"; } + +.fa-download::before { + content: "\f019"; } + +.fa-face-grin::before { + content: "\f580"; } + +.fa-grin::before { + content: "\f580"; } + +.fa-delete-left::before { + content: "\f55a"; } + +.fa-backspace::before { + content: "\f55a"; } + +.fa-eye-dropper::before { + content: "\f1fb"; } + +.fa-eye-dropper-empty::before { + content: "\f1fb"; } + +.fa-eyedropper::before { + content: "\f1fb"; } + +.fa-file-circle-check::before { + content: "\e5a0"; } + +.fa-forward::before { + content: "\f04e"; } + +.fa-mobile::before { + content: "\f3ce"; } + +.fa-mobile-android::before { + content: "\f3ce"; } + +.fa-mobile-phone::before { + content: "\f3ce"; } + +.fa-face-meh::before { + content: "\f11a"; } + +.fa-meh::before { + content: "\f11a"; } + +.fa-align-center::before { + content: "\f037"; } + +.fa-book-skull::before { + content: "\f6b7"; } + +.fa-book-dead::before { + content: "\f6b7"; } + +.fa-id-card::before { + content: "\f2c2"; } + +.fa-drivers-license::before { + content: "\f2c2"; } + +.fa-outdent::before { + content: "\f03b"; } + +.fa-dedent::before { + content: "\f03b"; } + +.fa-heart-circle-exclamation::before { + content: "\e4fe"; } + +.fa-house::before { + content: "\f015"; } + +.fa-home::before { + content: "\f015"; } + +.fa-home-alt::before { + content: "\f015"; } + +.fa-home-lg-alt::before { + content: "\f015"; } + +.fa-calendar-week::before { + content: "\f784"; } + +.fa-laptop-medical::before { + content: "\f812"; } + +.fa-b::before { + content: "\42"; } + +.fa-file-medical::before { + content: "\f477"; } + +.fa-dice-one::before { + content: "\f525"; } + +.fa-kiwi-bird::before { + content: "\f535"; } + +.fa-arrow-right-arrow-left::before { + content: "\f0ec"; } + +.fa-exchange::before { + content: "\f0ec"; } + +.fa-rotate-right::before { + content: "\f2f9"; } + +.fa-redo-alt::before { + content: "\f2f9"; } + +.fa-rotate-forward::before { + content: "\f2f9"; } + +.fa-utensils::before { + content: "\f2e7"; } + +.fa-cutlery::before { + content: "\f2e7"; } + +.fa-arrow-up-wide-short::before { + content: "\f161"; } + +.fa-sort-amount-up::before { + content: "\f161"; } + +.fa-mill-sign::before { + content: "\e1ed"; } + +.fa-bowl-rice::before { + content: "\e2eb"; } + +.fa-skull::before { + content: "\f54c"; } + +.fa-tower-broadcast::before { + content: "\f519"; } + +.fa-broadcast-tower::before { + content: "\f519"; } + +.fa-truck-pickup::before { + content: "\f63c"; } + +.fa-up-long::before { + content: "\f30c"; } + +.fa-long-arrow-alt-up::before { + content: "\f30c"; } + +.fa-stop::before { + content: "\f04d"; } + +.fa-code-merge::before { + content: "\f387"; } + +.fa-upload::before { + content: "\f093"; } + +.fa-hurricane::before { + content: "\f751"; } + +.fa-mound::before { + content: "\e52d"; } + +.fa-toilet-portable::before { + content: "\e583"; } + +.fa-compact-disc::before { + content: "\f51f"; } + +.fa-file-arrow-down::before { + content: "\f56d"; } + +.fa-file-download::before { + content: "\f56d"; } + +.fa-caravan::before { + content: "\f8ff"; } + +.fa-shield-cat::before { + content: "\e572"; } + +.fa-bolt::before { + content: "\f0e7"; } + +.fa-zap::before { + content: "\f0e7"; } + +.fa-glass-water::before { + content: "\e4f4"; } + +.fa-oil-well::before { + content: "\e532"; } + +.fa-vault::before { + content: "\e2c5"; } + +.fa-mars::before { + content: "\f222"; } + +.fa-toilet::before { + content: "\f7d8"; } + +.fa-plane-circle-xmark::before { + content: "\e557"; } + +.fa-yen-sign::before { + content: "\f157"; } + +.fa-cny::before { + content: "\f157"; } + +.fa-jpy::before { + content: "\f157"; } + +.fa-rmb::before { + content: "\f157"; } + +.fa-yen::before { + content: "\f157"; } + +.fa-ruble-sign::before { + content: "\f158"; } + +.fa-rouble::before { + content: "\f158"; } + +.fa-rub::before { + content: "\f158"; } + +.fa-ruble::before { + content: "\f158"; } + +.fa-sun::before { + content: "\f185"; } + +.fa-guitar::before { + content: "\f7a6"; } + +.fa-face-laugh-wink::before { + content: "\f59c"; } + +.fa-laugh-wink::before { + content: "\f59c"; } + +.fa-horse-head::before { + content: "\f7ab"; } + +.fa-bore-hole::before { + content: "\e4c3"; } + +.fa-industry::before { + content: "\f275"; } + +.fa-circle-down::before { + content: "\f358"; } + +.fa-arrow-alt-circle-down::before { + content: "\f358"; } + +.fa-arrows-turn-to-dots::before { + content: "\e4c1"; } + +.fa-florin-sign::before { + content: "\e184"; } + +.fa-arrow-down-short-wide::before { + content: "\f884"; } + +.fa-sort-amount-desc::before { + content: "\f884"; } + +.fa-sort-amount-down-alt::before { + content: "\f884"; } + +.fa-less-than::before { + content: "\3c"; } + +.fa-angle-down::before { + content: "\f107"; } + +.fa-car-tunnel::before { + content: "\e4de"; } + +.fa-head-side-cough::before { + content: "\e061"; } + +.fa-grip-lines::before { + content: "\f7a4"; } + +.fa-thumbs-down::before { + content: "\f165"; } + +.fa-user-lock::before { + content: "\f502"; } + +.fa-arrow-right-long::before { + content: "\f178"; } + +.fa-long-arrow-right::before { + content: "\f178"; } + +.fa-anchor-circle-xmark::before { + content: "\e4ac"; } + +.fa-ellipsis::before { + content: "\f141"; } + +.fa-ellipsis-h::before { + content: "\f141"; } + +.fa-chess-pawn::before { + content: "\f443"; } + +.fa-kit-medical::before { + content: "\f479"; } + +.fa-first-aid::before { + content: "\f479"; } + +.fa-person-through-window::before { + content: "\e5a9"; } + +.fa-toolbox::before { + content: "\f552"; } + +.fa-hands-holding-circle::before { + content: "\e4fb"; } + +.fa-bug::before { + content: "\f188"; } + +.fa-credit-card::before { + content: "\f09d"; } + +.fa-credit-card-alt::before { + content: "\f09d"; } + +.fa-car::before { + content: "\f1b9"; } + +.fa-automobile::before { + content: "\f1b9"; } + +.fa-hand-holding-hand::before { + content: "\e4f7"; } + +.fa-book-open-reader::before { + content: "\f5da"; } + +.fa-book-reader::before { + content: "\f5da"; } + +.fa-mountain-sun::before { + content: "\e52f"; } + +.fa-arrows-left-right-to-line::before { + content: "\e4ba"; } + +.fa-dice-d20::before { + content: "\f6cf"; } + +.fa-truck-droplet::before { + content: "\e58c"; } + +.fa-file-circle-xmark::before { + content: "\e5a1"; } + +.fa-temperature-arrow-up::before { + content: "\e040"; } + +.fa-temperature-up::before { + content: "\e040"; } + +.fa-medal::before { + content: "\f5a2"; } + +.fa-bed::before { + content: "\f236"; } + +.fa-square-h::before { + content: "\f0fd"; } + +.fa-h-square::before { + content: "\f0fd"; } + +.fa-podcast::before { + content: "\f2ce"; } + +.fa-temperature-full::before { + content: "\f2c7"; } + +.fa-temperature-4::before { + content: "\f2c7"; } + +.fa-thermometer-4::before { + content: "\f2c7"; } + +.fa-thermometer-full::before { + content: "\f2c7"; } + +.fa-bell::before { + content: "\f0f3"; } + +.fa-superscript::before { + content: "\f12b"; } + +.fa-plug-circle-xmark::before { + content: "\e560"; } + +.fa-star-of-life::before { + content: "\f621"; } + +.fa-phone-slash::before { + content: "\f3dd"; } + +.fa-paint-roller::before { + content: "\f5aa"; } + +.fa-handshake-angle::before { + content: "\f4c4"; } + +.fa-hands-helping::before { + content: "\f4c4"; } + +.fa-location-dot::before { + content: "\f3c5"; } + +.fa-map-marker-alt::before { + content: "\f3c5"; } + +.fa-file::before { + content: "\f15b"; } + +.fa-greater-than::before { + content: "\3e"; } + +.fa-person-swimming::before { + content: "\f5c4"; } + +.fa-swimmer::before { + content: "\f5c4"; } + +.fa-arrow-down::before { + content: "\f063"; } + +.fa-droplet::before { + content: "\f043"; } + +.fa-tint::before { + content: "\f043"; } + +.fa-eraser::before { + content: "\f12d"; } + +.fa-earth-americas::before { + content: "\f57d"; } + +.fa-earth::before { + content: "\f57d"; } + +.fa-earth-america::before { + content: "\f57d"; } + +.fa-globe-americas::before { + content: "\f57d"; } + +.fa-person-burst::before { + content: "\e53b"; } + +.fa-dove::before { + content: "\f4ba"; } + +.fa-battery-empty::before { + content: "\f244"; } + +.fa-battery-0::before { + content: "\f244"; } + +.fa-socks::before { + content: "\f696"; } + +.fa-inbox::before { + content: "\f01c"; } + +.fa-section::before { + content: "\e447"; } + +.fa-gauge-high::before { + content: "\f625"; } + +.fa-tachometer-alt::before { + content: "\f625"; } + +.fa-tachometer-alt-fast::before { + content: "\f625"; } + +.fa-envelope-open-text::before { + content: "\f658"; } + +.fa-hospital::before { + content: "\f0f8"; } + +.fa-hospital-alt::before { + content: "\f0f8"; } + +.fa-hospital-wide::before { + content: "\f0f8"; } + +.fa-wine-bottle::before { + content: "\f72f"; } + +.fa-chess-rook::before { + content: "\f447"; } + +.fa-bars-staggered::before { + content: "\f550"; } + +.fa-reorder::before { + content: "\f550"; } + +.fa-stream::before { + content: "\f550"; } + +.fa-dharmachakra::before { + content: "\f655"; } + +.fa-hotdog::before { + content: "\f80f"; } + +.fa-person-walking-with-cane::before { + content: "\f29d"; } + +.fa-blind::before { + content: "\f29d"; } + +.fa-drum::before { + content: "\f569"; } + +.fa-ice-cream::before { + content: "\f810"; } + +.fa-heart-circle-bolt::before { + content: "\e4fc"; } + +.fa-fax::before { + content: "\f1ac"; } + +.fa-paragraph::before { + content: "\f1dd"; } + +.fa-check-to-slot::before { + content: "\f772"; } + +.fa-vote-yea::before { + content: "\f772"; } + +.fa-star-half::before { + content: "\f089"; } + +.fa-boxes-stacked::before { + content: "\f468"; } + +.fa-boxes::before { + content: "\f468"; } + +.fa-boxes-alt::before { + content: "\f468"; } + +.fa-link::before { + content: "\f0c1"; } + +.fa-chain::before { + content: "\f0c1"; } + +.fa-ear-listen::before { + content: "\f2a2"; } + +.fa-assistive-listening-systems::before { + content: "\f2a2"; } + +.fa-tree-city::before { + content: "\e587"; } + +.fa-play::before { + content: "\f04b"; } + +.fa-font::before { + content: "\f031"; } + +.fa-table-cells-row-lock::before { + content: "\e67a"; } + +.fa-rupiah-sign::before { + content: "\e23d"; } + +.fa-magnifying-glass::before { + content: "\f002"; } + +.fa-search::before { + content: "\f002"; } + +.fa-table-tennis-paddle-ball::before { + content: "\f45d"; } + +.fa-ping-pong-paddle-ball::before { + content: "\f45d"; } + +.fa-table-tennis::before { + content: "\f45d"; } + +.fa-person-dots-from-line::before { + content: "\f470"; } + +.fa-diagnoses::before { + content: "\f470"; } + +.fa-trash-can-arrow-up::before { + content: "\f82a"; } + +.fa-trash-restore-alt::before { + content: "\f82a"; } + +.fa-naira-sign::before { + content: "\e1f6"; } + +.fa-cart-arrow-down::before { + content: "\f218"; } + +.fa-walkie-talkie::before { + content: "\f8ef"; } + +.fa-file-pen::before { + content: "\f31c"; } + +.fa-file-edit::before { + content: "\f31c"; } + +.fa-receipt::before { + content: "\f543"; } + +.fa-square-pen::before { + content: "\f14b"; } + +.fa-pen-square::before { + content: "\f14b"; } + +.fa-pencil-square::before { + content: "\f14b"; } + +.fa-suitcase-rolling::before { + content: "\f5c1"; } + +.fa-person-circle-exclamation::before { + content: "\e53f"; } + +.fa-chevron-down::before { + content: "\f078"; } + +.fa-battery-full::before { + content: "\f240"; } + +.fa-battery::before { + content: "\f240"; } + +.fa-battery-5::before { + content: "\f240"; } + +.fa-skull-crossbones::before { + content: "\f714"; } + +.fa-code-compare::before { + content: "\e13a"; } + +.fa-list-ul::before { + content: "\f0ca"; } + +.fa-list-dots::before { + content: "\f0ca"; } + +.fa-school-lock::before { + content: "\e56f"; } + +.fa-tower-cell::before { + content: "\e585"; } + +.fa-down-long::before { + content: "\f309"; } + +.fa-long-arrow-alt-down::before { + content: "\f309"; } + +.fa-ranking-star::before { + content: "\e561"; } + +.fa-chess-king::before { + content: "\f43f"; } + +.fa-person-harassing::before { + content: "\e549"; } + +.fa-brazilian-real-sign::before { + content: "\e46c"; } + +.fa-landmark-dome::before { + content: "\f752"; } + +.fa-landmark-alt::before { + content: "\f752"; } + +.fa-arrow-up::before { + content: "\f062"; } + +.fa-tv::before { + content: "\f26c"; } + +.fa-television::before { + content: "\f26c"; } + +.fa-tv-alt::before { + content: "\f26c"; } + +.fa-shrimp::before { + content: "\e448"; } + +.fa-list-check::before { + content: "\f0ae"; } + +.fa-tasks::before { + content: "\f0ae"; } + +.fa-jug-detergent::before { + content: "\e519"; } + +.fa-circle-user::before { + content: "\f2bd"; } + +.fa-user-circle::before { + content: "\f2bd"; } + +.fa-user-shield::before { + content: "\f505"; } + +.fa-wind::before { + content: "\f72e"; } + +.fa-car-burst::before { + content: "\f5e1"; } + +.fa-car-crash::before { + content: "\f5e1"; } + +.fa-y::before { + content: "\59"; } + +.fa-person-snowboarding::before { + content: "\f7ce"; } + +.fa-snowboarding::before { + content: "\f7ce"; } + +.fa-truck-fast::before { + content: "\f48b"; } + +.fa-shipping-fast::before { + content: "\f48b"; } + +.fa-fish::before { + content: "\f578"; } + +.fa-user-graduate::before { + content: "\f501"; } + +.fa-circle-half-stroke::before { + content: "\f042"; } + +.fa-adjust::before { + content: "\f042"; } + +.fa-clapperboard::before { + content: "\e131"; } + +.fa-circle-radiation::before { + content: "\f7ba"; } + +.fa-radiation-alt::before { + content: "\f7ba"; } + +.fa-baseball::before { + content: "\f433"; } + +.fa-baseball-ball::before { + content: "\f433"; } + +.fa-jet-fighter-up::before { + content: "\e518"; } + +.fa-diagram-project::before { + content: "\f542"; } + +.fa-project-diagram::before { + content: "\f542"; } + +.fa-copy::before { + content: "\f0c5"; } + +.fa-volume-xmark::before { + content: "\f6a9"; } + +.fa-volume-mute::before { + content: "\f6a9"; } + +.fa-volume-times::before { + content: "\f6a9"; } + +.fa-hand-sparkles::before { + content: "\e05d"; } + +.fa-grip::before { + content: "\f58d"; } + +.fa-grip-horizontal::before { + content: "\f58d"; } + +.fa-share-from-square::before { + content: "\f14d"; } + +.fa-share-square::before { + content: "\f14d"; } + +.fa-child-combatant::before { + content: "\e4e0"; } + +.fa-child-rifle::before { + content: "\e4e0"; } + +.fa-gun::before { + content: "\e19b"; } + +.fa-square-phone::before { + content: "\f098"; } + +.fa-phone-square::before { + content: "\f098"; } + +.fa-plus::before { + content: "\2b"; } + +.fa-add::before { + content: "\2b"; } + +.fa-expand::before { + content: "\f065"; } + +.fa-computer::before { + content: "\e4e5"; } + +.fa-xmark::before { + content: "\f00d"; } + +.fa-close::before { + content: "\f00d"; } + +.fa-multiply::before { + content: "\f00d"; } + +.fa-remove::before { + content: "\f00d"; } + +.fa-times::before { + content: "\f00d"; } + +.fa-arrows-up-down-left-right::before { + content: "\f047"; } + +.fa-arrows::before { + content: "\f047"; } + +.fa-chalkboard-user::before { + content: "\f51c"; } + +.fa-chalkboard-teacher::before { + content: "\f51c"; } + +.fa-peso-sign::before { + content: "\e222"; } + +.fa-building-shield::before { + content: "\e4d8"; } + +.fa-baby::before { + content: "\f77c"; } + +.fa-users-line::before { + content: "\e592"; } + +.fa-quote-left::before { + content: "\f10d"; } + +.fa-quote-left-alt::before { + content: "\f10d"; } + +.fa-tractor::before { + content: "\f722"; } + +.fa-trash-arrow-up::before { + content: "\f829"; } + +.fa-trash-restore::before { + content: "\f829"; } + +.fa-arrow-down-up-lock::before { + content: "\e4b0"; } + +.fa-lines-leaning::before { + content: "\e51e"; } + +.fa-ruler-combined::before { + content: "\f546"; } + +.fa-copyright::before { + content: "\f1f9"; } + +.fa-equals::before { + content: "\3d"; } + +.fa-blender::before { + content: "\f517"; } + +.fa-teeth::before { + content: "\f62e"; } + +.fa-shekel-sign::before { + content: "\f20b"; } + +.fa-ils::before { + content: "\f20b"; } + +.fa-shekel::before { + content: "\f20b"; } + +.fa-sheqel::before { + content: "\f20b"; } + +.fa-sheqel-sign::before { + content: "\f20b"; } + +.fa-map::before { + content: "\f279"; } + +.fa-rocket::before { + content: "\f135"; } + +.fa-photo-film::before { + content: "\f87c"; } + +.fa-photo-video::before { + content: "\f87c"; } + +.fa-folder-minus::before { + content: "\f65d"; } + +.fa-store::before { + content: "\f54e"; } + +.fa-arrow-trend-up::before { + content: "\e098"; } + +.fa-plug-circle-minus::before { + content: "\e55e"; } + +.fa-sign-hanging::before { + content: "\f4d9"; } + +.fa-sign::before { + content: "\f4d9"; } + +.fa-bezier-curve::before { + content: "\f55b"; } + +.fa-bell-slash::before { + content: "\f1f6"; } + +.fa-tablet::before { + content: "\f3fb"; } + +.fa-tablet-android::before { + content: "\f3fb"; } + +.fa-school-flag::before { + content: "\e56e"; } + +.fa-fill::before { + content: "\f575"; } + +.fa-angle-up::before { + content: "\f106"; } + +.fa-drumstick-bite::before { + content: "\f6d7"; } + +.fa-holly-berry::before { + content: "\f7aa"; } + +.fa-chevron-left::before { + content: "\f053"; } + +.fa-bacteria::before { + content: "\e059"; } + +.fa-hand-lizard::before { + content: "\f258"; } + +.fa-notdef::before { + content: "\e1fe"; } + +.fa-disease::before { + content: "\f7fa"; } + +.fa-briefcase-medical::before { + content: "\f469"; } + +.fa-genderless::before { + content: "\f22d"; } + +.fa-chevron-right::before { + content: "\f054"; } + +.fa-retweet::before { + content: "\f079"; } + +.fa-car-rear::before { + content: "\f5de"; } + +.fa-car-alt::before { + content: "\f5de"; } + +.fa-pump-soap::before { + content: "\e06b"; } + +.fa-video-slash::before { + content: "\f4e2"; } + +.fa-battery-quarter::before { + content: "\f243"; } + +.fa-battery-2::before { + content: "\f243"; } + +.fa-radio::before { + content: "\f8d7"; } + +.fa-baby-carriage::before { + content: "\f77d"; } + +.fa-carriage-baby::before { + content: "\f77d"; } + +.fa-traffic-light::before { + content: "\f637"; } + +.fa-thermometer::before { + content: "\f491"; } + +.fa-vr-cardboard::before { + content: "\f729"; } + +.fa-hand-middle-finger::before { + content: "\f806"; } + +.fa-percent::before { + content: "\25"; } + +.fa-percentage::before { + content: "\25"; } + +.fa-truck-moving::before { + content: "\f4df"; } + +.fa-glass-water-droplet::before { + content: "\e4f5"; } + +.fa-display::before { + content: "\e163"; } + +.fa-face-smile::before { + content: "\f118"; } + +.fa-smile::before { + content: "\f118"; } + +.fa-thumbtack::before { + content: "\f08d"; } + +.fa-thumb-tack::before { + content: "\f08d"; } + +.fa-trophy::before { + content: "\f091"; } + +.fa-person-praying::before { + content: "\f683"; } + +.fa-pray::before { + content: "\f683"; } + +.fa-hammer::before { + content: "\f6e3"; } + +.fa-hand-peace::before { + content: "\f25b"; } + +.fa-rotate::before { + content: "\f2f1"; } + +.fa-sync-alt::before { + content: "\f2f1"; } + +.fa-spinner::before { + content: "\f110"; } + +.fa-robot::before { + content: "\f544"; } + +.fa-peace::before { + content: "\f67c"; } + +.fa-gears::before { + content: "\f085"; } + +.fa-cogs::before { + content: "\f085"; } + +.fa-warehouse::before { + content: "\f494"; } + +.fa-arrow-up-right-dots::before { + content: "\e4b7"; } + +.fa-splotch::before { + content: "\f5bc"; } + +.fa-face-grin-hearts::before { + content: "\f584"; } + +.fa-grin-hearts::before { + content: "\f584"; } + +.fa-dice-four::before { + content: "\f524"; } + +.fa-sim-card::before { + content: "\f7c4"; } + +.fa-transgender::before { + content: "\f225"; } + +.fa-transgender-alt::before { + content: "\f225"; } + +.fa-mercury::before { + content: "\f223"; } + +.fa-arrow-turn-down::before { + content: "\f149"; } + +.fa-level-down::before { + content: "\f149"; } + +.fa-person-falling-burst::before { + content: "\e547"; } + +.fa-award::before { + content: "\f559"; } + +.fa-ticket-simple::before { + content: "\f3ff"; } + +.fa-ticket-alt::before { + content: "\f3ff"; } + +.fa-building::before { + content: "\f1ad"; } + +.fa-angles-left::before { + content: "\f100"; } + +.fa-angle-double-left::before { + content: "\f100"; } + +.fa-qrcode::before { + content: "\f029"; } + +.fa-clock-rotate-left::before { + content: "\f1da"; } + +.fa-history::before { + content: "\f1da"; } + +.fa-face-grin-beam-sweat::before { + content: "\f583"; } + +.fa-grin-beam-sweat::before { + content: "\f583"; } + +.fa-file-export::before { + content: "\f56e"; } + +.fa-arrow-right-from-file::before { + content: "\f56e"; } + +.fa-shield::before { + content: "\f132"; } + +.fa-shield-blank::before { + content: "\f132"; } + +.fa-arrow-up-short-wide::before { + content: "\f885"; } + +.fa-sort-amount-up-alt::before { + content: "\f885"; } + +.fa-house-medical::before { + content: "\e3b2"; } + +.fa-golf-ball-tee::before { + content: "\f450"; } + +.fa-golf-ball::before { + content: "\f450"; } + +.fa-circle-chevron-left::before { + content: "\f137"; } + +.fa-chevron-circle-left::before { + content: "\f137"; } + +.fa-house-chimney-window::before { + content: "\e00d"; } + +.fa-pen-nib::before { + content: "\f5ad"; } + +.fa-tent-arrow-turn-left::before { + content: "\e580"; } + +.fa-tents::before { + content: "\e582"; } + +.fa-wand-magic::before { + content: "\f0d0"; } + +.fa-magic::before { + content: "\f0d0"; } + +.fa-dog::before { + content: "\f6d3"; } + +.fa-carrot::before { + content: "\f787"; } + +.fa-moon::before { + content: "\f186"; } + +.fa-wine-glass-empty::before { + content: "\f5ce"; } + +.fa-wine-glass-alt::before { + content: "\f5ce"; } + +.fa-cheese::before { + content: "\f7ef"; } + +.fa-yin-yang::before { + content: "\f6ad"; } + +.fa-music::before { + content: "\f001"; } + +.fa-code-commit::before { + content: "\f386"; } + +.fa-temperature-low::before { + content: "\f76b"; } + +.fa-person-biking::before { + content: "\f84a"; } + +.fa-biking::before { + content: "\f84a"; } + +.fa-broom::before { + content: "\f51a"; } + +.fa-shield-heart::before { + content: "\e574"; } + +.fa-gopuram::before { + content: "\f664"; } + +.fa-earth-oceania::before { + content: "\e47b"; } + +.fa-globe-oceania::before { + content: "\e47b"; } + +.fa-square-xmark::before { + content: "\f2d3"; } + +.fa-times-square::before { + content: "\f2d3"; } + +.fa-xmark-square::before { + content: "\f2d3"; } + +.fa-hashtag::before { + content: "\23"; } + +.fa-up-right-and-down-left-from-center::before { + content: "\f424"; } + +.fa-expand-alt::before { + content: "\f424"; } + +.fa-oil-can::before { + content: "\f613"; } + +.fa-t::before { + content: "\54"; } + +.fa-hippo::before { + content: "\f6ed"; } + +.fa-chart-column::before { + content: "\e0e3"; } + +.fa-infinity::before { + content: "\f534"; } + +.fa-vial-circle-check::before { + content: "\e596"; } + +.fa-person-arrow-down-to-line::before { + content: "\e538"; } + +.fa-voicemail::before { + content: "\f897"; } + +.fa-fan::before { + content: "\f863"; } + +.fa-person-walking-luggage::before { + content: "\e554"; } + +.fa-up-down::before { + content: "\f338"; } + +.fa-arrows-alt-v::before { + content: "\f338"; } + +.fa-cloud-moon-rain::before { + content: "\f73c"; } + +.fa-calendar::before { + content: "\f133"; } + +.fa-trailer::before { + content: "\e041"; } + +.fa-bahai::before { + content: "\f666"; } + +.fa-haykal::before { + content: "\f666"; } + +.fa-sd-card::before { + content: "\f7c2"; } + +.fa-dragon::before { + content: "\f6d5"; } + +.fa-shoe-prints::before { + content: "\f54b"; } + +.fa-circle-plus::before { + content: "\f055"; } + +.fa-plus-circle::before { + content: "\f055"; } + +.fa-face-grin-tongue-wink::before { + content: "\f58b"; } + +.fa-grin-tongue-wink::before { + content: "\f58b"; } + +.fa-hand-holding::before { + content: "\f4bd"; } + +.fa-plug-circle-exclamation::before { + content: "\e55d"; } + +.fa-link-slash::before { + content: "\f127"; } + +.fa-chain-broken::before { + content: "\f127"; } + +.fa-chain-slash::before { + content: "\f127"; } + +.fa-unlink::before { + content: "\f127"; } + +.fa-clone::before { + content: "\f24d"; } + +.fa-person-walking-arrow-loop-left::before { + content: "\e551"; } + +.fa-arrow-up-z-a::before { + content: "\f882"; } + +.fa-sort-alpha-up-alt::before { + content: "\f882"; } + +.fa-fire-flame-curved::before { + content: "\f7e4"; } + +.fa-fire-alt::before { + content: "\f7e4"; } + +.fa-tornado::before { + content: "\f76f"; } + +.fa-file-circle-plus::before { + content: "\e494"; } + +.fa-book-quran::before { + content: "\f687"; } + +.fa-quran::before { + content: "\f687"; } + +.fa-anchor::before { + content: "\f13d"; } + +.fa-border-all::before { + content: "\f84c"; } + +.fa-face-angry::before { + content: "\f556"; } + +.fa-angry::before { + content: "\f556"; } + +.fa-cookie-bite::before { + content: "\f564"; } + +.fa-arrow-trend-down::before { + content: "\e097"; } + +.fa-rss::before { + content: "\f09e"; } + +.fa-feed::before { + content: "\f09e"; } + +.fa-draw-polygon::before { + content: "\f5ee"; } + +.fa-scale-balanced::before { + content: "\f24e"; } + +.fa-balance-scale::before { + content: "\f24e"; } + +.fa-gauge-simple-high::before { + content: "\f62a"; } + +.fa-tachometer::before { + content: "\f62a"; } + +.fa-tachometer-fast::before { + content: "\f62a"; } + +.fa-shower::before { + content: "\f2cc"; } + +.fa-desktop::before { + content: "\f390"; } + +.fa-desktop-alt::before { + content: "\f390"; } + +.fa-m::before { + content: "\4d"; } + +.fa-table-list::before { + content: "\f00b"; } + +.fa-th-list::before { + content: "\f00b"; } + +.fa-comment-sms::before { + content: "\f7cd"; } + +.fa-sms::before { + content: "\f7cd"; } + +.fa-book::before { + content: "\f02d"; } + +.fa-user-plus::before { + content: "\f234"; } + +.fa-check::before { + content: "\f00c"; } + +.fa-battery-three-quarters::before { + content: "\f241"; } + +.fa-battery-4::before { + content: "\f241"; } + +.fa-house-circle-check::before { + content: "\e509"; } + +.fa-angle-left::before { + content: "\f104"; } + +.fa-diagram-successor::before { + content: "\e47a"; } + +.fa-truck-arrow-right::before { + content: "\e58b"; } + +.fa-arrows-split-up-and-left::before { + content: "\e4bc"; } + +.fa-hand-fist::before { + content: "\f6de"; } + +.fa-fist-raised::before { + content: "\f6de"; } + +.fa-cloud-moon::before { + content: "\f6c3"; } + +.fa-briefcase::before { + content: "\f0b1"; } + +.fa-person-falling::before { + content: "\e546"; } + +.fa-image-portrait::before { + content: "\f3e0"; } + +.fa-portrait::before { + content: "\f3e0"; } + +.fa-user-tag::before { + content: "\f507"; } + +.fa-rug::before { + content: "\e569"; } + +.fa-earth-europe::before { + content: "\f7a2"; } + +.fa-globe-europe::before { + content: "\f7a2"; } + +.fa-cart-flatbed-suitcase::before { + content: "\f59d"; } + +.fa-luggage-cart::before { + content: "\f59d"; } + +.fa-rectangle-xmark::before { + content: "\f410"; } + +.fa-rectangle-times::before { + content: "\f410"; } + +.fa-times-rectangle::before { + content: "\f410"; } + +.fa-window-close::before { + content: "\f410"; } + +.fa-baht-sign::before { + content: "\e0ac"; } + +.fa-book-open::before { + content: "\f518"; } + +.fa-book-journal-whills::before { + content: "\f66a"; } + +.fa-journal-whills::before { + content: "\f66a"; } + +.fa-handcuffs::before { + content: "\e4f8"; } + +.fa-triangle-exclamation::before { + content: "\f071"; } + +.fa-exclamation-triangle::before { + content: "\f071"; } + +.fa-warning::before { + content: "\f071"; } + +.fa-database::before { + content: "\f1c0"; } + +.fa-share::before { + content: "\f064"; } + +.fa-mail-forward::before { + content: "\f064"; } + +.fa-bottle-droplet::before { + content: "\e4c4"; } + +.fa-mask-face::before { + content: "\e1d7"; } + +.fa-hill-rockslide::before { + content: "\e508"; } + +.fa-right-left::before { + content: "\f362"; } + +.fa-exchange-alt::before { + content: "\f362"; } + +.fa-paper-plane::before { + content: "\f1d8"; } + +.fa-road-circle-exclamation::before { + content: "\e565"; } + +.fa-dungeon::before { + content: "\f6d9"; } + +.fa-align-right::before { + content: "\f038"; } + +.fa-money-bill-1-wave::before { + content: "\f53b"; } + +.fa-money-bill-wave-alt::before { + content: "\f53b"; } + +.fa-life-ring::before { + content: "\f1cd"; } + +.fa-hands::before { + content: "\f2a7"; } + +.fa-sign-language::before { + content: "\f2a7"; } + +.fa-signing::before { + content: "\f2a7"; } + +.fa-calendar-day::before { + content: "\f783"; } + +.fa-water-ladder::before { + content: "\f5c5"; } + +.fa-ladder-water::before { + content: "\f5c5"; } + +.fa-swimming-pool::before { + content: "\f5c5"; } + +.fa-arrows-up-down::before { + content: "\f07d"; } + +.fa-arrows-v::before { + content: "\f07d"; } + +.fa-face-grimace::before { + content: "\f57f"; } + +.fa-grimace::before { + content: "\f57f"; } + +.fa-wheelchair-move::before { + content: "\e2ce"; } + +.fa-wheelchair-alt::before { + content: "\e2ce"; } + +.fa-turn-down::before { + content: "\f3be"; } + +.fa-level-down-alt::before { + content: "\f3be"; } + +.fa-person-walking-arrow-right::before { + content: "\e552"; } + +.fa-square-envelope::before { + content: "\f199"; } + +.fa-envelope-square::before { + content: "\f199"; } + +.fa-dice::before { + content: "\f522"; } + +.fa-bowling-ball::before { + content: "\f436"; } + +.fa-brain::before { + content: "\f5dc"; } + +.fa-bandage::before { + content: "\f462"; } + +.fa-band-aid::before { + content: "\f462"; } + +.fa-calendar-minus::before { + content: "\f272"; } + +.fa-circle-xmark::before { + content: "\f057"; } + +.fa-times-circle::before { + content: "\f057"; } + +.fa-xmark-circle::before { + content: "\f057"; } + +.fa-gifts::before { + content: "\f79c"; } + +.fa-hotel::before { + content: "\f594"; } + +.fa-earth-asia::before { + content: "\f57e"; } + +.fa-globe-asia::before { + content: "\f57e"; } + +.fa-id-card-clip::before { + content: "\f47f"; } + +.fa-id-card-alt::before { + content: "\f47f"; } + +.fa-magnifying-glass-plus::before { + content: "\f00e"; } + +.fa-search-plus::before { + content: "\f00e"; } + +.fa-thumbs-up::before { + content: "\f164"; } + +.fa-user-clock::before { + content: "\f4fd"; } + +.fa-hand-dots::before { + content: "\f461"; } + +.fa-allergies::before { + content: "\f461"; } + +.fa-file-invoice::before { + content: "\f570"; } + +.fa-window-minimize::before { + content: "\f2d1"; } + +.fa-mug-saucer::before { + content: "\f0f4"; } + +.fa-coffee::before { + content: "\f0f4"; } + +.fa-brush::before { + content: "\f55d"; } + +.fa-mask::before { + content: "\f6fa"; } + +.fa-magnifying-glass-minus::before { + content: "\f010"; } + +.fa-search-minus::before { + content: "\f010"; } + +.fa-ruler-vertical::before { + content: "\f548"; } + +.fa-user-large::before { + content: "\f406"; } + +.fa-user-alt::before { + content: "\f406"; } + +.fa-train-tram::before { + content: "\e5b4"; } + +.fa-user-nurse::before { + content: "\f82f"; } + +.fa-syringe::before { + content: "\f48e"; } + +.fa-cloud-sun::before { + content: "\f6c4"; } + +.fa-stopwatch-20::before { + content: "\e06f"; } + +.fa-square-full::before { + content: "\f45c"; } + +.fa-magnet::before { + content: "\f076"; } + +.fa-jar::before { + content: "\e516"; } + +.fa-note-sticky::before { + content: "\f249"; } + +.fa-sticky-note::before { + content: "\f249"; } + +.fa-bug-slash::before { + content: "\e490"; } + +.fa-arrow-up-from-water-pump::before { + content: "\e4b6"; } + +.fa-bone::before { + content: "\f5d7"; } + +.fa-user-injured::before { + content: "\f728"; } + +.fa-face-sad-tear::before { + content: "\f5b4"; } + +.fa-sad-tear::before { + content: "\f5b4"; } + +.fa-plane::before { + content: "\f072"; } + +.fa-tent-arrows-down::before { + content: "\e581"; } + +.fa-exclamation::before { + content: "\21"; } + +.fa-arrows-spin::before { + content: "\e4bb"; } + +.fa-print::before { + content: "\f02f"; } + +.fa-turkish-lira-sign::before { + content: "\e2bb"; } + +.fa-try::before { + content: "\e2bb"; } + +.fa-turkish-lira::before { + content: "\e2bb"; } + +.fa-dollar-sign::before { + content: "\24"; } + +.fa-dollar::before { + content: "\24"; } + +.fa-usd::before { + content: "\24"; } + +.fa-x::before { + content: "\58"; } + +.fa-magnifying-glass-dollar::before { + content: "\f688"; } + +.fa-search-dollar::before { + content: "\f688"; } + +.fa-users-gear::before { + content: "\f509"; } + +.fa-users-cog::before { + content: "\f509"; } + +.fa-person-military-pointing::before { + content: "\e54a"; } + +.fa-building-columns::before { + content: "\f19c"; } + +.fa-bank::before { + content: "\f19c"; } + +.fa-institution::before { + content: "\f19c"; } + +.fa-museum::before { + content: "\f19c"; } + +.fa-university::before { + content: "\f19c"; } + +.fa-umbrella::before { + content: "\f0e9"; } + +.fa-trowel::before { + content: "\e589"; } + +.fa-d::before { + content: "\44"; } + +.fa-stapler::before { + content: "\e5af"; } + +.fa-masks-theater::before { + content: "\f630"; } + +.fa-theater-masks::before { + content: "\f630"; } + +.fa-kip-sign::before { + content: "\e1c4"; } + +.fa-hand-point-left::before { + content: "\f0a5"; } + +.fa-handshake-simple::before { + content: "\f4c6"; } + +.fa-handshake-alt::before { + content: "\f4c6"; } + +.fa-jet-fighter::before { + content: "\f0fb"; } + +.fa-fighter-jet::before { + content: "\f0fb"; } + +.fa-square-share-nodes::before { + content: "\f1e1"; } + +.fa-share-alt-square::before { + content: "\f1e1"; } + +.fa-barcode::before { + content: "\f02a"; } + +.fa-plus-minus::before { + content: "\e43c"; } + +.fa-video::before { + content: "\f03d"; } + +.fa-video-camera::before { + content: "\f03d"; } + +.fa-graduation-cap::before { + content: "\f19d"; } + +.fa-mortar-board::before { + content: "\f19d"; } + +.fa-hand-holding-medical::before { + content: "\e05c"; } + +.fa-person-circle-check::before { + content: "\e53e"; } + +.fa-turn-up::before { + content: "\f3bf"; } + +.fa-level-up-alt::before { + content: "\f3bf"; } + +.sr-only, +.fa-sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border-width: 0; } + +.sr-only-focusable:not(:focus), +.fa-sr-only-focusable:not(:focus) { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border-width: 0; } +:root, :host { + --fa-style-family-brands: 'Font Awesome 6 Brands'; + --fa-font-brands: normal 400 1em/1 'Font Awesome 6 Brands'; } + +@font-face { + font-family: 'Font Awesome 6 Brands'; + font-style: normal; + font-weight: 400; + font-display: block; + src: url("../webfonts/fa-brands-400.woff2") format("woff2"), url("../webfonts/fa-brands-400.ttf") format("truetype"); } + +.fab, +.fa-brands { + font-weight: 400; } + +.fa-monero:before { + content: "\f3d0"; } + +.fa-hooli:before { + content: "\f427"; } + +.fa-yelp:before { + content: "\f1e9"; } + +.fa-cc-visa:before { + content: "\f1f0"; } + +.fa-lastfm:before { + content: "\f202"; } + +.fa-shopware:before { + content: "\f5b5"; } + +.fa-creative-commons-nc:before { + content: "\f4e8"; } + +.fa-aws:before { + content: "\f375"; } + +.fa-redhat:before { + content: "\f7bc"; } + +.fa-yoast:before { + content: "\f2b1"; } + +.fa-cloudflare:before { + content: "\e07d"; } + +.fa-ups:before { + content: "\f7e0"; } + +.fa-pixiv:before { + content: "\e640"; } + +.fa-wpexplorer:before { + content: "\f2de"; } + +.fa-dyalog:before { + content: "\f399"; } + +.fa-bity:before { + content: "\f37a"; } + +.fa-stackpath:before { + content: "\f842"; } + +.fa-buysellads:before { + content: "\f20d"; } + +.fa-first-order:before { + content: "\f2b0"; } + +.fa-modx:before { + content: "\f285"; } + +.fa-guilded:before { + content: "\e07e"; } + +.fa-vnv:before { + content: "\f40b"; } + +.fa-square-js:before { + content: "\f3b9"; } + +.fa-js-square:before { + content: "\f3b9"; } + +.fa-microsoft:before { + content: "\f3ca"; } + +.fa-qq:before { + content: "\f1d6"; } + +.fa-orcid:before { + content: "\f8d2"; } + +.fa-java:before { + content: "\f4e4"; } + +.fa-invision:before { + content: "\f7b0"; } + +.fa-creative-commons-pd-alt:before { + content: "\f4ed"; } + +.fa-centercode:before { + content: "\f380"; } + +.fa-glide-g:before { + content: "\f2a6"; } + +.fa-drupal:before { + content: "\f1a9"; } + +.fa-jxl:before { + content: "\e67b"; } + +.fa-hire-a-helper:before { + content: "\f3b0"; } + +.fa-creative-commons-by:before { + content: "\f4e7"; } + +.fa-unity:before { + content: "\e049"; } + +.fa-whmcs:before { + content: "\f40d"; } + +.fa-rocketchat:before { + content: "\f3e8"; } + +.fa-vk:before { + content: "\f189"; } + +.fa-untappd:before { + content: "\f405"; } + +.fa-mailchimp:before { + content: "\f59e"; } + +.fa-css3-alt:before { + content: "\f38b"; } + +.fa-square-reddit:before { + content: "\f1a2"; } + +.fa-reddit-square:before { + content: "\f1a2"; } + +.fa-vimeo-v:before { + content: "\f27d"; } + +.fa-contao:before { + content: "\f26d"; } + +.fa-square-font-awesome:before { + content: "\e5ad"; } + +.fa-deskpro:before { + content: "\f38f"; } + +.fa-brave:before { + content: "\e63c"; } + +.fa-sistrix:before { + content: "\f3ee"; } + +.fa-square-instagram:before { + content: "\e055"; } + +.fa-instagram-square:before { + content: "\e055"; } + +.fa-battle-net:before { + content: "\f835"; } + +.fa-the-red-yeti:before { + content: "\f69d"; } + +.fa-square-hacker-news:before { + content: "\f3af"; } + +.fa-hacker-news-square:before { + content: "\f3af"; } + +.fa-edge:before { + content: "\f282"; } + +.fa-threads:before { + content: "\e618"; } + +.fa-napster:before { + content: "\f3d2"; } + +.fa-square-snapchat:before { + content: "\f2ad"; } + +.fa-snapchat-square:before { + content: "\f2ad"; } + +.fa-google-plus-g:before { + content: "\f0d5"; } + +.fa-artstation:before { + content: "\f77a"; } + +.fa-markdown:before { + content: "\f60f"; } + +.fa-sourcetree:before { + content: "\f7d3"; } + +.fa-google-plus:before { + content: "\f2b3"; } + +.fa-diaspora:before { + content: "\f791"; } + +.fa-foursquare:before { + content: "\f180"; } + +.fa-stack-overflow:before { + content: "\f16c"; } + +.fa-github-alt:before { + content: "\f113"; } + +.fa-phoenix-squadron:before { + content: "\f511"; } + +.fa-pagelines:before { + content: "\f18c"; } + +.fa-algolia:before { + content: "\f36c"; } + +.fa-red-river:before { + content: "\f3e3"; } + +.fa-creative-commons-sa:before { + content: "\f4ef"; } + +.fa-safari:before { + content: "\f267"; } + +.fa-google:before { + content: "\f1a0"; } + +.fa-square-font-awesome-stroke:before { + content: "\f35c"; } + +.fa-font-awesome-alt:before { + content: "\f35c"; } + +.fa-atlassian:before { + content: "\f77b"; } + +.fa-linkedin-in:before { + content: "\f0e1"; } + +.fa-digital-ocean:before { + content: "\f391"; } + +.fa-nimblr:before { + content: "\f5a8"; } + +.fa-chromecast:before { + content: "\f838"; } + +.fa-evernote:before { + content: "\f839"; } + +.fa-hacker-news:before { + content: "\f1d4"; } + +.fa-creative-commons-sampling:before { + content: "\f4f0"; } + +.fa-adversal:before { + content: "\f36a"; } + +.fa-creative-commons:before { + content: "\f25e"; } + +.fa-watchman-monitoring:before { + content: "\e087"; } + +.fa-fonticons:before { + content: "\f280"; } + +.fa-weixin:before { + content: "\f1d7"; } + +.fa-shirtsinbulk:before { + content: "\f214"; } + +.fa-codepen:before { + content: "\f1cb"; } + +.fa-git-alt:before { + content: "\f841"; } + +.fa-lyft:before { + content: "\f3c3"; } + +.fa-rev:before { + content: "\f5b2"; } + +.fa-windows:before { + content: "\f17a"; } + +.fa-wizards-of-the-coast:before { + content: "\f730"; } + +.fa-square-viadeo:before { + content: "\f2aa"; } + +.fa-viadeo-square:before { + content: "\f2aa"; } + +.fa-meetup:before { + content: "\f2e0"; } + +.fa-centos:before { + content: "\f789"; } + +.fa-adn:before { + content: "\f170"; } + +.fa-cloudsmith:before { + content: "\f384"; } + +.fa-opensuse:before { + content: "\e62b"; } + +.fa-pied-piper-alt:before { + content: "\f1a8"; } + +.fa-square-dribbble:before { + content: "\f397"; } + +.fa-dribbble-square:before { + content: "\f397"; } + +.fa-codiepie:before { + content: "\f284"; } + +.fa-node:before { + content: "\f419"; } + +.fa-mix:before { + content: "\f3cb"; } + +.fa-steam:before { + content: "\f1b6"; } + +.fa-cc-apple-pay:before { + content: "\f416"; } + +.fa-scribd:before { + content: "\f28a"; } + +.fa-debian:before { + content: "\e60b"; } + +.fa-openid:before { + content: "\f19b"; } + +.fa-instalod:before { + content: "\e081"; } + +.fa-expeditedssl:before { + content: "\f23e"; } + +.fa-sellcast:before { + content: "\f2da"; } + +.fa-square-twitter:before { + content: "\f081"; } + +.fa-twitter-square:before { + content: "\f081"; } + +.fa-r-project:before { + content: "\f4f7"; } + +.fa-delicious:before { + content: "\f1a5"; } + +.fa-freebsd:before { + content: "\f3a4"; } + +.fa-vuejs:before { + content: "\f41f"; } + +.fa-accusoft:before { + content: "\f369"; } + +.fa-ioxhost:before { + content: "\f208"; } + +.fa-fonticons-fi:before { + content: "\f3a2"; } + +.fa-app-store:before { + content: "\f36f"; } + +.fa-cc-mastercard:before { + content: "\f1f1"; } + +.fa-itunes-note:before { + content: "\f3b5"; } + +.fa-golang:before { + content: "\e40f"; } + +.fa-kickstarter:before { + content: "\f3bb"; } + +.fa-square-kickstarter:before { + content: "\f3bb"; } + +.fa-grav:before { + content: "\f2d6"; } + +.fa-weibo:before { + content: "\f18a"; } + +.fa-uncharted:before { + content: "\e084"; } + +.fa-firstdraft:before { + content: "\f3a1"; } + +.fa-square-youtube:before { + content: "\f431"; } + +.fa-youtube-square:before { + content: "\f431"; } + +.fa-wikipedia-w:before { + content: "\f266"; } + +.fa-wpressr:before { + content: "\f3e4"; } + +.fa-rendact:before { + content: "\f3e4"; } + +.fa-angellist:before { + content: "\f209"; } + +.fa-galactic-republic:before { + content: "\f50c"; } + +.fa-nfc-directional:before { + content: "\e530"; } + +.fa-skype:before { + content: "\f17e"; } + +.fa-joget:before { + content: "\f3b7"; } + +.fa-fedora:before { + content: "\f798"; } + +.fa-stripe-s:before { + content: "\f42a"; } + +.fa-meta:before { + content: "\e49b"; } + +.fa-laravel:before { + content: "\f3bd"; } + +.fa-hotjar:before { + content: "\f3b1"; } + +.fa-bluetooth-b:before { + content: "\f294"; } + +.fa-square-letterboxd:before { + content: "\e62e"; } + +.fa-sticker-mule:before { + content: "\f3f7"; } + +.fa-creative-commons-zero:before { + content: "\f4f3"; } + +.fa-hips:before { + content: "\f452"; } + +.fa-behance:before { + content: "\f1b4"; } + +.fa-reddit:before { + content: "\f1a1"; } + +.fa-discord:before { + content: "\f392"; } + +.fa-chrome:before { + content: "\f268"; } + +.fa-app-store-ios:before { + content: "\f370"; } + +.fa-cc-discover:before { + content: "\f1f2"; } + +.fa-wpbeginner:before { + content: "\f297"; } + +.fa-confluence:before { + content: "\f78d"; } + +.fa-shoelace:before { + content: "\e60c"; } + +.fa-mdb:before { + content: "\f8ca"; } + +.fa-dochub:before { + content: "\f394"; } + +.fa-accessible-icon:before { + content: "\f368"; } + +.fa-ebay:before { + content: "\f4f4"; } + +.fa-amazon:before { + content: "\f270"; } + +.fa-unsplash:before { + content: "\e07c"; } + +.fa-yarn:before { + content: "\f7e3"; } + +.fa-square-steam:before { + content: "\f1b7"; } + +.fa-steam-square:before { + content: "\f1b7"; } + +.fa-500px:before { + content: "\f26e"; } + +.fa-square-vimeo:before { + content: "\f194"; } + +.fa-vimeo-square:before { + content: "\f194"; } + +.fa-asymmetrik:before { + content: "\f372"; } + +.fa-font-awesome:before { + content: "\f2b4"; } + +.fa-font-awesome-flag:before { + content: "\f2b4"; } + +.fa-font-awesome-logo-full:before { + content: "\f2b4"; } + +.fa-gratipay:before { + content: "\f184"; } + +.fa-apple:before { + content: "\f179"; } + +.fa-hive:before { + content: "\e07f"; } + +.fa-gitkraken:before { + content: "\f3a6"; } + +.fa-keybase:before { + content: "\f4f5"; } + +.fa-apple-pay:before { + content: "\f415"; } + +.fa-padlet:before { + content: "\e4a0"; } + +.fa-amazon-pay:before { + content: "\f42c"; } + +.fa-square-github:before { + content: "\f092"; } + +.fa-github-square:before { + content: "\f092"; } + +.fa-stumbleupon:before { + content: "\f1a4"; } + +.fa-fedex:before { + content: "\f797"; } + +.fa-phoenix-framework:before { + content: "\f3dc"; } + +.fa-shopify:before { + content: "\e057"; } + +.fa-neos:before { + content: "\f612"; } + +.fa-square-threads:before { + content: "\e619"; } + +.fa-hackerrank:before { + content: "\f5f7"; } + +.fa-researchgate:before { + content: "\f4f8"; } + +.fa-swift:before { + content: "\f8e1"; } + +.fa-angular:before { + content: "\f420"; } + +.fa-speakap:before { + content: "\f3f3"; } + +.fa-angrycreative:before { + content: "\f36e"; } + +.fa-y-combinator:before { + content: "\f23b"; } + +.fa-empire:before { + content: "\f1d1"; } + +.fa-envira:before { + content: "\f299"; } + +.fa-google-scholar:before { + content: "\e63b"; } + +.fa-square-gitlab:before { + content: "\e5ae"; } + +.fa-gitlab-square:before { + content: "\e5ae"; } + +.fa-studiovinari:before { + content: "\f3f8"; } + +.fa-pied-piper:before { + content: "\f2ae"; } + +.fa-wordpress:before { + content: "\f19a"; } + +.fa-product-hunt:before { + content: "\f288"; } + +.fa-firefox:before { + content: "\f269"; } + +.fa-linode:before { + content: "\f2b8"; } + +.fa-goodreads:before { + content: "\f3a8"; } + +.fa-square-odnoklassniki:before { + content: "\f264"; } + +.fa-odnoklassniki-square:before { + content: "\f264"; } + +.fa-jsfiddle:before { + content: "\f1cc"; } + +.fa-sith:before { + content: "\f512"; } + +.fa-themeisle:before { + content: "\f2b2"; } + +.fa-page4:before { + content: "\f3d7"; } + +.fa-hashnode:before { + content: "\e499"; } + +.fa-react:before { + content: "\f41b"; } + +.fa-cc-paypal:before { + content: "\f1f4"; } + +.fa-squarespace:before { + content: "\f5be"; } + +.fa-cc-stripe:before { + content: "\f1f5"; } + +.fa-creative-commons-share:before { + content: "\f4f2"; } + +.fa-bitcoin:before { + content: "\f379"; } + +.fa-keycdn:before { + content: "\f3ba"; } + +.fa-opera:before { + content: "\f26a"; } + +.fa-itch-io:before { + content: "\f83a"; } + +.fa-umbraco:before { + content: "\f8e8"; } + +.fa-galactic-senate:before { + content: "\f50d"; } + +.fa-ubuntu:before { + content: "\f7df"; } + +.fa-draft2digital:before { + content: "\f396"; } + +.fa-stripe:before { + content: "\f429"; } + +.fa-houzz:before { + content: "\f27c"; } + +.fa-gg:before { + content: "\f260"; } + +.fa-dhl:before { + content: "\f790"; } + +.fa-square-pinterest:before { + content: "\f0d3"; } + +.fa-pinterest-square:before { + content: "\f0d3"; } + +.fa-xing:before { + content: "\f168"; } + +.fa-blackberry:before { + content: "\f37b"; } + +.fa-creative-commons-pd:before { + content: "\f4ec"; } + +.fa-playstation:before { + content: "\f3df"; } + +.fa-quinscape:before { + content: "\f459"; } + +.fa-less:before { + content: "\f41d"; } + +.fa-blogger-b:before { + content: "\f37d"; } + +.fa-opencart:before { + content: "\f23d"; } + +.fa-vine:before { + content: "\f1ca"; } + +.fa-signal-messenger:before { + content: "\e663"; } + +.fa-paypal:before { + content: "\f1ed"; } + +.fa-gitlab:before { + content: "\f296"; } + +.fa-typo3:before { + content: "\f42b"; } + +.fa-reddit-alien:before { + content: "\f281"; } + +.fa-yahoo:before { + content: "\f19e"; } + +.fa-dailymotion:before { + content: "\e052"; } + +.fa-affiliatetheme:before { + content: "\f36b"; } + +.fa-pied-piper-pp:before { + content: "\f1a7"; } + +.fa-bootstrap:before { + content: "\f836"; } + +.fa-odnoklassniki:before { + content: "\f263"; } + +.fa-nfc-symbol:before { + content: "\e531"; } + +.fa-mintbit:before { + content: "\e62f"; } + +.fa-ethereum:before { + content: "\f42e"; } + +.fa-speaker-deck:before { + content: "\f83c"; } + +.fa-creative-commons-nc-eu:before { + content: "\f4e9"; } + +.fa-patreon:before { + content: "\f3d9"; } + +.fa-avianex:before { + content: "\f374"; } + +.fa-ello:before { + content: "\f5f1"; } + +.fa-gofore:before { + content: "\f3a7"; } + +.fa-bimobject:before { + content: "\f378"; } + +.fa-brave-reverse:before { + content: "\e63d"; } + +.fa-facebook-f:before { + content: "\f39e"; } + +.fa-square-google-plus:before { + content: "\f0d4"; } + +.fa-google-plus-square:before { + content: "\f0d4"; } + +.fa-web-awesome:before { + content: "\e682"; } + +.fa-mandalorian:before { + content: "\f50f"; } + +.fa-first-order-alt:before { + content: "\f50a"; } + +.fa-osi:before { + content: "\f41a"; } + +.fa-google-wallet:before { + content: "\f1ee"; } + +.fa-d-and-d-beyond:before { + content: "\f6ca"; } + +.fa-periscope:before { + content: "\f3da"; } + +.fa-fulcrum:before { + content: "\f50b"; } + +.fa-cloudscale:before { + content: "\f383"; } + +.fa-forumbee:before { + content: "\f211"; } + +.fa-mizuni:before { + content: "\f3cc"; } + +.fa-schlix:before { + content: "\f3ea"; } + +.fa-square-xing:before { + content: "\f169"; } + +.fa-xing-square:before { + content: "\f169"; } + +.fa-bandcamp:before { + content: "\f2d5"; } + +.fa-wpforms:before { + content: "\f298"; } + +.fa-cloudversify:before { + content: "\f385"; } + +.fa-usps:before { + content: "\f7e1"; } + +.fa-megaport:before { + content: "\f5a3"; } + +.fa-magento:before { + content: "\f3c4"; } + +.fa-spotify:before { + content: "\f1bc"; } + +.fa-optin-monster:before { + content: "\f23c"; } + +.fa-fly:before { + content: "\f417"; } + +.fa-aviato:before { + content: "\f421"; } + +.fa-itunes:before { + content: "\f3b4"; } + +.fa-cuttlefish:before { + content: "\f38c"; } + +.fa-blogger:before { + content: "\f37c"; } + +.fa-flickr:before { + content: "\f16e"; } + +.fa-viber:before { + content: "\f409"; } + +.fa-soundcloud:before { + content: "\f1be"; } + +.fa-digg:before { + content: "\f1a6"; } + +.fa-tencent-weibo:before { + content: "\f1d5"; } + +.fa-letterboxd:before { + content: "\e62d"; } + +.fa-symfony:before { + content: "\f83d"; } + +.fa-maxcdn:before { + content: "\f136"; } + +.fa-etsy:before { + content: "\f2d7"; } + +.fa-facebook-messenger:before { + content: "\f39f"; } + +.fa-audible:before { + content: "\f373"; } + +.fa-think-peaks:before { + content: "\f731"; } + +.fa-bilibili:before { + content: "\e3d9"; } + +.fa-erlang:before { + content: "\f39d"; } + +.fa-x-twitter:before { + content: "\e61b"; } + +.fa-cotton-bureau:before { + content: "\f89e"; } + +.fa-dashcube:before { + content: "\f210"; } + +.fa-42-group:before { + content: "\e080"; } + +.fa-innosoft:before { + content: "\e080"; } + +.fa-stack-exchange:before { + content: "\f18d"; } + +.fa-elementor:before { + content: "\f430"; } + +.fa-square-pied-piper:before { + content: "\e01e"; } + +.fa-pied-piper-square:before { + content: "\e01e"; } + +.fa-creative-commons-nd:before { + content: "\f4eb"; } + +.fa-palfed:before { + content: "\f3d8"; } + +.fa-superpowers:before { + content: "\f2dd"; } + +.fa-resolving:before { + content: "\f3e7"; } + +.fa-xbox:before { + content: "\f412"; } + +.fa-square-web-awesome-stroke:before { + content: "\e684"; } + +.fa-searchengin:before { + content: "\f3eb"; } + +.fa-tiktok:before { + content: "\e07b"; } + +.fa-square-facebook:before { + content: "\f082"; } + +.fa-facebook-square:before { + content: "\f082"; } + +.fa-renren:before { + content: "\f18b"; } + +.fa-linux:before { + content: "\f17c"; } + +.fa-glide:before { + content: "\f2a5"; } + +.fa-linkedin:before { + content: "\f08c"; } + +.fa-hubspot:before { + content: "\f3b2"; } + +.fa-deploydog:before { + content: "\f38e"; } + +.fa-twitch:before { + content: "\f1e8"; } + +.fa-ravelry:before { + content: "\f2d9"; } + +.fa-mixer:before { + content: "\e056"; } + +.fa-square-lastfm:before { + content: "\f203"; } + +.fa-lastfm-square:before { + content: "\f203"; } + +.fa-vimeo:before { + content: "\f40a"; } + +.fa-mendeley:before { + content: "\f7b3"; } + +.fa-uniregistry:before { + content: "\f404"; } + +.fa-figma:before { + content: "\f799"; } + +.fa-creative-commons-remix:before { + content: "\f4ee"; } + +.fa-cc-amazon-pay:before { + content: "\f42d"; } + +.fa-dropbox:before { + content: "\f16b"; } + +.fa-instagram:before { + content: "\f16d"; } + +.fa-cmplid:before { + content: "\e360"; } + +.fa-upwork:before { + content: "\e641"; } + +.fa-facebook:before { + content: "\f09a"; } + +.fa-gripfire:before { + content: "\f3ac"; } + +.fa-jedi-order:before { + content: "\f50e"; } + +.fa-uikit:before { + content: "\f403"; } + +.fa-fort-awesome-alt:before { + content: "\f3a3"; } + +.fa-phabricator:before { + content: "\f3db"; } + +.fa-ussunnah:before { + content: "\f407"; } + +.fa-earlybirds:before { + content: "\f39a"; } + +.fa-trade-federation:before { + content: "\f513"; } + +.fa-autoprefixer:before { + content: "\f41c"; } + +.fa-whatsapp:before { + content: "\f232"; } + +.fa-square-upwork:before { + content: "\e67c"; } + +.fa-slideshare:before { + content: "\f1e7"; } + +.fa-google-play:before { + content: "\f3ab"; } + +.fa-viadeo:before { + content: "\f2a9"; } + +.fa-line:before { + content: "\f3c0"; } + +.fa-google-drive:before { + content: "\f3aa"; } + +.fa-servicestack:before { + content: "\f3ec"; } + +.fa-simplybuilt:before { + content: "\f215"; } + +.fa-bitbucket:before { + content: "\f171"; } + +.fa-imdb:before { + content: "\f2d8"; } + +.fa-deezer:before { + content: "\e077"; } + +.fa-raspberry-pi:before { + content: "\f7bb"; } + +.fa-jira:before { + content: "\f7b1"; } + +.fa-docker:before { + content: "\f395"; } + +.fa-screenpal:before { + content: "\e570"; } + +.fa-bluetooth:before { + content: "\f293"; } + +.fa-gitter:before { + content: "\f426"; } + +.fa-d-and-d:before { + content: "\f38d"; } + +.fa-microblog:before { + content: "\e01a"; } + +.fa-cc-diners-club:before { + content: "\f24c"; } + +.fa-gg-circle:before { + content: "\f261"; } + +.fa-pied-piper-hat:before { + content: "\f4e5"; } + +.fa-kickstarter-k:before { + content: "\f3bc"; } + +.fa-yandex:before { + content: "\f413"; } + +.fa-readme:before { + content: "\f4d5"; } + +.fa-html5:before { + content: "\f13b"; } + +.fa-sellsy:before { + content: "\f213"; } + +.fa-square-web-awesome:before { + content: "\e683"; } + +.fa-sass:before { + content: "\f41e"; } + +.fa-wirsindhandwerk:before { + content: "\e2d0"; } + +.fa-wsh:before { + content: "\e2d0"; } + +.fa-buromobelexperte:before { + content: "\f37f"; } + +.fa-salesforce:before { + content: "\f83b"; } + +.fa-octopus-deploy:before { + content: "\e082"; } + +.fa-medapps:before { + content: "\f3c6"; } + +.fa-ns8:before { + content: "\f3d5"; } + +.fa-pinterest-p:before { + content: "\f231"; } + +.fa-apper:before { + content: "\f371"; } + +.fa-fort-awesome:before { + content: "\f286"; } + +.fa-waze:before { + content: "\f83f"; } + +.fa-bluesky:before { + content: "\e671"; } + +.fa-cc-jcb:before { + content: "\f24b"; } + +.fa-snapchat:before { + content: "\f2ab"; } + +.fa-snapchat-ghost:before { + content: "\f2ab"; } + +.fa-fantasy-flight-games:before { + content: "\f6dc"; } + +.fa-rust:before { + content: "\e07a"; } + +.fa-wix:before { + content: "\f5cf"; } + +.fa-square-behance:before { + content: "\f1b5"; } + +.fa-behance-square:before { + content: "\f1b5"; } + +.fa-supple:before { + content: "\f3f9"; } + +.fa-webflow:before { + content: "\e65c"; } + +.fa-rebel:before { + content: "\f1d0"; } + +.fa-css3:before { + content: "\f13c"; } + +.fa-staylinked:before { + content: "\f3f5"; } + +.fa-kaggle:before { + content: "\f5fa"; } + +.fa-space-awesome:before { + content: "\e5ac"; } + +.fa-deviantart:before { + content: "\f1bd"; } + +.fa-cpanel:before { + content: "\f388"; } + +.fa-goodreads-g:before { + content: "\f3a9"; } + +.fa-square-git:before { + content: "\f1d2"; } + +.fa-git-square:before { + content: "\f1d2"; } + +.fa-square-tumblr:before { + content: "\f174"; } + +.fa-tumblr-square:before { + content: "\f174"; } + +.fa-trello:before { + content: "\f181"; } + +.fa-creative-commons-nc-jp:before { + content: "\f4ea"; } + +.fa-get-pocket:before { + content: "\f265"; } + +.fa-perbyte:before { + content: "\e083"; } + +.fa-grunt:before { + content: "\f3ad"; } + +.fa-weebly:before { + content: "\f5cc"; } + +.fa-connectdevelop:before { + content: "\f20e"; } + +.fa-leanpub:before { + content: "\f212"; } + +.fa-black-tie:before { + content: "\f27e"; } + +.fa-themeco:before { + content: "\f5c6"; } + +.fa-python:before { + content: "\f3e2"; } + +.fa-android:before { + content: "\f17b"; } + +.fa-bots:before { + content: "\e340"; } + +.fa-free-code-camp:before { + content: "\f2c5"; } + +.fa-hornbill:before { + content: "\f592"; } + +.fa-js:before { + content: "\f3b8"; } + +.fa-ideal:before { + content: "\e013"; } + +.fa-git:before { + content: "\f1d3"; } + +.fa-dev:before { + content: "\f6cc"; } + +.fa-sketch:before { + content: "\f7c6"; } + +.fa-yandex-international:before { + content: "\f414"; } + +.fa-cc-amex:before { + content: "\f1f3"; } + +.fa-uber:before { + content: "\f402"; } + +.fa-github:before { + content: "\f09b"; } + +.fa-php:before { + content: "\f457"; } + +.fa-alipay:before { + content: "\f642"; } + +.fa-youtube:before { + content: "\f167"; } + +.fa-skyatlas:before { + content: "\f216"; } + +.fa-firefox-browser:before { + content: "\e007"; } + +.fa-replyd:before { + content: "\f3e6"; } + +.fa-suse:before { + content: "\f7d6"; } + +.fa-jenkins:before { + content: "\f3b6"; } + +.fa-twitter:before { + content: "\f099"; } + +.fa-rockrms:before { + content: "\f3e9"; } + +.fa-pinterest:before { + content: "\f0d2"; } + +.fa-buffer:before { + content: "\f837"; } + +.fa-npm:before { + content: "\f3d4"; } + +.fa-yammer:before { + content: "\f840"; } + +.fa-btc:before { + content: "\f15a"; } + +.fa-dribbble:before { + content: "\f17d"; } + +.fa-stumbleupon-circle:before { + content: "\f1a3"; } + +.fa-internet-explorer:before { + content: "\f26b"; } + +.fa-stubber:before { + content: "\e5c7"; } + +.fa-telegram:before { + content: "\f2c6"; } + +.fa-telegram-plane:before { + content: "\f2c6"; } + +.fa-old-republic:before { + content: "\f510"; } + +.fa-odysee:before { + content: "\e5c6"; } + +.fa-square-whatsapp:before { + content: "\f40c"; } + +.fa-whatsapp-square:before { + content: "\f40c"; } + +.fa-node-js:before { + content: "\f3d3"; } + +.fa-edge-legacy:before { + content: "\e078"; } + +.fa-slack:before { + content: "\f198"; } + +.fa-slack-hash:before { + content: "\f198"; } + +.fa-medrt:before { + content: "\f3c8"; } + +.fa-usb:before { + content: "\f287"; } + +.fa-tumblr:before { + content: "\f173"; } + +.fa-vaadin:before { + content: "\f408"; } + +.fa-quora:before { + content: "\f2c4"; } + +.fa-square-x-twitter:before { + content: "\e61a"; } + +.fa-reacteurope:before { + content: "\f75d"; } + +.fa-medium:before { + content: "\f23a"; } + +.fa-medium-m:before { + content: "\f23a"; } + +.fa-amilia:before { + content: "\f36d"; } + +.fa-mixcloud:before { + content: "\f289"; } + +.fa-flipboard:before { + content: "\f44d"; } + +.fa-viacoin:before { + content: "\f237"; } + +.fa-critical-role:before { + content: "\f6c9"; } + +.fa-sitrox:before { + content: "\e44a"; } + +.fa-discourse:before { + content: "\f393"; } + +.fa-joomla:before { + content: "\f1aa"; } + +.fa-mastodon:before { + content: "\f4f6"; } + +.fa-airbnb:before { + content: "\f834"; } + +.fa-wolf-pack-battalion:before { + content: "\f514"; } + +.fa-buy-n-large:before { + content: "\f8a6"; } + +.fa-gulp:before { + content: "\f3ae"; } + +.fa-creative-commons-sampling-plus:before { + content: "\f4f1"; } + +.fa-strava:before { + content: "\f428"; } + +.fa-ember:before { + content: "\f423"; } + +.fa-canadian-maple-leaf:before { + content: "\f785"; } + +.fa-teamspeak:before { + content: "\f4f9"; } + +.fa-pushed:before { + content: "\f3e1"; } + +.fa-wordpress-simple:before { + content: "\f411"; } + +.fa-nutritionix:before { + content: "\f3d6"; } + +.fa-wodu:before { + content: "\e088"; } + +.fa-google-pay:before { + content: "\e079"; } + +.fa-intercom:before { + content: "\f7af"; } + +.fa-zhihu:before { + content: "\f63f"; } + +.fa-korvue:before { + content: "\f42f"; } + +.fa-pix:before { + content: "\e43a"; } + +.fa-steam-symbol:before { + content: "\f3f6"; } +:root, :host { + --fa-style-family-classic: 'Font Awesome 6 Free'; + --fa-font-regular: normal 400 1em/1 'Font Awesome 6 Free'; } + +@font-face { + font-family: 'Font Awesome 6 Free'; + font-style: normal; + font-weight: 400; + font-display: block; + src: url("../webfonts/fa-regular-400.woff2") format("woff2"), url("../webfonts/fa-regular-400.ttf") format("truetype"); } + +.far, +.fa-regular { + font-weight: 400; } +:root, :host { + --fa-style-family-classic: 'Font Awesome 6 Free'; + --fa-font-solid: normal 900 1em/1 'Font Awesome 6 Free'; } + +@font-face { + font-family: 'Font Awesome 6 Free'; + font-style: normal; + font-weight: 900; + font-display: block; + src: url("../webfonts/fa-solid-900.woff2") format("woff2"), url("../webfonts/fa-solid-900.ttf") format("truetype"); } + +.fas, +.fa-solid { + font-weight: 900; } +@font-face { + font-family: 'Font Awesome 5 Brands'; + font-display: block; + font-weight: 400; + src: url("../webfonts/fa-brands-400.woff2") format("woff2"), url("../webfonts/fa-brands-400.ttf") format("truetype"); } + +@font-face { + font-family: 'Font Awesome 5 Free'; + font-display: block; + font-weight: 900; + src: url("../webfonts/fa-solid-900.woff2") format("woff2"), url("../webfonts/fa-solid-900.ttf") format("truetype"); } + +@font-face { + font-family: 'Font Awesome 5 Free'; + font-display: block; + font-weight: 400; + src: url("../webfonts/fa-regular-400.woff2") format("woff2"), url("../webfonts/fa-regular-400.ttf") format("truetype"); } +@font-face { + font-family: 'FontAwesome'; + font-display: block; + src: url("../webfonts/fa-solid-900.woff2") format("woff2"), url("../webfonts/fa-solid-900.ttf") format("truetype"); } + +@font-face { + font-family: 'FontAwesome'; + font-display: block; + src: url("../webfonts/fa-brands-400.woff2") format("woff2"), url("../webfonts/fa-brands-400.ttf") format("truetype"); } + +@font-face { + font-family: 'FontAwesome'; + font-display: block; + src: url("../webfonts/fa-regular-400.woff2") format("woff2"), url("../webfonts/fa-regular-400.ttf") format("truetype"); + unicode-range: U+F003,U+F006,U+F014,U+F016-F017,U+F01A-F01B,U+F01D,U+F022,U+F03E,U+F044,U+F046,U+F05C-F05D,U+F06E,U+F070,U+F087-F088,U+F08A,U+F094,U+F096-F097,U+F09D,U+F0A0,U+F0A2,U+F0A4-F0A7,U+F0C5,U+F0C7,U+F0E5-F0E6,U+F0EB,U+F0F6-F0F8,U+F10C,U+F114-F115,U+F118-F11A,U+F11C-F11D,U+F133,U+F147,U+F14E,U+F150-F152,U+F185-F186,U+F18E,U+F190-F192,U+F196,U+F1C1-F1C9,U+F1D9,U+F1DB,U+F1E3,U+F1EA,U+F1F7,U+F1F9,U+F20A,U+F247-F248,U+F24A,U+F24D,U+F255-F25B,U+F25D,U+F271-F274,U+F278,U+F27B,U+F28C,U+F28E,U+F29C,U+F2B5,U+F2B7,U+F2BA,U+F2BC,U+F2BE,U+F2C0-F2C1,U+F2C3,U+F2D0,U+F2D2,U+F2D4,U+F2DC; } + +@font-face { + font-family: 'FontAwesome'; + font-display: block; + src: url("../webfonts/fa-v4compatibility.woff2") format("woff2"), url("../webfonts/fa-v4compatibility.ttf") format("truetype"); + unicode-range: U+F041,U+F047,U+F065-F066,U+F07D-F07E,U+F080,U+F08B,U+F08E,U+F090,U+F09A,U+F0AC,U+F0AE,U+F0B2,U+F0D0,U+F0D6,U+F0E4,U+F0EC,U+F10A-F10B,U+F123,U+F13E,U+F148-F149,U+F14C,U+F156,U+F15E,U+F160-F161,U+F163,U+F175-F178,U+F195,U+F1F8,U+F219,U+F27A; } diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/css/v4-shims.css b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/css/v4-shims.css index ab494c529..ea60ea4d7 100644 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/css/v4-shims.css +++ b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/css/v4-shims.css @@ -1,2172 +1,2194 @@ -/*! - * Font Awesome Free 5.13.1 by @fontawesome - https://fontawesome.com - * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) - */ -.fa.fa-glass:before { - content: "\f000"; } - -.fa.fa-meetup { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-star-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-star-o:before { - content: "\f005"; } - -.fa.fa-remove:before { - content: "\f00d"; } - -.fa.fa-close:before { - content: "\f00d"; } - -.fa.fa-gear:before { - content: "\f013"; } - -.fa.fa-trash-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-trash-o:before { - content: "\f2ed"; } - -.fa.fa-file-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-file-o:before { - content: "\f15b"; } - -.fa.fa-clock-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-clock-o:before { - content: "\f017"; } - -.fa.fa-arrow-circle-o-down { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-arrow-circle-o-down:before { - content: "\f358"; } - -.fa.fa-arrow-circle-o-up { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-arrow-circle-o-up:before { - content: "\f35b"; } - -.fa.fa-play-circle-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-play-circle-o:before { - content: "\f144"; } - -.fa.fa-repeat:before { - content: "\f01e"; } - -.fa.fa-rotate-right:before { - content: "\f01e"; } - -.fa.fa-refresh:before { - content: "\f021"; } - -.fa.fa-list-alt { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-dedent:before { - content: "\f03b"; } - -.fa.fa-video-camera:before { - content: "\f03d"; } - -.fa.fa-picture-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-picture-o:before { - content: "\f03e"; } - -.fa.fa-photo { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-photo:before { - content: "\f03e"; } - -.fa.fa-image { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-image:before { - content: "\f03e"; } - -.fa.fa-pencil:before { - content: "\f303"; } - -.fa.fa-map-marker:before { - content: "\f3c5"; } - -.fa.fa-pencil-square-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-pencil-square-o:before { - content: "\f044"; } - -.fa.fa-share-square-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-share-square-o:before { - content: "\f14d"; } - -.fa.fa-check-square-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-check-square-o:before { - content: "\f14a"; } - -.fa.fa-arrows:before { - content: "\f0b2"; } - -.fa.fa-times-circle-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-times-circle-o:before { - content: "\f057"; } - -.fa.fa-check-circle-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-check-circle-o:before { - content: "\f058"; } - -.fa.fa-mail-forward:before { - content: "\f064"; } - -.fa.fa-expand:before { - content: "\f424"; } - -.fa.fa-compress:before { - content: "\f422"; } - -.fa.fa-eye { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-eye-slash { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-warning:before { - content: "\f071"; } - -.fa.fa-calendar:before { - content: "\f073"; } - -.fa.fa-arrows-v:before { - content: "\f338"; } - -.fa.fa-arrows-h:before { - content: "\f337"; } - -.fa.fa-bar-chart { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-bar-chart:before { - content: "\f080"; } - -.fa.fa-bar-chart-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-bar-chart-o:before { - content: "\f080"; } - -.fa.fa-twitter-square { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-facebook-square { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-gears:before { - content: "\f085"; } - -.fa.fa-thumbs-o-up { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-thumbs-o-up:before { - content: "\f164"; } - -.fa.fa-thumbs-o-down { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-thumbs-o-down:before { - content: "\f165"; } - -.fa.fa-heart-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-heart-o:before { - content: "\f004"; } - -.fa.fa-sign-out:before { - content: "\f2f5"; } - -.fa.fa-linkedin-square { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-linkedin-square:before { - content: "\f08c"; } - -.fa.fa-thumb-tack:before { - content: "\f08d"; } - -.fa.fa-external-link:before { - content: "\f35d"; } - -.fa.fa-sign-in:before { - content: "\f2f6"; } - -.fa.fa-github-square { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-lemon-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-lemon-o:before { - content: "\f094"; } - -.fa.fa-square-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-square-o:before { - content: "\f0c8"; } - -.fa.fa-bookmark-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-bookmark-o:before { - content: "\f02e"; } - -.fa.fa-twitter { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-facebook { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-facebook:before { - content: "\f39e"; } - -.fa.fa-facebook-f { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-facebook-f:before { - content: "\f39e"; } - -.fa.fa-github { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-credit-card { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-feed:before { - content: "\f09e"; } - -.fa.fa-hdd-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-hdd-o:before { - content: "\f0a0"; } - -.fa.fa-hand-o-right { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-hand-o-right:before { - content: "\f0a4"; } - -.fa.fa-hand-o-left { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-hand-o-left:before { - content: "\f0a5"; } - -.fa.fa-hand-o-up { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-hand-o-up:before { - content: "\f0a6"; } - -.fa.fa-hand-o-down { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-hand-o-down:before { - content: "\f0a7"; } - -.fa.fa-arrows-alt:before { - content: "\f31e"; } - -.fa.fa-group:before { - content: "\f0c0"; } - -.fa.fa-chain:before { - content: "\f0c1"; } - -.fa.fa-scissors:before { - content: "\f0c4"; } - -.fa.fa-files-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-files-o:before { - content: "\f0c5"; } - -.fa.fa-floppy-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-floppy-o:before { - content: "\f0c7"; } - -.fa.fa-navicon:before { - content: "\f0c9"; } - -.fa.fa-reorder:before { - content: "\f0c9"; } - -.fa.fa-pinterest { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-pinterest-square { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-google-plus-square { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-google-plus { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-google-plus:before { - content: "\f0d5"; } - -.fa.fa-money { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-money:before { - content: "\f3d1"; } - -.fa.fa-unsorted:before { - content: "\f0dc"; } - -.fa.fa-sort-desc:before { - content: "\f0dd"; } - -.fa.fa-sort-asc:before { - content: "\f0de"; } - -.fa.fa-linkedin { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-linkedin:before { - content: "\f0e1"; } - -.fa.fa-rotate-left:before { - content: "\f0e2"; } - -.fa.fa-legal:before { - content: "\f0e3"; } - -.fa.fa-tachometer:before { - content: "\f3fd"; } - -.fa.fa-dashboard:before { - content: "\f3fd"; } - -.fa.fa-comment-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-comment-o:before { - content: "\f075"; } - -.fa.fa-comments-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-comments-o:before { - content: "\f086"; } - -.fa.fa-flash:before { - content: "\f0e7"; } - -.fa.fa-clipboard { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-paste { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-paste:before { - content: "\f328"; } - -.fa.fa-lightbulb-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-lightbulb-o:before { - content: "\f0eb"; } - -.fa.fa-exchange:before { - content: "\f362"; } - -.fa.fa-cloud-download:before { - content: "\f381"; } - -.fa.fa-cloud-upload:before { - content: "\f382"; } - -.fa.fa-bell-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-bell-o:before { - content: "\f0f3"; } - -.fa.fa-cutlery:before { - content: "\f2e7"; } - -.fa.fa-file-text-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-file-text-o:before { - content: "\f15c"; } - -.fa.fa-building-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-building-o:before { - content: "\f1ad"; } - -.fa.fa-hospital-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-hospital-o:before { - content: "\f0f8"; } - -.fa.fa-tablet:before { - content: "\f3fa"; } - -.fa.fa-mobile:before { - content: "\f3cd"; } - -.fa.fa-mobile-phone:before { - content: "\f3cd"; } - -.fa.fa-circle-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-circle-o:before { - content: "\f111"; } - -.fa.fa-mail-reply:before { - content: "\f3e5"; } - -.fa.fa-github-alt { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-folder-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-folder-o:before { - content: "\f07b"; } - -.fa.fa-folder-open-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-folder-open-o:before { - content: "\f07c"; } - -.fa.fa-smile-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-smile-o:before { - content: "\f118"; } - -.fa.fa-frown-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-frown-o:before { - content: "\f119"; } - -.fa.fa-meh-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-meh-o:before { - content: "\f11a"; } - -.fa.fa-keyboard-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-keyboard-o:before { - content: "\f11c"; } - -.fa.fa-flag-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-flag-o:before { - content: "\f024"; } - -.fa.fa-mail-reply-all:before { - content: "\f122"; } - -.fa.fa-star-half-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-star-half-o:before { - content: "\f089"; } - -.fa.fa-star-half-empty { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-star-half-empty:before { - content: "\f089"; } - -.fa.fa-star-half-full { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-star-half-full:before { - content: "\f089"; } - -.fa.fa-code-fork:before { - content: "\f126"; } - -.fa.fa-chain-broken:before { - content: "\f127"; } - -.fa.fa-shield:before { - content: "\f3ed"; } - -.fa.fa-calendar-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-calendar-o:before { - content: "\f133"; } - -.fa.fa-maxcdn { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-html5 { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-css3 { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-ticket:before { - content: "\f3ff"; } - -.fa.fa-minus-square-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-minus-square-o:before { - content: "\f146"; } - -.fa.fa-level-up:before { - content: "\f3bf"; } - -.fa.fa-level-down:before { - content: "\f3be"; } - -.fa.fa-pencil-square:before { - content: "\f14b"; } - -.fa.fa-external-link-square:before { - content: "\f360"; } - -.fa.fa-compass { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-caret-square-o-down { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-caret-square-o-down:before { - content: "\f150"; } - -.fa.fa-toggle-down { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-toggle-down:before { - content: "\f150"; } - -.fa.fa-caret-square-o-up { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-caret-square-o-up:before { - content: "\f151"; } - -.fa.fa-toggle-up { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-toggle-up:before { - content: "\f151"; } - -.fa.fa-caret-square-o-right { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-caret-square-o-right:before { - content: "\f152"; } - -.fa.fa-toggle-right { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-toggle-right:before { - content: "\f152"; } - -.fa.fa-eur:before { - content: "\f153"; } - -.fa.fa-euro:before { - content: "\f153"; } - -.fa.fa-gbp:before { - content: "\f154"; } - -.fa.fa-usd:before { - content: "\f155"; } - -.fa.fa-dollar:before { - content: "\f155"; } - -.fa.fa-inr:before { - content: "\f156"; } - -.fa.fa-rupee:before { - content: "\f156"; } - -.fa.fa-jpy:before { - content: "\f157"; } - -.fa.fa-cny:before { - content: "\f157"; } - -.fa.fa-rmb:before { - content: "\f157"; } - -.fa.fa-yen:before { - content: "\f157"; } - -.fa.fa-rub:before { - content: "\f158"; } - -.fa.fa-ruble:before { - content: "\f158"; } - -.fa.fa-rouble:before { - content: "\f158"; } - -.fa.fa-krw:before { - content: "\f159"; } - -.fa.fa-won:before { - content: "\f159"; } - -.fa.fa-btc { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-bitcoin { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-bitcoin:before { - content: "\f15a"; } - -.fa.fa-file-text:before { - content: "\f15c"; } - -.fa.fa-sort-alpha-asc:before { - content: "\f15d"; } - -.fa.fa-sort-alpha-desc:before { - content: "\f881"; } - -.fa.fa-sort-amount-asc:before { - content: "\f160"; } - -.fa.fa-sort-amount-desc:before { - content: "\f884"; } - -.fa.fa-sort-numeric-asc:before { - content: "\f162"; } - -.fa.fa-sort-numeric-desc:before { - content: "\f886"; } - -.fa.fa-youtube-square { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-youtube { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-xing { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-xing-square { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-youtube-play { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-youtube-play:before { - content: "\f167"; } - -.fa.fa-dropbox { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-stack-overflow { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-instagram { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-flickr { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-adn { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-bitbucket { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-bitbucket-square { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-bitbucket-square:before { - content: "\f171"; } - -.fa.fa-tumblr { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-tumblr-square { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-long-arrow-down:before { - content: "\f309"; } - -.fa.fa-long-arrow-up:before { - content: "\f30c"; } - -.fa.fa-long-arrow-left:before { - content: "\f30a"; } - -.fa.fa-long-arrow-right:before { - content: "\f30b"; } - -.fa.fa-apple { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-windows { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-android { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-linux { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-dribbble { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-skype { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-foursquare { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-trello { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-gratipay { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-gittip { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-gittip:before { - content: "\f184"; } - -.fa.fa-sun-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-sun-o:before { - content: "\f185"; } - -.fa.fa-moon-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-moon-o:before { - content: "\f186"; } - -.fa.fa-vk { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-weibo { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-renren { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-pagelines { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-stack-exchange { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-arrow-circle-o-right { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-arrow-circle-o-right:before { - content: "\f35a"; } - -.fa.fa-arrow-circle-o-left { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-arrow-circle-o-left:before { - content: "\f359"; } - -.fa.fa-caret-square-o-left { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-caret-square-o-left:before { - content: "\f191"; } - -.fa.fa-toggle-left { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-toggle-left:before { - content: "\f191"; } - -.fa.fa-dot-circle-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-dot-circle-o:before { - content: "\f192"; } - -.fa.fa-vimeo-square { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-try:before { - content: "\f195"; } - -.fa.fa-turkish-lira:before { - content: "\f195"; } - -.fa.fa-plus-square-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-plus-square-o:before { - content: "\f0fe"; } - -.fa.fa-slack { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-wordpress { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-openid { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-institution:before { - content: "\f19c"; } - -.fa.fa-bank:before { - content: "\f19c"; } - -.fa.fa-mortar-board:before { - content: "\f19d"; } - -.fa.fa-yahoo { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-google { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-reddit { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-reddit-square { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-stumbleupon-circle { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-stumbleupon { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-delicious { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-digg { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-pied-piper-pp { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-pied-piper-alt { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-drupal { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-joomla { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-spoon:before { - content: "\f2e5"; } - -.fa.fa-behance { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-behance-square { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-steam { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-steam-square { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-automobile:before { - content: "\f1b9"; } - -.fa.fa-envelope-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-envelope-o:before { - content: "\f0e0"; } - -.fa.fa-spotify { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-deviantart { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-soundcloud { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-file-pdf-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-file-pdf-o:before { - content: "\f1c1"; } - -.fa.fa-file-word-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-file-word-o:before { - content: "\f1c2"; } - -.fa.fa-file-excel-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-file-excel-o:before { - content: "\f1c3"; } - -.fa.fa-file-powerpoint-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-file-powerpoint-o:before { - content: "\f1c4"; } - -.fa.fa-file-image-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-file-image-o:before { - content: "\f1c5"; } - -.fa.fa-file-photo-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-file-photo-o:before { - content: "\f1c5"; } - -.fa.fa-file-picture-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-file-picture-o:before { - content: "\f1c5"; } - -.fa.fa-file-archive-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-file-archive-o:before { - content: "\f1c6"; } - -.fa.fa-file-zip-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-file-zip-o:before { - content: "\f1c6"; } - -.fa.fa-file-audio-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-file-audio-o:before { - content: "\f1c7"; } - -.fa.fa-file-sound-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-file-sound-o:before { - content: "\f1c7"; } - -.fa.fa-file-video-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-file-video-o:before { - content: "\f1c8"; } - -.fa.fa-file-movie-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-file-movie-o:before { - content: "\f1c8"; } - -.fa.fa-file-code-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-file-code-o:before { - content: "\f1c9"; } - -.fa.fa-vine { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-codepen { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-jsfiddle { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-life-ring { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-life-bouy { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-life-bouy:before { - content: "\f1cd"; } - -.fa.fa-life-buoy { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-life-buoy:before { - content: "\f1cd"; } - -.fa.fa-life-saver { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-life-saver:before { - content: "\f1cd"; } - -.fa.fa-support { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-support:before { - content: "\f1cd"; } - -.fa.fa-circle-o-notch:before { - content: "\f1ce"; } - -.fa.fa-rebel { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-ra { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-ra:before { - content: "\f1d0"; } - -.fa.fa-resistance { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-resistance:before { - content: "\f1d0"; } - -.fa.fa-empire { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-ge { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-ge:before { - content: "\f1d1"; } - -.fa.fa-git-square { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-git { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-hacker-news { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-y-combinator-square { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-y-combinator-square:before { - content: "\f1d4"; } - -.fa.fa-yc-square { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-yc-square:before { - content: "\f1d4"; } - -.fa.fa-tencent-weibo { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-qq { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-weixin { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-wechat { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-wechat:before { - content: "\f1d7"; } - -.fa.fa-send:before { - content: "\f1d8"; } - -.fa.fa-paper-plane-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-paper-plane-o:before { - content: "\f1d8"; } - -.fa.fa-send-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-send-o:before { - content: "\f1d8"; } - -.fa.fa-circle-thin { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-circle-thin:before { - content: "\f111"; } - -.fa.fa-header:before { - content: "\f1dc"; } - -.fa.fa-sliders:before { - content: "\f1de"; } - -.fa.fa-futbol-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-futbol-o:before { - content: "\f1e3"; } - -.fa.fa-soccer-ball-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-soccer-ball-o:before { - content: "\f1e3"; } - -.fa.fa-slideshare { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-twitch { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-yelp { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-newspaper-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-newspaper-o:before { - content: "\f1ea"; } - -.fa.fa-paypal { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-google-wallet { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-cc-visa { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-cc-mastercard { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-cc-discover { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-cc-amex { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-cc-paypal { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-cc-stripe { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-bell-slash-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-bell-slash-o:before { - content: "\f1f6"; } - -.fa.fa-trash:before { - content: "\f2ed"; } - -.fa.fa-copyright { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-eyedropper:before { - content: "\f1fb"; } - -.fa.fa-area-chart:before { - content: "\f1fe"; } - -.fa.fa-pie-chart:before { - content: "\f200"; } - -.fa.fa-line-chart:before { - content: "\f201"; } - -.fa.fa-lastfm { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-lastfm-square { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-ioxhost { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-angellist { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-cc { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-cc:before { - content: "\f20a"; } - -.fa.fa-ils:before { - content: "\f20b"; } - -.fa.fa-shekel:before { - content: "\f20b"; } - -.fa.fa-sheqel:before { - content: "\f20b"; } - -.fa.fa-meanpath { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-meanpath:before { - content: "\f2b4"; } - -.fa.fa-buysellads { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-connectdevelop { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-dashcube { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-forumbee { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-leanpub { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-sellsy { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-shirtsinbulk { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-simplybuilt { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-skyatlas { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-diamond { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-diamond:before { - content: "\f3a5"; } - -.fa.fa-intersex:before { - content: "\f224"; } - -.fa.fa-facebook-official { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-facebook-official:before { - content: "\f09a"; } - -.fa.fa-pinterest-p { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-whatsapp { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-hotel:before { - content: "\f236"; } - -.fa.fa-viacoin { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-medium { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-y-combinator { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-yc { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-yc:before { - content: "\f23b"; } - -.fa.fa-optin-monster { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-opencart { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-expeditedssl { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-battery-4:before { - content: "\f240"; } - -.fa.fa-battery:before { - content: "\f240"; } - -.fa.fa-battery-3:before { - content: "\f241"; } - -.fa.fa-battery-2:before { - content: "\f242"; } - -.fa.fa-battery-1:before { - content: "\f243"; } - -.fa.fa-battery-0:before { - content: "\f244"; } - -.fa.fa-object-group { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-object-ungroup { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-sticky-note-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-sticky-note-o:before { - content: "\f249"; } - -.fa.fa-cc-jcb { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-cc-diners-club { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-clone { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-hourglass-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-hourglass-o:before { - content: "\f254"; } - -.fa.fa-hourglass-1:before { - content: "\f251"; } - -.fa.fa-hourglass-2:before { - content: "\f252"; } - -.fa.fa-hourglass-3:before { - content: "\f253"; } - -.fa.fa-hand-rock-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-hand-rock-o:before { - content: "\f255"; } - -.fa.fa-hand-grab-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-hand-grab-o:before { - content: "\f255"; } - -.fa.fa-hand-paper-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-hand-paper-o:before { - content: "\f256"; } - -.fa.fa-hand-stop-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-hand-stop-o:before { - content: "\f256"; } - -.fa.fa-hand-scissors-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-hand-scissors-o:before { - content: "\f257"; } - -.fa.fa-hand-lizard-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-hand-lizard-o:before { - content: "\f258"; } - -.fa.fa-hand-spock-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-hand-spock-o:before { - content: "\f259"; } - -.fa.fa-hand-pointer-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-hand-pointer-o:before { - content: "\f25a"; } - -.fa.fa-hand-peace-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-hand-peace-o:before { - content: "\f25b"; } - -.fa.fa-registered { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-creative-commons { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-gg { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-gg-circle { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-tripadvisor { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-odnoklassniki { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-odnoklassniki-square { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-get-pocket { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-wikipedia-w { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-safari { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-chrome { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-firefox { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-opera { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-internet-explorer { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-television:before { - content: "\f26c"; } - -.fa.fa-contao { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-500px { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-amazon { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-calendar-plus-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-calendar-plus-o:before { - content: "\f271"; } - -.fa.fa-calendar-minus-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-calendar-minus-o:before { - content: "\f272"; } - -.fa.fa-calendar-times-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-calendar-times-o:before { - content: "\f273"; } - -.fa.fa-calendar-check-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-calendar-check-o:before { - content: "\f274"; } - -.fa.fa-map-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-map-o:before { - content: "\f279"; } - -.fa.fa-commenting:before { - content: "\f4ad"; } - -.fa.fa-commenting-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-commenting-o:before { - content: "\f4ad"; } - -.fa.fa-houzz { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-vimeo { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-vimeo:before { - content: "\f27d"; } - -.fa.fa-black-tie { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-fonticons { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-reddit-alien { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-edge { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-credit-card-alt:before { - content: "\f09d"; } - -.fa.fa-codiepie { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-modx { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-fort-awesome { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-usb { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-product-hunt { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-mixcloud { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-scribd { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-pause-circle-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-pause-circle-o:before { - content: "\f28b"; } - -.fa.fa-stop-circle-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-stop-circle-o:before { - content: "\f28d"; } - -.fa.fa-bluetooth { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-bluetooth-b { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-gitlab { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-wpbeginner { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-wpforms { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-envira { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-wheelchair-alt { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-wheelchair-alt:before { - content: "\f368"; } - -.fa.fa-question-circle-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-question-circle-o:before { - content: "\f059"; } - -.fa.fa-volume-control-phone:before { - content: "\f2a0"; } - -.fa.fa-asl-interpreting:before { - content: "\f2a3"; } - -.fa.fa-deafness:before { - content: "\f2a4"; } - -.fa.fa-hard-of-hearing:before { - content: "\f2a4"; } - -.fa.fa-glide { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-glide-g { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-signing:before { - content: "\f2a7"; } - -.fa.fa-viadeo { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-viadeo-square { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-snapchat { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-snapchat-ghost { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-snapchat-square { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-pied-piper { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-first-order { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-yoast { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-themeisle { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-google-plus-official { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-google-plus-official:before { - content: "\f2b3"; } - -.fa.fa-google-plus-circle { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-google-plus-circle:before { - content: "\f2b3"; } - -.fa.fa-font-awesome { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-fa { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-fa:before { - content: "\f2b4"; } - -.fa.fa-handshake-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-handshake-o:before { - content: "\f2b5"; } - -.fa.fa-envelope-open-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-envelope-open-o:before { - content: "\f2b6"; } - -.fa.fa-linode { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-address-book-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-address-book-o:before { - content: "\f2b9"; } - -.fa.fa-vcard:before { - content: "\f2bb"; } - -.fa.fa-address-card-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-address-card-o:before { - content: "\f2bb"; } - -.fa.fa-vcard-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-vcard-o:before { - content: "\f2bb"; } - -.fa.fa-user-circle-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-user-circle-o:before { - content: "\f2bd"; } - -.fa.fa-user-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-user-o:before { - content: "\f007"; } - -.fa.fa-id-badge { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-drivers-license:before { - content: "\f2c2"; } - -.fa.fa-id-card-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-id-card-o:before { - content: "\f2c2"; } - -.fa.fa-drivers-license-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-drivers-license-o:before { - content: "\f2c2"; } - -.fa.fa-quora { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-free-code-camp { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-telegram { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-thermometer-4:before { - content: "\f2c7"; } - -.fa.fa-thermometer:before { - content: "\f2c7"; } - -.fa.fa-thermometer-3:before { - content: "\f2c8"; } - -.fa.fa-thermometer-2:before { - content: "\f2c9"; } - -.fa.fa-thermometer-1:before { - content: "\f2ca"; } - -.fa.fa-thermometer-0:before { - content: "\f2cb"; } - -.fa.fa-bathtub:before { - content: "\f2cd"; } - -.fa.fa-s15:before { - content: "\f2cd"; } - -.fa.fa-window-maximize { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-window-restore { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-times-rectangle:before { - content: "\f410"; } - -.fa.fa-window-close-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-window-close-o:before { - content: "\f410"; } - -.fa.fa-times-rectangle-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-times-rectangle-o:before { - content: "\f410"; } - -.fa.fa-bandcamp { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-grav { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-etsy { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-imdb { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-ravelry { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-eercast { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-eercast:before { - content: "\f2da"; } - -.fa.fa-snowflake-o { - font-family: 'Font Awesome 5 Free'; - font-weight: 400; } - -.fa.fa-snowflake-o:before { - content: "\f2dc"; } - -.fa.fa-superpowers { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-wpexplorer { - font-family: 'Font Awesome 5 Brands'; - font-weight: 400; } - -.fa.fa-cab:before { - content: "\f1ba"; } +/*! + * Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com + * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) + * Copyright 2024 Fonticons, Inc. + */ +.fa.fa-glass:before { + content: "\f000"; } + +.fa.fa-envelope-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-envelope-o:before { + content: "\f0e0"; } + +.fa.fa-star-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-star-o:before { + content: "\f005"; } + +.fa.fa-remove:before { + content: "\f00d"; } + +.fa.fa-close:before { + content: "\f00d"; } + +.fa.fa-gear:before { + content: "\f013"; } + +.fa.fa-trash-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-trash-o:before { + content: "\f2ed"; } + +.fa.fa-home:before { + content: "\f015"; } + +.fa.fa-file-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-file-o:before { + content: "\f15b"; } + +.fa.fa-clock-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-clock-o:before { + content: "\f017"; } + +.fa.fa-arrow-circle-o-down { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-arrow-circle-o-down:before { + content: "\f358"; } + +.fa.fa-arrow-circle-o-up { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-arrow-circle-o-up:before { + content: "\f35b"; } + +.fa.fa-play-circle-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-play-circle-o:before { + content: "\f144"; } + +.fa.fa-repeat:before { + content: "\f01e"; } + +.fa.fa-rotate-right:before { + content: "\f01e"; } + +.fa.fa-refresh:before { + content: "\f021"; } + +.fa.fa-list-alt { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-list-alt:before { + content: "\f022"; } + +.fa.fa-dedent:before { + content: "\f03b"; } + +.fa.fa-video-camera:before { + content: "\f03d"; } + +.fa.fa-picture-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-picture-o:before { + content: "\f03e"; } + +.fa.fa-photo { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-photo:before { + content: "\f03e"; } + +.fa.fa-image { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-image:before { + content: "\f03e"; } + +.fa.fa-map-marker:before { + content: "\f3c5"; } + +.fa.fa-pencil-square-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-pencil-square-o:before { + content: "\f044"; } + +.fa.fa-edit { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-edit:before { + content: "\f044"; } + +.fa.fa-share-square-o:before { + content: "\f14d"; } + +.fa.fa-check-square-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-check-square-o:before { + content: "\f14a"; } + +.fa.fa-arrows:before { + content: "\f0b2"; } + +.fa.fa-times-circle-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-times-circle-o:before { + content: "\f057"; } + +.fa.fa-check-circle-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-check-circle-o:before { + content: "\f058"; } + +.fa.fa-mail-forward:before { + content: "\f064"; } + +.fa.fa-expand:before { + content: "\f424"; } + +.fa.fa-compress:before { + content: "\f422"; } + +.fa.fa-eye { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-eye-slash { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-warning:before { + content: "\f071"; } + +.fa.fa-calendar:before { + content: "\f073"; } + +.fa.fa-arrows-v:before { + content: "\f338"; } + +.fa.fa-arrows-h:before { + content: "\f337"; } + +.fa.fa-bar-chart:before { + content: "\e0e3"; } + +.fa.fa-bar-chart-o:before { + content: "\e0e3"; } + +.fa.fa-twitter-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-twitter-square:before { + content: "\f081"; } + +.fa.fa-facebook-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-facebook-square:before { + content: "\f082"; } + +.fa.fa-gears:before { + content: "\f085"; } + +.fa.fa-thumbs-o-up { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-thumbs-o-up:before { + content: "\f164"; } + +.fa.fa-thumbs-o-down { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-thumbs-o-down:before { + content: "\f165"; } + +.fa.fa-heart-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-heart-o:before { + content: "\f004"; } + +.fa.fa-sign-out:before { + content: "\f2f5"; } + +.fa.fa-linkedin-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-linkedin-square:before { + content: "\f08c"; } + +.fa.fa-thumb-tack:before { + content: "\f08d"; } + +.fa.fa-external-link:before { + content: "\f35d"; } + +.fa.fa-sign-in:before { + content: "\f2f6"; } + +.fa.fa-github-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-github-square:before { + content: "\f092"; } + +.fa.fa-lemon-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-lemon-o:before { + content: "\f094"; } + +.fa.fa-square-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-square-o:before { + content: "\f0c8"; } + +.fa.fa-bookmark-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-bookmark-o:before { + content: "\f02e"; } + +.fa.fa-twitter { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-facebook { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-facebook:before { + content: "\f39e"; } + +.fa.fa-facebook-f { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-facebook-f:before { + content: "\f39e"; } + +.fa.fa-github { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-credit-card { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-feed:before { + content: "\f09e"; } + +.fa.fa-hdd-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-hdd-o:before { + content: "\f0a0"; } + +.fa.fa-hand-o-right { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-hand-o-right:before { + content: "\f0a4"; } + +.fa.fa-hand-o-left { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-hand-o-left:before { + content: "\f0a5"; } + +.fa.fa-hand-o-up { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-hand-o-up:before { + content: "\f0a6"; } + +.fa.fa-hand-o-down { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-hand-o-down:before { + content: "\f0a7"; } + +.fa.fa-globe:before { + content: "\f57d"; } + +.fa.fa-tasks:before { + content: "\f828"; } + +.fa.fa-arrows-alt:before { + content: "\f31e"; } + +.fa.fa-group:before { + content: "\f0c0"; } + +.fa.fa-chain:before { + content: "\f0c1"; } + +.fa.fa-cut:before { + content: "\f0c4"; } + +.fa.fa-files-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-files-o:before { + content: "\f0c5"; } + +.fa.fa-floppy-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-floppy-o:before { + content: "\f0c7"; } + +.fa.fa-save { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-save:before { + content: "\f0c7"; } + +.fa.fa-navicon:before { + content: "\f0c9"; } + +.fa.fa-reorder:before { + content: "\f0c9"; } + +.fa.fa-magic:before { + content: "\e2ca"; } + +.fa.fa-pinterest { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-pinterest-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-pinterest-square:before { + content: "\f0d3"; } + +.fa.fa-google-plus-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-google-plus-square:before { + content: "\f0d4"; } + +.fa.fa-google-plus { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-google-plus:before { + content: "\f0d5"; } + +.fa.fa-money:before { + content: "\f3d1"; } + +.fa.fa-unsorted:before { + content: "\f0dc"; } + +.fa.fa-sort-desc:before { + content: "\f0dd"; } + +.fa.fa-sort-asc:before { + content: "\f0de"; } + +.fa.fa-linkedin { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-linkedin:before { + content: "\f0e1"; } + +.fa.fa-rotate-left:before { + content: "\f0e2"; } + +.fa.fa-legal:before { + content: "\f0e3"; } + +.fa.fa-tachometer:before { + content: "\f625"; } + +.fa.fa-dashboard:before { + content: "\f625"; } + +.fa.fa-comment-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-comment-o:before { + content: "\f075"; } + +.fa.fa-comments-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-comments-o:before { + content: "\f086"; } + +.fa.fa-flash:before { + content: "\f0e7"; } + +.fa.fa-clipboard:before { + content: "\f0ea"; } + +.fa.fa-lightbulb-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-lightbulb-o:before { + content: "\f0eb"; } + +.fa.fa-exchange:before { + content: "\f362"; } + +.fa.fa-cloud-download:before { + content: "\f0ed"; } + +.fa.fa-cloud-upload:before { + content: "\f0ee"; } + +.fa.fa-bell-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-bell-o:before { + content: "\f0f3"; } + +.fa.fa-cutlery:before { + content: "\f2e7"; } + +.fa.fa-file-text-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-file-text-o:before { + content: "\f15c"; } + +.fa.fa-building-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-building-o:before { + content: "\f1ad"; } + +.fa.fa-hospital-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-hospital-o:before { + content: "\f0f8"; } + +.fa.fa-tablet:before { + content: "\f3fa"; } + +.fa.fa-mobile:before { + content: "\f3cd"; } + +.fa.fa-mobile-phone:before { + content: "\f3cd"; } + +.fa.fa-circle-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-circle-o:before { + content: "\f111"; } + +.fa.fa-mail-reply:before { + content: "\f3e5"; } + +.fa.fa-github-alt { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-folder-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-folder-o:before { + content: "\f07b"; } + +.fa.fa-folder-open-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-folder-open-o:before { + content: "\f07c"; } + +.fa.fa-smile-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-smile-o:before { + content: "\f118"; } + +.fa.fa-frown-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-frown-o:before { + content: "\f119"; } + +.fa.fa-meh-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-meh-o:before { + content: "\f11a"; } + +.fa.fa-keyboard-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-keyboard-o:before { + content: "\f11c"; } + +.fa.fa-flag-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-flag-o:before { + content: "\f024"; } + +.fa.fa-mail-reply-all:before { + content: "\f122"; } + +.fa.fa-star-half-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-star-half-o:before { + content: "\f5c0"; } + +.fa.fa-star-half-empty { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-star-half-empty:before { + content: "\f5c0"; } + +.fa.fa-star-half-full { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-star-half-full:before { + content: "\f5c0"; } + +.fa.fa-code-fork:before { + content: "\f126"; } + +.fa.fa-chain-broken:before { + content: "\f127"; } + +.fa.fa-unlink:before { + content: "\f127"; } + +.fa.fa-calendar-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-calendar-o:before { + content: "\f133"; } + +.fa.fa-maxcdn { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-html5 { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-css3 { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-unlock-alt:before { + content: "\f09c"; } + +.fa.fa-minus-square-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-minus-square-o:before { + content: "\f146"; } + +.fa.fa-level-up:before { + content: "\f3bf"; } + +.fa.fa-level-down:before { + content: "\f3be"; } + +.fa.fa-pencil-square:before { + content: "\f14b"; } + +.fa.fa-external-link-square:before { + content: "\f360"; } + +.fa.fa-compass { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-caret-square-o-down { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-caret-square-o-down:before { + content: "\f150"; } + +.fa.fa-toggle-down { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-toggle-down:before { + content: "\f150"; } + +.fa.fa-caret-square-o-up { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-caret-square-o-up:before { + content: "\f151"; } + +.fa.fa-toggle-up { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-toggle-up:before { + content: "\f151"; } + +.fa.fa-caret-square-o-right { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-caret-square-o-right:before { + content: "\f152"; } + +.fa.fa-toggle-right { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-toggle-right:before { + content: "\f152"; } + +.fa.fa-eur:before { + content: "\f153"; } + +.fa.fa-euro:before { + content: "\f153"; } + +.fa.fa-gbp:before { + content: "\f154"; } + +.fa.fa-usd:before { + content: "\24"; } + +.fa.fa-dollar:before { + content: "\24"; } + +.fa.fa-inr:before { + content: "\e1bc"; } + +.fa.fa-rupee:before { + content: "\e1bc"; } + +.fa.fa-jpy:before { + content: "\f157"; } + +.fa.fa-cny:before { + content: "\f157"; } + +.fa.fa-rmb:before { + content: "\f157"; } + +.fa.fa-yen:before { + content: "\f157"; } + +.fa.fa-rub:before { + content: "\f158"; } + +.fa.fa-ruble:before { + content: "\f158"; } + +.fa.fa-rouble:before { + content: "\f158"; } + +.fa.fa-krw:before { + content: "\f159"; } + +.fa.fa-won:before { + content: "\f159"; } + +.fa.fa-btc { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-bitcoin { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-bitcoin:before { + content: "\f15a"; } + +.fa.fa-file-text:before { + content: "\f15c"; } + +.fa.fa-sort-alpha-asc:before { + content: "\f15d"; } + +.fa.fa-sort-alpha-desc:before { + content: "\f881"; } + +.fa.fa-sort-amount-asc:before { + content: "\f884"; } + +.fa.fa-sort-amount-desc:before { + content: "\f160"; } + +.fa.fa-sort-numeric-asc:before { + content: "\f162"; } + +.fa.fa-sort-numeric-desc:before { + content: "\f886"; } + +.fa.fa-youtube-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-youtube-square:before { + content: "\f431"; } + +.fa.fa-youtube { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-xing { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-xing-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-xing-square:before { + content: "\f169"; } + +.fa.fa-youtube-play { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-youtube-play:before { + content: "\f167"; } + +.fa.fa-dropbox { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-stack-overflow { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-instagram { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-flickr { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-adn { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-bitbucket { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-bitbucket-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-bitbucket-square:before { + content: "\f171"; } + +.fa.fa-tumblr { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-tumblr-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-tumblr-square:before { + content: "\f174"; } + +.fa.fa-long-arrow-down:before { + content: "\f309"; } + +.fa.fa-long-arrow-up:before { + content: "\f30c"; } + +.fa.fa-long-arrow-left:before { + content: "\f30a"; } + +.fa.fa-long-arrow-right:before { + content: "\f30b"; } + +.fa.fa-apple { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-windows { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-android { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-linux { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-dribbble { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-skype { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-foursquare { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-trello { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-gratipay { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-gittip { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-gittip:before { + content: "\f184"; } + +.fa.fa-sun-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-sun-o:before { + content: "\f185"; } + +.fa.fa-moon-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-moon-o:before { + content: "\f186"; } + +.fa.fa-vk { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-weibo { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-renren { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-pagelines { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-stack-exchange { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-arrow-circle-o-right { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-arrow-circle-o-right:before { + content: "\f35a"; } + +.fa.fa-arrow-circle-o-left { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-arrow-circle-o-left:before { + content: "\f359"; } + +.fa.fa-caret-square-o-left { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-caret-square-o-left:before { + content: "\f191"; } + +.fa.fa-toggle-left { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-toggle-left:before { + content: "\f191"; } + +.fa.fa-dot-circle-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-dot-circle-o:before { + content: "\f192"; } + +.fa.fa-vimeo-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-vimeo-square:before { + content: "\f194"; } + +.fa.fa-try:before { + content: "\e2bb"; } + +.fa.fa-turkish-lira:before { + content: "\e2bb"; } + +.fa.fa-plus-square-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-plus-square-o:before { + content: "\f0fe"; } + +.fa.fa-slack { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-wordpress { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-openid { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-institution:before { + content: "\f19c"; } + +.fa.fa-bank:before { + content: "\f19c"; } + +.fa.fa-mortar-board:before { + content: "\f19d"; } + +.fa.fa-yahoo { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-google { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-reddit { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-reddit-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-reddit-square:before { + content: "\f1a2"; } + +.fa.fa-stumbleupon-circle { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-stumbleupon { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-delicious { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-digg { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-pied-piper-pp { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-pied-piper-alt { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-drupal { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-joomla { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-behance { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-behance-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-behance-square:before { + content: "\f1b5"; } + +.fa.fa-steam { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-steam-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-steam-square:before { + content: "\f1b7"; } + +.fa.fa-automobile:before { + content: "\f1b9"; } + +.fa.fa-cab:before { + content: "\f1ba"; } + +.fa.fa-spotify { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-deviantart { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-soundcloud { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-file-pdf-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-file-pdf-o:before { + content: "\f1c1"; } + +.fa.fa-file-word-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-file-word-o:before { + content: "\f1c2"; } + +.fa.fa-file-excel-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-file-excel-o:before { + content: "\f1c3"; } + +.fa.fa-file-powerpoint-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-file-powerpoint-o:before { + content: "\f1c4"; } + +.fa.fa-file-image-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-file-image-o:before { + content: "\f1c5"; } + +.fa.fa-file-photo-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-file-photo-o:before { + content: "\f1c5"; } + +.fa.fa-file-picture-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-file-picture-o:before { + content: "\f1c5"; } + +.fa.fa-file-archive-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-file-archive-o:before { + content: "\f1c6"; } + +.fa.fa-file-zip-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-file-zip-o:before { + content: "\f1c6"; } + +.fa.fa-file-audio-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-file-audio-o:before { + content: "\f1c7"; } + +.fa.fa-file-sound-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-file-sound-o:before { + content: "\f1c7"; } + +.fa.fa-file-video-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-file-video-o:before { + content: "\f1c8"; } + +.fa.fa-file-movie-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-file-movie-o:before { + content: "\f1c8"; } + +.fa.fa-file-code-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-file-code-o:before { + content: "\f1c9"; } + +.fa.fa-vine { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-codepen { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-jsfiddle { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-life-bouy:before { + content: "\f1cd"; } + +.fa.fa-life-buoy:before { + content: "\f1cd"; } + +.fa.fa-life-saver:before { + content: "\f1cd"; } + +.fa.fa-support:before { + content: "\f1cd"; } + +.fa.fa-circle-o-notch:before { + content: "\f1ce"; } + +.fa.fa-rebel { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-ra { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-ra:before { + content: "\f1d0"; } + +.fa.fa-resistance { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-resistance:before { + content: "\f1d0"; } + +.fa.fa-empire { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-ge { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-ge:before { + content: "\f1d1"; } + +.fa.fa-git-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-git-square:before { + content: "\f1d2"; } + +.fa.fa-git { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-hacker-news { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-y-combinator-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-y-combinator-square:before { + content: "\f1d4"; } + +.fa.fa-yc-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-yc-square:before { + content: "\f1d4"; } + +.fa.fa-tencent-weibo { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-qq { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-weixin { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-wechat { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-wechat:before { + content: "\f1d7"; } + +.fa.fa-send:before { + content: "\f1d8"; } + +.fa.fa-paper-plane-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-paper-plane-o:before { + content: "\f1d8"; } + +.fa.fa-send-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-send-o:before { + content: "\f1d8"; } + +.fa.fa-circle-thin { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-circle-thin:before { + content: "\f111"; } + +.fa.fa-header:before { + content: "\f1dc"; } + +.fa.fa-futbol-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-futbol-o:before { + content: "\f1e3"; } + +.fa.fa-soccer-ball-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-soccer-ball-o:before { + content: "\f1e3"; } + +.fa.fa-slideshare { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-twitch { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-yelp { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-newspaper-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-newspaper-o:before { + content: "\f1ea"; } + +.fa.fa-paypal { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-google-wallet { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-cc-visa { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-cc-mastercard { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-cc-discover { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-cc-amex { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-cc-paypal { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-cc-stripe { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-bell-slash-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-bell-slash-o:before { + content: "\f1f6"; } + +.fa.fa-trash:before { + content: "\f2ed"; } + +.fa.fa-copyright { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-eyedropper:before { + content: "\f1fb"; } + +.fa.fa-area-chart:before { + content: "\f1fe"; } + +.fa.fa-pie-chart:before { + content: "\f200"; } + +.fa.fa-line-chart:before { + content: "\f201"; } + +.fa.fa-lastfm { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-lastfm-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-lastfm-square:before { + content: "\f203"; } + +.fa.fa-ioxhost { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-angellist { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-cc { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-cc:before { + content: "\f20a"; } + +.fa.fa-ils:before { + content: "\f20b"; } + +.fa.fa-shekel:before { + content: "\f20b"; } + +.fa.fa-sheqel:before { + content: "\f20b"; } + +.fa.fa-buysellads { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-connectdevelop { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-dashcube { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-forumbee { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-leanpub { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-sellsy { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-shirtsinbulk { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-simplybuilt { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-skyatlas { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-diamond { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-diamond:before { + content: "\f3a5"; } + +.fa.fa-transgender:before { + content: "\f224"; } + +.fa.fa-intersex:before { + content: "\f224"; } + +.fa.fa-transgender-alt:before { + content: "\f225"; } + +.fa.fa-facebook-official { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-facebook-official:before { + content: "\f09a"; } + +.fa.fa-pinterest-p { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-whatsapp { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-hotel:before { + content: "\f236"; } + +.fa.fa-viacoin { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-medium { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-y-combinator { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-yc { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-yc:before { + content: "\f23b"; } + +.fa.fa-optin-monster { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-opencart { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-expeditedssl { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-battery-4:before { + content: "\f240"; } + +.fa.fa-battery:before { + content: "\f240"; } + +.fa.fa-battery-3:before { + content: "\f241"; } + +.fa.fa-battery-2:before { + content: "\f242"; } + +.fa.fa-battery-1:before { + content: "\f243"; } + +.fa.fa-battery-0:before { + content: "\f244"; } + +.fa.fa-object-group { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-object-ungroup { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-sticky-note-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-sticky-note-o:before { + content: "\f249"; } + +.fa.fa-cc-jcb { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-cc-diners-club { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-clone { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-hourglass-o:before { + content: "\f254"; } + +.fa.fa-hourglass-1:before { + content: "\f251"; } + +.fa.fa-hourglass-2:before { + content: "\f252"; } + +.fa.fa-hourglass-3:before { + content: "\f253"; } + +.fa.fa-hand-rock-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-hand-rock-o:before { + content: "\f255"; } + +.fa.fa-hand-grab-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-hand-grab-o:before { + content: "\f255"; } + +.fa.fa-hand-paper-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-hand-paper-o:before { + content: "\f256"; } + +.fa.fa-hand-stop-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-hand-stop-o:before { + content: "\f256"; } + +.fa.fa-hand-scissors-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-hand-scissors-o:before { + content: "\f257"; } + +.fa.fa-hand-lizard-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-hand-lizard-o:before { + content: "\f258"; } + +.fa.fa-hand-spock-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-hand-spock-o:before { + content: "\f259"; } + +.fa.fa-hand-pointer-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-hand-pointer-o:before { + content: "\f25a"; } + +.fa.fa-hand-peace-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-hand-peace-o:before { + content: "\f25b"; } + +.fa.fa-registered { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-creative-commons { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-gg { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-gg-circle { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-odnoklassniki { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-odnoklassniki-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-odnoklassniki-square:before { + content: "\f264"; } + +.fa.fa-get-pocket { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-wikipedia-w { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-safari { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-chrome { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-firefox { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-opera { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-internet-explorer { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-television:before { + content: "\f26c"; } + +.fa.fa-contao { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-500px { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-amazon { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-calendar-plus-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-calendar-plus-o:before { + content: "\f271"; } + +.fa.fa-calendar-minus-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-calendar-minus-o:before { + content: "\f272"; } + +.fa.fa-calendar-times-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-calendar-times-o:before { + content: "\f273"; } + +.fa.fa-calendar-check-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-calendar-check-o:before { + content: "\f274"; } + +.fa.fa-map-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-map-o:before { + content: "\f279"; } + +.fa.fa-commenting:before { + content: "\f4ad"; } + +.fa.fa-commenting-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-commenting-o:before { + content: "\f4ad"; } + +.fa.fa-houzz { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-vimeo { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-vimeo:before { + content: "\f27d"; } + +.fa.fa-black-tie { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-fonticons { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-reddit-alien { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-edge { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-credit-card-alt:before { + content: "\f09d"; } + +.fa.fa-codiepie { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-modx { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-fort-awesome { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-usb { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-product-hunt { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-mixcloud { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-scribd { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-pause-circle-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-pause-circle-o:before { + content: "\f28b"; } + +.fa.fa-stop-circle-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-stop-circle-o:before { + content: "\f28d"; } + +.fa.fa-bluetooth { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-bluetooth-b { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-gitlab { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-wpbeginner { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-wpforms { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-envira { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-wheelchair-alt { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-wheelchair-alt:before { + content: "\f368"; } + +.fa.fa-question-circle-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-question-circle-o:before { + content: "\f059"; } + +.fa.fa-volume-control-phone:before { + content: "\f2a0"; } + +.fa.fa-asl-interpreting:before { + content: "\f2a3"; } + +.fa.fa-deafness:before { + content: "\f2a4"; } + +.fa.fa-hard-of-hearing:before { + content: "\f2a4"; } + +.fa.fa-glide { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-glide-g { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-signing:before { + content: "\f2a7"; } + +.fa.fa-viadeo { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-viadeo-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-viadeo-square:before { + content: "\f2aa"; } + +.fa.fa-snapchat { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-snapchat-ghost { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-snapchat-ghost:before { + content: "\f2ab"; } + +.fa.fa-snapchat-square { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-snapchat-square:before { + content: "\f2ad"; } + +.fa.fa-pied-piper { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-first-order { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-yoast { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-themeisle { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-google-plus-official { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-google-plus-official:before { + content: "\f2b3"; } + +.fa.fa-google-plus-circle { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-google-plus-circle:before { + content: "\f2b3"; } + +.fa.fa-font-awesome { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-fa { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-fa:before { + content: "\f2b4"; } + +.fa.fa-handshake-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-handshake-o:before { + content: "\f2b5"; } + +.fa.fa-envelope-open-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-envelope-open-o:before { + content: "\f2b6"; } + +.fa.fa-linode { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-address-book-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-address-book-o:before { + content: "\f2b9"; } + +.fa.fa-vcard:before { + content: "\f2bb"; } + +.fa.fa-address-card-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-address-card-o:before { + content: "\f2bb"; } + +.fa.fa-vcard-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-vcard-o:before { + content: "\f2bb"; } + +.fa.fa-user-circle-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-user-circle-o:before { + content: "\f2bd"; } + +.fa.fa-user-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-user-o:before { + content: "\f007"; } + +.fa.fa-id-badge { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-drivers-license:before { + content: "\f2c2"; } + +.fa.fa-id-card-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-id-card-o:before { + content: "\f2c2"; } + +.fa.fa-drivers-license-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-drivers-license-o:before { + content: "\f2c2"; } + +.fa.fa-quora { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-free-code-camp { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-telegram { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-thermometer-4:before { + content: "\f2c7"; } + +.fa.fa-thermometer:before { + content: "\f2c7"; } + +.fa.fa-thermometer-3:before { + content: "\f2c8"; } + +.fa.fa-thermometer-2:before { + content: "\f2c9"; } + +.fa.fa-thermometer-1:before { + content: "\f2ca"; } + +.fa.fa-thermometer-0:before { + content: "\f2cb"; } + +.fa.fa-bathtub:before { + content: "\f2cd"; } + +.fa.fa-s15:before { + content: "\f2cd"; } + +.fa.fa-window-maximize { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-window-restore { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-times-rectangle:before { + content: "\f410"; } + +.fa.fa-window-close-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-window-close-o:before { + content: "\f410"; } + +.fa.fa-times-rectangle-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-times-rectangle-o:before { + content: "\f410"; } + +.fa.fa-bandcamp { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-grav { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-etsy { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-imdb { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-ravelry { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-eercast { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-eercast:before { + content: "\f2da"; } + +.fa.fa-snowflake-o { + font-family: 'Font Awesome 6 Free'; + font-weight: 400; } + +.fa.fa-snowflake-o:before { + content: "\f2dc"; } + +.fa.fa-superpowers { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-wpexplorer { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } + +.fa.fa-meetup { + font-family: 'Font Awesome 6 Brands'; + font-weight: 400; } diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-brands-400.eot b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-brands-400.eot deleted file mode 100644 index 8745c3eb0..000000000 Binary files a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-brands-400.eot and /dev/null differ diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-brands-400.svg b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-brands-400.svg deleted file mode 100644 index 32ba3b120..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-brands-400.svg +++ /dev/null @@ -1,3633 +0,0 @@ - - - - - -Created by FontForge 20190801 at Thu Jun 18 14:52:21 2020 - By Robert Madole -Copyright (c) Font Awesome - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-brands-400.ttf b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-brands-400.ttf index ef792f424..1fbb1f7c3 100644 Binary files a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-brands-400.ttf and b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-brands-400.ttf differ diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-brands-400.woff b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-brands-400.woff deleted file mode 100644 index 4d5c55f98..000000000 Binary files a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-brands-400.woff and /dev/null differ diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-brands-400.woff2 b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-brands-400.woff2 index 1c640823b..5d2802169 100644 Binary files a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-brands-400.woff2 and b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-brands-400.woff2 differ diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-regular-400.eot b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-regular-400.eot deleted file mode 100644 index 1de96d4b9..000000000 Binary files a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-regular-400.eot and /dev/null differ diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-regular-400.svg b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-regular-400.svg deleted file mode 100644 index f17818b14..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-regular-400.svg +++ /dev/null @@ -1,803 +0,0 @@ - - - - - -Created by FontForge 20190801 at Thu Jun 18 14:52:21 2020 - By Robert Madole -Copyright (c) Font Awesome - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-regular-400.ttf b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-regular-400.ttf index 3c0cf40e0..549d68dc0 100644 Binary files a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-regular-400.ttf and b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-regular-400.ttf differ diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-regular-400.woff b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-regular-400.woff deleted file mode 100644 index 53b47b5e5..000000000 Binary files a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-regular-400.woff and /dev/null differ diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-regular-400.woff2 b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-regular-400.woff2 index 585a29db5..18400d7fa 100644 Binary files a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-regular-400.woff2 and b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-regular-400.woff2 differ diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-solid-900.eot b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-solid-900.eot deleted file mode 100644 index 5318231d1..000000000 Binary files a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-solid-900.eot and /dev/null differ diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-solid-900.svg b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-solid-900.svg deleted file mode 100644 index 4faef4e43..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-solid-900.svg +++ /dev/null @@ -1,5000 +0,0 @@ - - - - - -Created by FontForge 20190801 at Thu Jun 18 14:52:21 2020 - By Robert Madole -Copyright (c) Font Awesome - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-solid-900.ttf b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-solid-900.ttf index 8adeea24e..bb2a86956 100644 Binary files a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-solid-900.ttf and b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-solid-900.ttf differ diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-solid-900.woff b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-solid-900.woff deleted file mode 100644 index 65f1d331a..000000000 Binary files a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-solid-900.woff and /dev/null differ diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-solid-900.woff2 b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-solid-900.woff2 index b48ec6c3f..758dd4f60 100644 Binary files a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-solid-900.woff2 and b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/@fortawesome/fontawesome-free/webfonts/fa-solid-900.woff2 differ diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/abp/core/abp.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/abp/core/abp.js index f353b9dd2..ad1d23844 100644 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/abp/core/abp.js +++ b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/abp/core/abp.js @@ -72,36 +72,83 @@ var abp = abp || {}; /* LOCALIZATION ***********************************************/ abp.localization = abp.localization || {}; + abp.localization.internal = abp.localization.internal || {}; + abp.localization.values = abp.localization.values || {}; + abp.localization.resources = abp.localization.resources || {}; + + abp.localization.internal.getResource = function (resourceName) { + var resource = abp.localization.resources[resourceName]; + if (resource) { + return resource; + } + + var legacySource = abp.localization.values[resourceName]; + if (legacySource) { + return { + texts: abp.localization.values[resourceName], + baseResources: [] + }; + } + + abp.log.warn('Could not find localization source: ' + resourceName); + return null; + }; + + abp.localization.internal.localize = function (key, sourceName) { + var resource = abp.localization.internal.getResource(sourceName); + if (!resource){ + return { + value: key, + found: false + }; + } - abp.localization.values = {}; + var value = resource.texts[key]; + if (value === undefined) { + for (var i = 0; i < resource.baseResources.length; i++){ + var basedArguments = Array.prototype.slice.call(arguments, 0); + basedArguments[1] = resource.baseResources[i]; - abp.localization.localize = function (key, sourceName) { - if (sourceName === '_') { //A convention to suppress the localization - return key; + var result = abp.localization.internal.localize.apply(this, basedArguments); + if (result.found){ + return result; + } + } + + return { + value: key, + found: false + }; } - sourceName = sourceName || abp.localization.defaultResourceName; - if (!sourceName) { - abp.log.warn('Localization source name is not specified and the defaultResourceName was not defined!'); - return key; - } + var copiedArguments = Array.prototype.slice.call(arguments, 0); + copiedArguments.splice(1, 1); + copiedArguments[0] = value; + + return { + value: abp.utils.formatString.apply(this, copiedArguments), + found: true + }; + }; - var source = abp.localization.values[sourceName]; - if (!source) { - abp.log.warn('Could not find localization source: ' + sourceName); + abp.localization.localize = function (key, sourceName) { + if (sourceName === '_') { //A convention to suppress the localization return key; } + + if (sourceName) { + return abp.localization.internal.localize.apply(this, arguments).value; + } - var value = source[key]; - if (value == undefined) { + if (!abp.localization.defaultResourceName) { + abp.log.warn('Localization source name is not specified and the defaultResourceName was not defined!'); return key; } var copiedArguments = Array.prototype.slice.call(arguments, 0); - copiedArguments.splice(1, 1); - copiedArguments[0] = value; + copiedArguments.splice(1, 1, abp.localization.defaultResourceName); - return abp.utils.formatString.apply(this, copiedArguments); + return abp.localization.internal.localize.apply(this, copiedArguments).value; }; abp.localization.isLocalized = function (key, sourceName) { @@ -114,17 +161,7 @@ var abp = abp || {}; return false; } - var source = abp.localization.values[sourceName]; - if (!source) { - return false; - } - - var value = source[key]; - if (value === undefined) { - return false; - } - - return true; + return abp.localization.internal.localize(key, sourceName).found; }; abp.localization.getResource = function (name) { @@ -173,12 +210,10 @@ var abp = abp || {}; abp.auth = abp.auth || {}; - abp.auth.policies = abp.auth.policies || {}; - abp.auth.grantedPolicies = abp.auth.grantedPolicies || {}; abp.auth.isGranted = function (policyName) { - return abp.auth.policies[policyName] != undefined && abp.auth.grantedPolicies[policyName] != undefined; + return abp.auth.grantedPolicies[policyName] != undefined; }; abp.auth.isAnyGranted = function () { @@ -372,7 +407,9 @@ var abp = abp || {}; setTimeout(function () { if (element) { element.classList.remove('abp-block-area-disappearing'); - element.parentElement.removeChild(element); + if (element.parentElement) { + element.parentElement.removeChild(element); + } } }, 250); } @@ -685,7 +722,7 @@ var abp = abp || {}; } /** - * Escape HTML to help prevent XSS attacks. + * Escape HTML to help prevent XSS attacks. */ abp.utils.htmlEscape = function (html) { return typeof html === 'string' ? html.replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"') : html; @@ -757,7 +794,7 @@ var abp = abp || {}; return toUtc(date); } }; - + /* FEATURES *************************************************/ abp.features = abp.features || {}; @@ -772,5 +809,15 @@ var abp = abp || {}; abp.features.get = function (name) { return abp.features.values[name]; }; - + + /* GLOBAL FEATURES *************************************************/ + + abp.globalFeatures = abp.globalFeatures || {}; + + abp.globalFeatures.enabledFeatures = abp.globalFeatures.enabledFeatures || []; + + abp.globalFeatures.isEnabled = function(name){ + return abp.globalFeatures.enabledFeatures.indexOf(name) != -1; + } + })(); diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/abp/jquery/abp.jquery.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/abp/jquery/abp.jquery.js index 81ebf1e2e..7dc3439da 100644 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/abp/jquery/abp.jquery.js +++ b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/abp/jquery/abp.jquery.js @@ -205,14 +205,16 @@ var abp = abp || {}; handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) { var messagePromise = null; + var responseJSON = jqXHR.responseJSON ? jqXHR.responseJSON : JSON.parse(jqXHR.responseText); + if (userOptions.abpHandleError !== false) { - messagePromise = abp.ajax.showError(jqXHR.responseJSON.error); + messagePromise = abp.ajax.showError(responseJSON.error); } - abp.ajax.logError(jqXHR.responseJSON.error); + abp.ajax.logError(responseJSON.error); - $dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR); - userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR); + $dfd && $dfd.reject(responseJSON.error, jqXHR); + userOptions.error && userOptions.error(responseJSON.error, jqXHR); if (jqXHR.status === 401 && userOptions.abpHandleError !== false) { abp.ajax.handleUnAuthorizedRequest(messagePromise); @@ -369,13 +371,18 @@ var abp = abp || {}; }; var _loadScript = function (url, loadCallback, failCallback) { + var nonce = document.body.nonce || document.body.getAttribute('nonce'); _loadFromUrl(url, loadCallback, failCallback, function (urlInfo) { $.get({ url: url, dataType: 'text' }) .done(function (script) { - $.globalEval(script); + if(nonce){ + $.globalEval(script, { nonce: nonce}); + }else{ + $.globalEval(script); + } urlInfo.succeed(); }) .fail(function () { diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/abp/utils/abp-utils.umd.js.map b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/abp/utils/abp-utils.umd.js.map index 2c5d45ddc..c8cf999f3 100644 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/abp/utils/abp-utils.umd.js.map +++ b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/abp/utils/abp-utils.umd.js.map @@ -1 +1 @@ -{"version":3,"file":"abp-utils.umd.js","sources":["../../node_modules/tslib/tslib.es6.js","../../projects/utils/src/lib/linked-list.ts","../../projects/utils/src/public-api.ts","../../projects/utils/src/abp-utils.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","/* tslint:disable:no-non-null-assertion */\n\nimport compare from 'just-compare';\n\nexport class ListNode {\n next: ListNode | undefined;\n previous: ListNode | undefined;\n constructor(public readonly value: T) {}\n}\n\nexport class LinkedList {\n private first: ListNode | undefined;\n private last: ListNode | undefined;\n private size = 0;\n\n get head(): ListNode | undefined {\n return this.first;\n }\n get tail(): ListNode | undefined {\n return this.last;\n }\n get length(): number {\n return this.size;\n }\n\n private attach(\n value: T,\n previousNode: ListNode | undefined,\n nextNode: ListNode | undefined,\n ): ListNode {\n if (!previousNode) return this.addHead(value);\n\n if (!nextNode) return this.addTail(value);\n\n const node = new ListNode(value);\n node.previous = previousNode;\n previousNode.next = node;\n node.next = nextNode;\n nextNode.previous = node;\n\n this.size++;\n\n return node;\n }\n\n private attachMany(\n values: T[],\n previousNode: ListNode | undefined,\n nextNode: ListNode | undefined,\n ): ListNode[] {\n if (!values.length) return [];\n\n if (!previousNode) return this.addManyHead(values);\n\n if (!nextNode) return this.addManyTail(values);\n\n const list = new LinkedList();\n list.addManyTail(values);\n list.first!.previous = previousNode;\n previousNode.next = list.first;\n list.last!.next = nextNode;\n nextNode.previous = list.last;\n\n this.size += values.length;\n\n return list.toNodeArray();\n }\n\n private detach(node: ListNode) {\n if (!node.previous) return this.dropHead();\n\n if (!node.next) return this.dropTail();\n\n node.previous.next = node.next;\n node.next.previous = node.previous;\n\n this.size--;\n\n return node;\n }\n\n add(value: T) {\n return {\n after: (...params: [T] | [any, ListComparisonFn]) =>\n this.addAfter.call(this, value, ...params),\n before: (...params: [T] | [any, ListComparisonFn]) =>\n this.addBefore.call(this, value, ...params),\n byIndex: (position: number) => this.addByIndex(value, position),\n head: () => this.addHead(value),\n tail: () => this.addTail(value),\n };\n }\n\n addMany(values: T[]) {\n return {\n after: (...params: [T] | [any, ListComparisonFn]) =>\n this.addManyAfter.call(this, values, ...params),\n before: (...params: [T] | [any, ListComparisonFn]) =>\n this.addManyBefore.call(this, values, ...params),\n byIndex: (position: number) => this.addManyByIndex(values, position),\n head: () => this.addManyHead(values),\n tail: () => this.addManyTail(values),\n };\n }\n\n addAfter(value: T, previousValue: T): ListNode;\n addAfter(value: T, previousValue: any, compareFn: ListComparisonFn): ListNode;\n addAfter(value: T, previousValue: any, compareFn: ListComparisonFn = compare): ListNode {\n const previous = this.find(node => compareFn(node.value, previousValue));\n\n return previous ? this.attach(value, previous, previous.next) : this.addTail(value);\n }\n\n addBefore(value: T, nextValue: T): ListNode;\n addBefore(value: T, nextValue: any, compareFn: ListComparisonFn): ListNode;\n addBefore(value: T, nextValue: any, compareFn: ListComparisonFn = compare): ListNode {\n const next = this.find(node => compareFn(node.value, nextValue));\n\n return next ? this.attach(value, next.previous, next) : this.addHead(value);\n }\n\n addByIndex(value: T, position: number): ListNode {\n if (position < 0) position += this.size;\n else if (position >= this.size) return this.addTail(value);\n\n if (position <= 0) return this.addHead(value);\n\n const next = this.get(position)!;\n\n return this.attach(value, next.previous, next);\n }\n\n addHead(value: T): ListNode {\n const node = new ListNode(value);\n\n node.next = this.first;\n\n if (this.first) this.first.previous = node;\n else this.last = node;\n\n this.first = node;\n this.size++;\n\n return node;\n }\n\n addTail(value: T): ListNode {\n const node = new ListNode(value);\n\n if (this.first) {\n node.previous = this.last;\n this.last!.next = node;\n this.last = node;\n } else {\n this.first = node;\n this.last = node;\n }\n\n this.size++;\n\n return node;\n }\n\n addManyAfter(values: T[], previousValue: T): ListNode[];\n addManyAfter(values: T[], previousValue: any, compareFn: ListComparisonFn): ListNode[];\n addManyAfter(\n values: T[],\n previousValue: any,\n compareFn: ListComparisonFn = compare,\n ): ListNode[] {\n const previous = this.find(node => compareFn(node.value, previousValue));\n\n return previous ? this.attachMany(values, previous, previous.next) : this.addManyTail(values);\n }\n\n addManyBefore(values: T[], nextValue: T): ListNode[];\n addManyBefore(values: T[], nextValue: any, compareFn: ListComparisonFn): ListNode[];\n addManyBefore(\n values: T[],\n nextValue: any,\n compareFn: ListComparisonFn = compare,\n ): ListNode[] {\n const next = this.find(node => compareFn(node.value, nextValue));\n\n return next ? this.attachMany(values, next.previous, next) : this.addManyHead(values);\n }\n\n addManyByIndex(values: T[], position: number): ListNode[] {\n if (position < 0) position += this.size;\n\n if (position <= 0) return this.addManyHead(values);\n\n if (position >= this.size) return this.addManyTail(values);\n\n const next = this.get(position)!;\n\n return this.attachMany(values, next.previous, next);\n }\n\n addManyHead(values: T[]): ListNode[] {\n return values.reduceRight[]>((nodes, value) => {\n nodes.unshift(this.addHead(value));\n return nodes;\n }, []);\n }\n\n addManyTail(values: T[]): ListNode[] {\n return values.map(value => this.addTail(value));\n }\n\n drop() {\n return {\n byIndex: (position: number) => this.dropByIndex(position),\n byValue: (...params: [T] | [any, ListComparisonFn]) =>\n this.dropByValue.apply(this, params),\n byValueAll: (...params: [T] | [any, ListComparisonFn]) =>\n this.dropByValueAll.apply(this, params),\n head: () => this.dropHead(),\n tail: () => this.dropTail(),\n };\n }\n\n dropMany(count: number) {\n return {\n byIndex: (position: number) => this.dropManyByIndex(count, position),\n head: () => this.dropManyHead(count),\n tail: () => this.dropManyTail(count),\n };\n }\n\n dropByIndex(position: number): ListNode | undefined {\n if (position < 0) position += this.size;\n\n const current = this.get(position);\n\n return current ? this.detach(current) : undefined;\n }\n\n dropByValue(value: T): ListNode | undefined;\n dropByValue(value: any, compareFn: ListComparisonFn): ListNode | undefined;\n dropByValue(value: any, compareFn: ListComparisonFn = compare): ListNode | undefined {\n const position = this.findIndex(node => compareFn(node.value, value));\n\n return position < 0 ? undefined : this.dropByIndex(position);\n }\n\n dropByValueAll(value: T): ListNode[];\n dropByValueAll(value: any, compareFn: ListComparisonFn): ListNode[];\n dropByValueAll(value: any, compareFn: ListComparisonFn = compare): ListNode[] {\n const dropped: ListNode[] = [];\n\n for (let current = this.first, position = 0; current; position++, current = current.next) {\n if (compareFn(current.value, value)) {\n dropped.push(this.dropByIndex(position - dropped.length)!);\n }\n }\n\n return dropped;\n }\n\n dropHead(): ListNode | undefined {\n const head = this.first;\n\n if (head) {\n this.first = head.next;\n\n if (this.first) this.first.previous = undefined;\n else this.last = undefined;\n\n this.size--;\n\n return head;\n }\n\n return undefined;\n }\n\n dropTail(): ListNode | undefined {\n const tail = this.last;\n\n if (tail) {\n this.last = tail.previous;\n\n if (this.last) this.last.next = undefined;\n else this.first = undefined;\n\n this.size--;\n\n return tail;\n }\n\n return undefined;\n }\n\n dropManyByIndex(count: number, position: number): ListNode[] {\n if (count <= 0) return [];\n\n if (position < 0) position = Math.max(position + this.size, 0);\n else if (position >= this.size) return [];\n\n count = Math.min(count, this.size - position);\n\n const dropped: ListNode[] = [];\n\n while (count--) {\n const current = this.get(position);\n dropped.push(this.detach(current!)!);\n }\n\n return dropped;\n }\n\n dropManyHead(count: Exclude): ListNode[] {\n if (count <= 0) return [];\n\n count = Math.min(count, this.size);\n\n const dropped: ListNode[] = [];\n\n while (count--) dropped.unshift(this.dropHead()!);\n\n return dropped;\n }\n\n dropManyTail(count: Exclude): ListNode[] {\n if (count <= 0) return [];\n\n count = Math.min(count, this.size);\n\n const dropped: ListNode[] = [];\n\n while (count--) dropped.push(this.dropTail()!);\n\n return dropped;\n }\n\n find(predicate: ListIteratorFn): ListNode | undefined {\n for (let current = this.first, position = 0; current; position++, current = current.next) {\n if (predicate(current, position, this)) return current;\n }\n\n return undefined;\n }\n\n findIndex(predicate: ListIteratorFn): number {\n for (let current = this.first, position = 0; current; position++, current = current.next) {\n if (predicate(current, position, this)) return position;\n }\n\n return -1;\n }\n\n forEach(iteratorFn: ListIteratorFn) {\n for (let node = this.first, position = 0; node; position++, node = node.next) {\n iteratorFn(node, position, this);\n }\n }\n\n get(position: number): ListNode | undefined {\n return this.find((_, index) => position === index);\n }\n\n indexOf(value: T): number;\n indexOf(value: any, compareFn: ListComparisonFn): number;\n indexOf(value: any, compareFn: ListComparisonFn = compare): number {\n return this.findIndex(node => compareFn(node.value, value));\n }\n\n toArray(): T[] {\n const array = new Array(this.size);\n\n this.forEach((node, index) => (array[index!] = node.value));\n\n return array;\n }\n\n toNodeArray(): ListNode[] {\n const array = new Array(this.size);\n\n this.forEach((node, index) => (array[index!] = node));\n\n return array;\n }\n\n toString(mapperFn: ListMapperFn = JSON.stringify): string {\n return this.toArray()\n .map(value => mapperFn(value))\n .join(' <-> ');\n }\n\n // Cannot use Generator type because of ng-packagr\n *[Symbol.iterator](): any {\n for (let node = this.first, position = 0; node; position++, node = node.next) {\n yield node.value;\n }\n }\n}\n\nexport type ListMapperFn = (value: T) => any;\n\nexport type ListComparisonFn = (value1: T, value2: any) => boolean;\n\nexport type ListIteratorFn = (\n node: ListNode,\n index?: number,\n list?: LinkedList,\n) => R;\n","/*\n * Public API Surface of utils\n */\n\nexport * from './lib/linked-list';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;IAAA;;;;;;;;;;;;;;IAcA;IAEA,IAAI,aAAa,GAAG,UAAS,CAAC,EAAE,CAAC;QAC7B,aAAa,GAAG,MAAM,CAAC,cAAc;aAChC,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;YAC5E,UAAU,CAAC,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC;gBAAE,IAAI,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC;oBAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/E,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/B,CAAC,CAAC;aAEc,SAAS,CAAC,CAAC,EAAE,CAAC;QAC1B,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACpB,SAAS,EAAE,KAAK,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE;QACvC,CAAC,CAAC,SAAS,GAAG,CAAC,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IACzF,CAAC;IAEM,IAAI,QAAQ,GAAG;QAClB,QAAQ,GAAG,MAAM,CAAC,MAAM,IAAI,SAAS,QAAQ,CAAC,CAAC;YAC3C,KAAK,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;gBACjD,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;gBACjB,KAAK,IAAI,CAAC,IAAI,CAAC;oBAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;wBAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;aAChF;YACD,OAAO,CAAC,CAAC;SACZ,CAAA;QACD,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAC3C,CAAC,CAAA;aAEe,MAAM,CAAC,CAAC,EAAE,CAAC;QACvB,IAAI,CAAC,GAAG,EAAE,CAAC;QACX,KAAK,IAAI,CAAC,IAAI,CAAC;YAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;gBAC/E,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAChB,IAAI,CAAC,IAAI,IAAI,IAAI,OAAO,MAAM,CAAC,qBAAqB,KAAK,UAAU;YAC/D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACpE,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;oBAC1E,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aACzB;QACL,OAAO,CAAC,CAAC;IACb,CAAC;aAEe,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI;QACpD,IAAI,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;QAC7H,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,CAAC,QAAQ,KAAK,UAAU;YAAE,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;;YAC1H,KAAK,IAAI,CAAC,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;gBAAE,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC;oBAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;QAClJ,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IAClE,CAAC;aAEe,OAAO,CAAC,UAAU,EAAE,SAAS;QACzC,OAAO,UAAU,MAAM,EAAE,GAAG,IAAI,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC,EAAE,CAAA;IACzE,CAAC;aAEe,UAAU,CAAC,WAAW,EAAE,aAAa;QACjD,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,CAAC,QAAQ,KAAK,UAAU;YAAE,OAAO,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;IACnI,CAAC;aAEe,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,SAAS;QACvD,SAAS,KAAK,CAAC,KAAK,IAAI,OAAO,KAAK,YAAY,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,CAAC,UAAU,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;QAC5G,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,EAAE,UAAU,OAAO,EAAE,MAAM;YACrD,SAAS,SAAS,CAAC,KAAK,IAAI,IAAI;gBAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;aAAE;YAAC,OAAO,CAAC,EAAE;gBAAE,MAAM,CAAC,CAAC,CAAC,CAAC;aAAE,EAAE;YAC3F,SAAS,QAAQ,CAAC,KAAK,IAAI,IAAI;gBAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;aAAE;YAAC,OAAO,CAAC,EAAE;gBAAE,MAAM,CAAC,CAAC,CAAC,CAAC;aAAE,EAAE;YAC9F,SAAS,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,EAAE;YAC9G,IAAI,CAAC,CAAC,SAAS,GAAG,SAAS,CAAC,KAAK,CAAC,OAAO,EAAE,UAAU,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;SACzE,CAAC,CAAC;IACP,CAAC;aAEe,WAAW,CAAC,OAAO,EAAE,IAAI;QACrC,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,cAAa,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;gBAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACjH,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,OAAO,MAAM,KAAK,UAAU,KAAK,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,cAAa,OAAO,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACzJ,SAAS,IAAI,CAAC,CAAC,IAAI,OAAO,UAAU,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE;QAClE,SAAS,IAAI,CAAC,EAAE;YACZ,IAAI,CAAC;gBAAE,MAAM,IAAI,SAAS,CAAC,iCAAiC,CAAC,CAAC;YAC9D,OAAO,CAAC;gBAAE,IAAI;oBACV,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI;wBAAE,OAAO,CAAC,CAAC;oBAC7J,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;wBAAE,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;oBACxC,QAAQ,EAAE,CAAC,CAAC,CAAC;wBACT,KAAK,CAAC,CAAC;wBAAC,KAAK,CAAC;4BAAE,CAAC,GAAG,EAAE,CAAC;4BAAC,MAAM;wBAC9B,KAAK,CAAC;4BAAE,CAAC,CAAC,KAAK,EAAE,CAAC;4BAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;wBACxD,KAAK,CAAC;4BAAE,CAAC,CAAC,KAAK,EAAE,CAAC;4BAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;4BAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;4BAAC,SAAS;wBACjD,KAAK,CAAC;4BAAE,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;4BAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;4BAAC,SAAS;wBACjD;4BACI,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE;gCAAE,CAAC,GAAG,CAAC,CAAC;gCAAC,SAAS;6BAAE;4BAC5G,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;gCAAE,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;gCAAC,MAAM;6BAAE;4BACtF,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE;gCAAE,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;gCAAC,CAAC,GAAG,EAAE,CAAC;gCAAC,MAAM;6BAAE;4BACrE,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE;gCAAE,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;gCAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gCAAC,MAAM;6BAAE;4BACnE,IAAI,CAAC,CAAC,CAAC,CAAC;gCAAE,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;4BACtB,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;4BAAC,SAAS;qBAC9B;oBACD,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;iBAC9B;gBAAC,OAAO,CAAC,EAAE;oBAAE,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;oBAAC,CAAC,GAAG,CAAC,CAAC;iBAAE;wBAAS;oBAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;iBAAE;YAC1D,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;gBAAE,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;YAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;SACpF;IACL,CAAC;IAEM,IAAI,eAAe,GAAG,MAAM,CAAC,MAAM,IAAI,UAAS,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE;QAC9D,IAAI,EAAE,KAAK,SAAS;YAAE,EAAE,GAAG,CAAC,CAAC;QAC7B,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,cAAa,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACzF,CAAC,KAAK,UAAS,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE;QACtB,IAAI,EAAE,KAAK,SAAS;YAAE,EAAE,GAAG,CAAC,CAAC;QAC7B,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;aAEa,YAAY,CAAC,CAAC,EAAE,OAAO;QACnC,KAAK,IAAI,CAAC,IAAI,CAAC;YAAE,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC;gBAAE,eAAe,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACvG,CAAC;aAEe,QAAQ,CAAC,CAAC;QACtB,IAAI,CAAC,GAAG,OAAO,MAAM,KAAK,UAAU,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;QAC9E,IAAI,CAAC;YAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC,MAAM,KAAK,QAAQ;YAAE,OAAO;gBAC1C,IAAI,EAAE;oBACF,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM;wBAAE,CAAC,GAAG,KAAK,CAAC,CAAC;oBACnC,OAAO,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;iBAC3C;aACJ,CAAC;QACF,MAAM,IAAI,SAAS,CAAC,CAAC,GAAG,yBAAyB,GAAG,iCAAiC,CAAC,CAAC;IAC3F,CAAC;aAEe,MAAM,CAAC,CAAC,EAAE,CAAC;QACvB,IAAI,CAAC,GAAG,OAAO,MAAM,KAAK,UAAU,IAAI,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC3D,IAAI,CAAC,CAAC;YAAE,OAAO,CAAC,CAAC;QACjB,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QACjC,IAAI;YACA,OAAO,CAAC,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,IAAI;gBAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;SAC9E;QACD,OAAO,KAAK,EAAE;YAAE,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;SAAE;gBAC/B;YACJ,IAAI;gBACA,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC;oBAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACpD;oBACO;gBAAE,IAAI,CAAC;oBAAE,MAAM,CAAC,CAAC,KAAK,CAAC;aAAE;SACpC;QACD,OAAO,EAAE,CAAC;IACd,CAAC;aAEe,QAAQ;QACpB,KAAK,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE;YAC9C,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACzC,OAAO,EAAE,CAAC;IACd,CAAC;aAEe,cAAc;QAC1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE;YAAE,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QACpF,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE;YAC5C,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE;gBAC7D,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACpB,OAAO,CAAC,CAAC;IACb,CAAC;IAAA,CAAC;aAEc,OAAO,CAAC,CAAC;QACrB,OAAO,IAAI,YAAY,OAAO,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,IAAI,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;IACzE,CAAC;aAEe,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS;QAC3D,IAAI,CAAC,MAAM,CAAC,aAAa;YAAE,MAAM,IAAI,SAAS,CAAC,sCAAsC,CAAC,CAAC;QACvF,IAAI,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,OAAO,EAAE,UAAU,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC;QAC9D,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,cAAc,OAAO,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;QACtH,SAAS,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;YAAE,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,IAAI,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE;QAC1I,SAAS,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI;YAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAAE;QAAC,OAAO,CAAC,EAAE;YAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SAAE,EAAE;QAClF,SAAS,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,YAAY,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;QACxH,SAAS,OAAO,CAAC,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,EAAE;QAClD,SAAS,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,EAAE;QAClD,SAAS,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,MAAM;YAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;IACtF,CAAC;aAEe,gBAAgB,CAAC,CAAC;QAC9B,IAAI,CAAC,EAAE,CAAC,CAAC;QACT,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,cAAc,OAAO,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;QAC5I,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,IAAI,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,KAAK,QAAQ,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE;IACnJ,CAAC;aAEe,aAAa,CAAC,CAAC;QAC3B,IAAI,CAAC,MAAM,CAAC,aAAa;YAAE,MAAM,IAAI,SAAS,CAAC,sCAAsC,CAAC,CAAC;QACvF,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;QACnC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,QAAQ,KAAK,UAAU,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,cAAc,OAAO,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QACjN,SAAS,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,IAAI,OAAO,IAAI,OAAO,CAAC,UAAU,OAAO,EAAE,MAAM,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE;QAChK,SAAS,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAS,CAAC,IAAI,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,EAAE;IAChI,CAAC;aAEe,oBAAoB,CAAC,MAAM,EAAE,GAAG;QAC5C,IAAI,MAAM,CAAC,cAAc,EAAE;YAAE,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;SAAE;aAAM;YAAE,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC;SAAE;QAC/G,OAAO,MAAM,CAAC;IAClB,CAAC;IAAA,CAAC;IAEF,IAAI,kBAAkB,GAAG,MAAM,CAAC,MAAM,IAAI,UAAS,CAAC,EAAE,CAAC;QACnD,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;IACxE,CAAC,IAAI,UAAS,CAAC,EAAE,CAAC;QACd,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC,CAAC;aAEc,YAAY,CAAC,GAAG;QAC5B,IAAI,GAAG,IAAI,GAAG,CAAC,UAAU;YAAE,OAAO,GAAG,CAAC;QACtC,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI,GAAG,IAAI,IAAI;YAAE,KAAK,IAAI,CAAC,IAAI,GAAG;gBAAE,IAAI,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;oBAAE,eAAe,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;QAC5G,kBAAkB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAChC,OAAO,MAAM,CAAC;IAClB,CAAC;aAEe,eAAe,CAAC,GAAG;QAC/B,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,UAAU,IAAI,GAAG,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;IAC5D,CAAC;aAEe,sBAAsB,CAAC,QAAQ,EAAE,UAAU;QACvD,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;YAC3B,MAAM,IAAI,SAAS,CAAC,gDAAgD,CAAC,CAAC;SACzE;QACD,OAAO,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;aAEe,sBAAsB,CAAC,QAAQ,EAAE,UAAU,EAAE,KAAK;QAC9D,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;YAC3B,MAAM,IAAI,SAAS,CAAC,gDAAgD,CAAC,CAAC;SACzE;QACD,UAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QAChC,OAAO,KAAK,CAAC;IACjB;;;QC3NE,kBAA4B,KAAQ;YAAR,UAAK,GAAL,KAAK,CAAG;SAAI;uBACzC;KAAA,IAAA;;QAED;YAGU,SAAI,GAAG,CAAC,CAAC;SA+XlB;QA7XC,sBAAI,4BAAI;iBAAR;gBACE,OAAO,IAAI,CAAC,KAAK,CAAC;aACnB;;;WAAA;QACD,sBAAI,4BAAI;iBAAR;gBACE,OAAO,IAAI,CAAC,IAAI,CAAC;aAClB;;;WAAA;QACD,sBAAI,8BAAM;iBAAV;gBACE,OAAO,IAAI,CAAC,IAAI,CAAC;aAClB;;;WAAA;QAEO,2BAAM,GAAN,UACN,KAAQ,EACR,YAAqC,EACrC,QAAiC;YAEjC,IAAI,CAAC,YAAY;gBAAE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAE9C,IAAI,CAAC,QAAQ;gBAAE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAE1C,IAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC;YACjC,IAAI,CAAC,QAAQ,GAAG,YAAY,CAAC;YAC7B,YAAY,CAAC,IAAI,GAAG,IAAI,CAAC;YACzB,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC;YACrB,QAAQ,CAAC,QAAQ,GAAG,IAAI,CAAC;YAEzB,IAAI,CAAC,IAAI,EAAE,CAAC;YAEZ,OAAO,IAAI,CAAC;SACb;QAEO,+BAAU,GAAV,UACN,MAAW,EACX,YAAqC,EACrC,QAAiC;YAEjC,IAAI,CAAC,MAAM,CAAC,MAAM;gBAAE,OAAO,EAAE,CAAC;YAE9B,IAAI,CAAC,YAAY;gBAAE,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YAEnD,IAAI,CAAC,QAAQ;gBAAE,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YAE/C,IAAM,IAAI,GAAG,IAAI,UAAU,EAAK,CAAC;YACjC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YACzB,IAAI,CAAC,KAAM,CAAC,QAAQ,GAAG,YAAY,CAAC;YACpC,YAAY,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC;YAC/B,IAAI,CAAC,IAAK,CAAC,IAAI,GAAG,QAAQ,CAAC;YAC3B,QAAQ,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;YAE9B,IAAI,CAAC,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC;YAE3B,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;SAC3B;QAEO,2BAAM,GAAN,UAAO,IAAiB;YAC9B,IAAI,CAAC,IAAI,CAAC,QAAQ;gBAAE,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;YAE3C,IAAI,CAAC,IAAI,CAAC,IAAI;gBAAE,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;YAEvC,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;YAC/B,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;YAEnC,IAAI,CAAC,IAAI,EAAE,CAAC;YAEZ,OAAO,IAAI,CAAC;SACb;QAED,wBAAG,GAAH,UAAI,KAAQ;YAAZ,iBAUC;YATC,OAAO;gBACL,KAAK,EAAE;;oBAAC,gBAA2C;yBAA3C,UAA2C,EAA3C,qBAA2C,EAA3C,IAA2C;wBAA3C,2BAA2C;;oBACjD,OAAA,CAAA,KAAA,KAAI,CAAC,QAAQ,EAAC,IAAI,qBAAC,KAAI,EAAE,KAAK,GAAK,MAAM;iBAAC;gBAC5C,MAAM,EAAE;;oBAAC,gBAA2C;yBAA3C,UAA2C,EAA3C,qBAA2C,EAA3C,IAA2C;wBAA3C,2BAA2C;;oBAClD,OAAA,CAAA,KAAA,KAAI,CAAC,SAAS,EAAC,IAAI,qBAAC,KAAI,EAAE,KAAK,GAAK,MAAM;iBAAC;gBAC7C,OAAO,EAAE,UAAC,QAAgB,IAAK,OAAA,KAAI,CAAC,UAAU,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAA;gBAC/D,IAAI,EAAE,cAAM,OAAA,KAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAA;gBAC/B,IAAI,EAAE,cAAM,OAAA,KAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAA;aAChC,CAAC;SACH;QAED,4BAAO,GAAP,UAAQ,MAAW;YAAnB,iBAUC;YATC,OAAO;gBACL,KAAK,EAAE;;oBAAC,gBAA2C;yBAA3C,UAA2C,EAA3C,qBAA2C,EAA3C,IAA2C;wBAA3C,2BAA2C;;oBACjD,OAAA,CAAA,KAAA,KAAI,CAAC,YAAY,EAAC,IAAI,qBAAC,KAAI,EAAE,MAAM,GAAK,MAAM;iBAAC;gBACjD,MAAM,EAAE;;oBAAC,gBAA2C;yBAA3C,UAA2C,EAA3C,qBAA2C,EAA3C,IAA2C;wBAA3C,2BAA2C;;oBAClD,OAAA,CAAA,KAAA,KAAI,CAAC,aAAa,EAAC,IAAI,qBAAC,KAAI,EAAE,MAAM,GAAK,MAAM;iBAAC;gBAClD,OAAO,EAAE,UAAC,QAAgB,IAAK,OAAA,KAAI,CAAC,cAAc,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAA;gBACpE,IAAI,EAAE,cAAM,OAAA,KAAI,CAAC,WAAW,CAAC,MAAM,CAAC,GAAA;gBACpC,IAAI,EAAE,cAAM,OAAA,KAAI,CAAC,WAAW,CAAC,MAAM,CAAC,GAAA;aACrC,CAAC;SACH;QAID,6BAAQ,GAAR,UAAS,KAAQ,EAAE,aAAkB,EAAE,SAAwC;YAAxC,0BAAA,EAAA,mBAAwC;YAC7E,IAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,UAAA,IAAI,IAAI,OAAA,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,aAAa,CAAC,GAAA,CAAC,CAAC;YAEzE,OAAO,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;SACrF;QAID,8BAAS,GAAT,UAAU,KAAQ,EAAE,SAAc,EAAE,SAAwC;YAAxC,0BAAA,EAAA,mBAAwC;YAC1E,IAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,UAAA,IAAI,IAAI,OAAA,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,GAAA,CAAC,CAAC;YAEjE,OAAO,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;SAC7E;QAED,+BAAU,GAAV,UAAW,KAAQ,EAAE,QAAgB;YACnC,IAAI,QAAQ,GAAG,CAAC;gBAAE,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC;iBACnC,IAAI,QAAQ,IAAI,IAAI,CAAC,IAAI;gBAAE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAE3D,IAAI,QAAQ,IAAI,CAAC;gBAAE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAE9C,IAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAE,CAAC;YAEjC,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;SAChD;QAED,4BAAO,GAAP,UAAQ,KAAQ;YACd,IAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC;YAEjC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC;YAEvB,IAAI,IAAI,CAAC,KAAK;gBAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;;gBACtC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;YAEtB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;YAClB,IAAI,CAAC,IAAI,EAAE,CAAC;YAEZ,OAAO,IAAI,CAAC;SACb;QAED,4BAAO,GAAP,UAAQ,KAAQ;YACd,IAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC;YAEjC,IAAI,IAAI,CAAC,KAAK,EAAE;gBACd,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;gBAC1B,IAAI,CAAC,IAAK,CAAC,IAAI,GAAG,IAAI,CAAC;gBACvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;aAClB;iBAAM;gBACL,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;gBAClB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;aAClB;YAED,IAAI,CAAC,IAAI,EAAE,CAAC;YAEZ,OAAO,IAAI,CAAC;SACb;QAID,iCAAY,GAAZ,UACE,MAAW,EACX,aAAkB,EAClB,SAAwC;YAAxC,0BAAA,EAAA,mBAAwC;YAExC,IAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,UAAA,IAAI,IAAI,OAAA,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,aAAa,CAAC,GAAA,CAAC,CAAC;YAEzE,OAAO,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;SAC/F;QAID,kCAAa,GAAb,UACE,MAAW,EACX,SAAc,EACd,SAAwC;YAAxC,0BAAA,EAAA,mBAAwC;YAExC,IAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,UAAA,IAAI,IAAI,OAAA,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,GAAA,CAAC,CAAC;YAEjE,OAAO,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;SACvF;QAED,mCAAc,GAAd,UAAe,MAAW,EAAE,QAAgB;YAC1C,IAAI,QAAQ,GAAG,CAAC;gBAAE,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC;YAExC,IAAI,QAAQ,IAAI,CAAC;gBAAE,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YAEnD,IAAI,QAAQ,IAAI,IAAI,CAAC,IAAI;gBAAE,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YAE3D,IAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAE,CAAC;YAEjC,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;SACrD;QAED,gCAAW,GAAX,UAAY,MAAW;YAAvB,iBAKC;YAJC,OAAO,MAAM,CAAC,WAAW,CAAgB,UAAC,KAAK,EAAE,KAAK;gBACpD,KAAK,CAAC,OAAO,CAAC,KAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;gBACnC,OAAO,KAAK,CAAC;aACd,EAAE,EAAE,CAAC,CAAC;SACR;QAED,gCAAW,GAAX,UAAY,MAAW;YAAvB,iBAEC;YADC,OAAO,MAAM,CAAC,GAAG,CAAC,UAAA,KAAK,IAAI,OAAA,KAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAA,CAAC,CAAC;SACjD;QAED,yBAAI,GAAJ;YAAA,iBAUC;YATC,OAAO;gBACL,OAAO,EAAE,UAAC,QAAgB,IAAK,OAAA,KAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAA;gBACzD,OAAO,EAAE;oBAAC,gBAA2C;yBAA3C,UAA2C,EAA3C,qBAA2C,EAA3C,IAA2C;wBAA3C,2BAA2C;;oBACnD,OAAA,KAAI,CAAC,WAAW,CAAC,KAAK,CAAC,KAAI,EAAE,MAAM,CAAC;iBAAA;gBACtC,UAAU,EAAE;oBAAC,gBAA2C;yBAA3C,UAA2C,EAA3C,qBAA2C,EAA3C,IAA2C;wBAA3C,2BAA2C;;oBACtD,OAAA,KAAI,CAAC,cAAc,CAAC,KAAK,CAAC,KAAI,EAAE,MAAM,CAAC;iBAAA;gBACzC,IAAI,EAAE,cAAM,OAAA,KAAI,CAAC,QAAQ,EAAE,GAAA;gBAC3B,IAAI,EAAE,cAAM,OAAA,KAAI,CAAC,QAAQ,EAAE,GAAA;aAC5B,CAAC;SACH;QAED,6BAAQ,GAAR,UAAS,KAAa;YAAtB,iBAMC;YALC,OAAO;gBACL,OAAO,EAAE,UAAC,QAAgB,IAAK,OAAA,KAAI,CAAC,eAAe,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAA;gBACpE,IAAI,EAAE,cAAM,OAAA,KAAI,CAAC,YAAY,CAAC,KAAK,CAAC,GAAA;gBACpC,IAAI,EAAE,cAAM,OAAA,KAAI,CAAC,YAAY,CAAC,KAAK,CAAC,GAAA;aACrC,CAAC;SACH;QAED,gCAAW,GAAX,UAAY,QAAgB;YAC1B,IAAI,QAAQ,GAAG,CAAC;gBAAE,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC;YAExC,IAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YAEnC,OAAO,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC;SACnD;QAID,gCAAW,GAAX,UAAY,KAAU,EAAE,SAAwC;YAAxC,0BAAA,EAAA,mBAAwC;YAC9D,IAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,UAAA,IAAI,IAAI,OAAA,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,GAAA,CAAC,CAAC;YAEtE,OAAO,QAAQ,GAAG,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;SAC9D;QAID,mCAAc,GAAd,UAAe,KAAU,EAAE,SAAwC;YAAxC,0BAAA,EAAA,mBAAwC;YACjE,IAAM,OAAO,GAAkB,EAAE,CAAC;YAElC,KAAK,IAAI,OAAO,GAAG,IAAI,CAAC,KAAK,EAAE,QAAQ,GAAG,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE;gBACxF,IAAI,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE;oBACnC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAE,CAAC,CAAC;iBAC5D;aACF;YAED,OAAO,OAAO,CAAC;SAChB;QAED,6BAAQ,GAAR;YACE,IAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC;YAExB,IAAI,IAAI,EAAE;gBACR,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC;gBAEvB,IAAI,IAAI,CAAC,KAAK;oBAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,SAAS,CAAC;;oBAC3C,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;gBAE3B,IAAI,CAAC,IAAI,EAAE,CAAC;gBAEZ,OAAO,IAAI,CAAC;aACb;YAED,OAAO,SAAS,CAAC;SAClB;QAED,6BAAQ,GAAR;YACE,IAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;YAEvB,IAAI,IAAI,EAAE;gBACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC;gBAE1B,IAAI,IAAI,CAAC,IAAI;oBAAE,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;;oBACrC,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;gBAE5B,IAAI,CAAC,IAAI,EAAE,CAAC;gBAEZ,OAAO,IAAI,CAAC;aACb;YAED,OAAO,SAAS,CAAC;SAClB;QAED,oCAAe,GAAf,UAAgB,KAAa,EAAE,QAAgB;YAC7C,IAAI,KAAK,IAAI,CAAC;gBAAE,OAAO,EAAE,CAAC;YAE1B,IAAI,QAAQ,GAAG,CAAC;gBAAE,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;iBAC1D,IAAI,QAAQ,IAAI,IAAI,CAAC,IAAI;gBAAE,OAAO,EAAE,CAAC;YAE1C,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,CAAC;YAE9C,IAAM,OAAO,GAAkB,EAAE,CAAC;YAElC,OAAO,KAAK,EAAE,EAAE;gBACd,IAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;gBACnC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAQ,CAAE,CAAC,CAAC;aACtC;YAED,OAAO,OAAO,CAAC;SAChB;QAED,iCAAY,GAAZ,UAAa,KAAyB;YACpC,IAAI,KAAK,IAAI,CAAC;gBAAE,OAAO,EAAE,CAAC;YAE1B,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YAEnC,IAAM,OAAO,GAAkB,EAAE,CAAC;YAElC,OAAO,KAAK,EAAE;gBAAE,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAG,CAAC,CAAC;YAElD,OAAO,OAAO,CAAC;SAChB;QAED,iCAAY,GAAZ,UAAa,KAAyB;YACpC,IAAI,KAAK,IAAI,CAAC;gBAAE,OAAO,EAAE,CAAC;YAE1B,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YAEnC,IAAM,OAAO,GAAkB,EAAE,CAAC;YAElC,OAAO,KAAK,EAAE;gBAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAG,CAAC,CAAC;YAE/C,OAAO,OAAO,CAAC;SAChB;QAED,yBAAI,GAAJ,UAAK,SAA4B;YAC/B,KAAK,IAAI,OAAO,GAAG,IAAI,CAAC,KAAK,EAAE,QAAQ,GAAG,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE;gBACxF,IAAI,SAAS,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC;oBAAE,OAAO,OAAO,CAAC;aACxD;YAED,OAAO,SAAS,CAAC;SAClB;QAED,8BAAS,GAAT,UAAU,SAA4B;YACpC,KAAK,IAAI,OAAO,GAAG,IAAI,CAAC,KAAK,EAAE,QAAQ,GAAG,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE;gBACxF,IAAI,SAAS,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC;oBAAE,OAAO,QAAQ,CAAC;aACzD;YAED,OAAO,CAAC,CAAC,CAAC;SACX;QAED,4BAAO,GAAP,UAAqB,UAAgC;YACnD,KAAK,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,EAAE,QAAQ,GAAG,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE;gBAC5E,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;aAClC;SACF;QAED,wBAAG,GAAH,UAAI,QAAgB;YAClB,OAAO,IAAI,CAAC,IAAI,CAAC,UAAC,CAAC,EAAE,KAAK,IAAK,OAAA,QAAQ,KAAK,KAAK,GAAA,CAAC,CAAC;SACpD;QAID,4BAAO,GAAP,UAAQ,KAAU,EAAE,SAAwC;YAAxC,0BAAA,EAAA,mBAAwC;YAC1D,OAAO,IAAI,CAAC,SAAS,CAAC,UAAA,IAAI,IAAI,OAAA,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,GAAA,CAAC,CAAC;SAC7D;QAED,4BAAO,GAAP;YACE,IAAM,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAEnC,IAAI,CAAC,OAAO,CAAC,UAAC,IAAI,EAAE,KAAK,IAAK,QAAC,KAAK,CAAC,KAAM,CAAC,GAAG,IAAI,CAAC,KAAK,IAAC,CAAC,CAAC;YAE5D,OAAO,KAAK,CAAC;SACd;QAED,gCAAW,GAAX;YACE,IAAM,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAEnC,IAAI,CAAC,OAAO,CAAC,UAAC,IAAI,EAAE,KAAK,IAAK,QAAC,KAAK,CAAC,KAAM,CAAC,GAAG,IAAI,IAAC,CAAC,CAAC;YAEtD,OAAO,KAAK,CAAC;SACd;QAED,6BAAQ,GAAR,UAAS,QAA0C;YAA1C,yBAAA,EAAA,WAA4B,IAAI,CAAC,SAAS;YACjD,OAAO,IAAI,CAAC,OAAO,EAAE;iBAClB,GAAG,CAAC,UAAA,KAAK,IAAI,OAAA,QAAQ,CAAC,KAAK,CAAC,GAAA,CAAC;iBAC7B,IAAI,CAAC,OAAO,CAAC,CAAC;SAClB;;QAGA,qBAAC,MAAM,CAAC,QAAQ,CAAC,GAAlB;;;;;wBACW,IAAI,GAAG,IAAI,CAAC,KAAK,EAAE,QAAQ,GAAG,CAAC;;;6BAAE,IAAI;wBAC5C,qBAAM,IAAI,CAAC,KAAK,EAAA;;wBAAhB,SAAgB,CAAC;;;wBAD6B,QAAQ,EAAE,EAAE,IAAI,GAAG,IAAI,CAAC,IAAI,CAAA;;;;;SAG7E;yBACF;KAAA;;IC5YD;;;;ICAA;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"abp-utils.umd.js","sources":["../../node_modules/tslib/tslib.es6.js","../../projects/utils/src/lib/linked-list.ts","../../projects/utils/src/public-api.ts","../../projects/utils/src/abp-utils.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","/* tslint:disable:no-non-null-assertion */\r\n\r\nimport compare from 'just-compare';\r\n\r\nexport class ListNode {\r\n next: ListNode | undefined;\r\n previous: ListNode | undefined;\r\n constructor(public readonly value: T) {}\r\n}\r\n\r\nexport class LinkedList {\r\n private first: ListNode | undefined;\r\n private last: ListNode | undefined;\r\n private size = 0;\r\n\r\n get head(): ListNode | undefined {\r\n return this.first;\r\n }\r\n get tail(): ListNode | undefined {\r\n return this.last;\r\n }\r\n get length(): number {\r\n return this.size;\r\n }\r\n\r\n private attach(\r\n value: T,\r\n previousNode: ListNode | undefined,\r\n nextNode: ListNode | undefined,\r\n ): ListNode {\r\n if (!previousNode) return this.addHead(value);\r\n\r\n if (!nextNode) return this.addTail(value);\r\n\r\n const node = new ListNode(value);\r\n node.previous = previousNode;\r\n previousNode.next = node;\r\n node.next = nextNode;\r\n nextNode.previous = node;\r\n\r\n this.size++;\r\n\r\n return node;\r\n }\r\n\r\n private attachMany(\r\n values: T[],\r\n previousNode: ListNode | undefined,\r\n nextNode: ListNode | undefined,\r\n ): ListNode[] {\r\n if (!values.length) return [];\r\n\r\n if (!previousNode) return this.addManyHead(values);\r\n\r\n if (!nextNode) return this.addManyTail(values);\r\n\r\n const list = new LinkedList();\r\n list.addManyTail(values);\r\n list.first!.previous = previousNode;\r\n previousNode.next = list.first;\r\n list.last!.next = nextNode;\r\n nextNode.previous = list.last;\r\n\r\n this.size += values.length;\r\n\r\n return list.toNodeArray();\r\n }\r\n\r\n private detach(node: ListNode) {\r\n if (!node.previous) return this.dropHead();\r\n\r\n if (!node.next) return this.dropTail();\r\n\r\n node.previous.next = node.next;\r\n node.next.previous = node.previous;\r\n\r\n this.size--;\r\n\r\n return node;\r\n }\r\n\r\n add(value: T) {\r\n return {\r\n after: (...params: [T] | [any, ListComparisonFn]) =>\r\n this.addAfter.call(this, value, ...params),\r\n before: (...params: [T] | [any, ListComparisonFn]) =>\r\n this.addBefore.call(this, value, ...params),\r\n byIndex: (position: number) => this.addByIndex(value, position),\r\n head: () => this.addHead(value),\r\n tail: () => this.addTail(value),\r\n };\r\n }\r\n\r\n addMany(values: T[]) {\r\n return {\r\n after: (...params: [T] | [any, ListComparisonFn]) =>\r\n this.addManyAfter.call(this, values, ...params),\r\n before: (...params: [T] | [any, ListComparisonFn]) =>\r\n this.addManyBefore.call(this, values, ...params),\r\n byIndex: (position: number) => this.addManyByIndex(values, position),\r\n head: () => this.addManyHead(values),\r\n tail: () => this.addManyTail(values),\r\n };\r\n }\r\n\r\n addAfter(value: T, previousValue: T): ListNode;\r\n addAfter(value: T, previousValue: any, compareFn: ListComparisonFn): ListNode;\r\n addAfter(value: T, previousValue: any, compareFn: ListComparisonFn = compare): ListNode {\r\n const previous = this.find(node => compareFn(node.value, previousValue));\r\n\r\n return previous ? this.attach(value, previous, previous.next) : this.addTail(value);\r\n }\r\n\r\n addBefore(value: T, nextValue: T): ListNode;\r\n addBefore(value: T, nextValue: any, compareFn: ListComparisonFn): ListNode;\r\n addBefore(value: T, nextValue: any, compareFn: ListComparisonFn = compare): ListNode {\r\n const next = this.find(node => compareFn(node.value, nextValue));\r\n\r\n return next ? this.attach(value, next.previous, next) : this.addHead(value);\r\n }\r\n\r\n addByIndex(value: T, position: number): ListNode {\r\n if (position < 0) position += this.size;\r\n else if (position >= this.size) return this.addTail(value);\r\n\r\n if (position <= 0) return this.addHead(value);\r\n\r\n const next = this.get(position)!;\r\n\r\n return this.attach(value, next.previous, next);\r\n }\r\n\r\n addHead(value: T): ListNode {\r\n const node = new ListNode(value);\r\n\r\n node.next = this.first;\r\n\r\n if (this.first) this.first.previous = node;\r\n else this.last = node;\r\n\r\n this.first = node;\r\n this.size++;\r\n\r\n return node;\r\n }\r\n\r\n addTail(value: T): ListNode {\r\n const node = new ListNode(value);\r\n\r\n if (this.first) {\r\n node.previous = this.last;\r\n this.last!.next = node;\r\n this.last = node;\r\n } else {\r\n this.first = node;\r\n this.last = node;\r\n }\r\n\r\n this.size++;\r\n\r\n return node;\r\n }\r\n\r\n addManyAfter(values: T[], previousValue: T): ListNode[];\r\n addManyAfter(values: T[], previousValue: any, compareFn: ListComparisonFn): ListNode[];\r\n addManyAfter(\r\n values: T[],\r\n previousValue: any,\r\n compareFn: ListComparisonFn = compare,\r\n ): ListNode[] {\r\n const previous = this.find(node => compareFn(node.value, previousValue));\r\n\r\n return previous ? this.attachMany(values, previous, previous.next) : this.addManyTail(values);\r\n }\r\n\r\n addManyBefore(values: T[], nextValue: T): ListNode[];\r\n addManyBefore(values: T[], nextValue: any, compareFn: ListComparisonFn): ListNode[];\r\n addManyBefore(\r\n values: T[],\r\n nextValue: any,\r\n compareFn: ListComparisonFn = compare,\r\n ): ListNode[] {\r\n const next = this.find(node => compareFn(node.value, nextValue));\r\n\r\n return next ? this.attachMany(values, next.previous, next) : this.addManyHead(values);\r\n }\r\n\r\n addManyByIndex(values: T[], position: number): ListNode[] {\r\n if (position < 0) position += this.size;\r\n\r\n if (position <= 0) return this.addManyHead(values);\r\n\r\n if (position >= this.size) return this.addManyTail(values);\r\n\r\n const next = this.get(position)!;\r\n\r\n return this.attachMany(values, next.previous, next);\r\n }\r\n\r\n addManyHead(values: T[]): ListNode[] {\r\n return values.reduceRight[]>((nodes, value) => {\r\n nodes.unshift(this.addHead(value));\r\n return nodes;\r\n }, []);\r\n }\r\n\r\n addManyTail(values: T[]): ListNode[] {\r\n return values.map(value => this.addTail(value));\r\n }\r\n\r\n drop() {\r\n return {\r\n byIndex: (position: number) => this.dropByIndex(position),\r\n byValue: (...params: [T] | [any, ListComparisonFn]) =>\r\n this.dropByValue.apply(this, params),\r\n byValueAll: (...params: [T] | [any, ListComparisonFn]) =>\r\n this.dropByValueAll.apply(this, params),\r\n head: () => this.dropHead(),\r\n tail: () => this.dropTail(),\r\n };\r\n }\r\n\r\n dropMany(count: number) {\r\n return {\r\n byIndex: (position: number) => this.dropManyByIndex(count, position),\r\n head: () => this.dropManyHead(count),\r\n tail: () => this.dropManyTail(count),\r\n };\r\n }\r\n\r\n dropByIndex(position: number): ListNode | undefined {\r\n if (position < 0) position += this.size;\r\n\r\n const current = this.get(position);\r\n\r\n return current ? this.detach(current) : undefined;\r\n }\r\n\r\n dropByValue(value: T): ListNode | undefined;\r\n dropByValue(value: any, compareFn: ListComparisonFn): ListNode | undefined;\r\n dropByValue(value: any, compareFn: ListComparisonFn = compare): ListNode | undefined {\r\n const position = this.findIndex(node => compareFn(node.value, value));\r\n\r\n return position < 0 ? undefined : this.dropByIndex(position);\r\n }\r\n\r\n dropByValueAll(value: T): ListNode[];\r\n dropByValueAll(value: any, compareFn: ListComparisonFn): ListNode[];\r\n dropByValueAll(value: any, compareFn: ListComparisonFn = compare): ListNode[] {\r\n const dropped: ListNode[] = [];\r\n\r\n for (let current = this.first, position = 0; current; position++, current = current.next) {\r\n if (compareFn(current.value, value)) {\r\n dropped.push(this.dropByIndex(position - dropped.length)!);\r\n }\r\n }\r\n\r\n return dropped;\r\n }\r\n\r\n dropHead(): ListNode | undefined {\r\n const head = this.first;\r\n\r\n if (head) {\r\n this.first = head.next;\r\n\r\n if (this.first) this.first.previous = undefined;\r\n else this.last = undefined;\r\n\r\n this.size--;\r\n\r\n return head;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n dropTail(): ListNode | undefined {\r\n const tail = this.last;\r\n\r\n if (tail) {\r\n this.last = tail.previous;\r\n\r\n if (this.last) this.last.next = undefined;\r\n else this.first = undefined;\r\n\r\n this.size--;\r\n\r\n return tail;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n dropManyByIndex(count: number, position: number): ListNode[] {\r\n if (count <= 0) return [];\r\n\r\n if (position < 0) position = Math.max(position + this.size, 0);\r\n else if (position >= this.size) return [];\r\n\r\n count = Math.min(count, this.size - position);\r\n\r\n const dropped: ListNode[] = [];\r\n\r\n while (count--) {\r\n const current = this.get(position);\r\n dropped.push(this.detach(current!)!);\r\n }\r\n\r\n return dropped;\r\n }\r\n\r\n dropManyHead(count: Exclude): ListNode[] {\r\n if (count <= 0) return [];\r\n\r\n count = Math.min(count, this.size);\r\n\r\n const dropped: ListNode[] = [];\r\n\r\n while (count--) dropped.unshift(this.dropHead()!);\r\n\r\n return dropped;\r\n }\r\n\r\n dropManyTail(count: Exclude): ListNode[] {\r\n if (count <= 0) return [];\r\n\r\n count = Math.min(count, this.size);\r\n\r\n const dropped: ListNode[] = [];\r\n\r\n while (count--) dropped.push(this.dropTail()!);\r\n\r\n return dropped;\r\n }\r\n\r\n find(predicate: ListIteratorFn): ListNode | undefined {\r\n for (let current = this.first, position = 0; current; position++, current = current.next) {\r\n if (predicate(current, position, this)) return current;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n findIndex(predicate: ListIteratorFn): number {\r\n for (let current = this.first, position = 0; current; position++, current = current.next) {\r\n if (predicate(current, position, this)) return position;\r\n }\r\n\r\n return -1;\r\n }\r\n\r\n forEach(iteratorFn: ListIteratorFn) {\r\n for (let node = this.first, position = 0; node; position++, node = node.next) {\r\n iteratorFn(node, position, this);\r\n }\r\n }\r\n\r\n get(position: number): ListNode | undefined {\r\n return this.find((_, index) => position === index);\r\n }\r\n\r\n indexOf(value: T): number;\r\n indexOf(value: any, compareFn: ListComparisonFn): number;\r\n indexOf(value: any, compareFn: ListComparisonFn = compare): number {\r\n return this.findIndex(node => compareFn(node.value, value));\r\n }\r\n\r\n toArray(): T[] {\r\n const array = new Array(this.size);\r\n\r\n this.forEach((node, index) => (array[index!] = node.value));\r\n\r\n return array;\r\n }\r\n\r\n toNodeArray(): ListNode[] {\r\n const array = new Array(this.size);\r\n\r\n this.forEach((node, index) => (array[index!] = node));\r\n\r\n return array;\r\n }\r\n\r\n toString(mapperFn: ListMapperFn = JSON.stringify): string {\r\n return this.toArray()\r\n .map(value => mapperFn(value))\r\n .join(' <-> ');\r\n }\r\n\r\n // Cannot use Generator type because of ng-packagr\r\n *[Symbol.iterator](): any {\r\n for (let node = this.first, position = 0; node; position++, node = node.next) {\r\n yield node.value;\r\n }\r\n }\r\n}\r\n\r\nexport type ListMapperFn = (value: T) => any;\r\n\r\nexport type ListComparisonFn = (value1: T, value2: any) => boolean;\r\n\r\nexport type ListIteratorFn = (\r\n node: ListNode,\r\n index?: number,\r\n list?: LinkedList,\r\n) => R;\r\n","/*\r\n * Public API Surface of utils\r\n */\r\n\r\nexport * from './lib/linked-list';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;IAAA;;;;;;;;;;;;;;IAcA;IAEA,IAAI,aAAa,GAAG,UAAS,CAAC,EAAE,CAAC;QAC7B,aAAa,GAAG,MAAM,CAAC,cAAc;aAChC,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;YAC5E,UAAU,CAAC,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC;gBAAE,IAAI,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC;oBAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/E,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/B,CAAC,CAAC;aAEc,SAAS,CAAC,CAAC,EAAE,CAAC;QAC1B,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACpB,SAAS,EAAE,KAAK,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE;QACvC,CAAC,CAAC,SAAS,GAAG,CAAC,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IACzF,CAAC;IAEM,IAAI,QAAQ,GAAG;QAClB,QAAQ,GAAG,MAAM,CAAC,MAAM,IAAI,SAAS,QAAQ,CAAC,CAAC;YAC3C,KAAK,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;gBACjD,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;gBACjB,KAAK,IAAI,CAAC,IAAI,CAAC;oBAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;wBAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;aAChF;YACD,OAAO,CAAC,CAAC;SACZ,CAAA;QACD,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAC3C,CAAC,CAAA;aAEe,MAAM,CAAC,CAAC,EAAE,CAAC;QACvB,IAAI,CAAC,GAAG,EAAE,CAAC;QACX,KAAK,IAAI,CAAC,IAAI,CAAC;YAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;gBAC/E,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAChB,IAAI,CAAC,IAAI,IAAI,IAAI,OAAO,MAAM,CAAC,qBAAqB,KAAK,UAAU;YAC/D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACpE,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;oBAC1E,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aACzB;QACL,OAAO,CAAC,CAAC;IACb,CAAC;aAEe,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI;QACpD,IAAI,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;QAC7H,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,CAAC,QAAQ,KAAK,UAAU;YAAE,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;;YAC1H,KAAK,IAAI,CAAC,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;gBAAE,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC;oBAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;QAClJ,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IAClE,CAAC;aAEe,OAAO,CAAC,UAAU,EAAE,SAAS;QACzC,OAAO,UAAU,MAAM,EAAE,GAAG,IAAI,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC,EAAE,CAAA;IACzE,CAAC;aAEe,UAAU,CAAC,WAAW,EAAE,aAAa;QACjD,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,CAAC,QAAQ,KAAK,UAAU;YAAE,OAAO,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;IACnI,CAAC;aAEe,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,SAAS;QACvD,SAAS,KAAK,CAAC,KAAK,IAAI,OAAO,KAAK,YAAY,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,CAAC,UAAU,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;QAC5G,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,EAAE,UAAU,OAAO,EAAE,MAAM;YACrD,SAAS,SAAS,CAAC,KAAK,IAAI,IAAI;gBAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;aAAE;YAAC,OAAO,CAAC,EAAE;gBAAE,MAAM,CAAC,CAAC,CAAC,CAAC;aAAE,EAAE;YAC3F,SAAS,QAAQ,CAAC,KAAK,IAAI,IAAI;gBAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;aAAE;YAAC,OAAO,CAAC,EAAE;gBAAE,MAAM,CAAC,CAAC,CAAC,CAAC;aAAE,EAAE;YAC9F,SAAS,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,EAAE;YAC9G,IAAI,CAAC,CAAC,SAAS,GAAG,SAAS,CAAC,KAAK,CAAC,OAAO,EAAE,UAAU,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;SACzE,CAAC,CAAC;IACP,CAAC;aAEe,WAAW,CAAC,OAAO,EAAE,IAAI;QACrC,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,cAAa,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;gBAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACjH,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,OAAO,MAAM,KAAK,UAAU,KAAK,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,cAAa,OAAO,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACzJ,SAAS,IAAI,CAAC,CAAC,IAAI,OAAO,UAAU,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE;QAClE,SAAS,IAAI,CAAC,EAAE;YACZ,IAAI,CAAC;gBAAE,MAAM,IAAI,SAAS,CAAC,iCAAiC,CAAC,CAAC;YAC9D,OAAO,CAAC;gBAAE,IAAI;oBACV,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI;wBAAE,OAAO,CAAC,CAAC;oBAC7J,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;wBAAE,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;oBACxC,QAAQ,EAAE,CAAC,CAAC,CAAC;wBACT,KAAK,CAAC,CAAC;wBAAC,KAAK,CAAC;4BAAE,CAAC,GAAG,EAAE,CAAC;4BAAC,MAAM;wBAC9B,KAAK,CAAC;4BAAE,CAAC,CAAC,KAAK,EAAE,CAAC;4BAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;wBACxD,KAAK,CAAC;4BAAE,CAAC,CAAC,KAAK,EAAE,CAAC;4BAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;4BAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;4BAAC,SAAS;wBACjD,KAAK,CAAC;4BAAE,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;4BAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;4BAAC,SAAS;wBACjD;4BACI,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE;gCAAE,CAAC,GAAG,CAAC,CAAC;gCAAC,SAAS;6BAAE;4BAC5G,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;gCAAE,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;gCAAC,MAAM;6BAAE;4BACtF,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE;gCAAE,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;gCAAC,CAAC,GAAG,EAAE,CAAC;gCAAC,MAAM;6BAAE;4BACrE,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE;gCAAE,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;gCAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gCAAC,MAAM;6BAAE;4BACnE,IAAI,CAAC,CAAC,CAAC,CAAC;gCAAE,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;4BACtB,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;4BAAC,SAAS;qBAC9B;oBACD,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;iBAC9B;gBAAC,OAAO,CAAC,EAAE;oBAAE,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;oBAAC,CAAC,GAAG,CAAC,CAAC;iBAAE;wBAAS;oBAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;iBAAE;YAC1D,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;gBAAE,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;YAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;SACpF;IACL,CAAC;IAEM,IAAI,eAAe,GAAG,MAAM,CAAC,MAAM,IAAI,UAAS,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE;QAC9D,IAAI,EAAE,KAAK,SAAS;YAAE,EAAE,GAAG,CAAC,CAAC;QAC7B,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,cAAa,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACzF,CAAC,KAAK,UAAS,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE;QACtB,IAAI,EAAE,KAAK,SAAS;YAAE,EAAE,GAAG,CAAC,CAAC;QAC7B,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;aAEa,YAAY,CAAC,CAAC,EAAE,OAAO;QACnC,KAAK,IAAI,CAAC,IAAI,CAAC;YAAE,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC;gBAAE,eAAe,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACvG,CAAC;aAEe,QAAQ,CAAC,CAAC;QACtB,IAAI,CAAC,GAAG,OAAO,MAAM,KAAK,UAAU,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;QAC9E,IAAI,CAAC;YAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC,MAAM,KAAK,QAAQ;YAAE,OAAO;gBAC1C,IAAI,EAAE;oBACF,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM;wBAAE,CAAC,GAAG,KAAK,CAAC,CAAC;oBACnC,OAAO,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;iBAC3C;aACJ,CAAC;QACF,MAAM,IAAI,SAAS,CAAC,CAAC,GAAG,yBAAyB,GAAG,iCAAiC,CAAC,CAAC;IAC3F,CAAC;aAEe,MAAM,CAAC,CAAC,EAAE,CAAC;QACvB,IAAI,CAAC,GAAG,OAAO,MAAM,KAAK,UAAU,IAAI,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC3D,IAAI,CAAC,CAAC;YAAE,OAAO,CAAC,CAAC;QACjB,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QACjC,IAAI;YACA,OAAO,CAAC,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,IAAI;gBAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;SAC9E;QACD,OAAO,KAAK,EAAE;YAAE,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;SAAE;gBAC/B;YACJ,IAAI;gBACA,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC;oBAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACpD;oBACO;gBAAE,IAAI,CAAC;oBAAE,MAAM,CAAC,CAAC,KAAK,CAAC;aAAE;SACpC;QACD,OAAO,EAAE,CAAC;IACd,CAAC;aAEe,QAAQ;QACpB,KAAK,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE;YAC9C,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACzC,OAAO,EAAE,CAAC;IACd,CAAC;aAEe,cAAc;QAC1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE;YAAE,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QACpF,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE;YAC5C,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE;gBAC7D,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACpB,OAAO,CAAC,CAAC;IACb,CAAC;IAAA,CAAC;aAEc,OAAO,CAAC,CAAC;QACrB,OAAO,IAAI,YAAY,OAAO,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,IAAI,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;IACzE,CAAC;aAEe,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS;QAC3D,IAAI,CAAC,MAAM,CAAC,aAAa;YAAE,MAAM,IAAI,SAAS,CAAC,sCAAsC,CAAC,CAAC;QACvF,IAAI,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,OAAO,EAAE,UAAU,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC;QAC9D,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,cAAc,OAAO,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;QACtH,SAAS,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;YAAE,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,IAAI,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE;QAC1I,SAAS,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI;YAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAAE;QAAC,OAAO,CAAC,EAAE;YAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SAAE,EAAE;QAClF,SAAS,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,YAAY,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;QACxH,SAAS,OAAO,CAAC,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,EAAE;QAClD,SAAS,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,EAAE;QAClD,SAAS,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,MAAM;YAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;IACtF,CAAC;aAEe,gBAAgB,CAAC,CAAC;QAC9B,IAAI,CAAC,EAAE,CAAC,CAAC;QACT,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,cAAc,OAAO,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;QAC5I,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,IAAI,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,KAAK,QAAQ,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE;IACnJ,CAAC;aAEe,aAAa,CAAC,CAAC;QAC3B,IAAI,CAAC,MAAM,CAAC,aAAa;YAAE,MAAM,IAAI,SAAS,CAAC,sCAAsC,CAAC,CAAC;QACvF,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;QACnC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,QAAQ,KAAK,UAAU,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,cAAc,OAAO,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QACjN,SAAS,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,IAAI,OAAO,IAAI,OAAO,CAAC,UAAU,OAAO,EAAE,MAAM,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE;QAChK,SAAS,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAS,CAAC,IAAI,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,EAAE;IAChI,CAAC;aAEe,oBAAoB,CAAC,MAAM,EAAE,GAAG;QAC5C,IAAI,MAAM,CAAC,cAAc,EAAE;YAAE,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;SAAE;aAAM;YAAE,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC;SAAE;QAC/G,OAAO,MAAM,CAAC;IAClB,CAAC;IAAA,CAAC;IAEF,IAAI,kBAAkB,GAAG,MAAM,CAAC,MAAM,IAAI,UAAS,CAAC,EAAE,CAAC;QACnD,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;IACxE,CAAC,IAAI,UAAS,CAAC,EAAE,CAAC;QACd,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC,CAAC;aAEc,YAAY,CAAC,GAAG;QAC5B,IAAI,GAAG,IAAI,GAAG,CAAC,UAAU;YAAE,OAAO,GAAG,CAAC;QACtC,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI,GAAG,IAAI,IAAI;YAAE,KAAK,IAAI,CAAC,IAAI,GAAG;gBAAE,IAAI,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;oBAAE,eAAe,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;QAC5G,kBAAkB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAChC,OAAO,MAAM,CAAC;IAClB,CAAC;aAEe,eAAe,CAAC,GAAG;QAC/B,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,UAAU,IAAI,GAAG,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;IAC5D,CAAC;aAEe,sBAAsB,CAAC,QAAQ,EAAE,UAAU;QACvD,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;YAC3B,MAAM,IAAI,SAAS,CAAC,gDAAgD,CAAC,CAAC;SACzE;QACD,OAAO,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;aAEe,sBAAsB,CAAC,QAAQ,EAAE,UAAU,EAAE,KAAK;QAC9D,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;YAC3B,MAAM,IAAI,SAAS,CAAC,gDAAgD,CAAC,CAAC;SACzE;QACD,UAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QAChC,OAAO,KAAK,CAAC;IACjB;;;QC3NE,kBAA4B,KAAQ;YAAR,UAAK,GAAL,KAAK,CAAG;SAAI;uBACzC;KAAA,IAAA;;QAED;YAGU,SAAI,GAAG,CAAC,CAAC;SA+XlB;QA7XC,sBAAI,4BAAI;iBAAR;gBACE,OAAO,IAAI,CAAC,KAAK,CAAC;aACnB;;;WAAA;QACD,sBAAI,4BAAI;iBAAR;gBACE,OAAO,IAAI,CAAC,IAAI,CAAC;aAClB;;;WAAA;QACD,sBAAI,8BAAM;iBAAV;gBACE,OAAO,IAAI,CAAC,IAAI,CAAC;aAClB;;;WAAA;QAEO,2BAAM,GAAN,UACN,KAAQ,EACR,YAAqC,EACrC,QAAiC;YAEjC,IAAI,CAAC,YAAY;gBAAE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAE9C,IAAI,CAAC,QAAQ;gBAAE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAE1C,IAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC;YACjC,IAAI,CAAC,QAAQ,GAAG,YAAY,CAAC;YAC7B,YAAY,CAAC,IAAI,GAAG,IAAI,CAAC;YACzB,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC;YACrB,QAAQ,CAAC,QAAQ,GAAG,IAAI,CAAC;YAEzB,IAAI,CAAC,IAAI,EAAE,CAAC;YAEZ,OAAO,IAAI,CAAC;SACb;QAEO,+BAAU,GAAV,UACN,MAAW,EACX,YAAqC,EACrC,QAAiC;YAEjC,IAAI,CAAC,MAAM,CAAC,MAAM;gBAAE,OAAO,EAAE,CAAC;YAE9B,IAAI,CAAC,YAAY;gBAAE,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YAEnD,IAAI,CAAC,QAAQ;gBAAE,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YAE/C,IAAM,IAAI,GAAG,IAAI,UAAU,EAAK,CAAC;YACjC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YACzB,IAAI,CAAC,KAAM,CAAC,QAAQ,GAAG,YAAY,CAAC;YACpC,YAAY,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC;YAC/B,IAAI,CAAC,IAAK,CAAC,IAAI,GAAG,QAAQ,CAAC;YAC3B,QAAQ,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;YAE9B,IAAI,CAAC,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC;YAE3B,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;SAC3B;QAEO,2BAAM,GAAN,UAAO,IAAiB;YAC9B,IAAI,CAAC,IAAI,CAAC,QAAQ;gBAAE,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;YAE3C,IAAI,CAAC,IAAI,CAAC,IAAI;gBAAE,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;YAEvC,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;YAC/B,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;YAEnC,IAAI,CAAC,IAAI,EAAE,CAAC;YAEZ,OAAO,IAAI,CAAC;SACb;QAED,wBAAG,GAAH,UAAI,KAAQ;YAAZ,iBAUC;YATC,OAAO;gBACL,KAAK,EAAE;;oBAAC,gBAA2C;yBAA3C,UAA2C,EAA3C,qBAA2C,EAA3C,IAA2C;wBAA3C,2BAA2C;;oBACjD,OAAA,CAAA,KAAA,KAAI,CAAC,QAAQ,EAAC,IAAI,qBAAC,KAAI,EAAE,KAAK,GAAK,MAAM;iBAAC;gBAC5C,MAAM,EAAE;;oBAAC,gBAA2C;yBAA3C,UAA2C,EAA3C,qBAA2C,EAA3C,IAA2C;wBAA3C,2BAA2C;;oBAClD,OAAA,CAAA,KAAA,KAAI,CAAC,SAAS,EAAC,IAAI,qBAAC,KAAI,EAAE,KAAK,GAAK,MAAM;iBAAC;gBAC7C,OAAO,EAAE,UAAC,QAAgB,IAAK,OAAA,KAAI,CAAC,UAAU,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAA;gBAC/D,IAAI,EAAE,cAAM,OAAA,KAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAA;gBAC/B,IAAI,EAAE,cAAM,OAAA,KAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAA;aAChC,CAAC;SACH;QAED,4BAAO,GAAP,UAAQ,MAAW;YAAnB,iBAUC;YATC,OAAO;gBACL,KAAK,EAAE;;oBAAC,gBAA2C;yBAA3C,UAA2C,EAA3C,qBAA2C,EAA3C,IAA2C;wBAA3C,2BAA2C;;oBACjD,OAAA,CAAA,KAAA,KAAI,CAAC,YAAY,EAAC,IAAI,qBAAC,KAAI,EAAE,MAAM,GAAK,MAAM;iBAAC;gBACjD,MAAM,EAAE;;oBAAC,gBAA2C;yBAA3C,UAA2C,EAA3C,qBAA2C,EAA3C,IAA2C;wBAA3C,2BAA2C;;oBAClD,OAAA,CAAA,KAAA,KAAI,CAAC,aAAa,EAAC,IAAI,qBAAC,KAAI,EAAE,MAAM,GAAK,MAAM;iBAAC;gBAClD,OAAO,EAAE,UAAC,QAAgB,IAAK,OAAA,KAAI,CAAC,cAAc,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAA;gBACpE,IAAI,EAAE,cAAM,OAAA,KAAI,CAAC,WAAW,CAAC,MAAM,CAAC,GAAA;gBACpC,IAAI,EAAE,cAAM,OAAA,KAAI,CAAC,WAAW,CAAC,MAAM,CAAC,GAAA;aACrC,CAAC;SACH;QAID,6BAAQ,GAAR,UAAS,KAAQ,EAAE,aAAkB,EAAE,SAAwC;YAAxC,0BAAA,EAAA,mBAAwC;YAC7E,IAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,UAAA,IAAI,IAAI,OAAA,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,aAAa,CAAC,GAAA,CAAC,CAAC;YAEzE,OAAO,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;SACrF;QAID,8BAAS,GAAT,UAAU,KAAQ,EAAE,SAAc,EAAE,SAAwC;YAAxC,0BAAA,EAAA,mBAAwC;YAC1E,IAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,UAAA,IAAI,IAAI,OAAA,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,GAAA,CAAC,CAAC;YAEjE,OAAO,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;SAC7E;QAED,+BAAU,GAAV,UAAW,KAAQ,EAAE,QAAgB;YACnC,IAAI,QAAQ,GAAG,CAAC;gBAAE,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC;iBACnC,IAAI,QAAQ,IAAI,IAAI,CAAC,IAAI;gBAAE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAE3D,IAAI,QAAQ,IAAI,CAAC;gBAAE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAE9C,IAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAE,CAAC;YAEjC,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;SAChD;QAED,4BAAO,GAAP,UAAQ,KAAQ;YACd,IAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC;YAEjC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC;YAEvB,IAAI,IAAI,CAAC,KAAK;gBAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;;gBACtC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;YAEtB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;YAClB,IAAI,CAAC,IAAI,EAAE,CAAC;YAEZ,OAAO,IAAI,CAAC;SACb;QAED,4BAAO,GAAP,UAAQ,KAAQ;YACd,IAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC;YAEjC,IAAI,IAAI,CAAC,KAAK,EAAE;gBACd,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;gBAC1B,IAAI,CAAC,IAAK,CAAC,IAAI,GAAG,IAAI,CAAC;gBACvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;aAClB;iBAAM;gBACL,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;gBAClB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;aAClB;YAED,IAAI,CAAC,IAAI,EAAE,CAAC;YAEZ,OAAO,IAAI,CAAC;SACb;QAID,iCAAY,GAAZ,UACE,MAAW,EACX,aAAkB,EAClB,SAAwC;YAAxC,0BAAA,EAAA,mBAAwC;YAExC,IAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,UAAA,IAAI,IAAI,OAAA,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,aAAa,CAAC,GAAA,CAAC,CAAC;YAEzE,OAAO,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;SAC/F;QAID,kCAAa,GAAb,UACE,MAAW,EACX,SAAc,EACd,SAAwC;YAAxC,0BAAA,EAAA,mBAAwC;YAExC,IAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,UAAA,IAAI,IAAI,OAAA,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,GAAA,CAAC,CAAC;YAEjE,OAAO,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;SACvF;QAED,mCAAc,GAAd,UAAe,MAAW,EAAE,QAAgB;YAC1C,IAAI,QAAQ,GAAG,CAAC;gBAAE,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC;YAExC,IAAI,QAAQ,IAAI,CAAC;gBAAE,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YAEnD,IAAI,QAAQ,IAAI,IAAI,CAAC,IAAI;gBAAE,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YAE3D,IAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAE,CAAC;YAEjC,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;SACrD;QAED,gCAAW,GAAX,UAAY,MAAW;YAAvB,iBAKC;YAJC,OAAO,MAAM,CAAC,WAAW,CAAgB,UAAC,KAAK,EAAE,KAAK;gBACpD,KAAK,CAAC,OAAO,CAAC,KAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;gBACnC,OAAO,KAAK,CAAC;aACd,EAAE,EAAE,CAAC,CAAC;SACR;QAED,gCAAW,GAAX,UAAY,MAAW;YAAvB,iBAEC;YADC,OAAO,MAAM,CAAC,GAAG,CAAC,UAAA,KAAK,IAAI,OAAA,KAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAA,CAAC,CAAC;SACjD;QAED,yBAAI,GAAJ;YAAA,iBAUC;YATC,OAAO;gBACL,OAAO,EAAE,UAAC,QAAgB,IAAK,OAAA,KAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAA;gBACzD,OAAO,EAAE;oBAAC,gBAA2C;yBAA3C,UAA2C,EAA3C,qBAA2C,EAA3C,IAA2C;wBAA3C,2BAA2C;;oBACnD,OAAA,KAAI,CAAC,WAAW,CAAC,KAAK,CAAC,KAAI,EAAE,MAAM,CAAC;iBAAA;gBACtC,UAAU,EAAE;oBAAC,gBAA2C;yBAA3C,UAA2C,EAA3C,qBAA2C,EAA3C,IAA2C;wBAA3C,2BAA2C;;oBACtD,OAAA,KAAI,CAAC,cAAc,CAAC,KAAK,CAAC,KAAI,EAAE,MAAM,CAAC;iBAAA;gBACzC,IAAI,EAAE,cAAM,OAAA,KAAI,CAAC,QAAQ,EAAE,GAAA;gBAC3B,IAAI,EAAE,cAAM,OAAA,KAAI,CAAC,QAAQ,EAAE,GAAA;aAC5B,CAAC;SACH;QAED,6BAAQ,GAAR,UAAS,KAAa;YAAtB,iBAMC;YALC,OAAO;gBACL,OAAO,EAAE,UAAC,QAAgB,IAAK,OAAA,KAAI,CAAC,eAAe,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAA;gBACpE,IAAI,EAAE,cAAM,OAAA,KAAI,CAAC,YAAY,CAAC,KAAK,CAAC,GAAA;gBACpC,IAAI,EAAE,cAAM,OAAA,KAAI,CAAC,YAAY,CAAC,KAAK,CAAC,GAAA;aACrC,CAAC;SACH;QAED,gCAAW,GAAX,UAAY,QAAgB;YAC1B,IAAI,QAAQ,GAAG,CAAC;gBAAE,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC;YAExC,IAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YAEnC,OAAO,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC;SACnD;QAID,gCAAW,GAAX,UAAY,KAAU,EAAE,SAAwC;YAAxC,0BAAA,EAAA,mBAAwC;YAC9D,IAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,UAAA,IAAI,IAAI,OAAA,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,GAAA,CAAC,CAAC;YAEtE,OAAO,QAAQ,GAAG,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;SAC9D;QAID,mCAAc,GAAd,UAAe,KAAU,EAAE,SAAwC;YAAxC,0BAAA,EAAA,mBAAwC;YACjE,IAAM,OAAO,GAAkB,EAAE,CAAC;YAElC,KAAK,IAAI,OAAO,GAAG,IAAI,CAAC,KAAK,EAAE,QAAQ,GAAG,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE;gBACxF,IAAI,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE;oBACnC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAE,CAAC,CAAC;iBAC5D;aACF;YAED,OAAO,OAAO,CAAC;SAChB;QAED,6BAAQ,GAAR;YACE,IAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC;YAExB,IAAI,IAAI,EAAE;gBACR,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC;gBAEvB,IAAI,IAAI,CAAC,KAAK;oBAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,SAAS,CAAC;;oBAC3C,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;gBAE3B,IAAI,CAAC,IAAI,EAAE,CAAC;gBAEZ,OAAO,IAAI,CAAC;aACb;YAED,OAAO,SAAS,CAAC;SAClB;QAED,6BAAQ,GAAR;YACE,IAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;YAEvB,IAAI,IAAI,EAAE;gBACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC;gBAE1B,IAAI,IAAI,CAAC,IAAI;oBAAE,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;;oBACrC,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;gBAE5B,IAAI,CAAC,IAAI,EAAE,CAAC;gBAEZ,OAAO,IAAI,CAAC;aACb;YAED,OAAO,SAAS,CAAC;SAClB;QAED,oCAAe,GAAf,UAAgB,KAAa,EAAE,QAAgB;YAC7C,IAAI,KAAK,IAAI,CAAC;gBAAE,OAAO,EAAE,CAAC;YAE1B,IAAI,QAAQ,GAAG,CAAC;gBAAE,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;iBAC1D,IAAI,QAAQ,IAAI,IAAI,CAAC,IAAI;gBAAE,OAAO,EAAE,CAAC;YAE1C,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,CAAC;YAE9C,IAAM,OAAO,GAAkB,EAAE,CAAC;YAElC,OAAO,KAAK,EAAE,EAAE;gBACd,IAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;gBACnC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAQ,CAAE,CAAC,CAAC;aACtC;YAED,OAAO,OAAO,CAAC;SAChB;QAED,iCAAY,GAAZ,UAAa,KAAyB;YACpC,IAAI,KAAK,IAAI,CAAC;gBAAE,OAAO,EAAE,CAAC;YAE1B,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YAEnC,IAAM,OAAO,GAAkB,EAAE,CAAC;YAElC,OAAO,KAAK,EAAE;gBAAE,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAG,CAAC,CAAC;YAElD,OAAO,OAAO,CAAC;SAChB;QAED,iCAAY,GAAZ,UAAa,KAAyB;YACpC,IAAI,KAAK,IAAI,CAAC;gBAAE,OAAO,EAAE,CAAC;YAE1B,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YAEnC,IAAM,OAAO,GAAkB,EAAE,CAAC;YAElC,OAAO,KAAK,EAAE;gBAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAG,CAAC,CAAC;YAE/C,OAAO,OAAO,CAAC;SAChB;QAED,yBAAI,GAAJ,UAAK,SAA4B;YAC/B,KAAK,IAAI,OAAO,GAAG,IAAI,CAAC,KAAK,EAAE,QAAQ,GAAG,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE;gBACxF,IAAI,SAAS,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC;oBAAE,OAAO,OAAO,CAAC;aACxD;YAED,OAAO,SAAS,CAAC;SAClB;QAED,8BAAS,GAAT,UAAU,SAA4B;YACpC,KAAK,IAAI,OAAO,GAAG,IAAI,CAAC,KAAK,EAAE,QAAQ,GAAG,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE;gBACxF,IAAI,SAAS,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC;oBAAE,OAAO,QAAQ,CAAC;aACzD;YAED,OAAO,CAAC,CAAC,CAAC;SACX;QAED,4BAAO,GAAP,UAAqB,UAAgC;YACnD,KAAK,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,EAAE,QAAQ,GAAG,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE;gBAC5E,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;aAClC;SACF;QAED,wBAAG,GAAH,UAAI,QAAgB;YAClB,OAAO,IAAI,CAAC,IAAI,CAAC,UAAC,CAAC,EAAE,KAAK,IAAK,OAAA,QAAQ,KAAK,KAAK,GAAA,CAAC,CAAC;SACpD;QAID,4BAAO,GAAP,UAAQ,KAAU,EAAE,SAAwC;YAAxC,0BAAA,EAAA,mBAAwC;YAC1D,OAAO,IAAI,CAAC,SAAS,CAAC,UAAA,IAAI,IAAI,OAAA,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,GAAA,CAAC,CAAC;SAC7D;QAED,4BAAO,GAAP;YACE,IAAM,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAEnC,IAAI,CAAC,OAAO,CAAC,UAAC,IAAI,EAAE,KAAK,IAAK,QAAC,KAAK,CAAC,KAAM,CAAC,GAAG,IAAI,CAAC,KAAK,IAAC,CAAC,CAAC;YAE5D,OAAO,KAAK,CAAC;SACd;QAED,gCAAW,GAAX;YACE,IAAM,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAEnC,IAAI,CAAC,OAAO,CAAC,UAAC,IAAI,EAAE,KAAK,IAAK,QAAC,KAAK,CAAC,KAAM,CAAC,GAAG,IAAI,IAAC,CAAC,CAAC;YAEtD,OAAO,KAAK,CAAC;SACd;QAED,6BAAQ,GAAR,UAAS,QAA0C;YAA1C,yBAAA,EAAA,WAA4B,IAAI,CAAC,SAAS;YACjD,OAAO,IAAI,CAAC,OAAO,EAAE;iBAClB,GAAG,CAAC,UAAA,KAAK,IAAI,OAAA,QAAQ,CAAC,KAAK,CAAC,GAAA,CAAC;iBAC7B,IAAI,CAAC,OAAO,CAAC,CAAC;SAClB;;QAGA,qBAAC,MAAM,CAAC,QAAQ,CAAC,GAAlB;;;;;wBACW,IAAI,GAAG,IAAI,CAAC,KAAK,EAAE,QAAQ,GAAG,CAAC;;;6BAAE,IAAI;wBAC5C,qBAAM,IAAI,CAAC,KAAK,EAAA;;wBAAhB,SAAgB,CAAC;;;wBAD6B,QAAQ,EAAE,EAAE,IAAI,GAAG,IAAI,CAAC,IAAI,CAAA;;;;;SAG7E;yBACF;KAAA;;IC5YD;;;;ICAA;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/abp/utils/abp-utils.umd.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/abp/utils/abp-utils.umd.min.js index e26d982e5..57b22e518 100644 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/abp/utils/abp-utils.umd.min.js +++ b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/abp/utils/abp-utils.umd.min.js @@ -1,2 +1,2 @@ -!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("just-compare")):"function"==typeof define&&define.amd?define("@abp/utils",["exports","just-compare"],r):r(((t=t||self).abp=t.abp||{},t.abp.utils=t.abp.utils||{},t.abp.utils.common={}),t.compare)}(this,(function(t,r){"use strict";r=r&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r;function e(t,r){var e,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;a;)try{if(e=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)&&!(n=o.next()).done;)a.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(e=o.return)&&e.call(o)}finally{if(i)throw i.error}}return a}function i(){for(var t=[],r=0;r=this.size)return this.addTail(t);if(r<=0)return this.addHead(t);var e=this.get(r);return this.attach(t,e.previous,e)},t.prototype.addHead=function(t){var r=new o(t);return r.next=this.first,this.first?this.first.previous=r:this.last=r,this.first=r,this.size++,r},t.prototype.addTail=function(t){var r=new o(t);return this.first?(r.previous=this.last,this.last.next=r,this.last=r):(this.first=r,this.last=r),this.size++,r},t.prototype.addManyAfter=function(t,e,n){void 0===n&&(n=r);var i=this.find((function(t){return n(t.value,e)}));return i?this.attachMany(t,i,i.next):this.addManyTail(t)},t.prototype.addManyBefore=function(t,e,n){void 0===n&&(n=r);var i=this.find((function(t){return n(t.value,e)}));return i?this.attachMany(t,i.previous,i):this.addManyHead(t)},t.prototype.addManyByIndex=function(t,r){if(r<0&&(r+=this.size),r<=0)return this.addManyHead(t);if(r>=this.size)return this.addManyTail(t);var e=this.get(r);return this.attachMany(t,e.previous,e)},t.prototype.addManyHead=function(t){var r=this;return t.reduceRight((function(t,e){return t.unshift(r.addHead(e)),t}),[])},t.prototype.addManyTail=function(t){var r=this;return t.map((function(t){return r.addTail(t)}))},t.prototype.drop=function(){var t=this;return{byIndex:function(r){return t.dropByIndex(r)},byValue:function(){for(var r=[],e=0;e=this.size)return[];t=Math.min(t,this.size-r);for(var e=[];t--;){var n=this.get(r);e.push(this.detach(n))}return e},t.prototype.dropManyHead=function(t){if(t<=0)return[];t=Math.min(t,this.size);for(var r=[];t--;)r.unshift(this.dropHead());return r},t.prototype.dropManyTail=function(t){if(t<=0)return[];t=Math.min(t,this.size);for(var r=[];t--;)r.push(this.dropTail());return r},t.prototype.find=function(t){for(var r=this.first,e=0;r;e++,r=r.next)if(t(r,e,this))return r},t.prototype.findIndex=function(t){for(var r=this.first,e=0;r;e++,r=r.next)if(t(r,e,this))return e;return-1},t.prototype.forEach=function(t){for(var r=this.first,e=0;r;e++,r=r.next)t(r,e,this)},t.prototype.get=function(t){return this.find((function(r,e){return t===e}))},t.prototype.indexOf=function(t,e){return void 0===e&&(e=r),this.findIndex((function(r){return e(r.value,t)}))},t.prototype.toArray=function(){var t=new Array(this.size);return this.forEach((function(r,e){return t[e]=r.value})),t},t.prototype.toNodeArray=function(){var t=new Array(this.size);return this.forEach((function(r,e){return t[e]=r})),t},t.prototype.toString=function(t){return void 0===t&&(t=JSON.stringify),this.toArray().map((function(r){return t(r)})).join(" <-> ")},t.prototype[Symbol.iterator]=function(){var t;return e(this,(function(r){switch(r.label){case 0:t=this.first,0,r.label=1;case 1:return t?[4,t.value]:[3,4];case 2:r.sent(),r.label=3;case 3:return t=t.next,[3,1];case 4:return[2]}}))},t}();t.LinkedList=a,t.ListNode=o,Object.defineProperty(t,"__esModule",{value:!0})})); +!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("just-compare")):"function"==typeof define&&define.amd?define("@abp/utils",["exports","just-compare"],r):r(((t=t||self).abp=t.abp||{},t.abp.utils=t.abp.utils||{},t.abp.utils.common={}),t.compare)}(this,(function(t,r){"use strict";r=r&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r;function e(t,r){var e,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;a;)try{if(e=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)&&!(n=o.next()).done;)a.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(e=o.return)&&e.call(o)}finally{if(i)throw i.error}}return a}function i(){for(var t=[],r=0;r=this.size)return this.addTail(t);if(r<=0)return this.addHead(t);var e=this.get(r);return this.attach(t,e.previous,e)},t.prototype.addHead=function(t){var r=new o(t);return r.next=this.first,this.first?this.first.previous=r:this.last=r,this.first=r,this.size++,r},t.prototype.addTail=function(t){var r=new o(t);return this.first?(r.previous=this.last,this.last.next=r,this.last=r):(this.first=r,this.last=r),this.size++,r},t.prototype.addManyAfter=function(t,e,n){void 0===n&&(n=r);var i=this.find((function(t){return n(t.value,e)}));return i?this.attachMany(t,i,i.next):this.addManyTail(t)},t.prototype.addManyBefore=function(t,e,n){void 0===n&&(n=r);var i=this.find((function(t){return n(t.value,e)}));return i?this.attachMany(t,i.previous,i):this.addManyHead(t)},t.prototype.addManyByIndex=function(t,r){if(r<0&&(r+=this.size),r<=0)return this.addManyHead(t);if(r>=this.size)return this.addManyTail(t);var e=this.get(r);return this.attachMany(t,e.previous,e)},t.prototype.addManyHead=function(t){var r=this;return t.reduceRight((function(t,e){return t.unshift(r.addHead(e)),t}),[])},t.prototype.addManyTail=function(t){var r=this;return t.map((function(t){return r.addTail(t)}))},t.prototype.drop=function(){var t=this;return{byIndex:function(r){return t.dropByIndex(r)},byValue:function(){for(var r=[],e=0;e=this.size)return[];t=Math.min(t,this.size-r);for(var e=[];t--;){var n=this.get(r);e.push(this.detach(n))}return e},t.prototype.dropManyHead=function(t){if(t<=0)return[];t=Math.min(t,this.size);for(var r=[];t--;)r.unshift(this.dropHead());return r},t.prototype.dropManyTail=function(t){if(t<=0)return[];t=Math.min(t,this.size);for(var r=[];t--;)r.push(this.dropTail());return r},t.prototype.find=function(t){for(var r=this.first,e=0;r;e++,r=r.next)if(t(r,e,this))return r},t.prototype.findIndex=function(t){for(var r=this.first,e=0;r;e++,r=r.next)if(t(r,e,this))return e;return-1},t.prototype.forEach=function(t){for(var r=this.first,e=0;r;e++,r=r.next)t(r,e,this)},t.prototype.get=function(t){return this.find((function(r,e){return t===e}))},t.prototype.indexOf=function(t,e){return void 0===e&&(e=r),this.findIndex((function(r){return e(r.value,t)}))},t.prototype.toArray=function(){var t=new Array(this.size);return this.forEach((function(r,e){return t[e]=r.value})),t},t.prototype.toNodeArray=function(){var t=new Array(this.size);return this.forEach((function(r,e){return t[e]=r})),t},t.prototype.toString=function(t){return void 0===t&&(t=JSON.stringify),this.toArray().map((function(r){return t(r)})).join(" <-> ")},t.prototype[Symbol.iterator]=function(){var t;return e(this,(function(r){switch(r.label){case 0:t=this.first,0,r.label=1;case 1:return t?[4,t.value]:[3,4];case 2:r.sent(),r.label=3;case 3:return t=t.next,[3,1];case 4:return[2]}}))},t}();t.LinkedList=a,t.ListNode=o,Object.defineProperty(t,"__esModule",{value:!0})})); //# sourceMappingURL=abp-utils.umd.min.js.map \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/abp/utils/abp-utils.umd.min.js.map b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/abp/utils/abp-utils.umd.min.js.map index b4e4d3e0a..529ba4c44 100644 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/abp/utils/abp-utils.umd.min.js.map +++ b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/abp/utils/abp-utils.umd.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../node_modules/tslib/tslib.es6.js","../../projects/utils/src/lib/linked-list.ts"],"names":["__generator","thisArg","body","f","y","t","g","_","label","sent","trys","ops","next","verb","throw","return","Symbol","iterator","this","n","v","op","TypeError","call","done","value","pop","length","push","e","step","Object","create","__read","o","m","r","i","ar","error","__spread","arguments","concat","LinkedList","size","defineProperty","prototype","first","last","attach","previousNode","nextNode","addHead","addTail","node","ListNode","previous","attachMany","values","addManyHead","addManyTail","list","toNodeArray","detach","dropTail","dropHead","add","_this","after","params","_i","_a","addAfter","apply","before","addBefore","byIndex","position","addByIndex","head","tail","addMany","addManyAfter","addManyBefore","addManyByIndex","previousValue","compareFn","compare","find","nextValue","get","reduceRight","nodes","unshift","map","drop","dropByIndex","byValue","dropByValue","byValueAll","dropByValueAll","dropMany","count","dropManyByIndex","dropManyHead","dropManyTail","current","undefined","findIndex","dropped","Math","max","min","predicate","forEach","iteratorFn","index","indexOf","toArray","array","Array","toString","mapperFn","JSON","stringify","join"],"mappings":"wYA6EgBA,EAAYC,EAASC,GACjC,IAAsGC,EAAGC,EAAGC,EAAGC,EAA3GC,EAAI,CAAEC,MAAO,EAAGC,KAAM,WAAa,GAAW,EAAPJ,EAAE,GAAQ,MAAMA,EAAE,GAAI,OAAOA,EAAE,IAAOK,KAAM,GAAIC,IAAK,IAChG,OAAOL,EAAI,CAAEM,KAAMC,EAAK,GAAIC,MAASD,EAAK,GAAIE,OAAUF,EAAK,IAAwB,mBAAXG,SAA0BV,EAAEU,OAAOC,UAAY,WAAa,OAAOC,OAAUZ,EACvJ,SAASO,EAAKM,GAAK,OAAO,SAAUC,GAAK,OACzC,SAAcC,GACV,GAAIlB,EAAG,MAAM,IAAImB,UAAU,mCAC3B,KAAOf,GAAG,IACN,GAAIJ,EAAI,EAAGC,IAAMC,EAAY,EAARgB,EAAG,GAASjB,EAAU,OAAIiB,EAAG,GAAKjB,EAAS,SAAOC,EAAID,EAAU,SAAMC,EAAEkB,KAAKnB,GAAI,GAAKA,EAAEQ,SAAWP,EAAIA,EAAEkB,KAAKnB,EAAGiB,EAAG,KAAKG,KAAM,OAAOnB,EAE3J,OADID,EAAI,EAAGC,IAAGgB,EAAK,CAAS,EAARA,EAAG,GAAQhB,EAAEoB,QACzBJ,EAAG,IACP,KAAK,EAAG,KAAK,EAAGhB,EAAIgB,EAAI,MACxB,KAAK,EAAc,OAAXd,EAAEC,QAAgB,CAAEiB,MAAOJ,EAAG,GAAIG,MAAM,GAChD,KAAK,EAAGjB,EAAEC,QAASJ,EAAIiB,EAAG,GAAIA,EAAK,CAAC,GAAI,SACxC,KAAK,EAAGA,EAAKd,EAAEI,IAAIe,MAAOnB,EAAEG,KAAKgB,MAAO,SACxC,QACI,KAAMrB,EAAIE,EAAEG,MAAML,EAAIA,EAAEsB,OAAS,GAAKtB,EAAEA,EAAEsB,OAAS,KAAkB,IAAVN,EAAG,IAAsB,IAAVA,EAAG,IAAW,CAAEd,EAAI,EAAG,SACjG,GAAc,IAAVc,EAAG,MAAchB,GAAMgB,EAAG,GAAKhB,EAAE,IAAMgB,EAAG,GAAKhB,EAAE,IAAM,CAAEE,EAAEC,MAAQa,EAAG,GAAI,MAC9E,GAAc,IAAVA,EAAG,IAAYd,EAAEC,MAAQH,EAAE,GAAI,CAAEE,EAAEC,MAAQH,EAAE,GAAIA,EAAIgB,EAAI,MAC7D,GAAIhB,GAAKE,EAAEC,MAAQH,EAAE,GAAI,CAAEE,EAAEC,MAAQH,EAAE,GAAIE,EAAEI,IAAIiB,KAAKP,GAAK,MACvDhB,EAAE,IAAIE,EAAEI,IAAIe,MAChBnB,EAAEG,KAAKgB,MAAO,SAEtBL,EAAKnB,EAAKqB,KAAKtB,EAASM,GAC1B,MAAOsB,GAAKR,EAAK,CAAC,EAAGQ,GAAIzB,EAAI,UAAeD,EAAIE,EAAI,EACtD,GAAY,EAARgB,EAAG,GAAQ,MAAMA,EAAG,GAAI,MAAO,CAAEI,MAAOJ,EAAG,GAAKA,EAAG,QAAK,EAAQG,MAAM,GArB9BM,CAAK,CAACX,EAAGC,MAyBhCW,OAAOC,gBAwBpBC,EAAOC,EAAGf,GACtB,IAAIgB,EAAsB,mBAAXnB,QAAyBkB,EAAElB,OAAOC,UACjD,IAAKkB,EAAG,OAAOD,EACf,IAAmBE,EAAYP,EAA3BQ,EAAIF,EAAEZ,KAAKW,GAAOI,EAAK,GAC3B,IACI,WAAc,IAANnB,GAAgBA,KAAM,MAAQiB,EAAIC,EAAEzB,QAAQY,MAAMc,EAAGV,KAAKQ,EAAEX,OAExE,MAAOc,GAASV,EAAI,CAAEU,MAAOA,WAEzB,IACQH,IAAMA,EAAEZ,OAASW,EAAIE,EAAU,SAAIF,EAAEZ,KAAKc,WAExC,GAAIR,EAAG,MAAMA,EAAEU,OAE7B,OAAOD,WAGKE,IACZ,IAAK,IAAIF,EAAK,GAAID,EAAI,EAAGA,EAAII,UAAUd,OAAQU,IAC3CC,EAAKA,EAAGI,OAAOT,EAAOQ,UAAUJ,KACpC,OAAOC,EA8CcP,OAAOC,aC5L9B,SAA4BP,GAAAP,KAAAO,MAAAA,gBAG9B,SAAAkB,IAGUzB,KAAA0B,KAAO,SAEfb,OAAAc,eAAIF,EAAAG,UAAA,OAAI,KAAR,WACE,OAAO5B,KAAK6B,uCAEdhB,OAAAc,eAAIF,EAAAG,UAAA,OAAI,KAAR,WACE,OAAO5B,KAAK8B,sCAEdjB,OAAAc,eAAIF,EAAAG,UAAA,SAAM,KAAV,WACE,OAAO5B,KAAK0B,sCAGND,EAAAG,UAAAG,OAAA,SACNxB,EACAyB,EACAC,GAEA,IAAKD,EAAc,OAAOhC,KAAKkC,QAAQ3B,GAEvC,IAAK0B,EAAU,OAAOjC,KAAKmC,QAAQ5B,GAEnC,IAAM6B,EAAO,IAAIC,EAAS9B,GAQ1B,OAPA6B,EAAKE,SAAWN,EAChBA,EAAatC,KAAO0C,EACpBA,EAAK1C,KAAOuC,EACZA,EAASK,SAAWF,EAEpBpC,KAAK0B,OAEEU,GAGDX,EAAAG,UAAAW,WAAA,SACNC,EACAR,EACAC,GAEA,IAAKO,EAAO/B,OAAQ,MAAO,GAE3B,IAAKuB,EAAc,OAAOhC,KAAKyC,YAAYD,GAE3C,IAAKP,EAAU,OAAOjC,KAAK0C,YAAYF,GAEvC,IAAMG,EAAO,IAAIlB,EASjB,OARAkB,EAAKD,YAAYF,GACjBG,EAAKd,MAAOS,SAAWN,EACvBA,EAAatC,KAAOiD,EAAKd,MACzBc,EAAKb,KAAMpC,KAAOuC,EAClBA,EAASK,SAAWK,EAAKb,KAEzB9B,KAAK0B,MAAQc,EAAO/B,OAEbkC,EAAKC,eAGNnB,EAAAG,UAAAiB,OAAA,SAAOT,GACb,OAAKA,EAAKE,SAELF,EAAK1C,MAEV0C,EAAKE,SAAS5C,KAAO0C,EAAK1C,KAC1B0C,EAAK1C,KAAK4C,SAAWF,EAAKE,SAE1BtC,KAAK0B,OAEEU,GAPgBpC,KAAK8C,WAFD9C,KAAK+C,YAYlCtB,EAAAG,UAAAoB,IAAA,SAAIzC,GAAJ,IAAA0C,EAAAjD,KACE,MAAO,CACLkD,MAAO,qBAACC,EAAA,GAAAC,EAAA,EAAAA,EAAA7B,UAAAd,OAAA2C,IAAAD,EAAAC,GAAA7B,UAAA6B,GACN,OAAAC,EAAAJ,EAAKK,UAASjD,KAAIkD,MAAAF,EAAA/B,EAAA,CAAC2B,EAAM1C,GAAU4C,KACrCK,OAAQ,qBAACL,EAAA,GAAAC,EAAA,EAAAA,EAAA7B,UAAAd,OAAA2C,IAAAD,EAAAC,GAAA7B,UAAA6B,GACP,OAAAC,EAAAJ,EAAKQ,WAAUpD,KAAIkD,MAAAF,EAAA/B,EAAA,CAAC2B,EAAM1C,GAAU4C,KACtCO,QAAS,SAACC,GAAqB,OAAAV,EAAKW,WAAWrD,EAAOoD,IACtDE,KAAM,WAAM,OAAAZ,EAAKf,QAAQ3B,IACzBuD,KAAM,WAAM,OAAAb,EAAKd,QAAQ5B,MAI7BkB,EAAAG,UAAAmC,QAAA,SAAQvB,GAAR,IAAAS,EAAAjD,KACE,MAAO,CACLkD,MAAO,qBAACC,EAAA,GAAAC,EAAA,EAAAA,EAAA7B,UAAAd,OAAA2C,IAAAD,EAAAC,GAAA7B,UAAA6B,GACN,OAAAC,EAAAJ,EAAKe,cAAa3D,KAAIkD,MAAAF,EAAA/B,EAAA,CAAC2B,EAAMT,GAAWW,KAC1CK,OAAQ,qBAACL,EAAA,GAAAC,EAAA,EAAAA,EAAA7B,UAAAd,OAAA2C,IAAAD,EAAAC,GAAA7B,UAAA6B,GACP,OAAAC,EAAAJ,EAAKgB,eAAc5D,KAAIkD,MAAAF,EAAA/B,EAAA,CAAC2B,EAAMT,GAAWW,KAC3CO,QAAS,SAACC,GAAqB,OAAAV,EAAKiB,eAAe1B,EAAQmB,IAC3DE,KAAM,WAAM,OAAAZ,EAAKR,YAAYD,IAC7BsB,KAAM,WAAM,OAAAb,EAAKP,YAAYF,MAMjCf,EAAAG,UAAA0B,SAAA,SAAS/C,EAAU4D,EAAoBC,QAAA,IAAAA,IAAAA,EAAAC,GACrC,IAAM/B,EAAWtC,KAAKsE,MAAK,SAAAlC,GAAQ,OAAAgC,EAAUhC,EAAK7B,MAAO4D,MAEzD,OAAO7B,EAAWtC,KAAK+B,OAAOxB,EAAO+B,EAAUA,EAAS5C,MAAQM,KAAKmC,QAAQ5B,IAK/EkB,EAAAG,UAAA6B,UAAA,SAAUlD,EAAUgE,EAAgBH,QAAA,IAAAA,IAAAA,EAAAC,GAClC,IAAM3E,EAAOM,KAAKsE,MAAK,SAAAlC,GAAQ,OAAAgC,EAAUhC,EAAK7B,MAAOgE,MAErD,OAAO7E,EAAOM,KAAK+B,OAAOxB,EAAOb,EAAK4C,SAAU5C,GAAQM,KAAKkC,QAAQ3B,IAGvEkB,EAAAG,UAAAgC,WAAA,SAAWrD,EAAUoD,GACnB,GAAIA,EAAW,EAAGA,GAAY3D,KAAK0B,UAC9B,GAAIiC,GAAY3D,KAAK0B,KAAM,OAAO1B,KAAKmC,QAAQ5B,GAEpD,GAAIoD,GAAY,EAAG,OAAO3D,KAAKkC,QAAQ3B,GAEvC,IAAMb,EAAOM,KAAKwE,IAAIb,GAEtB,OAAO3D,KAAK+B,OAAOxB,EAAOb,EAAK4C,SAAU5C,IAG3C+B,EAAAG,UAAAM,QAAA,SAAQ3B,GACN,IAAM6B,EAAO,IAAIC,EAAS9B,GAU1B,OARA6B,EAAK1C,KAAOM,KAAK6B,MAEb7B,KAAK6B,MAAO7B,KAAK6B,MAAMS,SAAWF,EACjCpC,KAAK8B,KAAOM,EAEjBpC,KAAK6B,MAAQO,EACbpC,KAAK0B,OAEEU,GAGTX,EAAAG,UAAAO,QAAA,SAAQ5B,GACN,IAAM6B,EAAO,IAAIC,EAAS9B,GAa1B,OAXIP,KAAK6B,OACPO,EAAKE,SAAWtC,KAAK8B,KACrB9B,KAAK8B,KAAMpC,KAAO0C,EAClBpC,KAAK8B,KAAOM,IAEZpC,KAAK6B,MAAQO,EACbpC,KAAK8B,KAAOM,GAGdpC,KAAK0B,OAEEU,GAKTX,EAAAG,UAAAoC,aAAA,SACExB,EACA2B,EACAC,QAAA,IAAAA,IAAAA,EAAAC,GAEA,IAAM/B,EAAWtC,KAAKsE,MAAK,SAAAlC,GAAQ,OAAAgC,EAAUhC,EAAK7B,MAAO4D,MAEzD,OAAO7B,EAAWtC,KAAKuC,WAAWC,EAAQF,EAAUA,EAAS5C,MAAQM,KAAK0C,YAAYF,IAKxFf,EAAAG,UAAAqC,cAAA,SACEzB,EACA+B,EACAH,QAAA,IAAAA,IAAAA,EAAAC,GAEA,IAAM3E,EAAOM,KAAKsE,MAAK,SAAAlC,GAAQ,OAAAgC,EAAUhC,EAAK7B,MAAOgE,MAErD,OAAO7E,EAAOM,KAAKuC,WAAWC,EAAQ9C,EAAK4C,SAAU5C,GAAQM,KAAKyC,YAAYD,IAGhFf,EAAAG,UAAAsC,eAAA,SAAe1B,EAAamB,GAG1B,GAFIA,EAAW,IAAGA,GAAY3D,KAAK0B,MAE/BiC,GAAY,EAAG,OAAO3D,KAAKyC,YAAYD,GAE3C,GAAImB,GAAY3D,KAAK0B,KAAM,OAAO1B,KAAK0C,YAAYF,GAEnD,IAAM9C,EAAOM,KAAKwE,IAAIb,GAEtB,OAAO3D,KAAKuC,WAAWC,EAAQ9C,EAAK4C,SAAU5C,IAGhD+B,EAAAG,UAAAa,YAAA,SAAYD,GAAZ,IAAAS,EAAAjD,KACE,OAAOwC,EAAOiC,aAA2B,SAACC,EAAOnE,GAE/C,OADAmE,EAAMC,QAAQ1B,EAAKf,QAAQ3B,IACpBmE,IACN,KAGLjD,EAAAG,UAAAc,YAAA,SAAYF,GAAZ,IAAAS,EAAAjD,KACE,OAAOwC,EAAOoC,KAAI,SAAArE,GAAS,OAAA0C,EAAKd,QAAQ5B,OAG1CkB,EAAAG,UAAAiD,KAAA,WAAA,IAAA5B,EAAAjD,KACE,MAAO,CACL0D,QAAS,SAACC,GAAqB,OAAAV,EAAK6B,YAAYnB,IAChDoB,QAAS,eAAC,IAAA5B,EAAA,GAAAC,EAAA,EAAAA,EAAA7B,UAAAd,OAAA2C,IAAAD,EAAAC,GAAA7B,UAAA6B,GACR,OAAAH,EAAK+B,YAAYzB,MAAMN,EAAME,IAC/B8B,WAAY,eAAC,IAAA9B,EAAA,GAAAC,EAAA,EAAAA,EAAA7B,UAAAd,OAAA2C,IAAAD,EAAAC,GAAA7B,UAAA6B,GACX,OAAAH,EAAKiC,eAAe3B,MAAMN,EAAME,IAClCU,KAAM,WAAM,OAAAZ,EAAKF,YACjBe,KAAM,WAAM,OAAAb,EAAKH,cAIrBrB,EAAAG,UAAAuD,SAAA,SAASC,GAAT,IAAAnC,EAAAjD,KACE,MAAO,CACL0D,QAAS,SAACC,GAAqB,OAAAV,EAAKoC,gBAAgBD,EAAOzB,IAC3DE,KAAM,WAAM,OAAAZ,EAAKqC,aAAaF,IAC9BtB,KAAM,WAAM,OAAAb,EAAKsC,aAAaH,MAIlC3D,EAAAG,UAAAkD,YAAA,SAAYnB,GACNA,EAAW,IAAGA,GAAY3D,KAAK0B,MAEnC,IAAM8D,EAAUxF,KAAKwE,IAAIb,GAEzB,OAAO6B,EAAUxF,KAAK6C,OAAO2C,QAAWC,GAK1ChE,EAAAG,UAAAoD,YAAA,SAAYzE,EAAY6D,QAAA,IAAAA,IAAAA,EAAAC,GACtB,IAAMV,EAAW3D,KAAK0F,WAAU,SAAAtD,GAAQ,OAAAgC,EAAUhC,EAAK7B,MAAOA,MAE9D,OAAOoD,EAAW,OAAI8B,EAAYzF,KAAK8E,YAAYnB,IAKrDlC,EAAAG,UAAAsD,eAAA,SAAe3E,EAAY6D,QAAA,IAAAA,IAAAA,EAAAC,GAGzB,IAFA,IAAMsB,EAAyB,GAEtBH,EAAUxF,KAAK6B,MAAO8B,EAAW,EAAG6B,EAAS7B,IAAY6B,EAAUA,EAAQ9F,KAC9E0E,EAAUoB,EAAQjF,MAAOA,IAC3BoF,EAAQjF,KAAKV,KAAK8E,YAAYnB,EAAWgC,EAAQlF,SAIrD,OAAOkF,GAGTlE,EAAAG,UAAAmB,SAAA,WACE,IAAMc,EAAO7D,KAAK6B,MAElB,GAAIgC,EAQF,OAPA7D,KAAK6B,MAAQgC,EAAKnE,KAEdM,KAAK6B,MAAO7B,KAAK6B,MAAMS,cAAWmD,EACjCzF,KAAK8B,UAAO2D,EAEjBzF,KAAK0B,OAEEmC,GAMXpC,EAAAG,UAAAkB,SAAA,WACE,IAAMgB,EAAO9D,KAAK8B,KAElB,GAAIgC,EAQF,OAPA9D,KAAK8B,KAAOgC,EAAKxB,SAEbtC,KAAK8B,KAAM9B,KAAK8B,KAAKpC,UAAO+F,EAC3BzF,KAAK6B,WAAQ4D,EAElBzF,KAAK0B,OAEEoC,GAMXrC,EAAAG,UAAAyD,gBAAA,SAAgBD,EAAezB,GAC7B,GAAIyB,GAAS,EAAG,MAAO,GAEvB,GAAIzB,EAAW,EAAGA,EAAWiC,KAAKC,IAAIlC,EAAW3D,KAAK0B,KAAM,QACvD,GAAIiC,GAAY3D,KAAK0B,KAAM,MAAO,GAEvC0D,EAAQQ,KAAKE,IAAIV,EAAOpF,KAAK0B,KAAOiC,GAIpC,IAFA,IAAMgC,EAAyB,GAExBP,KAAS,CACd,IAAMI,EAAUxF,KAAKwE,IAAIb,GACzBgC,EAAQjF,KAAKV,KAAK6C,OAAO2C,IAG3B,OAAOG,GAGTlE,EAAAG,UAAA0D,aAAA,SAAaF,GACX,GAAIA,GAAS,EAAG,MAAO,GAEvBA,EAAQQ,KAAKE,IAAIV,EAAOpF,KAAK0B,MAI7B,IAFA,IAAMiE,EAAyB,GAExBP,KAASO,EAAQhB,QAAQ3E,KAAK+C,YAErC,OAAO4C,GAGTlE,EAAAG,UAAA2D,aAAA,SAAaH,GACX,GAAIA,GAAS,EAAG,MAAO,GAEvBA,EAAQQ,KAAKE,IAAIV,EAAOpF,KAAK0B,MAI7B,IAFA,IAAMiE,EAAyB,GAExBP,KAASO,EAAQjF,KAAKV,KAAK8C,YAElC,OAAO6C,GAGTlE,EAAAG,UAAA0C,KAAA,SAAKyB,GACH,IAAK,IAAIP,EAAUxF,KAAK6B,MAAO8B,EAAW,EAAG6B,EAAS7B,IAAY6B,EAAUA,EAAQ9F,KAClF,GAAIqG,EAAUP,EAAS7B,EAAU3D,MAAO,OAAOwF,GAMnD/D,EAAAG,UAAA8D,UAAA,SAAUK,GACR,IAAK,IAAIP,EAAUxF,KAAK6B,MAAO8B,EAAW,EAAG6B,EAAS7B,IAAY6B,EAAUA,EAAQ9F,KAClF,GAAIqG,EAAUP,EAAS7B,EAAU3D,MAAO,OAAO2D,EAGjD,OAAQ,GAGVlC,EAAAG,UAAAoE,QAAA,SAAqBC,GACnB,IAAK,IAAI7D,EAAOpC,KAAK6B,MAAO8B,EAAW,EAAGvB,EAAMuB,IAAYvB,EAAOA,EAAK1C,KACtEuG,EAAW7D,EAAMuB,EAAU3D,OAI/ByB,EAAAG,UAAA4C,IAAA,SAAIb,GACF,OAAO3D,KAAKsE,MAAK,SAACjF,EAAG6G,GAAU,OAAAvC,IAAauC,MAK9CzE,EAAAG,UAAAuE,QAAA,SAAQ5F,EAAY6D,GAClB,YADkB,IAAAA,IAAAA,EAAAC,GACXrE,KAAK0F,WAAU,SAAAtD,GAAQ,OAAAgC,EAAUhC,EAAK7B,MAAOA,OAGtDkB,EAAAG,UAAAwE,QAAA,WACE,IAAMC,EAAQ,IAAIC,MAAMtG,KAAK0B,MAI7B,OAFA1B,KAAKgG,SAAQ,SAAC5D,EAAM8D,GAAU,OAACG,EAAMH,GAAU9D,EAAK7B,SAE7C8F,GAGT5E,EAAAG,UAAAgB,YAAA,WACE,IAAMyD,EAAQ,IAAIC,MAAMtG,KAAK0B,MAI7B,OAFA1B,KAAKgG,SAAQ,SAAC5D,EAAM8D,GAAU,OAACG,EAAMH,GAAU9D,KAExCiE,GAGT5E,EAAAG,UAAA2E,SAAA,SAASC,GACP,YADO,IAAAA,IAAAA,EAA4BC,KAAKC,WACjC1G,KAAKoG,UACTxB,KAAI,SAAArE,GAAS,OAAAiG,EAASjG,MACtBoG,KAAK,UAITlF,EAAAG,UAAC9B,OAAOC,UAAT,mEACWqC,EAAOpC,KAAK6B,MAAkB,0BAAGO,EACxC,CAAA,EAAMA,EAAK7B,OADiC,CAAA,EAAA,UAC5C8C,EAAA9D,+BAD0D6C,EAAOA,EAAK1C","sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","/* tslint:disable:no-non-null-assertion */\n\nimport compare from 'just-compare';\n\nexport class ListNode {\n next: ListNode | undefined;\n previous: ListNode | undefined;\n constructor(public readonly value: T) {}\n}\n\nexport class LinkedList {\n private first: ListNode | undefined;\n private last: ListNode | undefined;\n private size = 0;\n\n get head(): ListNode | undefined {\n return this.first;\n }\n get tail(): ListNode | undefined {\n return this.last;\n }\n get length(): number {\n return this.size;\n }\n\n private attach(\n value: T,\n previousNode: ListNode | undefined,\n nextNode: ListNode | undefined,\n ): ListNode {\n if (!previousNode) return this.addHead(value);\n\n if (!nextNode) return this.addTail(value);\n\n const node = new ListNode(value);\n node.previous = previousNode;\n previousNode.next = node;\n node.next = nextNode;\n nextNode.previous = node;\n\n this.size++;\n\n return node;\n }\n\n private attachMany(\n values: T[],\n previousNode: ListNode | undefined,\n nextNode: ListNode | undefined,\n ): ListNode[] {\n if (!values.length) return [];\n\n if (!previousNode) return this.addManyHead(values);\n\n if (!nextNode) return this.addManyTail(values);\n\n const list = new LinkedList();\n list.addManyTail(values);\n list.first!.previous = previousNode;\n previousNode.next = list.first;\n list.last!.next = nextNode;\n nextNode.previous = list.last;\n\n this.size += values.length;\n\n return list.toNodeArray();\n }\n\n private detach(node: ListNode) {\n if (!node.previous) return this.dropHead();\n\n if (!node.next) return this.dropTail();\n\n node.previous.next = node.next;\n node.next.previous = node.previous;\n\n this.size--;\n\n return node;\n }\n\n add(value: T) {\n return {\n after: (...params: [T] | [any, ListComparisonFn]) =>\n this.addAfter.call(this, value, ...params),\n before: (...params: [T] | [any, ListComparisonFn]) =>\n this.addBefore.call(this, value, ...params),\n byIndex: (position: number) => this.addByIndex(value, position),\n head: () => this.addHead(value),\n tail: () => this.addTail(value),\n };\n }\n\n addMany(values: T[]) {\n return {\n after: (...params: [T] | [any, ListComparisonFn]) =>\n this.addManyAfter.call(this, values, ...params),\n before: (...params: [T] | [any, ListComparisonFn]) =>\n this.addManyBefore.call(this, values, ...params),\n byIndex: (position: number) => this.addManyByIndex(values, position),\n head: () => this.addManyHead(values),\n tail: () => this.addManyTail(values),\n };\n }\n\n addAfter(value: T, previousValue: T): ListNode;\n addAfter(value: T, previousValue: any, compareFn: ListComparisonFn): ListNode;\n addAfter(value: T, previousValue: any, compareFn: ListComparisonFn = compare): ListNode {\n const previous = this.find(node => compareFn(node.value, previousValue));\n\n return previous ? this.attach(value, previous, previous.next) : this.addTail(value);\n }\n\n addBefore(value: T, nextValue: T): ListNode;\n addBefore(value: T, nextValue: any, compareFn: ListComparisonFn): ListNode;\n addBefore(value: T, nextValue: any, compareFn: ListComparisonFn = compare): ListNode {\n const next = this.find(node => compareFn(node.value, nextValue));\n\n return next ? this.attach(value, next.previous, next) : this.addHead(value);\n }\n\n addByIndex(value: T, position: number): ListNode {\n if (position < 0) position += this.size;\n else if (position >= this.size) return this.addTail(value);\n\n if (position <= 0) return this.addHead(value);\n\n const next = this.get(position)!;\n\n return this.attach(value, next.previous, next);\n }\n\n addHead(value: T): ListNode {\n const node = new ListNode(value);\n\n node.next = this.first;\n\n if (this.first) this.first.previous = node;\n else this.last = node;\n\n this.first = node;\n this.size++;\n\n return node;\n }\n\n addTail(value: T): ListNode {\n const node = new ListNode(value);\n\n if (this.first) {\n node.previous = this.last;\n this.last!.next = node;\n this.last = node;\n } else {\n this.first = node;\n this.last = node;\n }\n\n this.size++;\n\n return node;\n }\n\n addManyAfter(values: T[], previousValue: T): ListNode[];\n addManyAfter(values: T[], previousValue: any, compareFn: ListComparisonFn): ListNode[];\n addManyAfter(\n values: T[],\n previousValue: any,\n compareFn: ListComparisonFn = compare,\n ): ListNode[] {\n const previous = this.find(node => compareFn(node.value, previousValue));\n\n return previous ? this.attachMany(values, previous, previous.next) : this.addManyTail(values);\n }\n\n addManyBefore(values: T[], nextValue: T): ListNode[];\n addManyBefore(values: T[], nextValue: any, compareFn: ListComparisonFn): ListNode[];\n addManyBefore(\n values: T[],\n nextValue: any,\n compareFn: ListComparisonFn = compare,\n ): ListNode[] {\n const next = this.find(node => compareFn(node.value, nextValue));\n\n return next ? this.attachMany(values, next.previous, next) : this.addManyHead(values);\n }\n\n addManyByIndex(values: T[], position: number): ListNode[] {\n if (position < 0) position += this.size;\n\n if (position <= 0) return this.addManyHead(values);\n\n if (position >= this.size) return this.addManyTail(values);\n\n const next = this.get(position)!;\n\n return this.attachMany(values, next.previous, next);\n }\n\n addManyHead(values: T[]): ListNode[] {\n return values.reduceRight[]>((nodes, value) => {\n nodes.unshift(this.addHead(value));\n return nodes;\n }, []);\n }\n\n addManyTail(values: T[]): ListNode[] {\n return values.map(value => this.addTail(value));\n }\n\n drop() {\n return {\n byIndex: (position: number) => this.dropByIndex(position),\n byValue: (...params: [T] | [any, ListComparisonFn]) =>\n this.dropByValue.apply(this, params),\n byValueAll: (...params: [T] | [any, ListComparisonFn]) =>\n this.dropByValueAll.apply(this, params),\n head: () => this.dropHead(),\n tail: () => this.dropTail(),\n };\n }\n\n dropMany(count: number) {\n return {\n byIndex: (position: number) => this.dropManyByIndex(count, position),\n head: () => this.dropManyHead(count),\n tail: () => this.dropManyTail(count),\n };\n }\n\n dropByIndex(position: number): ListNode | undefined {\n if (position < 0) position += this.size;\n\n const current = this.get(position);\n\n return current ? this.detach(current) : undefined;\n }\n\n dropByValue(value: T): ListNode | undefined;\n dropByValue(value: any, compareFn: ListComparisonFn): ListNode | undefined;\n dropByValue(value: any, compareFn: ListComparisonFn = compare): ListNode | undefined {\n const position = this.findIndex(node => compareFn(node.value, value));\n\n return position < 0 ? undefined : this.dropByIndex(position);\n }\n\n dropByValueAll(value: T): ListNode[];\n dropByValueAll(value: any, compareFn: ListComparisonFn): ListNode[];\n dropByValueAll(value: any, compareFn: ListComparisonFn = compare): ListNode[] {\n const dropped: ListNode[] = [];\n\n for (let current = this.first, position = 0; current; position++, current = current.next) {\n if (compareFn(current.value, value)) {\n dropped.push(this.dropByIndex(position - dropped.length)!);\n }\n }\n\n return dropped;\n }\n\n dropHead(): ListNode | undefined {\n const head = this.first;\n\n if (head) {\n this.first = head.next;\n\n if (this.first) this.first.previous = undefined;\n else this.last = undefined;\n\n this.size--;\n\n return head;\n }\n\n return undefined;\n }\n\n dropTail(): ListNode | undefined {\n const tail = this.last;\n\n if (tail) {\n this.last = tail.previous;\n\n if (this.last) this.last.next = undefined;\n else this.first = undefined;\n\n this.size--;\n\n return tail;\n }\n\n return undefined;\n }\n\n dropManyByIndex(count: number, position: number): ListNode[] {\n if (count <= 0) return [];\n\n if (position < 0) position = Math.max(position + this.size, 0);\n else if (position >= this.size) return [];\n\n count = Math.min(count, this.size - position);\n\n const dropped: ListNode[] = [];\n\n while (count--) {\n const current = this.get(position);\n dropped.push(this.detach(current!)!);\n }\n\n return dropped;\n }\n\n dropManyHead(count: Exclude): ListNode[] {\n if (count <= 0) return [];\n\n count = Math.min(count, this.size);\n\n const dropped: ListNode[] = [];\n\n while (count--) dropped.unshift(this.dropHead()!);\n\n return dropped;\n }\n\n dropManyTail(count: Exclude): ListNode[] {\n if (count <= 0) return [];\n\n count = Math.min(count, this.size);\n\n const dropped: ListNode[] = [];\n\n while (count--) dropped.push(this.dropTail()!);\n\n return dropped;\n }\n\n find(predicate: ListIteratorFn): ListNode | undefined {\n for (let current = this.first, position = 0; current; position++, current = current.next) {\n if (predicate(current, position, this)) return current;\n }\n\n return undefined;\n }\n\n findIndex(predicate: ListIteratorFn): number {\n for (let current = this.first, position = 0; current; position++, current = current.next) {\n if (predicate(current, position, this)) return position;\n }\n\n return -1;\n }\n\n forEach(iteratorFn: ListIteratorFn) {\n for (let node = this.first, position = 0; node; position++, node = node.next) {\n iteratorFn(node, position, this);\n }\n }\n\n get(position: number): ListNode | undefined {\n return this.find((_, index) => position === index);\n }\n\n indexOf(value: T): number;\n indexOf(value: any, compareFn: ListComparisonFn): number;\n indexOf(value: any, compareFn: ListComparisonFn = compare): number {\n return this.findIndex(node => compareFn(node.value, value));\n }\n\n toArray(): T[] {\n const array = new Array(this.size);\n\n this.forEach((node, index) => (array[index!] = node.value));\n\n return array;\n }\n\n toNodeArray(): ListNode[] {\n const array = new Array(this.size);\n\n this.forEach((node, index) => (array[index!] = node));\n\n return array;\n }\n\n toString(mapperFn: ListMapperFn = JSON.stringify): string {\n return this.toArray()\n .map(value => mapperFn(value))\n .join(' <-> ');\n }\n\n // Cannot use Generator type because of ng-packagr\n *[Symbol.iterator](): any {\n for (let node = this.first, position = 0; node; position++, node = node.next) {\n yield node.value;\n }\n }\n}\n\nexport type ListMapperFn = (value: T) => any;\n\nexport type ListComparisonFn = (value1: T, value2: any) => boolean;\n\nexport type ListIteratorFn = (\n node: ListNode,\n index?: number,\n list?: LinkedList,\n) => R;\n"]} \ No newline at end of file +{"version":3,"sources":["../../node_modules/tslib/tslib.es6.js","../../projects/utils/src/lib/linked-list.ts"],"names":["__generator","thisArg","body","f","y","t","g","_","label","sent","trys","ops","next","verb","throw","return","Symbol","iterator","this","n","v","op","TypeError","call","done","value","pop","length","push","e","step","Object","create","__read","o","m","r","i","ar","error","__spread","arguments","concat","LinkedList","size","defineProperty","prototype","first","last","attach","previousNode","nextNode","addHead","addTail","node","ListNode","previous","attachMany","values","addManyHead","addManyTail","list","toNodeArray","detach","dropTail","dropHead","add","_this","after","params","_i","_a","addAfter","apply","before","addBefore","byIndex","position","addByIndex","head","tail","addMany","addManyAfter","addManyBefore","addManyByIndex","previousValue","compareFn","compare","find","nextValue","get","reduceRight","nodes","unshift","map","drop","dropByIndex","byValue","dropByValue","byValueAll","dropByValueAll","dropMany","count","dropManyByIndex","dropManyHead","dropManyTail","current","undefined","findIndex","dropped","Math","max","min","predicate","forEach","iteratorFn","index","indexOf","toArray","array","Array","toString","mapperFn","JSON","stringify","join"],"mappings":"wYA6EgBA,EAAYC,EAASC,GACjC,IAAsGC,EAAGC,EAAGC,EAAGC,EAA3GC,EAAI,CAAEC,MAAO,EAAGC,KAAM,WAAa,GAAW,EAAPJ,EAAE,GAAQ,MAAMA,EAAE,GAAI,OAAOA,EAAE,IAAOK,KAAM,GAAIC,IAAK,IAChG,OAAOL,EAAI,CAAEM,KAAMC,EAAK,GAAIC,MAASD,EAAK,GAAIE,OAAUF,EAAK,IAAwB,mBAAXG,SAA0BV,EAAEU,OAAOC,UAAY,WAAa,OAAOC,OAAUZ,EACvJ,SAASO,EAAKM,GAAK,OAAO,SAAUC,GAAK,OACzC,SAAcC,GACV,GAAIlB,EAAG,MAAM,IAAImB,UAAU,mCAC3B,KAAOf,GAAG,IACN,GAAIJ,EAAI,EAAGC,IAAMC,EAAY,EAARgB,EAAG,GAASjB,EAAU,OAAIiB,EAAG,GAAKjB,EAAS,SAAOC,EAAID,EAAU,SAAMC,EAAEkB,KAAKnB,GAAI,GAAKA,EAAEQ,SAAWP,EAAIA,EAAEkB,KAAKnB,EAAGiB,EAAG,KAAKG,KAAM,OAAOnB,EAE3J,OADID,EAAI,EAAGC,IAAGgB,EAAK,CAAS,EAARA,EAAG,GAAQhB,EAAEoB,QACzBJ,EAAG,IACP,KAAK,EAAG,KAAK,EAAGhB,EAAIgB,EAAI,MACxB,KAAK,EAAc,OAAXd,EAAEC,QAAgB,CAAEiB,MAAOJ,EAAG,GAAIG,MAAM,GAChD,KAAK,EAAGjB,EAAEC,QAASJ,EAAIiB,EAAG,GAAIA,EAAK,CAAC,GAAI,SACxC,KAAK,EAAGA,EAAKd,EAAEI,IAAIe,MAAOnB,EAAEG,KAAKgB,MAAO,SACxC,QACI,KAAMrB,EAAIE,EAAEG,MAAML,EAAIA,EAAEsB,OAAS,GAAKtB,EAAEA,EAAEsB,OAAS,KAAkB,IAAVN,EAAG,IAAsB,IAAVA,EAAG,IAAW,CAAEd,EAAI,EAAG,SACjG,GAAc,IAAVc,EAAG,MAAchB,GAAMgB,EAAG,GAAKhB,EAAE,IAAMgB,EAAG,GAAKhB,EAAE,IAAM,CAAEE,EAAEC,MAAQa,EAAG,GAAI,MAC9E,GAAc,IAAVA,EAAG,IAAYd,EAAEC,MAAQH,EAAE,GAAI,CAAEE,EAAEC,MAAQH,EAAE,GAAIA,EAAIgB,EAAI,MAC7D,GAAIhB,GAAKE,EAAEC,MAAQH,EAAE,GAAI,CAAEE,EAAEC,MAAQH,EAAE,GAAIE,EAAEI,IAAIiB,KAAKP,GAAK,MACvDhB,EAAE,IAAIE,EAAEI,IAAIe,MAChBnB,EAAEG,KAAKgB,MAAO,SAEtBL,EAAKnB,EAAKqB,KAAKtB,EAASM,GAC1B,MAAOsB,GAAKR,EAAK,CAAC,EAAGQ,GAAIzB,EAAI,UAAeD,EAAIE,EAAI,EACtD,GAAY,EAARgB,EAAG,GAAQ,MAAMA,EAAG,GAAI,MAAO,CAAEI,MAAOJ,EAAG,GAAKA,EAAG,QAAK,EAAQG,MAAM,GArB9BM,CAAK,CAACX,EAAGC,MAyBhCW,OAAOC,gBAwBpBC,EAAOC,EAAGf,GACtB,IAAIgB,EAAsB,mBAAXnB,QAAyBkB,EAAElB,OAAOC,UACjD,IAAKkB,EAAG,OAAOD,EACf,IAAmBE,EAAYP,EAA3BQ,EAAIF,EAAEZ,KAAKW,GAAOI,EAAK,GAC3B,IACI,WAAc,IAANnB,GAAgBA,KAAM,MAAQiB,EAAIC,EAAEzB,QAAQY,MAAMc,EAAGV,KAAKQ,EAAEX,OAExE,MAAOc,GAASV,EAAI,CAAEU,MAAOA,WAEzB,IACQH,IAAMA,EAAEZ,OAASW,EAAIE,EAAU,SAAIF,EAAEZ,KAAKc,WAExC,GAAIR,EAAG,MAAMA,EAAEU,OAE7B,OAAOD,WAGKE,IACZ,IAAK,IAAIF,EAAK,GAAID,EAAI,EAAGA,EAAII,UAAUd,OAAQU,IAC3CC,EAAKA,EAAGI,OAAOT,EAAOQ,UAAUJ,KACpC,OAAOC,EA8CcP,OAAOC,aC5L9B,SAA4BP,GAAAP,KAAAO,MAAAA,gBAG9B,SAAAkB,IAGUzB,KAAA0B,KAAO,SAEfb,OAAAc,eAAIF,EAAAG,UAAA,OAAI,KAAR,WACE,OAAO5B,KAAK6B,uCAEdhB,OAAAc,eAAIF,EAAAG,UAAA,OAAI,KAAR,WACE,OAAO5B,KAAK8B,sCAEdjB,OAAAc,eAAIF,EAAAG,UAAA,SAAM,KAAV,WACE,OAAO5B,KAAK0B,sCAGND,EAAAG,UAAAG,OAAA,SACNxB,EACAyB,EACAC,GAEA,IAAKD,EAAc,OAAOhC,KAAKkC,QAAQ3B,GAEvC,IAAK0B,EAAU,OAAOjC,KAAKmC,QAAQ5B,GAEnC,IAAM6B,EAAO,IAAIC,EAAS9B,GAQ1B,OAPA6B,EAAKE,SAAWN,EAChBA,EAAatC,KAAO0C,EACpBA,EAAK1C,KAAOuC,EACZA,EAASK,SAAWF,EAEpBpC,KAAK0B,OAEEU,GAGDX,EAAAG,UAAAW,WAAA,SACNC,EACAR,EACAC,GAEA,IAAKO,EAAO/B,OAAQ,MAAO,GAE3B,IAAKuB,EAAc,OAAOhC,KAAKyC,YAAYD,GAE3C,IAAKP,EAAU,OAAOjC,KAAK0C,YAAYF,GAEvC,IAAMG,EAAO,IAAIlB,EASjB,OARAkB,EAAKD,YAAYF,GACjBG,EAAKd,MAAOS,SAAWN,EACvBA,EAAatC,KAAOiD,EAAKd,MACzBc,EAAKb,KAAMpC,KAAOuC,EAClBA,EAASK,SAAWK,EAAKb,KAEzB9B,KAAK0B,MAAQc,EAAO/B,OAEbkC,EAAKC,eAGNnB,EAAAG,UAAAiB,OAAA,SAAOT,GACb,OAAKA,EAAKE,SAELF,EAAK1C,MAEV0C,EAAKE,SAAS5C,KAAO0C,EAAK1C,KAC1B0C,EAAK1C,KAAK4C,SAAWF,EAAKE,SAE1BtC,KAAK0B,OAEEU,GAPgBpC,KAAK8C,WAFD9C,KAAK+C,YAYlCtB,EAAAG,UAAAoB,IAAA,SAAIzC,GAAJ,IAAA0C,EAAAjD,KACE,MAAO,CACLkD,MAAO,qBAACC,EAAA,GAAAC,EAAA,EAAAA,EAAA7B,UAAAd,OAAA2C,IAAAD,EAAAC,GAAA7B,UAAA6B,GACN,OAAAC,EAAAJ,EAAKK,UAASjD,KAAIkD,MAAAF,EAAA/B,EAAA,CAAC2B,EAAM1C,GAAU4C,KACrCK,OAAQ,qBAACL,EAAA,GAAAC,EAAA,EAAAA,EAAA7B,UAAAd,OAAA2C,IAAAD,EAAAC,GAAA7B,UAAA6B,GACP,OAAAC,EAAAJ,EAAKQ,WAAUpD,KAAIkD,MAAAF,EAAA/B,EAAA,CAAC2B,EAAM1C,GAAU4C,KACtCO,QAAS,SAACC,GAAqB,OAAAV,EAAKW,WAAWrD,EAAOoD,IACtDE,KAAM,WAAM,OAAAZ,EAAKf,QAAQ3B,IACzBuD,KAAM,WAAM,OAAAb,EAAKd,QAAQ5B,MAI7BkB,EAAAG,UAAAmC,QAAA,SAAQvB,GAAR,IAAAS,EAAAjD,KACE,MAAO,CACLkD,MAAO,qBAACC,EAAA,GAAAC,EAAA,EAAAA,EAAA7B,UAAAd,OAAA2C,IAAAD,EAAAC,GAAA7B,UAAA6B,GACN,OAAAC,EAAAJ,EAAKe,cAAa3D,KAAIkD,MAAAF,EAAA/B,EAAA,CAAC2B,EAAMT,GAAWW,KAC1CK,OAAQ,qBAACL,EAAA,GAAAC,EAAA,EAAAA,EAAA7B,UAAAd,OAAA2C,IAAAD,EAAAC,GAAA7B,UAAA6B,GACP,OAAAC,EAAAJ,EAAKgB,eAAc5D,KAAIkD,MAAAF,EAAA/B,EAAA,CAAC2B,EAAMT,GAAWW,KAC3CO,QAAS,SAACC,GAAqB,OAAAV,EAAKiB,eAAe1B,EAAQmB,IAC3DE,KAAM,WAAM,OAAAZ,EAAKR,YAAYD,IAC7BsB,KAAM,WAAM,OAAAb,EAAKP,YAAYF,MAMjCf,EAAAG,UAAA0B,SAAA,SAAS/C,EAAU4D,EAAoBC,QAAA,IAAAA,IAAAA,EAAAC,GACrC,IAAM/B,EAAWtC,KAAKsE,MAAK,SAAAlC,GAAQ,OAAAgC,EAAUhC,EAAK7B,MAAO4D,MAEzD,OAAO7B,EAAWtC,KAAK+B,OAAOxB,EAAO+B,EAAUA,EAAS5C,MAAQM,KAAKmC,QAAQ5B,IAK/EkB,EAAAG,UAAA6B,UAAA,SAAUlD,EAAUgE,EAAgBH,QAAA,IAAAA,IAAAA,EAAAC,GAClC,IAAM3E,EAAOM,KAAKsE,MAAK,SAAAlC,GAAQ,OAAAgC,EAAUhC,EAAK7B,MAAOgE,MAErD,OAAO7E,EAAOM,KAAK+B,OAAOxB,EAAOb,EAAK4C,SAAU5C,GAAQM,KAAKkC,QAAQ3B,IAGvEkB,EAAAG,UAAAgC,WAAA,SAAWrD,EAAUoD,GACnB,GAAIA,EAAW,EAAGA,GAAY3D,KAAK0B,UAC9B,GAAIiC,GAAY3D,KAAK0B,KAAM,OAAO1B,KAAKmC,QAAQ5B,GAEpD,GAAIoD,GAAY,EAAG,OAAO3D,KAAKkC,QAAQ3B,GAEvC,IAAMb,EAAOM,KAAKwE,IAAIb,GAEtB,OAAO3D,KAAK+B,OAAOxB,EAAOb,EAAK4C,SAAU5C,IAG3C+B,EAAAG,UAAAM,QAAA,SAAQ3B,GACN,IAAM6B,EAAO,IAAIC,EAAS9B,GAU1B,OARA6B,EAAK1C,KAAOM,KAAK6B,MAEb7B,KAAK6B,MAAO7B,KAAK6B,MAAMS,SAAWF,EACjCpC,KAAK8B,KAAOM,EAEjBpC,KAAK6B,MAAQO,EACbpC,KAAK0B,OAEEU,GAGTX,EAAAG,UAAAO,QAAA,SAAQ5B,GACN,IAAM6B,EAAO,IAAIC,EAAS9B,GAa1B,OAXIP,KAAK6B,OACPO,EAAKE,SAAWtC,KAAK8B,KACrB9B,KAAK8B,KAAMpC,KAAO0C,EAClBpC,KAAK8B,KAAOM,IAEZpC,KAAK6B,MAAQO,EACbpC,KAAK8B,KAAOM,GAGdpC,KAAK0B,OAEEU,GAKTX,EAAAG,UAAAoC,aAAA,SACExB,EACA2B,EACAC,QAAA,IAAAA,IAAAA,EAAAC,GAEA,IAAM/B,EAAWtC,KAAKsE,MAAK,SAAAlC,GAAQ,OAAAgC,EAAUhC,EAAK7B,MAAO4D,MAEzD,OAAO7B,EAAWtC,KAAKuC,WAAWC,EAAQF,EAAUA,EAAS5C,MAAQM,KAAK0C,YAAYF,IAKxFf,EAAAG,UAAAqC,cAAA,SACEzB,EACA+B,EACAH,QAAA,IAAAA,IAAAA,EAAAC,GAEA,IAAM3E,EAAOM,KAAKsE,MAAK,SAAAlC,GAAQ,OAAAgC,EAAUhC,EAAK7B,MAAOgE,MAErD,OAAO7E,EAAOM,KAAKuC,WAAWC,EAAQ9C,EAAK4C,SAAU5C,GAAQM,KAAKyC,YAAYD,IAGhFf,EAAAG,UAAAsC,eAAA,SAAe1B,EAAamB,GAG1B,GAFIA,EAAW,IAAGA,GAAY3D,KAAK0B,MAE/BiC,GAAY,EAAG,OAAO3D,KAAKyC,YAAYD,GAE3C,GAAImB,GAAY3D,KAAK0B,KAAM,OAAO1B,KAAK0C,YAAYF,GAEnD,IAAM9C,EAAOM,KAAKwE,IAAIb,GAEtB,OAAO3D,KAAKuC,WAAWC,EAAQ9C,EAAK4C,SAAU5C,IAGhD+B,EAAAG,UAAAa,YAAA,SAAYD,GAAZ,IAAAS,EAAAjD,KACE,OAAOwC,EAAOiC,aAA2B,SAACC,EAAOnE,GAE/C,OADAmE,EAAMC,QAAQ1B,EAAKf,QAAQ3B,IACpBmE,IACN,KAGLjD,EAAAG,UAAAc,YAAA,SAAYF,GAAZ,IAAAS,EAAAjD,KACE,OAAOwC,EAAOoC,KAAI,SAAArE,GAAS,OAAA0C,EAAKd,QAAQ5B,OAG1CkB,EAAAG,UAAAiD,KAAA,WAAA,IAAA5B,EAAAjD,KACE,MAAO,CACL0D,QAAS,SAACC,GAAqB,OAAAV,EAAK6B,YAAYnB,IAChDoB,QAAS,eAAC,IAAA5B,EAAA,GAAAC,EAAA,EAAAA,EAAA7B,UAAAd,OAAA2C,IAAAD,EAAAC,GAAA7B,UAAA6B,GACR,OAAAH,EAAK+B,YAAYzB,MAAMN,EAAME,IAC/B8B,WAAY,eAAC,IAAA9B,EAAA,GAAAC,EAAA,EAAAA,EAAA7B,UAAAd,OAAA2C,IAAAD,EAAAC,GAAA7B,UAAA6B,GACX,OAAAH,EAAKiC,eAAe3B,MAAMN,EAAME,IAClCU,KAAM,WAAM,OAAAZ,EAAKF,YACjBe,KAAM,WAAM,OAAAb,EAAKH,cAIrBrB,EAAAG,UAAAuD,SAAA,SAASC,GAAT,IAAAnC,EAAAjD,KACE,MAAO,CACL0D,QAAS,SAACC,GAAqB,OAAAV,EAAKoC,gBAAgBD,EAAOzB,IAC3DE,KAAM,WAAM,OAAAZ,EAAKqC,aAAaF,IAC9BtB,KAAM,WAAM,OAAAb,EAAKsC,aAAaH,MAIlC3D,EAAAG,UAAAkD,YAAA,SAAYnB,GACNA,EAAW,IAAGA,GAAY3D,KAAK0B,MAEnC,IAAM8D,EAAUxF,KAAKwE,IAAIb,GAEzB,OAAO6B,EAAUxF,KAAK6C,OAAO2C,QAAWC,GAK1ChE,EAAAG,UAAAoD,YAAA,SAAYzE,EAAY6D,QAAA,IAAAA,IAAAA,EAAAC,GACtB,IAAMV,EAAW3D,KAAK0F,WAAU,SAAAtD,GAAQ,OAAAgC,EAAUhC,EAAK7B,MAAOA,MAE9D,OAAOoD,EAAW,OAAI8B,EAAYzF,KAAK8E,YAAYnB,IAKrDlC,EAAAG,UAAAsD,eAAA,SAAe3E,EAAY6D,QAAA,IAAAA,IAAAA,EAAAC,GAGzB,IAFA,IAAMsB,EAAyB,GAEtBH,EAAUxF,KAAK6B,MAAO8B,EAAW,EAAG6B,EAAS7B,IAAY6B,EAAUA,EAAQ9F,KAC9E0E,EAAUoB,EAAQjF,MAAOA,IAC3BoF,EAAQjF,KAAKV,KAAK8E,YAAYnB,EAAWgC,EAAQlF,SAIrD,OAAOkF,GAGTlE,EAAAG,UAAAmB,SAAA,WACE,IAAMc,EAAO7D,KAAK6B,MAElB,GAAIgC,EAQF,OAPA7D,KAAK6B,MAAQgC,EAAKnE,KAEdM,KAAK6B,MAAO7B,KAAK6B,MAAMS,cAAWmD,EACjCzF,KAAK8B,UAAO2D,EAEjBzF,KAAK0B,OAEEmC,GAMXpC,EAAAG,UAAAkB,SAAA,WACE,IAAMgB,EAAO9D,KAAK8B,KAElB,GAAIgC,EAQF,OAPA9D,KAAK8B,KAAOgC,EAAKxB,SAEbtC,KAAK8B,KAAM9B,KAAK8B,KAAKpC,UAAO+F,EAC3BzF,KAAK6B,WAAQ4D,EAElBzF,KAAK0B,OAEEoC,GAMXrC,EAAAG,UAAAyD,gBAAA,SAAgBD,EAAezB,GAC7B,GAAIyB,GAAS,EAAG,MAAO,GAEvB,GAAIzB,EAAW,EAAGA,EAAWiC,KAAKC,IAAIlC,EAAW3D,KAAK0B,KAAM,QACvD,GAAIiC,GAAY3D,KAAK0B,KAAM,MAAO,GAEvC0D,EAAQQ,KAAKE,IAAIV,EAAOpF,KAAK0B,KAAOiC,GAIpC,IAFA,IAAMgC,EAAyB,GAExBP,KAAS,CACd,IAAMI,EAAUxF,KAAKwE,IAAIb,GACzBgC,EAAQjF,KAAKV,KAAK6C,OAAO2C,IAG3B,OAAOG,GAGTlE,EAAAG,UAAA0D,aAAA,SAAaF,GACX,GAAIA,GAAS,EAAG,MAAO,GAEvBA,EAAQQ,KAAKE,IAAIV,EAAOpF,KAAK0B,MAI7B,IAFA,IAAMiE,EAAyB,GAExBP,KAASO,EAAQhB,QAAQ3E,KAAK+C,YAErC,OAAO4C,GAGTlE,EAAAG,UAAA2D,aAAA,SAAaH,GACX,GAAIA,GAAS,EAAG,MAAO,GAEvBA,EAAQQ,KAAKE,IAAIV,EAAOpF,KAAK0B,MAI7B,IAFA,IAAMiE,EAAyB,GAExBP,KAASO,EAAQjF,KAAKV,KAAK8C,YAElC,OAAO6C,GAGTlE,EAAAG,UAAA0C,KAAA,SAAKyB,GACH,IAAK,IAAIP,EAAUxF,KAAK6B,MAAO8B,EAAW,EAAG6B,EAAS7B,IAAY6B,EAAUA,EAAQ9F,KAClF,GAAIqG,EAAUP,EAAS7B,EAAU3D,MAAO,OAAOwF,GAMnD/D,EAAAG,UAAA8D,UAAA,SAAUK,GACR,IAAK,IAAIP,EAAUxF,KAAK6B,MAAO8B,EAAW,EAAG6B,EAAS7B,IAAY6B,EAAUA,EAAQ9F,KAClF,GAAIqG,EAAUP,EAAS7B,EAAU3D,MAAO,OAAO2D,EAGjD,OAAQ,GAGVlC,EAAAG,UAAAoE,QAAA,SAAqBC,GACnB,IAAK,IAAI7D,EAAOpC,KAAK6B,MAAO8B,EAAW,EAAGvB,EAAMuB,IAAYvB,EAAOA,EAAK1C,KACtEuG,EAAW7D,EAAMuB,EAAU3D,OAI/ByB,EAAAG,UAAA4C,IAAA,SAAIb,GACF,OAAO3D,KAAKsE,MAAK,SAACjF,EAAG6G,GAAU,OAAAvC,IAAauC,MAK9CzE,EAAAG,UAAAuE,QAAA,SAAQ5F,EAAY6D,GAClB,YADkB,IAAAA,IAAAA,EAAAC,GACXrE,KAAK0F,WAAU,SAAAtD,GAAQ,OAAAgC,EAAUhC,EAAK7B,MAAOA,OAGtDkB,EAAAG,UAAAwE,QAAA,WACE,IAAMC,EAAQ,IAAIC,MAAMtG,KAAK0B,MAI7B,OAFA1B,KAAKgG,SAAQ,SAAC5D,EAAM8D,GAAU,OAACG,EAAMH,GAAU9D,EAAK7B,SAE7C8F,GAGT5E,EAAAG,UAAAgB,YAAA,WACE,IAAMyD,EAAQ,IAAIC,MAAMtG,KAAK0B,MAI7B,OAFA1B,KAAKgG,SAAQ,SAAC5D,EAAM8D,GAAU,OAACG,EAAMH,GAAU9D,KAExCiE,GAGT5E,EAAAG,UAAA2E,SAAA,SAASC,GACP,YADO,IAAAA,IAAAA,EAA4BC,KAAKC,WACjC1G,KAAKoG,UACTxB,KAAI,SAAArE,GAAS,OAAAiG,EAASjG,MACtBoG,KAAK,UAITlF,EAAAG,UAAC9B,OAAOC,UAAT,mEACWqC,EAAOpC,KAAK6B,MAAkB,0BAAGO,EACxC,CAAA,EAAMA,EAAK7B,OADiC,CAAA,EAAA,UAC5C8C,EAAA9D,+BAD0D6C,EAAOA,EAAK1C","sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","/* tslint:disable:no-non-null-assertion */\r\n\r\nimport compare from 'just-compare';\r\n\r\nexport class ListNode {\r\n next: ListNode | undefined;\r\n previous: ListNode | undefined;\r\n constructor(public readonly value: T) {}\r\n}\r\n\r\nexport class LinkedList {\r\n private first: ListNode | undefined;\r\n private last: ListNode | undefined;\r\n private size = 0;\r\n\r\n get head(): ListNode | undefined {\r\n return this.first;\r\n }\r\n get tail(): ListNode | undefined {\r\n return this.last;\r\n }\r\n get length(): number {\r\n return this.size;\r\n }\r\n\r\n private attach(\r\n value: T,\r\n previousNode: ListNode | undefined,\r\n nextNode: ListNode | undefined,\r\n ): ListNode {\r\n if (!previousNode) return this.addHead(value);\r\n\r\n if (!nextNode) return this.addTail(value);\r\n\r\n const node = new ListNode(value);\r\n node.previous = previousNode;\r\n previousNode.next = node;\r\n node.next = nextNode;\r\n nextNode.previous = node;\r\n\r\n this.size++;\r\n\r\n return node;\r\n }\r\n\r\n private attachMany(\r\n values: T[],\r\n previousNode: ListNode | undefined,\r\n nextNode: ListNode | undefined,\r\n ): ListNode[] {\r\n if (!values.length) return [];\r\n\r\n if (!previousNode) return this.addManyHead(values);\r\n\r\n if (!nextNode) return this.addManyTail(values);\r\n\r\n const list = new LinkedList();\r\n list.addManyTail(values);\r\n list.first!.previous = previousNode;\r\n previousNode.next = list.first;\r\n list.last!.next = nextNode;\r\n nextNode.previous = list.last;\r\n\r\n this.size += values.length;\r\n\r\n return list.toNodeArray();\r\n }\r\n\r\n private detach(node: ListNode) {\r\n if (!node.previous) return this.dropHead();\r\n\r\n if (!node.next) return this.dropTail();\r\n\r\n node.previous.next = node.next;\r\n node.next.previous = node.previous;\r\n\r\n this.size--;\r\n\r\n return node;\r\n }\r\n\r\n add(value: T) {\r\n return {\r\n after: (...params: [T] | [any, ListComparisonFn]) =>\r\n this.addAfter.call(this, value, ...params),\r\n before: (...params: [T] | [any, ListComparisonFn]) =>\r\n this.addBefore.call(this, value, ...params),\r\n byIndex: (position: number) => this.addByIndex(value, position),\r\n head: () => this.addHead(value),\r\n tail: () => this.addTail(value),\r\n };\r\n }\r\n\r\n addMany(values: T[]) {\r\n return {\r\n after: (...params: [T] | [any, ListComparisonFn]) =>\r\n this.addManyAfter.call(this, values, ...params),\r\n before: (...params: [T] | [any, ListComparisonFn]) =>\r\n this.addManyBefore.call(this, values, ...params),\r\n byIndex: (position: number) => this.addManyByIndex(values, position),\r\n head: () => this.addManyHead(values),\r\n tail: () => this.addManyTail(values),\r\n };\r\n }\r\n\r\n addAfter(value: T, previousValue: T): ListNode;\r\n addAfter(value: T, previousValue: any, compareFn: ListComparisonFn): ListNode;\r\n addAfter(value: T, previousValue: any, compareFn: ListComparisonFn = compare): ListNode {\r\n const previous = this.find(node => compareFn(node.value, previousValue));\r\n\r\n return previous ? this.attach(value, previous, previous.next) : this.addTail(value);\r\n }\r\n\r\n addBefore(value: T, nextValue: T): ListNode;\r\n addBefore(value: T, nextValue: any, compareFn: ListComparisonFn): ListNode;\r\n addBefore(value: T, nextValue: any, compareFn: ListComparisonFn = compare): ListNode {\r\n const next = this.find(node => compareFn(node.value, nextValue));\r\n\r\n return next ? this.attach(value, next.previous, next) : this.addHead(value);\r\n }\r\n\r\n addByIndex(value: T, position: number): ListNode {\r\n if (position < 0) position += this.size;\r\n else if (position >= this.size) return this.addTail(value);\r\n\r\n if (position <= 0) return this.addHead(value);\r\n\r\n const next = this.get(position)!;\r\n\r\n return this.attach(value, next.previous, next);\r\n }\r\n\r\n addHead(value: T): ListNode {\r\n const node = new ListNode(value);\r\n\r\n node.next = this.first;\r\n\r\n if (this.first) this.first.previous = node;\r\n else this.last = node;\r\n\r\n this.first = node;\r\n this.size++;\r\n\r\n return node;\r\n }\r\n\r\n addTail(value: T): ListNode {\r\n const node = new ListNode(value);\r\n\r\n if (this.first) {\r\n node.previous = this.last;\r\n this.last!.next = node;\r\n this.last = node;\r\n } else {\r\n this.first = node;\r\n this.last = node;\r\n }\r\n\r\n this.size++;\r\n\r\n return node;\r\n }\r\n\r\n addManyAfter(values: T[], previousValue: T): ListNode[];\r\n addManyAfter(values: T[], previousValue: any, compareFn: ListComparisonFn): ListNode[];\r\n addManyAfter(\r\n values: T[],\r\n previousValue: any,\r\n compareFn: ListComparisonFn = compare,\r\n ): ListNode[] {\r\n const previous = this.find(node => compareFn(node.value, previousValue));\r\n\r\n return previous ? this.attachMany(values, previous, previous.next) : this.addManyTail(values);\r\n }\r\n\r\n addManyBefore(values: T[], nextValue: T): ListNode[];\r\n addManyBefore(values: T[], nextValue: any, compareFn: ListComparisonFn): ListNode[];\r\n addManyBefore(\r\n values: T[],\r\n nextValue: any,\r\n compareFn: ListComparisonFn = compare,\r\n ): ListNode[] {\r\n const next = this.find(node => compareFn(node.value, nextValue));\r\n\r\n return next ? this.attachMany(values, next.previous, next) : this.addManyHead(values);\r\n }\r\n\r\n addManyByIndex(values: T[], position: number): ListNode[] {\r\n if (position < 0) position += this.size;\r\n\r\n if (position <= 0) return this.addManyHead(values);\r\n\r\n if (position >= this.size) return this.addManyTail(values);\r\n\r\n const next = this.get(position)!;\r\n\r\n return this.attachMany(values, next.previous, next);\r\n }\r\n\r\n addManyHead(values: T[]): ListNode[] {\r\n return values.reduceRight[]>((nodes, value) => {\r\n nodes.unshift(this.addHead(value));\r\n return nodes;\r\n }, []);\r\n }\r\n\r\n addManyTail(values: T[]): ListNode[] {\r\n return values.map(value => this.addTail(value));\r\n }\r\n\r\n drop() {\r\n return {\r\n byIndex: (position: number) => this.dropByIndex(position),\r\n byValue: (...params: [T] | [any, ListComparisonFn]) =>\r\n this.dropByValue.apply(this, params),\r\n byValueAll: (...params: [T] | [any, ListComparisonFn]) =>\r\n this.dropByValueAll.apply(this, params),\r\n head: () => this.dropHead(),\r\n tail: () => this.dropTail(),\r\n };\r\n }\r\n\r\n dropMany(count: number) {\r\n return {\r\n byIndex: (position: number) => this.dropManyByIndex(count, position),\r\n head: () => this.dropManyHead(count),\r\n tail: () => this.dropManyTail(count),\r\n };\r\n }\r\n\r\n dropByIndex(position: number): ListNode | undefined {\r\n if (position < 0) position += this.size;\r\n\r\n const current = this.get(position);\r\n\r\n return current ? this.detach(current) : undefined;\r\n }\r\n\r\n dropByValue(value: T): ListNode | undefined;\r\n dropByValue(value: any, compareFn: ListComparisonFn): ListNode | undefined;\r\n dropByValue(value: any, compareFn: ListComparisonFn = compare): ListNode | undefined {\r\n const position = this.findIndex(node => compareFn(node.value, value));\r\n\r\n return position < 0 ? undefined : this.dropByIndex(position);\r\n }\r\n\r\n dropByValueAll(value: T): ListNode[];\r\n dropByValueAll(value: any, compareFn: ListComparisonFn): ListNode[];\r\n dropByValueAll(value: any, compareFn: ListComparisonFn = compare): ListNode[] {\r\n const dropped: ListNode[] = [];\r\n\r\n for (let current = this.first, position = 0; current; position++, current = current.next) {\r\n if (compareFn(current.value, value)) {\r\n dropped.push(this.dropByIndex(position - dropped.length)!);\r\n }\r\n }\r\n\r\n return dropped;\r\n }\r\n\r\n dropHead(): ListNode | undefined {\r\n const head = this.first;\r\n\r\n if (head) {\r\n this.first = head.next;\r\n\r\n if (this.first) this.first.previous = undefined;\r\n else this.last = undefined;\r\n\r\n this.size--;\r\n\r\n return head;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n dropTail(): ListNode | undefined {\r\n const tail = this.last;\r\n\r\n if (tail) {\r\n this.last = tail.previous;\r\n\r\n if (this.last) this.last.next = undefined;\r\n else this.first = undefined;\r\n\r\n this.size--;\r\n\r\n return tail;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n dropManyByIndex(count: number, position: number): ListNode[] {\r\n if (count <= 0) return [];\r\n\r\n if (position < 0) position = Math.max(position + this.size, 0);\r\n else if (position >= this.size) return [];\r\n\r\n count = Math.min(count, this.size - position);\r\n\r\n const dropped: ListNode[] = [];\r\n\r\n while (count--) {\r\n const current = this.get(position);\r\n dropped.push(this.detach(current!)!);\r\n }\r\n\r\n return dropped;\r\n }\r\n\r\n dropManyHead(count: Exclude): ListNode[] {\r\n if (count <= 0) return [];\r\n\r\n count = Math.min(count, this.size);\r\n\r\n const dropped: ListNode[] = [];\r\n\r\n while (count--) dropped.unshift(this.dropHead()!);\r\n\r\n return dropped;\r\n }\r\n\r\n dropManyTail(count: Exclude): ListNode[] {\r\n if (count <= 0) return [];\r\n\r\n count = Math.min(count, this.size);\r\n\r\n const dropped: ListNode[] = [];\r\n\r\n while (count--) dropped.push(this.dropTail()!);\r\n\r\n return dropped;\r\n }\r\n\r\n find(predicate: ListIteratorFn): ListNode | undefined {\r\n for (let current = this.first, position = 0; current; position++, current = current.next) {\r\n if (predicate(current, position, this)) return current;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n findIndex(predicate: ListIteratorFn): number {\r\n for (let current = this.first, position = 0; current; position++, current = current.next) {\r\n if (predicate(current, position, this)) return position;\r\n }\r\n\r\n return -1;\r\n }\r\n\r\n forEach(iteratorFn: ListIteratorFn) {\r\n for (let node = this.first, position = 0; node; position++, node = node.next) {\r\n iteratorFn(node, position, this);\r\n }\r\n }\r\n\r\n get(position: number): ListNode | undefined {\r\n return this.find((_, index) => position === index);\r\n }\r\n\r\n indexOf(value: T): number;\r\n indexOf(value: any, compareFn: ListComparisonFn): number;\r\n indexOf(value: any, compareFn: ListComparisonFn = compare): number {\r\n return this.findIndex(node => compareFn(node.value, value));\r\n }\r\n\r\n toArray(): T[] {\r\n const array = new Array(this.size);\r\n\r\n this.forEach((node, index) => (array[index!] = node.value));\r\n\r\n return array;\r\n }\r\n\r\n toNodeArray(): ListNode[] {\r\n const array = new Array(this.size);\r\n\r\n this.forEach((node, index) => (array[index!] = node));\r\n\r\n return array;\r\n }\r\n\r\n toString(mapperFn: ListMapperFn = JSON.stringify): string {\r\n return this.toArray()\r\n .map(value => mapperFn(value))\r\n .join(' <-> ');\r\n }\r\n\r\n // Cannot use Generator type because of ng-packagr\r\n *[Symbol.iterator](): any {\r\n for (let node = this.first, position = 0; node; position++, node = node.next) {\r\n yield node.value;\r\n }\r\n }\r\n}\r\n\r\nexport type ListMapperFn = (value: T) => any;\r\n\r\nexport type ListComparisonFn = (value1: T, value2: any) => boolean;\r\n\r\nexport type ListIteratorFn = (\r\n node: ListNode,\r\n index?: number,\r\n list?: LinkedList,\r\n) => R;\r\n"]} \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/bootstrap-datepicker.min.css b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/bootstrap-datepicker.min.css index f0194ce03..9d39187a8 100644 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/bootstrap-datepicker.min.css +++ b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/bootstrap-datepicker.min.css @@ -1,7 +1,7 @@ -/*! - * Datepicker for Bootstrap v1.9.0 (https://github.com/uxsolutions/bootstrap-datepicker) - * - * Licensed under the Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0) - */ - +/*! + * Datepicker for Bootstrap v1.10.0 (https://github.com/uxsolutions/bootstrap-datepicker) + * + * Licensed under the Apache License v2.0 (https://www.apache.org/licenses/LICENSE-2.0) + */ + .datepicker{padding:4px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;direction:ltr}.datepicker-inline{width:220px}.datepicker-rtl{direction:rtl}.datepicker-rtl.dropdown-menu{left:auto}.datepicker-rtl table tr td span{float:right}.datepicker-dropdown{top:0;left:0}.datepicker-dropdown:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #999;border-top:0;border-bottom-color:rgba(0,0,0,.2);position:absolute}.datepicker-dropdown:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff;border-top:0;position:absolute}.datepicker-dropdown.datepicker-orient-left:before{left:6px}.datepicker-dropdown.datepicker-orient-left:after{left:7px}.datepicker-dropdown.datepicker-orient-right:before{right:6px}.datepicker-dropdown.datepicker-orient-right:after{right:7px}.datepicker-dropdown.datepicker-orient-bottom:before{top:-7px}.datepicker-dropdown.datepicker-orient-bottom:after{top:-6px}.datepicker-dropdown.datepicker-orient-top:before{bottom:-7px;border-bottom:0;border-top:7px solid #999}.datepicker-dropdown.datepicker-orient-top:after{bottom:-6px;border-bottom:0;border-top:6px solid #fff}.datepicker table{margin:0;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.datepicker td,.datepicker th{text-align:center;width:20px;height:20px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;border:none}.table-striped .datepicker table tr td,.table-striped .datepicker table tr th{background-color:transparent}.datepicker table tr td.day.focused,.datepicker table tr td.day:hover{background:#eee;cursor:pointer}.datepicker table tr td.new,.datepicker table tr td.old{color:#999}.datepicker table tr td.disabled,.datepicker table tr td.disabled:hover{background:0 0;color:#999;cursor:default}.datepicker table tr td.highlighted{background:#d9edf7;border-radius:0}.datepicker table tr td.today,.datepicker table tr td.today.disabled,.datepicker table tr td.today.disabled:hover,.datepicker table tr td.today:hover{background-color:#fde19a;background-image:-moz-linear-gradient(to bottom,#fdd49a,#fdf59a);background-image:-ms-linear-gradient(to bottom,#fdd49a,#fdf59a);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fdd49a),to(#fdf59a));background-image:-webkit-linear-gradient(to bottom,#fdd49a,#fdf59a);background-image:-o-linear-gradient(to bottom,#fdd49a,#fdf59a);background-image:linear-gradient(to bottom,#fdd49a,#fdf59a);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fdd49a', endColorstr='#fdf59a', GradientType=0);border-color:#fdf59a #fdf59a #fbed50;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);color:#000}.datepicker table tr td.today.active,.datepicker table tr td.today.disabled,.datepicker table tr td.today.disabled.active,.datepicker table tr td.today.disabled.disabled,.datepicker table tr td.today.disabled:active,.datepicker table tr td.today.disabled:hover,.datepicker table tr td.today.disabled:hover.active,.datepicker table tr td.today.disabled:hover.disabled,.datepicker table tr td.today.disabled:hover:active,.datepicker table tr td.today.disabled:hover:hover,.datepicker table tr td.today.disabled:hover[disabled],.datepicker table tr td.today.disabled[disabled],.datepicker table tr td.today:active,.datepicker table tr td.today:hover,.datepicker table tr td.today:hover.active,.datepicker table tr td.today:hover.disabled,.datepicker table tr td.today:hover:active,.datepicker table tr td.today:hover:hover,.datepicker table tr td.today:hover[disabled],.datepicker table tr td.today[disabled]{background-color:#fdf59a}.datepicker table tr td.today.active,.datepicker table tr td.today.disabled.active,.datepicker table tr td.today.disabled:active,.datepicker table tr td.today.disabled:hover.active,.datepicker table tr td.today.disabled:hover:active,.datepicker table tr td.today:active,.datepicker table tr td.today:hover.active,.datepicker table tr td.today:hover:active{background-color:#fbf069\9}.datepicker table tr td.today:hover:hover{color:#000}.datepicker table tr td.today.active:hover{color:#fff}.datepicker table tr td.range,.datepicker table tr td.range.disabled,.datepicker table tr td.range.disabled:hover,.datepicker table tr td.range:hover{background:#eee;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.datepicker table tr td.range.today,.datepicker table tr td.range.today.disabled,.datepicker table tr td.range.today.disabled:hover,.datepicker table tr td.range.today:hover{background-color:#f3d17a;background-image:-moz-linear-gradient(to bottom,#f3c17a,#f3e97a);background-image:-ms-linear-gradient(to bottom,#f3c17a,#f3e97a);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f3c17a),to(#f3e97a));background-image:-webkit-linear-gradient(to bottom,#f3c17a,#f3e97a);background-image:-o-linear-gradient(to bottom,#f3c17a,#f3e97a);background-image:linear-gradient(to bottom,#f3c17a,#f3e97a);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f3c17a', endColorstr='#f3e97a', GradientType=0);border-color:#f3e97a #f3e97a #edde34;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.datepicker table tr td.range.today.active,.datepicker table tr td.range.today.disabled,.datepicker table tr td.range.today.disabled.active,.datepicker table tr td.range.today.disabled.disabled,.datepicker table tr td.range.today.disabled:active,.datepicker table tr td.range.today.disabled:hover,.datepicker table tr td.range.today.disabled:hover.active,.datepicker table tr td.range.today.disabled:hover.disabled,.datepicker table tr td.range.today.disabled:hover:active,.datepicker table tr td.range.today.disabled:hover:hover,.datepicker table tr td.range.today.disabled:hover[disabled],.datepicker table tr td.range.today.disabled[disabled],.datepicker table tr td.range.today:active,.datepicker table tr td.range.today:hover,.datepicker table tr td.range.today:hover.active,.datepicker table tr td.range.today:hover.disabled,.datepicker table tr td.range.today:hover:active,.datepicker table tr td.range.today:hover:hover,.datepicker table tr td.range.today:hover[disabled],.datepicker table tr td.range.today[disabled]{background-color:#f3e97a}.datepicker table tr td.range.today.active,.datepicker table tr td.range.today.disabled.active,.datepicker table tr td.range.today.disabled:active,.datepicker table tr td.range.today.disabled:hover.active,.datepicker table tr td.range.today.disabled:hover:active,.datepicker table tr td.range.today:active,.datepicker table tr td.range.today:hover.active,.datepicker table tr td.range.today:hover:active{background-color:#efe24b\9}.datepicker table tr td.selected,.datepicker table tr td.selected.disabled,.datepicker table tr td.selected.disabled:hover,.datepicker table tr td.selected:hover{background-color:#9e9e9e;background-image:-moz-linear-gradient(to bottom,#b3b3b3,grey);background-image:-ms-linear-gradient(to bottom,#b3b3b3,grey);background-image:-webkit-gradient(linear,0 0,0 100%,from(#b3b3b3),to(grey));background-image:-webkit-linear-gradient(to bottom,#b3b3b3,grey);background-image:-o-linear-gradient(to bottom,#b3b3b3,grey);background-image:linear-gradient(to bottom,#b3b3b3,grey);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#b3b3b3', endColorstr='#808080', GradientType=0);border-color:grey grey #595959;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25)}.datepicker table tr td.selected.active,.datepicker table tr td.selected.disabled,.datepicker table tr td.selected.disabled.active,.datepicker table tr td.selected.disabled.disabled,.datepicker table tr td.selected.disabled:active,.datepicker table tr td.selected.disabled:hover,.datepicker table tr td.selected.disabled:hover.active,.datepicker table tr td.selected.disabled:hover.disabled,.datepicker table tr td.selected.disabled:hover:active,.datepicker table tr td.selected.disabled:hover:hover,.datepicker table tr td.selected.disabled:hover[disabled],.datepicker table tr td.selected.disabled[disabled],.datepicker table tr td.selected:active,.datepicker table tr td.selected:hover,.datepicker table tr td.selected:hover.active,.datepicker table tr td.selected:hover.disabled,.datepicker table tr td.selected:hover:active,.datepicker table tr td.selected:hover:hover,.datepicker table tr td.selected:hover[disabled],.datepicker table tr td.selected[disabled]{background-color:grey}.datepicker table tr td.selected.active,.datepicker table tr td.selected.disabled.active,.datepicker table tr td.selected.disabled:active,.datepicker table tr td.selected.disabled:hover.active,.datepicker table tr td.selected.disabled:hover:active,.datepicker table tr td.selected:active,.datepicker table tr td.selected:hover.active,.datepicker table tr td.selected:hover:active{background-color:#666\9}.datepicker table tr td.active,.datepicker table tr td.active.disabled,.datepicker table tr td.active.disabled:hover,.datepicker table tr td.active:hover{background-color:#006dcc;background-image:-moz-linear-gradient(to bottom,#08c,#04c);background-image:-ms-linear-gradient(to bottom,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(to bottom,#08c,#04c);background-image:-o-linear-gradient(to bottom,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#08c', endColorstr='#0044cc', GradientType=0);border-color:#04c #04c #002a80;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25)}.datepicker table tr td.active.active,.datepicker table tr td.active.disabled,.datepicker table tr td.active.disabled.active,.datepicker table tr td.active.disabled.disabled,.datepicker table tr td.active.disabled:active,.datepicker table tr td.active.disabled:hover,.datepicker table tr td.active.disabled:hover.active,.datepicker table tr td.active.disabled:hover.disabled,.datepicker table tr td.active.disabled:hover:active,.datepicker table tr td.active.disabled:hover:hover,.datepicker table tr td.active.disabled:hover[disabled],.datepicker table tr td.active.disabled[disabled],.datepicker table tr td.active:active,.datepicker table tr td.active:hover,.datepicker table tr td.active:hover.active,.datepicker table tr td.active:hover.disabled,.datepicker table tr td.active:hover:active,.datepicker table tr td.active:hover:hover,.datepicker table tr td.active:hover[disabled],.datepicker table tr td.active[disabled]{background-color:#04c}.datepicker table tr td.active.active,.datepicker table tr td.active.disabled.active,.datepicker table tr td.active.disabled:active,.datepicker table tr td.active.disabled:hover.active,.datepicker table tr td.active.disabled:hover:active,.datepicker table tr td.active:active,.datepicker table tr td.active:hover.active,.datepicker table tr td.active:hover:active{background-color:#039\9}.datepicker table tr td span{display:block;width:23%;height:54px;line-height:54px;float:left;margin:1%;cursor:pointer;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.datepicker table tr td span.focused,.datepicker table tr td span:hover{background:#eee}.datepicker table tr td span.disabled,.datepicker table tr td span.disabled:hover{background:0 0;color:#999;cursor:default}.datepicker table tr td span.active,.datepicker table tr td span.active.disabled,.datepicker table tr td span.active.disabled:hover,.datepicker table tr td span.active:hover{background-color:#006dcc;background-image:-moz-linear-gradient(to bottom,#08c,#04c);background-image:-ms-linear-gradient(to bottom,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(to bottom,#08c,#04c);background-image:-o-linear-gradient(to bottom,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#08c', endColorstr='#0044cc', GradientType=0);border-color:#04c #04c #002a80;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25)}.datepicker table tr td span.active.active,.datepicker table tr td span.active.disabled,.datepicker table tr td span.active.disabled.active,.datepicker table tr td span.active.disabled.disabled,.datepicker table tr td span.active.disabled:active,.datepicker table tr td span.active.disabled:hover,.datepicker table tr td span.active.disabled:hover.active,.datepicker table tr td span.active.disabled:hover.disabled,.datepicker table tr td span.active.disabled:hover:active,.datepicker table tr td span.active.disabled:hover:hover,.datepicker table tr td span.active.disabled:hover[disabled],.datepicker table tr td span.active.disabled[disabled],.datepicker table tr td span.active:active,.datepicker table tr td span.active:hover,.datepicker table tr td span.active:hover.active,.datepicker table tr td span.active:hover.disabled,.datepicker table tr td span.active:hover:active,.datepicker table tr td span.active:hover:hover,.datepicker table tr td span.active:hover[disabled],.datepicker table tr td span.active[disabled]{background-color:#04c}.datepicker table tr td span.active.active,.datepicker table tr td span.active.disabled.active,.datepicker table tr td span.active.disabled:active,.datepicker table tr td span.active.disabled:hover.active,.datepicker table tr td span.active.disabled:hover:active,.datepicker table tr td span.active:active,.datepicker table tr td span.active:hover.active,.datepicker table tr td span.active:hover:active{background-color:#039\9}.datepicker table tr td span.new,.datepicker table tr td span.old{color:#999}.datepicker .datepicker-switch{width:145px}.datepicker .datepicker-switch,.datepicker .next,.datepicker .prev,.datepicker tfoot tr th{cursor:pointer}.datepicker .datepicker-switch:hover,.datepicker .next:hover,.datepicker .prev:hover,.datepicker tfoot tr th:hover{background:#eee}.datepicker .next.disabled,.datepicker .prev.disabled{visibility:hidden}.datepicker .cw{font-size:10px;width:12px;padding:0 2px 0 5px;vertical-align:middle}.input-append.date .add-on,.input-prepend.date .add-on{cursor:pointer}.input-append.date .add-on i,.input-prepend.date .add-on i{margin-top:3px}.input-daterange input{text-align:center}.input-daterange input:first-child{-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.input-daterange input:last-child{-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.input-daterange .add-on{display:inline-block;width:auto;min-width:16px;height:18px;padding:4px 5px;font-weight:400;line-height:18px;text-align:center;text-shadow:0 1px 0 #fff;vertical-align:middle;background-color:#eee;border:1px solid #ccc;margin-left:-5px;margin-right:-5px} \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/bootstrap-datepicker.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/bootstrap-datepicker.min.js index eddaff85d..017a3de62 100644 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/bootstrap-datepicker.min.js +++ b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/bootstrap-datepicker.min.js @@ -1,8 +1,8 @@ -/*! - * Datepicker for Bootstrap v1.9.0 (https://github.com/uxsolutions/bootstrap-datepicker) - * - * Licensed under the Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0) - */ - -!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a,b){function c(){return new Date(Date.UTC.apply(Date,arguments))}function d(){var a=new Date;return c(a.getFullYear(),a.getMonth(),a.getDate())}function e(a,b){return a.getUTCFullYear()===b.getUTCFullYear()&&a.getUTCMonth()===b.getUTCMonth()&&a.getUTCDate()===b.getUTCDate()}function f(c,d){return function(){return d!==b&&a.fn.datepicker.deprecated(d),this[c].apply(this,arguments)}}function g(a){return a&&!isNaN(a.getTime())}function h(b,c){function d(a,b){return b.toLowerCase()}var e,f=a(b).data(),g={},h=new RegExp("^"+c.toLowerCase()+"([A-Z])");c=new RegExp("^"+c.toLowerCase());for(var i in f)c.test(i)&&(e=i.replace(h,d),g[e]=f[i]);return g}function i(b){var c={};if(q[b]||(b=b.split("-")[0],q[b])){var d=q[b];return a.each(p,function(a,b){b in d&&(c[b]=d[b])}),c}}var j=function(){var b={get:function(a){return this.slice(a)[0]},contains:function(a){for(var b=a&&a.valueOf(),c=0,d=this.length;c]/g)||[]).length<=0)return!0;return a(c).length>0}catch(a){return!1}},_process_options:function(b){this._o=a.extend({},this._o,b);var e=this.o=a.extend({},this._o),f=e.language;q[f]||(f=f.split("-")[0],q[f]||(f=o.language)),e.language=f,e.startView=this._resolveViewName(e.startView),e.minViewMode=this._resolveViewName(e.minViewMode),e.maxViewMode=this._resolveViewName(e.maxViewMode),e.startView=Math.max(this.o.minViewMode,Math.min(this.o.maxViewMode,e.startView)),!0!==e.multidate&&(e.multidate=Number(e.multidate)||!1,!1!==e.multidate&&(e.multidate=Math.max(0,e.multidate))),e.multidateSeparator=String(e.multidateSeparator),e.weekStart%=7,e.weekEnd=(e.weekStart+6)%7;var g=r.parseFormat(e.format);e.startDate!==-1/0&&(e.startDate?e.startDate instanceof Date?e.startDate=this._local_to_utc(this._zero_time(e.startDate)):e.startDate=r.parseDate(e.startDate,g,e.language,e.assumeNearbyYear):e.startDate=-1/0),e.endDate!==1/0&&(e.endDate?e.endDate instanceof Date?e.endDate=this._local_to_utc(this._zero_time(e.endDate)):e.endDate=r.parseDate(e.endDate,g,e.language,e.assumeNearbyYear):e.endDate=1/0),e.daysOfWeekDisabled=this._resolveDaysOfWeek(e.daysOfWeekDisabled||[]),e.daysOfWeekHighlighted=this._resolveDaysOfWeek(e.daysOfWeekHighlighted||[]),e.datesDisabled=e.datesDisabled||[],a.isArray(e.datesDisabled)||(e.datesDisabled=e.datesDisabled.split(",")),e.datesDisabled=a.map(e.datesDisabled,function(a){return r.parseDate(a,g,e.language,e.assumeNearbyYear)});var h=String(e.orientation).toLowerCase().split(/\s+/g),i=e.orientation.toLowerCase();if(h=a.grep(h,function(a){return/^auto|left|right|top|bottom$/.test(a)}),e.orientation={x:"auto",y:"auto"},i&&"auto"!==i)if(1===h.length)switch(h[0]){case"top":case"bottom":e.orientation.y=h[0];break;case"left":case"right":e.orientation.x=h[0]}else i=a.grep(h,function(a){return/^left|right$/.test(a)}),e.orientation.x=i[0]||"auto",i=a.grep(h,function(a){return/^top|bottom$/.test(a)}),e.orientation.y=i[0]||"auto";else;if(e.defaultViewDate instanceof Date||"string"==typeof e.defaultViewDate)e.defaultViewDate=r.parseDate(e.defaultViewDate,g,e.language,e.assumeNearbyYear);else if(e.defaultViewDate){var j=e.defaultViewDate.year||(new Date).getFullYear(),k=e.defaultViewDate.month||0,l=e.defaultViewDate.day||1;e.defaultViewDate=c(j,k,l)}else e.defaultViewDate=d()},_applyEvents:function(a){for(var c,d,e,f=0;fe?(this.picker.addClass("datepicker-orient-right"),m+=l-b):this.o.rtl?this.picker.addClass("datepicker-orient-right"):this.picker.addClass("datepicker-orient-left");var o,p=this.o.orientation.y;if("auto"===p&&(o=-f+n-c,p=o<0?"bottom":"top"),this.picker.addClass("datepicker-orient-"+p),"top"===p?n-=c+parseInt(this.picker.css("padding-top")):n+=k,this.o.rtl){var q=e-(m+l);this.picker.css({top:n,right:q,zIndex:i})}else this.picker.css({top:n,left:m,zIndex:i});return this},_allow_update:!0,update:function(){if(!this._allow_update)return this;var b=this.dates.copy(),c=[],d=!1;return arguments.length?(a.each(arguments,a.proxy(function(a,b){b instanceof Date&&(b=this._local_to_utc(b)),c.push(b)},this)),d=!0):(c=this.isInput?this.element.val():this.element.data("date")||this.inputField.val(),c=c&&this.o.multidate?c.split(this.o.multidateSeparator):[c],delete this.element.data().date),c=a.map(c,a.proxy(function(a){return r.parseDate(a,this.o.format,this.o.language,this.o.assumeNearbyYear)},this)),c=a.grep(c,a.proxy(function(a){return!this.dateWithinRange(a)||!a},this),!0),this.dates.replace(c),this.o.updateViewDate&&(this.dates.length?this.viewDate=new Date(this.dates.get(-1)):this.viewDatethis.o.endDate?this.viewDate=new Date(this.o.endDate):this.viewDate=this.o.defaultViewDate),d?(this.setValue(),this.element.change()):this.dates.length&&String(b)!==String(this.dates)&&d&&(this._trigger("changeDate"),this.element.change()),!this.dates.length&&b.length&&(this._trigger("clearDate"),this.element.change()),this.fill(),this},fillDow:function(){if(this.o.showWeekDays){var b=this.o.weekStart,c="";for(this.o.calendarWeeks&&(c+=' ');b";c+="",this.picker.find(".datepicker-days thead").append(c)}},fillMonths:function(){for(var a,b=this._utc_to_local(this.viewDate),c="",d=0;d<12;d++)a=b&&b.getMonth()===d?" focused":"",c+=''+q[this.o.language].monthsShort[d]+"";this.picker.find(".datepicker-months td").html(c)},setRange:function(b){b&&b.length?this.range=a.map(b,function(a){return a.valueOf()}):delete this.range,this.fill()},getClassNames:function(b){var c=[],f=this.viewDate.getUTCFullYear(),g=this.viewDate.getUTCMonth(),h=d();return b.getUTCFullYear()f||b.getUTCFullYear()===f&&b.getUTCMonth()>g)&&c.push("new"),this.focusDate&&b.valueOf()===this.focusDate.valueOf()&&c.push("focused"),this.o.todayHighlight&&e(b,h)&&c.push("today"),-1!==this.dates.contains(b)&&c.push("active"),this.dateWithinRange(b)||c.push("disabled"),this.dateIsDisabled(b)&&c.push("disabled","disabled-date"),-1!==a.inArray(b.getUTCDay(),this.o.daysOfWeekHighlighted)&&c.push("highlighted"),this.range&&(b>this.range[0]&&bh)&&j.push("disabled"),t===r&&j.push("focused"),i!==a.noop&&(l=i(new Date(t,0,1)),l===b?l={}:"boolean"==typeof l?l={enabled:l}:"string"==typeof l&&(l={classes:l}),!1===l.enabled&&j.push("disabled"),l.classes&&(j=j.concat(l.classes.split(/\s+/))),l.tooltip&&(k=l.tooltip)),m+='"+t+"";o.find(".datepicker-switch").text(p+"-"+q),o.find("td").html(m)},fill:function(){var e,f,g=new Date(this.viewDate),h=g.getUTCFullYear(),i=g.getUTCMonth(),j=this.o.startDate!==-1/0?this.o.startDate.getUTCFullYear():-1/0,k=this.o.startDate!==-1/0?this.o.startDate.getUTCMonth():-1/0,l=this.o.endDate!==1/0?this.o.endDate.getUTCFullYear():1/0,m=this.o.endDate!==1/0?this.o.endDate.getUTCMonth():1/0,n=q[this.o.language].today||q.en.today||"",o=q[this.o.language].clear||q.en.clear||"",p=q[this.o.language].titleFormat||q.en.titleFormat,s=d(),t=(!0===this.o.todayBtn||"linked"===this.o.todayBtn)&&s>=this.o.startDate&&s<=this.o.endDate&&!this.weekOfDateIsDisabled(s);if(!isNaN(h)&&!isNaN(i)){this.picker.find(".datepicker-days .datepicker-switch").text(r.formatDate(g,p,this.o.language)),this.picker.find("tfoot .today").text(n).css("display",t?"table-cell":"none"),this.picker.find("tfoot .clear").text(o).css("display",!0===this.o.clearBtn?"table-cell":"none"),this.picker.find("thead .datepicker-title").text(this.o.title).css("display","string"==typeof this.o.title&&""!==this.o.title?"table-cell":"none"),this.updateNavArrows(),this.fillMonths();var u=c(h,i,0),v=u.getUTCDate();u.setUTCDate(v-(u.getUTCDay()-this.o.weekStart+7)%7);var w=new Date(u);u.getUTCFullYear()<100&&w.setUTCFullYear(u.getUTCFullYear()),w.setUTCDate(w.getUTCDate()+42),w=w.valueOf();for(var x,y,z=[];u.valueOf()"),this.o.calendarWeeks)){var A=new Date(+u+(this.o.weekStart-x-7)%7*864e5),B=new Date(Number(A)+(11-A.getUTCDay())%7*864e5),C=new Date(Number(C=c(B.getUTCFullYear(),0,1))+(11-C.getUTCDay())%7*864e5),D=(B-C)/864e5/7+1;z.push(''+D+"")}y=this.getClassNames(u),y.push("day");var E=u.getUTCDate();this.o.beforeShowDay!==a.noop&&(f=this.o.beforeShowDay(this._utc_to_local(u)),f===b?f={}:"boolean"==typeof f?f={enabled:f}:"string"==typeof f&&(f={classes:f}),!1===f.enabled&&y.push("disabled"),f.classes&&(y=y.concat(f.classes.split(/\s+/))),f.tooltip&&(e=f.tooltip),f.content&&(E=f.content)),y=a.isFunction(a.uniqueSort)?a.uniqueSort(y):a.unique(y),z.push(''+E+""),e=null,x===this.o.weekEnd&&z.push(""),u.setUTCDate(u.getUTCDate()+1)}this.picker.find(".datepicker-days tbody").html(z.join(""));var F=q[this.o.language].monthsTitle||q.en.monthsTitle||"Months",G=this.picker.find(".datepicker-months").find(".datepicker-switch").text(this.o.maxViewMode<2?F:h).end().find("tbody span").removeClass("active");if(a.each(this.dates,function(a,b){b.getUTCFullYear()===h&&G.eq(b.getUTCMonth()).addClass("active")}),(hl)&&G.addClass("disabled"),h===j&&G.slice(0,k).addClass("disabled"),h===l&&G.slice(m+1).addClass("disabled"),this.o.beforeShowMonth!==a.noop){var H=this;a.each(G,function(c,d){var e=new Date(h,c,1),f=H.o.beforeShowMonth(e);f===b?f={}:"boolean"==typeof f?f={enabled:f}:"string"==typeof f&&(f={classes:f}),!1!==f.enabled||a(d).hasClass("disabled")||a(d).addClass("disabled"),f.classes&&a(d).addClass(f.classes),f.tooltip&&a(d).prop("title",f.tooltip)})}this._fill_yearsView(".datepicker-years","year",10,h,j,l,this.o.beforeShowYear),this._fill_yearsView(".datepicker-decades","decade",100,h,j,l,this.o.beforeShowDecade),this._fill_yearsView(".datepicker-centuries","century",1e3,h,j,l,this.o.beforeShowCentury)}},updateNavArrows:function(){if(this._allow_update){var a,b,c=new Date(this.viewDate),d=c.getUTCFullYear(),e=c.getUTCMonth(),f=this.o.startDate!==-1/0?this.o.startDate.getUTCFullYear():-1/0,g=this.o.startDate!==-1/0?this.o.startDate.getUTCMonth():-1/0,h=this.o.endDate!==1/0?this.o.endDate.getUTCFullYear():1/0,i=this.o.endDate!==1/0?this.o.endDate.getUTCMonth():1/0,j=1;switch(this.viewMode){case 4:j*=10;case 3:j*=10;case 2:j*=10;case 1:a=Math.floor(d/j)*j<=f,b=Math.floor(d/j)*j+j>h;break;case 0:a=d<=f&&e<=g,b=d>=h&&e>=i}this.picker.find(".prev").toggleClass("disabled",a),this.picker.find(".next").toggleClass("disabled",b)}},click:function(b){b.preventDefault(),b.stopPropagation();var e,f,g,h;e=a(b.target),e.hasClass("datepicker-switch")&&this.viewMode!==this.o.maxViewMode&&this.setViewMode(this.viewMode+1),e.hasClass("today")&&!e.hasClass("day")&&(this.setViewMode(0),this._setDate(d(),"linked"===this.o.todayBtn?null:"view")),e.hasClass("clear")&&this.clearDates(),e.hasClass("disabled")||(e.hasClass("month")||e.hasClass("year")||e.hasClass("decade")||e.hasClass("century"))&&(this.viewDate.setUTCDate(1),f=1,1===this.viewMode?(h=e.parent().find("span").index(e),g=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(h)):(h=0,g=Number(e.text()),this.viewDate.setUTCFullYear(g)),this._trigger(r.viewModes[this.viewMode-1].e,this.viewDate),this.viewMode===this.o.minViewMode?this._setDate(c(g,h,f)):(this.setViewMode(this.viewMode-1),this.fill())),this.picker.is(":visible")&&this._focused_from&&this._focused_from.focus(),delete this._focused_from},dayCellClick:function(b){var c=a(b.currentTarget),d=c.data("date"),e=new Date(d);this.o.updateViewDate&&(e.getUTCFullYear()!==this.viewDate.getUTCFullYear()&&this._trigger("changeYear",this.viewDate),e.getUTCMonth()!==this.viewDate.getUTCMonth()&&this._trigger("changeMonth",this.viewDate)),this._setDate(e)},navArrowsClick:function(b){var c=a(b.currentTarget),d=c.hasClass("prev")?-1:1;0!==this.viewMode&&(d*=12*r.viewModes[this.viewMode].navStep),this.viewDate=this.moveMonth(this.viewDate,d),this._trigger(r.viewModes[this.viewMode].e,this.viewDate),this.fill()},_toggle_multidate:function(a){var b=this.dates.contains(a);if(a||this.dates.clear(),-1!==b?(!0===this.o.multidate||this.o.multidate>1||this.o.toggleActive)&&this.dates.remove(b):!1===this.o.multidate?(this.dates.clear(),this.dates.push(a)):this.dates.push(a),"number"==typeof this.o.multidate)for(;this.dates.length>this.o.multidate;)this.dates.remove(0)},_setDate:function(a,b){b&&"date"!==b||this._toggle_multidate(a&&new Date(a)),(!b&&this.o.updateViewDate||"view"===b)&&(this.viewDate=a&&new Date(a)),this.fill(),this.setValue(),b&&"view"===b||this._trigger("changeDate"),this.inputField.trigger("change"),!this.o.autoclose||b&&"date"!==b||this.hide()},moveDay:function(a,b){var c=new Date(a);return c.setUTCDate(a.getUTCDate()+b),c},moveWeek:function(a,b){return this.moveDay(a,7*b)},moveMonth:function(a,b){if(!g(a))return this.o.defaultViewDate;if(!b)return a;var c,d,e=new Date(a.valueOf()),f=e.getUTCDate(),h=e.getUTCMonth(),i=Math.abs(b);if(b=b>0?1:-1,1===i)d=-1===b?function(){return e.getUTCMonth()===h}:function(){return e.getUTCMonth()!==c},c=h+b,e.setUTCMonth(c),c=(c+12)%12;else{for(var j=0;j0},dateWithinRange:function(a){return a>=this.o.startDate&&a<=this.o.endDate},keydown:function(a){if(!this.picker.is(":visible"))return void(40!==a.keyCode&&27!==a.keyCode||(this.show(),a.stopPropagation()));var b,c,d=!1,e=this.focusDate||this.viewDate;switch(a.keyCode){case 27:this.focusDate?(this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill()):this.hide(),a.preventDefault(),a.stopPropagation();break;case 37:case 38:case 39:case 40:if(!this.o.keyboardNavigation||7===this.o.daysOfWeekDisabled.length)break;b=37===a.keyCode||38===a.keyCode?-1:1,0===this.viewMode?a.ctrlKey?(c=this.moveAvailableDate(e,b,"moveYear"))&&this._trigger("changeYear",this.viewDate):a.shiftKey?(c=this.moveAvailableDate(e,b,"moveMonth"))&&this._trigger("changeMonth",this.viewDate):37===a.keyCode||39===a.keyCode?c=this.moveAvailableDate(e,b,"moveDay"):this.weekOfDateIsDisabled(e)||(c=this.moveAvailableDate(e,b,"moveWeek")):1===this.viewMode?(38!==a.keyCode&&40!==a.keyCode||(b*=4),c=this.moveAvailableDate(e,b,"moveMonth")):2===this.viewMode&&(38!==a.keyCode&&40!==a.keyCode||(b*=4),c=this.moveAvailableDate(e,b,"moveYear")),c&&(this.focusDate=this.viewDate=c,this.setValue(),this.fill(),a.preventDefault());break;case 13:if(!this.o.forceParse)break;e=this.focusDate||this.dates.get(-1)||this.viewDate,this.o.keyboardNavigation&&(this._toggle_multidate(e),d=!0),this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.setValue(),this.fill(),this.picker.is(":visible")&&(a.preventDefault(),a.stopPropagation(),this.o.autoclose&&this.hide());break;case 9:this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill(),this.hide()}d&&(this.dates.length?this._trigger("changeDate"):this._trigger("clearDate"),this.inputField.trigger("change"))},setViewMode:function(a){this.viewMode=a,this.picker.children("div").hide().filter(".datepicker-"+r.viewModes[this.viewMode].clsName).show(),this.updateNavArrows(),this._trigger("changeViewMode",new Date(this.viewDate))}};var l=function(b,c){a.data(b,"datepicker",this),this.element=a(b),this.inputs=a.map(c.inputs,function(a){return a.jquery?a[0]:a}),delete c.inputs,this.keepEmptyValues=c.keepEmptyValues,delete c.keepEmptyValues,n.call(a(this.inputs),c).on("changeDate",a.proxy(this.dateUpdated,this)),this.pickers=a.map(this.inputs,function(b){return a.data(b,"datepicker")}),this.updateDates()};l.prototype={updateDates:function(){this.dates=a.map(this.pickers,function(a){return a.getUTCDate()}),this.updateRanges()},updateRanges:function(){var b=a.map(this.dates,function(a){return a.valueOf()});a.each(this.pickers,function(a,c){c.setRange(b)})},clearDates:function(){a.each(this.pickers,function(a,b){b.clearDates()})},dateUpdated:function(c){if(!this.updating){this.updating=!0;var d=a.data(c.target,"datepicker");if(d!==b){var e=d.getUTCDate(),f=this.keepEmptyValues,g=a.inArray(c.target,this.inputs),h=g-1,i=g+1,j=this.inputs.length;if(-1!==g){if(a.each(this.pickers,function(a,b){b.getUTCDate()||b!==d&&f||b.setUTCDate(e)}),e=0&&ethis.dates[i])for(;ithis.dates[i];)this.pickers[i++].setUTCDate(e);this.updateDates(),delete this.updating}}}},destroy:function(){a.map(this.pickers,function(a){a.destroy()}),a(this.inputs).off("changeDate",this.dateUpdated),delete this.element.data().datepicker},remove:f("destroy","Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead")};var m=a.fn.datepicker,n=function(c){var d=Array.apply(null,arguments);d.shift();var e;if(this.each(function(){var b=a(this),f=b.data("datepicker"),g="object"==typeof c&&c;if(!f){var j=h(this,"date"),m=a.extend({},o,j,g),n=i(m.language),p=a.extend({},o,n,j,g);b.hasClass("input-daterange")||p.inputs?(a.extend(p,{inputs:p.inputs||b.find("input").toArray()}),f=new l(this,p)):f=new k(this,p),b.data("datepicker",f)}"string"==typeof c&&"function"==typeof f[c]&&(e=f[c].apply(f,d))}),e===b||e instanceof k||e instanceof l)return this;if(this.length>1)throw new Error("Using only allowed for the collection of a single element ("+c+" function)");return e};a.fn.datepicker=n;var o=a.fn.datepicker.defaults={assumeNearbyYear:!1,autoclose:!1,beforeShowDay:a.noop,beforeShowMonth:a.noop,beforeShowYear:a.noop,beforeShowDecade:a.noop,beforeShowCentury:a.noop,calendarWeeks:!1,clearBtn:!1,toggleActive:!1,daysOfWeekDisabled:[],daysOfWeekHighlighted:[],datesDisabled:[],endDate:1/0,forceParse:!0,format:"mm/dd/yyyy",keepEmptyValues:!1,keyboardNavigation:!0,language:"en",minViewMode:0,maxViewMode:4,multidate:!1,multidateSeparator:",",orientation:"auto",rtl:!1,startDate:-1/0,startView:0,todayBtn:!1,todayHighlight:!1,updateViewDate:!0,weekStart:0,disableTouchKeyboard:!1,enableOnReadonly:!0,showOnFocus:!0,zIndexOffset:10,container:"body",immediateUpdates:!1,title:"",templates:{leftArrow:"«",rightArrow:"»"},showWeekDays:!0},p=a.fn.datepicker.locale_opts=["format","rtl","weekStart"];a.fn.datepicker.Constructor=k;var q=a.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",titleFormat:"MM yyyy"}},r={viewModes:[{names:["days","month"],clsName:"days",e:"changeMonth"},{names:["months","year"],clsName:"months",e:"changeYear",navStep:1},{names:["years","decade"],clsName:"years",e:"changeDecade",navStep:10},{names:["decades","century"],clsName:"decades",e:"changeCentury",navStep:100},{names:["centuries","millennium"],clsName:"centuries",e:"changeMillennium",navStep:1e3}],validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\u5e74\u6708\u65e5\[-`{-~\t\n\r]+/g,parseFormat:function(a){if("function"==typeof a.toValue&&"function"==typeof a.toDisplay)return a;var b=a.replace(this.validParts,"\0").split("\0"),c=a.match(this.validParts);if(!b||!b.length||!c||0===c.length)throw new Error("Invalid date format.");return{separators:b,parts:c}},parseDate:function(c,e,f,g){function h(a,b){return!0===b&&(b=10),a<100&&(a+=2e3)>(new Date).getFullYear()+b&&(a-=100),a}function i(){var a=this.slice(0,j[n].length),b=j[n].slice(0,a.length);return a.toLowerCase()===b.toLowerCase()}if(!c)return b;if(c instanceof Date)return c;if("string"==typeof e&&(e=r.parseFormat(e)),e.toValue)return e.toValue(c,e,f);var j,l,m,n,o,p={d:"moveDay",m:"moveMonth",w:"moveWeek",y:"moveYear"},s={yesterday:"-1d",today:"+0d",tomorrow:"+1d"};if(c in s&&(c=s[c]),/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/i.test(c)){for(j=c.match(/([\-+]\d+)([dmwy])/gi),c=new Date,n=0;n'+o.templates.leftArrow+''+o.templates.rightArrow+"",contTemplate:'',footTemplate:''};r.template='
'+r.headTemplate+""+r.footTemplate+'
'+r.headTemplate+r.contTemplate+r.footTemplate+'
'+r.headTemplate+r.contTemplate+r.footTemplate+'
'+r.headTemplate+r.contTemplate+r.footTemplate+'
'+r.headTemplate+r.contTemplate+r.footTemplate+"
",a.fn.datepicker.DPGlobal=r,a.fn.datepicker.noConflict=function(){return a.fn.datepicker=m,this},a.fn.datepicker.version="1.9.0",a.fn.datepicker.deprecated=function(a){var b=window.console;b&&b.warn&&b.warn("DEPRECATED: "+a)},a(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(b){var c=a(this);c.data("datepicker")||(b.preventDefault(),n.call(c,"show"))}),a(function(){n.call(a('[data-provide="datepicker-inline"]'))})}); \ No newline at end of file +/*! + * Datepicker for Bootstrap v1.10.0 (https://github.com/uxsolutions/bootstrap-datepicker) + * + * Licensed under the Apache License v2.0 (https://www.apache.org/licenses/LICENSE-2.0) + */ + +!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a,b){function c(){return new Date(Date.UTC.apply(Date,arguments))}function d(){var a=new Date;return c(a.getFullYear(),a.getMonth(),a.getDate())}function e(a,b){return a.getUTCFullYear()===b.getUTCFullYear()&&a.getUTCMonth()===b.getUTCMonth()&&a.getUTCDate()===b.getUTCDate()}function f(c,d){return function(){return d!==b&&a.fn.datepicker.deprecated(d),this[c].apply(this,arguments)}}function g(a){return a&&!isNaN(a.getTime())}function h(b,c){function d(a,b){return b.toLowerCase()}var e,f=a(b).data(),g={},h=new RegExp("^"+c.toLowerCase()+"([A-Z])");c=new RegExp("^"+c.toLowerCase());for(var i in f)c.test(i)&&(e=i.replace(h,d),g[e]=f[i]);return g}function i(b){var c={};if(q[b]||(b=b.split("-")[0],q[b])){var d=q[b];return a.each(p,function(a,b){b in d&&(c[b]=d[b])}),c}}var j=function(){var b={get:function(a){return this.slice(a)[0]},contains:function(a){for(var b=a&&a.valueOf(),c=0,d=this.length;c]/g)||[]).length<=0)return!0;return a(c).length>0}catch(a){return!1}},_process_options:function(b){this._o=a.extend({},this._o,b);var e=this.o=a.extend({},this._o),f=e.language;q[f]||(f=f.split("-")[0],q[f]||(f=o.language)),e.language=f,e.startView=this._resolveViewName(e.startView),e.minViewMode=this._resolveViewName(e.minViewMode),e.maxViewMode=this._resolveViewName(e.maxViewMode),e.startView=Math.max(this.o.minViewMode,Math.min(this.o.maxViewMode,e.startView)),!0!==e.multidate&&(e.multidate=Number(e.multidate)||!1,!1!==e.multidate&&(e.multidate=Math.max(0,e.multidate))),e.multidateSeparator=String(e.multidateSeparator),e.weekStart%=7,e.weekEnd=(e.weekStart+6)%7;var g=r.parseFormat(e.format);e.startDate!==-1/0&&(e.startDate?e.startDate instanceof Date?e.startDate=this._local_to_utc(this._zero_time(e.startDate)):e.startDate=r.parseDate(e.startDate,g,e.language,e.assumeNearbyYear):e.startDate=-1/0),e.endDate!==1/0&&(e.endDate?e.endDate instanceof Date?e.endDate=this._local_to_utc(this._zero_time(e.endDate)):e.endDate=r.parseDate(e.endDate,g,e.language,e.assumeNearbyYear):e.endDate=1/0),e.daysOfWeekDisabled=this._resolveDaysOfWeek(e.daysOfWeekDisabled||[]),e.daysOfWeekHighlighted=this._resolveDaysOfWeek(e.daysOfWeekHighlighted||[]),e.datesDisabled=e.datesDisabled||[],Array.isArray(e.datesDisabled)||(e.datesDisabled=e.datesDisabled.split(",")),e.datesDisabled=a.map(e.datesDisabled,function(a){return r.parseDate(a,g,e.language,e.assumeNearbyYear)});var h=String(e.orientation).toLowerCase().split(/\s+/g),i=e.orientation.toLowerCase();if(h=a.grep(h,function(a){return/^auto|left|right|top|bottom$/.test(a)}),e.orientation={x:"auto",y:"auto"},i&&"auto"!==i)if(1===h.length)switch(h[0]){case"top":case"bottom":e.orientation.y=h[0];break;case"left":case"right":e.orientation.x=h[0]}else i=a.grep(h,function(a){return/^left|right$/.test(a)}),e.orientation.x=i[0]||"auto",i=a.grep(h,function(a){return/^top|bottom$/.test(a)}),e.orientation.y=i[0]||"auto";else;if(e.defaultViewDate instanceof Date||"string"==typeof e.defaultViewDate)e.defaultViewDate=r.parseDate(e.defaultViewDate,g,e.language,e.assumeNearbyYear);else if(e.defaultViewDate){var j=e.defaultViewDate.year||(new Date).getFullYear(),k=e.defaultViewDate.month||0,l=e.defaultViewDate.day||1;e.defaultViewDate=c(j,k,l)}else e.defaultViewDate=d()},_applyEvents:function(a){for(var c,d,e,f=0;fe?(this.picker.addClass("datepicker-orient-right"),m+=l-b):this.o.rtl?this.picker.addClass("datepicker-orient-right"):this.picker.addClass("datepicker-orient-left");var o,p=this.o.orientation.y;if("auto"===p&&(o=-f+n-c,p=o<0?"bottom":"top"),this.picker.addClass("datepicker-orient-"+p),"top"===p?n-=c+parseInt(this.picker.css("padding-top")):n+=k,this.o.rtl){var q=e-(m+l);this.picker.css({top:n,right:q,zIndex:i})}else this.picker.css({top:n,left:m,zIndex:i});return this},_allow_update:!0,update:function(){if(!this._allow_update)return this;var b=this.dates.copy(),c=[],d=!1;return arguments.length?(a.each(arguments,a.proxy(function(a,b){b instanceof Date&&(b=this._local_to_utc(b)),c.push(b)},this)),d=!0):(c=this.isInput?this.element.val():this.element.data("date")||this.inputField.val(),c=c&&this.o.multidate?c.split(this.o.multidateSeparator):[c],delete this.element.data().date),c=a.map(c,a.proxy(function(a){return r.parseDate(a,this.o.format,this.o.language,this.o.assumeNearbyYear)},this)),c=a.grep(c,a.proxy(function(a){return!this.dateWithinRange(a)||!a},this),!0),this.dates.replace(c),this.o.updateViewDate&&(this.dates.length?this.viewDate=new Date(this.dates.get(-1)):this.viewDatethis.o.endDate?this.viewDate=new Date(this.o.endDate):this.viewDate=this.o.defaultViewDate),d?(this.setValue(),this.element.change()):this.dates.length&&String(b)!==String(this.dates)&&d&&(this._trigger("changeDate"),this.element.change()),!this.dates.length&&b.length&&(this._trigger("clearDate"),this.element.change()),this.fill(),this},fillDow:function(){if(this.o.showWeekDays){var b=this.o.weekStart,c="";for(this.o.calendarWeeks&&(c+=' ');b";c+="",this.picker.find(".datepicker-days thead").append(c)}},fillMonths:function(){for(var a,b=this._utc_to_local(this.viewDate),c="",d=0;d<12;d++)a=b&&b.getMonth()===d?" focused":"",c+=''+q[this.o.language].monthsShort[d]+"";this.picker.find(".datepicker-months td").html(c)},setRange:function(b){b&&b.length?this.range=a.map(b,function(a){return a.valueOf()}):delete this.range,this.fill()},getClassNames:function(b){var c=[],f=this.viewDate.getUTCFullYear(),g=this.viewDate.getUTCMonth(),h=d();return b.getUTCFullYear()f||b.getUTCFullYear()===f&&b.getUTCMonth()>g)&&c.push("new"),this.focusDate&&b.valueOf()===this.focusDate.valueOf()&&c.push("focused"),this.o.todayHighlight&&e(b,h)&&c.push("today"),-1!==this.dates.contains(b)&&c.push("active"),this.dateWithinRange(b)||c.push("disabled"),this.dateIsDisabled(b)&&c.push("disabled","disabled-date"),-1!==a.inArray(b.getUTCDay(),this.o.daysOfWeekHighlighted)&&c.push("highlighted"),this.range&&(b>this.range[0]&&bh)&&j.push("disabled"),t===r&&j.push("focused"),i!==a.noop&&(l=i(new Date(t,0,1)),l===b?l={}:"boolean"==typeof l?l={enabled:l}:"string"==typeof l&&(l={classes:l}),!1===l.enabled&&j.push("disabled"),l.classes&&(j=j.concat(l.classes.split(/\s+/))),l.tooltip&&(k=l.tooltip)),m+='"+t+"";o.find(".datepicker-switch").text(p+"-"+q),o.find("td").html(m)},fill:function(){var e,f,g=new Date(this.viewDate),h=g.getUTCFullYear(),i=g.getUTCMonth(),j=this.o.startDate!==-1/0?this.o.startDate.getUTCFullYear():-1/0,k=this.o.startDate!==-1/0?this.o.startDate.getUTCMonth():-1/0,l=this.o.endDate!==1/0?this.o.endDate.getUTCFullYear():1/0,m=this.o.endDate!==1/0?this.o.endDate.getUTCMonth():1/0,n=q[this.o.language].today||q.en.today||"",o=q[this.o.language].clear||q.en.clear||"",p=q[this.o.language].titleFormat||q.en.titleFormat,s=d(),t=(!0===this.o.todayBtn||"linked"===this.o.todayBtn)&&s>=this.o.startDate&&s<=this.o.endDate&&!this.weekOfDateIsDisabled(s);if(!isNaN(h)&&!isNaN(i)){this.picker.find(".datepicker-days .datepicker-switch").text(r.formatDate(g,p,this.o.language)),this.picker.find("tfoot .today").text(n).css("display",t?"table-cell":"none"),this.picker.find("tfoot .clear").text(o).css("display",!0===this.o.clearBtn?"table-cell":"none"),this.picker.find("thead .datepicker-title").text(this.o.title).css("display","string"==typeof this.o.title&&""!==this.o.title?"table-cell":"none"),this.updateNavArrows(),this.fillMonths();var u=c(h,i,0),v=u.getUTCDate();u.setUTCDate(v-(u.getUTCDay()-this.o.weekStart+7)%7);var w=new Date(u);u.getUTCFullYear()<100&&w.setUTCFullYear(u.getUTCFullYear()),w.setUTCDate(w.getUTCDate()+42),w=w.valueOf();for(var x,y,z=[];u.valueOf()"),this.o.calendarWeeks)){var A=new Date(+u+(this.o.weekStart-x-7)%7*864e5),B=new Date(Number(A)+(11-A.getUTCDay())%7*864e5),C=new Date(Number(C=c(B.getUTCFullYear(),0,1))+(11-C.getUTCDay())%7*864e5),D=(B-C)/864e5/7+1;z.push(''+D+"")}y=this.getClassNames(u),y.push("day");var E=u.getUTCDate();this.o.beforeShowDay!==a.noop&&(f=this.o.beforeShowDay(this._utc_to_local(u)),f===b?f={}:"boolean"==typeof f?f={enabled:f}:"string"==typeof f&&(f={classes:f}),!1===f.enabled&&y.push("disabled"),f.classes&&(y=y.concat(f.classes.split(/\s+/))),f.tooltip&&(e=f.tooltip),f.content&&(E=f.content)),y="function"==typeof a.uniqueSort?a.uniqueSort(y):a.unique(y),z.push(''+E+""),e=null,x===this.o.weekEnd&&z.push(""),u.setUTCDate(u.getUTCDate()+1)}this.picker.find(".datepicker-days tbody").html(z.join(""));var F=q[this.o.language].monthsTitle||q.en.monthsTitle||"Months",G=this.picker.find(".datepicker-months").find(".datepicker-switch").text(this.o.maxViewMode<2?F:h).end().find("tbody span").removeClass("active");if(a.each(this.dates,function(a,b){b.getUTCFullYear()===h&&G.eq(b.getUTCMonth()).addClass("active")}),(hl)&&G.addClass("disabled"),h===j&&G.slice(0,k).addClass("disabled"),h===l&&G.slice(m+1).addClass("disabled"),this.o.beforeShowMonth!==a.noop){var H=this;a.each(G,function(c,d){var e=new Date(h,c,1),f=H.o.beforeShowMonth(e);f===b?f={}:"boolean"==typeof f?f={enabled:f}:"string"==typeof f&&(f={classes:f}),!1!==f.enabled||a(d).hasClass("disabled")||a(d).addClass("disabled"),f.classes&&a(d).addClass(f.classes),f.tooltip&&a(d).prop("title",f.tooltip)})}this._fill_yearsView(".datepicker-years","year",10,h,j,l,this.o.beforeShowYear),this._fill_yearsView(".datepicker-decades","decade",100,h,j,l,this.o.beforeShowDecade),this._fill_yearsView(".datepicker-centuries","century",1e3,h,j,l,this.o.beforeShowCentury)}},updateNavArrows:function(){if(this._allow_update){var a,b,c=new Date(this.viewDate),d=c.getUTCFullYear(),e=c.getUTCMonth(),f=this.o.startDate!==-1/0?this.o.startDate.getUTCFullYear():-1/0,g=this.o.startDate!==-1/0?this.o.startDate.getUTCMonth():-1/0,h=this.o.endDate!==1/0?this.o.endDate.getUTCFullYear():1/0,i=this.o.endDate!==1/0?this.o.endDate.getUTCMonth():1/0,j=1;switch(this.viewMode){case 4:j*=10;case 3:j*=10;case 2:j*=10;case 1:a=Math.floor(d/j)*j<=f,b=Math.floor(d/j)*j+j>h;break;case 0:a=d<=f&&e<=g,b=d>=h&&e>=i}this.picker.find(".prev").toggleClass("disabled",a),this.picker.find(".next").toggleClass("disabled",b)}},click:function(b){b.preventDefault(),b.stopPropagation();var e,f,g,h;e=a(b.target),e.hasClass("datepicker-switch")&&this.viewMode!==this.o.maxViewMode&&this.setViewMode(this.viewMode+1),e.hasClass("today")&&!e.hasClass("day")&&(this.setViewMode(0),this._setDate(d(),"linked"===this.o.todayBtn?null:"view")),e.hasClass("clear")&&this.clearDates(),e.hasClass("disabled")||(e.hasClass("month")||e.hasClass("year")||e.hasClass("decade")||e.hasClass("century"))&&(this.viewDate.setUTCDate(1),f=1,1===this.viewMode?(h=e.parent().find("span").index(e),g=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(h)):(h=0,g=Number(e.text()),this.viewDate.setUTCFullYear(g)),this._trigger(r.viewModes[this.viewMode-1].e,this.viewDate),this.viewMode===this.o.minViewMode?this._setDate(c(g,h,f)):(this.setViewMode(this.viewMode-1),this.fill())),this.picker.is(":visible")&&this._focused_from&&this._focused_from.focus(),delete this._focused_from},dayCellClick:function(b){var c=a(b.currentTarget),d=c.data("date"),e=new Date(d);this.o.updateViewDate&&(e.getUTCFullYear()!==this.viewDate.getUTCFullYear()&&this._trigger("changeYear",this.viewDate),e.getUTCMonth()!==this.viewDate.getUTCMonth()&&this._trigger("changeMonth",this.viewDate)),this._setDate(e)},navArrowsClick:function(b){var c=a(b.currentTarget),d=c.hasClass("prev")?-1:1;0!==this.viewMode&&(d*=12*r.viewModes[this.viewMode].navStep),this.viewDate=this.moveMonth(this.viewDate,d),this._trigger(r.viewModes[this.viewMode].e,this.viewDate),this.fill()},_toggle_multidate:function(a){var b=this.dates.contains(a);if(a||this.dates.clear(),-1!==b?(!0===this.o.multidate||this.o.multidate>1||this.o.toggleActive)&&this.dates.remove(b):!1===this.o.multidate?(this.dates.clear(),this.dates.push(a)):this.dates.push(a),"number"==typeof this.o.multidate)for(;this.dates.length>this.o.multidate;)this.dates.remove(0)},_setDate:function(a,b){b&&"date"!==b||this._toggle_multidate(a&&new Date(a)),(!b&&this.o.updateViewDate||"view"===b)&&(this.viewDate=a&&new Date(a)),this.fill(),this.setValue(),b&&"view"===b||this._trigger("changeDate"),this.inputField.trigger("change"),!this.o.autoclose||b&&"date"!==b||this.hide()},moveDay:function(a,b){var c=new Date(a);return c.setUTCDate(a.getUTCDate()+b),c},moveWeek:function(a,b){return this.moveDay(a,7*b)},moveMonth:function(a,b){if(!g(a))return this.o.defaultViewDate;if(!b)return a;var c,d,e=new Date(a.valueOf()),f=e.getUTCDate(),h=e.getUTCMonth(),i=Math.abs(b);if(b=b>0?1:-1,1===i)d=-1===b?function(){return e.getUTCMonth()===h}:function(){return e.getUTCMonth()!==c},c=h+b,e.setUTCMonth(c),c=(c+12)%12;else{for(var j=0;j0},dateWithinRange:function(a){return a>=this.o.startDate&&a<=this.o.endDate},keydown:function(a){if(!this.picker.is(":visible"))return void(40!==a.keyCode&&27!==a.keyCode||(this.show(),a.stopPropagation()));var b,c,d=!1,e=this.focusDate||this.viewDate;switch(a.keyCode){case 27:this.focusDate?(this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill()):this.hide(),a.preventDefault(),a.stopPropagation();break;case 37:case 38:case 39:case 40:if(!this.o.keyboardNavigation||7===this.o.daysOfWeekDisabled.length)break;b=37===a.keyCode||38===a.keyCode?-1:1,0===this.viewMode?a.ctrlKey?(c=this.moveAvailableDate(e,b,"moveYear"))&&this._trigger("changeYear",this.viewDate):a.shiftKey?(c=this.moveAvailableDate(e,b,"moveMonth"))&&this._trigger("changeMonth",this.viewDate):37===a.keyCode||39===a.keyCode?c=this.moveAvailableDate(e,b,"moveDay"):this.weekOfDateIsDisabled(e)||(c=this.moveAvailableDate(e,b,"moveWeek")):1===this.viewMode?(38!==a.keyCode&&40!==a.keyCode||(b*=4),c=this.moveAvailableDate(e,b,"moveMonth")):2===this.viewMode&&(38!==a.keyCode&&40!==a.keyCode||(b*=4),c=this.moveAvailableDate(e,b,"moveYear")),c&&(this.focusDate=this.viewDate=c,this.setValue(),this.fill(),a.preventDefault());break;case 13:if(!this.o.forceParse)break;e=this.focusDate||this.dates.get(-1)||this.viewDate,this.o.keyboardNavigation&&(this._toggle_multidate(e),d=!0),this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.setValue(),this.fill(),this.picker.is(":visible")&&(a.preventDefault(),a.stopPropagation(),this.o.autoclose&&this.hide());break;case 9:this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill(),this.hide()}d&&(this.dates.length?this._trigger("changeDate"):this._trigger("clearDate"),this.inputField.trigger("change"))},setViewMode:function(a){this.viewMode=a,this.picker.children("div").hide().filter(".datepicker-"+r.viewModes[this.viewMode].clsName).show(),this.updateNavArrows(),this._trigger("changeViewMode",new Date(this.viewDate))}};var l=function(b,c){a.data(b,"datepicker",this),this.element=a(b),this.inputs=a.map(c.inputs,function(a){return a.jquery?a[0]:a}),delete c.inputs,this.keepEmptyValues=c.keepEmptyValues,delete c.keepEmptyValues,n.call(a(this.inputs),c).on("changeDate",a.proxy(this.dateUpdated,this)),this.pickers=a.map(this.inputs,function(b){return a.data(b,"datepicker")}),this.updateDates()};l.prototype={updateDates:function(){this.dates=a.map(this.pickers,function(a){return a.getUTCDate()}),this.updateRanges()},updateRanges:function(){var b=a.map(this.dates,function(a){return a.valueOf()});a.each(this.pickers,function(a,c){c.setRange(b)})},clearDates:function(){a.each(this.pickers,function(a,b){b.clearDates()})},dateUpdated:function(c){if(!this.updating){this.updating=!0;var d=a.data(c.target,"datepicker");if(d!==b){var e=d.getUTCDate(),f=this.keepEmptyValues,g=a.inArray(c.target,this.inputs),h=g-1,i=g+1,j=this.inputs.length;if(-1!==g){if(a.each(this.pickers,function(a,b){b.getUTCDate()||b!==d&&f||b.setUTCDate(e)}),e=0&&e0;)this.pickers[h--].setUTCDate(e);else if(e>this.dates[i])for(;ithis.dates[i]&&(this.pickers[i].element.val()||"").length>0;)this.pickers[i++].setUTCDate(e);this.updateDates(),delete this.updating}}}},destroy:function(){a.map(this.pickers,function(a){a.destroy()}),a(this.inputs).off("changeDate",this.dateUpdated),delete this.element.data().datepicker},remove:f("destroy","Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead")};var m=a.fn.datepicker,n=function(c){var d=Array.apply(null,arguments);d.shift();var e;if(this.each(function(){var b=a(this),f=b.data("datepicker"),g="object"==typeof c&&c;if(!f){var j=h(this,"date"),m=a.extend({},o,j,g),n=i(m.language),p=a.extend({},o,n,j,g);b.hasClass("input-daterange")||p.inputs?(a.extend(p,{inputs:p.inputs||b.find("input").toArray()}),f=new l(this,p)):f=new k(this,p),b.data("datepicker",f)}"string"==typeof c&&"function"==typeof f[c]&&(e=f[c].apply(f,d))}),e===b||e instanceof k||e instanceof l)return this;if(this.length>1)throw new Error("Using only allowed for the collection of a single element ("+c+" function)");return e};a.fn.datepicker=n;var o=a.fn.datepicker.defaults={assumeNearbyYear:!1,autoclose:!1,beforeShowDay:a.noop,beforeShowMonth:a.noop,beforeShowYear:a.noop,beforeShowDecade:a.noop,beforeShowCentury:a.noop,calendarWeeks:!1,clearBtn:!1,toggleActive:!1,daysOfWeekDisabled:[],daysOfWeekHighlighted:[],datesDisabled:[],endDate:1/0,forceParse:!0,format:"mm/dd/yyyy",isInline:null,keepEmptyValues:!1,keyboardNavigation:!0,language:"en",minViewMode:0,maxViewMode:4,multidate:!1,multidateSeparator:",",orientation:"auto",rtl:!1,startDate:-1/0,startView:0,todayBtn:!1,todayHighlight:!1,updateViewDate:!0,weekStart:0,disableTouchKeyboard:!1,enableOnReadonly:!0,showOnFocus:!0,zIndexOffset:10,container:"body",immediateUpdates:!1,title:"",templates:{leftArrow:"«",rightArrow:"»"},showWeekDays:!0},p=a.fn.datepicker.locale_opts=["format","rtl","weekStart"];a.fn.datepicker.Constructor=k;var q=a.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",titleFormat:"MM yyyy"}},r={viewModes:[{names:["days","month"],clsName:"days",e:"changeMonth"},{names:["months","year"],clsName:"months",e:"changeYear",navStep:1},{names:["years","decade"],clsName:"years",e:"changeDecade",navStep:10},{names:["decades","century"],clsName:"decades",e:"changeCentury",navStep:100},{names:["centuries","millennium"],clsName:"centuries",e:"changeMillennium",navStep:1e3}],validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\u5e74\u6708\u65e5\[-`{-~\t\n\r]+/g,parseFormat:function(a){if("function"==typeof a.toValue&&"function"==typeof a.toDisplay)return a;var b=a.replace(this.validParts,"\0").split("\0"),c=a.match(this.validParts);if(!b||!b.length||!c||0===c.length)throw new Error("Invalid date format.");return{separators:b,parts:c}},parseDate:function(c,e,f,g){function h(a,b){return!0===b&&(b=10),a<100&&(a+=2e3)>(new Date).getFullYear()+b&&(a-=100),a}function i(){var a=this.slice(0,j[n].length),b=j[n].slice(0,a.length);return a.toLowerCase()===b.toLowerCase()}if(!c)return b;if(c instanceof Date)return c;if("string"==typeof e&&(e=r.parseFormat(e)),e.toValue)return e.toValue(c,e,f);var j,l,m,n,o,p={d:"moveDay",m:"moveMonth",w:"moveWeek",y:"moveYear"},s={yesterday:"-1d",today:"+0d",tomorrow:"+1d"};if(c in s&&(c=s[c]),/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/i.test(c)){for(j=c.match(/([\-+]\d+)([dmwy])/gi),c=new Date,n=0;n'+o.templates.leftArrow+''+o.templates.rightArrow+"",contTemplate:'',footTemplate:''};r.template='
'+r.headTemplate+""+r.footTemplate+'
'+r.headTemplate+r.contTemplate+r.footTemplate+'
'+r.headTemplate+r.contTemplate+r.footTemplate+'
'+r.headTemplate+r.contTemplate+r.footTemplate+'
'+r.headTemplate+r.contTemplate+r.footTemplate+"
",a.fn.datepicker.DPGlobal=r,a.fn.datepicker.noConflict=function(){return a.fn.datepicker=m,this},a.fn.datepicker.version="1.10.0",a.fn.datepicker.deprecated=function(a){var b=window.console;b&&b.warn&&b.warn("DEPRECATED: "+a)},a(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(b){var c=a(this);c.data("datepicker")||(b.preventDefault(),n.call(c,"show"))}),a(function(){n.call(a('[data-provide="datepicker-inline"]'))})}); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.ca.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.ca.min.js index ac107894c..d21351866 100644 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.ca.min.js +++ b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.ca.min.js @@ -1 +1 @@ -!function(a){a.fn.datepicker.dates.ca={days:["Diumenge","Dilluns","Dimarts","Dimecres","Dijous","Divendres","Dissabte"],daysShort:["Diu","Dil","Dmt","Dmc","Dij","Div","Dis"],daysMin:["dg","dl","dt","dc","dj","dv","ds"],months:["Gener","Febrer","Març","Abril","Maig","Juny","Juliol","Agost","Setembre","Octubre","Novembre","Desembre"],monthsShort:["Gen","Feb","Mar","Abr","Mai","Jun","Jul","Ago","Set","Oct","Nov","Des"],today:"Avui",monthsTitle:"Mesos",clear:"Esborrar",weekStart:1,format:"dd/mm/yyyy"}}(jQuery); \ No newline at end of file +!function(a){a.fn.datepicker.dates.ca={days:["diumenge","dilluns","dimarts","dimecres","dijous","divendres","dissabte"],daysShort:["dg.","dl.","dt.","dc.","dj.","dv.","ds."],daysMin:["dg","dl","dt","dc","dj","dv","ds"],months:["gener","febrer","març","abril","maig","juny","juliol","agost","setembre","octubre","novembre","desembre"],monthsShort:["gen.","febr.","març","abr.","maig","juny","jul.","ag.","set.","oct.","nov.","des."],today:"Avui",monthsTitle:"Mesos",clear:"Esborra",weekStart:1,format:"dd/mm/yyyy"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.de.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.de.min.js index 1b5d6a247..c76f75d37 100644 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.de.min.js +++ b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.de.min.js @@ -1 +1 @@ -!function(a){a.fn.datepicker.dates.de={days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],daysShort:["Son","Mon","Die","Mit","Don","Fre","Sam"],daysMin:["So","Mo","Di","Mi","Do","Fr","Sa"],months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthsShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute",monthsTitle:"Monate",clear:"Löschen",weekStart:1,format:"dd.mm.yyyy"}}(jQuery); \ No newline at end of file +!function(a){a.fn.datepicker.dates.de={days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],daysShort:["So","Mo","Di","Mi","Do","Fr","Sa"],daysMin:["So","Mo","Di","Mi","Do","Fr","Sa"],months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthsShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute",monthsTitle:"Monate",clear:"Löschen",weekStart:1,format:"dd.mm.yyyy"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.fi.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.fi.min.js index 239dfb796..33af3d3eb 100644 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.fi.min.js +++ b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.fi.min.js @@ -1 +1 @@ -!function(a){a.fn.datepicker.dates.fi={days:["sunnuntai","maanantai","tiistai","keskiviikko","torstai","perjantai","lauantai"],daysShort:["sun","maa","tii","kes","tor","per","lau"],daysMin:["su","ma","ti","ke","to","pe","la"],months:["tammikuu","helmikuu","maaliskuu","huhtikuu","toukokuu","kesäkuu","heinäkuu","elokuu","syyskuu","lokakuu","marraskuu","joulukuu"],monthsShort:["tam","hel","maa","huh","tou","kes","hei","elo","syy","lok","mar","jou"],today:"tänään",clear:"Tyhjennä",weekStart:1,format:"d.m.yyyy"}}(jQuery); \ No newline at end of file +!function(a){a.fn.datepicker.dates.fi={days:["sunnuntai","maanantai","tiistai","keskiviikko","torstai","perjantai","lauantai"],daysShort:["sun","maa","tii","kes","tor","per","lau"],daysMin:["su","ma","ti","ke","to","pe","la"],months:["tammikuu","helmikuu","maaliskuu","huhtikuu","toukokuu","kesäkuu","heinäkuu","elokuu","syyskuu","lokakuu","marraskuu","joulukuu"],monthsShort:["tammi","helmi","maalis","huhti","touko","kesä","heinä","elo","syys","loka","marras","joulu"],today:"tänään",clear:"Tyhjennä",weekStart:1,format:"d.m.yyyy"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.hi.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.hi.min.js deleted file mode 100644 index 635baffa8..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.hi.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.hi={days:["रविवार","सोमवार","मंगलवार","बुधवार","गुरुवार","शुक्रवार","शनिवार"],daysShort:["सूर्य","सोम","मंगल","बुध","गुरु","शुक्र","शनि"],daysMin:["र","सो","मं","बु","गु","शु","श"],months:["जनवरी","फ़रवरी","मार्च","अप्रैल","मई","जून","जुलाई","अगस्त","सितम्बर","अक्टूबर","नवंबर","दिसम्बर"],monthsShort:["जन","फ़रवरी","मार्च","अप्रैल","मई","जून","जुलाई","अगस्त","सितं","अक्टूबर","नवं","दिसम्बर"],today:"आज",monthsTitle:"महीने",clear:"साफ",weekStart:1,format:"dd / mm / yyyy"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.hr.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.hr.min.js deleted file mode 100644 index 8b34bce0f..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.hr.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.hr={days:["Nedjelja","Ponedjeljak","Utorak","Srijeda","Četvrtak","Petak","Subota"],daysShort:["Ned","Pon","Uto","Sri","Čet","Pet","Sub"],daysMin:["Ne","Po","Ut","Sr","Če","Pe","Su"],months:["Siječanj","Veljača","Ožujak","Travanj","Svibanj","Lipanj","Srpanj","Kolovoz","Rujan","Listopad","Studeni","Prosinac"],monthsShort:["Sij","Velj","Ožu","Tra","Svi","Lip","Srp","Kol","Ruj","Lis","Stu","Pro"],today:"Danas"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.hu.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.hu.min.js deleted file mode 100644 index f9decf9a2..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.hu.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.hu={days:["vasárnap","hétfő","kedd","szerda","csütörtök","péntek","szombat"],daysShort:["vas","hét","ked","sze","csü","pén","szo"],daysMin:["V","H","K","Sze","Cs","P","Szo"],months:["január","február","március","április","május","június","július","augusztus","szeptember","október","november","december"],monthsShort:["jan","feb","már","ápr","máj","jún","júl","aug","sze","okt","nov","dec"],today:"ma",weekStart:1,clear:"töröl",titleFormat:"yyyy. MM",format:"yyyy.mm.dd"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.hy.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.hy.min.js deleted file mode 100644 index a1cf653d3..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.hy.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.hy={days:["Կիրակի","Երկուշաբթի","Երեքշաբթի","Չորեքշաբթի","Հինգշաբթի","Ուրբաթ","Շաբաթ"],daysShort:["Կիր","Երկ","Երե","Չոր","Հին","Ուրբ","Շաբ"],daysMin:["Կի","Եկ","Եք","Չո","Հի","Ու","Շա"],months:["Հունվար","Փետրվար","Մարտ","Ապրիլ","Մայիս","Հունիս","Հուլիս","Օգոստոս","Սեպտեմբեր","Հոկտեմբեր","Նոյեմբեր","Դեկտեմբեր"],monthsShort:["Հնվ","Փետ","Մար","Ապր","Մայ","Հուն","Հուլ","Օգս","Սեպ","Հոկ","Նոյ","Դեկ"],today:"Այսօր",clear:"Ջնջել",format:"dd.mm.yyyy",weekStart:1,monthsTitle:"Ամիսնէր"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.id.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.id.min.js deleted file mode 100644 index 7c3220a64..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.id.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.id={days:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"],daysShort:["Mgu","Sen","Sel","Rab","Kam","Jum","Sab"],daysMin:["Mg","Sn","Sl","Ra","Ka","Ju","Sa"],months:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Ags","Sep","Okt","Nov","Des"],today:"Hari Ini",clear:"Kosongkan"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.is.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.is.min.js deleted file mode 100644 index f49bd18cc..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.is.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.is={days:["Sunnudagur","Mánudagur","Þriðjudagur","Miðvikudagur","Fimmtudagur","Föstudagur","Laugardagur"],daysShort:["Sun","Mán","Þri","Mið","Fim","Fös","Lau"],daysMin:["Su","Má","Þr","Mi","Fi","Fö","La"],months:["Janúar","Febrúar","Mars","Apríl","Maí","Júní","Júlí","Ágúst","September","Október","Nóvember","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Maí","Jún","Júl","Ágú","Sep","Okt","Nóv","Des"],today:"Í Dag"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.it-CH.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.it-CH.min.js deleted file mode 100644 index 7e1adbb95..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.it-CH.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.it={days:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato"],daysShort:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"],daysMin:["Do","Lu","Ma","Me","Gi","Ve","Sa"],months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],monthsShort:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"],today:"Oggi",clear:"Cancella",weekStart:1,format:"dd.mm.yyyy"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.it.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.it.min.js deleted file mode 100644 index cc30766ff..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.it.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.it={days:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato"],daysShort:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"],daysMin:["Do","Lu","Ma","Me","Gi","Ve","Sa"],months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],monthsShort:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"],today:"Oggi",monthsTitle:"Mesi",clear:"Cancella",weekStart:1,format:"dd/mm/yyyy"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.ja.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.ja.min.js deleted file mode 100644 index e321f04ff..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.ja.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.ja={days:["日曜","月曜","火曜","水曜","木曜","金曜","土曜"],daysShort:["日","月","火","水","木","金","土"],daysMin:["日","月","火","水","木","金","土"],months:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],monthsShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],today:"今日",format:"yyyy/mm/dd",titleFormat:"yyyy年mm月",clear:"クリア"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.ka.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.ka.min.js deleted file mode 100644 index 84f14c0e9..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.ka.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.ka={days:["კვირა","ორშაბათი","სამშაბათი","ოთხშაბათი","ხუთშაბათი","პარასკევი","შაბათი"],daysShort:["კვი","ორშ","სამ","ოთხ","ხუთ","პარ","შაბ"],daysMin:["კვ","ორ","სა","ოთ","ხუ","პა","შა"],months:["იანვარი","თებერვალი","მარტი","აპრილი","მაისი","ივნისი","ივლისი","აგვისტო","სექტემბერი","ოქტომბერი","ნოემბერი","დეკემბერი"],monthsShort:["იან","თებ","მარ","აპრ","მაი","ივნ","ივლ","აგვ","სექ","ოქტ","ნოე","დეკ"],today:"დღეს",clear:"გასუფთავება",weekStart:1,format:"dd.mm.yyyy"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.kh.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.kh.min.js deleted file mode 100644 index bf2abc5d8..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.kh.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.kh={days:["អាទិត្យ","ចន្ទ","អង្គារ","ពុធ","ព្រហស្បតិ៍","សុក្រ","សៅរ៍"],daysShort:["អា.ទិ","ចន្ទ","អង្គារ","ពុធ","ព្រ.ហ","សុក្រ","សៅរ៍"],daysMin:["អា.ទិ","ចន្ទ","អង្គារ","ពុធ","ព្រ.ហ","សុក្រ","សៅរ៍"],months:["មករា","កុម្ភះ","មិនា","មេសា","ឧសភា","មិថុនា","កក្កដា","សីហា","កញ្ញា","តុលា","វិច្ឆិកា","ធ្នូ"],monthsShort:["មករា","កុម្ភះ","មិនា","មេសា","ឧសភា","មិថុនា","កក្កដា","សីហា","កញ្ញា","តុលា","វិច្ឆិកា","ធ្នូ"],today:"ថ្ងៃនេះ",clear:"សំអាត"},a.fn.datepicker.deprecated('The language code "kh" is deprecated and will be removed in 2.0. For Khmer support use "km" instead.')}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.kk.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.kk.min.js deleted file mode 100644 index f4e2f3f1a..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.kk.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.kk={days:["Жексенбі","Дүйсенбі","Сейсенбі","Сәрсенбі","Бейсенбі","Жұма","Сенбі"],daysShort:["Жек","Дүй","Сей","Сәр","Бей","Жұм","Сен"],daysMin:["Жк","Дс","Сс","Ср","Бс","Жм","Сн"],months:["Қаңтар","Ақпан","Наурыз","Сәуір","Мамыр","Маусым","Шілде","Тамыз","Қыркүйек","Қазан","Қараша","Желтоқсан"],monthsShort:["Қаң","Ақп","Нау","Сәу","Мам","Мау","Шіл","Там","Қыр","Қаз","Қар","Жел"],today:"Бүгін",weekStart:1}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.km.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.km.min.js deleted file mode 100644 index 648d83f84..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.km.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.km={days:["អាទិត្យ","ចន្ទ","អង្គារ","ពុធ","ព្រហស្បតិ៍","សុក្រ","សៅរ៍"],daysShort:["អា.ទិ","ចន្ទ","អង្គារ","ពុធ","ព្រ.ហ","សុក្រ","សៅរ៍"],daysMin:["អា.ទិ","ចន្ទ","អង្គារ","ពុធ","ព្រ.ហ","សុក្រ","សៅរ៍"],months:["មករា","កុម្ភះ","មិនា","មេសា","ឧសភា","មិថុនា","កក្កដា","សីហា","កញ្ញា","តុលា","វិច្ឆិកា","ធ្នូ"],monthsShort:["មករា","កុម្ភះ","មិនា","មេសា","ឧសភា","មិថុនា","កក្កដា","សីហា","កញ្ញា","តុលា","វិច្ឆិកា","ធ្នូ"],today:"ថ្ងៃនេះ",clear:"សំអាត"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.ko.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.ko.min.js deleted file mode 100644 index 9751ee5c2..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.ko.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.ko={days:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],daysShort:["일","월","화","수","목","금","토"],daysMin:["일","월","화","수","목","금","토"],months:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],monthsShort:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],today:"오늘",clear:"삭제",format:"yyyy-mm-dd",titleFormat:"yyyy년mm월",weekStart:0}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.kr.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.kr.min.js deleted file mode 100644 index 43393409e..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.kr.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.kr={days:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],daysShort:["일","월","화","수","목","금","토"],daysMin:["일","월","화","수","목","금","토"],months:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],monthsShort:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"]},a.fn.datepicker.deprecated('The language code "kr" is deprecated and will be removed in 2.0. For korean support use "ko" instead.')}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.lt.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.lt.min.js deleted file mode 100644 index da78ea85f..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.lt.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.lt={days:["Sekmadienis","Pirmadienis","Antradienis","Trečiadienis","Ketvirtadienis","Penktadienis","Šeštadienis"],daysShort:["S","Pr","A","T","K","Pn","Š"],daysMin:["Sk","Pr","An","Tr","Ke","Pn","Št"],months:["Sausis","Vasaris","Kovas","Balandis","Gegužė","Birželis","Liepa","Rugpjūtis","Rugsėjis","Spalis","Lapkritis","Gruodis"],monthsShort:["Sau","Vas","Kov","Bal","Geg","Bir","Lie","Rugp","Rugs","Spa","Lap","Gru"],today:"Šiandien",monthsTitle:"Mėnesiai",clear:"Išvalyti",weekStart:1,format:"yyyy-mm-dd"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.lv.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.lv.min.js deleted file mode 100644 index 89cea00f8..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.lv.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.lv={days:["Svētdiena","Pirmdiena","Otrdiena","Trešdiena","Ceturtdiena","Piektdiena","Sestdiena"],daysShort:["Sv","P","O","T","C","Pk","S"],daysMin:["Sv","Pr","Ot","Tr","Ce","Pk","Se"],months:["Janvāris","Februāris","Marts","Aprīlis","Maijs","Jūnijs","Jūlijs","Augusts","Septembris","Oktobris","Novembris","Decembris"],monthsShort:["Jan","Feb","Mar","Apr","Mai","Jūn","Jūl","Aug","Sep","Okt","Nov","Dec"],monthsTitle:"Mēneši",today:"Šodien",clear:"Nodzēst",weekStart:1}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.me.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.me.min.js deleted file mode 100644 index c65a89164..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.me.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.me={days:["Nedjelja","Ponedjeljak","Utorak","Srijeda","Četvrtak","Petak","Subota"],daysShort:["Ned","Pon","Uto","Sri","Čet","Pet","Sub"],daysMin:["Ne","Po","Ut","Sr","Če","Pe","Su"],months:["Januar","Februar","Mart","April","Maj","Jun","Jul","Avgust","Septembar","Oktobar","Novembar","Decembar"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Avg","Sep","Okt","Nov","Dec"],today:"Danas",weekStart:1,clear:"Izbriši",format:"dd.mm.yyyy"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.mk.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.mk.min.js deleted file mode 100644 index 46423f758..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.mk.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.mk={days:["Недела","Понеделник","Вторник","Среда","Четврток","Петок","Сабота"],daysShort:["Нед","Пон","Вто","Сре","Чет","Пет","Саб"],daysMin:["Не","По","Вт","Ср","Че","Пе","Са"],months:["Јануари","Февруари","Март","Април","Мај","Јуни","Јули","Август","Септември","Октомври","Ноември","Декември"],monthsShort:["Јан","Фев","Мар","Апр","Мај","Јун","Јул","Авг","Сеп","Окт","Ное","Дек"],today:"Денес",format:"dd.mm.yyyy"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.mn.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.mn.min.js deleted file mode 100644 index 6ebaec9d8..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.mn.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.mn={days:["Ням","Даваа","Мягмар","Лхагва","Пүрэв","Баасан","Бямба"],daysShort:["Ням","Дав","Мяг","Лха","Пүр","Баа","Бям"],daysMin:["Ня","Да","Мя","Лх","Пү","Ба","Бя"],months:["Хулгана","Үхэр","Бар","Туулай","Луу","Могой","Морь","Хонь","Бич","Тахиа","Нохой","Гахай"],monthsShort:["Хул","Үхэ","Бар","Туу","Луу","Мог","Мор","Хон","Бич","Тах","Нох","Гах"],today:"Өнөөдөр",clear:"Тодорхой",format:"yyyy.mm.dd",weekStart:1}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.ms.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.ms.min.js deleted file mode 100644 index 47efafdc2..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.ms.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.ms={days:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu"],daysShort:["Aha","Isn","Sel","Rab","Kha","Jum","Sab"],daysMin:["Ah","Is","Se","Ra","Kh","Ju","Sa"],months:["Januari","Februari","Mac","April","Mei","Jun","Julai","Ogos","September","Oktober","November","Disember"],monthsShort:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Ogo","Sep","Okt","Nov","Dis"],today:"Hari Ini",clear:"Bersihkan"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.nl-BE.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.nl-BE.min.js deleted file mode 100644 index 85d3146df..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.nl-BE.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates["nl-BE"]={days:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],daysShort:["zo","ma","di","wo","do","vr","za"],daysMin:["zo","ma","di","wo","do","vr","za"],months:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],monthsShort:["jan","feb","mrt","apr","mei","jun","jul","aug","sep","okt","nov","dec"],today:"Vandaag",monthsTitle:"Maanden",clear:"Leegmaken",weekStart:1,format:"dd/mm/yyyy"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.nl.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.nl.min.js deleted file mode 100644 index af977b71e..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.nl.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.nl={days:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],daysShort:["zo","ma","di","wo","do","vr","za"],daysMin:["zo","ma","di","wo","do","vr","za"],months:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],monthsShort:["jan","feb","mrt","apr","mei","jun","jul","aug","sep","okt","nov","dec"],today:"Vandaag",monthsTitle:"Maanden",clear:"Wissen",weekStart:1,format:"dd-mm-yyyy"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.no.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.no.min.js deleted file mode 100644 index 0c5136e44..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.no.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.no={days:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],daysShort:["søn","man","tir","ons","tor","fre","lør"],daysMin:["sø","ma","ti","on","to","fr","lø"],months:["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"],monthsShort:["jan","feb","mar","apr","mai","jun","jul","aug","sep","okt","nov","des"],today:"i dag",monthsTitle:"Måneder",clear:"Nullstill",weekStart:1,format:"dd.mm.yyyy"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.oc.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.oc.min.js deleted file mode 100644 index 630fa16b9..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.oc.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.oc={days:["Dimenge","Diluns","Dimars","Dimècres","Dijòus","Divendres","Dissabte"],daysShort:["Dim","Dil","Dmr","Dmc","Dij","Div","Dis"],daysMin:["dg","dl","dr","dc","dj","dv","ds"],months:["Genièr","Febrièr","Març","Abrial","Mai","Junh","Julhet","Agost","Setembre","Octobre","Novembre","Decembre"],monthsShort:["Gen","Feb","Mar","Abr","Mai","Jun","Jul","Ago","Set","Oct","Nov","Dec"],today:"Uèi",monthsTitle:"Meses",clear:"Escafar",weekStart:1,format:"dd/mm/yyyy"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.pl.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.pl.min.js deleted file mode 100644 index ffb30ec8b..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.pl.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.pl={days:["Niedziela","Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota"],daysShort:["Niedz.","Pon.","Wt.","Śr.","Czw.","Piąt.","Sob."],daysMin:["Ndz.","Pn.","Wt.","Śr.","Czw.","Pt.","Sob."],months:["Styczeń","Luty","Marzec","Kwiecień","Maj","Czerwiec","Lipiec","Sierpień","Wrzesień","Październik","Listopad","Grudzień"],monthsShort:["Sty.","Lut.","Mar.","Kwi.","Maj","Cze.","Lip.","Sie.","Wrz.","Paź.","Lis.","Gru."],today:"Dzisiaj",weekStart:1,clear:"Wyczyść",format:"dd.mm.yyyy"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.pt-BR.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.pt-BR.min.js deleted file mode 100644 index 2d3f8afda..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.pt-BR.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates["pt-BR"]={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],today:"Hoje",monthsTitle:"Meses",clear:"Limpar",format:"dd/mm/yyyy"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.pt.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.pt.min.js deleted file mode 100644 index e2b4e64d7..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.pt.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.pt={days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],today:"Hoje",monthsTitle:"Meses",clear:"Limpar",format:"dd/mm/yyyy"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.ro.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.ro.min.js deleted file mode 100644 index 5fff2986d..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.ro.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.ro={days:["Duminică","Luni","Marţi","Miercuri","Joi","Vineri","Sâmbătă"],daysShort:["Dum","Lun","Mar","Mie","Joi","Vin","Sâm"],daysMin:["Du","Lu","Ma","Mi","Jo","Vi","Sâ"],months:["Ianuarie","Februarie","Martie","Aprilie","Mai","Iunie","Iulie","August","Septembrie","Octombrie","Noiembrie","Decembrie"],monthsShort:["Ian","Feb","Mar","Apr","Mai","Iun","Iul","Aug","Sep","Oct","Nov","Dec"],today:"Astăzi",clear:"Șterge",weekStart:1,format:"dd/mm/yyyy"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.rs-latin.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.rs-latin.min.js deleted file mode 100644 index e520c9573..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.rs-latin.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates["rs-latin"]={days:["Nedelja","Ponedeljak","Utorak","Sreda","Četvrtak","Petak","Subota"],daysShort:["Ned","Pon","Uto","Sre","Čet","Pet","Sub"],daysMin:["N","Po","U","Sr","Č","Pe","Su"],months:["Januar","Februar","Mart","April","Maj","Jun","Jul","Avgust","Septembar","Oktobar","Novembar","Decembar"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Avg","Sep","Okt","Nov","Dec"],today:"Danas",weekStart:1,format:"dd.mm.yyyy"},a.fn.datepicker.deprecated('This language code "rs-latin" is deprecated (invalid serbian language code) and will be removed in 2.0. For Serbian latin support use "sr-latin" instead.')}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.rs.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.rs.min.js deleted file mode 100644 index ba95ae298..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.rs.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.rs={days:["Недеља","Понедељак","Уторак","Среда","Четвртак","Петак","Субота"],daysShort:["Нед","Пон","Уто","Сре","Чет","Пет","Суб"],daysMin:["Н","По","У","Ср","Ч","Пе","Су"],months:["Јануар","Фебруар","Март","Април","Мај","Јун","Јул","Август","Септембар","Октобар","Новембар","Децембар"],monthsShort:["Јан","Феб","Мар","Апр","Мај","Јун","Јул","Авг","Сеп","Окт","Нов","Дец"],today:"Данас",weekStart:1,format:"dd.mm.yyyy"},a.fn.datepicker.deprecated('This language code "rs" is deprecated (invalid serbian language code) and will be removed in 2.0. For Serbian support use "sr" instead.')}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.ru.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.ru.min.js deleted file mode 100644 index 52bc010b9..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.ru.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.ru={days:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота"],daysShort:["Вск","Пнд","Втр","Срд","Чтв","Птн","Суб"],daysMin:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],months:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],monthsShort:["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],today:"Сегодня",clear:"Очистить",format:"dd.mm.yyyy",weekStart:1,monthsTitle:"Месяцы"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.si.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.si.min.js deleted file mode 100644 index b9746b8fc..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.si.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.si={days:["ඉරිදා","සඳුදා","අඟහරුවාදා","බදාදා","බ්‍රහස්පතින්දා","සිකුරාදා","සෙනසුරාදා"],daysShort:["ඉරි","සඳු","අඟ","බදා","බ්‍රහ","සිකු","සෙන"],daysMin:["ඉ","ස","අ","බ","බ්‍ර","සි","සෙ"],months:["ජනවාරි","පෙබරවාරි","මාර්තු","අප්‍රේල්","මැයි","ජුනි","ජූලි","අගෝස්තු","සැප්තැම්බර්","ඔක්තෝබර්","නොවැම්බර්","දෙසැම්බර්"],monthsShort:["ජන","පෙබ","මාර්","අප්‍රේ","මැයි","ජුනි","ජූලි","අගෝ","සැප්","ඔක්","නොවැ","දෙසැ"],today:"අද",monthsTitle:"මාස",clear:"මකන්න",weekStart:0,format:"yyyy-mm-dd"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.sk.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.sk.min.js deleted file mode 100644 index 79a9267fd..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.sk.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.sk={days:["Nedeľa","Pondelok","Utorok","Streda","Štvrtok","Piatok","Sobota"],daysShort:["Ned","Pon","Uto","Str","Štv","Pia","Sob"],daysMin:["Ne","Po","Ut","St","Št","Pia","So"],months:["Január","Február","Marec","Apríl","Máj","Jún","Júl","August","September","Október","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Máj","Jún","Júl","Aug","Sep","Okt","Nov","Dec"],today:"Dnes",clear:"Vymazať",weekStart:1,format:"d.m.yyyy"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.sl.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.sl.min.js deleted file mode 100644 index 831cf7390..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.sl.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.sl={days:["Nedelja","Ponedeljek","Torek","Sreda","Četrtek","Petek","Sobota"],daysShort:["Ned","Pon","Tor","Sre","Čet","Pet","Sob"],daysMin:["Ne","Po","To","Sr","Če","Pe","So"],months:["Januar","Februar","Marec","April","Maj","Junij","Julij","Avgust","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Avg","Sep","Okt","Nov","Dec"],today:"Danes",weekStart:1}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.sq.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.sq.min.js deleted file mode 100644 index 8c586055a..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.sq.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.sq={days:["E Diel","E Hënë","E Martē","E Mërkurë","E Enjte","E Premte","E Shtunë"],daysShort:["Die","Hën","Mar","Mër","Enj","Pre","Shtu"],daysMin:["Di","Hë","Ma","Më","En","Pr","Sht"],months:["Janar","Shkurt","Mars","Prill","Maj","Qershor","Korrik","Gusht","Shtator","Tetor","Nëntor","Dhjetor"],monthsShort:["Jan","Shk","Mar","Pri","Maj","Qer","Korr","Gu","Sht","Tet","Nën","Dhjet"],monthsTitle:"Muaj",today:"Sot",weekStart:1,format:"dd/mm/yyyy",clear:"Pastro"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.sr-latin.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.sr-latin.min.js deleted file mode 100644 index c6b7001ac..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.sr-latin.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates["sr-latin"]={days:["Nedelja","Ponedeljak","Utorak","Sreda","Četvrtak","Petak","Subota"],daysShort:["Ned","Pon","Uto","Sre","Čet","Pet","Sub"],daysMin:["N","Po","U","Sr","Č","Pe","Su"],months:["Januar","Februar","Mart","April","Maj","Jun","Jul","Avgust","Septembar","Oktobar","Novembar","Decembar"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Avg","Sep","Okt","Nov","Dec"],today:"Danas",weekStart:1,format:"dd.mm.yyyy"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.sr.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.sr.min.js deleted file mode 100644 index 4e46dbf64..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.sr.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.sr={days:["Недеља","Понедељак","Уторак","Среда","Четвртак","Петак","Субота"],daysShort:["Нед","Пон","Уто","Сре","Чет","Пет","Суб"],daysMin:["Н","По","У","Ср","Ч","Пе","Су"],months:["Јануар","Фебруар","Март","Април","Мај","Јун","Јул","Август","Септембар","Октобар","Новембар","Децембар"],monthsShort:["Јан","Феб","Мар","Апр","Мај","Јун","Јул","Авг","Сеп","Окт","Нов","Дец"],today:"Данас",weekStart:1,format:"dd.mm.yyyy"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.sv.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.sv.min.js deleted file mode 100644 index 7ab6becb9..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.sv.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.sv={days:["söndag","måndag","tisdag","onsdag","torsdag","fredag","lördag"],daysShort:["sön","mån","tis","ons","tor","fre","lör"],daysMin:["sö","må","ti","on","to","fr","lö"],months:["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december"],monthsShort:["jan","feb","mar","apr","maj","jun","jul","aug","sep","okt","nov","dec"],today:"Idag",format:"yyyy-mm-dd",weekStart:1,clear:"Rensa"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.ta.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.ta.min.js deleted file mode 100644 index e7909494a..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.ta.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.ta={days:["ஞாயிறு","திங்கள்","செவ்வாய்","புதன்","வியாழன்","வெள்ளி","சனி"],daysShort:["ஞாயி","திங்","செவ்","புத","வியா","வெள்","சனி"],daysMin:["ஞா","தி","செ","பு","வி","வெ","ச"],months:["ஜனவரி","பிப்ரவரி","மார்ச்","ஏப்ரல்","மே","ஜூன்","ஜூலை","ஆகஸ்டு","செப்டம்பர்","அக்டோபர்","நவம்பர்","டிசம்பர்"],monthsShort:["ஜன","பிப்","மார்","ஏப்","மே","ஜூன்","ஜூலை","ஆக","செப்","அக்","நவ","டிச"],today:"இன்று",monthsTitle:"மாதங்கள்",clear:"நீக்கு",weekStart:1,format:"dd/mm/yyyy"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.tg.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.tg.min.js deleted file mode 100644 index 104b6dd95..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.tg.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.tg={days:["Якшанбе","Душанбе","Сешанбе","Чоршанбе","Панҷшанбе","Ҷумъа","Шанбе"],daysShort:["Яшб","Дшб","Сшб","Чшб","Пшб","Ҷум","Шнб"],daysMin:["Яш","Дш","Сш","Чш","Пш","Ҷм","Шб"],months:["Январ","Феврал","Март","Апрел","Май","Июн","Июл","Август","Сентябр","Октябр","Ноябр","Декабр"],monthsShort:["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],today:"Имрӯз",monthsTitle:"Моҳҳо",clear:"Тоза намудан",weekStart:1,format:"dd.mm.yyyy"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.th.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.th.min.js deleted file mode 100644 index 1e398ba8b..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.th.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.th={days:["อาทิตย์","จันทร์","อังคาร","พุธ","พฤหัส","ศุกร์","เสาร์","อาทิตย์"],daysShort:["อา","จ","อ","พ","พฤ","ศ","ส","อา"],daysMin:["อา","จ","อ","พ","พฤ","ศ","ส","อา"],months:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],monthsShort:["ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."],today:"วันนี้"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.tk.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.tk.min.js deleted file mode 100644 index 716edef2e..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.tk.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.tk={days:["Ýekşenbe","Duşenbe","Sişenbe","Çarşenbe","Penşenbe","Anna","Şenbe"],daysShort:["Ýek","Duş","Siş","Çar","Pen","Ann","Şen"],daysMin:["Ýe","Du","Si","Ça","Pe","An","Şe"],months:["Ýanwar","Fewral","Mart","Aprel","Maý","Iýun","Iýul","Awgust","Sentýabr","Oktýabr","Noýabr","Dekabr"],monthsShort:["Ýan","Few","Mar","Apr","Maý","Iýn","Iýl","Awg","Sen","Okt","Noý","Dek"],today:"Bu gün",monthsTitle:"Aýlar",clear:"Aýyr",weekStart:1,format:"dd.mm.yyyy"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.tr.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.tr.min.js deleted file mode 100644 index 7889b1135..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.tr.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.tr={days:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"],daysShort:["Pz","Pzt","Sal","Çrş","Prş","Cu","Cts"],daysMin:["Pz","Pzt","Sa","Çr","Pr","Cu","Ct"],months:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],monthsShort:["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],today:"Bugün",clear:"Temizle",weekStart:1,format:"dd.mm.yyyy"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.uk.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.uk.min.js deleted file mode 100644 index 41b02e6b2..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.uk.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.uk={days:["Неділя","Понеділок","Вівторок","Середа","Четвер","П'ятниця","Субота"],daysShort:["Нед","Пнд","Втр","Срд","Чтв","Птн","Суб"],daysMin:["Нд","Пн","Вт","Ср","Чт","Пт","Сб"],months:["Cічень","Лютий","Березень","Квітень","Травень","Червень","Липень","Серпень","Вересень","Жовтень","Листопад","Грудень"],monthsShort:["Січ","Лют","Бер","Кві","Тра","Чер","Лип","Сер","Вер","Жов","Лис","Гру"],today:"Сьогодні",clear:"Очистити",format:"dd.mm.yyyy",weekStart:1}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.uz-cyrl.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.uz-cyrl.min.js deleted file mode 100644 index a0a8f213c..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.uz-cyrl.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates["uz-cyrl"]={days:["Якшанба","Душанба","Сешанба","Чоршанба","Пайшанба","Жума","Шанба"],daysShort:["Якш","Ду","Се","Чор","Пай","Жу","Ша"],daysMin:["Як","Ду","Се","Чо","Па","Жу","Ша"],months:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],monthsShort:["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],today:"Бугун",clear:"Ўчириш",format:"dd.mm.yyyy",weekStart:1,monthsTitle:"Ойлар"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.uz-latn.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.uz-latn.min.js deleted file mode 100644 index 2f58e343e..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.uz-latn.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates["uz-latn"]={days:["Yakshanba","Dushanba","Seshanba","Chorshanba","Payshanba","Juma","Shanba"],daysShort:["Yak","Du","Se","Chor","Pay","Ju","Sha"],daysMin:["Ya","Du","Se","Cho","Pa","Ju","Sha"],months:["Yanvar","Fevral","Mart","Aprel","May","Iyun","Iyul","Avgust","Sentabr","Oktabr","Noyabr","Dekabr"],monthsShort:["Yan","Fev","Mar","Apr","May","Iyn","Iyl","Avg","Sen","Okt","Noy","Dek"],today:"Bugun",clear:"O'chirish",format:"dd.mm.yyyy",weekStart:1,monthsTitle:"Oylar"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.vi.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.vi.min.js deleted file mode 100644 index 3311d23f8..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.vi.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates.vi={days:["Chủ nhật","Thứ hai","Thứ ba","Thứ tư","Thứ năm","Thứ sáu","Thứ bảy"],daysShort:["CN","Thứ 2","Thứ 3","Thứ 4","Thứ 5","Thứ 6","Thứ 7"],daysMin:["CN","T2","T3","T4","T5","T6","T7"],months:["Tháng 1","Tháng 2","Tháng 3","Tháng 4","Tháng 5","Tháng 6","Tháng 7","Tháng 8","Tháng 9","Tháng 10","Tháng 11","Tháng 12"],monthsShort:["Th1","Th2","Th3","Th4","Th5","Th6","Th7","Th8","Th9","Th10","Th11","Th12"],today:"Hôm nay",clear:"Xóa",format:"dd/mm/yyyy"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.min.js deleted file mode 100644 index 8e6920b0c..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates["zh-CN"]={days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],daysShort:["周日","周一","周二","周三","周四","周五","周六"],daysMin:["日","一","二","三","四","五","六"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],today:"今天",monthsTitle:"选择月份",clear:"清除",format:"yyyy-mm-dd",titleFormat:"yyyy年mm月",weekStart:1}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.zh-TW.min.js b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.zh-TW.min.js deleted file mode 100644 index e309c1d7d..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap-datepicker/locales/bootstrap-datepicker.zh-TW.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){a.fn.datepicker.dates["zh-TW"]={days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],daysShort:["週日","週一","週二","週三","週四","週五","週六"],daysMin:["日","一","二","三","四","五","六"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],today:"今天",format:"yyyy年mm月dd日",weekStart:1,clear:"清除"}}(jQuery); \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap/css/bootstrap-rtl.css b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap/css/bootstrap-rtl.css deleted file mode 100644 index 0a5e9b5a8..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap/css/bootstrap-rtl.css +++ /dev/null @@ -1,11453 +0,0 @@ -/*! - * Bootstrap v4.5.2 (https://getbootstrap.com/) - * Copyright 2011-2020 The Bootstrap Authors - * Copyright 2011-2020 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - */ -:root { - --blue: #007bff; - --indigo: #6610f2; - --purple: #6f42c1; - --pink: #e83e8c; - --red: #dc3545; - --orange: #fd7e14; - --yellow: #ffc107; - --green: #28a745; - --teal: #20c997; - --cyan: #17a2b8; - --white: #fff; - --gray: #6c757d; - --gray-dark: #343a40; - --primary: #007bff; - --secondary: #6c757d; - --success: #28a745; - --info: #17a2b8; - --warning: #ffc107; - --danger: #dc3545; - --light: #f8f9fa; - --dark: #343a40; - --breakpoint-xs: 0; - --breakpoint-sm: 576px; - --breakpoint-md: 768px; - --breakpoint-lg: 992px; - --breakpoint-xl: 1200px; - --font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; - --font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; -} - -*, -*::before, -*::after { - box-sizing: border-box; -} - -html { - font-family: sans-serif; - line-height: 1.15; - -webkit-text-size-adjust: 100%; - -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -} - -article, aside, figcaption, figure, footer, header, hgroup, main, nav, section { - display: block; -} - -body { - margin: 0; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; - font-size: 1rem; - font-weight: 400; - line-height: 1.5; - color: #212529; - text-align: left; - background-color: #fff; -} - -[tabindex="-1"]:focus:not(:focus-visible) { - outline: 0 !important; -} - -hr { - box-sizing: content-box; - height: 0; - overflow: visible; -} - -h1, h2, h3, h4, h5, h6 { - margin-top: 0; - margin-bottom: 0.5rem; -} - -p { - margin-top: 0; - margin-bottom: 1rem; -} - -abbr[title], -abbr[data-original-title] { - text-decoration: underline; - -webkit-text-decoration: underline dotted; - text-decoration: underline dotted; - cursor: help; - border-bottom: 0; - -webkit-text-decoration-skip-ink: none; - text-decoration-skip-ink: none; -} - -address { - margin-bottom: 1rem; - font-style: normal; - line-height: inherit; -} - -ol, -ul, -dl { - margin-top: 0; - margin-bottom: 1rem; -} - -ol ol, -ul ul, -ol ul, -ul ol { - margin-bottom: 0; -} - -dt { - font-weight: 700; -} - -dd { - margin-bottom: .5rem; - margin-left: 0; -} - -blockquote { - margin: 0 0 1rem; -} - -b, -strong { - font-weight: bolder; -} - -small { - font-size: 80%; -} - -sub, -sup { - position: relative; - font-size: 75%; - line-height: 0; - vertical-align: baseline; -} - -sub { - bottom: -.25em; -} - -sup { - top: -.5em; -} - -a { - color: #007bff; - text-decoration: none; - background-color: transparent; -} - -a:hover { - color: #0056b3; - text-decoration: underline; -} - -a:not([href]):not([class]) { - color: inherit; - text-decoration: none; -} - -a:not([href]):not([class]):hover { - color: inherit; - text-decoration: none; -} - -pre, -code, -kbd, -samp { - font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; - font-size: 1em; -} - -pre { - margin-top: 0; - margin-bottom: 1rem; - overflow: auto; - -ms-overflow-style: scrollbar; -} - -figure { - margin: 0 0 1rem; -} - -img { - vertical-align: middle; - border-style: none; -} - -svg { - overflow: hidden; - vertical-align: middle; -} - -table { - border-collapse: collapse; -} - -caption { - padding-top: 0.75rem; - padding-bottom: 0.75rem; - color: #6c757d; - text-align: left; - caption-side: bottom; -} - -th { - text-align: inherit; - text-align: -webkit-match-parent; -} - -label { - display: inline-block; - margin-bottom: 0.5rem; -} - -button { - border-radius: 0; -} - -button:focus:not(:focus-visible) { - outline: 0; -} - -input, -button, -select, -optgroup, -textarea { - margin: 0; - font-family: inherit; - font-size: inherit; - line-height: inherit; -} - -button, -input { - overflow: visible; -} - -button, -select { - text-transform: none; -} - -[role="button"] { - cursor: pointer; -} - -select { - word-wrap: normal; -} - -button, -[type="button"], -[type="reset"], -[type="submit"] { - -webkit-appearance: button; -} - -button:not(:disabled), -[type="button"]:not(:disabled), -[type="reset"]:not(:disabled), -[type="submit"]:not(:disabled) { - cursor: pointer; -} - -button::-moz-focus-inner, -[type="button"]::-moz-focus-inner, -[type="reset"]::-moz-focus-inner, -[type="submit"]::-moz-focus-inner { - padding: 0; - border-style: none; -} - -input[type="radio"], -input[type="checkbox"] { - box-sizing: border-box; - padding: 0; -} - -textarea { - overflow: auto; - resize: vertical; -} - -fieldset { - min-width: 0; - padding: 0; - margin: 0; - border: 0; -} - -legend { - display: block; - width: 100%; - max-width: 100%; - padding: 0; - margin-bottom: .5rem; - font-size: 1.5rem; - line-height: inherit; - color: inherit; - white-space: normal; -} - -progress { - vertical-align: baseline; -} - -[type="number"]::-webkit-inner-spin-button, -[type="number"]::-webkit-outer-spin-button { - height: auto; -} - -[type="search"] { - outline-offset: -2px; - -webkit-appearance: none; -} - -[type="search"]::-webkit-search-decoration { - -webkit-appearance: none; -} - -::-webkit-file-upload-button { - font: inherit; - -webkit-appearance: button; -} - -output { - display: inline-block; -} - -summary { - display: list-item; - cursor: pointer; -} - -template { - display: none; -} - -[hidden] { - display: none !important; -} - -h1, h2, h3, h4, h5, h6, -.h1, .h2, .h3, .h4, .h5, .h6 { - margin-bottom: 0.5rem; - font-weight: 500; - line-height: 1.2; -} - -h1, .h1 { - font-size: 2.5rem; -} - -h2, .h2 { - font-size: 2rem; -} - -h3, .h3 { - font-size: 1.75rem; -} - -h4, .h4 { - font-size: 1.5rem; -} - -h5, .h5 { - font-size: 1.25rem; -} - -h6, .h6 { - font-size: 1rem; -} - -.lead { - font-size: 1.25rem; - font-weight: 300; -} - -.display-1 { - font-size: 6rem; - font-weight: 300; - line-height: 1.2; -} - -.display-2 { - font-size: 5.5rem; - font-weight: 300; - line-height: 1.2; -} - -.display-3 { - font-size: 4.5rem; - font-weight: 300; - line-height: 1.2; -} - -.display-4 { - font-size: 3.5rem; - font-weight: 300; - line-height: 1.2; -} - -hr { - margin-top: 1rem; - margin-bottom: 1rem; - border: 0; - border-top: 1px solid rgba(0, 0, 0, 0.1); -} - -small, -.small { - font-size: 80%; - font-weight: 400; -} - -mark, -.mark { - padding: 0.2em; - background-color: #fcf8e3; -} - -.list-unstyled { - padding-left: 0; - list-style: none; -} - -.list-inline { - padding-left: 0; - list-style: none; -} - -.list-inline-item { - display: inline-block; -} - -.list-inline-item:not(:last-child) { - margin-right: 0.5rem; -} - -.initialism { - font-size: 90%; - text-transform: uppercase; -} - -.blockquote { - margin-bottom: 1rem; - font-size: 1.25rem; -} - -.blockquote-footer { - display: block; - font-size: 80%; - color: #6c757d; -} - -.blockquote-footer::before { - content: "\2014\00A0"; -} - -.img-fluid { - max-width: 100%; - height: auto; -} - -.img-thumbnail { - padding: 0.25rem; - background-color: #fff; - border: 1px solid #dee2e6; - border-radius: 0.25rem; - max-width: 100%; - height: auto; -} - -.figure { - display: inline-block; -} - -.figure-img { - margin-bottom: 0.5rem; - line-height: 1; -} - -.figure-caption { - font-size: 90%; - color: #6c757d; -} - -code { - font-size: 87.5%; - color: #e83e8c; - word-wrap: break-word; -} - -a > code { - color: inherit; -} - -kbd { - padding: 0.2rem 0.4rem; - font-size: 87.5%; - color: #fff; - background-color: #212529; - border-radius: 0.2rem; -} - -kbd kbd { - padding: 0; - font-size: 100%; - font-weight: 700; -} - -pre { - display: block; - font-size: 87.5%; - color: #212529; -} - -pre code { - font-size: inherit; - color: inherit; - word-break: normal; -} - -.pre-scrollable { - max-height: 340px; - overflow-y: scroll; -} - -.container, -.container-fluid, -.container-sm, -.container-md, -.container-lg, -.container-xl { - width: 100%; - padding-right: 15px; - padding-left: 15px; - margin-right: auto; - margin-left: auto; -} - -@media (min-width: 576px) { - .container, .container-sm { - max-width: 540px; - } -} - -@media (min-width: 768px) { - .container, .container-sm, .container-md { - max-width: 720px; - } -} - -@media (min-width: 992px) { - .container, .container-sm, .container-md, .container-lg { - max-width: 960px; - } -} - -@media (min-width: 1200px) { - .container, .container-sm, .container-md, .container-lg, .container-xl { - max-width: 1140px; - } -} - -.row { - display: flex; - flex-wrap: wrap; - margin-right: -15px; - margin-left: -15px; -} - -.no-gutters { - margin-right: 0; - margin-left: 0; -} - -.no-gutters > .col, -.no-gutters > [class*="col-"] { - padding-right: 0; - padding-left: 0; -} - -.col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12, .col, -.col-auto, .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm, -.col-sm-auto, .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12, .col-md, -.col-md-auto, .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg, -.col-lg-auto, .col-xl-1, .col-xl-2, .col-xl-3, .col-xl-4, .col-xl-5, .col-xl-6, .col-xl-7, .col-xl-8, .col-xl-9, .col-xl-10, .col-xl-11, .col-xl-12, .col-xl, -.col-xl-auto { - position: relative; - width: 100%; - padding-right: 15px; - padding-left: 15px; -} - -.col { - flex-basis: 0; - flex-grow: 1; - max-width: 100%; -} - -.row-cols-1 > * { - flex: 0 0 100%; - max-width: 100%; -} - -.row-cols-2 > * { - flex: 0 0 50%; - max-width: 50%; -} - -.row-cols-3 > * { - flex: 0 0 33.333333%; - max-width: 33.333333%; -} - -.row-cols-4 > * { - flex: 0 0 25%; - max-width: 25%; -} - -.row-cols-5 > * { - flex: 0 0 20%; - max-width: 20%; -} - -.row-cols-6 > * { - flex: 0 0 16.666667%; - max-width: 16.666667%; -} - -.col-auto { - flex: 0 0 auto; - width: auto; - max-width: 100%; -} - -.col-1 { - flex: 0 0 8.333333%; - max-width: 8.333333%; -} - -.col-2 { - flex: 0 0 16.666667%; - max-width: 16.666667%; -} - -.col-3 { - flex: 0 0 25%; - max-width: 25%; -} - -.col-4 { - flex: 0 0 33.333333%; - max-width: 33.333333%; -} - -.col-5 { - flex: 0 0 41.666667%; - max-width: 41.666667%; -} - -.col-6 { - flex: 0 0 50%; - max-width: 50%; -} - -.col-7 { - flex: 0 0 58.333333%; - max-width: 58.333333%; -} - -.col-8 { - flex: 0 0 66.666667%; - max-width: 66.666667%; -} - -.col-9 { - flex: 0 0 75%; - max-width: 75%; -} - -.col-10 { - flex: 0 0 83.333333%; - max-width: 83.333333%; -} - -.col-11 { - flex: 0 0 91.666667%; - max-width: 91.666667%; -} - -.col-12 { - flex: 0 0 100%; - max-width: 100%; -} - -.order-first { - order: -1; -} - -.order-last { - order: 13; -} - -.order-0 { - order: 0; -} - -.order-1 { - order: 1; -} - -.order-2 { - order: 2; -} - -.order-3 { - order: 3; -} - -.order-4 { - order: 4; -} - -.order-5 { - order: 5; -} - -.order-6 { - order: 6; -} - -.order-7 { - order: 7; -} - -.order-8 { - order: 8; -} - -.order-9 { - order: 9; -} - -.order-10 { - order: 10; -} - -.order-11 { - order: 11; -} - -.order-12 { - order: 12; -} - -.offset-1 { - margin-left: 8.333333%; -} - -.offset-2 { - margin-left: 16.666667%; -} - -.offset-3 { - margin-left: 25%; -} - -.offset-4 { - margin-left: 33.333333%; -} - -.offset-5 { - margin-left: 41.666667%; -} - -.offset-6 { - margin-left: 50%; -} - -.offset-7 { - margin-left: 58.333333%; -} - -.offset-8 { - margin-left: 66.666667%; -} - -.offset-9 { - margin-left: 75%; -} - -.offset-10 { - margin-left: 83.333333%; -} - -.offset-11 { - margin-left: 91.666667%; -} - -@media (min-width: 576px) { - .col-sm { - flex-basis: 0; - flex-grow: 1; - max-width: 100%; - } - .row-cols-sm-1 > * { - flex: 0 0 100%; - max-width: 100%; - } - .row-cols-sm-2 > * { - flex: 0 0 50%; - max-width: 50%; - } - .row-cols-sm-3 > * { - flex: 0 0 33.333333%; - max-width: 33.333333%; - } - .row-cols-sm-4 > * { - flex: 0 0 25%; - max-width: 25%; - } - .row-cols-sm-5 > * { - flex: 0 0 20%; - max-width: 20%; - } - .row-cols-sm-6 > * { - flex: 0 0 16.666667%; - max-width: 16.666667%; - } - .col-sm-auto { - flex: 0 0 auto; - width: auto; - max-width: 100%; - } - .col-sm-1 { - flex: 0 0 8.333333%; - max-width: 8.333333%; - } - .col-sm-2 { - flex: 0 0 16.666667%; - max-width: 16.666667%; - } - .col-sm-3 { - flex: 0 0 25%; - max-width: 25%; - } - .col-sm-4 { - flex: 0 0 33.333333%; - max-width: 33.333333%; - } - .col-sm-5 { - flex: 0 0 41.666667%; - max-width: 41.666667%; - } - .col-sm-6 { - flex: 0 0 50%; - max-width: 50%; - } - .col-sm-7 { - flex: 0 0 58.333333%; - max-width: 58.333333%; - } - .col-sm-8 { - flex: 0 0 66.666667%; - max-width: 66.666667%; - } - .col-sm-9 { - flex: 0 0 75%; - max-width: 75%; - } - .col-sm-10 { - flex: 0 0 83.333333%; - max-width: 83.333333%; - } - .col-sm-11 { - flex: 0 0 91.666667%; - max-width: 91.666667%; - } - .col-sm-12 { - flex: 0 0 100%; - max-width: 100%; - } - .order-sm-first { - order: -1; - } - .order-sm-last { - order: 13; - } - .order-sm-0 { - order: 0; - } - .order-sm-1 { - order: 1; - } - .order-sm-2 { - order: 2; - } - .order-sm-3 { - order: 3; - } - .order-sm-4 { - order: 4; - } - .order-sm-5 { - order: 5; - } - .order-sm-6 { - order: 6; - } - .order-sm-7 { - order: 7; - } - .order-sm-8 { - order: 8; - } - .order-sm-9 { - order: 9; - } - .order-sm-10 { - order: 10; - } - .order-sm-11 { - order: 11; - } - .order-sm-12 { - order: 12; - } - .offset-sm-0 { - margin-left: 0; - } - .offset-sm-1 { - margin-left: 8.333333%; - } - .offset-sm-2 { - margin-left: 16.666667%; - } - .offset-sm-3 { - margin-left: 25%; - } - .offset-sm-4 { - margin-left: 33.333333%; - } - .offset-sm-5 { - margin-left: 41.666667%; - } - .offset-sm-6 { - margin-left: 50%; - } - .offset-sm-7 { - margin-left: 58.333333%; - } - .offset-sm-8 { - margin-left: 66.666667%; - } - .offset-sm-9 { - margin-left: 75%; - } - .offset-sm-10 { - margin-left: 83.333333%; - } - .offset-sm-11 { - margin-left: 91.666667%; - } -} - -@media (min-width: 768px) { - .col-md { - flex-basis: 0; - flex-grow: 1; - max-width: 100%; - } - .row-cols-md-1 > * { - flex: 0 0 100%; - max-width: 100%; - } - .row-cols-md-2 > * { - flex: 0 0 50%; - max-width: 50%; - } - .row-cols-md-3 > * { - flex: 0 0 33.333333%; - max-width: 33.333333%; - } - .row-cols-md-4 > * { - flex: 0 0 25%; - max-width: 25%; - } - .row-cols-md-5 > * { - flex: 0 0 20%; - max-width: 20%; - } - .row-cols-md-6 > * { - flex: 0 0 16.666667%; - max-width: 16.666667%; - } - .col-md-auto { - flex: 0 0 auto; - width: auto; - max-width: 100%; - } - .col-md-1 { - flex: 0 0 8.333333%; - max-width: 8.333333%; - } - .col-md-2 { - flex: 0 0 16.666667%; - max-width: 16.666667%; - } - .col-md-3 { - flex: 0 0 25%; - max-width: 25%; - } - .col-md-4 { - flex: 0 0 33.333333%; - max-width: 33.333333%; - } - .col-md-5 { - flex: 0 0 41.666667%; - max-width: 41.666667%; - } - .col-md-6 { - flex: 0 0 50%; - max-width: 50%; - } - .col-md-7 { - flex: 0 0 58.333333%; - max-width: 58.333333%; - } - .col-md-8 { - flex: 0 0 66.666667%; - max-width: 66.666667%; - } - .col-md-9 { - flex: 0 0 75%; - max-width: 75%; - } - .col-md-10 { - flex: 0 0 83.333333%; - max-width: 83.333333%; - } - .col-md-11 { - flex: 0 0 91.666667%; - max-width: 91.666667%; - } - .col-md-12 { - flex: 0 0 100%; - max-width: 100%; - } - .order-md-first { - order: -1; - } - .order-md-last { - order: 13; - } - .order-md-0 { - order: 0; - } - .order-md-1 { - order: 1; - } - .order-md-2 { - order: 2; - } - .order-md-3 { - order: 3; - } - .order-md-4 { - order: 4; - } - .order-md-5 { - order: 5; - } - .order-md-6 { - order: 6; - } - .order-md-7 { - order: 7; - } - .order-md-8 { - order: 8; - } - .order-md-9 { - order: 9; - } - .order-md-10 { - order: 10; - } - .order-md-11 { - order: 11; - } - .order-md-12 { - order: 12; - } - .offset-md-0 { - margin-left: 0; - } - .offset-md-1 { - margin-left: 8.333333%; - } - .offset-md-2 { - margin-left: 16.666667%; - } - .offset-md-3 { - margin-left: 25%; - } - .offset-md-4 { - margin-left: 33.333333%; - } - .offset-md-5 { - margin-left: 41.666667%; - } - .offset-md-6 { - margin-left: 50%; - } - .offset-md-7 { - margin-left: 58.333333%; - } - .offset-md-8 { - margin-left: 66.666667%; - } - .offset-md-9 { - margin-left: 75%; - } - .offset-md-10 { - margin-left: 83.333333%; - } - .offset-md-11 { - margin-left: 91.666667%; - } -} - -@media (min-width: 992px) { - .col-lg { - flex-basis: 0; - flex-grow: 1; - max-width: 100%; - } - .row-cols-lg-1 > * { - flex: 0 0 100%; - max-width: 100%; - } - .row-cols-lg-2 > * { - flex: 0 0 50%; - max-width: 50%; - } - .row-cols-lg-3 > * { - flex: 0 0 33.333333%; - max-width: 33.333333%; - } - .row-cols-lg-4 > * { - flex: 0 0 25%; - max-width: 25%; - } - .row-cols-lg-5 > * { - flex: 0 0 20%; - max-width: 20%; - } - .row-cols-lg-6 > * { - flex: 0 0 16.666667%; - max-width: 16.666667%; - } - .col-lg-auto { - flex: 0 0 auto; - width: auto; - max-width: 100%; - } - .col-lg-1 { - flex: 0 0 8.333333%; - max-width: 8.333333%; - } - .col-lg-2 { - flex: 0 0 16.666667%; - max-width: 16.666667%; - } - .col-lg-3 { - flex: 0 0 25%; - max-width: 25%; - } - .col-lg-4 { - flex: 0 0 33.333333%; - max-width: 33.333333%; - } - .col-lg-5 { - flex: 0 0 41.666667%; - max-width: 41.666667%; - } - .col-lg-6 { - flex: 0 0 50%; - max-width: 50%; - } - .col-lg-7 { - flex: 0 0 58.333333%; - max-width: 58.333333%; - } - .col-lg-8 { - flex: 0 0 66.666667%; - max-width: 66.666667%; - } - .col-lg-9 { - flex: 0 0 75%; - max-width: 75%; - } - .col-lg-10 { - flex: 0 0 83.333333%; - max-width: 83.333333%; - } - .col-lg-11 { - flex: 0 0 91.666667%; - max-width: 91.666667%; - } - .col-lg-12 { - flex: 0 0 100%; - max-width: 100%; - } - .order-lg-first { - order: -1; - } - .order-lg-last { - order: 13; - } - .order-lg-0 { - order: 0; - } - .order-lg-1 { - order: 1; - } - .order-lg-2 { - order: 2; - } - .order-lg-3 { - order: 3; - } - .order-lg-4 { - order: 4; - } - .order-lg-5 { - order: 5; - } - .order-lg-6 { - order: 6; - } - .order-lg-7 { - order: 7; - } - .order-lg-8 { - order: 8; - } - .order-lg-9 { - order: 9; - } - .order-lg-10 { - order: 10; - } - .order-lg-11 { - order: 11; - } - .order-lg-12 { - order: 12; - } - .offset-lg-0 { - margin-left: 0; - } - .offset-lg-1 { - margin-left: 8.333333%; - } - .offset-lg-2 { - margin-left: 16.666667%; - } - .offset-lg-3 { - margin-left: 25%; - } - .offset-lg-4 { - margin-left: 33.333333%; - } - .offset-lg-5 { - margin-left: 41.666667%; - } - .offset-lg-6 { - margin-left: 50%; - } - .offset-lg-7 { - margin-left: 58.333333%; - } - .offset-lg-8 { - margin-left: 66.666667%; - } - .offset-lg-9 { - margin-left: 75%; - } - .offset-lg-10 { - margin-left: 83.333333%; - } - .offset-lg-11 { - margin-left: 91.666667%; - } -} - -@media (min-width: 1200px) { - .col-xl { - flex-basis: 0; - flex-grow: 1; - max-width: 100%; - } - .row-cols-xl-1 > * { - flex: 0 0 100%; - max-width: 100%; - } - .row-cols-xl-2 > * { - flex: 0 0 50%; - max-width: 50%; - } - .row-cols-xl-3 > * { - flex: 0 0 33.333333%; - max-width: 33.333333%; - } - .row-cols-xl-4 > * { - flex: 0 0 25%; - max-width: 25%; - } - .row-cols-xl-5 > * { - flex: 0 0 20%; - max-width: 20%; - } - .row-cols-xl-6 > * { - flex: 0 0 16.666667%; - max-width: 16.666667%; - } - .col-xl-auto { - flex: 0 0 auto; - width: auto; - max-width: 100%; - } - .col-xl-1 { - flex: 0 0 8.333333%; - max-width: 8.333333%; - } - .col-xl-2 { - flex: 0 0 16.666667%; - max-width: 16.666667%; - } - .col-xl-3 { - flex: 0 0 25%; - max-width: 25%; - } - .col-xl-4 { - flex: 0 0 33.333333%; - max-width: 33.333333%; - } - .col-xl-5 { - flex: 0 0 41.666667%; - max-width: 41.666667%; - } - .col-xl-6 { - flex: 0 0 50%; - max-width: 50%; - } - .col-xl-7 { - flex: 0 0 58.333333%; - max-width: 58.333333%; - } - .col-xl-8 { - flex: 0 0 66.666667%; - max-width: 66.666667%; - } - .col-xl-9 { - flex: 0 0 75%; - max-width: 75%; - } - .col-xl-10 { - flex: 0 0 83.333333%; - max-width: 83.333333%; - } - .col-xl-11 { - flex: 0 0 91.666667%; - max-width: 91.666667%; - } - .col-xl-12 { - flex: 0 0 100%; - max-width: 100%; - } - .order-xl-first { - order: -1; - } - .order-xl-last { - order: 13; - } - .order-xl-0 { - order: 0; - } - .order-xl-1 { - order: 1; - } - .order-xl-2 { - order: 2; - } - .order-xl-3 { - order: 3; - } - .order-xl-4 { - order: 4; - } - .order-xl-5 { - order: 5; - } - .order-xl-6 { - order: 6; - } - .order-xl-7 { - order: 7; - } - .order-xl-8 { - order: 8; - } - .order-xl-9 { - order: 9; - } - .order-xl-10 { - order: 10; - } - .order-xl-11 { - order: 11; - } - .order-xl-12 { - order: 12; - } - .offset-xl-0 { - margin-left: 0; - } - .offset-xl-1 { - margin-left: 8.333333%; - } - .offset-xl-2 { - margin-left: 16.666667%; - } - .offset-xl-3 { - margin-left: 25%; - } - .offset-xl-4 { - margin-left: 33.333333%; - } - .offset-xl-5 { - margin-left: 41.666667%; - } - .offset-xl-6 { - margin-left: 50%; - } - .offset-xl-7 { - margin-left: 58.333333%; - } - .offset-xl-8 { - margin-left: 66.666667%; - } - .offset-xl-9 { - margin-left: 75%; - } - .offset-xl-10 { - margin-left: 83.333333%; - } - .offset-xl-11 { - margin-left: 91.666667%; - } -} - -.table { - width: 100%; - margin-bottom: 1rem; - color: #212529; -} - -.table th, -.table td { - padding: 0.75rem; - vertical-align: top; - border-top: 1px solid #dee2e6; -} - -.table thead th { - vertical-align: bottom; - border-bottom: 2px solid #dee2e6; -} - -.table tbody + tbody { - border-top: 2px solid #dee2e6; -} - -.table-sm th, -.table-sm td { - padding: 0.3rem; -} - -.table-bordered { - border: 1px solid #dee2e6; -} - -.table-bordered th, -.table-bordered td { - border: 1px solid #dee2e6; -} - -.table-bordered thead th, -.table-bordered thead td { - border-bottom-width: 2px; -} - -.table-borderless th, -.table-borderless td, -.table-borderless thead th, -.table-borderless tbody + tbody { - border: 0; -} - -.table-striped tbody tr:nth-of-type(odd) { - background-color: rgba(0, 0, 0, 0.05); -} - -.table-hover tbody tr:hover { - color: #212529; - background-color: rgba(0, 0, 0, 0.075); -} - -.table-primary, -.table-primary > th, -.table-primary > td { - background-color: #b8daff; -} - -.table-primary th, -.table-primary td, -.table-primary thead th, -.table-primary tbody + tbody { - border-color: #7abaff; -} - -.table-hover .table-primary:hover { - background-color: #9fcdff; -} - -.table-hover .table-primary:hover > td, -.table-hover .table-primary:hover > th { - background-color: #9fcdff; -} - -.table-secondary, -.table-secondary > th, -.table-secondary > td { - background-color: #d6d8db; -} - -.table-secondary th, -.table-secondary td, -.table-secondary thead th, -.table-secondary tbody + tbody { - border-color: #b3b7bb; -} - -.table-hover .table-secondary:hover { - background-color: #c8cbcf; -} - -.table-hover .table-secondary:hover > td, -.table-hover .table-secondary:hover > th { - background-color: #c8cbcf; -} - -.table-success, -.table-success > th, -.table-success > td { - background-color: #c3e6cb; -} - -.table-success th, -.table-success td, -.table-success thead th, -.table-success tbody + tbody { - border-color: #8fd19e; -} - -.table-hover .table-success:hover { - background-color: #b1dfbb; -} - -.table-hover .table-success:hover > td, -.table-hover .table-success:hover > th { - background-color: #b1dfbb; -} - -.table-info, -.table-info > th, -.table-info > td { - background-color: #bee5eb; -} - -.table-info th, -.table-info td, -.table-info thead th, -.table-info tbody + tbody { - border-color: #86cfda; -} - -.table-hover .table-info:hover { - background-color: #abdde5; -} - -.table-hover .table-info:hover > td, -.table-hover .table-info:hover > th { - background-color: #abdde5; -} - -.table-warning, -.table-warning > th, -.table-warning > td { - background-color: #ffeeba; -} - -.table-warning th, -.table-warning td, -.table-warning thead th, -.table-warning tbody + tbody { - border-color: #ffdf7e; -} - -.table-hover .table-warning:hover { - background-color: #ffe8a1; -} - -.table-hover .table-warning:hover > td, -.table-hover .table-warning:hover > th { - background-color: #ffe8a1; -} - -.table-danger, -.table-danger > th, -.table-danger > td { - background-color: #f5c6cb; -} - -.table-danger th, -.table-danger td, -.table-danger thead th, -.table-danger tbody + tbody { - border-color: #ed969e; -} - -.table-hover .table-danger:hover { - background-color: #f1b0b7; -} - -.table-hover .table-danger:hover > td, -.table-hover .table-danger:hover > th { - background-color: #f1b0b7; -} - -.table-light, -.table-light > th, -.table-light > td { - background-color: #fdfdfe; -} - -.table-light th, -.table-light td, -.table-light thead th, -.table-light tbody + tbody { - border-color: #fbfcfc; -} - -.table-hover .table-light:hover { - background-color: #ececf6; -} - -.table-hover .table-light:hover > td, -.table-hover .table-light:hover > th { - background-color: #ececf6; -} - -.table-dark, -.table-dark > th, -.table-dark > td { - background-color: #c6c8ca; -} - -.table-dark th, -.table-dark td, -.table-dark thead th, -.table-dark tbody + tbody { - border-color: #95999c; -} - -.table-hover .table-dark:hover { - background-color: #b9bbbe; -} - -.table-hover .table-dark:hover > td, -.table-hover .table-dark:hover > th { - background-color: #b9bbbe; -} - -.table-active, -.table-active > th, -.table-active > td { - background-color: rgba(0, 0, 0, 0.075); -} - -.table-hover .table-active:hover { - background-color: rgba(0, 0, 0, 0.075); -} - -.table-hover .table-active:hover > td, -.table-hover .table-active:hover > th { - background-color: rgba(0, 0, 0, 0.075); -} - -.table .thead-dark th { - color: #fff; - background-color: #343a40; - border-color: #454d55; -} - -.table .thead-light th { - color: #495057; - background-color: #e9ecef; - border-color: #dee2e6; -} - -.table-dark { - color: #fff; - background-color: #343a40; -} - -.table-dark th, -.table-dark td, -.table-dark thead th { - border-color: #454d55; -} - -.table-dark.table-bordered { - border: 0; -} - -.table-dark.table-striped tbody tr:nth-of-type(odd) { - background-color: rgba(255, 255, 255, 0.05); -} - -.table-dark.table-hover tbody tr:hover { - color: #fff; - background-color: rgba(255, 255, 255, 0.075); -} - -@media (max-width: 575.98px) { - .table-responsive-sm { - display: block; - width: 100%; - overflow-x: auto; - -webkit-overflow-scrolling: touch; - } - .table-responsive-sm > .table-bordered { - border: 0; - } -} - -@media (max-width: 767.98px) { - .table-responsive-md { - display: block; - width: 100%; - overflow-x: auto; - -webkit-overflow-scrolling: touch; - } - .table-responsive-md > .table-bordered { - border: 0; - } -} - -@media (max-width: 991.98px) { - .table-responsive-lg { - display: block; - width: 100%; - overflow-x: auto; - -webkit-overflow-scrolling: touch; - } - .table-responsive-lg > .table-bordered { - border: 0; - } -} - -@media (max-width: 1199.98px) { - .table-responsive-xl { - display: block; - width: 100%; - overflow-x: auto; - -webkit-overflow-scrolling: touch; - } - .table-responsive-xl > .table-bordered { - border: 0; - } -} - -.table-responsive { - display: block; - width: 100%; - overflow-x: auto; - -webkit-overflow-scrolling: touch; -} - -.table-responsive > .table-bordered { - border: 0; -} - -.form-control { - display: block; - width: 100%; - height: calc(1.5em + 0.75rem + 2px); - padding: 0.375rem 0.75rem; - font-size: 1rem; - font-weight: 400; - line-height: 1.5; - color: #495057; - background-color: #fff; - background-clip: padding-box; - border: 1px solid #ced4da; - border-radius: 0.25rem; - transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; -} - -@media (prefers-reduced-motion: reduce) { - .form-control { - transition: none; - } -} - -.form-control::-ms-expand { - background-color: transparent; - border: 0; -} - -.form-control:-moz-focusring { - color: transparent; - text-shadow: 0 0 0 #495057; -} - -.form-control:focus { - color: #495057; - background-color: #fff; - border-color: #80bdff; - outline: 0; - box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); -} - -.form-control::-moz-placeholder { - color: #6c757d; - opacity: 1; -} - -.form-control:-ms-input-placeholder { - color: #6c757d; - opacity: 1; -} - -.form-control::placeholder { - color: #6c757d; - opacity: 1; -} - -.form-control:disabled, .form-control[readonly] { - background-color: #e9ecef; - opacity: 1; -} - -input[type="date"].form-control, -input[type="time"].form-control, -input[type="datetime-local"].form-control, -input[type="month"].form-control { - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; -} - -select.form-control:focus::-ms-value { - color: #495057; - background-color: #fff; -} - -.form-control-file, -.form-control-range { - display: block; - width: 100%; -} - -.col-form-label { - padding-top: calc(0.375rem + 1px); - padding-bottom: calc(0.375rem + 1px); - margin-bottom: 0; - font-size: inherit; - line-height: 1.5; -} - -.col-form-label-lg { - padding-top: calc(0.5rem + 1px); - padding-bottom: calc(0.5rem + 1px); - font-size: 1.25rem; - line-height: 1.5; -} - -.col-form-label-sm { - padding-top: calc(0.25rem + 1px); - padding-bottom: calc(0.25rem + 1px); - font-size: 0.875rem; - line-height: 1.5; -} - -.form-control-plaintext { - display: block; - width: 100%; - padding: 0.375rem 0; - margin-bottom: 0; - font-size: 1rem; - line-height: 1.5; - color: #212529; - background-color: transparent; - border: solid transparent; - border-width: 1px 0; -} - -.form-control-plaintext.form-control-sm, .form-control-plaintext.form-control-lg { - padding-right: 0; - padding-left: 0; -} - -.form-control-sm { - height: calc(1.5em + 0.5rem + 2px); - padding: 0.25rem 0.5rem; - font-size: 0.875rem; - line-height: 1.5; - border-radius: 0.2rem; -} - -.form-control-lg { - height: calc(1.5em + 1rem + 2px); - padding: 0.5rem 1rem; - font-size: 1.25rem; - line-height: 1.5; - border-radius: 0.3rem; -} - -select.form-control[size], select.form-control[multiple] { - height: auto; -} - -textarea.form-control { - height: auto; -} - -.form-group { - margin-bottom: 1rem; -} - -.form-text { - display: block; - margin-top: 0.25rem; -} - -.form-row { - display: flex; - flex-wrap: wrap; - margin-right: -5px; - margin-left: -5px; -} - -.form-row > .col, -.form-row > [class*="col-"] { - padding-right: 5px; - padding-left: 5px; -} - -.form-check { - position: relative; - display: block; - padding-left: 1.25rem; -} - -.form-check-input { - position: absolute; - margin-top: 0.3rem; - margin-left: -1.25rem; -} - -.form-check-input[disabled] ~ .form-check-label, -.form-check-input:disabled ~ .form-check-label { - color: #6c757d; -} - -.form-check-label { - margin-bottom: 0; -} - -.form-check-inline { - display: inline-flex; - align-items: center; - padding-left: 0; - margin-right: 0.75rem; -} - -.form-check-inline .form-check-input { - position: static; - margin-top: 0; - margin-right: 0.3125rem; - margin-left: 0; -} - -.valid-feedback { - display: none; - width: 100%; - margin-top: 0.25rem; - font-size: 80%; - color: #28a745; -} - -.valid-tooltip { - position: absolute; - top: 100%; - left: 0; - z-index: 5; - display: none; - max-width: 100%; - padding: 0.25rem 0.5rem; - margin-top: .1rem; - font-size: 0.875rem; - line-height: 1.5; - color: #fff; - background-color: rgba(40, 167, 69, 0.9); - border-radius: 0.25rem; -} - -.form-row > .col > .valid-tooltip, -.form-row > [class*="col-"] > .valid-tooltip { - left: 5px; -} - -.was-validated :valid ~ .valid-feedback, -.was-validated :valid ~ .valid-tooltip, -.is-valid ~ .valid-feedback, -.is-valid ~ .valid-tooltip { - display: block; -} - -.was-validated .form-control:valid, .form-control.is-valid { - border-color: #28a745; - padding-right: calc(1.5em + 0.75rem); - background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e"); - background-repeat: no-repeat; - background-position: right calc(0.375em + 0.1875rem) center; - background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem); -} - -.was-validated .form-control:valid:focus, .form-control.is-valid:focus { - border-color: #28a745; - box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25); -} - -.was-validated textarea.form-control:valid, textarea.form-control.is-valid { - padding-right: calc(1.5em + 0.75rem); - background-position: top calc(0.375em + 0.1875rem) right calc(0.375em + 0.1875rem); -} - -.was-validated .custom-select:valid, .custom-select.is-valid { - border-color: #28a745; - padding-right: calc(0.75em + 2.3125rem); - background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") right 0.75rem center/8px 10px no-repeat, #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e") center right 1.75rem/calc(0.75em + 0.375rem) calc(0.75em + 0.375rem) no-repeat; -} - -.was-validated .custom-select:valid:focus, .custom-select.is-valid:focus { - border-color: #28a745; - box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25); -} - -.was-validated .form-check-input:valid ~ .form-check-label, .form-check-input.is-valid ~ .form-check-label { - color: #28a745; -} - -.was-validated .form-check-input:valid ~ .valid-feedback, -.was-validated .form-check-input:valid ~ .valid-tooltip, .form-check-input.is-valid ~ .valid-feedback, -.form-check-input.is-valid ~ .valid-tooltip { - display: block; -} - -.was-validated .custom-control-input:valid ~ .custom-control-label, .custom-control-input.is-valid ~ .custom-control-label { - color: #28a745; -} - -.was-validated .custom-control-input:valid ~ .custom-control-label::before, .custom-control-input.is-valid ~ .custom-control-label::before { - border-color: #28a745; -} - -.was-validated .custom-control-input:valid:checked ~ .custom-control-label::before, .custom-control-input.is-valid:checked ~ .custom-control-label::before { - border-color: #34ce57; - background-color: #34ce57; -} - -.was-validated .custom-control-input:valid:focus ~ .custom-control-label::before, .custom-control-input.is-valid:focus ~ .custom-control-label::before { - box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25); -} - -.was-validated .custom-control-input:valid:focus:not(:checked) ~ .custom-control-label::before, .custom-control-input.is-valid:focus:not(:checked) ~ .custom-control-label::before { - border-color: #28a745; -} - -.was-validated .custom-file-input:valid ~ .custom-file-label, .custom-file-input.is-valid ~ .custom-file-label { - border-color: #28a745; -} - -.was-validated .custom-file-input:valid:focus ~ .custom-file-label, .custom-file-input.is-valid:focus ~ .custom-file-label { - border-color: #28a745; - box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25); -} - -.invalid-feedback { - display: none; - width: 100%; - margin-top: 0.25rem; - font-size: 80%; - color: #dc3545; -} - -.invalid-tooltip { - position: absolute; - top: 100%; - left: 0; - z-index: 5; - display: none; - max-width: 100%; - padding: 0.25rem 0.5rem; - margin-top: .1rem; - font-size: 0.875rem; - line-height: 1.5; - color: #fff; - background-color: rgba(220, 53, 69, 0.9); - border-radius: 0.25rem; -} - -.form-row > .col > .invalid-tooltip, -.form-row > [class*="col-"] > .invalid-tooltip { - left: 5px; -} - -.was-validated :invalid ~ .invalid-feedback, -.was-validated :invalid ~ .invalid-tooltip, -.is-invalid ~ .invalid-feedback, -.is-invalid ~ .invalid-tooltip { - display: block; -} - -.was-validated .form-control:invalid, .form-control.is-invalid { - border-color: #dc3545; - padding-right: calc(1.5em + 0.75rem); - background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e"); - background-repeat: no-repeat; - background-position: right calc(0.375em + 0.1875rem) center; - background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem); -} - -.was-validated .form-control:invalid:focus, .form-control.is-invalid:focus { - border-color: #dc3545; - box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25); -} - -.was-validated textarea.form-control:invalid, textarea.form-control.is-invalid { - padding-right: calc(1.5em + 0.75rem); - background-position: top calc(0.375em + 0.1875rem) right calc(0.375em + 0.1875rem); -} - -.was-validated .custom-select:invalid, .custom-select.is-invalid { - border-color: #dc3545; - padding-right: calc(0.75em + 2.3125rem); - background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") right 0.75rem center/8px 10px no-repeat, #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e") center right 1.75rem/calc(0.75em + 0.375rem) calc(0.75em + 0.375rem) no-repeat; -} - -.was-validated .custom-select:invalid:focus, .custom-select.is-invalid:focus { - border-color: #dc3545; - box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25); -} - -.was-validated .form-check-input:invalid ~ .form-check-label, .form-check-input.is-invalid ~ .form-check-label { - color: #dc3545; -} - -.was-validated .form-check-input:invalid ~ .invalid-feedback, -.was-validated .form-check-input:invalid ~ .invalid-tooltip, .form-check-input.is-invalid ~ .invalid-feedback, -.form-check-input.is-invalid ~ .invalid-tooltip { - display: block; -} - -.was-validated .custom-control-input:invalid ~ .custom-control-label, .custom-control-input.is-invalid ~ .custom-control-label { - color: #dc3545; -} - -.was-validated .custom-control-input:invalid ~ .custom-control-label::before, .custom-control-input.is-invalid ~ .custom-control-label::before { - border-color: #dc3545; -} - -.was-validated .custom-control-input:invalid:checked ~ .custom-control-label::before, .custom-control-input.is-invalid:checked ~ .custom-control-label::before { - border-color: #e4606d; - background-color: #e4606d; -} - -.was-validated .custom-control-input:invalid:focus ~ .custom-control-label::before, .custom-control-input.is-invalid:focus ~ .custom-control-label::before { - box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25); -} - -.was-validated .custom-control-input:invalid:focus:not(:checked) ~ .custom-control-label::before, .custom-control-input.is-invalid:focus:not(:checked) ~ .custom-control-label::before { - border-color: #dc3545; -} - -.was-validated .custom-file-input:invalid ~ .custom-file-label, .custom-file-input.is-invalid ~ .custom-file-label { - border-color: #dc3545; -} - -.was-validated .custom-file-input:invalid:focus ~ .custom-file-label, .custom-file-input.is-invalid:focus ~ .custom-file-label { - border-color: #dc3545; - box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25); -} - -.form-inline { - display: flex; - flex-flow: row wrap; - align-items: center; -} - -.form-inline .form-check { - width: 100%; -} - -@media (min-width: 576px) { - .form-inline label { - display: flex; - align-items: center; - justify-content: center; - margin-bottom: 0; - } - .form-inline .form-group { - display: flex; - flex: 0 0 auto; - flex-flow: row wrap; - align-items: center; - margin-bottom: 0; - } - .form-inline .form-control { - display: inline-block; - width: auto; - vertical-align: middle; - } - .form-inline .form-control-plaintext { - display: inline-block; - } - .form-inline .input-group, - .form-inline .custom-select { - width: auto; - } - .form-inline .form-check { - display: flex; - align-items: center; - justify-content: center; - width: auto; - padding-left: 0; - } - .form-inline .form-check-input { - position: relative; - flex-shrink: 0; - margin-top: 0; - margin-right: 0.25rem; - margin-left: 0; - } - .form-inline .custom-control { - align-items: center; - justify-content: center; - } - .form-inline .custom-control-label { - margin-bottom: 0; - } -} - -.btn { - display: inline-block; - font-weight: 400; - color: #212529; - text-align: center; - vertical-align: middle; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - background-color: transparent; - border: 1px solid transparent; - padding: 0.375rem 0.75rem; - font-size: 1rem; - line-height: 1.5; - border-radius: 0.25rem; - transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; -} - -@media (prefers-reduced-motion: reduce) { - .btn { - transition: none; - } -} - -.btn:hover { - color: #212529; - text-decoration: none; -} - -.btn:focus, .btn.focus { - outline: 0; - box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); -} - -.btn.disabled, .btn:disabled { - opacity: 0.65; -} - -.btn:not(:disabled):not(.disabled) { - cursor: pointer; -} - -a.btn.disabled, -fieldset:disabled a.btn { - pointer-events: none; -} - -.btn-primary { - color: #fff; - background-color: #007bff; - border-color: #007bff; -} - -.btn-primary:hover { - color: #fff; - background-color: #0069d9; - border-color: #0062cc; -} - -.btn-primary:focus, .btn-primary.focus { - color: #fff; - background-color: #0069d9; - border-color: #0062cc; - box-shadow: 0 0 0 0.2rem rgba(38, 143, 255, 0.5); -} - -.btn-primary.disabled, .btn-primary:disabled { - color: #fff; - background-color: #007bff; - border-color: #007bff; -} - -.btn-primary:not(:disabled):not(.disabled):active, .btn-primary:not(:disabled):not(.disabled).active, -.show > .btn-primary.dropdown-toggle { - color: #fff; - background-color: #0062cc; - border-color: #005cbf; -} - -.btn-primary:not(:disabled):not(.disabled):active:focus, .btn-primary:not(:disabled):not(.disabled).active:focus, -.show > .btn-primary.dropdown-toggle:focus { - box-shadow: 0 0 0 0.2rem rgba(38, 143, 255, 0.5); -} - -.btn-secondary { - color: #fff; - background-color: #6c757d; - border-color: #6c757d; -} - -.btn-secondary:hover { - color: #fff; - background-color: #5a6268; - border-color: #545b62; -} - -.btn-secondary:focus, .btn-secondary.focus { - color: #fff; - background-color: #5a6268; - border-color: #545b62; - box-shadow: 0 0 0 0.2rem rgba(130, 138, 145, 0.5); -} - -.btn-secondary.disabled, .btn-secondary:disabled { - color: #fff; - background-color: #6c757d; - border-color: #6c757d; -} - -.btn-secondary:not(:disabled):not(.disabled):active, .btn-secondary:not(:disabled):not(.disabled).active, -.show > .btn-secondary.dropdown-toggle { - color: #fff; - background-color: #545b62; - border-color: #4e555b; -} - -.btn-secondary:not(:disabled):not(.disabled):active:focus, .btn-secondary:not(:disabled):not(.disabled).active:focus, -.show > .btn-secondary.dropdown-toggle:focus { - box-shadow: 0 0 0 0.2rem rgba(130, 138, 145, 0.5); -} - -.btn-success { - color: #fff; - background-color: #28a745; - border-color: #28a745; -} - -.btn-success:hover { - color: #fff; - background-color: #218838; - border-color: #1e7e34; -} - -.btn-success:focus, .btn-success.focus { - color: #fff; - background-color: #218838; - border-color: #1e7e34; - box-shadow: 0 0 0 0.2rem rgba(72, 180, 97, 0.5); -} - -.btn-success.disabled, .btn-success:disabled { - color: #fff; - background-color: #28a745; - border-color: #28a745; -} - -.btn-success:not(:disabled):not(.disabled):active, .btn-success:not(:disabled):not(.disabled).active, -.show > .btn-success.dropdown-toggle { - color: #fff; - background-color: #1e7e34; - border-color: #1c7430; -} - -.btn-success:not(:disabled):not(.disabled):active:focus, .btn-success:not(:disabled):not(.disabled).active:focus, -.show > .btn-success.dropdown-toggle:focus { - box-shadow: 0 0 0 0.2rem rgba(72, 180, 97, 0.5); -} - -.btn-info { - color: #fff; - background-color: #17a2b8; - border-color: #17a2b8; -} - -.btn-info:hover { - color: #fff; - background-color: #138496; - border-color: #117a8b; -} - -.btn-info:focus, .btn-info.focus { - color: #fff; - background-color: #138496; - border-color: #117a8b; - box-shadow: 0 0 0 0.2rem rgba(58, 176, 195, 0.5); -} - -.btn-info.disabled, .btn-info:disabled { - color: #fff; - background-color: #17a2b8; - border-color: #17a2b8; -} - -.btn-info:not(:disabled):not(.disabled):active, .btn-info:not(:disabled):not(.disabled).active, -.show > .btn-info.dropdown-toggle { - color: #fff; - background-color: #117a8b; - border-color: #10707f; -} - -.btn-info:not(:disabled):not(.disabled):active:focus, .btn-info:not(:disabled):not(.disabled).active:focus, -.show > .btn-info.dropdown-toggle:focus { - box-shadow: 0 0 0 0.2rem rgba(58, 176, 195, 0.5); -} - -.btn-warning { - color: #212529; - background-color: #ffc107; - border-color: #ffc107; -} - -.btn-warning:hover { - color: #212529; - background-color: #e0a800; - border-color: #d39e00; -} - -.btn-warning:focus, .btn-warning.focus { - color: #212529; - background-color: #e0a800; - border-color: #d39e00; - box-shadow: 0 0 0 0.2rem rgba(222, 170, 12, 0.5); -} - -.btn-warning.disabled, .btn-warning:disabled { - color: #212529; - background-color: #ffc107; - border-color: #ffc107; -} - -.btn-warning:not(:disabled):not(.disabled):active, .btn-warning:not(:disabled):not(.disabled).active, -.show > .btn-warning.dropdown-toggle { - color: #212529; - background-color: #d39e00; - border-color: #c69500; -} - -.btn-warning:not(:disabled):not(.disabled):active:focus, .btn-warning:not(:disabled):not(.disabled).active:focus, -.show > .btn-warning.dropdown-toggle:focus { - box-shadow: 0 0 0 0.2rem rgba(222, 170, 12, 0.5); -} - -.btn-danger { - color: #fff; - background-color: #dc3545; - border-color: #dc3545; -} - -.btn-danger:hover { - color: #fff; - background-color: #c82333; - border-color: #bd2130; -} - -.btn-danger:focus, .btn-danger.focus { - color: #fff; - background-color: #c82333; - border-color: #bd2130; - box-shadow: 0 0 0 0.2rem rgba(225, 83, 97, 0.5); -} - -.btn-danger.disabled, .btn-danger:disabled { - color: #fff; - background-color: #dc3545; - border-color: #dc3545; -} - -.btn-danger:not(:disabled):not(.disabled):active, .btn-danger:not(:disabled):not(.disabled).active, -.show > .btn-danger.dropdown-toggle { - color: #fff; - background-color: #bd2130; - border-color: #b21f2d; -} - -.btn-danger:not(:disabled):not(.disabled):active:focus, .btn-danger:not(:disabled):not(.disabled).active:focus, -.show > .btn-danger.dropdown-toggle:focus { - box-shadow: 0 0 0 0.2rem rgba(225, 83, 97, 0.5); -} - -.btn-light { - color: #212529; - background-color: #f8f9fa; - border-color: #f8f9fa; -} - -.btn-light:hover { - color: #212529; - background-color: #e2e6ea; - border-color: #dae0e5; -} - -.btn-light:focus, .btn-light.focus { - color: #212529; - background-color: #e2e6ea; - border-color: #dae0e5; - box-shadow: 0 0 0 0.2rem rgba(216, 217, 219, 0.5); -} - -.btn-light.disabled, .btn-light:disabled { - color: #212529; - background-color: #f8f9fa; - border-color: #f8f9fa; -} - -.btn-light:not(:disabled):not(.disabled):active, .btn-light:not(:disabled):not(.disabled).active, -.show > .btn-light.dropdown-toggle { - color: #212529; - background-color: #dae0e5; - border-color: #d3d9df; -} - -.btn-light:not(:disabled):not(.disabled):active:focus, .btn-light:not(:disabled):not(.disabled).active:focus, -.show > .btn-light.dropdown-toggle:focus { - box-shadow: 0 0 0 0.2rem rgba(216, 217, 219, 0.5); -} - -.btn-dark { - color: #fff; - background-color: #343a40; - border-color: #343a40; -} - -.btn-dark:hover { - color: #fff; - background-color: #23272b; - border-color: #1d2124; -} - -.btn-dark:focus, .btn-dark.focus { - color: #fff; - background-color: #23272b; - border-color: #1d2124; - box-shadow: 0 0 0 0.2rem rgba(82, 88, 93, 0.5); -} - -.btn-dark.disabled, .btn-dark:disabled { - color: #fff; - background-color: #343a40; - border-color: #343a40; -} - -.btn-dark:not(:disabled):not(.disabled):active, .btn-dark:not(:disabled):not(.disabled).active, -.show > .btn-dark.dropdown-toggle { - color: #fff; - background-color: #1d2124; - border-color: #171a1d; -} - -.btn-dark:not(:disabled):not(.disabled):active:focus, .btn-dark:not(:disabled):not(.disabled).active:focus, -.show > .btn-dark.dropdown-toggle:focus { - box-shadow: 0 0 0 0.2rem rgba(82, 88, 93, 0.5); -} - -.btn-outline-primary { - color: #007bff; - border-color: #007bff; -} - -.btn-outline-primary:hover { - color: #fff; - background-color: #007bff; - border-color: #007bff; -} - -.btn-outline-primary:focus, .btn-outline-primary.focus { - box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5); -} - -.btn-outline-primary.disabled, .btn-outline-primary:disabled { - color: #007bff; - background-color: transparent; -} - -.btn-outline-primary:not(:disabled):not(.disabled):active, .btn-outline-primary:not(:disabled):not(.disabled).active, -.show > .btn-outline-primary.dropdown-toggle { - color: #fff; - background-color: #007bff; - border-color: #007bff; -} - -.btn-outline-primary:not(:disabled):not(.disabled):active:focus, .btn-outline-primary:not(:disabled):not(.disabled).active:focus, -.show > .btn-outline-primary.dropdown-toggle:focus { - box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5); -} - -.btn-outline-secondary { - color: #6c757d; - border-color: #6c757d; -} - -.btn-outline-secondary:hover { - color: #fff; - background-color: #6c757d; - border-color: #6c757d; -} - -.btn-outline-secondary:focus, .btn-outline-secondary.focus { - box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.5); -} - -.btn-outline-secondary.disabled, .btn-outline-secondary:disabled { - color: #6c757d; - background-color: transparent; -} - -.btn-outline-secondary:not(:disabled):not(.disabled):active, .btn-outline-secondary:not(:disabled):not(.disabled).active, -.show > .btn-outline-secondary.dropdown-toggle { - color: #fff; - background-color: #6c757d; - border-color: #6c757d; -} - -.btn-outline-secondary:not(:disabled):not(.disabled):active:focus, .btn-outline-secondary:not(:disabled):not(.disabled).active:focus, -.show > .btn-outline-secondary.dropdown-toggle:focus { - box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.5); -} - -.btn-outline-success { - color: #28a745; - border-color: #28a745; -} - -.btn-outline-success:hover { - color: #fff; - background-color: #28a745; - border-color: #28a745; -} - -.btn-outline-success:focus, .btn-outline-success.focus { - box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5); -} - -.btn-outline-success.disabled, .btn-outline-success:disabled { - color: #28a745; - background-color: transparent; -} - -.btn-outline-success:not(:disabled):not(.disabled):active, .btn-outline-success:not(:disabled):not(.disabled).active, -.show > .btn-outline-success.dropdown-toggle { - color: #fff; - background-color: #28a745; - border-color: #28a745; -} - -.btn-outline-success:not(:disabled):not(.disabled):active:focus, .btn-outline-success:not(:disabled):not(.disabled).active:focus, -.show > .btn-outline-success.dropdown-toggle:focus { - box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5); -} - -.btn-outline-info { - color: #17a2b8; - border-color: #17a2b8; -} - -.btn-outline-info:hover { - color: #fff; - background-color: #17a2b8; - border-color: #17a2b8; -} - -.btn-outline-info:focus, .btn-outline-info.focus { - box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.5); -} - -.btn-outline-info.disabled, .btn-outline-info:disabled { - color: #17a2b8; - background-color: transparent; -} - -.btn-outline-info:not(:disabled):not(.disabled):active, .btn-outline-info:not(:disabled):not(.disabled).active, -.show > .btn-outline-info.dropdown-toggle { - color: #fff; - background-color: #17a2b8; - border-color: #17a2b8; -} - -.btn-outline-info:not(:disabled):not(.disabled):active:focus, .btn-outline-info:not(:disabled):not(.disabled).active:focus, -.show > .btn-outline-info.dropdown-toggle:focus { - box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.5); -} - -.btn-outline-warning { - color: #ffc107; - border-color: #ffc107; -} - -.btn-outline-warning:hover { - color: #212529; - background-color: #ffc107; - border-color: #ffc107; -} - -.btn-outline-warning:focus, .btn-outline-warning.focus { - box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.5); -} - -.btn-outline-warning.disabled, .btn-outline-warning:disabled { - color: #ffc107; - background-color: transparent; -} - -.btn-outline-warning:not(:disabled):not(.disabled):active, .btn-outline-warning:not(:disabled):not(.disabled).active, -.show > .btn-outline-warning.dropdown-toggle { - color: #212529; - background-color: #ffc107; - border-color: #ffc107; -} - -.btn-outline-warning:not(:disabled):not(.disabled):active:focus, .btn-outline-warning:not(:disabled):not(.disabled).active:focus, -.show > .btn-outline-warning.dropdown-toggle:focus { - box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.5); -} - -.btn-outline-danger { - color: #dc3545; - border-color: #dc3545; -} - -.btn-outline-danger:hover { - color: #fff; - background-color: #dc3545; - border-color: #dc3545; -} - -.btn-outline-danger:focus, .btn-outline-danger.focus { - box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.5); -} - -.btn-outline-danger.disabled, .btn-outline-danger:disabled { - color: #dc3545; - background-color: transparent; -} - -.btn-outline-danger:not(:disabled):not(.disabled):active, .btn-outline-danger:not(:disabled):not(.disabled).active, -.show > .btn-outline-danger.dropdown-toggle { - color: #fff; - background-color: #dc3545; - border-color: #dc3545; -} - -.btn-outline-danger:not(:disabled):not(.disabled):active:focus, .btn-outline-danger:not(:disabled):not(.disabled).active:focus, -.show > .btn-outline-danger.dropdown-toggle:focus { - box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.5); -} - -.btn-outline-light { - color: #f8f9fa; - border-color: #f8f9fa; -} - -.btn-outline-light:hover { - color: #212529; - background-color: #f8f9fa; - border-color: #f8f9fa; -} - -.btn-outline-light:focus, .btn-outline-light.focus { - box-shadow: 0 0 0 0.2rem rgba(248, 249, 250, 0.5); -} - -.btn-outline-light.disabled, .btn-outline-light:disabled { - color: #f8f9fa; - background-color: transparent; -} - -.btn-outline-light:not(:disabled):not(.disabled):active, .btn-outline-light:not(:disabled):not(.disabled).active, -.show > .btn-outline-light.dropdown-toggle { - color: #212529; - background-color: #f8f9fa; - border-color: #f8f9fa; -} - -.btn-outline-light:not(:disabled):not(.disabled):active:focus, .btn-outline-light:not(:disabled):not(.disabled).active:focus, -.show > .btn-outline-light.dropdown-toggle:focus { - box-shadow: 0 0 0 0.2rem rgba(248, 249, 250, 0.5); -} - -.btn-outline-dark { - color: #343a40; - border-color: #343a40; -} - -.btn-outline-dark:hover { - color: #fff; - background-color: #343a40; - border-color: #343a40; -} - -.btn-outline-dark:focus, .btn-outline-dark.focus { - box-shadow: 0 0 0 0.2rem rgba(52, 58, 64, 0.5); -} - -.btn-outline-dark.disabled, .btn-outline-dark:disabled { - color: #343a40; - background-color: transparent; -} - -.btn-outline-dark:not(:disabled):not(.disabled):active, .btn-outline-dark:not(:disabled):not(.disabled).active, -.show > .btn-outline-dark.dropdown-toggle { - color: #fff; - background-color: #343a40; - border-color: #343a40; -} - -.btn-outline-dark:not(:disabled):not(.disabled):active:focus, .btn-outline-dark:not(:disabled):not(.disabled).active:focus, -.show > .btn-outline-dark.dropdown-toggle:focus { - box-shadow: 0 0 0 0.2rem rgba(52, 58, 64, 0.5); -} - -.btn-link { - font-weight: 400; - color: #007bff; - text-decoration: none; -} - -.btn-link:hover { - color: #0056b3; - text-decoration: underline; -} - -.btn-link:focus, .btn-link.focus { - text-decoration: underline; -} - -.btn-link:disabled, .btn-link.disabled { - color: #6c757d; - pointer-events: none; -} - -.btn-lg, .btn-group-lg > .btn { - padding: 0.5rem 1rem; - font-size: 1.25rem; - line-height: 1.5; - border-radius: 0.3rem; -} - -.btn-sm, .btn-group-sm > .btn { - padding: 0.25rem 0.5rem; - font-size: 0.875rem; - line-height: 1.5; - border-radius: 0.2rem; -} - -.btn-block { - display: block; - width: 100%; -} - -.btn-block + .btn-block { - margin-top: 0.5rem; -} - -input[type="submit"].btn-block, -input[type="reset"].btn-block, -input[type="button"].btn-block { - width: 100%; -} - -.fade { - transition: opacity 0.15s linear; -} - -@media (prefers-reduced-motion: reduce) { - .fade { - transition: none; - } -} - -.fade:not(.show) { - opacity: 0; -} - -.collapse:not(.show) { - display: none; -} - -.collapsing { - position: relative; - height: 0; - overflow: hidden; - transition: height 0.35s ease; -} - -@media (prefers-reduced-motion: reduce) { - .collapsing { - transition: none; - } -} - -.dropup, -.dropright, -.dropdown, -.dropleft { - position: relative; -} - -.dropdown-toggle { - white-space: nowrap; -} - -.dropdown-toggle::after { - display: inline-block; - margin-left: 0.255em; - vertical-align: 0.255em; - content: ""; - border-top: 0.3em solid; - border-right: 0.3em solid transparent; - border-bottom: 0; - border-left: 0.3em solid transparent; -} - -.dropdown-toggle:empty::after { - margin-left: 0; -} - -.dropdown-menu { - position: absolute; - top: 100%; - left: 0; - z-index: 1000; - display: none; - float: left; - min-width: 10rem; - padding: 0.5rem 0; - margin: 0.125rem 0 0; - font-size: 1rem; - color: #212529; - text-align: left; - list-style: none; - background-color: #fff; - background-clip: padding-box; - border: 1px solid rgba(0, 0, 0, 0.15); - border-radius: 0.25rem; -} - -.dropdown-menu-left { - right: auto; - left: 0; -} - -.dropdown-menu-right { - right: 0; - left: auto; -} - -@media (min-width: 576px) { - .dropdown-menu-sm-left { - right: auto; - left: 0; - } - .dropdown-menu-sm-right { - right: 0; - left: auto; - } -} - -@media (min-width: 768px) { - .dropdown-menu-md-left { - right: auto; - left: 0; - } - .dropdown-menu-md-right { - right: 0; - left: auto; - } -} - -@media (min-width: 992px) { - .dropdown-menu-lg-left { - right: auto; - left: 0; - } - .dropdown-menu-lg-right { - right: 0; - left: auto; - } -} - -@media (min-width: 1200px) { - .dropdown-menu-xl-left { - right: auto; - left: 0; - } - .dropdown-menu-xl-right { - right: 0; - left: auto; - } -} - -.dropup .dropdown-menu { - top: auto; - bottom: 100%; - margin-top: 0; - margin-bottom: 0.125rem; -} - -.dropup .dropdown-toggle::after { - display: inline-block; - margin-left: 0.255em; - vertical-align: 0.255em; - content: ""; - border-top: 0; - border-right: 0.3em solid transparent; - border-bottom: 0.3em solid; - border-left: 0.3em solid transparent; -} - -.dropup .dropdown-toggle:empty::after { - margin-left: 0; -} - -.dropright .dropdown-menu { - top: 0; - right: auto; - left: 100%; - margin-top: 0; - margin-left: 0.125rem; -} - -.dropright .dropdown-toggle::after { - display: inline-block; - margin-left: 0.255em; - vertical-align: 0.255em; - content: ""; - border-top: 0.3em solid transparent; - border-right: 0; - border-bottom: 0.3em solid transparent; - border-left: 0.3em solid; -} - -.dropright .dropdown-toggle:empty::after { - margin-left: 0; -} - -.dropright .dropdown-toggle::after { - vertical-align: 0; -} - -.dropleft .dropdown-menu { - top: 0; - right: 100%; - left: auto; - margin-top: 0; - margin-right: 0.125rem; -} - -.dropleft .dropdown-toggle::after { - display: inline-block; - margin-left: 0.255em; - vertical-align: 0.255em; - content: ""; -} - -.dropleft .dropdown-toggle::after { - display: none; -} - -.dropleft .dropdown-toggle::before { - display: inline-block; - margin-right: 0.255em; - vertical-align: 0.255em; - content: ""; - border-top: 0.3em solid transparent; - border-right: 0.3em solid; - border-bottom: 0.3em solid transparent; -} - -.dropleft .dropdown-toggle:empty::after { - margin-left: 0; -} - -.dropleft .dropdown-toggle::before { - vertical-align: 0; -} - -.dropdown-menu[x-placement^="top"], .dropdown-menu[x-placement^="right"], .dropdown-menu[x-placement^="bottom"], .dropdown-menu[x-placement^="left"] { - right: auto; - bottom: auto; -} - -.dropdown-divider { - height: 0; - margin: 0.5rem 0; - overflow: hidden; - border-top: 1px solid #e9ecef; -} - -.dropdown-item { - display: block; - width: 100%; - padding: 0.25rem 1.5rem; - clear: both; - font-weight: 400; - color: #212529; - text-align: inherit; - white-space: nowrap; - background-color: transparent; - border: 0; -} - -.dropdown-item:hover, .dropdown-item:focus { - color: #16181b; - text-decoration: none; - background-color: #e9ecef; -} - -.dropdown-item.active, .dropdown-item:active { - color: #fff; - text-decoration: none; - background-color: #007bff; -} - -.dropdown-item.disabled, .dropdown-item:disabled { - color: #adb5bd; - pointer-events: none; - background-color: transparent; -} - -.dropdown-menu.show { - display: block; -} - -.dropdown-header { - display: block; - padding: 0.5rem 1.5rem; - margin-bottom: 0; - font-size: 0.875rem; - color: #6c757d; - white-space: nowrap; -} - -.dropdown-item-text { - display: block; - padding: 0.25rem 1.5rem; - color: #212529; -} - -.btn-group, -.btn-group-vertical { - position: relative; - display: inline-flex; - vertical-align: middle; -} - -.btn-group > .btn, -.btn-group-vertical > .btn { - position: relative; - flex: 1 1 auto; -} - -.btn-group > .btn:hover, -.btn-group-vertical > .btn:hover { - z-index: 1; -} - -.btn-group > .btn:focus, .btn-group > .btn:active, .btn-group > .btn.active, -.btn-group-vertical > .btn:focus, -.btn-group-vertical > .btn:active, -.btn-group-vertical > .btn.active { - z-index: 1; -} - -.btn-toolbar { - display: flex; - flex-wrap: wrap; - justify-content: flex-start; -} - -.btn-toolbar .input-group { - width: auto; -} - -.btn-group > .btn:not(:first-child), -.btn-group > .btn-group:not(:first-child) { - margin-left: -1px; -} - -.btn-group > .btn:not(:last-child):not(.dropdown-toggle), -.btn-group > .btn-group:not(:last-child) > .btn { - border-top-right-radius: 0; - border-bottom-right-radius: 0; -} - -.btn-group > .btn:not(:first-child), -.btn-group > .btn-group:not(:first-child) > .btn { - border-top-left-radius: 0; - border-bottom-left-radius: 0; -} - -.dropdown-toggle-split { - padding-right: 0.5625rem; - padding-left: 0.5625rem; -} - -.dropdown-toggle-split::after, -.dropup .dropdown-toggle-split::after, -.dropright .dropdown-toggle-split::after { - margin-left: 0; -} - -.dropleft .dropdown-toggle-split::before { - margin-right: 0; -} - -.btn-sm + .dropdown-toggle-split, .btn-group-sm > .btn + .dropdown-toggle-split { - padding-right: 0.375rem; - padding-left: 0.375rem; -} - -.btn-lg + .dropdown-toggle-split, .btn-group-lg > .btn + .dropdown-toggle-split { - padding-right: 0.75rem; - padding-left: 0.75rem; -} - -.btn-group-vertical { - flex-direction: column; - align-items: flex-start; - justify-content: center; -} - -.btn-group-vertical > .btn, -.btn-group-vertical > .btn-group { - width: 100%; -} - -.btn-group-vertical > .btn:not(:first-child), -.btn-group-vertical > .btn-group:not(:first-child) { - margin-top: -1px; -} - -.btn-group-vertical > .btn:not(:last-child):not(.dropdown-toggle), -.btn-group-vertical > .btn-group:not(:last-child) > .btn { - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; -} - -.btn-group-vertical > .btn:not(:first-child), -.btn-group-vertical > .btn-group:not(:first-child) > .btn { - border-top-left-radius: 0; - border-top-right-radius: 0; -} - -.btn-group-toggle > .btn, -.btn-group-toggle > .btn-group > .btn { - margin-bottom: 0; -} - -.btn-group-toggle > .btn input[type="radio"], -.btn-group-toggle > .btn input[type="checkbox"], -.btn-group-toggle > .btn-group > .btn input[type="radio"], -.btn-group-toggle > .btn-group > .btn input[type="checkbox"] { - position: absolute; - clip: rect(0, 0, 0, 0); - pointer-events: none; -} - -.input-group { - position: relative; - display: flex; - flex-wrap: wrap; - align-items: stretch; - width: 100%; -} - -.input-group > .form-control, -.input-group > .form-control-plaintext, -.input-group > .custom-select, -.input-group > .custom-file { - position: relative; - flex: 1 1 auto; - width: 1%; - min-width: 0; - margin-bottom: 0; -} - -.input-group > .form-control + .form-control, -.input-group > .form-control + .custom-select, -.input-group > .form-control + .custom-file, -.input-group > .form-control-plaintext + .form-control, -.input-group > .form-control-plaintext + .custom-select, -.input-group > .form-control-plaintext + .custom-file, -.input-group > .custom-select + .form-control, -.input-group > .custom-select + .custom-select, -.input-group > .custom-select + .custom-file, -.input-group > .custom-file + .form-control, -.input-group > .custom-file + .custom-select, -.input-group > .custom-file + .custom-file { - margin-left: -1px; -} - -.input-group > .form-control:focus, -.input-group > .custom-select:focus, -.input-group > .custom-file .custom-file-input:focus ~ .custom-file-label { - z-index: 3; -} - -.input-group > .custom-file .custom-file-input:focus { - z-index: 4; -} - -.input-group > .form-control:not(:first-child), -.input-group > .custom-select:not(:first-child) { - border-top-left-radius: 0; - border-bottom-left-radius: 0; -} - -.input-group > .custom-file { - display: flex; - align-items: center; -} - -.input-group > .custom-file:not(:last-child) .custom-file-label, -.input-group > .custom-file:not(:first-child) .custom-file-label { - border-top-left-radius: 0; - border-bottom-left-radius: 0; -} - -.input-group:not(.has-validation) > .form-control:not(:last-child), -.input-group:not(.has-validation) > .custom-select:not(:last-child), -.input-group:not(.has-validation) > .custom-file:not(:last-child) .custom-file-label::after { - border-top-right-radius: 0; - border-bottom-right-radius: 0; -} - -.input-group.has-validation > .form-control:nth-last-child(n + 3), -.input-group.has-validation > .custom-select:nth-last-child(n + 3), -.input-group.has-validation > .custom-file:nth-last-child(n + 3) .custom-file-label::after { - border-top-right-radius: 0; - border-bottom-right-radius: 0; -} - -.input-group-prepend, -.input-group-append { - display: flex; -} - -.input-group-prepend .btn, -.input-group-append .btn { - position: relative; - z-index: 2; -} - -.input-group-prepend .btn:focus, -.input-group-append .btn:focus { - z-index: 3; -} - -.input-group-prepend .btn + .btn, -.input-group-prepend .btn + .input-group-text, -.input-group-prepend .input-group-text + .input-group-text, -.input-group-prepend .input-group-text + .btn, -.input-group-append .btn + .btn, -.input-group-append .btn + .input-group-text, -.input-group-append .input-group-text + .input-group-text, -.input-group-append .input-group-text + .btn { - margin-left: -1px; -} - -.input-group-prepend { - margin-right: -1px; -} - -.input-group-append { - margin-left: -1px; -} - -.input-group-text { - display: flex; - align-items: center; - padding: 0.375rem 0.75rem; - margin-bottom: 0; - font-size: 1rem; - font-weight: 400; - line-height: 1.5; - color: #495057; - text-align: center; - white-space: nowrap; - background-color: #e9ecef; - border: 1px solid #ced4da; - border-radius: 0.25rem; -} - -.input-group-text input[type="radio"], -.input-group-text input[type="checkbox"] { - margin-top: 0; -} - -.input-group-lg > .form-control:not(textarea), -.input-group-lg > .custom-select { - height: calc(1.5em + 1rem + 2px); -} - -.input-group-lg > .form-control, -.input-group-lg > .custom-select, -.input-group-lg > .input-group-prepend > .input-group-text, -.input-group-lg > .input-group-append > .input-group-text, -.input-group-lg > .input-group-prepend > .btn, -.input-group-lg > .input-group-append > .btn { - padding: 0.5rem 1rem; - font-size: 1.25rem; - line-height: 1.5; - border-radius: 0.3rem; -} - -.input-group-sm > .form-control:not(textarea), -.input-group-sm > .custom-select { - height: calc(1.5em + 0.5rem + 2px); -} - -.input-group-sm > .form-control, -.input-group-sm > .custom-select, -.input-group-sm > .input-group-prepend > .input-group-text, -.input-group-sm > .input-group-append > .input-group-text, -.input-group-sm > .input-group-prepend > .btn, -.input-group-sm > .input-group-append > .btn { - padding: 0.25rem 0.5rem; - font-size: 0.875rem; - line-height: 1.5; - border-radius: 0.2rem; -} - -.input-group-lg > .custom-select, -.input-group-sm > .custom-select { - padding-right: 1.75rem; -} - -.input-group > .input-group-prepend > .btn, -.input-group > .input-group-prepend > .input-group-text, -.input-group:not(.has-validation) > .input-group-append:not(:last-child) > .btn, -.input-group:not(.has-validation) > .input-group-append:not(:last-child) > .input-group-text, -.input-group.has-validation > .input-group-append:nth-last-child(n + 3) > .btn, -.input-group.has-validation > .input-group-append:nth-last-child(n + 3) > .input-group-text, -.input-group > .input-group-append:last-child > .btn:not(:last-child):not(.dropdown-toggle), -.input-group > .input-group-append:last-child > .input-group-text:not(:last-child) { - border-top-right-radius: 0; - border-bottom-right-radius: 0; -} - -.input-group > .input-group-append > .btn, -.input-group > .input-group-append > .input-group-text, -.input-group > .input-group-prepend:not(:first-child) > .btn, -.input-group > .input-group-prepend:not(:first-child) > .input-group-text, -.input-group > .input-group-prepend:first-child > .btn:not(:first-child), -.input-group > .input-group-prepend:first-child > .input-group-text:not(:first-child) { - border-top-left-radius: 0; - border-bottom-left-radius: 0; -} - -.custom-control { - position: relative; - z-index: 1; - display: block; - min-height: 1.5rem; - padding-left: 1.5rem; - -webkit-print-color-adjust: exact; - color-adjust: exact; -} - -.custom-control-inline { - display: inline-flex; - margin-right: 1rem; -} - -.custom-control-input { - position: absolute; - left: 0; - z-index: -1; - width: 1rem; - height: 1.25rem; - opacity: 0; -} - -.custom-control-input:checked ~ .custom-control-label::before { - color: #fff; - border-color: #007bff; - background-color: #007bff; -} - -.custom-control-input:focus ~ .custom-control-label::before { - box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); -} - -.custom-control-input:focus:not(:checked) ~ .custom-control-label::before { - border-color: #80bdff; -} - -.custom-control-input:not(:disabled):active ~ .custom-control-label::before { - color: #fff; - background-color: #b3d7ff; - border-color: #b3d7ff; -} - -.custom-control-input[disabled] ~ .custom-control-label, .custom-control-input:disabled ~ .custom-control-label { - color: #6c757d; -} - -.custom-control-input[disabled] ~ .custom-control-label::before, .custom-control-input:disabled ~ .custom-control-label::before { - background-color: #e9ecef; -} - -.custom-control-label { - position: relative; - margin-bottom: 0; - vertical-align: top; -} - -.custom-control-label::before { - position: absolute; - top: 0.25rem; - left: -1.5rem; - display: block; - width: 1rem; - height: 1rem; - pointer-events: none; - content: ""; - background-color: #fff; - border: #adb5bd solid 1px; -} - -.custom-control-label::after { - position: absolute; - top: 0.25rem; - left: -1.5rem; - display: block; - width: 1rem; - height: 1rem; - content: ""; - background: 50% / 50% 50% no-repeat; -} - -.custom-checkbox .custom-control-label::before { - border-radius: 0.25rem; -} - -.custom-checkbox .custom-control-input:checked ~ .custom-control-label::after { - background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z'/%3e%3c/svg%3e"); -} - -.custom-checkbox .custom-control-input:indeterminate ~ .custom-control-label::before { - border-color: #007bff; - background-color: #007bff; -} - -.custom-checkbox .custom-control-input:indeterminate ~ .custom-control-label::after { - background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3e%3cpath stroke='%23fff' d='M0 2h4'/%3e%3c/svg%3e"); -} - -.custom-checkbox .custom-control-input:disabled:checked ~ .custom-control-label::before { - background-color: rgba(0, 123, 255, 0.5); -} - -.custom-checkbox .custom-control-input:disabled:indeterminate ~ .custom-control-label::before { - background-color: rgba(0, 123, 255, 0.5); -} - -.custom-radio .custom-control-label::before { - border-radius: 50%; -} - -.custom-radio .custom-control-input:checked ~ .custom-control-label::after { - background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e"); -} - -.custom-radio .custom-control-input:disabled:checked ~ .custom-control-label::before { - background-color: rgba(0, 123, 255, 0.5); -} - -.custom-switch { - padding-left: 2.25rem; -} - -.custom-switch .custom-control-label::before { - left: -2.25rem; - width: 1.75rem; - pointer-events: all; - border-radius: 0.5rem; -} - -.custom-switch .custom-control-label::after { - top: calc(0.25rem + 2px); - left: calc(-2.25rem + 2px); - width: calc(1rem - 4px); - height: calc(1rem - 4px); - background-color: #adb5bd; - border-radius: 0.5rem; - transition: transform 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; -} - -@media (prefers-reduced-motion: reduce) { - .custom-switch .custom-control-label::after { - transition: none; - } -} - -.custom-switch .custom-control-input:checked ~ .custom-control-label::after { - background-color: #fff; - transform: translateX(0.75rem); -} - -.custom-switch .custom-control-input:disabled:checked ~ .custom-control-label::before { - background-color: rgba(0, 123, 255, 0.5); -} - -.custom-select { - display: inline-block; - width: 100%; - height: calc(1.5em + 0.75rem + 2px); - padding: 0.375rem 1.75rem 0.375rem 0.75rem; - font-size: 1rem; - font-weight: 400; - line-height: 1.5; - color: #495057; - vertical-align: middle; - background: #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") right 0.75rem center/8px 10px no-repeat; - border: 1px solid #ced4da; - border-radius: 0.25rem; - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; -} - -.custom-select:focus { - border-color: #80bdff; - outline: 0; - box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); -} - -.custom-select:focus::-ms-value { - color: #495057; - background-color: #fff; -} - -.custom-select[multiple], .custom-select[size]:not([size="1"]) { - height: auto; - padding-right: 0.75rem; - background-image: none; -} - -.custom-select:disabled { - color: #6c757d; - background-color: #e9ecef; -} - -.custom-select::-ms-expand { - display: none; -} - -.custom-select:-moz-focusring { - color: transparent; - text-shadow: 0 0 0 #495057; -} - -.custom-select-sm { - height: calc(1.5em + 0.5rem + 2px); - padding-top: 0.25rem; - padding-bottom: 0.25rem; - padding-left: 0.5rem; - font-size: 0.875rem; -} - -.custom-select-lg { - height: calc(1.5em + 1rem + 2px); - padding-top: 0.5rem; - padding-bottom: 0.5rem; - padding-left: 1rem; - font-size: 1.25rem; -} - -.custom-file { - position: relative; - display: inline-block; - width: 100%; - height: calc(1.5em + 0.75rem + 2px); - margin-bottom: 0; -} - -.custom-file-input { - position: relative; - z-index: 2; - width: 100%; - height: calc(1.5em + 0.75rem + 2px); - margin: 0; - overflow: hidden; - opacity: 0; -} - -.custom-file-input:focus ~ .custom-file-label { - border-color: #80bdff; - box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); -} - -.custom-file-input[disabled] ~ .custom-file-label, -.custom-file-input:disabled ~ .custom-file-label { - background-color: #e9ecef; -} - -.custom-file-input:lang(en) ~ .custom-file-label::after { - content: "Browse"; -} - -.custom-file-input ~ .custom-file-label[data-browse]::after { - content: attr(data-browse); -} - -.custom-file-label { - position: absolute; - top: 0; - right: 0; - left: 0; - z-index: 1; - height: calc(1.5em + 0.75rem + 2px); - padding: 0.375rem 0.75rem; - overflow: hidden; - font-weight: 400; - line-height: 1.5; - color: #495057; - background-color: #fff; - border: 1px solid #ced4da; - border-radius: 0.25rem; -} - -.custom-file-label::after { - position: absolute; - top: 0; - right: 0; - bottom: 0; - z-index: 3; - display: block; - height: calc(1.5em + 0.75rem); - padding: 0.375rem 0.75rem; - line-height: 1.5; - color: #495057; - content: "Browse"; - background-color: #e9ecef; - border-left: inherit; - border-radius: 0 0.25rem 0.25rem 0; -} - -.custom-range { - width: 100%; - height: 1.4rem; - padding: 0; - background-color: transparent; - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; -} - -.custom-range:focus { - outline: 0; -} - -.custom-range:focus::-webkit-slider-thumb { - box-shadow: 0 0 0 1px #fff, 0 0 0 0.2rem rgba(0, 123, 255, 0.25); -} - -.custom-range:focus::-moz-range-thumb { - box-shadow: 0 0 0 1px #fff, 0 0 0 0.2rem rgba(0, 123, 255, 0.25); -} - -.custom-range:focus::-ms-thumb { - box-shadow: 0 0 0 1px #fff, 0 0 0 0.2rem rgba(0, 123, 255, 0.25); -} - -.custom-range::-moz-focus-outer { - border: 0; -} - -.custom-range::-webkit-slider-thumb { - width: 1rem; - height: 1rem; - margin-top: -0.25rem; - background-color: #007bff; - border: 0; - border-radius: 1rem; - -webkit-transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; - transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; - -webkit-appearance: none; - appearance: none; -} - -@media (prefers-reduced-motion: reduce) { - .custom-range::-webkit-slider-thumb { - -webkit-transition: none; - transition: none; - } -} - -.custom-range::-webkit-slider-thumb:active { - background-color: #b3d7ff; -} - -.custom-range::-webkit-slider-runnable-track { - width: 100%; - height: 0.5rem; - color: transparent; - cursor: pointer; - background-color: #dee2e6; - border-color: transparent; - border-radius: 1rem; -} - -.custom-range::-moz-range-thumb { - width: 1rem; - height: 1rem; - background-color: #007bff; - border: 0; - border-radius: 1rem; - -moz-transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; - transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; - -moz-appearance: none; - appearance: none; -} - -@media (prefers-reduced-motion: reduce) { - .custom-range::-moz-range-thumb { - -moz-transition: none; - transition: none; - } -} - -.custom-range::-moz-range-thumb:active { - background-color: #b3d7ff; -} - -.custom-range::-moz-range-track { - width: 100%; - height: 0.5rem; - color: transparent; - cursor: pointer; - background-color: #dee2e6; - border-color: transparent; - border-radius: 1rem; -} - -.custom-range::-ms-thumb { - width: 1rem; - height: 1rem; - margin-top: 0; - margin-right: 0.2rem; - margin-left: 0.2rem; - background-color: #007bff; - border: 0; - border-radius: 1rem; - -ms-transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; - transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; - appearance: none; -} - -@media (prefers-reduced-motion: reduce) { - .custom-range::-ms-thumb { - -ms-transition: none; - transition: none; - } -} - -.custom-range::-ms-thumb:active { - background-color: #b3d7ff; -} - -.custom-range::-ms-track { - width: 100%; - height: 0.5rem; - color: transparent; - cursor: pointer; - background-color: transparent; - border-color: transparent; - border-width: 0.5rem; -} - -.custom-range::-ms-fill-lower { - background-color: #dee2e6; - border-radius: 1rem; -} - -.custom-range::-ms-fill-upper { - margin-right: 15px; - background-color: #dee2e6; - border-radius: 1rem; -} - -.custom-range:disabled::-webkit-slider-thumb { - background-color: #adb5bd; -} - -.custom-range:disabled::-webkit-slider-runnable-track { - cursor: default; -} - -.custom-range:disabled::-moz-range-thumb { - background-color: #adb5bd; -} - -.custom-range:disabled::-moz-range-track { - cursor: default; -} - -.custom-range:disabled::-ms-thumb { - background-color: #adb5bd; -} - -.custom-control-label::before, -.custom-file-label, -.custom-select { - transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; -} - -@media (prefers-reduced-motion: reduce) { - .custom-control-label::before, - .custom-file-label, - .custom-select { - transition: none; - } -} - -.nav { - display: flex; - flex-wrap: wrap; - padding-left: 0; - margin-bottom: 0; - list-style: none; -} - -.nav-link { - display: block; - padding: 0.5rem 1rem; -} - -.nav-link:hover, .nav-link:focus { - text-decoration: none; -} - -.nav-link.disabled { - color: #6c757d; - pointer-events: none; - cursor: default; -} - -.nav-tabs { - border-bottom: 1px solid #dee2e6; -} - -.nav-tabs .nav-link { - margin-bottom: -1px; - border: 1px solid transparent; - border-top-left-radius: 0.25rem; - border-top-right-radius: 0.25rem; -} - -.nav-tabs .nav-link:hover, .nav-tabs .nav-link:focus { - border-color: #e9ecef #e9ecef #dee2e6; -} - -.nav-tabs .nav-link.disabled { - color: #6c757d; - background-color: transparent; - border-color: transparent; -} - -.nav-tabs .nav-link.active, -.nav-tabs .nav-item.show .nav-link { - color: #495057; - background-color: #fff; - border-color: #dee2e6 #dee2e6 #fff; -} - -.nav-tabs .dropdown-menu { - margin-top: -1px; - border-top-left-radius: 0; - border-top-right-radius: 0; -} - -.nav-pills .nav-link { - border-radius: 0.25rem; -} - -.nav-pills .nav-link.active, -.nav-pills .show > .nav-link { - color: #fff; - background-color: #007bff; -} - -.nav-fill > .nav-link, -.nav-fill .nav-item { - flex: 1 1 auto; - text-align: center; -} - -.nav-justified > .nav-link, -.nav-justified .nav-item { - flex-basis: 0; - flex-grow: 1; - text-align: center; -} - -.tab-content > .tab-pane { - display: none; -} - -.tab-content > .active { - display: block; -} - -.navbar { - position: relative; - display: flex; - flex-wrap: wrap; - align-items: center; - justify-content: space-between; - padding: 0.5rem 1rem; -} - -.navbar .container, -.navbar .container-fluid, .navbar .container-sm, .navbar .container-md, .navbar .container-lg, .navbar .container-xl { - display: flex; - flex-wrap: wrap; - align-items: center; - justify-content: space-between; -} - -.navbar-brand { - display: inline-block; - padding-top: 0.3125rem; - padding-bottom: 0.3125rem; - margin-right: 1rem; - font-size: 1.25rem; - line-height: inherit; - white-space: nowrap; -} - -.navbar-brand:hover, .navbar-brand:focus { - text-decoration: none; -} - -.navbar-nav { - display: flex; - flex-direction: column; - padding-left: 0; - margin-bottom: 0; - list-style: none; -} - -.navbar-nav .nav-link { - padding-right: 0; - padding-left: 0; -} - -.navbar-nav .dropdown-menu { - position: static; - float: none; -} - -.navbar-text { - display: inline-block; - padding-top: 0.5rem; - padding-bottom: 0.5rem; -} - -.navbar-collapse { - flex-basis: 100%; - flex-grow: 1; - align-items: center; -} - -.navbar-toggler { - padding: 0.25rem 0.75rem; - font-size: 1.25rem; - line-height: 1; - background-color: transparent; - border: 1px solid transparent; - border-radius: 0.25rem; -} - -.navbar-toggler:hover, .navbar-toggler:focus { - text-decoration: none; -} - -.navbar-toggler-icon { - display: inline-block; - width: 1.5em; - height: 1.5em; - vertical-align: middle; - content: ""; - background: 50% / 100% 100% no-repeat; -} - -.navbar-nav-scroll { - max-height: 75vh; - overflow-y: auto; -} - -@media (max-width: 575.98px) { - .navbar-expand-sm > .container, - .navbar-expand-sm > .container-fluid, .navbar-expand-sm > .container-sm, .navbar-expand-sm > .container-md, .navbar-expand-sm > .container-lg, .navbar-expand-sm > .container-xl { - padding-right: 0; - padding-left: 0; - } -} - -@media (min-width: 576px) { - .navbar-expand-sm { - flex-flow: row nowrap; - justify-content: flex-start; - } - .navbar-expand-sm .navbar-nav { - flex-direction: row; - } - .navbar-expand-sm .navbar-nav .dropdown-menu { - position: absolute; - } - .navbar-expand-sm .navbar-nav .nav-link { - padding-right: 0.5rem; - padding-left: 0.5rem; - } - .navbar-expand-sm > .container, - .navbar-expand-sm > .container-fluid, .navbar-expand-sm > .container-sm, .navbar-expand-sm > .container-md, .navbar-expand-sm > .container-lg, .navbar-expand-sm > .container-xl { - flex-wrap: nowrap; - } - .navbar-expand-sm .navbar-nav-scroll { - overflow: visible; - } - .navbar-expand-sm .navbar-collapse { - display: flex !important; - flex-basis: auto; - } - .navbar-expand-sm .navbar-toggler { - display: none; - } -} - -@media (max-width: 767.98px) { - .navbar-expand-md > .container, - .navbar-expand-md > .container-fluid, .navbar-expand-md > .container-sm, .navbar-expand-md > .container-md, .navbar-expand-md > .container-lg, .navbar-expand-md > .container-xl { - padding-right: 0; - padding-left: 0; - } -} - -@media (min-width: 768px) { - .navbar-expand-md { - flex-flow: row nowrap; - justify-content: flex-start; - } - .navbar-expand-md .navbar-nav { - flex-direction: row; - } - .navbar-expand-md .navbar-nav .dropdown-menu { - position: absolute; - } - .navbar-expand-md .navbar-nav .nav-link { - padding-right: 0.5rem; - padding-left: 0.5rem; - } - .navbar-expand-md > .container, - .navbar-expand-md > .container-fluid, .navbar-expand-md > .container-sm, .navbar-expand-md > .container-md, .navbar-expand-md > .container-lg, .navbar-expand-md > .container-xl { - flex-wrap: nowrap; - } - .navbar-expand-md .navbar-nav-scroll { - overflow: visible; - } - .navbar-expand-md .navbar-collapse { - display: flex !important; - flex-basis: auto; - } - .navbar-expand-md .navbar-toggler { - display: none; - } -} - -@media (max-width: 991.98px) { - .navbar-expand-lg > .container, - .navbar-expand-lg > .container-fluid, .navbar-expand-lg > .container-sm, .navbar-expand-lg > .container-md, .navbar-expand-lg > .container-lg, .navbar-expand-lg > .container-xl { - padding-right: 0; - padding-left: 0; - } -} - -@media (min-width: 992px) { - .navbar-expand-lg { - flex-flow: row nowrap; - justify-content: flex-start; - } - .navbar-expand-lg .navbar-nav { - flex-direction: row; - } - .navbar-expand-lg .navbar-nav .dropdown-menu { - position: absolute; - } - .navbar-expand-lg .navbar-nav .nav-link { - padding-right: 0.5rem; - padding-left: 0.5rem; - } - .navbar-expand-lg > .container, - .navbar-expand-lg > .container-fluid, .navbar-expand-lg > .container-sm, .navbar-expand-lg > .container-md, .navbar-expand-lg > .container-lg, .navbar-expand-lg > .container-xl { - flex-wrap: nowrap; - } - .navbar-expand-lg .navbar-nav-scroll { - overflow: visible; - } - .navbar-expand-lg .navbar-collapse { - display: flex !important; - flex-basis: auto; - } - .navbar-expand-lg .navbar-toggler { - display: none; - } -} - -@media (max-width: 1199.98px) { - .navbar-expand-xl > .container, - .navbar-expand-xl > .container-fluid, .navbar-expand-xl > .container-sm, .navbar-expand-xl > .container-md, .navbar-expand-xl > .container-lg, .navbar-expand-xl > .container-xl { - padding-right: 0; - padding-left: 0; - } -} - -@media (min-width: 1200px) { - .navbar-expand-xl { - flex-flow: row nowrap; - justify-content: flex-start; - } - .navbar-expand-xl .navbar-nav { - flex-direction: row; - } - .navbar-expand-xl .navbar-nav .dropdown-menu { - position: absolute; - } - .navbar-expand-xl .navbar-nav .nav-link { - padding-right: 0.5rem; - padding-left: 0.5rem; - } - .navbar-expand-xl > .container, - .navbar-expand-xl > .container-fluid, .navbar-expand-xl > .container-sm, .navbar-expand-xl > .container-md, .navbar-expand-xl > .container-lg, .navbar-expand-xl > .container-xl { - flex-wrap: nowrap; - } - .navbar-expand-xl .navbar-nav-scroll { - overflow: visible; - } - .navbar-expand-xl .navbar-collapse { - display: flex !important; - flex-basis: auto; - } - .navbar-expand-xl .navbar-toggler { - display: none; - } -} - -.navbar-expand { - flex-flow: row nowrap; - justify-content: flex-start; -} - -.navbar-expand > .container, -.navbar-expand > .container-fluid, .navbar-expand > .container-sm, .navbar-expand > .container-md, .navbar-expand > .container-lg, .navbar-expand > .container-xl { - padding-right: 0; - padding-left: 0; -} - -.navbar-expand .navbar-nav { - flex-direction: row; -} - -.navbar-expand .navbar-nav .dropdown-menu { - position: absolute; -} - -.navbar-expand .navbar-nav .nav-link { - padding-right: 0.5rem; - padding-left: 0.5rem; -} - -.navbar-expand > .container, -.navbar-expand > .container-fluid, .navbar-expand > .container-sm, .navbar-expand > .container-md, .navbar-expand > .container-lg, .navbar-expand > .container-xl { - flex-wrap: nowrap; -} - -.navbar-expand .navbar-nav-scroll { - overflow: visible; -} - -.navbar-expand .navbar-collapse { - display: flex !important; - flex-basis: auto; -} - -.navbar-expand .navbar-toggler { - display: none; -} - -.navbar-light .navbar-brand { - color: rgba(0, 0, 0, 0.9); -} - -.navbar-light .navbar-brand:hover, .navbar-light .navbar-brand:focus { - color: rgba(0, 0, 0, 0.9); -} - -.navbar-light .navbar-nav .nav-link { - color: rgba(0, 0, 0, 0.5); -} - -.navbar-light .navbar-nav .nav-link:hover, .navbar-light .navbar-nav .nav-link:focus { - color: rgba(0, 0, 0, 0.7); -} - -.navbar-light .navbar-nav .nav-link.disabled { - color: rgba(0, 0, 0, 0.3); -} - -.navbar-light .navbar-nav .show > .nav-link, -.navbar-light .navbar-nav .active > .nav-link, -.navbar-light .navbar-nav .nav-link.show, -.navbar-light .navbar-nav .nav-link.active { - color: rgba(0, 0, 0, 0.9); -} - -.navbar-light .navbar-toggler { - color: rgba(0, 0, 0, 0.5); - border-color: rgba(0, 0, 0, 0.1); -} - -.navbar-light .navbar-toggler-icon { - background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 0, 0, 0.5%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e"); -} - -.navbar-light .navbar-text { - color: rgba(0, 0, 0, 0.5); -} - -.navbar-light .navbar-text a { - color: rgba(0, 0, 0, 0.9); -} - -.navbar-light .navbar-text a:hover, .navbar-light .navbar-text a:focus { - color: rgba(0, 0, 0, 0.9); -} - -.navbar-dark .navbar-brand { - color: #fff; -} - -.navbar-dark .navbar-brand:hover, .navbar-dark .navbar-brand:focus { - color: #fff; -} - -.navbar-dark .navbar-nav .nav-link { - color: rgba(255, 255, 255, 0.5); -} - -.navbar-dark .navbar-nav .nav-link:hover, .navbar-dark .navbar-nav .nav-link:focus { - color: rgba(255, 255, 255, 0.75); -} - -.navbar-dark .navbar-nav .nav-link.disabled { - color: rgba(255, 255, 255, 0.25); -} - -.navbar-dark .navbar-nav .show > .nav-link, -.navbar-dark .navbar-nav .active > .nav-link, -.navbar-dark .navbar-nav .nav-link.show, -.navbar-dark .navbar-nav .nav-link.active { - color: #fff; -} - -.navbar-dark .navbar-toggler { - color: rgba(255, 255, 255, 0.5); - border-color: rgba(255, 255, 255, 0.1); -} - -.navbar-dark .navbar-toggler-icon { - background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.5%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e"); -} - -.navbar-dark .navbar-text { - color: rgba(255, 255, 255, 0.5); -} - -.navbar-dark .navbar-text a { - color: #fff; -} - -.navbar-dark .navbar-text a:hover, .navbar-dark .navbar-text a:focus { - color: #fff; -} - -.card { - position: relative; - display: flex; - flex-direction: column; - min-width: 0; - word-wrap: break-word; - background-color: #fff; - background-clip: border-box; - border: 1px solid rgba(0, 0, 0, 0.125); - border-radius: 0.25rem; -} - -.card > hr { - margin-right: 0; - margin-left: 0; -} - -.card > .list-group { - border-top: inherit; - border-bottom: inherit; -} - -.card > .list-group:first-child { - border-top-width: 0; - border-top-left-radius: calc(0.25rem - 1px); - border-top-right-radius: calc(0.25rem - 1px); -} - -.card > .list-group:last-child { - border-bottom-width: 0; - border-bottom-right-radius: calc(0.25rem - 1px); - border-bottom-left-radius: calc(0.25rem - 1px); -} - -.card > .card-header + .list-group, -.card > .list-group + .card-footer { - border-top: 0; -} - -.card-body { - flex: 1 1 auto; - min-height: 1px; - padding: 1.25rem; -} - -.card-title { - margin-bottom: 0.75rem; -} - -.card-subtitle { - margin-top: -0.375rem; - margin-bottom: 0; -} - -.card-text:last-child { - margin-bottom: 0; -} - -.card-link:hover { - text-decoration: none; -} - -.card-link + .card-link { - margin-left: 1.25rem; -} - -.card-header { - padding: 0.75rem 1.25rem; - margin-bottom: 0; - background-color: rgba(0, 0, 0, 0.03); - border-bottom: 1px solid rgba(0, 0, 0, 0.125); -} - -.card-header:first-child { - border-radius: calc(0.25rem - 1px) calc(0.25rem - 1px) 0 0; -} - -.card-footer { - padding: 0.75rem 1.25rem; - background-color: rgba(0, 0, 0, 0.03); - border-top: 1px solid rgba(0, 0, 0, 0.125); -} - -.card-footer:last-child { - border-radius: 0 0 calc(0.25rem - 1px) calc(0.25rem - 1px); -} - -.card-header-tabs { - margin-right: -0.625rem; - margin-bottom: -0.75rem; - margin-left: -0.625rem; - border-bottom: 0; -} - -.card-header-pills { - margin-right: -0.625rem; - margin-left: -0.625rem; -} - -.card-img-overlay { - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - padding: 1.25rem; - border-radius: calc(0.25rem - 1px); -} - -.card-img, -.card-img-top, -.card-img-bottom { - flex-shrink: 0; - width: 100%; -} - -.card-img, -.card-img-top { - border-top-left-radius: calc(0.25rem - 1px); - border-top-right-radius: calc(0.25rem - 1px); -} - -.card-img, -.card-img-bottom { - border-bottom-right-radius: calc(0.25rem - 1px); - border-bottom-left-radius: calc(0.25rem - 1px); -} - -.card-deck .card { - margin-bottom: 15px; -} - -@media (min-width: 576px) { - .card-deck { - display: flex; - flex-flow: row wrap; - margin-right: -15px; - margin-left: -15px; - } - .card-deck .card { - flex: 1 0 0%; - margin-right: 15px; - margin-bottom: 0; - margin-left: 15px; - } -} - -.card-group > .card { - margin-bottom: 15px; -} - -@media (min-width: 576px) { - .card-group { - display: flex; - flex-flow: row wrap; - } - .card-group > .card { - flex: 1 0 0%; - margin-bottom: 0; - } - .card-group > .card + .card { - margin-left: 0; - border-left: 0; - } - .card-group > .card:not(:last-child) { - border-top-right-radius: 0; - border-bottom-right-radius: 0; - } - .card-group > .card:not(:last-child) .card-img-top, - .card-group > .card:not(:last-child) .card-header { - border-top-right-radius: 0; - } - .card-group > .card:not(:last-child) .card-img-bottom, - .card-group > .card:not(:last-child) .card-footer { - border-bottom-right-radius: 0; - } - .card-group > .card:not(:first-child) { - border-top-left-radius: 0; - border-bottom-left-radius: 0; - } - .card-group > .card:not(:first-child) .card-img-top, - .card-group > .card:not(:first-child) .card-header { - border-top-left-radius: 0; - } - .card-group > .card:not(:first-child) .card-img-bottom, - .card-group > .card:not(:first-child) .card-footer { - border-bottom-left-radius: 0; - } -} - -.card-columns .card { - margin-bottom: 0.75rem; -} - -@media (min-width: 576px) { - .card-columns { - -moz-column-count: 3; - column-count: 3; - -moz-column-gap: 1.25rem; - column-gap: 1.25rem; - orphans: 1; - widows: 1; - } - .card-columns .card { - display: inline-block; - width: 100%; - } -} - -.accordion { - overflow-anchor: none; -} - -.accordion > .card { - overflow: hidden; -} - -.accordion > .card:not(:last-of-type) { - border-bottom: 0; - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; -} - -.accordion > .card:not(:first-of-type) { - border-top-left-radius: 0; - border-top-right-radius: 0; -} - -.accordion > .card > .card-header { - border-radius: 0; - margin-bottom: -1px; -} - -.breadcrumb { - display: flex; - flex-wrap: wrap; - padding: 0.75rem 1rem; - margin-bottom: 1rem; - list-style: none; - background-color: #e9ecef; - border-radius: 0.25rem; -} - -.breadcrumb-item + .breadcrumb-item { - padding-left: 0.5rem; -} - -.breadcrumb-item + .breadcrumb-item::before { - float: left; - padding-right: 0.5rem; - color: #6c757d; - content: "/"; -} - -.breadcrumb-item + .breadcrumb-item:hover::before { - text-decoration: underline; -} - -.breadcrumb-item + .breadcrumb-item:hover::before { - text-decoration: none; -} - -.breadcrumb-item.active { - color: #6c757d; -} - -.pagination { - display: flex; - padding-left: 0; - list-style: none; - border-radius: 0.25rem; -} - -.page-link { - position: relative; - display: block; - padding: 0.5rem 0.75rem; - margin-left: -1px; - line-height: 1.25; - color: #007bff; - background-color: #fff; - border: 1px solid #dee2e6; -} - -.page-link:hover { - z-index: 2; - color: #0056b3; - text-decoration: none; - background-color: #e9ecef; - border-color: #dee2e6; -} - -.page-link:focus { - z-index: 3; - outline: 0; - box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); -} - -.page-item:first-child .page-link { - margin-left: 0; - border-top-left-radius: 0.25rem; - border-bottom-left-radius: 0.25rem; -} - -.page-item:last-child .page-link { - border-top-right-radius: 0.25rem; - border-bottom-right-radius: 0.25rem; -} - -.page-item.active .page-link { - z-index: 3; - color: #fff; - background-color: #007bff; - border-color: #007bff; -} - -.page-item.disabled .page-link { - color: #6c757d; - pointer-events: none; - cursor: auto; - background-color: #fff; - border-color: #dee2e6; -} - -.pagination-lg .page-link { - padding: 0.75rem 1.5rem; - font-size: 1.25rem; - line-height: 1.5; -} - -.pagination-lg .page-item:first-child .page-link { - border-top-left-radius: 0.3rem; - border-bottom-left-radius: 0.3rem; -} - -.pagination-lg .page-item:last-child .page-link { - border-top-right-radius: 0.3rem; - border-bottom-right-radius: 0.3rem; -} - -.pagination-sm .page-link { - padding: 0.25rem 0.5rem; - font-size: 0.875rem; - line-height: 1.5; -} - -.pagination-sm .page-item:first-child .page-link { - border-top-left-radius: 0.2rem; - border-bottom-left-radius: 0.2rem; -} - -.pagination-sm .page-item:last-child .page-link { - border-top-right-radius: 0.2rem; - border-bottom-right-radius: 0.2rem; -} - -.badge { - display: inline-block; - padding: 0.25em 0.4em; - font-size: 75%; - font-weight: 700; - line-height: 1; - text-align: center; - white-space: nowrap; - vertical-align: baseline; - border-radius: 0.25rem; - transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; -} - -@media (prefers-reduced-motion: reduce) { - .badge { - transition: none; - } -} - -a.badge:hover, a.badge:focus { - text-decoration: none; -} - -.badge:empty { - display: none; -} - -.btn .badge { - position: relative; - top: -1px; -} - -.badge-pill { - padding-right: 0.6em; - padding-left: 0.6em; - border-radius: 10rem; -} - -.badge-primary { - color: #fff; - background-color: #007bff; -} - -a.badge-primary:hover, a.badge-primary:focus { - color: #fff; - background-color: #0062cc; -} - -a.badge-primary:focus, a.badge-primary.focus { - outline: 0; - box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5); -} - -.badge-secondary { - color: #fff; - background-color: #6c757d; -} - -a.badge-secondary:hover, a.badge-secondary:focus { - color: #fff; - background-color: #545b62; -} - -a.badge-secondary:focus, a.badge-secondary.focus { - outline: 0; - box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.5); -} - -.badge-success { - color: #fff; - background-color: #28a745; -} - -a.badge-success:hover, a.badge-success:focus { - color: #fff; - background-color: #1e7e34; -} - -a.badge-success:focus, a.badge-success.focus { - outline: 0; - box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5); -} - -.badge-info { - color: #fff; - background-color: #17a2b8; -} - -a.badge-info:hover, a.badge-info:focus { - color: #fff; - background-color: #117a8b; -} - -a.badge-info:focus, a.badge-info.focus { - outline: 0; - box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.5); -} - -.badge-warning { - color: #212529; - background-color: #ffc107; -} - -a.badge-warning:hover, a.badge-warning:focus { - color: #212529; - background-color: #d39e00; -} - -a.badge-warning:focus, a.badge-warning.focus { - outline: 0; - box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.5); -} - -.badge-danger { - color: #fff; - background-color: #dc3545; -} - -a.badge-danger:hover, a.badge-danger:focus { - color: #fff; - background-color: #bd2130; -} - -a.badge-danger:focus, a.badge-danger.focus { - outline: 0; - box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.5); -} - -.badge-light { - color: #212529; - background-color: #f8f9fa; -} - -a.badge-light:hover, a.badge-light:focus { - color: #212529; - background-color: #dae0e5; -} - -a.badge-light:focus, a.badge-light.focus { - outline: 0; - box-shadow: 0 0 0 0.2rem rgba(248, 249, 250, 0.5); -} - -.badge-dark { - color: #fff; - background-color: #343a40; -} - -a.badge-dark:hover, a.badge-dark:focus { - color: #fff; - background-color: #1d2124; -} - -a.badge-dark:focus, a.badge-dark.focus { - outline: 0; - box-shadow: 0 0 0 0.2rem rgba(52, 58, 64, 0.5); -} - -.jumbotron { - padding: 2rem 1rem; - margin-bottom: 2rem; - background-color: #e9ecef; - border-radius: 0.3rem; -} - -@media (min-width: 576px) { - .jumbotron { - padding: 4rem 2rem; - } -} - -.jumbotron-fluid { - padding-right: 0; - padding-left: 0; - border-radius: 0; -} - -.alert { - position: relative; - padding: 0.75rem 1.25rem; - margin-bottom: 1rem; - border: 1px solid transparent; - border-radius: 0.25rem; -} - -.alert-heading { - color: inherit; -} - -.alert-link { - font-weight: 700; -} - -.alert-dismissible { - padding-right: 4rem; -} - -.alert-dismissible .close { - position: absolute; - top: 0; - right: 0; - z-index: 2; - padding: 0.75rem 1.25rem; - color: inherit; -} - -.alert-primary { - color: #004085; - background-color: #cce5ff; - border-color: #b8daff; -} - -.alert-primary hr { - border-top-color: #9fcdff; -} - -.alert-primary .alert-link { - color: #002752; -} - -.alert-secondary { - color: #383d41; - background-color: #e2e3e5; - border-color: #d6d8db; -} - -.alert-secondary hr { - border-top-color: #c8cbcf; -} - -.alert-secondary .alert-link { - color: #202326; -} - -.alert-success { - color: #155724; - background-color: #d4edda; - border-color: #c3e6cb; -} - -.alert-success hr { - border-top-color: #b1dfbb; -} - -.alert-success .alert-link { - color: #0b2e13; -} - -.alert-info { - color: #0c5460; - background-color: #d1ecf1; - border-color: #bee5eb; -} - -.alert-info hr { - border-top-color: #abdde5; -} - -.alert-info .alert-link { - color: #062c33; -} - -.alert-warning { - color: #856404; - background-color: #fff3cd; - border-color: #ffeeba; -} - -.alert-warning hr { - border-top-color: #ffe8a1; -} - -.alert-warning .alert-link { - color: #533f03; -} - -.alert-danger { - color: #721c24; - background-color: #f8d7da; - border-color: #f5c6cb; -} - -.alert-danger hr { - border-top-color: #f1b0b7; -} - -.alert-danger .alert-link { - color: #491217; -} - -.alert-light { - color: #818182; - background-color: #fefefe; - border-color: #fdfdfe; -} - -.alert-light hr { - border-top-color: #ececf6; -} - -.alert-light .alert-link { - color: #686868; -} - -.alert-dark { - color: #1b1e21; - background-color: #d6d8d9; - border-color: #c6c8ca; -} - -.alert-dark hr { - border-top-color: #b9bbbe; -} - -.alert-dark .alert-link { - color: #040505; -} - -@-webkit-keyframes progress-bar-stripes { - from { - background-position: 1rem 0; - } - to { - background-position: 0 0; - } -} - -@keyframes progress-bar-stripes { - from { - background-position: 1rem 0; - } - to { - background-position: 0 0; - } -} - -.progress { - display: flex; - height: 1rem; - overflow: hidden; - line-height: 0; - font-size: 0.75rem; - background-color: #e9ecef; - border-radius: 0.25rem; -} - -.progress-bar { - display: flex; - flex-direction: column; - justify-content: center; - overflow: hidden; - color: #fff; - text-align: center; - white-space: nowrap; - background-color: #007bff; - transition: width 0.6s ease; -} - -@media (prefers-reduced-motion: reduce) { - .progress-bar { - transition: none; - } -} - -.progress-bar-striped { - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-size: 1rem 1rem; -} - -.progress-bar-animated { - -webkit-animation: 1s linear infinite progress-bar-stripes; - animation: 1s linear infinite progress-bar-stripes; -} - -@media (prefers-reduced-motion: reduce) { - .progress-bar-animated { - -webkit-animation: none; - animation: none; - } -} - -.media { - display: flex; - align-items: flex-start; -} - -.media-body { - flex: 1; -} - -.list-group { - display: flex; - flex-direction: column; - padding-left: 0; - margin-bottom: 0; - border-radius: 0.25rem; -} - -.list-group-item-action { - width: 100%; - color: #495057; - text-align: inherit; -} - -.list-group-item-action:hover, .list-group-item-action:focus { - z-index: 1; - color: #495057; - text-decoration: none; - background-color: #f8f9fa; -} - -.list-group-item-action:active { - color: #212529; - background-color: #e9ecef; -} - -.list-group-item { - position: relative; - display: block; - padding: 0.75rem 1.25rem; - background-color: #fff; - border: 1px solid rgba(0, 0, 0, 0.125); -} - -.list-group-item:first-child { - border-top-left-radius: inherit; - border-top-right-radius: inherit; -} - -.list-group-item:last-child { - border-bottom-right-radius: inherit; - border-bottom-left-radius: inherit; -} - -.list-group-item.disabled, .list-group-item:disabled { - color: #6c757d; - pointer-events: none; - background-color: #fff; -} - -.list-group-item.active { - z-index: 2; - color: #fff; - background-color: #007bff; - border-color: #007bff; -} - -.list-group-item + .list-group-item { - border-top-width: 0; -} - -.list-group-item + .list-group-item.active { - margin-top: -1px; - border-top-width: 1px; -} - -.list-group-horizontal { - flex-direction: row; -} - -.list-group-horizontal > .list-group-item:first-child { - border-bottom-left-radius: 0.25rem; - border-top-right-radius: 0; -} - -.list-group-horizontal > .list-group-item:last-child { - border-top-right-radius: 0.25rem; - border-bottom-left-radius: 0; -} - -.list-group-horizontal > .list-group-item.active { - margin-top: 0; -} - -.list-group-horizontal > .list-group-item + .list-group-item { - border-top-width: 1px; - border-left-width: 0; -} - -.list-group-horizontal > .list-group-item + .list-group-item.active { - margin-left: -1px; - border-left-width: 1px; -} - -@media (min-width: 576px) { - .list-group-horizontal-sm { - flex-direction: row; - } - .list-group-horizontal-sm > .list-group-item:first-child { - border-bottom-left-radius: 0.25rem; - border-top-right-radius: 0; - } - .list-group-horizontal-sm > .list-group-item:last-child { - border-top-right-radius: 0.25rem; - border-bottom-left-radius: 0; - } - .list-group-horizontal-sm > .list-group-item.active { - margin-top: 0; - } - .list-group-horizontal-sm > .list-group-item + .list-group-item { - border-top-width: 1px; - border-left-width: 0; - } - .list-group-horizontal-sm > .list-group-item + .list-group-item.active { - margin-left: -1px; - border-left-width: 1px; - } -} - -@media (min-width: 768px) { - .list-group-horizontal-md { - flex-direction: row; - } - .list-group-horizontal-md > .list-group-item:first-child { - border-bottom-left-radius: 0.25rem; - border-top-right-radius: 0; - } - .list-group-horizontal-md > .list-group-item:last-child { - border-top-right-radius: 0.25rem; - border-bottom-left-radius: 0; - } - .list-group-horizontal-md > .list-group-item.active { - margin-top: 0; - } - .list-group-horizontal-md > .list-group-item + .list-group-item { - border-top-width: 1px; - border-left-width: 0; - } - .list-group-horizontal-md > .list-group-item + .list-group-item.active { - margin-left: -1px; - border-left-width: 1px; - } -} - -@media (min-width: 992px) { - .list-group-horizontal-lg { - flex-direction: row; - } - .list-group-horizontal-lg > .list-group-item:first-child { - border-bottom-left-radius: 0.25rem; - border-top-right-radius: 0; - } - .list-group-horizontal-lg > .list-group-item:last-child { - border-top-right-radius: 0.25rem; - border-bottom-left-radius: 0; - } - .list-group-horizontal-lg > .list-group-item.active { - margin-top: 0; - } - .list-group-horizontal-lg > .list-group-item + .list-group-item { - border-top-width: 1px; - border-left-width: 0; - } - .list-group-horizontal-lg > .list-group-item + .list-group-item.active { - margin-left: -1px; - border-left-width: 1px; - } -} - -@media (min-width: 1200px) { - .list-group-horizontal-xl { - flex-direction: row; - } - .list-group-horizontal-xl > .list-group-item:first-child { - border-bottom-left-radius: 0.25rem; - border-top-right-radius: 0; - } - .list-group-horizontal-xl > .list-group-item:last-child { - border-top-right-radius: 0.25rem; - border-bottom-left-radius: 0; - } - .list-group-horizontal-xl > .list-group-item.active { - margin-top: 0; - } - .list-group-horizontal-xl > .list-group-item + .list-group-item { - border-top-width: 1px; - border-left-width: 0; - } - .list-group-horizontal-xl > .list-group-item + .list-group-item.active { - margin-left: -1px; - border-left-width: 1px; - } -} - -.list-group-flush { - border-radius: 0; -} - -.list-group-flush > .list-group-item { - border-width: 0 0 1px; -} - -.list-group-flush > .list-group-item:last-child { - border-bottom-width: 0; -} - -.list-group-item-primary { - color: #004085; - background-color: #b8daff; -} - -.list-group-item-primary.list-group-item-action:hover, .list-group-item-primary.list-group-item-action:focus { - color: #004085; - background-color: #9fcdff; -} - -.list-group-item-primary.list-group-item-action.active { - color: #fff; - background-color: #004085; - border-color: #004085; -} - -.list-group-item-secondary { - color: #383d41; - background-color: #d6d8db; -} - -.list-group-item-secondary.list-group-item-action:hover, .list-group-item-secondary.list-group-item-action:focus { - color: #383d41; - background-color: #c8cbcf; -} - -.list-group-item-secondary.list-group-item-action.active { - color: #fff; - background-color: #383d41; - border-color: #383d41; -} - -.list-group-item-success { - color: #155724; - background-color: #c3e6cb; -} - -.list-group-item-success.list-group-item-action:hover, .list-group-item-success.list-group-item-action:focus { - color: #155724; - background-color: #b1dfbb; -} - -.list-group-item-success.list-group-item-action.active { - color: #fff; - background-color: #155724; - border-color: #155724; -} - -.list-group-item-info { - color: #0c5460; - background-color: #bee5eb; -} - -.list-group-item-info.list-group-item-action:hover, .list-group-item-info.list-group-item-action:focus { - color: #0c5460; - background-color: #abdde5; -} - -.list-group-item-info.list-group-item-action.active { - color: #fff; - background-color: #0c5460; - border-color: #0c5460; -} - -.list-group-item-warning { - color: #856404; - background-color: #ffeeba; -} - -.list-group-item-warning.list-group-item-action:hover, .list-group-item-warning.list-group-item-action:focus { - color: #856404; - background-color: #ffe8a1; -} - -.list-group-item-warning.list-group-item-action.active { - color: #fff; - background-color: #856404; - border-color: #856404; -} - -.list-group-item-danger { - color: #721c24; - background-color: #f5c6cb; -} - -.list-group-item-danger.list-group-item-action:hover, .list-group-item-danger.list-group-item-action:focus { - color: #721c24; - background-color: #f1b0b7; -} - -.list-group-item-danger.list-group-item-action.active { - color: #fff; - background-color: #721c24; - border-color: #721c24; -} - -.list-group-item-light { - color: #818182; - background-color: #fdfdfe; -} - -.list-group-item-light.list-group-item-action:hover, .list-group-item-light.list-group-item-action:focus { - color: #818182; - background-color: #ececf6; -} - -.list-group-item-light.list-group-item-action.active { - color: #fff; - background-color: #818182; - border-color: #818182; -} - -.list-group-item-dark { - color: #1b1e21; - background-color: #c6c8ca; -} - -.list-group-item-dark.list-group-item-action:hover, .list-group-item-dark.list-group-item-action:focus { - color: #1b1e21; - background-color: #b9bbbe; -} - -.list-group-item-dark.list-group-item-action.active { - color: #fff; - background-color: #1b1e21; - border-color: #1b1e21; -} - -.close { - float: right; - font-size: 1.5rem; - font-weight: 700; - line-height: 1; - color: #000; - text-shadow: 0 1px 0 #fff; - opacity: .5; -} - -.close:hover { - color: #000; - text-decoration: none; -} - -.close:not(:disabled):not(.disabled):hover, .close:not(:disabled):not(.disabled):focus { - opacity: .75; -} - -button.close { - padding: 0; - background-color: transparent; - border: 0; -} - -a.close.disabled { - pointer-events: none; -} - -.toast { - flex-basis: 350px; - max-width: 350px; - font-size: 0.875rem; - background-color: rgba(255, 255, 255, 0.85); - background-clip: padding-box; - border: 1px solid rgba(0, 0, 0, 0.1); - box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1); - opacity: 0; - border-radius: 0.25rem; -} - -.toast:not(:last-child) { - margin-bottom: 0.75rem; -} - -.toast.showing { - opacity: 1; -} - -.toast.show { - display: block; - opacity: 1; -} - -.toast.hide { - display: none; -} - -.toast-header { - display: flex; - align-items: center; - padding: 0.25rem 0.75rem; - color: #6c757d; - background-color: rgba(255, 255, 255, 0.85); - background-clip: padding-box; - border-bottom: 1px solid rgba(0, 0, 0, 0.05); - border-top-left-radius: calc(0.25rem - 1px); - border-top-right-radius: calc(0.25rem - 1px); -} - -.toast-body { - padding: 0.75rem; -} - -.modal-open { - overflow: hidden; -} - -.modal-open .modal { - overflow-x: hidden; - overflow-y: auto; -} - -.modal { - position: fixed; - top: 0; - left: 0; - z-index: 1050; - display: none; - width: 100%; - height: 100%; - overflow: hidden; - outline: 0; -} - -.modal-dialog { - position: relative; - width: auto; - margin: 0.5rem; - pointer-events: none; -} - -.modal.fade .modal-dialog { - transition: transform 0.3s ease-out; - transform: translate(0, -50px); -} - -@media (prefers-reduced-motion: reduce) { - .modal.fade .modal-dialog { - transition: none; - } -} - -.modal.show .modal-dialog { - transform: none; -} - -.modal.modal-static .modal-dialog { - transform: scale(1.02); -} - -.modal-dialog-scrollable { - display: flex; - max-height: calc(100% - 1rem); -} - -.modal-dialog-scrollable .modal-content { - max-height: calc(100vh - 1rem); - overflow: hidden; -} - -.modal-dialog-scrollable .modal-header, -.modal-dialog-scrollable .modal-footer { - flex-shrink: 0; -} - -.modal-dialog-scrollable .modal-body { - overflow-y: auto; -} - -.modal-dialog-centered { - display: flex; - align-items: center; - min-height: calc(100% - 1rem); -} - -.modal-dialog-centered::before { - display: block; - height: calc(100vh - 1rem); - height: -webkit-min-content; - height: -moz-min-content; - height: min-content; - content: ""; -} - -.modal-dialog-centered.modal-dialog-scrollable { - flex-direction: column; - justify-content: center; - height: 100%; -} - -.modal-dialog-centered.modal-dialog-scrollable .modal-content { - max-height: none; -} - -.modal-dialog-centered.modal-dialog-scrollable::before { - content: none; -} - -.modal-content { - position: relative; - display: flex; - flex-direction: column; - width: 100%; - pointer-events: auto; - background-color: #fff; - background-clip: padding-box; - border: 1px solid rgba(0, 0, 0, 0.2); - border-radius: 0.3rem; - outline: 0; -} - -.modal-backdrop { - position: fixed; - top: 0; - left: 0; - z-index: 1040; - width: 100vw; - height: 100vh; - background-color: #000; -} - -.modal-backdrop.fade { - opacity: 0; -} - -.modal-backdrop.show { - opacity: 0.5; -} - -.modal-header { - display: flex; - align-items: flex-start; - justify-content: space-between; - padding: 1rem 1rem; - border-bottom: 1px solid #dee2e6; - border-top-left-radius: calc(0.3rem - 1px); - border-top-right-radius: calc(0.3rem - 1px); -} - -.modal-header .close { - padding: 1rem 1rem; - margin: -1rem -1rem -1rem auto; -} - -.modal-title { - margin-bottom: 0; - line-height: 1.5; -} - -.modal-body { - position: relative; - flex: 1 1 auto; - padding: 1rem; -} - -.modal-footer { - display: flex; - flex-wrap: wrap; - align-items: center; - justify-content: flex-end; - padding: 0.75rem; - border-top: 1px solid #dee2e6; - border-bottom-right-radius: calc(0.3rem - 1px); - border-bottom-left-radius: calc(0.3rem - 1px); -} - -.modal-footer > * { - margin: 0.25rem; -} - -.modal-scrollbar-measure { - position: absolute; - top: -9999px; - width: 50px; - height: 50px; - overflow: scroll; -} - -@media (min-width: 576px) { - .modal-dialog { - max-width: 500px; - margin: 1.75rem auto; - } - .modal-dialog-scrollable { - max-height: calc(100% - 3.5rem); - } - .modal-dialog-scrollable .modal-content { - max-height: calc(100vh - 3.5rem); - } - .modal-dialog-centered { - min-height: calc(100% - 3.5rem); - } - .modal-dialog-centered::before { - height: calc(100vh - 3.5rem); - height: -webkit-min-content; - height: -moz-min-content; - height: min-content; - } - .modal-sm { - max-width: 300px; - } -} - -@media (min-width: 992px) { - .modal-lg, - .modal-xl { - max-width: 800px; - } -} - -@media (min-width: 1200px) { - .modal-xl { - max-width: 1140px; - } -} - -.tooltip { - position: absolute; - z-index: 1070; - display: block; - margin: 0; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; - font-style: normal; - font-weight: 400; - line-height: 1.5; - text-align: left; - text-align: start; - text-decoration: none; - text-shadow: none; - text-transform: none; - letter-spacing: normal; - word-break: normal; - word-spacing: normal; - white-space: normal; - line-break: auto; - font-size: 0.875rem; - word-wrap: break-word; - opacity: 0; -} - -.tooltip.show { - opacity: 0.9; -} - -.tooltip .arrow { - position: absolute; - display: block; - width: 0.8rem; - height: 0.4rem; -} - -.tooltip .arrow::before { - position: absolute; - content: ""; - border-color: transparent; - border-style: solid; -} - -.bs-tooltip-top, .bs-tooltip-auto[x-placement^="top"] { - padding: 0.4rem 0; -} - -.bs-tooltip-top .arrow, .bs-tooltip-auto[x-placement^="top"] .arrow { - bottom: 0; -} - -.bs-tooltip-top .arrow::before, .bs-tooltip-auto[x-placement^="top"] .arrow::before { - top: 0; - border-width: 0.4rem 0.4rem 0; - border-top-color: #000; -} - -.bs-tooltip-right, .bs-tooltip-auto[x-placement^="right"] { - padding: 0 0.4rem; -} - -.bs-tooltip-right .arrow, .bs-tooltip-auto[x-placement^="right"] .arrow { - left: 0; - width: 0.4rem; - height: 0.8rem; -} - -.bs-tooltip-right .arrow::before, .bs-tooltip-auto[x-placement^="right"] .arrow::before { - right: 0; - border-width: 0.4rem 0.4rem 0.4rem 0; - border-right-color: #000; -} - -.bs-tooltip-bottom, .bs-tooltip-auto[x-placement^="bottom"] { - padding: 0.4rem 0; -} - -.bs-tooltip-bottom .arrow, .bs-tooltip-auto[x-placement^="bottom"] .arrow { - top: 0; -} - -.bs-tooltip-bottom .arrow::before, .bs-tooltip-auto[x-placement^="bottom"] .arrow::before { - bottom: 0; - border-width: 0 0.4rem 0.4rem; - border-bottom-color: #000; -} - -.bs-tooltip-left, .bs-tooltip-auto[x-placement^="left"] { - padding: 0 0.4rem; -} - -.bs-tooltip-left .arrow, .bs-tooltip-auto[x-placement^="left"] .arrow { - right: 0; - width: 0.4rem; - height: 0.8rem; -} - -.bs-tooltip-left .arrow::before, .bs-tooltip-auto[x-placement^="left"] .arrow::before { - left: 0; - border-width: 0.4rem 0 0.4rem 0.4rem; - border-left-color: #000; -} - -.tooltip-inner { - max-width: 200px; - padding: 0.25rem 0.5rem; - color: #fff; - text-align: center; - background-color: #000; - border-radius: 0.25rem; -} - -.popover { - position: absolute; - top: 0; - left: 0; - z-index: 1060; - display: block; - max-width: 276px; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; - font-style: normal; - font-weight: 400; - line-height: 1.5; - text-align: left; - text-align: start; - text-decoration: none; - text-shadow: none; - text-transform: none; - letter-spacing: normal; - word-break: normal; - word-spacing: normal; - white-space: normal; - line-break: auto; - font-size: 0.875rem; - word-wrap: break-word; - background-color: #fff; - background-clip: padding-box; - border: 1px solid rgba(0, 0, 0, 0.2); - border-radius: 0.3rem; -} - -.popover .arrow { - position: absolute; - display: block; - width: 1rem; - height: 0.5rem; - margin: 0 0.3rem; -} - -.popover .arrow::before, .popover .arrow::after { - position: absolute; - display: block; - content: ""; - border-color: transparent; - border-style: solid; -} - -.bs-popover-top, .bs-popover-auto[x-placement^="top"] { - margin-bottom: 0.5rem; -} - -.bs-popover-top > .arrow, .bs-popover-auto[x-placement^="top"] > .arrow { - bottom: calc(-0.5rem - 1px); -} - -.bs-popover-top > .arrow::before, .bs-popover-auto[x-placement^="top"] > .arrow::before { - bottom: 0; - border-width: 0.5rem 0.5rem 0; - border-top-color: rgba(0, 0, 0, 0.25); -} - -.bs-popover-top > .arrow::after, .bs-popover-auto[x-placement^="top"] > .arrow::after { - bottom: 1px; - border-width: 0.5rem 0.5rem 0; - border-top-color: #fff; -} - -.bs-popover-right, .bs-popover-auto[x-placement^="right"] { - margin-left: 0.5rem; -} - -.bs-popover-right > .arrow, .bs-popover-auto[x-placement^="right"] > .arrow { - left: calc(-0.5rem - 1px); - width: 0.5rem; - height: 1rem; - margin: 0.3rem 0; -} - -.bs-popover-right > .arrow::before, .bs-popover-auto[x-placement^="right"] > .arrow::before { - left: 0; - border-width: 0.5rem 0.5rem 0.5rem 0; - border-right-color: rgba(0, 0, 0, 0.25); -} - -.bs-popover-right > .arrow::after, .bs-popover-auto[x-placement^="right"] > .arrow::after { - left: 1px; - border-width: 0.5rem 0.5rem 0.5rem 0; - border-right-color: #fff; -} - -.bs-popover-bottom, .bs-popover-auto[x-placement^="bottom"] { - margin-top: 0.5rem; -} - -.bs-popover-bottom > .arrow, .bs-popover-auto[x-placement^="bottom"] > .arrow { - top: calc(-0.5rem - 1px); -} - -.bs-popover-bottom > .arrow::before, .bs-popover-auto[x-placement^="bottom"] > .arrow::before { - top: 0; - border-width: 0 0.5rem 0.5rem 0.5rem; - border-bottom-color: rgba(0, 0, 0, 0.25); -} - -.bs-popover-bottom > .arrow::after, .bs-popover-auto[x-placement^="bottom"] > .arrow::after { - top: 1px; - border-width: 0 0.5rem 0.5rem 0.5rem; - border-bottom-color: #fff; -} - -.bs-popover-bottom .popover-header::before, .bs-popover-auto[x-placement^="bottom"] .popover-header::before { - position: absolute; - top: 0; - left: 50%; - display: block; - width: 1rem; - margin-left: -0.5rem; - content: ""; - border-bottom: 1px solid #f7f7f7; -} - -.bs-popover-left, .bs-popover-auto[x-placement^="left"] { - margin-right: 0.5rem; -} - -.bs-popover-left > .arrow, .bs-popover-auto[x-placement^="left"] > .arrow { - right: calc(-0.5rem - 1px); - width: 0.5rem; - height: 1rem; - margin: 0.3rem 0; -} - -.bs-popover-left > .arrow::before, .bs-popover-auto[x-placement^="left"] > .arrow::before { - right: 0; - border-width: 0.5rem 0 0.5rem 0.5rem; - border-left-color: rgba(0, 0, 0, 0.25); -} - -.bs-popover-left > .arrow::after, .bs-popover-auto[x-placement^="left"] > .arrow::after { - right: 1px; - border-width: 0.5rem 0 0.5rem 0.5rem; - border-left-color: #fff; -} - -.popover-header { - padding: 0.5rem 0.75rem; - margin-bottom: 0; - font-size: 1rem; - background-color: #f7f7f7; - border-bottom: 1px solid #ebebeb; - border-top-left-radius: calc(0.3rem - 1px); - border-top-right-radius: calc(0.3rem - 1px); -} - -.popover-header:empty { - display: none; -} - -.popover-body { - padding: 0.5rem 0.75rem; - color: #212529; -} - -.carousel { - position: relative; -} - -.carousel.pointer-event { - touch-action: pan-y; -} - -.carousel-inner { - position: relative; - width: 100%; - overflow: hidden; -} - -.carousel-inner::after { - display: block; - clear: both; - content: ""; -} - -.carousel-item { - position: relative; - display: none; - float: left; - width: 100%; - margin-right: -100%; - -webkit-backface-visibility: hidden; - backface-visibility: hidden; - transition: transform 0.6s ease-in-out; -} - -@media (prefers-reduced-motion: reduce) { - .carousel-item { - transition: none; - } -} - -.carousel-item.active, -.carousel-item-next, -.carousel-item-prev { - display: block; -} - -.carousel-item-next:not(.carousel-item-left), -.active.carousel-item-right { - transform: translateX(100%); -} - -.carousel-item-prev:not(.carousel-item-right), -.active.carousel-item-left { - transform: translateX(-100%); -} - -.carousel-fade .carousel-item { - opacity: 0; - transition-property: opacity; - transform: none; -} - -.carousel-fade .carousel-item.active, -.carousel-fade .carousel-item-next.carousel-item-left, -.carousel-fade .carousel-item-prev.carousel-item-right { - z-index: 1; - opacity: 1; -} - -.carousel-fade .active.carousel-item-left, -.carousel-fade .active.carousel-item-right { - z-index: 0; - opacity: 0; - transition: opacity 0s 0.6s; -} - -@media (prefers-reduced-motion: reduce) { - .carousel-fade .active.carousel-item-left, - .carousel-fade .active.carousel-item-right { - transition: none; - } -} - -.carousel-control-prev, -.carousel-control-next { - position: absolute; - top: 0; - bottom: 0; - z-index: 1; - display: flex; - align-items: center; - justify-content: center; - width: 15%; - color: #fff; - text-align: center; - opacity: 0.5; - transition: opacity 0.15s ease; -} - -@media (prefers-reduced-motion: reduce) { - .carousel-control-prev, - .carousel-control-next { - transition: none; - } -} - -.carousel-control-prev:hover, .carousel-control-prev:focus, -.carousel-control-next:hover, -.carousel-control-next:focus { - color: #fff; - text-decoration: none; - outline: 0; - opacity: 0.9; -} - -.carousel-control-prev { - left: 0; -} - -.carousel-control-next { - right: 0; -} - -.carousel-control-prev-icon, -.carousel-control-next-icon { - display: inline-block; - width: 20px; - height: 20px; - background: 50% / 100% 100% no-repeat; -} - -.carousel-control-prev-icon { - background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath d='M5.25 0l-4 4 4 4 1.5-1.5L4.25 4l2.5-2.5L5.25 0z'/%3e%3c/svg%3e"); -} - -.carousel-control-next-icon { - background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath d='M2.75 0l-1.5 1.5L3.75 4l-2.5 2.5L2.75 8l4-4-4-4z'/%3e%3c/svg%3e"); -} - -.carousel-indicators { - position: absolute; - right: 0; - bottom: 0; - left: 0; - z-index: 15; - display: flex; - justify-content: center; - padding-left: 0; - margin-right: 15%; - margin-left: 15%; - list-style: none; -} - -.carousel-indicators li { - box-sizing: content-box; - flex: 0 1 auto; - width: 30px; - height: 3px; - margin-right: 3px; - margin-left: 3px; - text-indent: -999px; - cursor: pointer; - background-color: #fff; - background-clip: padding-box; - border-top: 10px solid transparent; - border-bottom: 10px solid transparent; - opacity: .5; - transition: opacity 0.6s ease; -} - -@media (prefers-reduced-motion: reduce) { - .carousel-indicators li { - transition: none; - } -} - -.carousel-indicators .active { - opacity: 1; -} - -.carousel-caption { - position: absolute; - right: 15%; - bottom: 20px; - left: 15%; - z-index: 10; - padding-top: 20px; - padding-bottom: 20px; - color: #fff; - text-align: center; -} - -@-webkit-keyframes spinner-border { - to { - transform: rotate(360deg); - } -} - -@keyframes spinner-border { - to { - transform: rotate(360deg); - } -} - -.spinner-border { - display: inline-block; - width: 2rem; - height: 2rem; - vertical-align: text-bottom; - border: 0.25em solid currentColor; - border-right-color: transparent; - border-radius: 50%; - -webkit-animation: .75s linear infinite spinner-border; - animation: .75s linear infinite spinner-border; -} - -.spinner-border-sm { - width: 1rem; - height: 1rem; - border-width: 0.2em; -} - -@-webkit-keyframes spinner-grow { - 0% { - transform: scale(0); - } - 50% { - opacity: 1; - transform: none; - } -} - -@keyframes spinner-grow { - 0% { - transform: scale(0); - } - 50% { - opacity: 1; - transform: none; - } -} - -.spinner-grow { - display: inline-block; - width: 2rem; - height: 2rem; - vertical-align: text-bottom; - background-color: currentColor; - border-radius: 50%; - opacity: 0; - -webkit-animation: .75s linear infinite spinner-grow; - animation: .75s linear infinite spinner-grow; -} - -.spinner-grow-sm { - width: 1rem; - height: 1rem; -} - -@media (prefers-reduced-motion: reduce) { - .spinner-border, - .spinner-grow { - -webkit-animation-duration: 1.5s; - animation-duration: 1.5s; - } -} - -.align-baseline { - vertical-align: baseline !important; -} - -.align-top { - vertical-align: top !important; -} - -.align-middle { - vertical-align: middle !important; -} - -.align-bottom { - vertical-align: bottom !important; -} - -.align-text-bottom { - vertical-align: text-bottom !important; -} - -.align-text-top { - vertical-align: text-top !important; -} - -.bg-primary { - background-color: #007bff !important; -} - -a.bg-primary:hover, a.bg-primary:focus, -button.bg-primary:hover, -button.bg-primary:focus { - background-color: #0062cc !important; -} - -.bg-secondary { - background-color: #6c757d !important; -} - -a.bg-secondary:hover, a.bg-secondary:focus, -button.bg-secondary:hover, -button.bg-secondary:focus { - background-color: #545b62 !important; -} - -.bg-success { - background-color: #28a745 !important; -} - -a.bg-success:hover, a.bg-success:focus, -button.bg-success:hover, -button.bg-success:focus { - background-color: #1e7e34 !important; -} - -.bg-info { - background-color: #17a2b8 !important; -} - -a.bg-info:hover, a.bg-info:focus, -button.bg-info:hover, -button.bg-info:focus { - background-color: #117a8b !important; -} - -.bg-warning { - background-color: #ffc107 !important; -} - -a.bg-warning:hover, a.bg-warning:focus, -button.bg-warning:hover, -button.bg-warning:focus { - background-color: #d39e00 !important; -} - -.bg-danger { - background-color: #dc3545 !important; -} - -a.bg-danger:hover, a.bg-danger:focus, -button.bg-danger:hover, -button.bg-danger:focus { - background-color: #bd2130 !important; -} - -.bg-light { - background-color: #f8f9fa !important; -} - -a.bg-light:hover, a.bg-light:focus, -button.bg-light:hover, -button.bg-light:focus { - background-color: #dae0e5 !important; -} - -.bg-dark { - background-color: #343a40 !important; -} - -a.bg-dark:hover, a.bg-dark:focus, -button.bg-dark:hover, -button.bg-dark:focus { - background-color: #1d2124 !important; -} - -.bg-white { - background-color: #fff !important; -} - -.bg-transparent { - background-color: transparent !important; -} - -.border { - border: 1px solid #dee2e6 !important; -} - -.border-top { - border-top: 1px solid #dee2e6 !important; -} - -.border-right { - border-right: 1px solid #dee2e6 !important; -} - -.border-bottom { - border-bottom: 1px solid #dee2e6 !important; -} - -.border-left { - border-left: 1px solid #dee2e6 !important; -} - -.border-0 { - border: 0 !important; -} - -.border-top-0 { - border-top: 0 !important; -} - -.border-right-0 { - border-right: 0 !important; -} - -.border-bottom-0 { - border-bottom: 0 !important; -} - -.border-left-0 { - border-left: 0 !important; -} - -.border-primary { - border-color: #007bff !important; -} - -.border-secondary { - border-color: #6c757d !important; -} - -.border-success { - border-color: #28a745 !important; -} - -.border-info { - border-color: #17a2b8 !important; -} - -.border-warning { - border-color: #ffc107 !important; -} - -.border-danger { - border-color: #dc3545 !important; -} - -.border-light { - border-color: #f8f9fa !important; -} - -.border-dark { - border-color: #343a40 !important; -} - -.border-white { - border-color: #fff !important; -} - -.rounded-sm { - border-radius: 0.2rem !important; -} - -.rounded { - border-radius: 0.25rem !important; -} - -.rounded-top { - border-top-left-radius: 0.25rem !important; - border-top-right-radius: 0.25rem !important; -} - -.rounded-right { - border-top-right-radius: 0.25rem !important; - border-bottom-right-radius: 0.25rem !important; -} - -.rounded-bottom { - border-bottom-right-radius: 0.25rem !important; - border-bottom-left-radius: 0.25rem !important; -} - -.rounded-left { - border-top-left-radius: 0.25rem !important; - border-bottom-left-radius: 0.25rem !important; -} - -.rounded-lg { - border-radius: 0.3rem !important; -} - -.rounded-circle { - border-radius: 50% !important; -} - -.rounded-pill { - border-radius: 50rem !important; -} - -.rounded-0 { - border-radius: 0 !important; -} - -.clearfix::after { - display: block; - clear: both; - content: ""; -} - -.d-none { - display: none !important; -} - -.d-inline { - display: inline !important; -} - -.d-inline-block { - display: inline-block !important; -} - -.d-block { - display: block !important; -} - -.d-table { - display: table !important; -} - -.d-table-row { - display: table-row !important; -} - -.d-table-cell { - display: table-cell !important; -} - -.d-flex { - display: flex !important; -} - -.d-inline-flex { - display: inline-flex !important; -} - -@media (min-width: 576px) { - .d-sm-none { - display: none !important; - } - .d-sm-inline { - display: inline !important; - } - .d-sm-inline-block { - display: inline-block !important; - } - .d-sm-block { - display: block !important; - } - .d-sm-table { - display: table !important; - } - .d-sm-table-row { - display: table-row !important; - } - .d-sm-table-cell { - display: table-cell !important; - } - .d-sm-flex { - display: flex !important; - } - .d-sm-inline-flex { - display: inline-flex !important; - } -} - -@media (min-width: 768px) { - .d-md-none { - display: none !important; - } - .d-md-inline { - display: inline !important; - } - .d-md-inline-block { - display: inline-block !important; - } - .d-md-block { - display: block !important; - } - .d-md-table { - display: table !important; - } - .d-md-table-row { - display: table-row !important; - } - .d-md-table-cell { - display: table-cell !important; - } - .d-md-flex { - display: flex !important; - } - .d-md-inline-flex { - display: inline-flex !important; - } -} - -@media (min-width: 992px) { - .d-lg-none { - display: none !important; - } - .d-lg-inline { - display: inline !important; - } - .d-lg-inline-block { - display: inline-block !important; - } - .d-lg-block { - display: block !important; - } - .d-lg-table { - display: table !important; - } - .d-lg-table-row { - display: table-row !important; - } - .d-lg-table-cell { - display: table-cell !important; - } - .d-lg-flex { - display: flex !important; - } - .d-lg-inline-flex { - display: inline-flex !important; - } -} - -@media (min-width: 1200px) { - .d-xl-none { - display: none !important; - } - .d-xl-inline { - display: inline !important; - } - .d-xl-inline-block { - display: inline-block !important; - } - .d-xl-block { - display: block !important; - } - .d-xl-table { - display: table !important; - } - .d-xl-table-row { - display: table-row !important; - } - .d-xl-table-cell { - display: table-cell !important; - } - .d-xl-flex { - display: flex !important; - } - .d-xl-inline-flex { - display: inline-flex !important; - } -} - -@media print { - .d-print-none { - display: none !important; - } - .d-print-inline { - display: inline !important; - } - .d-print-inline-block { - display: inline-block !important; - } - .d-print-block { - display: block !important; - } - .d-print-table { - display: table !important; - } - .d-print-table-row { - display: table-row !important; - } - .d-print-table-cell { - display: table-cell !important; - } - .d-print-flex { - display: flex !important; - } - .d-print-inline-flex { - display: inline-flex !important; - } -} - -.embed-responsive { - position: relative; - display: block; - width: 100%; - padding: 0; - overflow: hidden; -} - -.embed-responsive::before { - display: block; - content: ""; -} - -.embed-responsive .embed-responsive-item, -.embed-responsive iframe, -.embed-responsive embed, -.embed-responsive object, -.embed-responsive video { - position: absolute; - top: 0; - bottom: 0; - left: 0; - width: 100%; - height: 100%; - border: 0; -} - -.embed-responsive-21by9::before { - padding-top: 42.857143%; -} - -.embed-responsive-16by9::before { - padding-top: 56.25%; -} - -.embed-responsive-4by3::before { - padding-top: 75%; -} - -.embed-responsive-1by1::before { - padding-top: 100%; -} - -.flex-row { - flex-direction: row !important; -} - -.flex-column { - flex-direction: column !important; -} - -.flex-row-reverse { - flex-direction: row-reverse !important; -} - -.flex-column-reverse { - flex-direction: column-reverse !important; -} - -.flex-wrap { - flex-wrap: wrap !important; -} - -.flex-nowrap { - flex-wrap: nowrap !important; -} - -.flex-wrap-reverse { - flex-wrap: wrap-reverse !important; -} - -.flex-fill { - flex: 1 1 auto !important; -} - -.flex-grow-0 { - flex-grow: 0 !important; -} - -.flex-grow-1 { - flex-grow: 1 !important; -} - -.flex-shrink-0 { - flex-shrink: 0 !important; -} - -.flex-shrink-1 { - flex-shrink: 1 !important; -} - -.justify-content-start { - justify-content: flex-start !important; -} - -.justify-content-end { - justify-content: flex-end !important; -} - -.justify-content-center { - justify-content: center !important; -} - -.justify-content-between { - justify-content: space-between !important; -} - -.justify-content-around { - justify-content: space-around !important; -} - -.align-items-start { - align-items: flex-start !important; -} - -.align-items-end { - align-items: flex-end !important; -} - -.align-items-center { - align-items: center !important; -} - -.align-items-baseline { - align-items: baseline !important; -} - -.align-items-stretch { - align-items: stretch !important; -} - -.align-content-start { - align-content: flex-start !important; -} - -.align-content-end { - align-content: flex-end !important; -} - -.align-content-center { - align-content: center !important; -} - -.align-content-between { - align-content: space-between !important; -} - -.align-content-around { - align-content: space-around !important; -} - -.align-content-stretch { - align-content: stretch !important; -} - -.align-self-auto { - align-self: auto !important; -} - -.align-self-start { - align-self: flex-start !important; -} - -.align-self-end { - align-self: flex-end !important; -} - -.align-self-center { - align-self: center !important; -} - -.align-self-baseline { - align-self: baseline !important; -} - -.align-self-stretch { - align-self: stretch !important; -} - -@media (min-width: 576px) { - .flex-sm-row { - flex-direction: row !important; - } - .flex-sm-column { - flex-direction: column !important; - } - .flex-sm-row-reverse { - flex-direction: row-reverse !important; - } - .flex-sm-column-reverse { - flex-direction: column-reverse !important; - } - .flex-sm-wrap { - flex-wrap: wrap !important; - } - .flex-sm-nowrap { - flex-wrap: nowrap !important; - } - .flex-sm-wrap-reverse { - flex-wrap: wrap-reverse !important; - } - .flex-sm-fill { - flex: 1 1 auto !important; - } - .flex-sm-grow-0 { - flex-grow: 0 !important; - } - .flex-sm-grow-1 { - flex-grow: 1 !important; - } - .flex-sm-shrink-0 { - flex-shrink: 0 !important; - } - .flex-sm-shrink-1 { - flex-shrink: 1 !important; - } - .justify-content-sm-start { - justify-content: flex-start !important; - } - .justify-content-sm-end { - justify-content: flex-end !important; - } - .justify-content-sm-center { - justify-content: center !important; - } - .justify-content-sm-between { - justify-content: space-between !important; - } - .justify-content-sm-around { - justify-content: space-around !important; - } - .align-items-sm-start { - align-items: flex-start !important; - } - .align-items-sm-end { - align-items: flex-end !important; - } - .align-items-sm-center { - align-items: center !important; - } - .align-items-sm-baseline { - align-items: baseline !important; - } - .align-items-sm-stretch { - align-items: stretch !important; - } - .align-content-sm-start { - align-content: flex-start !important; - } - .align-content-sm-end { - align-content: flex-end !important; - } - .align-content-sm-center { - align-content: center !important; - } - .align-content-sm-between { - align-content: space-between !important; - } - .align-content-sm-around { - align-content: space-around !important; - } - .align-content-sm-stretch { - align-content: stretch !important; - } - .align-self-sm-auto { - align-self: auto !important; - } - .align-self-sm-start { - align-self: flex-start !important; - } - .align-self-sm-end { - align-self: flex-end !important; - } - .align-self-sm-center { - align-self: center !important; - } - .align-self-sm-baseline { - align-self: baseline !important; - } - .align-self-sm-stretch { - align-self: stretch !important; - } -} - -@media (min-width: 768px) { - .flex-md-row { - flex-direction: row !important; - } - .flex-md-column { - flex-direction: column !important; - } - .flex-md-row-reverse { - flex-direction: row-reverse !important; - } - .flex-md-column-reverse { - flex-direction: column-reverse !important; - } - .flex-md-wrap { - flex-wrap: wrap !important; - } - .flex-md-nowrap { - flex-wrap: nowrap !important; - } - .flex-md-wrap-reverse { - flex-wrap: wrap-reverse !important; - } - .flex-md-fill { - flex: 1 1 auto !important; - } - .flex-md-grow-0 { - flex-grow: 0 !important; - } - .flex-md-grow-1 { - flex-grow: 1 !important; - } - .flex-md-shrink-0 { - flex-shrink: 0 !important; - } - .flex-md-shrink-1 { - flex-shrink: 1 !important; - } - .justify-content-md-start { - justify-content: flex-start !important; - } - .justify-content-md-end { - justify-content: flex-end !important; - } - .justify-content-md-center { - justify-content: center !important; - } - .justify-content-md-between { - justify-content: space-between !important; - } - .justify-content-md-around { - justify-content: space-around !important; - } - .align-items-md-start { - align-items: flex-start !important; - } - .align-items-md-end { - align-items: flex-end !important; - } - .align-items-md-center { - align-items: center !important; - } - .align-items-md-baseline { - align-items: baseline !important; - } - .align-items-md-stretch { - align-items: stretch !important; - } - .align-content-md-start { - align-content: flex-start !important; - } - .align-content-md-end { - align-content: flex-end !important; - } - .align-content-md-center { - align-content: center !important; - } - .align-content-md-between { - align-content: space-between !important; - } - .align-content-md-around { - align-content: space-around !important; - } - .align-content-md-stretch { - align-content: stretch !important; - } - .align-self-md-auto { - align-self: auto !important; - } - .align-self-md-start { - align-self: flex-start !important; - } - .align-self-md-end { - align-self: flex-end !important; - } - .align-self-md-center { - align-self: center !important; - } - .align-self-md-baseline { - align-self: baseline !important; - } - .align-self-md-stretch { - align-self: stretch !important; - } -} - -@media (min-width: 992px) { - .flex-lg-row { - flex-direction: row !important; - } - .flex-lg-column { - flex-direction: column !important; - } - .flex-lg-row-reverse { - flex-direction: row-reverse !important; - } - .flex-lg-column-reverse { - flex-direction: column-reverse !important; - } - .flex-lg-wrap { - flex-wrap: wrap !important; - } - .flex-lg-nowrap { - flex-wrap: nowrap !important; - } - .flex-lg-wrap-reverse { - flex-wrap: wrap-reverse !important; - } - .flex-lg-fill { - flex: 1 1 auto !important; - } - .flex-lg-grow-0 { - flex-grow: 0 !important; - } - .flex-lg-grow-1 { - flex-grow: 1 !important; - } - .flex-lg-shrink-0 { - flex-shrink: 0 !important; - } - .flex-lg-shrink-1 { - flex-shrink: 1 !important; - } - .justify-content-lg-start { - justify-content: flex-start !important; - } - .justify-content-lg-end { - justify-content: flex-end !important; - } - .justify-content-lg-center { - justify-content: center !important; - } - .justify-content-lg-between { - justify-content: space-between !important; - } - .justify-content-lg-around { - justify-content: space-around !important; - } - .align-items-lg-start { - align-items: flex-start !important; - } - .align-items-lg-end { - align-items: flex-end !important; - } - .align-items-lg-center { - align-items: center !important; - } - .align-items-lg-baseline { - align-items: baseline !important; - } - .align-items-lg-stretch { - align-items: stretch !important; - } - .align-content-lg-start { - align-content: flex-start !important; - } - .align-content-lg-end { - align-content: flex-end !important; - } - .align-content-lg-center { - align-content: center !important; - } - .align-content-lg-between { - align-content: space-between !important; - } - .align-content-lg-around { - align-content: space-around !important; - } - .align-content-lg-stretch { - align-content: stretch !important; - } - .align-self-lg-auto { - align-self: auto !important; - } - .align-self-lg-start { - align-self: flex-start !important; - } - .align-self-lg-end { - align-self: flex-end !important; - } - .align-self-lg-center { - align-self: center !important; - } - .align-self-lg-baseline { - align-self: baseline !important; - } - .align-self-lg-stretch { - align-self: stretch !important; - } -} - -@media (min-width: 1200px) { - .flex-xl-row { - flex-direction: row !important; - } - .flex-xl-column { - flex-direction: column !important; - } - .flex-xl-row-reverse { - flex-direction: row-reverse !important; - } - .flex-xl-column-reverse { - flex-direction: column-reverse !important; - } - .flex-xl-wrap { - flex-wrap: wrap !important; - } - .flex-xl-nowrap { - flex-wrap: nowrap !important; - } - .flex-xl-wrap-reverse { - flex-wrap: wrap-reverse !important; - } - .flex-xl-fill { - flex: 1 1 auto !important; - } - .flex-xl-grow-0 { - flex-grow: 0 !important; - } - .flex-xl-grow-1 { - flex-grow: 1 !important; - } - .flex-xl-shrink-0 { - flex-shrink: 0 !important; - } - .flex-xl-shrink-1 { - flex-shrink: 1 !important; - } - .justify-content-xl-start { - justify-content: flex-start !important; - } - .justify-content-xl-end { - justify-content: flex-end !important; - } - .justify-content-xl-center { - justify-content: center !important; - } - .justify-content-xl-between { - justify-content: space-between !important; - } - .justify-content-xl-around { - justify-content: space-around !important; - } - .align-items-xl-start { - align-items: flex-start !important; - } - .align-items-xl-end { - align-items: flex-end !important; - } - .align-items-xl-center { - align-items: center !important; - } - .align-items-xl-baseline { - align-items: baseline !important; - } - .align-items-xl-stretch { - align-items: stretch !important; - } - .align-content-xl-start { - align-content: flex-start !important; - } - .align-content-xl-end { - align-content: flex-end !important; - } - .align-content-xl-center { - align-content: center !important; - } - .align-content-xl-between { - align-content: space-between !important; - } - .align-content-xl-around { - align-content: space-around !important; - } - .align-content-xl-stretch { - align-content: stretch !important; - } - .align-self-xl-auto { - align-self: auto !important; - } - .align-self-xl-start { - align-self: flex-start !important; - } - .align-self-xl-end { - align-self: flex-end !important; - } - .align-self-xl-center { - align-self: center !important; - } - .align-self-xl-baseline { - align-self: baseline !important; - } - .align-self-xl-stretch { - align-self: stretch !important; - } -} - -.float-left { - float: left !important; -} - -.float-right { - float: right !important; -} - -.float-none { - float: none !important; -} - -@media (min-width: 576px) { - .float-sm-left { - float: left !important; - } - .float-sm-right { - float: right !important; - } - .float-sm-none { - float: none !important; - } -} - -@media (min-width: 768px) { - .float-md-left { - float: left !important; - } - .float-md-right { - float: right !important; - } - .float-md-none { - float: none !important; - } -} - -@media (min-width: 992px) { - .float-lg-left { - float: left !important; - } - .float-lg-right { - float: right !important; - } - .float-lg-none { - float: none !important; - } -} - -@media (min-width: 1200px) { - .float-xl-left { - float: left !important; - } - .float-xl-right { - float: right !important; - } - .float-xl-none { - float: none !important; - } -} - -.user-select-all { - -webkit-user-select: all !important; - -moz-user-select: all !important; - user-select: all !important; -} - -.user-select-auto { - -webkit-user-select: auto !important; - -moz-user-select: auto !important; - -ms-user-select: auto !important; - user-select: auto !important; -} - -.user-select-none { - -webkit-user-select: none !important; - -moz-user-select: none !important; - -ms-user-select: none !important; - user-select: none !important; -} - -.overflow-auto { - overflow: auto !important; -} - -.overflow-hidden { - overflow: hidden !important; -} - -.position-static { - position: static !important; -} - -.position-relative { - position: relative !important; -} - -.position-absolute { - position: absolute !important; -} - -.position-fixed { - position: fixed !important; -} - -.position-sticky { - position: -webkit-sticky !important; - position: sticky !important; -} - -.fixed-top { - position: fixed; - top: 0; - right: 0; - left: 0; - z-index: 1030; -} - -.fixed-bottom { - position: fixed; - right: 0; - bottom: 0; - left: 0; - z-index: 1030; -} - -@supports ((position: -webkit-sticky) or (position: sticky)) { - .sticky-top { - position: -webkit-sticky; - position: sticky; - top: 0; - z-index: 1020; - } -} - -.sr-only { - position: absolute; - width: 1px; - height: 1px; - padding: 0; - margin: -1px; - overflow: hidden; - clip: rect(0, 0, 0, 0); - white-space: nowrap; - border: 0; -} - -.sr-only-focusable:active, .sr-only-focusable:focus { - position: static; - width: auto; - height: auto; - overflow: visible; - clip: auto; - white-space: normal; -} - -.shadow-sm { - box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important; -} - -.shadow { - box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important; -} - -.shadow-lg { - box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important; -} - -.shadow-none { - box-shadow: none !important; -} - -.w-25 { - width: 25% !important; -} - -.w-50 { - width: 50% !important; -} - -.w-75 { - width: 75% !important; -} - -.w-100 { - width: 100% !important; -} - -.w-auto { - width: auto !important; -} - -.h-25 { - height: 25% !important; -} - -.h-50 { - height: 50% !important; -} - -.h-75 { - height: 75% !important; -} - -.h-100 { - height: 100% !important; -} - -.h-auto { - height: auto !important; -} - -.mw-100 { - max-width: 100% !important; -} - -.mh-100 { - max-height: 100% !important; -} - -.min-vw-100 { - min-width: 100vw !important; -} - -.min-vh-100 { - min-height: 100vh !important; -} - -.vw-100 { - width: 100vw !important; -} - -.vh-100 { - height: 100vh !important; -} - -.m-0 { - margin: 0 !important; -} - -.mt-0, -.my-0 { - margin-top: 0 !important; -} - -.mr-0, -.mx-0 { - margin-right: 0 !important; -} - -.mb-0, -.my-0 { - margin-bottom: 0 !important; -} - -.ml-0, -.mx-0 { - margin-left: 0 !important; -} - -.m-1 { - margin: 0.25rem !important; -} - -.mt-1, -.my-1 { - margin-top: 0.25rem !important; -} - -.mr-1, -.mx-1 { - margin-right: 0.25rem !important; -} - -.mb-1, -.my-1 { - margin-bottom: 0.25rem !important; -} - -.ml-1, -.mx-1 { - margin-left: 0.25rem !important; -} - -.m-2 { - margin: 0.5rem !important; -} - -.mt-2, -.my-2 { - margin-top: 0.5rem !important; -} - -.mr-2, -.mx-2 { - margin-right: 0.5rem !important; -} - -.mb-2, -.my-2 { - margin-bottom: 0.5rem !important; -} - -.ml-2, -.mx-2 { - margin-left: 0.5rem !important; -} - -.m-3 { - margin: 1rem !important; -} - -.mt-3, -.my-3 { - margin-top: 1rem !important; -} - -.mr-3, -.mx-3 { - margin-right: 1rem !important; -} - -.mb-3, -.my-3 { - margin-bottom: 1rem !important; -} - -.ml-3, -.mx-3 { - margin-left: 1rem !important; -} - -.m-4 { - margin: 1.5rem !important; -} - -.mt-4, -.my-4 { - margin-top: 1.5rem !important; -} - -.mr-4, -.mx-4 { - margin-right: 1.5rem !important; -} - -.mb-4, -.my-4 { - margin-bottom: 1.5rem !important; -} - -.ml-4, -.mx-4 { - margin-left: 1.5rem !important; -} - -.m-5 { - margin: 3rem !important; -} - -.mt-5, -.my-5 { - margin-top: 3rem !important; -} - -.mr-5, -.mx-5 { - margin-right: 3rem !important; -} - -.mb-5, -.my-5 { - margin-bottom: 3rem !important; -} - -.ml-5, -.mx-5 { - margin-left: 3rem !important; -} - -.p-0 { - padding: 0 !important; -} - -.pt-0, -.py-0 { - padding-top: 0 !important; -} - -.pr-0, -.px-0 { - padding-right: 0 !important; -} - -.pb-0, -.py-0 { - padding-bottom: 0 !important; -} - -.pl-0, -.px-0 { - padding-left: 0 !important; -} - -.p-1 { - padding: 0.25rem !important; -} - -.pt-1, -.py-1 { - padding-top: 0.25rem !important; -} - -.pr-1, -.px-1 { - padding-right: 0.25rem !important; -} - -.pb-1, -.py-1 { - padding-bottom: 0.25rem !important; -} - -.pl-1, -.px-1 { - padding-left: 0.25rem !important; -} - -.p-2 { - padding: 0.5rem !important; -} - -.pt-2, -.py-2 { - padding-top: 0.5rem !important; -} - -.pr-2, -.px-2 { - padding-right: 0.5rem !important; -} - -.pb-2, -.py-2 { - padding-bottom: 0.5rem !important; -} - -.pl-2, -.px-2 { - padding-left: 0.5rem !important; -} - -.p-3 { - padding: 1rem !important; -} - -.pt-3, -.py-3 { - padding-top: 1rem !important; -} - -.pr-3, -.px-3 { - padding-right: 1rem !important; -} - -.pb-3, -.py-3 { - padding-bottom: 1rem !important; -} - -.pl-3, -.px-3 { - padding-left: 1rem !important; -} - -.p-4 { - padding: 1.5rem !important; -} - -.pt-4, -.py-4 { - padding-top: 1.5rem !important; -} - -.pr-4, -.px-4 { - padding-right: 1.5rem !important; -} - -.pb-4, -.py-4 { - padding-bottom: 1.5rem !important; -} - -.pl-4, -.px-4 { - padding-left: 1.5rem !important; -} - -.p-5 { - padding: 3rem !important; -} - -.pt-5, -.py-5 { - padding-top: 3rem !important; -} - -.pr-5, -.px-5 { - padding-right: 3rem !important; -} - -.pb-5, -.py-5 { - padding-bottom: 3rem !important; -} - -.pl-5, -.px-5 { - padding-left: 3rem !important; -} - -.m-n1 { - margin: -0.25rem !important; -} - -.mt-n1, -.my-n1 { - margin-top: -0.25rem !important; -} - -.mr-n1, -.mx-n1 { - margin-right: -0.25rem !important; -} - -.mb-n1, -.my-n1 { - margin-bottom: -0.25rem !important; -} - -.ml-n1, -.mx-n1 { - margin-left: -0.25rem !important; -} - -.m-n2 { - margin: -0.5rem !important; -} - -.mt-n2, -.my-n2 { - margin-top: -0.5rem !important; -} - -.mr-n2, -.mx-n2 { - margin-right: -0.5rem !important; -} - -.mb-n2, -.my-n2 { - margin-bottom: -0.5rem !important; -} - -.ml-n2, -.mx-n2 { - margin-left: -0.5rem !important; -} - -.m-n3 { - margin: -1rem !important; -} - -.mt-n3, -.my-n3 { - margin-top: -1rem !important; -} - -.mr-n3, -.mx-n3 { - margin-right: -1rem !important; -} - -.mb-n3, -.my-n3 { - margin-bottom: -1rem !important; -} - -.ml-n3, -.mx-n3 { - margin-left: -1rem !important; -} - -.m-n4 { - margin: -1.5rem !important; -} - -.mt-n4, -.my-n4 { - margin-top: -1.5rem !important; -} - -.mr-n4, -.mx-n4 { - margin-right: -1.5rem !important; -} - -.mb-n4, -.my-n4 { - margin-bottom: -1.5rem !important; -} - -.ml-n4, -.mx-n4 { - margin-left: -1.5rem !important; -} - -.m-n5 { - margin: -3rem !important; -} - -.mt-n5, -.my-n5 { - margin-top: -3rem !important; -} - -.mr-n5, -.mx-n5 { - margin-right: -3rem !important; -} - -.mb-n5, -.my-n5 { - margin-bottom: -3rem !important; -} - -.ml-n5, -.mx-n5 { - margin-left: -3rem !important; -} - -.m-auto { - margin: auto !important; -} - -.mt-auto, -.my-auto { - margin-top: auto !important; -} - -.mr-auto, -.mx-auto { - margin-right: auto !important; -} - -.mb-auto, -.my-auto { - margin-bottom: auto !important; -} - -.ml-auto, -.mx-auto { - margin-left: auto !important; -} - -@media (min-width: 576px) { - .m-sm-0 { - margin: 0 !important; - } - .mt-sm-0, - .my-sm-0 { - margin-top: 0 !important; - } - .mr-sm-0, - .mx-sm-0 { - margin-right: 0 !important; - } - .mb-sm-0, - .my-sm-0 { - margin-bottom: 0 !important; - } - .ml-sm-0, - .mx-sm-0 { - margin-left: 0 !important; - } - .m-sm-1 { - margin: 0.25rem !important; - } - .mt-sm-1, - .my-sm-1 { - margin-top: 0.25rem !important; - } - .mr-sm-1, - .mx-sm-1 { - margin-right: 0.25rem !important; - } - .mb-sm-1, - .my-sm-1 { - margin-bottom: 0.25rem !important; - } - .ml-sm-1, - .mx-sm-1 { - margin-left: 0.25rem !important; - } - .m-sm-2 { - margin: 0.5rem !important; - } - .mt-sm-2, - .my-sm-2 { - margin-top: 0.5rem !important; - } - .mr-sm-2, - .mx-sm-2 { - margin-right: 0.5rem !important; - } - .mb-sm-2, - .my-sm-2 { - margin-bottom: 0.5rem !important; - } - .ml-sm-2, - .mx-sm-2 { - margin-left: 0.5rem !important; - } - .m-sm-3 { - margin: 1rem !important; - } - .mt-sm-3, - .my-sm-3 { - margin-top: 1rem !important; - } - .mr-sm-3, - .mx-sm-3 { - margin-right: 1rem !important; - } - .mb-sm-3, - .my-sm-3 { - margin-bottom: 1rem !important; - } - .ml-sm-3, - .mx-sm-3 { - margin-left: 1rem !important; - } - .m-sm-4 { - margin: 1.5rem !important; - } - .mt-sm-4, - .my-sm-4 { - margin-top: 1.5rem !important; - } - .mr-sm-4, - .mx-sm-4 { - margin-right: 1.5rem !important; - } - .mb-sm-4, - .my-sm-4 { - margin-bottom: 1.5rem !important; - } - .ml-sm-4, - .mx-sm-4 { - margin-left: 1.5rem !important; - } - .m-sm-5 { - margin: 3rem !important; - } - .mt-sm-5, - .my-sm-5 { - margin-top: 3rem !important; - } - .mr-sm-5, - .mx-sm-5 { - margin-right: 3rem !important; - } - .mb-sm-5, - .my-sm-5 { - margin-bottom: 3rem !important; - } - .ml-sm-5, - .mx-sm-5 { - margin-left: 3rem !important; - } - .p-sm-0 { - padding: 0 !important; - } - .pt-sm-0, - .py-sm-0 { - padding-top: 0 !important; - } - .pr-sm-0, - .px-sm-0 { - padding-right: 0 !important; - } - .pb-sm-0, - .py-sm-0 { - padding-bottom: 0 !important; - } - .pl-sm-0, - .px-sm-0 { - padding-left: 0 !important; - } - .p-sm-1 { - padding: 0.25rem !important; - } - .pt-sm-1, - .py-sm-1 { - padding-top: 0.25rem !important; - } - .pr-sm-1, - .px-sm-1 { - padding-right: 0.25rem !important; - } - .pb-sm-1, - .py-sm-1 { - padding-bottom: 0.25rem !important; - } - .pl-sm-1, - .px-sm-1 { - padding-left: 0.25rem !important; - } - .p-sm-2 { - padding: 0.5rem !important; - } - .pt-sm-2, - .py-sm-2 { - padding-top: 0.5rem !important; - } - .pr-sm-2, - .px-sm-2 { - padding-right: 0.5rem !important; - } - .pb-sm-2, - .py-sm-2 { - padding-bottom: 0.5rem !important; - } - .pl-sm-2, - .px-sm-2 { - padding-left: 0.5rem !important; - } - .p-sm-3 { - padding: 1rem !important; - } - .pt-sm-3, - .py-sm-3 { - padding-top: 1rem !important; - } - .pr-sm-3, - .px-sm-3 { - padding-right: 1rem !important; - } - .pb-sm-3, - .py-sm-3 { - padding-bottom: 1rem !important; - } - .pl-sm-3, - .px-sm-3 { - padding-left: 1rem !important; - } - .p-sm-4 { - padding: 1.5rem !important; - } - .pt-sm-4, - .py-sm-4 { - padding-top: 1.5rem !important; - } - .pr-sm-4, - .px-sm-4 { - padding-right: 1.5rem !important; - } - .pb-sm-4, - .py-sm-4 { - padding-bottom: 1.5rem !important; - } - .pl-sm-4, - .px-sm-4 { - padding-left: 1.5rem !important; - } - .p-sm-5 { - padding: 3rem !important; - } - .pt-sm-5, - .py-sm-5 { - padding-top: 3rem !important; - } - .pr-sm-5, - .px-sm-5 { - padding-right: 3rem !important; - } - .pb-sm-5, - .py-sm-5 { - padding-bottom: 3rem !important; - } - .pl-sm-5, - .px-sm-5 { - padding-left: 3rem !important; - } - .m-sm-n1 { - margin: -0.25rem !important; - } - .mt-sm-n1, - .my-sm-n1 { - margin-top: -0.25rem !important; - } - .mr-sm-n1, - .mx-sm-n1 { - margin-right: -0.25rem !important; - } - .mb-sm-n1, - .my-sm-n1 { - margin-bottom: -0.25rem !important; - } - .ml-sm-n1, - .mx-sm-n1 { - margin-left: -0.25rem !important; - } - .m-sm-n2 { - margin: -0.5rem !important; - } - .mt-sm-n2, - .my-sm-n2 { - margin-top: -0.5rem !important; - } - .mr-sm-n2, - .mx-sm-n2 { - margin-right: -0.5rem !important; - } - .mb-sm-n2, - .my-sm-n2 { - margin-bottom: -0.5rem !important; - } - .ml-sm-n2, - .mx-sm-n2 { - margin-left: -0.5rem !important; - } - .m-sm-n3 { - margin: -1rem !important; - } - .mt-sm-n3, - .my-sm-n3 { - margin-top: -1rem !important; - } - .mr-sm-n3, - .mx-sm-n3 { - margin-right: -1rem !important; - } - .mb-sm-n3, - .my-sm-n3 { - margin-bottom: -1rem !important; - } - .ml-sm-n3, - .mx-sm-n3 { - margin-left: -1rem !important; - } - .m-sm-n4 { - margin: -1.5rem !important; - } - .mt-sm-n4, - .my-sm-n4 { - margin-top: -1.5rem !important; - } - .mr-sm-n4, - .mx-sm-n4 { - margin-right: -1.5rem !important; - } - .mb-sm-n4, - .my-sm-n4 { - margin-bottom: -1.5rem !important; - } - .ml-sm-n4, - .mx-sm-n4 { - margin-left: -1.5rem !important; - } - .m-sm-n5 { - margin: -3rem !important; - } - .mt-sm-n5, - .my-sm-n5 { - margin-top: -3rem !important; - } - .mr-sm-n5, - .mx-sm-n5 { - margin-right: -3rem !important; - } - .mb-sm-n5, - .my-sm-n5 { - margin-bottom: -3rem !important; - } - .ml-sm-n5, - .mx-sm-n5 { - margin-left: -3rem !important; - } - .m-sm-auto { - margin: auto !important; - } - .mt-sm-auto, - .my-sm-auto { - margin-top: auto !important; - } - .mr-sm-auto, - .mx-sm-auto { - margin-right: auto !important; - } - .mb-sm-auto, - .my-sm-auto { - margin-bottom: auto !important; - } - .ml-sm-auto, - .mx-sm-auto { - margin-left: auto !important; - } -} - -@media (min-width: 768px) { - .m-md-0 { - margin: 0 !important; - } - .mt-md-0, - .my-md-0 { - margin-top: 0 !important; - } - .mr-md-0, - .mx-md-0 { - margin-right: 0 !important; - } - .mb-md-0, - .my-md-0 { - margin-bottom: 0 !important; - } - .ml-md-0, - .mx-md-0 { - margin-left: 0 !important; - } - .m-md-1 { - margin: 0.25rem !important; - } - .mt-md-1, - .my-md-1 { - margin-top: 0.25rem !important; - } - .mr-md-1, - .mx-md-1 { - margin-right: 0.25rem !important; - } - .mb-md-1, - .my-md-1 { - margin-bottom: 0.25rem !important; - } - .ml-md-1, - .mx-md-1 { - margin-left: 0.25rem !important; - } - .m-md-2 { - margin: 0.5rem !important; - } - .mt-md-2, - .my-md-2 { - margin-top: 0.5rem !important; - } - .mr-md-2, - .mx-md-2 { - margin-right: 0.5rem !important; - } - .mb-md-2, - .my-md-2 { - margin-bottom: 0.5rem !important; - } - .ml-md-2, - .mx-md-2 { - margin-left: 0.5rem !important; - } - .m-md-3 { - margin: 1rem !important; - } - .mt-md-3, - .my-md-3 { - margin-top: 1rem !important; - } - .mr-md-3, - .mx-md-3 { - margin-right: 1rem !important; - } - .mb-md-3, - .my-md-3 { - margin-bottom: 1rem !important; - } - .ml-md-3, - .mx-md-3 { - margin-left: 1rem !important; - } - .m-md-4 { - margin: 1.5rem !important; - } - .mt-md-4, - .my-md-4 { - margin-top: 1.5rem !important; - } - .mr-md-4, - .mx-md-4 { - margin-right: 1.5rem !important; - } - .mb-md-4, - .my-md-4 { - margin-bottom: 1.5rem !important; - } - .ml-md-4, - .mx-md-4 { - margin-left: 1.5rem !important; - } - .m-md-5 { - margin: 3rem !important; - } - .mt-md-5, - .my-md-5 { - margin-top: 3rem !important; - } - .mr-md-5, - .mx-md-5 { - margin-right: 3rem !important; - } - .mb-md-5, - .my-md-5 { - margin-bottom: 3rem !important; - } - .ml-md-5, - .mx-md-5 { - margin-left: 3rem !important; - } - .p-md-0 { - padding: 0 !important; - } - .pt-md-0, - .py-md-0 { - padding-top: 0 !important; - } - .pr-md-0, - .px-md-0 { - padding-right: 0 !important; - } - .pb-md-0, - .py-md-0 { - padding-bottom: 0 !important; - } - .pl-md-0, - .px-md-0 { - padding-left: 0 !important; - } - .p-md-1 { - padding: 0.25rem !important; - } - .pt-md-1, - .py-md-1 { - padding-top: 0.25rem !important; - } - .pr-md-1, - .px-md-1 { - padding-right: 0.25rem !important; - } - .pb-md-1, - .py-md-1 { - padding-bottom: 0.25rem !important; - } - .pl-md-1, - .px-md-1 { - padding-left: 0.25rem !important; - } - .p-md-2 { - padding: 0.5rem !important; - } - .pt-md-2, - .py-md-2 { - padding-top: 0.5rem !important; - } - .pr-md-2, - .px-md-2 { - padding-right: 0.5rem !important; - } - .pb-md-2, - .py-md-2 { - padding-bottom: 0.5rem !important; - } - .pl-md-2, - .px-md-2 { - padding-left: 0.5rem !important; - } - .p-md-3 { - padding: 1rem !important; - } - .pt-md-3, - .py-md-3 { - padding-top: 1rem !important; - } - .pr-md-3, - .px-md-3 { - padding-right: 1rem !important; - } - .pb-md-3, - .py-md-3 { - padding-bottom: 1rem !important; - } - .pl-md-3, - .px-md-3 { - padding-left: 1rem !important; - } - .p-md-4 { - padding: 1.5rem !important; - } - .pt-md-4, - .py-md-4 { - padding-top: 1.5rem !important; - } - .pr-md-4, - .px-md-4 { - padding-right: 1.5rem !important; - } - .pb-md-4, - .py-md-4 { - padding-bottom: 1.5rem !important; - } - .pl-md-4, - .px-md-4 { - padding-left: 1.5rem !important; - } - .p-md-5 { - padding: 3rem !important; - } - .pt-md-5, - .py-md-5 { - padding-top: 3rem !important; - } - .pr-md-5, - .px-md-5 { - padding-right: 3rem !important; - } - .pb-md-5, - .py-md-5 { - padding-bottom: 3rem !important; - } - .pl-md-5, - .px-md-5 { - padding-left: 3rem !important; - } - .m-md-n1 { - margin: -0.25rem !important; - } - .mt-md-n1, - .my-md-n1 { - margin-top: -0.25rem !important; - } - .mr-md-n1, - .mx-md-n1 { - margin-right: -0.25rem !important; - } - .mb-md-n1, - .my-md-n1 { - margin-bottom: -0.25rem !important; - } - .ml-md-n1, - .mx-md-n1 { - margin-left: -0.25rem !important; - } - .m-md-n2 { - margin: -0.5rem !important; - } - .mt-md-n2, - .my-md-n2 { - margin-top: -0.5rem !important; - } - .mr-md-n2, - .mx-md-n2 { - margin-right: -0.5rem !important; - } - .mb-md-n2, - .my-md-n2 { - margin-bottom: -0.5rem !important; - } - .ml-md-n2, - .mx-md-n2 { - margin-left: -0.5rem !important; - } - .m-md-n3 { - margin: -1rem !important; - } - .mt-md-n3, - .my-md-n3 { - margin-top: -1rem !important; - } - .mr-md-n3, - .mx-md-n3 { - margin-right: -1rem !important; - } - .mb-md-n3, - .my-md-n3 { - margin-bottom: -1rem !important; - } - .ml-md-n3, - .mx-md-n3 { - margin-left: -1rem !important; - } - .m-md-n4 { - margin: -1.5rem !important; - } - .mt-md-n4, - .my-md-n4 { - margin-top: -1.5rem !important; - } - .mr-md-n4, - .mx-md-n4 { - margin-right: -1.5rem !important; - } - .mb-md-n4, - .my-md-n4 { - margin-bottom: -1.5rem !important; - } - .ml-md-n4, - .mx-md-n4 { - margin-left: -1.5rem !important; - } - .m-md-n5 { - margin: -3rem !important; - } - .mt-md-n5, - .my-md-n5 { - margin-top: -3rem !important; - } - .mr-md-n5, - .mx-md-n5 { - margin-right: -3rem !important; - } - .mb-md-n5, - .my-md-n5 { - margin-bottom: -3rem !important; - } - .ml-md-n5, - .mx-md-n5 { - margin-left: -3rem !important; - } - .m-md-auto { - margin: auto !important; - } - .mt-md-auto, - .my-md-auto { - margin-top: auto !important; - } - .mr-md-auto, - .mx-md-auto { - margin-right: auto !important; - } - .mb-md-auto, - .my-md-auto { - margin-bottom: auto !important; - } - .ml-md-auto, - .mx-md-auto { - margin-left: auto !important; - } -} - -@media (min-width: 992px) { - .m-lg-0 { - margin: 0 !important; - } - .mt-lg-0, - .my-lg-0 { - margin-top: 0 !important; - } - .mr-lg-0, - .mx-lg-0 { - margin-right: 0 !important; - } - .mb-lg-0, - .my-lg-0 { - margin-bottom: 0 !important; - } - .ml-lg-0, - .mx-lg-0 { - margin-left: 0 !important; - } - .m-lg-1 { - margin: 0.25rem !important; - } - .mt-lg-1, - .my-lg-1 { - margin-top: 0.25rem !important; - } - .mr-lg-1, - .mx-lg-1 { - margin-right: 0.25rem !important; - } - .mb-lg-1, - .my-lg-1 { - margin-bottom: 0.25rem !important; - } - .ml-lg-1, - .mx-lg-1 { - margin-left: 0.25rem !important; - } - .m-lg-2 { - margin: 0.5rem !important; - } - .mt-lg-2, - .my-lg-2 { - margin-top: 0.5rem !important; - } - .mr-lg-2, - .mx-lg-2 { - margin-right: 0.5rem !important; - } - .mb-lg-2, - .my-lg-2 { - margin-bottom: 0.5rem !important; - } - .ml-lg-2, - .mx-lg-2 { - margin-left: 0.5rem !important; - } - .m-lg-3 { - margin: 1rem !important; - } - .mt-lg-3, - .my-lg-3 { - margin-top: 1rem !important; - } - .mr-lg-3, - .mx-lg-3 { - margin-right: 1rem !important; - } - .mb-lg-3, - .my-lg-3 { - margin-bottom: 1rem !important; - } - .ml-lg-3, - .mx-lg-3 { - margin-left: 1rem !important; - } - .m-lg-4 { - margin: 1.5rem !important; - } - .mt-lg-4, - .my-lg-4 { - margin-top: 1.5rem !important; - } - .mr-lg-4, - .mx-lg-4 { - margin-right: 1.5rem !important; - } - .mb-lg-4, - .my-lg-4 { - margin-bottom: 1.5rem !important; - } - .ml-lg-4, - .mx-lg-4 { - margin-left: 1.5rem !important; - } - .m-lg-5 { - margin: 3rem !important; - } - .mt-lg-5, - .my-lg-5 { - margin-top: 3rem !important; - } - .mr-lg-5, - .mx-lg-5 { - margin-right: 3rem !important; - } - .mb-lg-5, - .my-lg-5 { - margin-bottom: 3rem !important; - } - .ml-lg-5, - .mx-lg-5 { - margin-left: 3rem !important; - } - .p-lg-0 { - padding: 0 !important; - } - .pt-lg-0, - .py-lg-0 { - padding-top: 0 !important; - } - .pr-lg-0, - .px-lg-0 { - padding-right: 0 !important; - } - .pb-lg-0, - .py-lg-0 { - padding-bottom: 0 !important; - } - .pl-lg-0, - .px-lg-0 { - padding-left: 0 !important; - } - .p-lg-1 { - padding: 0.25rem !important; - } - .pt-lg-1, - .py-lg-1 { - padding-top: 0.25rem !important; - } - .pr-lg-1, - .px-lg-1 { - padding-right: 0.25rem !important; - } - .pb-lg-1, - .py-lg-1 { - padding-bottom: 0.25rem !important; - } - .pl-lg-1, - .px-lg-1 { - padding-left: 0.25rem !important; - } - .p-lg-2 { - padding: 0.5rem !important; - } - .pt-lg-2, - .py-lg-2 { - padding-top: 0.5rem !important; - } - .pr-lg-2, - .px-lg-2 { - padding-right: 0.5rem !important; - } - .pb-lg-2, - .py-lg-2 { - padding-bottom: 0.5rem !important; - } - .pl-lg-2, - .px-lg-2 { - padding-left: 0.5rem !important; - } - .p-lg-3 { - padding: 1rem !important; - } - .pt-lg-3, - .py-lg-3 { - padding-top: 1rem !important; - } - .pr-lg-3, - .px-lg-3 { - padding-right: 1rem !important; - } - .pb-lg-3, - .py-lg-3 { - padding-bottom: 1rem !important; - } - .pl-lg-3, - .px-lg-3 { - padding-left: 1rem !important; - } - .p-lg-4 { - padding: 1.5rem !important; - } - .pt-lg-4, - .py-lg-4 { - padding-top: 1.5rem !important; - } - .pr-lg-4, - .px-lg-4 { - padding-right: 1.5rem !important; - } - .pb-lg-4, - .py-lg-4 { - padding-bottom: 1.5rem !important; - } - .pl-lg-4, - .px-lg-4 { - padding-left: 1.5rem !important; - } - .p-lg-5 { - padding: 3rem !important; - } - .pt-lg-5, - .py-lg-5 { - padding-top: 3rem !important; - } - .pr-lg-5, - .px-lg-5 { - padding-right: 3rem !important; - } - .pb-lg-5, - .py-lg-5 { - padding-bottom: 3rem !important; - } - .pl-lg-5, - .px-lg-5 { - padding-left: 3rem !important; - } - .m-lg-n1 { - margin: -0.25rem !important; - } - .mt-lg-n1, - .my-lg-n1 { - margin-top: -0.25rem !important; - } - .mr-lg-n1, - .mx-lg-n1 { - margin-right: -0.25rem !important; - } - .mb-lg-n1, - .my-lg-n1 { - margin-bottom: -0.25rem !important; - } - .ml-lg-n1, - .mx-lg-n1 { - margin-left: -0.25rem !important; - } - .m-lg-n2 { - margin: -0.5rem !important; - } - .mt-lg-n2, - .my-lg-n2 { - margin-top: -0.5rem !important; - } - .mr-lg-n2, - .mx-lg-n2 { - margin-right: -0.5rem !important; - } - .mb-lg-n2, - .my-lg-n2 { - margin-bottom: -0.5rem !important; - } - .ml-lg-n2, - .mx-lg-n2 { - margin-left: -0.5rem !important; - } - .m-lg-n3 { - margin: -1rem !important; - } - .mt-lg-n3, - .my-lg-n3 { - margin-top: -1rem !important; - } - .mr-lg-n3, - .mx-lg-n3 { - margin-right: -1rem !important; - } - .mb-lg-n3, - .my-lg-n3 { - margin-bottom: -1rem !important; - } - .ml-lg-n3, - .mx-lg-n3 { - margin-left: -1rem !important; - } - .m-lg-n4 { - margin: -1.5rem !important; - } - .mt-lg-n4, - .my-lg-n4 { - margin-top: -1.5rem !important; - } - .mr-lg-n4, - .mx-lg-n4 { - margin-right: -1.5rem !important; - } - .mb-lg-n4, - .my-lg-n4 { - margin-bottom: -1.5rem !important; - } - .ml-lg-n4, - .mx-lg-n4 { - margin-left: -1.5rem !important; - } - .m-lg-n5 { - margin: -3rem !important; - } - .mt-lg-n5, - .my-lg-n5 { - margin-top: -3rem !important; - } - .mr-lg-n5, - .mx-lg-n5 { - margin-right: -3rem !important; - } - .mb-lg-n5, - .my-lg-n5 { - margin-bottom: -3rem !important; - } - .ml-lg-n5, - .mx-lg-n5 { - margin-left: -3rem !important; - } - .m-lg-auto { - margin: auto !important; - } - .mt-lg-auto, - .my-lg-auto { - margin-top: auto !important; - } - .mr-lg-auto, - .mx-lg-auto { - margin-right: auto !important; - } - .mb-lg-auto, - .my-lg-auto { - margin-bottom: auto !important; - } - .ml-lg-auto, - .mx-lg-auto { - margin-left: auto !important; - } -} - -@media (min-width: 1200px) { - .m-xl-0 { - margin: 0 !important; - } - .mt-xl-0, - .my-xl-0 { - margin-top: 0 !important; - } - .mr-xl-0, - .mx-xl-0 { - margin-right: 0 !important; - } - .mb-xl-0, - .my-xl-0 { - margin-bottom: 0 !important; - } - .ml-xl-0, - .mx-xl-0 { - margin-left: 0 !important; - } - .m-xl-1 { - margin: 0.25rem !important; - } - .mt-xl-1, - .my-xl-1 { - margin-top: 0.25rem !important; - } - .mr-xl-1, - .mx-xl-1 { - margin-right: 0.25rem !important; - } - .mb-xl-1, - .my-xl-1 { - margin-bottom: 0.25rem !important; - } - .ml-xl-1, - .mx-xl-1 { - margin-left: 0.25rem !important; - } - .m-xl-2 { - margin: 0.5rem !important; - } - .mt-xl-2, - .my-xl-2 { - margin-top: 0.5rem !important; - } - .mr-xl-2, - .mx-xl-2 { - margin-right: 0.5rem !important; - } - .mb-xl-2, - .my-xl-2 { - margin-bottom: 0.5rem !important; - } - .ml-xl-2, - .mx-xl-2 { - margin-left: 0.5rem !important; - } - .m-xl-3 { - margin: 1rem !important; - } - .mt-xl-3, - .my-xl-3 { - margin-top: 1rem !important; - } - .mr-xl-3, - .mx-xl-3 { - margin-right: 1rem !important; - } - .mb-xl-3, - .my-xl-3 { - margin-bottom: 1rem !important; - } - .ml-xl-3, - .mx-xl-3 { - margin-left: 1rem !important; - } - .m-xl-4 { - margin: 1.5rem !important; - } - .mt-xl-4, - .my-xl-4 { - margin-top: 1.5rem !important; - } - .mr-xl-4, - .mx-xl-4 { - margin-right: 1.5rem !important; - } - .mb-xl-4, - .my-xl-4 { - margin-bottom: 1.5rem !important; - } - .ml-xl-4, - .mx-xl-4 { - margin-left: 1.5rem !important; - } - .m-xl-5 { - margin: 3rem !important; - } - .mt-xl-5, - .my-xl-5 { - margin-top: 3rem !important; - } - .mr-xl-5, - .mx-xl-5 { - margin-right: 3rem !important; - } - .mb-xl-5, - .my-xl-5 { - margin-bottom: 3rem !important; - } - .ml-xl-5, - .mx-xl-5 { - margin-left: 3rem !important; - } - .p-xl-0 { - padding: 0 !important; - } - .pt-xl-0, - .py-xl-0 { - padding-top: 0 !important; - } - .pr-xl-0, - .px-xl-0 { - padding-right: 0 !important; - } - .pb-xl-0, - .py-xl-0 { - padding-bottom: 0 !important; - } - .pl-xl-0, - .px-xl-0 { - padding-left: 0 !important; - } - .p-xl-1 { - padding: 0.25rem !important; - } - .pt-xl-1, - .py-xl-1 { - padding-top: 0.25rem !important; - } - .pr-xl-1, - .px-xl-1 { - padding-right: 0.25rem !important; - } - .pb-xl-1, - .py-xl-1 { - padding-bottom: 0.25rem !important; - } - .pl-xl-1, - .px-xl-1 { - padding-left: 0.25rem !important; - } - .p-xl-2 { - padding: 0.5rem !important; - } - .pt-xl-2, - .py-xl-2 { - padding-top: 0.5rem !important; - } - .pr-xl-2, - .px-xl-2 { - padding-right: 0.5rem !important; - } - .pb-xl-2, - .py-xl-2 { - padding-bottom: 0.5rem !important; - } - .pl-xl-2, - .px-xl-2 { - padding-left: 0.5rem !important; - } - .p-xl-3 { - padding: 1rem !important; - } - .pt-xl-3, - .py-xl-3 { - padding-top: 1rem !important; - } - .pr-xl-3, - .px-xl-3 { - padding-right: 1rem !important; - } - .pb-xl-3, - .py-xl-3 { - padding-bottom: 1rem !important; - } - .pl-xl-3, - .px-xl-3 { - padding-left: 1rem !important; - } - .p-xl-4 { - padding: 1.5rem !important; - } - .pt-xl-4, - .py-xl-4 { - padding-top: 1.5rem !important; - } - .pr-xl-4, - .px-xl-4 { - padding-right: 1.5rem !important; - } - .pb-xl-4, - .py-xl-4 { - padding-bottom: 1.5rem !important; - } - .pl-xl-4, - .px-xl-4 { - padding-left: 1.5rem !important; - } - .p-xl-5 { - padding: 3rem !important; - } - .pt-xl-5, - .py-xl-5 { - padding-top: 3rem !important; - } - .pr-xl-5, - .px-xl-5 { - padding-right: 3rem !important; - } - .pb-xl-5, - .py-xl-5 { - padding-bottom: 3rem !important; - } - .pl-xl-5, - .px-xl-5 { - padding-left: 3rem !important; - } - .m-xl-n1 { - margin: -0.25rem !important; - } - .mt-xl-n1, - .my-xl-n1 { - margin-top: -0.25rem !important; - } - .mr-xl-n1, - .mx-xl-n1 { - margin-right: -0.25rem !important; - } - .mb-xl-n1, - .my-xl-n1 { - margin-bottom: -0.25rem !important; - } - .ml-xl-n1, - .mx-xl-n1 { - margin-left: -0.25rem !important; - } - .m-xl-n2 { - margin: -0.5rem !important; - } - .mt-xl-n2, - .my-xl-n2 { - margin-top: -0.5rem !important; - } - .mr-xl-n2, - .mx-xl-n2 { - margin-right: -0.5rem !important; - } - .mb-xl-n2, - .my-xl-n2 { - margin-bottom: -0.5rem !important; - } - .ml-xl-n2, - .mx-xl-n2 { - margin-left: -0.5rem !important; - } - .m-xl-n3 { - margin: -1rem !important; - } - .mt-xl-n3, - .my-xl-n3 { - margin-top: -1rem !important; - } - .mr-xl-n3, - .mx-xl-n3 { - margin-right: -1rem !important; - } - .mb-xl-n3, - .my-xl-n3 { - margin-bottom: -1rem !important; - } - .ml-xl-n3, - .mx-xl-n3 { - margin-left: -1rem !important; - } - .m-xl-n4 { - margin: -1.5rem !important; - } - .mt-xl-n4, - .my-xl-n4 { - margin-top: -1.5rem !important; - } - .mr-xl-n4, - .mx-xl-n4 { - margin-right: -1.5rem !important; - } - .mb-xl-n4, - .my-xl-n4 { - margin-bottom: -1.5rem !important; - } - .ml-xl-n4, - .mx-xl-n4 { - margin-left: -1.5rem !important; - } - .m-xl-n5 { - margin: -3rem !important; - } - .mt-xl-n5, - .my-xl-n5 { - margin-top: -3rem !important; - } - .mr-xl-n5, - .mx-xl-n5 { - margin-right: -3rem !important; - } - .mb-xl-n5, - .my-xl-n5 { - margin-bottom: -3rem !important; - } - .ml-xl-n5, - .mx-xl-n5 { - margin-left: -3rem !important; - } - .m-xl-auto { - margin: auto !important; - } - .mt-xl-auto, - .my-xl-auto { - margin-top: auto !important; - } - .mr-xl-auto, - .mx-xl-auto { - margin-right: auto !important; - } - .mb-xl-auto, - .my-xl-auto { - margin-bottom: auto !important; - } - .ml-xl-auto, - .mx-xl-auto { - margin-left: auto !important; - } -} - -.stretched-link::after { - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - z-index: 1; - pointer-events: auto; - content: ""; - background-color: rgba(0, 0, 0, 0); -} - -.text-monospace { - font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important; -} - -.text-justify { - text-align: justify !important; -} - -.text-wrap { - white-space: normal !important; -} - -.text-nowrap { - white-space: nowrap !important; -} - -.text-truncate { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -.text-left { - text-align: left !important; -} - -.text-right { - text-align: right !important; -} - -.text-center { - text-align: center !important; -} - -@media (min-width: 576px) { - .text-sm-left { - text-align: left !important; - } - .text-sm-right { - text-align: right !important; - } - .text-sm-center { - text-align: center !important; - } -} - -@media (min-width: 768px) { - .text-md-left { - text-align: left !important; - } - .text-md-right { - text-align: right !important; - } - .text-md-center { - text-align: center !important; - } -} - -@media (min-width: 992px) { - .text-lg-left { - text-align: left !important; - } - .text-lg-right { - text-align: right !important; - } - .text-lg-center { - text-align: center !important; - } -} - -@media (min-width: 1200px) { - .text-xl-left { - text-align: left !important; - } - .text-xl-right { - text-align: right !important; - } - .text-xl-center { - text-align: center !important; - } -} - -.text-lowercase { - text-transform: lowercase !important; -} - -.text-uppercase { - text-transform: uppercase !important; -} - -.text-capitalize { - text-transform: capitalize !important; -} - -.font-weight-light { - font-weight: 300 !important; -} - -.font-weight-lighter { - font-weight: lighter !important; -} - -.font-weight-normal { - font-weight: 400 !important; -} - -.font-weight-bold { - font-weight: 700 !important; -} - -.font-weight-bolder { - font-weight: bolder !important; -} - -.font-italic { - font-style: italic !important; -} - -.text-white { - color: #fff !important; -} - -.text-primary { - color: #007bff !important; -} - -a.text-primary:hover, a.text-primary:focus { - color: #0056b3 !important; -} - -.text-secondary { - color: #6c757d !important; -} - -a.text-secondary:hover, a.text-secondary:focus { - color: #494f54 !important; -} - -.text-success { - color: #28a745 !important; -} - -a.text-success:hover, a.text-success:focus { - color: #19692c !important; -} - -.text-info { - color: #17a2b8 !important; -} - -a.text-info:hover, a.text-info:focus { - color: #0f6674 !important; -} - -.text-warning { - color: #ffc107 !important; -} - -a.text-warning:hover, a.text-warning:focus { - color: #ba8b00 !important; -} - -.text-danger { - color: #dc3545 !important; -} - -a.text-danger:hover, a.text-danger:focus { - color: #a71d2a !important; -} - -.text-light { - color: #f8f9fa !important; -} - -a.text-light:hover, a.text-light:focus { - color: #cbd3da !important; -} - -.text-dark { - color: #343a40 !important; -} - -a.text-dark:hover, a.text-dark:focus { - color: #121416 !important; -} - -.text-body { - color: #212529 !important; -} - -.text-muted { - color: #6c757d !important; -} - -.text-black-50 { - color: rgba(0, 0, 0, 0.5) !important; -} - -.text-white-50 { - color: rgba(255, 255, 255, 0.5) !important; -} - -.text-hide { - font: 0/0 a; - color: transparent; - text-shadow: none; - background-color: transparent; - border: 0; -} - -.text-decoration-none { - text-decoration: none !important; -} - -.text-break { - word-break: break-word !important; - word-wrap: break-word !important; -} - -.text-reset { - color: inherit !important; -} - -.visible { - visibility: visible !important; -} - -.invisible { - visibility: hidden !important; -} - -@media print { - *, - *::before, - *::after { - text-shadow: none !important; - box-shadow: none !important; - } - a:not(.btn) { - text-decoration: underline; - } - abbr[title]::after { - content: " (" attr(title) ")"; - } - pre { - white-space: pre-wrap !important; - } - pre, - blockquote { - border: 1px solid #adb5bd; - page-break-inside: avoid; - } - thead { - display: table-header-group; - } - tr, - img { - page-break-inside: avoid; - } - p, - h2, - h3 { - orphans: 3; - widows: 3; - } - h2, - h3 { - page-break-after: avoid; - } - @page { - size: a3; - } - body { - min-width: 992px !important; - } - .container { - min-width: 992px !important; - } - .navbar { - display: none; - } - .badge { - border: 1px solid #000; - } - .table { - border-collapse: collapse !important; - } - .table td, - .table th { - background-color: #fff !important; - } - .table-bordered th, - .table-bordered td { - border: 1px solid #dee2e6 !important; - } - .table-dark { - color: inherit; - } - .table-dark th, - .table-dark td, - .table-dark thead th, - .table-dark tbody + tbody { - border-color: #dee2e6; - } - .table .thead-dark th { - color: inherit; - border-color: #dee2e6; - } -} - -.rtl, -[dir="rtl"] { - text-align: right; - direction: rtl; -} - -.rtl .nav, -[dir="rtl"] .nav { - padding-right: 0; -} - -.rtl .navbar-nav .nav-item, -[dir="rtl"] .navbar-nav .nav-item { - float: right; -} - -.rtl .navbar-nav .nav-item + .nav-item, -[dir="rtl"] .navbar-nav .nav-item + .nav-item { - margin-right: inherit; - margin-left: 1rem; -} - -.rtl th, -[dir="rtl"] th { - text-align: right; -} - -.rtl .alert-dismissible, -[dir="rtl"] .alert-dismissible { - padding-right: 1.25rem; - padding-left: 4rem; -} - -.rtl .dropdown-menu, -[dir="rtl"] .dropdown-menu { - right: 0; - left: inherit; - text-align: right; -} - -.rtl .checkbox label, -[dir="rtl"] .checkbox label { - padding-right: 1.25rem; - padding-left: inherit; -} - -.rtl .btn-group > .btn:not(:first-child), -.rtl .btn-group > .btn-group:not(:first-child), -[dir="rtl"] .btn-group > .btn:not(:first-child), -[dir="rtl"] .btn-group > .btn-group:not(:first-child) { - margin-left: initial; - margin-right: -1px; -} - -.rtl .btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle), -[dir="rtl"] .btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) { - border-radius: 0 0.25rem 0.25rem 0; -} - -.rtl .btn-group > .btn:last-child:not(:first-child), -.rtl .btn-group > .dropdown-toggle:not(:first-child), -[dir="rtl"] .btn-group > .btn:last-child:not(:first-child), -[dir="rtl"] .btn-group > .dropdown-toggle:not(:first-child) { - border-radius: 0.25rem 0 0 0.25rem; -} - -.rtl .btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child, -[dir="rtl"] .btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child { - border-radius: 0.25rem 0 0 0.25rem; -} - -.rtl .custom-control, -[dir="rtl"] .custom-control { - padding-right: 1.5rem; - padding-left: inherit; - margin-right: inherit; - margin-left: 1rem; -} - -.rtl .custom-control-indicator, -[dir="rtl"] .custom-control-indicator { - right: 0; - left: inherit; -} - -.rtl .custom-file-label::after, -[dir="rtl"] .custom-file-label::after { - right: initial; - left: -1px; - border-radius: .25rem 0 0 .25rem; -} - -.rtl .custom-control-label::after, -.rtl .custom-control-label::before, -[dir="rtl"] .custom-control-label::after, -[dir="rtl"] .custom-control-label::before { - right: -1.5rem; - left: inherit; -} - -.rtl .custom-select, -[dir="rtl"] .custom-select { - padding: 0.375rem 0.75rem 0.375rem 1.75rem; - background: #fff url("data:image/svg+xml,") no-repeat left 0.75rem center; - background-size: 8px 10px; -} - -.rtl .custom-switch, -[dir="rtl"] .custom-switch { - padding-right: 2.25rem; - padding-left: inherit; -} - -.rtl .custom-switch .custom-control-label::before, -[dir="rtl"] .custom-switch .custom-control-label::before { - right: -2.25rem; -} - -.rtl .custom-switch .custom-control-label::after, -[dir="rtl"] .custom-switch .custom-control-label::after { - right: calc(-2.25rem + 2px); -} - -.rtl .custom-switch .custom-control-input:checked ~ .custom-control-label::after, -[dir="rtl"] .custom-switch .custom-control-input:checked ~ .custom-control-label::after { - transform: translateX(-0.75rem); -} - -.rtl .input-group > .input-group-append:last-child > .btn:not(:last-child):not(.dropdown-toggle), -.rtl .input-group > .input-group-append:last-child > .input-group-text:not(:last-child), -.rtl .input-group > .input-group-append:not(:last-child) > .btn, -.rtl .input-group > .input-group-append:not(:last-child) > .input-group-text, -.rtl .input-group > .input-group-prepend > .btn, -.rtl .input-group > .input-group-prepend > .input-group-text, -[dir="rtl"] .input-group > .input-group-append:last-child > .btn:not(:last-child):not(.dropdown-toggle), -[dir="rtl"] .input-group > .input-group-append:last-child > .input-group-text:not(:last-child), -[dir="rtl"] .input-group > .input-group-append:not(:last-child) > .btn, -[dir="rtl"] .input-group > .input-group-append:not(:last-child) > .input-group-text, -[dir="rtl"] .input-group > .input-group-prepend > .btn, -[dir="rtl"] .input-group > .input-group-prepend > .input-group-text { - border-radius: 0 0.25rem 0.25rem 0; -} - -.rtl .input-group > .input-group-append > .btn, -.rtl .input-group > .input-group-append > .input-group-text, -.rtl .input-group > .input-group-prepend:first-child > .btn:not(:first-child), -.rtl .input-group > .input-group-prepend:first-child > .input-group-text:not(:first-child), -.rtl .input-group > .input-group-prepend:not(:first-child) > .btn, -.rtl .input-group > .input-group-prepend:not(:first-child) > .input-group-text, -[dir="rtl"] .input-group > .input-group-append > .btn, -[dir="rtl"] .input-group > .input-group-append > .input-group-text, -[dir="rtl"] .input-group > .input-group-prepend:first-child > .btn:not(:first-child), -[dir="rtl"] .input-group > .input-group-prepend:first-child > .input-group-text:not(:first-child), -[dir="rtl"] .input-group > .input-group-prepend:not(:first-child) > .btn, -[dir="rtl"] .input-group > .input-group-prepend:not(:first-child) > .input-group-text { - border-radius: 0.25rem 0 0 0.25rem; -} - -.rtl .input-group > .custom-select:not(:first-child), -.rtl .input-group > .form-control:not(:first-child), -[dir="rtl"] .input-group > .custom-select:not(:first-child), -[dir="rtl"] .input-group > .form-control:not(:first-child) { - border-radius: 0.25rem 0 0 0.25rem; -} - -.rtl .input-group > .custom-select:not(:last-child), -.rtl .input-group > .form-control:not(:last-child), -[dir="rtl"] .input-group > .custom-select:not(:last-child), -[dir="rtl"] .input-group > .form-control:not(:last-child) { - border-radius: 0 0.25rem 0.25rem 0; -} - -.rtl .input-group > .custom-select:not(:last-child):not(:first-child), -.rtl .input-group > .form-control:not(:last-child):not(:first-child), -[dir="rtl"] .input-group > .custom-select:not(:last-child):not(:first-child), -[dir="rtl"] .input-group > .form-control:not(:last-child):not(:first-child) { - border-radius: 0; -} - -.rtl .radio input, -.rtl .radio-inline, -.rtl .checkbox input, -.rtl .checkbox-inline input, -[dir="rtl"] .radio input, -[dir="rtl"] .radio-inline, -[dir="rtl"] .checkbox input, -[dir="rtl"] .checkbox-inline input { - margin-right: -1.25rem; - margin-left: inherit; -} - -.rtl .breadcrumb-item + .breadcrumb-item, -[dir="rtl"] .breadcrumb-item + .breadcrumb-item { - padding-right: 0.5rem; - padding-left: 0; - color: #6c757d; - content: "/"; -} - -.rtl .breadcrumb-item + .breadcrumb-item::before, -[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before { - padding-right: 0; - padding-left: 0.5rem; -} - -.rtl .list-group, -[dir="rtl"] .list-group { - padding-right: 0; - padding-left: 40px; -} - -.rtl .close, -[dir="rtl"] .close { - float: left; -} - -.rtl .modal-header .close, -[dir="rtl"] .modal-header .close { - margin: -15px auto -15px -15px; -} - -.rtl .modal-footer > :not(:first-child), -[dir="rtl"] .modal-footer > :not(:first-child) { - margin-right: .25rem; -} - -.rtl .modal-footer > :not(:last-child), -[dir="rtl"] .modal-footer > :not(:last-child) { - margin-left: .25rem; -} - -.rtl .modal-footer > :first-child, -[dir="rtl"] .modal-footer > :first-child { - margin-right: 0; -} - -.rtl .modal-footer > :last-child, -[dir="rtl"] .modal-footer > :last-child { - margin-left: 0; -} - -.rtl .alert-dismissible .close, -[dir="rtl"] .alert-dismissible .close { - right: inherit; - left: 0; -} - -.rtl .dropdown-toggle::after, -[dir="rtl"] .dropdown-toggle::after { - margin-right: .255em; - margin-left: 0; -} - -.rtl .form-check-input, -[dir="rtl"] .form-check-input { - margin-right: -1.25rem; - margin-left: inherit; -} - -.rtl .form-check-label, -[dir="rtl"] .form-check-label { - padding-right: 1.25rem; - padding-left: inherit; -} - -.rtl .pagination, -.rtl .list-unstyled, -.rtl .list-inline, -[dir="rtl"] .pagination, -[dir="rtl"] .list-unstyled, -[dir="rtl"] .list-inline { - padding-right: 0; - padding-left: inherit; -} - -.rtl .pagination .page-item:first-child .page-link, -[dir="rtl"] .pagination .page-item:first-child .page-link { - border-top-right-radius: 0.25rem; - border-bottom-right-radius: 0.25rem; - border-top-left-radius: 0; - border-bottom-left-radius: 0; -} - -.rtl .pagination .page-item:last-child .page-link, -[dir="rtl"] .pagination .page-item:last-child .page-link { - border-top-right-radius: 0; - border-bottom-right-radius: 0; - border-top-left-radius: 0.25rem; - border-bottom-left-radius: 0.25rem; -} - -.rtl .offset-1, -[dir="rtl"] .offset-1 { - margin-right: 8.333333%; - margin-left: 0; -} - -.rtl .offset-2, -[dir="rtl"] .offset-2 { - margin-right: 16.666667%; - margin-left: 0; -} - -.rtl .offset-3, -[dir="rtl"] .offset-3 { - margin-right: 25%; - margin-left: 0; -} - -.rtl .offset-4, -[dir="rtl"] .offset-4 { - margin-right: 33.333333%; - margin-left: 0; -} - -.rtl .offset-5, -[dir="rtl"] .offset-5 { - margin-right: 41.666667%; - margin-left: 0; -} - -.rtl .offset-6, -[dir="rtl"] .offset-6 { - margin-right: 50%; - margin-left: 0; -} - -.rtl .offset-7, -[dir="rtl"] .offset-7 { - margin-right: 58.333333%; - margin-left: 0; -} - -.rtl .offset-8, -[dir="rtl"] .offset-8 { - margin-right: 66.666667%; - margin-left: 0; -} - -.rtl .offset-9, -[dir="rtl"] .offset-9 { - margin-right: 75%; - margin-left: 0; -} - -.rtl .offset-10, -[dir="rtl"] .offset-10 { - margin-right: 83.333333%; - margin-left: 0; -} - -.rtl .offset-11, -[dir="rtl"] .offset-11 { - margin-right: 91.666667%; - margin-left: 0; -} - -@media (min-width: 576px) { - .rtl .offset-sm-0, - [dir="rtl"] .offset-sm-0 { - margin-right: 0; - margin-left: 0; - } - .rtl .offset-sm-1, - [dir="rtl"] .offset-sm-1 { - margin-right: 8.333333%; - margin-left: 0; - } - .rtl .offset-sm-2, - [dir="rtl"] .offset-sm-2 { - margin-right: 16.666667%; - margin-left: 0; - } - .rtl .offset-sm-3, - [dir="rtl"] .offset-sm-3 { - margin-right: 25%; - margin-left: 0; - } - .rtl .offset-sm-4, - [dir="rtl"] .offset-sm-4 { - margin-right: 33.333333%; - margin-left: 0; - } - .rtl .offset-sm-5, - [dir="rtl"] .offset-sm-5 { - margin-right: 41.666667%; - margin-left: 0; - } - .rtl .offset-sm-6, - [dir="rtl"] .offset-sm-6 { - margin-right: 50%; - margin-left: 0; - } - .rtl .offset-sm-7, - [dir="rtl"] .offset-sm-7 { - margin-right: 58.333333%; - margin-left: 0; - } - .rtl .offset-sm-8, - [dir="rtl"] .offset-sm-8 { - margin-right: 66.666667%; - margin-left: 0; - } - .rtl .offset-sm-9, - [dir="rtl"] .offset-sm-9 { - margin-right: 75%; - margin-left: 0; - } - .rtl .offset-sm-10, - [dir="rtl"] .offset-sm-10 { - margin-right: 83.333333%; - margin-left: 0; - } - .rtl .offset-sm-11, - [dir="rtl"] .offset-sm-11 { - margin-right: 91.666667%; - margin-left: 0; - } -} - -@media (min-width: 768px) { - .rtl .offset-md-0, - [dir="rtl"] .offset-md-0 { - margin-right: 0; - margin-left: 0; - } - .rtl .offset-md-1, - [dir="rtl"] .offset-md-1 { - margin-right: 8.333333%; - margin-left: 0; - } - .rtl .offset-md-2, - [dir="rtl"] .offset-md-2 { - margin-right: 16.666667%; - margin-left: 0; - } - .rtl .offset-md-3, - [dir="rtl"] .offset-md-3 { - margin-right: 25%; - margin-left: 0; - } - .rtl .offset-md-4, - [dir="rtl"] .offset-md-4 { - margin-right: 33.333333%; - margin-left: 0; - } - .rtl .offset-md-5, - [dir="rtl"] .offset-md-5 { - margin-right: 41.666667%; - margin-left: 0; - } - .rtl .offset-md-6, - [dir="rtl"] .offset-md-6 { - margin-right: 50%; - margin-left: 0; - } - .rtl .offset-md-7, - [dir="rtl"] .offset-md-7 { - margin-right: 58.333333%; - margin-left: 0; - } - .rtl .offset-md-8, - [dir="rtl"] .offset-md-8 { - margin-right: 66.666667%; - margin-left: 0; - } - .rtl .offset-md-9, - [dir="rtl"] .offset-md-9 { - margin-right: 75%; - margin-left: 0; - } - .rtl .offset-md-10, - [dir="rtl"] .offset-md-10 { - margin-right: 83.333333%; - margin-left: 0; - } - .rtl .offset-md-11, - [dir="rtl"] .offset-md-11 { - margin-right: 91.666667%; - margin-left: 0; - } -} - -@media (min-width: 992px) { - .rtl .offset-lg-0, - [dir="rtl"] .offset-lg-0 { - margin-right: 0; - margin-left: 0; - } - .rtl .offset-lg-1, - [dir="rtl"] .offset-lg-1 { - margin-right: 8.333333%; - margin-left: 0; - } - .rtl .offset-lg-2, - [dir="rtl"] .offset-lg-2 { - margin-right: 16.666667%; - margin-left: 0; - } - .rtl .offset-lg-3, - [dir="rtl"] .offset-lg-3 { - margin-right: 25%; - margin-left: 0; - } - .rtl .offset-lg-4, - [dir="rtl"] .offset-lg-4 { - margin-right: 33.333333%; - margin-left: 0; - } - .rtl .offset-lg-5, - [dir="rtl"] .offset-lg-5 { - margin-right: 41.666667%; - margin-left: 0; - } - .rtl .offset-lg-6, - [dir="rtl"] .offset-lg-6 { - margin-right: 50%; - margin-left: 0; - } - .rtl .offset-lg-7, - [dir="rtl"] .offset-lg-7 { - margin-right: 58.333333%; - margin-left: 0; - } - .rtl .offset-lg-8, - [dir="rtl"] .offset-lg-8 { - margin-right: 66.666667%; - margin-left: 0; - } - .rtl .offset-lg-9, - [dir="rtl"] .offset-lg-9 { - margin-right: 75%; - margin-left: 0; - } - .rtl .offset-lg-10, - [dir="rtl"] .offset-lg-10 { - margin-right: 83.333333%; - margin-left: 0; - } - .rtl .offset-lg-11, - [dir="rtl"] .offset-lg-11 { - margin-right: 91.666667%; - margin-left: 0; - } -} - -@media (min-width: 1200px) { - .rtl .offset-xl-0, - [dir="rtl"] .offset-xl-0 { - margin-right: 0; - margin-left: 0; - } - .rtl .offset-xl-1, - [dir="rtl"] .offset-xl-1 { - margin-right: 8.333333%; - margin-left: 0; - } - .rtl .offset-xl-2, - [dir="rtl"] .offset-xl-2 { - margin-right: 16.666667%; - margin-left: 0; - } - .rtl .offset-xl-3, - [dir="rtl"] .offset-xl-3 { - margin-right: 25%; - margin-left: 0; - } - .rtl .offset-xl-4, - [dir="rtl"] .offset-xl-4 { - margin-right: 33.333333%; - margin-left: 0; - } - .rtl .offset-xl-5, - [dir="rtl"] .offset-xl-5 { - margin-right: 41.666667%; - margin-left: 0; - } - .rtl .offset-xl-6, - [dir="rtl"] .offset-xl-6 { - margin-right: 50%; - margin-left: 0; - } - .rtl .offset-xl-7, - [dir="rtl"] .offset-xl-7 { - margin-right: 58.333333%; - margin-left: 0; - } - .rtl .offset-xl-8, - [dir="rtl"] .offset-xl-8 { - margin-right: 66.666667%; - margin-left: 0; - } - .rtl .offset-xl-9, - [dir="rtl"] .offset-xl-9 { - margin-right: 75%; - margin-left: 0; - } - .rtl .offset-xl-10, - [dir="rtl"] .offset-xl-10 { - margin-right: 83.333333%; - margin-left: 0; - } - .rtl .offset-xl-11, - [dir="rtl"] .offset-xl-11 { - margin-right: 91.666667%; - margin-left: 0; - } -} - -.rtl .mr-0, -[dir="rtl"] .mr-0 { - margin-right: 0 !important; - margin-left: 0 !important; -} - -.rtl .ml-0, -[dir="rtl"] .ml-0 { - margin-left: 0 !important; - margin-right: 0 !important; -} - -.rtl mx-0, -[dir="rtl"] mx-0 { - margin-left: 0 !important; - margin-right: 0 !important; -} - -.rtl .mr-1, -[dir="rtl"] .mr-1 { - margin-right: 0 !important; - margin-left: 0.25rem !important; -} - -.rtl .ml-1, -[dir="rtl"] .ml-1 { - margin-left: 0 !important; - margin-right: 0.25rem !important; -} - -.rtl mx-1, -[dir="rtl"] mx-1 { - margin-left: 0.25rem !important; - margin-right: 0.25rem !important; -} - -.rtl .mr-2, -[dir="rtl"] .mr-2 { - margin-right: 0 !important; - margin-left: 0.5rem !important; -} - -.rtl .ml-2, -[dir="rtl"] .ml-2 { - margin-left: 0 !important; - margin-right: 0.5rem !important; -} - -.rtl mx-2, -[dir="rtl"] mx-2 { - margin-left: 0.5rem !important; - margin-right: 0.5rem !important; -} - -.rtl .mr-3, -[dir="rtl"] .mr-3 { - margin-right: 0 !important; - margin-left: 1rem !important; -} - -.rtl .ml-3, -[dir="rtl"] .ml-3 { - margin-left: 0 !important; - margin-right: 1rem !important; -} - -.rtl mx-3, -[dir="rtl"] mx-3 { - margin-left: 1rem !important; - margin-right: 1rem !important; -} - -.rtl .mr-4, -[dir="rtl"] .mr-4 { - margin-right: 0 !important; - margin-left: 1.5rem !important; -} - -.rtl .ml-4, -[dir="rtl"] .ml-4 { - margin-left: 0 !important; - margin-right: 1.5rem !important; -} - -.rtl mx-4, -[dir="rtl"] mx-4 { - margin-left: 1.5rem !important; - margin-right: 1.5rem !important; -} - -.rtl .mr-5, -[dir="rtl"] .mr-5 { - margin-right: 0 !important; - margin-left: 3rem !important; -} - -.rtl .ml-5, -[dir="rtl"] .ml-5 { - margin-left: 0 !important; - margin-right: 3rem !important; -} - -.rtl mx-5, -[dir="rtl"] mx-5 { - margin-left: 3rem !important; - margin-right: 3rem !important; -} - -.rtl .pr-0, -[dir="rtl"] .pr-0 { - padding-right: 0 !important; - padding-left: 0 !important; -} - -.rtl .pl-0, -[dir="rtl"] .pl-0 { - padding-left: 0 !important; - padding-right: 0 !important; -} - -.rtl px-0, -[dir="rtl"] px-0 { - padding-left: 0 !important; - padding-right: 0 !important; -} - -.rtl .pr-1, -[dir="rtl"] .pr-1 { - padding-right: 0 !important; - padding-left: 0.25rem !important; -} - -.rtl .pl-1, -[dir="rtl"] .pl-1 { - padding-left: 0 !important; - padding-right: 0.25rem !important; -} - -.rtl px-1, -[dir="rtl"] px-1 { - padding-left: 0.25rem !important; - padding-right: 0.25rem !important; -} - -.rtl .pr-2, -[dir="rtl"] .pr-2 { - padding-right: 0 !important; - padding-left: 0.5rem !important; -} - -.rtl .pl-2, -[dir="rtl"] .pl-2 { - padding-left: 0 !important; - padding-right: 0.5rem !important; -} - -.rtl px-2, -[dir="rtl"] px-2 { - padding-left: 0.5rem !important; - padding-right: 0.5rem !important; -} - -.rtl .pr-3, -[dir="rtl"] .pr-3 { - padding-right: 0 !important; - padding-left: 1rem !important; -} - -.rtl .pl-3, -[dir="rtl"] .pl-3 { - padding-left: 0 !important; - padding-right: 1rem !important; -} - -.rtl px-3, -[dir="rtl"] px-3 { - padding-left: 1rem !important; - padding-right: 1rem !important; -} - -.rtl .pr-4, -[dir="rtl"] .pr-4 { - padding-right: 0 !important; - padding-left: 1.5rem !important; -} - -.rtl .pl-4, -[dir="rtl"] .pl-4 { - padding-left: 0 !important; - padding-right: 1.5rem !important; -} - -.rtl px-4, -[dir="rtl"] px-4 { - padding-left: 1.5rem !important; - padding-right: 1.5rem !important; -} - -.rtl .pr-5, -[dir="rtl"] .pr-5 { - padding-right: 0 !important; - padding-left: 3rem !important; -} - -.rtl .pl-5, -[dir="rtl"] .pl-5 { - padding-left: 0 !important; - padding-right: 3rem !important; -} - -.rtl px-5, -[dir="rtl"] px-5 { - padding-left: 3rem !important; - padding-right: 3rem !important; -} - -.rtl .mr-auto, -[dir="rtl"] .mr-auto { - margin-right: 0 !important; - margin-left: auto !important; -} - -.rtl .ml-auto, -[dir="rtl"] .ml-auto { - margin-right: auto !important; - margin-left: 0 !important; -} - -.rtl .mx-auto, -[dir="rtl"] .mx-auto { - margin-right: auto !important; - margin-left: auto !important; -} - -@media (min-width: 576px) { - .rtl .mr-sm-0, - [dir="rtl"] .mr-sm-0 { - margin-right: 0 !important; - margin-left: 0 !important; - } - .rtl .ml-sm-0, - [dir="rtl"] .ml-sm-0 { - margin-left: 0 !important; - margin-right: 0 !important; - } - .rtl mx-sm-0, - [dir="rtl"] mx-sm-0 { - margin-left: 0 !important; - margin-right: 0 !important; - } - .rtl .mr-sm-1, - [dir="rtl"] .mr-sm-1 { - margin-right: 0 !important; - margin-left: 0.25rem !important; - } - .rtl .ml-sm-1, - [dir="rtl"] .ml-sm-1 { - margin-left: 0 !important; - margin-right: 0.25rem !important; - } - .rtl mx-sm-1, - [dir="rtl"] mx-sm-1 { - margin-left: 0.25rem !important; - margin-right: 0.25rem !important; - } - .rtl .mr-sm-2, - [dir="rtl"] .mr-sm-2 { - margin-right: 0 !important; - margin-left: 0.5rem !important; - } - .rtl .ml-sm-2, - [dir="rtl"] .ml-sm-2 { - margin-left: 0 !important; - margin-right: 0.5rem !important; - } - .rtl mx-sm-2, - [dir="rtl"] mx-sm-2 { - margin-left: 0.5rem !important; - margin-right: 0.5rem !important; - } - .rtl .mr-sm-3, - [dir="rtl"] .mr-sm-3 { - margin-right: 0 !important; - margin-left: 1rem !important; - } - .rtl .ml-sm-3, - [dir="rtl"] .ml-sm-3 { - margin-left: 0 !important; - margin-right: 1rem !important; - } - .rtl mx-sm-3, - [dir="rtl"] mx-sm-3 { - margin-left: 1rem !important; - margin-right: 1rem !important; - } - .rtl .mr-sm-4, - [dir="rtl"] .mr-sm-4 { - margin-right: 0 !important; - margin-left: 1.5rem !important; - } - .rtl .ml-sm-4, - [dir="rtl"] .ml-sm-4 { - margin-left: 0 !important; - margin-right: 1.5rem !important; - } - .rtl mx-sm-4, - [dir="rtl"] mx-sm-4 { - margin-left: 1.5rem !important; - margin-right: 1.5rem !important; - } - .rtl .mr-sm-5, - [dir="rtl"] .mr-sm-5 { - margin-right: 0 !important; - margin-left: 3rem !important; - } - .rtl .ml-sm-5, - [dir="rtl"] .ml-sm-5 { - margin-left: 0 !important; - margin-right: 3rem !important; - } - .rtl mx-sm-5, - [dir="rtl"] mx-sm-5 { - margin-left: 3rem !important; - margin-right: 3rem !important; - } - .rtl .pr-sm-0, - [dir="rtl"] .pr-sm-0 { - padding-right: 0 !important; - padding-left: 0 !important; - } - .rtl .pl-sm-0, - [dir="rtl"] .pl-sm-0 { - padding-left: 0 !important; - padding-right: 0 !important; - } - .rtl px-sm-0, - [dir="rtl"] px-sm-0 { - padding-left: 0 !important; - padding-right: 0 !important; - } - .rtl .pr-sm-1, - [dir="rtl"] .pr-sm-1 { - padding-right: 0 !important; - padding-left: 0.25rem !important; - } - .rtl .pl-sm-1, - [dir="rtl"] .pl-sm-1 { - padding-left: 0 !important; - padding-right: 0.25rem !important; - } - .rtl px-sm-1, - [dir="rtl"] px-sm-1 { - padding-left: 0.25rem !important; - padding-right: 0.25rem !important; - } - .rtl .pr-sm-2, - [dir="rtl"] .pr-sm-2 { - padding-right: 0 !important; - padding-left: 0.5rem !important; - } - .rtl .pl-sm-2, - [dir="rtl"] .pl-sm-2 { - padding-left: 0 !important; - padding-right: 0.5rem !important; - } - .rtl px-sm-2, - [dir="rtl"] px-sm-2 { - padding-left: 0.5rem !important; - padding-right: 0.5rem !important; - } - .rtl .pr-sm-3, - [dir="rtl"] .pr-sm-3 { - padding-right: 0 !important; - padding-left: 1rem !important; - } - .rtl .pl-sm-3, - [dir="rtl"] .pl-sm-3 { - padding-left: 0 !important; - padding-right: 1rem !important; - } - .rtl px-sm-3, - [dir="rtl"] px-sm-3 { - padding-left: 1rem !important; - padding-right: 1rem !important; - } - .rtl .pr-sm-4, - [dir="rtl"] .pr-sm-4 { - padding-right: 0 !important; - padding-left: 1.5rem !important; - } - .rtl .pl-sm-4, - [dir="rtl"] .pl-sm-4 { - padding-left: 0 !important; - padding-right: 1.5rem !important; - } - .rtl px-sm-4, - [dir="rtl"] px-sm-4 { - padding-left: 1.5rem !important; - padding-right: 1.5rem !important; - } - .rtl .pr-sm-5, - [dir="rtl"] .pr-sm-5 { - padding-right: 0 !important; - padding-left: 3rem !important; - } - .rtl .pl-sm-5, - [dir="rtl"] .pl-sm-5 { - padding-left: 0 !important; - padding-right: 3rem !important; - } - .rtl px-sm-5, - [dir="rtl"] px-sm-5 { - padding-left: 3rem !important; - padding-right: 3rem !important; - } - .rtl .mr-sm-auto, - [dir="rtl"] .mr-sm-auto { - margin-right: 0 !important; - margin-left: auto !important; - } - .rtl .ml-sm-auto, - [dir="rtl"] .ml-sm-auto { - margin-right: auto !important; - margin-left: 0 !important; - } - .rtl .mx-sm-auto, - [dir="rtl"] .mx-sm-auto { - margin-right: auto !important; - margin-left: auto !important; - } -} - -@media (min-width: 768px) { - .rtl .mr-md-0, - [dir="rtl"] .mr-md-0 { - margin-right: 0 !important; - margin-left: 0 !important; - } - .rtl .ml-md-0, - [dir="rtl"] .ml-md-0 { - margin-left: 0 !important; - margin-right: 0 !important; - } - .rtl mx-md-0, - [dir="rtl"] mx-md-0 { - margin-left: 0 !important; - margin-right: 0 !important; - } - .rtl .mr-md-1, - [dir="rtl"] .mr-md-1 { - margin-right: 0 !important; - margin-left: 0.25rem !important; - } - .rtl .ml-md-1, - [dir="rtl"] .ml-md-1 { - margin-left: 0 !important; - margin-right: 0.25rem !important; - } - .rtl mx-md-1, - [dir="rtl"] mx-md-1 { - margin-left: 0.25rem !important; - margin-right: 0.25rem !important; - } - .rtl .mr-md-2, - [dir="rtl"] .mr-md-2 { - margin-right: 0 !important; - margin-left: 0.5rem !important; - } - .rtl .ml-md-2, - [dir="rtl"] .ml-md-2 { - margin-left: 0 !important; - margin-right: 0.5rem !important; - } - .rtl mx-md-2, - [dir="rtl"] mx-md-2 { - margin-left: 0.5rem !important; - margin-right: 0.5rem !important; - } - .rtl .mr-md-3, - [dir="rtl"] .mr-md-3 { - margin-right: 0 !important; - margin-left: 1rem !important; - } - .rtl .ml-md-3, - [dir="rtl"] .ml-md-3 { - margin-left: 0 !important; - margin-right: 1rem !important; - } - .rtl mx-md-3, - [dir="rtl"] mx-md-3 { - margin-left: 1rem !important; - margin-right: 1rem !important; - } - .rtl .mr-md-4, - [dir="rtl"] .mr-md-4 { - margin-right: 0 !important; - margin-left: 1.5rem !important; - } - .rtl .ml-md-4, - [dir="rtl"] .ml-md-4 { - margin-left: 0 !important; - margin-right: 1.5rem !important; - } - .rtl mx-md-4, - [dir="rtl"] mx-md-4 { - margin-left: 1.5rem !important; - margin-right: 1.5rem !important; - } - .rtl .mr-md-5, - [dir="rtl"] .mr-md-5 { - margin-right: 0 !important; - margin-left: 3rem !important; - } - .rtl .ml-md-5, - [dir="rtl"] .ml-md-5 { - margin-left: 0 !important; - margin-right: 3rem !important; - } - .rtl mx-md-5, - [dir="rtl"] mx-md-5 { - margin-left: 3rem !important; - margin-right: 3rem !important; - } - .rtl .pr-md-0, - [dir="rtl"] .pr-md-0 { - padding-right: 0 !important; - padding-left: 0 !important; - } - .rtl .pl-md-0, - [dir="rtl"] .pl-md-0 { - padding-left: 0 !important; - padding-right: 0 !important; - } - .rtl px-md-0, - [dir="rtl"] px-md-0 { - padding-left: 0 !important; - padding-right: 0 !important; - } - .rtl .pr-md-1, - [dir="rtl"] .pr-md-1 { - padding-right: 0 !important; - padding-left: 0.25rem !important; - } - .rtl .pl-md-1, - [dir="rtl"] .pl-md-1 { - padding-left: 0 !important; - padding-right: 0.25rem !important; - } - .rtl px-md-1, - [dir="rtl"] px-md-1 { - padding-left: 0.25rem !important; - padding-right: 0.25rem !important; - } - .rtl .pr-md-2, - [dir="rtl"] .pr-md-2 { - padding-right: 0 !important; - padding-left: 0.5rem !important; - } - .rtl .pl-md-2, - [dir="rtl"] .pl-md-2 { - padding-left: 0 !important; - padding-right: 0.5rem !important; - } - .rtl px-md-2, - [dir="rtl"] px-md-2 { - padding-left: 0.5rem !important; - padding-right: 0.5rem !important; - } - .rtl .pr-md-3, - [dir="rtl"] .pr-md-3 { - padding-right: 0 !important; - padding-left: 1rem !important; - } - .rtl .pl-md-3, - [dir="rtl"] .pl-md-3 { - padding-left: 0 !important; - padding-right: 1rem !important; - } - .rtl px-md-3, - [dir="rtl"] px-md-3 { - padding-left: 1rem !important; - padding-right: 1rem !important; - } - .rtl .pr-md-4, - [dir="rtl"] .pr-md-4 { - padding-right: 0 !important; - padding-left: 1.5rem !important; - } - .rtl .pl-md-4, - [dir="rtl"] .pl-md-4 { - padding-left: 0 !important; - padding-right: 1.5rem !important; - } - .rtl px-md-4, - [dir="rtl"] px-md-4 { - padding-left: 1.5rem !important; - padding-right: 1.5rem !important; - } - .rtl .pr-md-5, - [dir="rtl"] .pr-md-5 { - padding-right: 0 !important; - padding-left: 3rem !important; - } - .rtl .pl-md-5, - [dir="rtl"] .pl-md-5 { - padding-left: 0 !important; - padding-right: 3rem !important; - } - .rtl px-md-5, - [dir="rtl"] px-md-5 { - padding-left: 3rem !important; - padding-right: 3rem !important; - } - .rtl .mr-md-auto, - [dir="rtl"] .mr-md-auto { - margin-right: 0 !important; - margin-left: auto !important; - } - .rtl .ml-md-auto, - [dir="rtl"] .ml-md-auto { - margin-right: auto !important; - margin-left: 0 !important; - } - .rtl .mx-md-auto, - [dir="rtl"] .mx-md-auto { - margin-right: auto !important; - margin-left: auto !important; - } -} - -@media (min-width: 992px) { - .rtl .mr-lg-0, - [dir="rtl"] .mr-lg-0 { - margin-right: 0 !important; - margin-left: 0 !important; - } - .rtl .ml-lg-0, - [dir="rtl"] .ml-lg-0 { - margin-left: 0 !important; - margin-right: 0 !important; - } - .rtl mx-lg-0, - [dir="rtl"] mx-lg-0 { - margin-left: 0 !important; - margin-right: 0 !important; - } - .rtl .mr-lg-1, - [dir="rtl"] .mr-lg-1 { - margin-right: 0 !important; - margin-left: 0.25rem !important; - } - .rtl .ml-lg-1, - [dir="rtl"] .ml-lg-1 { - margin-left: 0 !important; - margin-right: 0.25rem !important; - } - .rtl mx-lg-1, - [dir="rtl"] mx-lg-1 { - margin-left: 0.25rem !important; - margin-right: 0.25rem !important; - } - .rtl .mr-lg-2, - [dir="rtl"] .mr-lg-2 { - margin-right: 0 !important; - margin-left: 0.5rem !important; - } - .rtl .ml-lg-2, - [dir="rtl"] .ml-lg-2 { - margin-left: 0 !important; - margin-right: 0.5rem !important; - } - .rtl mx-lg-2, - [dir="rtl"] mx-lg-2 { - margin-left: 0.5rem !important; - margin-right: 0.5rem !important; - } - .rtl .mr-lg-3, - [dir="rtl"] .mr-lg-3 { - margin-right: 0 !important; - margin-left: 1rem !important; - } - .rtl .ml-lg-3, - [dir="rtl"] .ml-lg-3 { - margin-left: 0 !important; - margin-right: 1rem !important; - } - .rtl mx-lg-3, - [dir="rtl"] mx-lg-3 { - margin-left: 1rem !important; - margin-right: 1rem !important; - } - .rtl .mr-lg-4, - [dir="rtl"] .mr-lg-4 { - margin-right: 0 !important; - margin-left: 1.5rem !important; - } - .rtl .ml-lg-4, - [dir="rtl"] .ml-lg-4 { - margin-left: 0 !important; - margin-right: 1.5rem !important; - } - .rtl mx-lg-4, - [dir="rtl"] mx-lg-4 { - margin-left: 1.5rem !important; - margin-right: 1.5rem !important; - } - .rtl .mr-lg-5, - [dir="rtl"] .mr-lg-5 { - margin-right: 0 !important; - margin-left: 3rem !important; - } - .rtl .ml-lg-5, - [dir="rtl"] .ml-lg-5 { - margin-left: 0 !important; - margin-right: 3rem !important; - } - .rtl mx-lg-5, - [dir="rtl"] mx-lg-5 { - margin-left: 3rem !important; - margin-right: 3rem !important; - } - .rtl .pr-lg-0, - [dir="rtl"] .pr-lg-0 { - padding-right: 0 !important; - padding-left: 0 !important; - } - .rtl .pl-lg-0, - [dir="rtl"] .pl-lg-0 { - padding-left: 0 !important; - padding-right: 0 !important; - } - .rtl px-lg-0, - [dir="rtl"] px-lg-0 { - padding-left: 0 !important; - padding-right: 0 !important; - } - .rtl .pr-lg-1, - [dir="rtl"] .pr-lg-1 { - padding-right: 0 !important; - padding-left: 0.25rem !important; - } - .rtl .pl-lg-1, - [dir="rtl"] .pl-lg-1 { - padding-left: 0 !important; - padding-right: 0.25rem !important; - } - .rtl px-lg-1, - [dir="rtl"] px-lg-1 { - padding-left: 0.25rem !important; - padding-right: 0.25rem !important; - } - .rtl .pr-lg-2, - [dir="rtl"] .pr-lg-2 { - padding-right: 0 !important; - padding-left: 0.5rem !important; - } - .rtl .pl-lg-2, - [dir="rtl"] .pl-lg-2 { - padding-left: 0 !important; - padding-right: 0.5rem !important; - } - .rtl px-lg-2, - [dir="rtl"] px-lg-2 { - padding-left: 0.5rem !important; - padding-right: 0.5rem !important; - } - .rtl .pr-lg-3, - [dir="rtl"] .pr-lg-3 { - padding-right: 0 !important; - padding-left: 1rem !important; - } - .rtl .pl-lg-3, - [dir="rtl"] .pl-lg-3 { - padding-left: 0 !important; - padding-right: 1rem !important; - } - .rtl px-lg-3, - [dir="rtl"] px-lg-3 { - padding-left: 1rem !important; - padding-right: 1rem !important; - } - .rtl .pr-lg-4, - [dir="rtl"] .pr-lg-4 { - padding-right: 0 !important; - padding-left: 1.5rem !important; - } - .rtl .pl-lg-4, - [dir="rtl"] .pl-lg-4 { - padding-left: 0 !important; - padding-right: 1.5rem !important; - } - .rtl px-lg-4, - [dir="rtl"] px-lg-4 { - padding-left: 1.5rem !important; - padding-right: 1.5rem !important; - } - .rtl .pr-lg-5, - [dir="rtl"] .pr-lg-5 { - padding-right: 0 !important; - padding-left: 3rem !important; - } - .rtl .pl-lg-5, - [dir="rtl"] .pl-lg-5 { - padding-left: 0 !important; - padding-right: 3rem !important; - } - .rtl px-lg-5, - [dir="rtl"] px-lg-5 { - padding-left: 3rem !important; - padding-right: 3rem !important; - } - .rtl .mr-lg-auto, - [dir="rtl"] .mr-lg-auto { - margin-right: 0 !important; - margin-left: auto !important; - } - .rtl .ml-lg-auto, - [dir="rtl"] .ml-lg-auto { - margin-right: auto !important; - margin-left: 0 !important; - } - .rtl .mx-lg-auto, - [dir="rtl"] .mx-lg-auto { - margin-right: auto !important; - margin-left: auto !important; - } -} - -@media (min-width: 1200px) { - .rtl .mr-xl-0, - [dir="rtl"] .mr-xl-0 { - margin-right: 0 !important; - margin-left: 0 !important; - } - .rtl .ml-xl-0, - [dir="rtl"] .ml-xl-0 { - margin-left: 0 !important; - margin-right: 0 !important; - } - .rtl mx-xl-0, - [dir="rtl"] mx-xl-0 { - margin-left: 0 !important; - margin-right: 0 !important; - } - .rtl .mr-xl-1, - [dir="rtl"] .mr-xl-1 { - margin-right: 0 !important; - margin-left: 0.25rem !important; - } - .rtl .ml-xl-1, - [dir="rtl"] .ml-xl-1 { - margin-left: 0 !important; - margin-right: 0.25rem !important; - } - .rtl mx-xl-1, - [dir="rtl"] mx-xl-1 { - margin-left: 0.25rem !important; - margin-right: 0.25rem !important; - } - .rtl .mr-xl-2, - [dir="rtl"] .mr-xl-2 { - margin-right: 0 !important; - margin-left: 0.5rem !important; - } - .rtl .ml-xl-2, - [dir="rtl"] .ml-xl-2 { - margin-left: 0 !important; - margin-right: 0.5rem !important; - } - .rtl mx-xl-2, - [dir="rtl"] mx-xl-2 { - margin-left: 0.5rem !important; - margin-right: 0.5rem !important; - } - .rtl .mr-xl-3, - [dir="rtl"] .mr-xl-3 { - margin-right: 0 !important; - margin-left: 1rem !important; - } - .rtl .ml-xl-3, - [dir="rtl"] .ml-xl-3 { - margin-left: 0 !important; - margin-right: 1rem !important; - } - .rtl mx-xl-3, - [dir="rtl"] mx-xl-3 { - margin-left: 1rem !important; - margin-right: 1rem !important; - } - .rtl .mr-xl-4, - [dir="rtl"] .mr-xl-4 { - margin-right: 0 !important; - margin-left: 1.5rem !important; - } - .rtl .ml-xl-4, - [dir="rtl"] .ml-xl-4 { - margin-left: 0 !important; - margin-right: 1.5rem !important; - } - .rtl mx-xl-4, - [dir="rtl"] mx-xl-4 { - margin-left: 1.5rem !important; - margin-right: 1.5rem !important; - } - .rtl .mr-xl-5, - [dir="rtl"] .mr-xl-5 { - margin-right: 0 !important; - margin-left: 3rem !important; - } - .rtl .ml-xl-5, - [dir="rtl"] .ml-xl-5 { - margin-left: 0 !important; - margin-right: 3rem !important; - } - .rtl mx-xl-5, - [dir="rtl"] mx-xl-5 { - margin-left: 3rem !important; - margin-right: 3rem !important; - } - .rtl .pr-xl-0, - [dir="rtl"] .pr-xl-0 { - padding-right: 0 !important; - padding-left: 0 !important; - } - .rtl .pl-xl-0, - [dir="rtl"] .pl-xl-0 { - padding-left: 0 !important; - padding-right: 0 !important; - } - .rtl px-xl-0, - [dir="rtl"] px-xl-0 { - padding-left: 0 !important; - padding-right: 0 !important; - } - .rtl .pr-xl-1, - [dir="rtl"] .pr-xl-1 { - padding-right: 0 !important; - padding-left: 0.25rem !important; - } - .rtl .pl-xl-1, - [dir="rtl"] .pl-xl-1 { - padding-left: 0 !important; - padding-right: 0.25rem !important; - } - .rtl px-xl-1, - [dir="rtl"] px-xl-1 { - padding-left: 0.25rem !important; - padding-right: 0.25rem !important; - } - .rtl .pr-xl-2, - [dir="rtl"] .pr-xl-2 { - padding-right: 0 !important; - padding-left: 0.5rem !important; - } - .rtl .pl-xl-2, - [dir="rtl"] .pl-xl-2 { - padding-left: 0 !important; - padding-right: 0.5rem !important; - } - .rtl px-xl-2, - [dir="rtl"] px-xl-2 { - padding-left: 0.5rem !important; - padding-right: 0.5rem !important; - } - .rtl .pr-xl-3, - [dir="rtl"] .pr-xl-3 { - padding-right: 0 !important; - padding-left: 1rem !important; - } - .rtl .pl-xl-3, - [dir="rtl"] .pl-xl-3 { - padding-left: 0 !important; - padding-right: 1rem !important; - } - .rtl px-xl-3, - [dir="rtl"] px-xl-3 { - padding-left: 1rem !important; - padding-right: 1rem !important; - } - .rtl .pr-xl-4, - [dir="rtl"] .pr-xl-4 { - padding-right: 0 !important; - padding-left: 1.5rem !important; - } - .rtl .pl-xl-4, - [dir="rtl"] .pl-xl-4 { - padding-left: 0 !important; - padding-right: 1.5rem !important; - } - .rtl px-xl-4, - [dir="rtl"] px-xl-4 { - padding-left: 1.5rem !important; - padding-right: 1.5rem !important; - } - .rtl .pr-xl-5, - [dir="rtl"] .pr-xl-5 { - padding-right: 0 !important; - padding-left: 3rem !important; - } - .rtl .pl-xl-5, - [dir="rtl"] .pl-xl-5 { - padding-left: 0 !important; - padding-right: 3rem !important; - } - .rtl px-xl-5, - [dir="rtl"] px-xl-5 { - padding-left: 3rem !important; - padding-right: 3rem !important; - } - .rtl .mr-xl-auto, - [dir="rtl"] .mr-xl-auto { - margin-right: 0 !important; - margin-left: auto !important; - } - .rtl .ml-xl-auto, - [dir="rtl"] .ml-xl-auto { - margin-right: auto !important; - margin-left: 0 !important; - } - .rtl .mx-xl-auto, - [dir="rtl"] .mx-xl-auto { - margin-right: auto !important; - margin-left: auto !important; - } -} - -.rtl .text-right, -[dir="rtl"] .text-right { - text-align: left !important; -} - -.rtl .text-left, -[dir="rtl"] .text-left { - text-align: right !important; -} - -@media (min-width: 576px) { - .rtl .text-sm-right, - [dir="rtl"] .text-sm-right { - text-align: left !important; - } - .rtl .text-sm-left, - [dir="rtl"] .text-sm-left { - text-align: right !important; - } -} - -@media (min-width: 768px) { - .rtl .text-md-right, - [dir="rtl"] .text-md-right { - text-align: left !important; - } - .rtl .text-md-left, - [dir="rtl"] .text-md-left { - text-align: right !important; - } -} - -@media (min-width: 992px) { - .rtl .text-lg-right, - [dir="rtl"] .text-lg-right { - text-align: left !important; - } - .rtl .text-lg-left, - [dir="rtl"] .text-lg-left { - text-align: right !important; - } -} - -@media (min-width: 1200px) { - .rtl .text-xl-right, - [dir="rtl"] .text-xl-right { - text-align: left !important; - } - .rtl .text-xl-left, - [dir="rtl"] .text-xl-left { - text-align: right !important; - } -} -/*# sourceMappingURL=bootstrap-rtl.css.map */ \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap/css/bootstrap-rtl.css.map b/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap/css/bootstrap-rtl.css.map deleted file mode 100644 index 69262df67..000000000 --- a/aspnet-core/services/LY.MicroService.AuthServer/wwwroot/libs/bootstrap/css/bootstrap-rtl.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../scss/bootstrap-rtl.scss","bootstrap-rtl.css","../../scss/_root.scss","../../scss/_reboot.scss","../../scss/_variables.scss","../../scss/vendor/_rfs.scss","../../scss/mixins/_hover.scss","../../scss/_type.scss","../../scss/mixins/_lists.scss","../../scss/_images.scss","../../scss/mixins/_image.scss","../../scss/mixins/_border-radius.scss","../../scss/_code.scss","../../scss/_grid.scss","../../scss/mixins/_grid.scss","../../scss/mixins/_breakpoints.scss","../../scss/mixins/_grid-framework.scss","../../scss/_tables.scss","../../scss/mixins/_table-row.scss","../../scss/_functions.scss","../../scss/_forms.scss","../../scss/mixins/_transition.scss","../../scss/mixins/_forms.scss","../../scss/mixins/_gradients.scss","../../scss/_buttons.scss","../../scss/mixins/_buttons.scss","../../scss/_transitions.scss","../../scss/_dropdown.scss","../../scss/mixins/_caret.scss","../../scss/mixins/_nav-divider.scss","../../scss/_button-group.scss","../../scss/_input-group.scss","../../scss/_custom-forms.scss","../../scss/_nav.scss","../../scss/_navbar.scss","../../scss/_card.scss","../../scss/_breadcrumb.scss","../../scss/_pagination.scss","../../scss/mixins/_pagination.scss","../../scss/_badge.scss","../../scss/mixins/_badge.scss","../../scss/_jumbotron.scss","../../scss/_alert.scss","../../scss/mixins/_alert.scss","../../scss/_progress.scss","../../scss/_media.scss","../../scss/_list-group.scss","../../scss/mixins/_list-group.scss","../../scss/_close.scss","../../scss/_toasts.scss","../../scss/_modal.scss","../../scss/_tooltip.scss","../../scss/mixins/_reset-text.scss","../../scss/_popover.scss","../../scss/_carousel.scss","../../scss/mixins/_clearfix.scss","../../scss/_spinners.scss","../../scss/utilities/_align.scss","../../scss/mixins/_background-variant.scss","../../scss/utilities/_background.scss","../../scss/utilities/_borders.scss","../../scss/utilities/_display.scss","../../scss/utilities/_embed.scss","../../scss/utilities/_flex.scss","../../scss/utilities/_float.scss","../../scss/utilities/_interactions.scss","../../scss/utilities/_overflow.scss","../../scss/utilities/_position.scss","../../scss/utilities/_screenreaders.scss","../../scss/mixins/_screen-reader.scss","../../scss/utilities/_shadows.scss","../../scss/utilities/_sizing.scss","../../scss/utilities/_spacing.scss","../../scss/utilities/_stretched-link.scss","../../scss/utilities/_text.scss","../../scss/mixins/_text-truncate.scss","../../scss/mixins/_text-emphasis.scss","../../scss/mixins/_text-hide.scss","../../scss/utilities/_visibility.scss","../../scss/_print.scss","../../scss/_rtl.scss"],"names":[],"mappings":"AAAA;;;;;ECKE;ACLF;EAGI,eAAc;EAAd,iBAAc;EAAd,iBAAc;EAAd,eAAc;EAAd,cAAc;EAAd,iBAAc;EAAd,iBAAc;EAAd,gBAAc;EAAd,eAAc;EAAd,eAAc;EAAd,aAAc;EAAd,eAAc;EAAd,oBAAc;EAId,kBAAc;EAAd,oBAAc;EAAd,kBAAc;EAAd,eAAc;EAAd,kBAAc;EAAd,iBAAc;EAAd,gBAAc;EAAd,eAAc;EAId,kBAAiC;EAAjC,sBAAiC;EAAjC,sBAAiC;EAAjC,sBAAiC;EAAjC,uBAAiC;EAKnC,kOAAyB;EACzB,6GAAwB;ADkB1B;;AEjBA;;;EAGE,sBAAsB;AFoBxB;;AEjBA;EACE,uBAAuB;EACvB,iBAAiB;EACjB,8BAA8B;EAC9B,6CCXa;AH+Bf;;AEdA;EACE,cAAc;AFiBhB;;AEPA;EACE,SAAS;EACT,qNCqOoO;ECrJhO,eAtCY;EFxChB,gBC8O+B;ED7O/B,gBCkP+B;EDjP/B,cCnCgB;EDoChB,gBAAgB;EAChB,sBC9Ca;AHwDf;;AAEA;EECE,qBAAqB;AFCvB;;AEQA;EACE,uBAAuB;EACvB,SAAS;EACT,iBAAiB;AFLnB;;AEkBA;EACE,aAAa;EACb,qBCgNuC;AH/NzC;;AEsBA;EACE,aAAa;EACb,mBCoF8B;AHvGhC;;AE8BA;;EAEE,0BAA0B;EAC1B,yCAAiC;EAAjC,iCAAiC;EACjC,YAAY;EACZ,gBAAgB;EAChB,sCAA8B;EAA9B,8BAA8B;AF3BhC;;AE8BA;EACE,mBAAmB;EACnB,kBAAkB;EAClB,oBAAoB;AF3BtB;;AE8BA;;;EAGE,aAAa;EACb,mBAAmB;AF3BrB;;AE8BA;;;;EAIE,gBAAgB;AF3BlB;;AE8BA;EACE,gBCiJ+B;AH5KjC;;AE8BA;EACE,oBAAoB;EACpB,cAAc;AF3BhB;;AE8BA;EACE,gBAAgB;AF3BlB;;AE8BA;;EAEE,mBCoIkC;AH/JpC;;AE8BA;EExFI,cAAW;AJ8Df;;AEmCA;;EAEE,kBAAkB;EEnGhB,cAAW;EFqGb,cAAc;EACd,wBAAwB;AFhC1B;;AEmCA;EAAM,cAAc;AF/BpB;;AEgCA;EAAM,UAAU;AF5BhB;;AEmCA;EACE,cCvJe;EDwJf,qBCX4C;EDY5C,6BAA6B;AFhC/B;;AKhJE;EHmLE,cCd8D;EDe9D,0BCd+C;AHjBnD;;AEwCA;EACE,cAAc;EACd,qBAAqB;AFrCvB;;AK1JE;EHkME,cAAc;EACd,qBAAqB;AFpCzB;;AE6CA;;;;EAIE,iGCyDgH;EC7M9G,cAAW;AJ2Gf;;AE6CA;EAEE,aAAa;EAEb,mBAAmB;EAEnB,cAAc;EAGd,6BAA6B;AF/C/B;;AEuDA;EAEE,gBAAgB;AFrDlB;;AE6DA;EACE,sBAAsB;EACtB,kBAAkB;AF1DpB;;AE6DA;EAGE,gBAAgB;EAChB,sBAAsB;AF5DxB;;AEoEA;EACE,yBAAyB;AFjE3B;;AEoEA;EACE,oBC6EkC;ED5ElC,uBC4EkC;ED3ElC,cCtQgB;EDuQhB,gBAAgB;EAChB,oBAAoB;AFjEtB;;AEwEA;EAEE,mBAAmB;EACnB,gCAAgC;AFtElC;;AE8EA;EAEE,qBAAqB;EACrB,qBC2J2C;AHvO7C;;AEkFA;EAEE,gBAAgB;AFhFlB;;AEwFA;EACE,UAAU;AFrFZ;;AEwFA;;;;;EAKE,SAAS;EACT,oBAAoB;EE5PlB,kBAAW;EF8Pb,oBAAoB;AFrFtB;;AEwFA;;EAEE,iBAAiB;AFrFnB;;AEwFA;;EAEE,oBAAoB;AFrFtB;;AAEA;EE0FE,eAAe;AFxFjB;;AE8FA;EACE,iBAAiB;AF3FnB;;AEkGA;;;;EAIE,0BAA0B;AF/F5B;;AEoGE;;;;EAKI,eAAe;AFlGrB;;AEwGA;;;;EAIE,UAAU;EACV,kBAAkB;AFrGpB;;AEwGA;;EAEE,sBAAsB;EACtB,UAAU;AFrGZ;;AEyGA;EACE,cAAc;EAEd,gBAAgB;AFvGlB;;AE0GA;EAME,YAAY;EAEZ,UAAU;EACV,SAAS;EACT,SAAS;AF7GX;;AEkHA;EACE,cAAc;EACd,WAAW;EACX,eAAe;EACf,UAAU;EACV,oBAAoB;EEnShB,iBAtCY;EF2UhB,oBAAoB;EACpB,cAAc;EACd,mBAAmB;AF/GrB;;AEkHA;EACE,wBAAwB;AF/G1B;;AAEA;;EEmHE,YAAY;AFhHd;;AAEA;EEsHE,oBAAoB;EACpB,wBAAwB;AFpH1B;;AAEA;EE0HE,wBAAwB;AFxH1B;;AEgIA;EACE,aAAa;EACb,0BAA0B;AF7H5B;;AEoIA;EACE,qBAAqB;AFjIvB;;AEoIA;EACE,kBAAkB;EAClB,eAAe;AFjIjB;;AEoIA;EACE,aAAa;AFjIf;;AAEA;EEqIE,wBAAwB;AFnI1B;;AMzVA;;EAEE,qBHqSuC;EGnSvC,gBHqS+B;EGpS/B,gBHqS+B;AHsDjC;;AMvVA;EFgHM,iBAtCY;AJiRlB;;AM1VA;EF+GM,eAtCY;AJqRlB;;AM7VA;EF8GM,kBAtCY;AJyRlB;;AMhWA;EF6GM,iBAtCY;AJ6RlB;;AMnWA;EF4GM,kBAtCY;AJiSlB;;AMtWA;EF2GM,eAtCY;AJqSlB;;AMxWA;EFyGM,kBAtCY;EEjEhB,gBHuS+B;AHoEjC;;AMvWA;EFmGM,eAtCY;EE3DhB,gBH0R+B;EGzR/B,gBHiR+B;AHyFjC;;AMxWA;EF8FM,iBAtCY;EEtDhB,gBHsR+B;EGrR/B,gBH4Q+B;AH+FjC;;AMzWA;EFyFM,iBAtCY;EEjDhB,gBHkR+B;EGjR/B,gBHuQ+B;AHqGjC;;AM1WA;EFoFM,iBAtCY;EE5ChB,gBH8Q+B;EG7Q/B,gBHkQ+B;AH2GjC;;AEhVA;EIpBE,gBHgFW;EG/EX,mBH+EW;EG9EX,SAAS;EACT,wCHzCa;AHiZf;;AMhWA;;EFMI,cAAW;EEHb,gBH0N+B;AHyIjC;;AMhWA;;EAEE,cHkQgC;EGjQhC,yBH0QmC;AHyFrC;;AM3VA;EC/EE,eAAe;EACf,gBAAgB;AP8alB;;AM3VA;ECpFE,eAAe;EACf,gBAAgB;APmblB;;AM7VA;EACE,qBAAqB;ANgWvB;;AMjWA;EAII,oBHoP+B;AH6GnC;;AMvVA;EFjCI,cAAW;EEmCb,yBAAyB;AN0V3B;;AMtVA;EACE,mBHuBW;ECRP,kBAtCY;AJiXlB;;AMtVA;EACE,cAAc;EF7CZ,cAAW;EE+Cb,cH1GgB;AHmclB;;AM5VA;EAMI,qBAAqB;AN0VzB;;AQ7cA;ECIE,eAAe;EAGf,YAAY;AT2cd;;AQ5cA;EACE,gBLmgCwC;EKlgCxC,sBLRa;EKSb,yBLNgB;EOQd,sBP6NgC;EMpOlC,eAAe;EAGf,YAAY;ATodd;;AQtcA;EAEE,qBAAqB;ARwcvB;;AQrcA;EACE,qBAA0B;EAC1B,cAAc;ARwchB;;AQrcA;EJkCI,cAAW;EIhCb,cL3BgB;AHmelB;;AW/eA;EPuEI,gBAAW;EOrEb,cRmCe;EQlCf,qBAAqB;AXkfvB;;AW/eE;EACE,cAAc;AXkflB;;AW7eA;EACE,sBRulCuC;EC7hCrC,gBAAW;EOxDb,WRTa;EQUb,yBRDgB;EOEd,qBP+N+B;AHiRnC;;AWrfA;EASI,UAAU;EPkDV,eAAW;EOhDX,gBRwQ6B;AHwOjC;;AExSA;ESjME,cAAc;EPyCZ,gBAAW;EOvCb,cRjBgB;AH8flB;;AWhfA;EP0CI,kBAAW;EOlCX,cAAc;EACd,kBAAkB;AX6etB;;AWxeA;EACE,iBR8jCuC;EQ7jCvC,kBAAkB;AX2epB;;AYnhBE;;;;;;ECDA,WAAW;EACX,mBAA0B;EAC1B,kBAAyB;EACzB,kBAAkB;EAClB,iBAAiB;Ab6hBnB;;Ac1eI;EFzCE;IACE,gBT+LG;EHwVT;AACF;;AchfI;EFzCE;IACE,gBTgMG;EH6VT;AACF;;ActfI;EFzCE;IACE,gBTiMG;EHkWT;AACF;;Ac5fI;EFzCE;IACE,iBTkMI;EHuWV;AACF;;AY9gBE;ECnCA,aAAa;EACb,eAAe;EACf,mBAA0B;EAC1B,kBAAyB;AbqjB3B;;AY/gBE;EACE,eAAe;EACf,cAAc;AZkhBlB;;AYphBE;;EAMI,gBAAgB;EAChB,eAAe;AZmhBrB;;AezkBE;;;;;;EACE,kBAAkB;EAClB,WAAW;EACX,mBAA0B;EAC1B,kBAAyB;AfilB7B;;Ae3jBM;EACE,aAAa;EACb,YAAY;EACZ,eAAe;Af8jBvB;;AezjBU;EFwBN,cAAuB;EACvB,eAAwB;AbqiB5B;;Ae9jBU;EFwBN,aAAuB;EACvB,cAAwB;Ab0iB5B;;AenkBU;EFwBN,oBAAuB;EACvB,qBAAwB;Ab+iB5B;;AexkBU;EFwBN,aAAuB;EACvB,cAAwB;AbojB5B;;Ae7kBU;EFwBN,aAAuB;EACvB,cAAwB;AbyjB5B;;AellBU;EFwBN,oBAAuB;EACvB,qBAAwB;Ab8jB5B;;AejlBM;EFCJ,cAAc;EACd,WAAW;EACX,eAAe;AbolBjB;;AejlBU;EFbR,mBAAsC;EAItC,oBAAuC;Ab+lBzC;;AetlBU;EFbR,oBAAsC;EAItC,qBAAuC;AbomBzC;;Ae3lBU;EFbR,aAAsC;EAItC,cAAuC;AbymBzC;;AehmBU;EFbR,oBAAsC;EAItC,qBAAuC;Ab8mBzC;;AermBU;EFbR,oBAAsC;EAItC,qBAAuC;AbmnBzC;;Ae1mBU;EFbR,aAAsC;EAItC,cAAuC;AbwnBzC;;Ae/mBU;EFbR,oBAAsC;EAItC,qBAAuC;Ab6nBzC;;AepnBU;EFbR,oBAAsC;EAItC,qBAAuC;AbkoBzC;;AeznBU;EFbR,aAAsC;EAItC,cAAuC;AbuoBzC;;Ae9nBU;EFbR,oBAAsC;EAItC,qBAAuC;Ab4oBzC;;AenoBU;EFbR,oBAAsC;EAItC,qBAAuC;AbipBzC;;AexoBU;EFbR,cAAsC;EAItC,eAAuC;AbspBzC;;AevoBM;EAAwB,SAAS;Af2oBvC;;AezoBM;EAAuB,SZmKG;AH0ehC;;Ae1oBQ;EAAwB,QADZ;Af+oBpB;;Ae9oBQ;EAAwB,QADZ;AfmpBpB;;AelpBQ;EAAwB,QADZ;AfupBpB;;AetpBQ;EAAwB,QADZ;Af2pBpB;;Ae1pBQ;EAAwB,QADZ;Af+pBpB;;Ae9pBQ;EAAwB,QADZ;AfmqBpB;;AelqBQ;EAAwB,QADZ;AfuqBpB;;AetqBQ;EAAwB,QADZ;Af2qBpB;;Ae1qBQ;EAAwB,QADZ;Af+qBpB;;Ae9qBQ;EAAwB,QADZ;AfmrBpB;;AelrBQ;EAAwB,SADZ;AfurBpB;;AetrBQ;EAAwB,SADZ;Af2rBpB;;Ae1rBQ;EAAwB,SADZ;Af+rBpB;;AevrBY;EFhBV,sBAA8C;Ab2sBhD;;Ae3rBY;EFhBV,uBAA8C;Ab+sBhD;;Ae/rBY;EFhBV,gBAA8C;AbmtBhD;;AensBY;EFhBV,uBAA8C;AbutBhD;;AevsBY;EFhBV,uBAA8C;Ab2tBhD;;Ae3sBY;EFhBV,gBAA8C;Ab+tBhD;;Ae/sBY;EFhBV,uBAA8C;AbmuBhD;;AentBY;EFhBV,uBAA8C;AbuuBhD;;AevtBY;EFhBV,gBAA8C;Ab2uBhD;;Ae3tBY;EFhBV,uBAA8C;Ab+uBhD;;Ae/tBY;EFhBV,uBAA8C;AbmvBhD;;Ac9uBI;EC3BE;IACE,aAAa;IACb,YAAY;IACZ,eAAe;Ef6wBrB;EexwBQ;IFwBN,cAAuB;IACvB,eAAwB;EbmvB1B;Ee5wBQ;IFwBN,aAAuB;IACvB,cAAwB;EbuvB1B;EehxBQ;IFwBN,oBAAuB;IACvB,qBAAwB;Eb2vB1B;EepxBQ;IFwBN,aAAuB;IACvB,cAAwB;Eb+vB1B;EexxBQ;IFwBN,aAAuB;IACvB,cAAwB;EbmwB1B;Ee5xBQ;IFwBN,oBAAuB;IACvB,qBAAwB;EbuwB1B;Ee1xBI;IFCJ,cAAc;IACd,WAAW;IACX,eAAe;Eb4xBf;EezxBQ;IFbR,mBAAsC;IAItC,oBAAuC;EbsyBvC;Ee7xBQ;IFbR,oBAAsC;IAItC,qBAAuC;Eb0yBvC;EejyBQ;IFbR,aAAsC;IAItC,cAAuC;Eb8yBvC;EeryBQ;IFbR,oBAAsC;IAItC,qBAAuC;EbkzBvC;EezyBQ;IFbR,oBAAsC;IAItC,qBAAuC;EbszBvC;Ee7yBQ;IFbR,aAAsC;IAItC,cAAuC;Eb0zBvC;EejzBQ;IFbR,oBAAsC;IAItC,qBAAuC;Eb8zBvC;EerzBQ;IFbR,oBAAsC;IAItC,qBAAuC;Ebk0BvC;EezzBQ;IFbR,aAAsC;IAItC,cAAuC;Ebs0BvC;Ee7zBQ;IFbR,oBAAsC;IAItC,qBAAuC;Eb00BvC;Eej0BQ;IFbR,oBAAsC;IAItC,qBAAuC;Eb80BvC;Eer0BQ;IFbR,cAAsC;IAItC,eAAuC;Ebk1BvC;Een0BI;IAAwB,SAAS;Efs0BrC;Eep0BI;IAAuB,SZmKG;EHoqB9B;Eep0BM;IAAwB,QADZ;Efw0BlB;Eev0BM;IAAwB,QADZ;Ef20BlB;Ee10BM;IAAwB,QADZ;Ef80BlB;Ee70BM;IAAwB,QADZ;Efi1BlB;Eeh1BM;IAAwB,QADZ;Efo1BlB;Een1BM;IAAwB,QADZ;Efu1BlB;Eet1BM;IAAwB,QADZ;Ef01BlB;Eez1BM;IAAwB,QADZ;Ef61BlB;Ee51BM;IAAwB,QADZ;Efg2BlB;Ee/1BM;IAAwB,QADZ;Efm2BlB;Eel2BM;IAAwB,SADZ;Efs2BlB;Eer2BM;IAAwB,SADZ;Efy2BlB;Eex2BM;IAAwB,SADZ;Ef42BlB;Eep2BU;IFhBV,cAA4B;Ebu3B5B;Eev2BU;IFhBV,sBAA8C;Eb03B9C;Ee12BU;IFhBV,uBAA8C;Eb63B9C;Ee72BU;IFhBV,gBAA8C;Ebg4B9C;Eeh3BU;IFhBV,uBAA8C;Ebm4B9C;Een3BU;IFhBV,uBAA8C;Ebs4B9C;Eet3BU;IFhBV,gBAA8C;Eby4B9C;Eez3BU;IFhBV,uBAA8C;Eb44B9C;Ee53BU;IFhBV,uBAA8C;Eb+4B9C;Ee/3BU;IFhBV,gBAA8C;Ebk5B9C;Eel4BU;IFhBV,uBAA8C;Ebq5B9C;Eer4BU;IFhBV,uBAA8C;Ebw5B9C;AACF;;Acp5BI;EC3BE;IACE,aAAa;IACb,YAAY;IACZ,eAAe;Efm7BrB;Ee96BQ;IFwBN,cAAuB;IACvB,eAAwB;Eby5B1B;Eel7BQ;IFwBN,aAAuB;IACvB,cAAwB;Eb65B1B;Eet7BQ;IFwBN,oBAAuB;IACvB,qBAAwB;Ebi6B1B;Ee17BQ;IFwBN,aAAuB;IACvB,cAAwB;Ebq6B1B;Ee97BQ;IFwBN,aAAuB;IACvB,cAAwB;Eby6B1B;Eel8BQ;IFwBN,oBAAuB;IACvB,qBAAwB;Eb66B1B;Eeh8BI;IFCJ,cAAc;IACd,WAAW;IACX,eAAe;Ebk8Bf;Ee/7BQ;IFbR,mBAAsC;IAItC,oBAAuC;Eb48BvC;Een8BQ;IFbR,oBAAsC;IAItC,qBAAuC;Ebg9BvC;Eev8BQ;IFbR,aAAsC;IAItC,cAAuC;Ebo9BvC;Ee38BQ;IFbR,oBAAsC;IAItC,qBAAuC;Ebw9BvC;Ee/8BQ;IFbR,oBAAsC;IAItC,qBAAuC;Eb49BvC;Een9BQ;IFbR,aAAsC;IAItC,cAAuC;Ebg+BvC;Eev9BQ;IFbR,oBAAsC;IAItC,qBAAuC;Ebo+BvC;Ee39BQ;IFbR,oBAAsC;IAItC,qBAAuC;Ebw+BvC;Ee/9BQ;IFbR,aAAsC;IAItC,cAAuC;Eb4+BvC;Een+BQ;IFbR,oBAAsC;IAItC,qBAAuC;Ebg/BvC;Eev+BQ;IFbR,oBAAsC;IAItC,qBAAuC;Ebo/BvC;Ee3+BQ;IFbR,cAAsC;IAItC,eAAuC;Ebw/BvC;Eez+BI;IAAwB,SAAS;Ef4+BrC;Ee1+BI;IAAuB,SZmKG;EH00B9B;Ee1+BM;IAAwB,QADZ;Ef8+BlB;Ee7+BM;IAAwB,QADZ;Efi/BlB;Eeh/BM;IAAwB,QADZ;Efo/BlB;Een/BM;IAAwB,QADZ;Efu/BlB;Eet/BM;IAAwB,QADZ;Ef0/BlB;Eez/BM;IAAwB,QADZ;Ef6/BlB;Ee5/BM;IAAwB,QADZ;EfggClB;Ee//BM;IAAwB,QADZ;EfmgClB;EelgCM;IAAwB,QADZ;EfsgClB;EergCM;IAAwB,QADZ;EfygClB;EexgCM;IAAwB,SADZ;Ef4gClB;Ee3gCM;IAAwB,SADZ;Ef+gClB;Ee9gCM;IAAwB,SADZ;EfkhClB;Ee1gCU;IFhBV,cAA4B;Eb6hC5B;Ee7gCU;IFhBV,sBAA8C;EbgiC9C;EehhCU;IFhBV,uBAA8C;EbmiC9C;EenhCU;IFhBV,gBAA8C;EbsiC9C;EethCU;IFhBV,uBAA8C;EbyiC9C;EezhCU;IFhBV,uBAA8C;Eb4iC9C;Ee5hCU;IFhBV,gBAA8C;Eb+iC9C;Ee/hCU;IFhBV,uBAA8C;EbkjC9C;EeliCU;IFhBV,uBAA8C;EbqjC9C;EeriCU;IFhBV,gBAA8C;EbwjC9C;EexiCU;IFhBV,uBAA8C;Eb2jC9C;Ee3iCU;IFhBV,uBAA8C;Eb8jC9C;AACF;;Ac1jCI;EC3BE;IACE,aAAa;IACb,YAAY;IACZ,eAAe;EfylCrB;EeplCQ;IFwBN,cAAuB;IACvB,eAAwB;Eb+jC1B;EexlCQ;IFwBN,aAAuB;IACvB,cAAwB;EbmkC1B;Ee5lCQ;IFwBN,oBAAuB;IACvB,qBAAwB;EbukC1B;EehmCQ;IFwBN,aAAuB;IACvB,cAAwB;Eb2kC1B;EepmCQ;IFwBN,aAAuB;IACvB,cAAwB;Eb+kC1B;EexmCQ;IFwBN,oBAAuB;IACvB,qBAAwB;EbmlC1B;EetmCI;IFCJ,cAAc;IACd,WAAW;IACX,eAAe;EbwmCf;EermCQ;IFbR,mBAAsC;IAItC,oBAAuC;EbknCvC;EezmCQ;IFbR,oBAAsC;IAItC,qBAAuC;EbsnCvC;Ee7mCQ;IFbR,aAAsC;IAItC,cAAuC;Eb0nCvC;EejnCQ;IFbR,oBAAsC;IAItC,qBAAuC;Eb8nCvC;EernCQ;IFbR,oBAAsC;IAItC,qBAAuC;EbkoCvC;EeznCQ;IFbR,aAAsC;IAItC,cAAuC;EbsoCvC;Ee7nCQ;IFbR,oBAAsC;IAItC,qBAAuC;Eb0oCvC;EejoCQ;IFbR,oBAAsC;IAItC,qBAAuC;Eb8oCvC;EeroCQ;IFbR,aAAsC;IAItC,cAAuC;EbkpCvC;EezoCQ;IFbR,oBAAsC;IAItC,qBAAuC;EbspCvC;Ee7oCQ;IFbR,oBAAsC;IAItC,qBAAuC;Eb0pCvC;EejpCQ;IFbR,cAAsC;IAItC,eAAuC;Eb8pCvC;Ee/oCI;IAAwB,SAAS;EfkpCrC;EehpCI;IAAuB,SZmKG;EHg/B9B;EehpCM;IAAwB,QADZ;EfopClB;EenpCM;IAAwB,QADZ;EfupClB;EetpCM;IAAwB,QADZ;Ef0pClB;EezpCM;IAAwB,QADZ;Ef6pClB;Ee5pCM;IAAwB,QADZ;EfgqClB;Ee/pCM;IAAwB,QADZ;EfmqClB;EelqCM;IAAwB,QADZ;EfsqClB;EerqCM;IAAwB,QADZ;EfyqClB;EexqCM;IAAwB,QADZ;Ef4qClB;Ee3qCM;IAAwB,QADZ;Ef+qClB;Ee9qCM;IAAwB,SADZ;EfkrClB;EejrCM;IAAwB,SADZ;EfqrClB;EeprCM;IAAwB,SADZ;EfwrClB;EehrCU;IFhBV,cAA4B;EbmsC5B;EenrCU;IFhBV,sBAA8C;EbssC9C;EetrCU;IFhBV,uBAA8C;EbysC9C;EezrCU;IFhBV,gBAA8C;Eb4sC9C;Ee5rCU;IFhBV,uBAA8C;Eb+sC9C;Ee/rCU;IFhBV,uBAA8C;EbktC9C;EelsCU;IFhBV,gBAA8C;EbqtC9C;EersCU;IFhBV,uBAA8C;EbwtC9C;EexsCU;IFhBV,uBAA8C;Eb2tC9C;Ee3sCU;IFhBV,gBAA8C;Eb8tC9C;Ee9sCU;IFhBV,uBAA8C;EbiuC9C;EejtCU;IFhBV,uBAA8C;EbouC9C;AACF;;AchuCI;EC3BE;IACE,aAAa;IACb,YAAY;IACZ,eAAe;Ef+vCrB;Ee1vCQ;IFwBN,cAAuB;IACvB,eAAwB;EbquC1B;Ee9vCQ;IFwBN,aAAuB;IACvB,cAAwB;EbyuC1B;EelwCQ;IFwBN,oBAAuB;IACvB,qBAAwB;Eb6uC1B;EetwCQ;IFwBN,aAAuB;IACvB,cAAwB;EbivC1B;Ee1wCQ;IFwBN,aAAuB;IACvB,cAAwB;EbqvC1B;Ee9wCQ;IFwBN,oBAAuB;IACvB,qBAAwB;EbyvC1B;Ee5wCI;IFCJ,cAAc;IACd,WAAW;IACX,eAAe;Eb8wCf;Ee3wCQ;IFbR,mBAAsC;IAItC,oBAAuC;EbwxCvC;Ee/wCQ;IFbR,oBAAsC;IAItC,qBAAuC;Eb4xCvC;EenxCQ;IFbR,aAAsC;IAItC,cAAuC;EbgyCvC;EevxCQ;IFbR,oBAAsC;IAItC,qBAAuC;EboyCvC;Ee3xCQ;IFbR,oBAAsC;IAItC,qBAAuC;EbwyCvC;Ee/xCQ;IFbR,aAAsC;IAItC,cAAuC;Eb4yCvC;EenyCQ;IFbR,oBAAsC;IAItC,qBAAuC;EbgzCvC;EevyCQ;IFbR,oBAAsC;IAItC,qBAAuC;EbozCvC;Ee3yCQ;IFbR,aAAsC;IAItC,cAAuC;EbwzCvC;Ee/yCQ;IFbR,oBAAsC;IAItC,qBAAuC;Eb4zCvC;EenzCQ;IFbR,oBAAsC;IAItC,qBAAuC;Ebg0CvC;EevzCQ;IFbR,cAAsC;IAItC,eAAuC;Ebo0CvC;EerzCI;IAAwB,SAAS;EfwzCrC;EetzCI;IAAuB,SZmKG;EHspC9B;EetzCM;IAAwB,QADZ;Ef0zClB;EezzCM;IAAwB,QADZ;Ef6zClB;Ee5zCM;IAAwB,QADZ;Efg0ClB;Ee/zCM;IAAwB,QADZ;Efm0ClB;Eel0CM;IAAwB,QADZ;Efs0ClB;Eer0CM;IAAwB,QADZ;Efy0ClB;Eex0CM;IAAwB,QADZ;Ef40ClB;Ee30CM;IAAwB,QADZ;Ef+0ClB;Ee90CM;IAAwB,QADZ;Efk1ClB;Eej1CM;IAAwB,QADZ;Efq1ClB;Eep1CM;IAAwB,SADZ;Efw1ClB;Eev1CM;IAAwB,SADZ;Ef21ClB;Ee11CM;IAAwB,SADZ;Ef81ClB;Eet1CU;IFhBV,cAA4B;Eby2C5B;Eez1CU;IFhBV,sBAA8C;Eb42C9C;Ee51CU;IFhBV,uBAA8C;Eb+2C9C;Ee/1CU;IFhBV,gBAA8C;Ebk3C9C;Eel2CU;IFhBV,uBAA8C;Ebq3C9C;Eer2CU;IFhBV,uBAA8C;Ebw3C9C;Eex2CU;IFhBV,gBAA8C;Eb23C9C;Ee32CU;IFhBV,uBAA8C;Eb83C9C;Ee92CU;IFhBV,uBAA8C;Ebi4C9C;Eej3CU;IFhBV,gBAA8C;Ebo4C9C;Eep3CU;IFhBV,uBAA8C;Ebu4C9C;Eev3CU;IFhBV,uBAA8C;Eb04C9C;AACF;;AgB97CA;EACE,WAAW;EACX,mBbiIW;EahIX,cbSgB;AHw7ClB;;AgBp8CA;;EAQI,gBbkVgC;EajVhC,mBAAmB;EACnB,6BbJc;AHq8ClB;;AgB38CA;EAcI,sBAAsB;EACtB,gCbTc;AH08ClB;;AgBh9CA;EAmBI,6Bbbc;AH88ClB;;AgBx7CA;;EAGI,eb4T+B;AH8nCnC;;AgBj7CA;EACE,yBbnCgB;AHu9ClB;;AgBr7CA;;EAKI,yBbvCc;AH49ClB;;AgB17CA;;EAWM,wBAA4C;AhBo7ClD;;AgB/6CA;;;;EAKI,SAAS;AhBi7Cb;;AgBz6CA;EAEI,qCb1DW;AHq+Cf;;AK1+CE;EW2EI,cbvEY;EawEZ,sCbvES;AH0+Cf;;AiBt/CE;;;EAII,yBCgG4D;AlBw5ClE;;AiB5/CE;;;;EAYM,qBCwF0D;AlB+5ClE;;AK5/CE;EYiBM,yBAJsC;AjBm/C9C;;AiBp/CE;;EASQ,yBARoC;AjBw/C9C;;AiB5gDE;;;EAII,yBCgG4D;AlB86ClE;;AiBlhDE;;;;EAYM,qBCwF0D;AlBq7ClE;;AKlhDE;EYiBM,yBAJsC;AjBygD9C;;AiB1gDE;;EASQ,yBARoC;AjB8gD9C;;AiBliDE;;;EAII,yBCgG4D;AlBo8ClE;;AiBxiDE;;;;EAYM,qBCwF0D;AlB28ClE;;AKxiDE;EYiBM,yBAJsC;AjB+hD9C;;AiBhiDE;;EASQ,yBARoC;AjBoiD9C;;AiBxjDE;;;EAII,yBCgG4D;AlB09ClE;;AiB9jDE;;;;EAYM,qBCwF0D;AlBi+ClE;;AK9jDE;EYiBM,yBAJsC;AjBqjD9C;;AiBtjDE;;EASQ,yBARoC;AjB0jD9C;;AiB9kDE;;;EAII,yBCgG4D;AlBg/ClE;;AiBplDE;;;;EAYM,qBCwF0D;AlBu/ClE;;AKplDE;EYiBM,yBAJsC;AjB2kD9C;;AiB5kDE;;EASQ,yBARoC;AjBglD9C;;AiBpmDE;;;EAII,yBCgG4D;AlBsgDlE;;AiB1mDE;;;;EAYM,qBCwF0D;AlB6gDlE;;AK1mDE;EYiBM,yBAJsC;AjBimD9C;;AiBlmDE;;EASQ,yBARoC;AjBsmD9C;;AiB1nDE;;;EAII,yBCgG4D;AlB4hDlE;;AiBhoDE;;;;EAYM,qBCwF0D;AlBmiDlE;;AKhoDE;EYiBM,yBAJsC;AjBunD9C;;AiBxnDE;;EASQ,yBARoC;AjB4nD9C;;AiBhpDE;;;EAII,yBCgG4D;AlBkjDlE;;AiBtpDE;;;;EAYM,qBCwF0D;AlByjDlE;;AKtpDE;EYiBM,yBAJsC;AjB6oD9C;;AiB9oDE;;EASQ,yBARoC;AjBkpD9C;;AiBtqDE;;;EAII,sCdQS;AHgqDf;;AKrqDE;EYiBM,sCAJsC;AjB4pD9C;;AiB7pDE;;EASQ,sCARoC;AjBiqD9C;;AgB3kDA;EAGM,Wb3GS;Ea4GT,yBbpGY;EaqGZ,qBbgQqD;AH40C3D;;AgBjlDA;EAWM,cb5GY;Ea6GZ,yBblHY;EamHZ,qBblHY;AH4rDlB;;AgBrkDA;EACE,Wb3Ha;Ea4Hb,yBbpHgB;AH4rDlB;;AgB1kDA;;;EAOI,qBb4OuD;AH61C3D;;AgBhlDA;EAWI,SAAS;AhBykDb;;AgBplDA;EAgBM,2Cb1IS;AHktDf;;AK7sDE;EW4IM,WbjJO;EakJP,4CblJO;AHutDf;;AcrpDI;EEiGA;IAEI,cAAc;IACd,WAAW;IACX,gBAAgB;IAChB,iCAAiC;EhBujDvC;EgB5jDG;IASK,SAAS;EhBsjDjB;AACF;;AcjqDI;EEiGA;IAEI,cAAc;IACd,WAAW;IACX,gBAAgB;IAChB,iCAAiC;EhBmkDvC;EgBxkDG;IASK,SAAS;EhBkkDjB;AACF;;Ac7qDI;EEiGA;IAEI,cAAc;IACd,WAAW;IACX,gBAAgB;IAChB,iCAAiC;EhB+kDvC;EgBplDG;IASK,SAAS;EhB8kDjB;AACF;;AczrDI;EEiGA;IAEI,cAAc;IACd,WAAW;IACX,gBAAgB;IAChB,iCAAiC;EhB2lDvC;EgBhmDG;IASK,SAAS;EhB0lDjB;AACF;;AgBzmDA;EAOQ,cAAc;EACd,WAAW;EACX,gBAAgB;EAChB,iCAAiC;AhBsmDzC;;AgBhnDA;EAcU,SAAS;AhBsmDnB;;AmBnxDA;EACE,cAAc;EACd,WAAW;EACX,mCDiH8D;EChH9D,yBhByXkC;ECpQ9B,eAtCY;Ee5EhB,gBhBkR+B;EgBjR/B,gBhBsR+B;EgBrR/B,chBDgB;EgBEhB,sBhBTa;EgBUb,4BAA4B;EAC5B,yBhBPgB;EOOd,sBP6NgC;EiB/N9B,wEjBue4F;AHkzClG;;AoBrxDM;EDdN;ICeQ,gBAAgB;EpByxDtB;AACF;;AmBzyDA;EAsBI,6BAA6B;EAC7B,SAAS;AnBuxDb;;AmB9yDA;EA4BI,kBAAkB;EAClB,0BhBrBc;AH2yDlB;;AqB5yDE;EACE,clBAc;EkBCd,sBlBRW;EkBSX,qBlBqdsE;EkBpdtE,UAAU;EAKR,gDlBaW;AH8xDjB;;AmB3zDA;EAqCI,chB9Bc;EgBgCd,UAAU;AnByxDd;;AmBh0DA;EAqCI,chB9Bc;EgBgCd,UAAU;AnByxDd;;AmBh0DA;EAqCI,chB9Bc;EgBgCd,UAAU;AnByxDd;;AmBh0DA;EAiDI,yBhB9Cc;EgBgDd,UAAU;AnBkxDd;;AmB9wDA;;;;EAKI,wBAAgB;EAAhB,qBAAgB;EAAhB,gBAAgB;AnBgxDpB;;AmB5wDA;EAOI,chB/Dc;EgBgEd,sBhBvEW;AHg1Df;;AmBpwDA;;EAEE,cAAc;EACd,WAAW;AnBuwDb;;AmB7vDA;EACE,iCDyB8D;ECxB9D,oCDwB8D;ECvB9D,gBAAgB;Ef3Bd,kBAAW;Ee6Bb,gBhB+L+B;AHikDjC;;AmB7vDA;EACE,+BDiB8D;EChB9D,kCDgB8D;EdK1D,kBAtCY;EemBhB,gBhB6H+B;AHmoDjC;;AmB7vDA;EACE,gCDU8D;ECT9D,mCDS8D;EdK1D,mBAtCY;Ee0BhB,gBhBuH+B;AHyoDjC;;AmBvvDA;EACE,cAAc;EACd,WAAW;EACX,mBAA2B;EAC3B,gBAAgB;EfDZ,eAtCY;EeyChB,gBhBkK+B;EgBjK/B,chBnHgB;EgBoHhB,6BAA6B;EAC7B,yBAAyB;EACzB,mBAAmC;AnB0vDrC;;AmBpwDA;EAcI,gBAAgB;EAChB,eAAe;AnB0vDnB;;AmB9uDA;EACE,kCD9B8D;EC+B9D,uBhBoPiC;EC9Q7B,mBAtCY;EekEhB,gBhB+E+B;EOxN7B,qBP+N+B;AH4pDnC;;AmB9uDA;EACE,gCDtC8D;ECuC9D,oBhBiPgC;ECnR5B,kBAtCY;Ee0EhB,gBhBsE+B;EOvN7B,qBP8N+B;AHqqDnC;;AmB7uDA;EAGI,YAAY;AnB8uDhB;;AmB1uDA;EACE,YAAY;AnB6uDd;;AmBruDA;EACE,mBhB0U0C;AH85C5C;;AmBruDA;EACE,cAAc;EACd,mBhB2T4C;AH66C9C;;AmBhuDA;EACE,aAAa;EACb,eAAe;EACf,kBAA0C;EAC1C,iBAAyC;AnBmuD3C;;AmBvuDA;;EAQI,kBAA0C;EAC1C,iBAAyC;AnBouD7C;;AmB3tDA;EACE,kBAAkB;EAClB,cAAc;EACd,qBhBgS6C;AH87C/C;;AmB3tDA;EACE,kBAAkB;EAClB,kBhB4R2C;EgB3R3C,qBhB0R6C;AHo8C/C;;AmBjuDA;;EAQI,chBzNc;AHu7DlB;;AmB1tDA;EACE,gBAAgB;AnB6tDlB;;AmB1tDA;EACE,oBAAoB;EACpB,mBAAmB;EACnB,eAAe;EACf,qBhB6Q4C;AHg9C9C;;AmBjuDA;EAQI,gBAAgB;EAChB,aAAa;EACb,uBhBwQ4C;EgBvQ5C,cAAc;AnB6tDlB;;AqB16DE;EACE,aAAa;EACb,WAAW;EACX,mBlB0c0C;ECjb1C,cAAW;EiBvBX,clBPa;AHo7DjB;;AqB16DE;EACE,kBAAkB;EAClB,SAAS;EACT,OAAO;EACP,UAAU;EACV,aAAa;EACb,eAAe;EACf,uBlBoyBqC;EkBnyBrC,iBAAiB;EjBmEf,mBAtCY;EiB3Bd,gBlBsO6B;EkBrO7B,WlBxDW;EkByDX,wClBtBa;EOxBb,sBP6NgC;AH+vDpC;;AqBz6DI;;EAEE,SAAiC;ArB46DvC;;AqBn9DI;;;;EA8CE,cAAc;ArB46DpB;;AqB19DI;EAoDE,qBlB1CW;EkB6CT,oCHmCwD;EGlCxD,iRH3B0E;EG4B1E,4BAA4B;EAC5B,2DAA6D;EAC7D,gEH+BwD;AlBy4DhE;;AqBn+DI;EA+DI,qBlBrDS;EkBsDT,gDlBtDS;AH89DjB;;AqBx+DI;EAyEI,oCHiBwD;EGhBxD,kFHgBwD;AlBm5DhE;;AqB7+DI;EAiFE,qBlBvEW;EkB0ET,uCHMwD;EGLxD,ujBAA8J;ArB85DtK;;AqBn/DI;EAyFI,qBlB/ES;EkBgFT,gDlBhFS;AH8+DjB;;AqBx/DI;EAkGI,clBxFS;AHk/DjB;;AqB5/DI;;;EAuGI,cAAc;ArB25DtB;;AqBlgEI;EA+GI,clBrGS;AH4/DjB;;AqBtgEI;EAkHM,qBlBxGO;AHggEjB;;AqB1gEI;EAwHM,qBAAkC;EClJxC,yBDmJ+C;ArBs5DnD;;AqB/gEI;EA+HM,gDlBrHO;AHygEjB;;AqBnhEI;EAmIM,qBlBzHO;AH6gEjB;;AqBvhEI;EA6II,qBlBnIS;AHihEjB;;AqB3hEI;EAkJM,qBlBxIO;EkByIP,gDlBzIO;AHshEjB;;AqBphEE;EACE,aAAa;EACb,WAAW;EACX,mBlB0c0C;ECjb1C,cAAW;EiBvBX,clBVa;AHiiEjB;;AqBphEE;EACE,kBAAkB;EAClB,SAAS;EACT,OAAO;EACP,UAAU;EACV,aAAa;EACb,eAAe;EACf,uBlBoyBqC;EkBnyBrC,iBAAiB;EjBmEf,mBAtCY;EiB3Bd,gBlBsO6B;EkBrO7B,WlBxDW;EkByDX,wClBzBa;EOrBb,sBP6NgC;AHy2DpC;;AqBnhEI;;EAEE,SAAiC;ArBshEvC;;AqB7jEI;;;;EA8CE,cAAc;ArBshEpB;;AqBpkEI;EAoDE,qBlB7CW;EkBgDT,oCHmCwD;EGlCxD,4UH3B0E;EG4B1E,4BAA4B;EAC5B,2DAA6D;EAC7D,gEH+BwD;AlBm/DhE;;AqB7kEI;EA+DI,qBlBxDS;EkByDT,gDlBzDS;AH2kEjB;;AqBllEI;EAyEI,oCHiBwD;EGhBxD,kFHgBwD;AlB6/DhE;;AqBvlEI;EAiFE,qBlB1EW;EkB6ET,uCHMwD;EGLxD,knBAA8J;ArBwgEtK;;AqB7lEI;EAyFI,qBlBlFS;EkBmFT,gDlBnFS;AH2lEjB;;AqBlmEI;EAkGI,clB3FS;AH+lEjB;;AqBtmEI;;;EAuGI,cAAc;ArBqgEtB;;AqB5mEI;EA+GI,clBxGS;AHymEjB;;AqBhnEI;EAkHM,qBlB3GO;AH6mEjB;;AqBpnEI;EAwHM,qBAAkC;EClJxC,yBDmJ+C;ArBggEnD;;AqBznEI;EA+HM,gDlBxHO;AHsnEjB;;AqB7nEI;EAmIM,qBlB5HO;AH0nEjB;;AqBjoEI;EA6II,qBlBtIS;AH8nEjB;;AqBroEI;EAkJM,qBlB3IO;EkB4IP,gDlB5IO;AHmoEjB;;AmBx5DA;EACE,aAAa;EACb,mBAAmB;EACnB,mBAAmB;AnB25DrB;;AmB95DA;EASI,WAAW;AnBy5Df;;AcxnEI;EKsNJ;IAeM,aAAa;IACb,mBAAmB;IACnB,uBAAuB;IACvB,gBAAgB;EnBw5DpB;EmB16DF;IAuBM,aAAa;IACb,cAAc;IACd,mBAAmB;IACnB,mBAAmB;IACnB,gBAAgB;EnBs5DpB;EmBj7DF;IAgCM,qBAAqB;IACrB,WAAW;IACX,sBAAsB;EnBo5D1B;EmBt7DF;IAuCM,qBAAqB;EnBk5DzB;EmBz7DF;;IA4CM,WAAW;EnBi5Df;EmB77DF;IAkDM,aAAa;IACb,mBAAmB;IACnB,uBAAuB;IACvB,WAAW;IACX,eAAe;EnB84DnB;EmBp8DF;IAyDM,kBAAkB;IAClB,cAAc;IACd,aAAa;IACb,qBhB+KwC;IgB9KxC,cAAc;EnB84DlB;EmB38DF;IAiEM,mBAAmB;IACnB,uBAAuB;EnB64D3B;EmB/8DF;IAqEM,gBAAgB;EnB64DpB;AACF;;AuB/tEA;EACE,qBAAqB;EAErB,gBpBsR+B;EoBrR/B,cpBMgB;EoBLhB,kBAAkB;EAGlB,sBAAsB;EACtB,yBAAiB;EAAjB,sBAAiB;EAAjB,qBAAiB;EAAjB,iBAAiB;EACjB,6BAA6B;EAC7B,6BAA2C;ECuF3C,yBrB2RkC;ECpQ9B,eAtCY;EoBiBhB,gBrB0L+B;EOlR7B,sBP6NgC;EiB/N9B,qIjBgb6I;AHqzDnJ;;AoBjuEM;EGdN;IHeQ,gBAAgB;EpBquEtB;AACF;;AK/uEE;EkBUE,cpBNc;EoBOd,qBAAqB;AvByuEzB;;AuB1vEA;EAsBI,UAAU;EACV,gDpBMa;AHkuEjB;;AuB/vEA;EA6BI,apBiZ6B;AHq1DjC;;AuBnwEA;EAkCI,eAAsD;AvBquE1D;;AuBvtEA;;EAEE,oBAAoB;AvB0tEtB;;AuBjtEE;EC3DA,WrBCa;EmBDX,yBnB6Ba;EqB3Bf,qBrB2Be;AHqvEjB;;AK5wEE;EmBAE,WrBLW;EmBDX,yBEDoF;EASpF,qBATyH;AxByxE7H;;AwB7wEE;EAEE,WrBZW;EmBDX,yBEDoF;EAgBpF,qBAhByH;EAqBvH,gDAAiF;AxB2wEvF;;AwBtwEE;EAEE,WrB1BW;EqB2BX,yBrBCa;EqBAb,qBrBAa;AHwwEjB;;AwBjwEE;;EAGE,WrBtCW;EqBuCX,yBAzCuK;EA6CvK,qBA7C+M;AxB6yEnN;;AwB9vEI;;EAKI,gDAAiF;AxB8vEzF;;AuBtvEE;EC3DA,WrBCa;EmBDX,yBnBOc;EqBLhB,qBrBKgB;AHgzElB;;AKjzEE;EmBAE,WrBLW;EmBDX,yBEDoF;EASpF,qBATyH;AxB8zE7H;;AwBlzEE;EAEE,WrBZW;EmBDX,yBEDoF;EAgBpF,qBAhByH;EAqBvH,iDAAiF;AxBgzEvF;;AwB3yEE;EAEE,WrB1BW;EqB2BX,yBrBrBc;EqBsBd,qBrBtBc;AHm0ElB;;AwBtyEE;;EAGE,WrBtCW;EqBuCX,yBAzCuK;EA6CvK,qBA7C+M;AxBk1EnN;;AwBnyEI;;EAKI,iDAAiF;AxBmyEzF;;AuB3xEE;EC3DA,WrBCa;EmBDX,yBnBoCa;EqBlCf,qBrBkCe;AHwzEjB;;AKt1EE;EmBAE,WrBLW;EmBDX,yBEDoF;EASpF,qBATyH;AxBm2E7H;;AwBv1EE;EAEE,WrBZW;EmBDX,yBEDoF;EAgBpF,qBAhByH;EAqBvH,+CAAiF;AxBq1EvF;;AwBh1EE;EAEE,WrB1BW;EqB2BX,yBrBQa;EqBPb,qBrBOa;AH20EjB;;AwB30EE;;EAGE,WrBtCW;EqBuCX,yBAzCuK;EA6CvK,qBA7C+M;AxBu3EnN;;AwBx0EI;;EAKI,+CAAiF;AxBw0EzF;;AuBh0EE;EC3DA,WrBCa;EmBDX,yBnBsCa;EqBpCf,qBrBoCe;AH21EjB;;AK33EE;EmBAE,WrBLW;EmBDX,yBEDoF;EASpF,qBATyH;AxBw4E7H;;AwB53EE;EAEE,WrBZW;EmBDX,yBEDoF;EAgBpF,qBAhByH;EAqBvH,gDAAiF;AxB03EvF;;AwBr3EE;EAEE,WrB1BW;EqB2BX,yBrBUa;EqBTb,qBrBSa;AH82EjB;;AwBh3EE;;EAGE,WrBtCW;EqBuCX,yBAzCuK;EA6CvK,qBA7C+M;AxB45EnN;;AwB72EI;;EAKI,gDAAiF;AxB62EzF;;AuBr2EE;EC3DA,crBUgB;EmBVd,yBnBmCa;EqBjCf,qBrBiCe;AHm4EjB;;AKh6EE;EmBAE,crBIc;EmBVd,yBEDoF;EASpF,qBATyH;AxB66E7H;;AwBj6EE;EAEE,crBHc;EmBVd,yBEDoF;EAgBpF,qBAhByH;EAqBvH,gDAAiF;AxB+5EvF;;AwB15EE;EAEE,crBjBc;EqBkBd,yBrBOa;EqBNb,qBrBMa;AHs5EjB;;AwBr5EE;;EAGE,crB7Bc;EqB8Bd,yBAzCuK;EA6CvK,qBA7C+M;AxBi8EnN;;AwBl5EI;;EAKI,gDAAiF;AxBk5EzF;;AuB14EE;EC3DA,WrBCa;EmBDX,yBnBiCa;EqB/Bf,qBrB+Be;AH06EjB;;AKr8EE;EmBAE,WrBLW;EmBDX,yBEDoF;EASpF,qBATyH;AxBk9E7H;;AwBt8EE;EAEE,WrBZW;EmBDX,yBEDoF;EAgBpF,qBAhByH;EAqBvH,+CAAiF;AxBo8EvF;;AwB/7EE;EAEE,WrB1BW;EqB2BX,yBrBKa;EqBJb,qBrBIa;AH67EjB;;AwB17EE;;EAGE,WrBtCW;EqBuCX,yBAzCuK;EA6CvK,qBA7C+M;AxBs+EnN;;AwBv7EI;;EAKI,+CAAiF;AxBu7EzF;;AuB/6EE;EC3DA,crBUgB;EmBVd,yBnBEc;EqBAhB,qBrBAgB;AH8+ElB;;AK1+EE;EmBAE,crBIc;EmBVd,yBEDoF;EASpF,qBATyH;AxBu/E7H;;AwB3+EE;EAEE,crBHc;EmBVd,yBEDoF;EAgBpF,qBAhByH;EAqBvH,iDAAiF;AxBy+EvF;;AwBp+EE;EAEE,crBjBc;EqBkBd,yBrB1Bc;EqB2Bd,qBrB3Bc;AHigFlB;;AwB/9EE;;EAGE,crB7Bc;EqB8Bd,yBAzCuK;EA6CvK,qBA7C+M;AxB2gFnN;;AwB59EI;;EAKI,iDAAiF;AxB49EzF;;AuBp9EE;EC3DA,WrBCa;EmBDX,yBnBSc;EqBPhB,qBrBOgB;AH4gFlB;;AK/gFE;EmBAE,WrBLW;EmBDX,yBEDoF;EASpF,qBATyH;AxB4hF7H;;AwBhhFE;EAEE,WrBZW;EmBDX,yBEDoF;EAgBpF,qBAhByH;EAqBvH,8CAAiF;AxB8gFvF;;AwBzgFE;EAEE,WrB1BW;EqB2BX,yBrBnBc;EqBoBd,qBrBpBc;AH+hFlB;;AwBpgFE;;EAGE,WrBtCW;EqBuCX,yBAzCuK;EA6CvK,qBA7C+M;AxBgjFnN;;AwBjgFI;;EAKI,8CAAiF;AxBigFzF;;AuBn/EE;ECPA,crB7Be;EqB8Bf,qBrB9Be;AH4hFjB;;AKnjFE;EmBwDE,WrB7DW;EqB8DX,yBrBlCa;EqBmCb,qBrBnCa;AHkiFjB;;AwB5/EE;EAEE,+CrBxCa;AHsiFjB;;AwB3/EE;EAEE,crB7Ca;EqB8Cb,6BAA6B;AxB6/EjC;;AwB1/EE;;EAGE,WrBhFW;EqBiFX,yBrBrDa;EqBsDb,qBrBtDa;AHkjFjB;;AwB1/EI;;EAKI,+CrB7DS;AHujFjB;;AuBnhFE;ECPA,crBnDgB;EqBoDhB,qBrBpDgB;AHklFlB;;AKnlFE;EmBwDE,WrB7DW;EqB8DX,yBrBxDc;EqByDd,qBrBzDc;AHwlFlB;;AwB5hFE;EAEE,iDrB9Dc;AH4lFlB;;AwB3hFE;EAEE,crBnEc;EqBoEd,6BAA6B;AxB6hFjC;;AwB1hFE;;EAGE,WrBhFW;EqBiFX,yBrB3Ec;EqB4Ed,qBrB5Ec;AHwmFlB;;AwB1hFI;;EAKI,iDrBnFU;AH6mFlB;;AuBnjFE;ECPA,crBtBe;EqBuBf,qBrBvBe;AHqlFjB;;AKnnFE;EmBwDE,WrB7DW;EqB8DX,yBrB3Ba;EqB4Bb,qBrB5Ba;AH2lFjB;;AwB5jFE;EAEE,+CrBjCa;AH+lFjB;;AwB3jFE;EAEE,crBtCa;EqBuCb,6BAA6B;AxB6jFjC;;AwB1jFE;;EAGE,WrBhFW;EqBiFX,yBrB9Ca;EqB+Cb,qBrB/Ca;AH2mFjB;;AwB1jFI;;EAKI,+CrBtDS;AHgnFjB;;AuBnlFE;ECPA,crBpBe;EqBqBf,qBrBrBe;AHmnFjB;;AKnpFE;EmBwDE,WrB7DW;EqB8DX,yBrBzBa;EqB0Bb,qBrB1Ba;AHynFjB;;AwB5lFE;EAEE,gDrB/Ba;AH6nFjB;;AwB3lFE;EAEE,crBpCa;EqBqCb,6BAA6B;AxB6lFjC;;AwB1lFE;;EAGE,WrBhFW;EqBiFX,yBrB5Ca;EqB6Cb,qBrB7Ca;AHyoFjB;;AwB1lFI;;EAKI,gDrBpDS;AH8oFjB;;AuBnnFE;ECPA,crBvBe;EqBwBf,qBrBxBe;AHspFjB;;AKnrFE;EmBwDE,crBpDc;EqBqDd,yBrB5Ba;EqB6Bb,qBrB7Ba;AH4pFjB;;AwB5nFE;EAEE,+CrBlCa;AHgqFjB;;AwB3nFE;EAEE,crBvCa;EqBwCb,6BAA6B;AxB6nFjC;;AwB1nFE;;EAGE,crBvEc;EqBwEd,yBrB/Ca;EqBgDb,qBrBhDa;AH4qFjB;;AwB1nFI;;EAKI,+CrBvDS;AHirFjB;;AuBnpFE;ECPA,crBzBe;EqB0Bf,qBrB1Be;AHwrFjB;;AKntFE;EmBwDE,WrB7DW;EqB8DX,yBrB9Ba;EqB+Bb,qBrB/Ba;AH8rFjB;;AwB5pFE;EAEE,+CrBpCa;AHksFjB;;AwB3pFE;EAEE,crBzCa;EqB0Cb,6BAA6B;AxB6pFjC;;AwB1pFE;;EAGE,WrBhFW;EqBiFX,yBrBjDa;EqBkDb,qBrBlDa;AH8sFjB;;AwB1pFI;;EAKI,+CrBzDS;AHmtFjB;;AuBnrFE;ECPA,crBxDgB;EqByDhB,qBrBzDgB;AHuvFlB;;AKnvFE;EmBwDE,crBpDc;EqBqDd,yBrB7Dc;EqB8Dd,qBrB9Dc;AH6vFlB;;AwB5rFE;EAEE,iDrBnEc;AHiwFlB;;AwB3rFE;EAEE,crBxEc;EqByEd,6BAA6B;AxB6rFjC;;AwB1rFE;;EAGE,crBvEc;EqBwEd,yBrBhFc;EqBiFd,qBrBjFc;AH6wFlB;;AwB1rFI;;EAKI,iDrBxFU;AHkxFlB;;AuBntFE;ECPA,crBjDgB;EqBkDhB,qBrBlDgB;AHgxFlB;;AKnxFE;EmBwDE,WrB7DW;EqB8DX,yBrBtDc;EqBuDd,qBrBvDc;AHsxFlB;;AwB5tFE;EAEE,8CrB5Dc;AH0xFlB;;AwB3tFE;EAEE,crBjEc;EqBkEd,6BAA6B;AxB6tFjC;;AwB1tFE;;EAGE,WrBhFW;EqBiFX,yBrBzEc;EqB0Ed,qBrB1Ec;AHsyFlB;;AwB1tFI;;EAKI,8CrBjFU;AH2yFlB;;AuBxuFA;EACE,gBpB4M+B;EoB3M/B,cpBjDe;EoBkDf,qBpB2F4C;AHgpF9C;;AKpzFE;EkB4EE,cpByF8D;EoBxF9D,0BpByF+C;AHmpFnD;;AuBnvFA;EAYI,0BpBoF+C;AHupFnD;;AuBvvFA;EAiBI,cpBtFc;EoBuFd,oBAAoB;AvB0uFxB;;AuB/tFA;ECPE,oBrB0SgC;ECnR5B,kBAtCY;EoBiBhB,gBrB+H+B;EOvN7B,qBP8N+B;AHqmFnC;;AuBluFA;ECXE,uBrBqSiC;EC9Q7B,mBAtCY;EoBiBhB,gBrBgI+B;EOxN7B,qBP+N+B;AH2mFnC;;AuBhuFA;EACE,cAAc;EACd,WAAW;AvBmuFb;;AuBruFA;EAMI,kBpBuT+B;AH46EnC;;AuB9tFA;;;EAII,WAAW;AvBguFf;;AyB32FA;ELgBM,gCjBiP2C;AH8mFjD;;AoB31FM;EKpBN;ILqBQ,gBAAgB;EpB+1FtB;AACF;;AyBr3FA;EAII,UAAU;AzBq3Fd;;AyBj3FA;EAEI,aAAa;AzBm3FjB;;AyB/2FA;EACE,kBAAkB;EAClB,SAAS;EACT,gBAAgB;ELDZ,6BjBkPwC;AHkoF9C;;AoBh3FM;EKNN;ILOQ,gBAAgB;EpBo3FtB;AACF;;A0Bz4FA;;;;EAIE,kBAAkB;A1B44FpB;;A0Bz4FA;EACE,mBAAmB;A1B44FrB;;A2Bx3FI;EACE,qBAAqB;EACrB,oBxB+N0C;EwB9N1C,uBxB6N0C;EwB5N1C,WAAW;EAhCf,uBAA8B;EAC9B,qCAA4C;EAC5C,gBAAgB;EAChB,oCAA2C;A3B45F7C;;A2Bv2FI;EACE,cAAc;A3B02FpB;;A0Bp5FA;EACE,kBAAkB;EAClB,SAAS;EACT,OAAO;EACP,avBwpBsC;EuBvpBtC,aAAa;EACb,WAAW;EACX,gBvBguBuC;EuB/tBvC,iBvBguBmC;EuB/tBnC,oBAA4B;EtBsGxB,eAtCY;EsB9DhB,cvBXgB;EuBYhB,gBAAgB;EAChB,gBAAgB;EAChB,sBvBvBa;EuBwBb,4BAA4B;EAC5B,qCvBfa;EOCX,sBP6NgC;AHysFpC;;A0B/4FI;EACE,WAAW;EACX,OAAO;A1Bk5Fb;;A0B/4FI;EACE,QAAQ;EACR,UAAU;A1Bk5FhB;;Act4FI;EYnBA;IACE,WAAW;IACX,OAAO;E1B65FX;E0B15FE;IACE,QAAQ;IACR,UAAU;E1B45Fd;AACF;;Acj5FI;EYnBA;IACE,WAAW;IACX,OAAO;E1Bw6FX;E0Br6FE;IACE,QAAQ;IACR,UAAU;E1Bu6Fd;AACF;;Ac55FI;EYnBA;IACE,WAAW;IACX,OAAO;E1Bm7FX;E0Bh7FE;IACE,QAAQ;IACR,UAAU;E1Bk7Fd;AACF;;Acv6FI;EYnBA;IACE,WAAW;IACX,OAAO;E1B87FX;E0B37FE;IACE,QAAQ;IACR,UAAU;E1B67Fd;AACF;;A0Bv7FA;EAEI,SAAS;EACT,YAAY;EACZ,aAAa;EACb,uBvB8rBuC;AH2vE3C;;A2Bx9FI;EACE,qBAAqB;EACrB,oBxB+N0C;EwB9N1C,uBxB6N0C;EwB5N1C,WAAW;EAzBf,aAAa;EACb,qCAA4C;EAC5C,0BAAiC;EACjC,oCAA2C;A3Bq/F7C;;A2Bv8FI;EACE,cAAc;A3B08FpB;;A0Bh8FA;EAEI,MAAM;EACN,WAAW;EACX,UAAU;EACV,aAAa;EACb,qBvBgrBuC;AHkxE3C;;A2B/+FI;EACE,qBAAqB;EACrB,oBxB+N0C;EwB9N1C,uBxB6N0C;EwB5N1C,WAAW;EAlBf,mCAA0C;EAC1C,eAAe;EACf,sCAA6C;EAC7C,wBAA+B;A3BqgGjC;;A2B99FI;EACE,cAAc;A3Bi+FpB;;A2B9/FI;EDmDE,iBAAiB;A1B+8FvB;;A0B18FA;EAEI,MAAM;EACN,WAAW;EACX,UAAU;EACV,aAAa;EACb,sBvB+pBuC;AH6yE3C;;A2B1gGI;EACE,qBAAqB;EACrB,oBxB+N0C;EwB9N1C,uBxB6N0C;EwB5N1C,WAAW;A3B6gGjB;;A2BjhGI;EAgBI,aAAa;A3BqgGrB;;A2BlgGM;EACE,qBAAqB;EACrB,qBxB4MwC;EwB3MxC,uBxB0MwC;EwBzMxC,WAAW;EA9BjB,mCAA0C;EAC1C,yBAAgC;EAChC,sCAA6C;A3BoiG/C;;A2BngGI;EACE,cAAc;A3BsgGpB;;A2BhhGM;EDiDA,iBAAiB;A1Bm+FvB;;A0B59FA;EAKI,WAAW;EACX,YAAY;A1B29FhB;;A0Bt9FA;EE9GE,SAAS;EACT,gBAAmB;EACnB,gBAAgB;EAChB,6BzBCgB;AHukGlB;;A0Bt9FA;EACE,cAAc;EACd,WAAW;EACX,uBvBmpBwC;EuBlpBxC,WAAW;EACX,gBvBgK+B;EuB/J/B,cvBhHgB;EuBiHhB,mBAAmB;EAEnB,mBAAmB;EACnB,6BAA6B;EAC7B,SAAS;A1Bw9FX;;AK7kGE;EqBoIE,cvBmnBqD;EuBlnBrD,qBAAqB;EJ/IrB,yBnBGc;AH0lGlB;;A0Bz+FA;EAiCI,WvBpJW;EuBqJX,qBAAqB;EJtJrB,yBnB6Ba;AHskGjB;;A0B/+FA;EAwCI,cvBtJc;EuBuJd,oBAAoB;EACpB,6BAA6B;A1B28FjC;;A0Bn8FA;EACE,cAAc;A1Bs8FhB;;A0Bl8FA;EACE,cAAc;EACd,sBvB6lBwC;EuB5lBxC,gBAAgB;EtBrDZ,mBAtCY;EsB6FhB,cvBzKgB;EuB0KhB,mBAAmB;A1Bq8FrB;;A0Bj8FA;EACE,cAAc;EACd,uBvBmlBwC;EuBllBxC,cvB9KgB;AHknGlB;;A6B/nGA;;EAEE,kBAAkB;EAClB,oBAAoB;EACpB,sBAAsB;A7BkoGxB;;A6BtoGA;;EAOI,kBAAkB;EAClB,cAAc;A7BooGlB;;AKnoGE;;EwBII,UAAU;A7BooGhB;;A6BjpGA;;;;EAkBM,UAAU;A7BsoGhB;;A6BhoGA;EACE,aAAa;EACb,eAAe;EACf,2BAA2B;A7BmoG7B;;A6BtoGA;EAMI,WAAW;A7BooGf;;A6BhoGA;;EAII,iB1BmM6B;AH87FjC;;A6BroGA;;EnBHI,0BmBa8B;EnBZ9B,6BmBY8B;A7BioGlC;;A6B3oGA;;EnBWI,yBmBI6B;EnBH7B,4BmBG6B;A7BkoGjC;;A6BlnGA;EACE,wBAAmC;EACnC,uBAAkC;A7BqnGpC;;A6BvnGA;;;EAOI,cAAc;A7BsnGlB;;A6BnnGE;EACE,eAAe;A7BsnGnB;;A6BlnGA;EACE,uBAAsC;EACtC,sBAAqC;A7BqnGvC;;A6BlnGA;EACE,sBAAsC;EACtC,qBAAqC;A7BqnGvC;;A6BjmGA;EACE,sBAAsB;EACtB,uBAAuB;EACvB,uBAAuB;A7BomGzB;;A6BvmGA;;EAOI,WAAW;A7BqmGf;;A6B5mGA;;EAYI,gB1BkH6B;AHm/FjC;;A6BjnGA;;EnBrEI,6BmBuF+B;EnBtF/B,4BmBsF+B;A7BqmGnC;;A6BvnGA;;EnBnFI,yBmB0G4B;EnBzG5B,0BmByG4B;A7BsmGhC;;A6BrlGA;;EAGI,gBAAgB;A7BulGpB;;A6B1lGA;;;;EAOM,kBAAkB;EAClB,sBAAsB;EACtB,oBAAoB;A7B0lG1B;;A8BnvGA;EACE,kBAAkB;EAClB,aAAa;EACb,eAAe;EACf,oBAAoB;EACpB,WAAW;A9BsvGb;;A8B3vGA;;;;EAWI,kBAAkB;EAClB,cAAc;EACd,SAAS;EACT,YAAY;EACZ,gBAAgB;A9BuvGpB;;A8BtwGA;;;;;;;;;;;;EAoBM,iB3BkN2B;AH+iGjC;;A8BrxGA;;;EA4BI,UAAU;A9B+vGd;;A8B3xGA;EAiCI,UAAU;A9B8vGd;;A8B/xGA;;EpB0CI,yBoBJmD;EpBKnD,4BoBLmD;A9B+vGvD;;A8BryGA;EA4CI,aAAa;EACb,mBAAmB;A9B6vGvB;;A8B1yGA;;EpB0CI,yBoBMsE;EpBLtE,4BoBKsE;A9BgwG1E;;A8BhzGA;;;EpB4BI,0BoB2BgC;EpB1BhC,6BoB0BgC;A9BgwGpC;;A8BvzGA;;;EpB4BI,0BoBmCgC;EpBlChC,6BoBkCgC;A9B+vGpC;;A8BnvGA;;EAEE,aAAa;A9BsvGf;;A8BxvGA;;EAQI,kBAAkB;EAClB,UAAU;A9BqvGd;;A8B9vGA;;EAYM,UAAU;A9BuvGhB;;A8BnwGA;;;;;;;;EAoBI,iB3BuI6B;AHmnGjC;;A8BtvGA;EAAuB,kB3BmIU;AHunGjC;;A8BzvGA;EAAsB,iB3BkIW;AH2nGjC;;A8BrvGA;EACE,aAAa;EACb,mBAAmB;EACnB,yB3B8QkC;E2B7QlC,gBAAgB;E1BSZ,eAtCY;E0B+BhB,gB3BuK+B;E2BtK/B,gB3B2K+B;E2B1K/B,c3B5GgB;E2B6GhB,kBAAkB;EAClB,mBAAmB;EACnB,yB3BpHgB;E2BqHhB,yB3BnHgB;EOOd,sBP6NgC;AHwoGpC;;A8BrwGA;;EAkBI,aAAa;A9BwvGjB;;A8B9uGA;;EAEE,gCZtB8D;AlBuwGhE;;A8B9uGA;;;;;;EAME,oB3ByPgC;ECnR5B,kBAtCY;E0BkEhB,gB3B8E+B;EOvN7B,qBP8N+B;AH6pGnC;;A8B9uGA;;EAEE,kCZvC8D;AlBwxGhE;;A8B9uGA;;;;;;EAME,uB3BmOiC;EC9Q7B,mBAtCY;E0BmFhB,gB3B8D+B;EOxN7B,qBP+N+B;AH6qGnC;;A8B9uGA;;EAEE,sBAA0E;A9BivG5E;;A8BtuGA;;;;;;;;EpB3JI,0BoBmK4B;EpBlK5B,6BoBkK4B;A9B0uGhC;;A8BvuGA;;;;;;EpBxJI,yBoB8J2B;EpB7J3B,4BoB6J2B;A9B2uG/B;;A+Bh7GA;EACE,kBAAkB;EAClB,UAAU;EACV,cAAc;EACd,kBAA+C;EAC/C,oBAAqE;EACrE,iCAAmB;EAAnB,mBAAmB;A/Bm7GrB;;A+Bh7GA;EACE,oBAAoB;EACpB,kB5Bwf0C;AH27F5C;;A+Bh7GA;EACE,kBAAkB;EAClB,OAAO;EACP,WAAW;EACX,W5Bof0C;E4Bnf1C,eAAkF;EAClF,UAAU;A/Bm7GZ;;A+Bz7GA;EASI,W5BzBW;E4B0BX,qB5BEa;EmB7Bb,yBnB6Ba;AHm7GjB;;A+B/7GA;EAoBM,gD5BRW;AHu7GjB;;A+Bn8GA;EAyBI,qB5BqbsE;AHy/F1E;;A+Bv8GA;EA6BI,W5B7CW;E4B8CX,yB5Bif8E;E4Bhf9E,qB5Bgf8E;AH87FlF;;A+B78GA;EAuCM,c5BjDY;AH29GlB;;A+Bj9GA;EA0CQ,yB5BxDU;AHm+GlB;;A+Bj6GA;EACE,kBAAkB;EAClB,gBAAgB;EAEhB,mBAAmB;A/Bm6GrB;;A+Bv6GA;EASI,kBAAkB;EAClB,YAA+E;EAC/E,aAA+D;EAC/D,cAAc;EACd,W5BubwC;E4BtbxC,Y5BsbwC;E4BrbxC,oBAAoB;EACpB,WAAW;EACX,sB5BrFW;E4BsFX,yB5B+I6B;AHmxGjC;;A+Bp7GA;EAwBI,kBAAkB;EAClB,YAA+E;EAC/E,aAA+D;EAC/D,cAAc;EACd,W5BwawC;E4BvaxC,Y5BuawC;E4BtaxC,WAAW;EACX,mCAAgE;A/Bg6GpE;;A+Bv5GA;ErBjGI,sBP6NgC;AH+xGpC;;A+B35GA;EAOM,kOb7D4E;AlBq9GlF;;A+B/5GA;EAaM,qB5B7FW;EmB7Bb,yBnB6Ba;AHo/GjB;;A+Bp6GA;EAkBM,+KbxE4E;AlB89GlF;;A+Bx6GA;ET7GI,wCnB6Ba;AH4/GjB;;A+B56GA;ET7GI,wCnB6Ba;AHggHjB;;A+B54GA;EAGI,kB5ByZ+C;AHo/FnD;;A+Bh5GA;EAQM,8KblG4E;AlB8+GlF;;A+Bp5GA;ETjJI,wCnB6Ba;AH4gHjB;;A+Bh4GA;EACE,qBAA2D;A/Bm4G7D;;A+Bp4GA;EAKM,cAAqD;EACrD,c5BiY+E;E4BhY/E,mBAAmB;EAEnB,qB5B+X4E;AHmgGlF;;A+B34GA;EAaM,wBblE0D;EamE1D,0BbnE0D;EaoE1D,uBbhD0D;EaiD1D,wBbjD0D;EakD1D,yB5BpLY;E4BsLZ,qB5BqX4E;EiBviB5E,yIjByf+H;AH2jGrI;;AoBhjHM;EW2JN;IX1JQ,gBAAgB;EpBojHtB;AACF;;A+B35GA;EA0BM,sB5BlMS;E4BmMT,8BAA4E;A/Bq4GlF;;A+Bh6GA;ETzKI,wCnB6Ba;AHgjHjB;;A+Bv3GA;EACE,qBAAqB;EACrB,WAAW;EACX,mCbrG8D;EasG9D,0C5BmKkC;ECpQ9B,eAtCY;E2B0IhB,gB5B4D+B;E4B3D/B,gB5BgE+B;E4B/D/B,c5BvNgB;E4BwNhB,sBAAsB;EACtB,uO5BkW+I;E4BjW/I,yB5B7NgB;EOOd,sBP6NgC;E4BJlC,wBAAgB;EAAhB,qBAAgB;EAAhB,gBAAgB;A/Bw3GlB;;A+Bv4GA;EAkBI,qB5BuPsE;E4BtPtE,UAAU;EAKR,gD5BjNW;AHskHjB;;A+B74GA;EAiCM,c5B/OY;E4BgPZ,sB5BvPS;AHumHf;;A+Bl5GA;EAwCI,YAAY;EACZ,sB5B8HgC;E4B7HhC,sBAAsB;A/B82G1B;;A+Bx5GA;EA8CI,c5B7Pc;E4B8Pd,yB5BlQc;AHgnHlB;;A+B75GA;EAoDI,aAAa;A/B62GjB;;A+Bj6GA;EAyDI,kBAAkB;EAClB,0B5BxQc;AHonHlB;;A+Bx2GA;EACE,kCbjK8D;EakK9D,oB5BgHkC;E4B/GlC,uB5B+GkC;E4B9GlC,oB5B+GiC;EC9Q7B,mBAtCY;AJijHlB;;A+Bx2GA;EACE,gCbzK8D;Ea0K9D,mB5B6GiC;E4B5GjC,sB5B4GiC;E4B3GjC,kB5B4GgC;ECnR5B,kBAtCY;AJyjHlB;;A+Bn2GA;EACE,kBAAkB;EAClB,qBAAqB;EACrB,WAAW;EACX,mCbzL8D;Ea0L9D,gBAAgB;A/Bs2GlB;;A+Bn2GA;EACE,kBAAkB;EAClB,UAAU;EACV,WAAW;EACX,mCbjM8D;EakM9D,SAAS;EACT,gBAAgB;EAChB,UAAU;A/Bs2GZ;;A+B72GA;EAUI,qB5BoKsE;E4BnKtE,gD5B/Ra;AHsoHjB;;A+Bl3GA;;EAiBI,yB5B/Tc;AHqqHlB;;A+Bv3GA;EAsBM,iB5B2TQ;AH0iGd;;A+B33GA;EA2BI,0BAA0B;A/Bo2G9B;;A+Bh2GA;EACE,kBAAkB;EAClB,MAAM;EACN,QAAQ;EACR,OAAO;EACP,UAAU;EACV,mCblO8D;EamO9D,yB5BsCkC;E4BrClC,gBAAgB;EAEhB,gB5BjE+B;E4BkE/B,gB5B7D+B;E4B8D/B,c5BpVgB;E4BqVhB,sB5B5Va;E4B6Vb,yB5BzVgB;EOOd,sBP6NgC;AHw9GpC;;A+Bj3GA;EAmBI,kBAAkB;EAClB,MAAM;EACN,QAAQ;EACR,SAAS;EACT,UAAU;EACV,cAAc;EACd,6BbrP4D;EasP5D,yB5BmBgC;E4BlBhC,gB5B7E6B;E4B8E7B,c5BpWc;E4BqWd,iBAAiB;ET7WjB,yBnBGc;E4B4Wd,oBAAoB;ErBnWpB,kCqBoWgF;A/Bk2GpF;;A+Bx1GA;EACE,WAAW;EACX,cb3Q2B;Ea4Q3B,UAAU;EACV,6BAA6B;EAC7B,wBAAgB;EAAhB,qBAAgB;EAAhB,gBAAgB;A/B21GlB;;A+Bh2GA;EAQI,UAAU;A/B41Gd;;A+Bp2GA;EAY8B,gE5BzWb;AHqsHjB;;A+Bx2GA;EAa8B,gE5B1Wb;AHysHjB;;A+B52GA;EAc8B,gE5B3Wb;AH6sHjB;;A+Bh3GA;EAkBI,SAAS;A/Bk2Gb;;A+Bp3GA;EAsBI,W5BmN6C;E4BlN7C,Y5BkN6C;E4BjN7C,oBAAyE;ETlZzE,yBnB6Ba;E4BuXb,S5BkN0C;EO1lB1C,mBP2lB6C;EiB7lB3C,oHjByf+H;EiBzf/H,4GjByf+H;E4B3GjI,wBAAgB;EAAhB,gBAAgB;A/Bi2GpB;;AoB3uHM;EW4WN;IX3WQ,wBAAgB;IAAhB,gBAAgB;EpB+uHtB;AACF;;A+Br4GA;ET1XI,yBnB2mB2E;AHwpG/E;;A+Bz4GA;EAsCI,W5B4LoC;E4B3LpC,c5B4LqC;E4B3LrC,kBAAkB;EAClB,e5B2LuC;E4B1LvC,yB5Bhac;E4Biad,yBAAyB;ErBzZzB,mBPolBoC;AH6qGxC;;A+Bn5GA;EAiDI,W5BwL6C;E4BvL7C,Y5BuL6C;EmBnmB7C,yBnB6Ba;E4BiZb,S5BwL0C;EO1lB1C,mBP2lB6C;EiB7lB3C,iHjByf+H;EiBzf/H,4GjByf+H;E4BjFjI,qBAAgB;EAAhB,gBAAgB;A/Bq2GpB;;AoBzwHM;EW4WN;IX3WQ,qBAAgB;IAAhB,gBAAgB;EpB6wHtB;AACF;;A+Bn6GA;ET1XI,yBnB2mB2E;AHsrG/E;;A+Bv6GA;EAgEI,W5BkKoC;E4BjKpC,c5BkKqC;E4BjKrC,kBAAkB;EAClB,e5BiKuC;E4BhKvC,yB5B1bc;E4B2bd,yBAAyB;ErBnbzB,mBPolBoC;AH2sGxC;;A+Bj7GA;EA2EI,W5B8J6C;E4B7J7C,Y5B6J6C;E4B5J7C,aAAa;EACb,oB5BtE+B;E4BuE/B,mB5BvE+B;EmBlY/B,yBnB6Ba;E4B8ab,S5B2J0C;EO1lB1C,mBP2lB6C;EiB7lB3C,gHjByf+H;EiBzf/H,4GjByf+H;E4BpDjI,gBAAgB;A/By2GpB;;AoB1yHM;EW4WN;IX3WQ,oBAAgB;IAAhB,gBAAgB;EpB8yHtB;AACF;;A+Bp8GA;ET1XI,yBnB2mB2E;AHutG/E;;A+Bx8GA;EA6FI,W5BqIoC;E4BpIpC,c5BqIqC;E4BpIrC,kBAAkB;EAClB,e5BoIuC;E4BnIvC,6BAA6B;EAC7B,yBAAyB;EACzB,oBAA4C;A/B+2GhD;;A+Bl9GA;EAwGI,yB5B9dc;EOQd,mBPolBoC;AHivGxC;;A+Bv9GA;EA6GI,kBAAkB;EAClB,yB5Bpec;EOQd,mBPolBoC;AHuvGxC;;A+B79GA;EAoHM,yB5BxeY;AHq1HlB;;A+Bj+GA;EAwHM,eAAe;A/B62GrB;;A+Br+GA;EA4HM,yB5BhfY;AH61HlB;;A+Bz+GA;EAgIM,eAAe;A/B62GrB;;A+B7+GA;EAoIM,yB5BxfY;AHq2HlB;;A+Bx2GA;;;EXzfM,4GjByf+H;AH82GrI;;AoBn2HM;EWqfN;;;IXpfQ,gBAAgB;EpBy2HtB;AACF;;AgC13HA;EACE,aAAa;EACb,eAAe;EACf,eAAe;EACf,gBAAgB;EAChB,gBAAgB;AhC63HlB;;AgC13HA;EACE,cAAc;EACd,oB7ByqBsC;AHotGxC;;AK53HE;E2BGE,qBAAqB;AhC63HzB;;AgCn4HA;EAWI,c7BXc;E6BYd,oBAAoB;EACpB,eAAe;AhC43HnB;;AgCp3HA;EACE,gC7BzBgB;AHg5HlB;;AgCx3HA;EAII,mB7BsM6B;E6BrM7B,6BAAgD;EtBZhD,+BPoNgC;EOnNhC,gCPmNgC;AHkrHpC;;AKj5HE;E2B2BI,qC7BjCY;AH25HlB;;AgCn4HA;EAaM,c7BlCY;E6BmCZ,6BAA6B;EAC7B,yBAAyB;AhC03H/B;;AgCz4HA;;EAqBI,c7BzCc;E6B0Cd,sB7BjDW;E6BkDX,kC7BlDW;AH26Hf;;AgCh5HA;EA4BI,gB7B8K6B;EOjN7B,yBsBqC4B;EtBpC5B,0BsBoC4B;AhCw3HhC;;AgC/2HA;EtBvDI,sBP6NgC;AH6sHpC;;AgCn3HA;;EAOI,W7BzEW;E6B0EX,yB7B9Ca;AH+5HjB;;AgCx2HA;;EAGI,cAAc;EACd,kBAAkB;AhC02HtB;;AgCt2HA;;EAGI,aAAa;EACb,YAAY;EACZ,kBAAkB;AhCw2HtB;;AgC/1HA;EAEI,aAAa;AhCi2HjB;;AgCn2HA;EAKI,cAAc;AhCk2HlB;;AiCt8HA;EACE,kBAAkB;EAClB,aAAa;EACb,eAAe;EACf,mBAAmB;EACnB,8BAA8B;EAC9B,oB9BgHW;AHy1Hb;;AiC/8HA;;EAWI,aAAa;EACb,eAAe;EACf,mBAAmB;EACnB,8BAA8B;AjCy8HlC;;AiCr7HA;EACE,qBAAqB;EACrB,sB9BiqB+E;E8BhqB/E,yB9BgqB+E;E8B/pB/E,kB9BgFW;ECRP,kBAtCY;E6BhChB,oBAAoB;EACpB,mBAAmB;AjCw7HrB;;AKl+HE;E4B6CE,qBAAqB;AjCy7HzB;;AiCh7HA;EACE,aAAa;EACb,sBAAsB;EACtB,eAAe;EACf,gBAAgB;EAChB,gBAAgB;AjCm7HlB;;AiCx7HA;EAQI,gBAAgB;EAChB,eAAe;AjCo7HnB;;AiC77HA;EAaI,gBAAgB;EAChB,WAAW;AjCo7Hf;;AiC36HA;EACE,qBAAqB;EACrB,mB9BwlBuC;E8BvlBvC,sB9BulBuC;AHu1GzC;;AiCl6HA;EACE,gBAAgB;EAChB,YAAY;EAGZ,mBAAmB;AjCm6HrB;;AiC/5HA;EACE,wB9BmmBwC;EC1lBpC,kBAtCY;E6B+BhB,cAAc;EACd,6BAA6B;EAC7B,6BAAuC;EvBxGrC,sBP6NgC;AH8yHpC;;AK7gIE;E4B8GE,qBAAqB;AjCm6HzB;;AiC75HA;EACE,qBAAqB;EACrB,YAAY;EACZ,aAAa;EACb,sBAAsB;EACtB,WAAW;EACX,qCAAqC;AjCg6HvC;;AiC75HA;EACE,gB9B+kBsC;E8B9kBtC,gBAAgB;AjCg6HlB;;Act+HI;EmBgFC;;IAGK,gBAAgB;IAChB,eAAe;EjCy5HvB;AACF;;Ac3/HI;EmB6FA;IAoBI,qBAAqB;IACrB,2BAA2B;EjC+4HjC;EiCp6HG;IAwBK,mBAAmB;EjC+4H3B;EiCv6HG;IA2BO,kBAAkB;EjC+4H5B;EiC16HG;IA+BO,qB9BwhB6B;I8BvhB7B,oB9BuhB6B;EHu3GvC;EiC96HG;;IAsCK,iBAAiB;EjC44HzB;EiCl7HG;IAqDK,iBAAiB;EjCg4HzB;EiCr7HG;IAyDK,wBAAwB;IAGxB,gBAAgB;EjC63HxB;EiCz7HG;IAgEK,aAAa;EjC43HrB;AACF;;Ac7gII;EmBgFC;;IAGK,gBAAgB;IAChB,eAAe;EjCg8HvB;AACF;;AcliII;EmB6FA;IAoBI,qBAAqB;IACrB,2BAA2B;EjCs7HjC;EiC38HG;IAwBK,mBAAmB;EjCs7H3B;EiC98HG;IA2BO,kBAAkB;EjCs7H5B;EiCj9HG;IA+BO,qB9BwhB6B;I8BvhB7B,oB9BuhB6B;EH85GvC;EiCr9HG;;IAsCK,iBAAiB;EjCm7HzB;EiCz9HG;IAqDK,iBAAiB;EjCu6HzB;EiC59HG;IAyDK,wBAAwB;IAGxB,gBAAgB;EjCo6HxB;EiCh+HG;IAgEK,aAAa;EjCm6HrB;AACF;;AcpjII;EmBgFC;;IAGK,gBAAgB;IAChB,eAAe;EjCu+HvB;AACF;;AczkII;EmB6FA;IAoBI,qBAAqB;IACrB,2BAA2B;EjC69HjC;EiCl/HG;IAwBK,mBAAmB;EjC69H3B;EiCr/HG;IA2BO,kBAAkB;EjC69H5B;EiCx/HG;IA+BO,qB9BwhB6B;I8BvhB7B,oB9BuhB6B;EHq8GvC;EiC5/HG;;IAsCK,iBAAiB;EjC09HzB;EiChgIG;IAqDK,iBAAiB;EjC88HzB;EiCngIG;IAyDK,wBAAwB;IAGxB,gBAAgB;EjC28HxB;EiCvgIG;IAgEK,aAAa;EjC08HrB;AACF;;Ac3lII;EmBgFC;;IAGK,gBAAgB;IAChB,eAAe;EjC8gIvB;AACF;;AchnII;EmB6FA;IAoBI,qBAAqB;IACrB,2BAA2B;EjCogIjC;EiCzhIG;IAwBK,mBAAmB;EjCogI3B;EiC5hIG;IA2BO,kBAAkB;EjCogI5B;EiC/hIG;IA+BO,qB9BwhB6B;I8BvhB7B,oB9BuhB6B;EH4+GvC;EiCniIG;;IAsCK,iBAAiB;EjCigIzB;EiCviIG;IAqDK,iBAAiB;EjCq/HzB;EiC1iIG;IAyDK,wBAAwB;IAGxB,gBAAgB;EjCk/HxB;EiC9iIG;IAgEK,aAAa;EjCi/HrB;AACF;;AiCvjIA;EAyBQ,qBAAqB;EACrB,2BAA2B;AjCkiInC;;AiC5jIA;;EAQU,gBAAgB;EAChB,eAAe;AjCyjIzB;;AiClkIA;EA6BU,mBAAmB;AjCyiI7B;;AiCtkIA;EAgCY,kBAAkB;AjC0iI9B;;AiC1kIA;EAoCY,qB9BwhB6B;E8BvhB7B,oB9BuhB6B;AHmhHzC;;AiC/kIA;;EA2CU,iBAAiB;AjCyiI3B;;AiCplIA;EA0DU,iBAAiB;AjC8hI3B;;AiCxlIA;EA8DU,wBAAwB;EAGxB,gBAAgB;AjC4hI1B;;AiC7lIA;EAqEU,aAAa;AjC4hIvB;;AiC/gIA;EAEI,yB9BvNW;AHwuIf;;AKzuIE;E4B2NI,yB9B1NS;AH4uIf;;AiCvhIA;EAWM,yB9BhOS;AHgvIf;;AKjvIE;E4BoOM,yB9BnOO;AHovIf;;AiC/hIA;EAkBQ,yB9BvOO;AHwvIf;;AiCniIA;;;;EA0BM,yB9B/OS;AH+vIf;;AiC1iIA;EA+BI,yB9BpPW;E8BqPX,gC9BrPW;AHowIf;;AiC/iIA;EAoCI,mRf7M8E;AlB4tIlF;;AiCnjIA;EAwCI,yB9B7PW;AH4wIf;;AiCvjIA;EA0CM,yB9B/PS;AHgxIf;;AKjxIE;E4BmQM,yB9BlQO;AHoxIf;;AiC3gIA;EAEI,W9BrRW;AHkyIf;;AKzxIE;E4B+QI,W9BxRS;AHsyIf;;AiCnhIA;EAWM,+B9B9RS;AH0yIf;;AKjyIE;E4BwRM,gC9BjSO;AH8yIf;;AiC3hIA;EAkBQ,gC9BrSO;AHkzIf;;AiC/hIA;;;;EA0BM,W9B7SS;AHyzIf;;AiCtiIA;EA+BI,+B9BlTW;E8BmTX,sC9BnTW;AH8zIf;;AiC3iIA;EAoCI,yRfjQ8E;AlB4wIlF;;AiC/iIA;EAwCI,+B9B3TW;AHs0If;;AiCnjIA;EA0CM,W9B7TS;AH00If;;AKj0IE;E4BuTM,W9BhUO;AH80If;;AkCj1IA;EACE,kBAAkB;EAClB,aAAa;EACb,sBAAsB;EACtB,YAAY;EAEZ,qBAAqB;EACrB,sB/BJa;E+BKb,2BAA2B;EAC3B,sC/BIa;EOCX,sBP6NgC;AHknIpC;;AkC71IA;EAaI,eAAe;EACf,cAAc;AlCo1IlB;;AkCl2IA;EAkBI,mBAAmB;EACnB,sBAAsB;AlCo1I1B;;AkCv2IA;EAsBM,mBAAmB;ExBCrB,2CQmH4D;ERlH5D,4CQkH4D;AlBmuIhE;;AkC72IA;EA2BM,sBAAsB;ExBUxB,+CQqG4D;ERpG5D,8CQoG4D;AlByuIhE;;AkCn3IA;;EAoCI,aAAa;AlCo1IjB;;AkCh1IA;EAGE,cAAc;EAGd,eAAe;EACf,gB/B8wByC;AHikH3C;;AkC30IA;EACE,sB/BwwBwC;AHskH1C;;AkC30IA;EACE,qBAA+B;EAC/B,gBAAgB;AlC80IlB;;AkC30IA;EACE,gBAAgB;AlC80IlB;;AKn4IE;E6B0DE,qBAAqB;AlC60IzB;;AkC/0IA;EAMI,oB/BuvBuC;AHslH3C;;AkCr0IA;EACE,wB/B8uByC;E+B7uBzC,gBAAgB;EAEhB,qC/BrEa;E+BsEb,6C/BtEa;AH64If;;AkC50IA;ExBhEI,0DwBwE8E;AlCw0IlF;;AkCp0IA;EACE,wB/BkuByC;E+BhuBzC,qC/BhFa;E+BiFb,0C/BjFa;AHu5If;;AkC10IA;ExB5EI,0DQ4H4D;AlB8xIhE;;AkC9zIA;EACE,uBAAiC;EACjC,uB/BgtBwC;E+B/sBxC,sBAAgC;EAChC,gBAAgB;AlCi0IlB;;AkC9zIA;EACE,uBAAiC;EACjC,sBAAgC;AlCi0IlC;;AkC7zIA;EACE,kBAAkB;EAClB,MAAM;EACN,QAAQ;EACR,SAAS;EACT,OAAO;EACP,gB/B2sByC;EO1zBvC,kCQ4H4D;AlBozIhE;;AkC7zIA;;;EAGE,cAAc;EACd,WAAW;AlCg0Ib;;AkC7zIA;;ExBjHI,2CQmH4D;ERlH5D,4CQkH4D;AlBi0IhE;;AkC9zIA;;ExBxGI,+CQqG4D;ERpG5D,8CQoG4D;AlBu0IhE;;AkC5zIA;EAEI,mB/BmrBsD;AH2oH1D;;Ac75II;EoB6FJ;IAMI,aAAa;IACb,mBAAmB;IACnB,mB/B6qBsD;I+B5qBtD,kB/B4qBsD;EHmpHxD;EkCx0IF;IAaM,YAAY;IACZ,kB/BuqBoD;I+BtqBpD,gBAAgB;IAChB,iB/BqqBoD;EHypHxD;AACF;;AkCrzIA;EAII,mB/BupBsD;AH8pH1D;;Ach7II;EoBuHJ;IAQI,aAAa;IACb,mBAAmB;ElCszIrB;EkC/zIF;IAcM,YAAY;IACZ,gBAAgB;ElCozIpB;EkCn0IF;IAkBQ,cAAc;IACd,cAAc;ElCozIpB;EkCv0IF;IxBjJI,0BwB0KoC;IxBzKpC,6BwByKoC;ElCkzItC;EkC30IF;;IA8BY,0BAA0B;ElCizIpC;EkC/0IF;;IAmCY,6BAA6B;ElCgzIvC;EkCn1IF;IxBnII,yBwB2KmC;IxB1KnC,4BwB0KmC;ElC+yIrC;EkCv1IF;;IA6CY,yBAAyB;ElC8yInC;EkC31IF;;IAkDY,4BAA4B;ElC6yItC;AACF;;AkCjyIA;EAEI,sB/B4kBsC;AHutH1C;;Ac39II;EoBsLJ;IAMI,oB/BylBiC;I+BzlBjC,e/BylBiC;I+BxlBjC,wB/BylBuC;I+BzlBvC,mB/BylBuC;I+BxlBvC,UAAU;IACV,SAAS;ElCoyIX;EkC7yIF;IAYM,qBAAqB;IACrB,WAAW;ElCoyIf;AACF;;AkC3xIA;EACE,qBAAqB;AlC8xIvB;;AkC/xIA;EAII,gBAAgB;AlC+xIpB;;AkCnyIA;EAOM,gBAAgB;ExBvOlB,6BwBwOiC;ExBvOjC,4BwBuOiC;AlCiyIrC;;AkCzyIA;ExB9OI,yBwB0P8B;ExBzP9B,0BwByP8B;AlCkyIlC;;AkC9yIA;ExBvPI,gBwBuQ0B;EACxB,mB/B9C2B;AHg1IjC;;AmC5jJA;EACE,aAAa;EACb,eAAe;EACf,qBhCiiCsC;EgChiCtC,mBhCmiCsC;EgCjiCtC,gBAAgB;EAChB,yBhCEgB;EOSd,sBP6NgC;AHu1IpC;;AmC3jJA;EAGI,oBhCuhCqC;AHqiHzC;;AmC/jJA;EAMM,WAAW;EACX,qBhCmhCmC;EgClhCnC,chCNY;EgCOZ,YhCwhCuC;AHqiH7C;;AmCtkJA;EAoBI,0BAA0B;AnCsjJ9B;;AmC1kJA;EAwBI,qBAAqB;AnCsjJzB;;AmC9kJA;EA4BI,chC1Bc;AHglJlB;;AoC7lJA;EACE,aAAa;E7BGb,eAAe;EACf,gBAAgB;EGad,sBP6NgC;AHq3IpC;;AoC9lJA;EACE,kBAAkB;EAClB,cAAc;EACd,uBjCgxBwC;EiC/wBxC,iBjCkO+B;EiCjO/B,iBjCmxBsC;EiClxBtC,cjCuBe;EiCrBf,sBjCPa;EiCQb,yBjCLgB;AHqmJlB;;AoCzmJA;EAYI,UAAU;EACV,cjC8J8D;EiC7J9D,qBAAqB;EACrB,yBjCZc;EiCad,qBjCZc;AH6mJlB;;AoCjnJA;EAoBI,UAAU;EACV,UjC2wBiC;EiC1wBjC,gDjCOa;AH0lJjB;;AoC7lJA;EAGM,cAAc;E1BahB,+BP+LgC;EO9LhC,kCP8LgC;AHo5IpC;;AoCnmJA;E1BEI,gCP6MgC;EO5MhC,mCP4MgC;AHy5IpC;;AoCxmJA;EAcI,UAAU;EACV,WjCxCW;EiCyCX,yBjCba;EiCcb,qBjCda;AH4mJjB;;AoC/mJA;EAqBI,cjCxCc;EiCyCd,oBAAoB;EAEpB,YAAY;EACZ,sBjClDW;EiCmDX,qBjChDc;AH6oJlB;;AqCppJE;EACE,uBlCyxBsC;EC9pBpC,kBAtCY;EiCnFd,gBlCmO6B;AHo7IjC;;AqClpJM;E3BqCF,8BPgM+B;EO/L/B,iCP+L+B;AHk7InC;;AqClpJM;E3BkBF,+BP8M+B;EO7M/B,kCP6M+B;AHu7InC;;AqCpqJE;EACE,uBlCuxBqC;EC5pBnC,mBAtCY;EiCnFd,gBlCoO6B;AHm8IjC;;AqClqJM;E3BqCF,8BPiM+B;EOhM/B,iCPgM+B;AHi8InC;;AqClqJM;E3BkBF,+BP+M+B;EO9M/B,kCP8M+B;AHs8InC;;AsClrJA;EACE,qBAAqB;EACrB,qBnC05BsC;ECz1BpC,cAAW;EkC/Db,gBnCuR+B;EmCtR/B,cAAc;EACd,kBAAkB;EAClB,mBAAmB;EACnB,wBAAwB;E5BKtB,sBP6NgC;EiB/N9B,qIjBgb6I;AHowInJ;;AoBhrJM;EkBfN;IlBgBQ,gBAAgB;EpBorJtB;AACF;;AK1rJE;EiCGI,qBAAqB;AtC2rJ3B;;AsCzsJA;EAoBI,aAAa;AtCyrJjB;;AsCprJA;EACE,kBAAkB;EAClB,SAAS;AtCurJX;;AsChrJA;EACE,oBnC+3BsC;EmC93BtC,mBnC83BsC;EOr5BpC,oBPw5BqC;AHmzHzC;;AsC3qJE;ECjDA,WpCMa;EoCLb,yBpCiCe;AH+rJjB;;AKltJE;EkCVI,WpCCS;EoCAT,yBAAkC;AvCguJxC;;AuCnuJU;EAQJ,UAAU;EACV,+CpCsBW;AHysJjB;;AsC1rJE;ECjDA,WpCMa;EoCLb,yBpCWgB;AHouJlB;;AKjuJE;EkCVI,WpCCS;EoCAT,yBAAkC;AvC+uJxC;;AuClvJU;EAQJ,UAAU;EACV,iDpCAY;AH8uJlB;;AsCzsJE;ECjDA,WpCMa;EoCLb,yBpCwCe;AHstJjB;;AKhvJE;EkCVI,WpCCS;EoCAT,yBAAkC;AvC8vJxC;;AuCjwJU;EAQJ,UAAU;EACV,+CpC6BW;AHguJjB;;AsCxtJE;ECjDA,WpCMa;EoCLb,yBpC0Ce;AHmuJjB;;AK/vJE;EkCVI,WpCCS;EoCAT,yBAAkC;AvC6wJxC;;AuChxJU;EAQJ,UAAU;EACV,gDpC+BW;AH6uJjB;;AsCvuJE;ECjDA,cpCegB;EoCdhB,yBpCuCe;AHqvJjB;;AK9wJE;EkCVI,cpCUY;EoCTZ,yBAAkC;AvC4xJxC;;AuC/xJU;EAQJ,UAAU;EACV,+CpC4BW;AH+vJjB;;AsCtvJE;ECjDA,WpCMa;EoCLb,yBpCqCe;AHswJjB;;AK7xJE;EkCVI,WpCCS;EoCAT,yBAAkC;AvC2yJxC;;AuC9yJU;EAQJ,UAAU;EACV,+CpC0BW;AHgxJjB;;AsCrwJE;ECjDA,cpCegB;EoCdhB,yBpCMgB;AHozJlB;;AK5yJE;EkCVI,cpCUY;EoCTZ,yBAAkC;AvC0zJxC;;AuC7zJU;EAQJ,UAAU;EACV,iDpCLY;AH8zJlB;;AsCpxJE;ECjDA,WpCMa;EoCLb,yBpCagB;AH4zJlB;;AK3zJE;EkCVI,WpCCS;EoCAT,yBAAkC;AvCy0JxC;;AuC50JU;EAQJ,UAAU;EACV,8CpCEY;AHs0JlB;;AwCr1JA;EACE,kBAAoD;EACpD,mBrCuzBsC;EqCrzBtC,yBrCKgB;EOSd,qBP8N+B;AH4mJnC;;AchyJI;E0B5DJ;IAQI,kBrCizBoC;EHwiItC;AACF;;AwCt1JA;EACE,gBAAgB;EAChB,eAAe;E9BIb,gB8BHsB;AxCy1J1B;;AyCp2JA;EACE,kBAAkB;EAClB,wBtCu9ByC;EsCt9BzC,mBtCu9BsC;EsCt9BtC,6BAA6C;E/BU3C,sBP6NgC;AHioJpC;;AyCn2JA;EAEE,cAAc;AzCq2JhB;;AyCj2JA;EACE,gBtC4Q+B;AHwlJjC;;AyC51JA;EACE,mBAAsD;AzC+1JxD;;AyCh2JA;EAKI,kBAAkB;EAClB,MAAM;EACN,QAAQ;EACR,UAAU;EACV,wBtCw7BuC;EsCv7BvC,cAAc;AzC+1JlB;;AyCr1JE;EC/CA,cxBwGgE;EInG9D,yBJmG8D;EwBtGhE,qBxBsGgE;AlBkyJlE;;A0Ct4JE;EACE,yBAAqC;A1Cy4JzC;;A0Ct4JE;EACE,cAA0B;A1Cy4J9B;;AyCn2JE;EC/CA,cxBwGgE;EInG9D,yBJmG8D;EwBtGhE,qBxBsGgE;AlBgzJlE;;A0Cp5JE;EACE,yBAAqC;A1Cu5JzC;;A0Cp5JE;EACE,cAA0B;A1Cu5J9B;;AyCj3JE;EC/CA,cxBwGgE;EInG9D,yBJmG8D;EwBtGhE,qBxBsGgE;AlB8zJlE;;A0Cl6JE;EACE,yBAAqC;A1Cq6JzC;;A0Cl6JE;EACE,cAA0B;A1Cq6J9B;;AyC/3JE;EC/CA,cxBwGgE;EInG9D,yBJmG8D;EwBtGhE,qBxBsGgE;AlB40JlE;;A0Ch7JE;EACE,yBAAqC;A1Cm7JzC;;A0Ch7JE;EACE,cAA0B;A1Cm7J9B;;AyC74JE;EC/CA,cxBwGgE;EInG9D,yBJmG8D;EwBtGhE,qBxBsGgE;AlB01JlE;;A0C97JE;EACE,yBAAqC;A1Ci8JzC;;A0C97JE;EACE,cAA0B;A1Ci8J9B;;AyC35JE;EC/CA,cxBwGgE;EInG9D,yBJmG8D;EwBtGhE,qBxBsGgE;AlBw2JlE;;A0C58JE;EACE,yBAAqC;A1C+8JzC;;A0C58JE;EACE,cAA0B;A1C+8J9B;;AyCz6JE;EC/CA,cxBwGgE;EInG9D,yBJmG8D;EwBtGhE,qBxBsGgE;AlBs3JlE;;A0C19JE;EACE,yBAAqC;A1C69JzC;;A0C19JE;EACE,cAA0B;A1C69J9B;;AyCv7JE;EC/CA,cxBwGgE;EInG9D,yBJmG8D;EwBtGhE,qBxBsGgE;AlBo4JlE;;A0Cx+JE;EACE,yBAAqC;A1C2+JzC;;A0Cx+JE;EACE,cAA0B;A1C2+J9B;;A2Cn/JE;EACE;IAAO,2BAAuC;E3Cu/JhD;E2Ct/JE;IAAK,wBAAwB;E3Cy/J/B;AACF;;A2C5/JE;EACE;IAAO,2BAAuC;E3Cu/JhD;E2Ct/JE;IAAK,wBAAwB;E3Cy/J/B;AACF;;A2Ct/JA;EACE,aAAa;EACb,YxCg+BsC;EwC/9BtC,gBAAgB;EAChB,cAAc;EvCmHV,kBAtCY;EuC3EhB,yBxCLgB;EOSd,sBP6NgC;AHyxJpC;;A2Cr/JA;EACE,aAAa;EACb,sBAAsB;EACtB,uBAAuB;EACvB,gBAAgB;EAChB,WxCjBa;EwCkBb,kBAAkB;EAClB,mBAAmB;EACnB,yBxCQe;EiBnBX,2BjBk+B4C;AHkiIlD;;AoBhgKM;EuBDN;IvBEQ,gBAAgB;EpBogKtB;AACF;;A2C3/JA;ErBYE,qMAA6I;EqBV7I,0BxCy8BsC;AHqjIxC;;A2C1/JE;EACE,0DAA8D;EAA9D,kDAA8D;A3C6/JlE;;A2C1/JM;EAJJ;IAKM,uBAAe;IAAf,eAAe;E3C8/JrB;AACF;;A4CziKA;EACE,aAAa;EACb,uBAAuB;A5C4iKzB;;A4CziKA;EACE,OAAO;A5C4iKT;;A6C9iKA;EACE,aAAa;EACb,sBAAsB;EAGtB,eAAe;EACf,gBAAgB;EnCQd,sBP6NgC;AH20JpC;;A6CtiKA;EACE,WAAW;EACX,c1CRgB;E0CShB,mBAAmB;A7CyiKrB;;AKhjKE;EwCWE,UAAU;EACV,c1Cdc;E0Ced,qBAAqB;EACrB,yB1CtBc;AH+jKlB;;A6CnjKA;EAcI,c1ClBc;E0CmBd,yB1C1Bc;AHmkKlB;;A6ChiKA;EACE,kBAAkB;EAClB,cAAc;EACd,wB1C+8ByC;E0C58BzC,sB1C3Ca;E0C4Cb,sC1ClCa;AHmkKf;;A6CxiKA;EnCjBI,+BmC2BkC;EnC1BlC,gCmC0BkC;A7CmiKtC;;A6C7iKA;EnCHI,mCmCiBqC;EnChBrC,kCmCgBqC;A7CoiKzC;;A6CljKA;EAmBI,c1ClDc;E0CmDd,oBAAoB;EACpB,sB1C1DW;AH6lKf;;A6CxjKA;EA0BI,UAAU;EACV,W1ChEW;E0CiEX,yB1CrCa;E0CsCb,qB1CtCa;AHwkKjB;;A6C/jKA;EAiCI,mBAAmB;A7CkiKvB;;A6CnkKA;EAoCM,gB1C4J2B;E0C3J3B,qB1C2J2B;AHw4JjC;;A6CrhKI;EACE,mBAAmB;A7CwhKzB;;A6CzhKI;EnCtBA,kCPsKgC;EOlLhC,0BmCwCwC;A7CwhK5C;;A6C9hKI;EnClCA,gCPkLgC;EOtKhC,4BmCiC0C;A7CwhK9C;;A6CniKI;EAeM,aAAa;A7CwhKvB;;A6CviKI;EAmBM,qB1C0HuB;E0CzHvB,oBAAoB;A7CwhK9B;;A6C5iKI;EAuBQ,iB1CsHqB;E0CrHrB,sB1CqHqB;AHo6JjC;;AcplKI;E+BmCA;IACE,mBAAmB;E7CqjKvB;E6CtjKE;InCtBA,kCPsKgC;IOlLhC,0BmCwCwC;E7CojK1C;E6C1jKE;InClCA,gCPkLgC;IOtKhC,4BmCiC0C;E7CmjK5C;E6C9jKE;IAeM,aAAa;E7CkjKrB;E6CjkKE;IAmBM,qB1C0HuB;I0CzHvB,oBAAoB;E7CijK5B;E6CrkKE;IAuBQ,iB1CsHqB;I0CrHrB,sB1CqHqB;EH47J/B;AACF;;Ac7mKI;E+BmCA;IACE,mBAAmB;E7C8kKvB;E6C/kKE;InCtBA,kCPsKgC;IOlLhC,0BmCwCwC;E7C6kK1C;E6CnlKE;InClCA,gCPkLgC;IOtKhC,4BmCiC0C;E7C4kK5C;E6CvlKE;IAeM,aAAa;E7C2kKrB;E6C1lKE;IAmBM,qB1C0HuB;I0CzHvB,oBAAoB;E7C0kK5B;E6C9lKE;IAuBQ,iB1CsHqB;I0CrHrB,sB1CqHqB;EHq9J/B;AACF;;ActoKI;E+BmCA;IACE,mBAAmB;E7CumKvB;E6CxmKE;InCtBA,kCPsKgC;IOlLhC,0BmCwCwC;E7CsmK1C;E6C5mKE;InClCA,gCPkLgC;IOtKhC,4BmCiC0C;E7CqmK5C;E6ChnKE;IAeM,aAAa;E7ComKrB;E6CnnKE;IAmBM,qB1C0HuB;I0CzHvB,oBAAoB;E7CmmK5B;E6CvnKE;IAuBQ,iB1CsHqB;I0CrHrB,sB1CqHqB;EH8+J/B;AACF;;Ac/pKI;E+BmCA;IACE,mBAAmB;E7CgoKvB;E6CjoKE;InCtBA,kCPsKgC;IOlLhC,0BmCwCwC;E7C+nK1C;E6CroKE;InClCA,gCPkLgC;IOtKhC,4BmCiC0C;E7C8nK5C;E6CzoKE;IAeM,aAAa;E7C6nKrB;E6C5oKE;IAmBM,qB1C0HuB;I0CzHvB,oBAAoB;E7C4nK5B;E6ChpKE;IAuBQ,iB1CsHqB;I0CrHrB,sB1CqHqB;EHugK/B;AACF;;A6C/mKA;EnCnHI,gBmCoHsB;A7CknK1B;;A6CnnKA;EAII,qB1CmG6B;AHghKjC;;A6CvnKA;EAOM,sBAAsB;A7ConK5B;;A8C7vKE;EACE,c5BqG8D;E4BpG9D,yB5BoG8D;AlB4pKlE;;AKrvKE;EyCPM,c5BgG0D;E4B/F1D,yBAAyC;A9CgwKjD;;A8CvwKE;EAWM,W3CPO;E2CQP,yB5B0F0D;E4BzF1D,qB5ByF0D;AlBuqKlE;;A8C7wKE;EACE,c5BqG8D;E4BpG9D,yB5BoG8D;AlB4qKlE;;AKrwKE;EyCPM,c5BgG0D;E4B/F1D,yBAAyC;A9CgxKjD;;A8CvxKE;EAWM,W3CPO;E2CQP,yB5B0F0D;E4BzF1D,qB5ByF0D;AlBurKlE;;A8C7xKE;EACE,c5BqG8D;E4BpG9D,yB5BoG8D;AlB4rKlE;;AKrxKE;EyCPM,c5BgG0D;E4B/F1D,yBAAyC;A9CgyKjD;;A8CvyKE;EAWM,W3CPO;E2CQP,yB5B0F0D;E4BzF1D,qB5ByF0D;AlBusKlE;;A8C7yKE;EACE,c5BqG8D;E4BpG9D,yB5BoG8D;AlB4sKlE;;AKryKE;EyCPM,c5BgG0D;E4B/F1D,yBAAyC;A9CgzKjD;;A8CvzKE;EAWM,W3CPO;E2CQP,yB5B0F0D;E4BzF1D,qB5ByF0D;AlButKlE;;A8C7zKE;EACE,c5BqG8D;E4BpG9D,yB5BoG8D;AlB4tKlE;;AKrzKE;EyCPM,c5BgG0D;E4B/F1D,yBAAyC;A9Cg0KjD;;A8Cv0KE;EAWM,W3CPO;E2CQP,yB5B0F0D;E4BzF1D,qB5ByF0D;AlBuuKlE;;A8C70KE;EACE,c5BqG8D;E4BpG9D,yB5BoG8D;AlB4uKlE;;AKr0KE;EyCPM,c5BgG0D;E4B/F1D,yBAAyC;A9Cg1KjD;;A8Cv1KE;EAWM,W3CPO;E2CQP,yB5B0F0D;E4BzF1D,qB5ByF0D;AlBuvKlE;;A8C71KE;EACE,c5BqG8D;E4BpG9D,yB5BoG8D;AlB4vKlE;;AKr1KE;EyCPM,c5BgG0D;E4B/F1D,yBAAyC;A9Cg2KjD;;A8Cv2KE;EAWM,W3CPO;E2CQP,yB5B0F0D;E4BzF1D,qB5ByF0D;AlBuwKlE;;A8C72KE;EACE,c5BqG8D;E4BpG9D,yB5BoG8D;AlB4wKlE;;AKr2KE;EyCPM,c5BgG0D;E4B/F1D,yBAAyC;A9Cg3KjD;;A8Cv3KE;EAWM,W3CPO;E2CQP,yB5B0F0D;E4BzF1D,qB5ByF0D;AlBuxKlE;;A+Ch4KA;EACE,YAAY;E3C8HR,iBAtCY;E2CtFhB,gB5C6R+B;E4C5R/B,cAAc;EACd,W5CYa;E4CXb,yB5CCa;E4CAb,WAAW;A/Cm4Kb;;AK93KE;E0CDE,W5CMW;E4CLX,qBAAqB;A/Cm4KzB;;AK/3KE;E0CCI,YAAY;A/Ck4KlB;;A+Cv3KA;EACE,UAAU;EACV,6BAA6B;EAC7B,SAAS;A/C03KX;;A+Cp3KA;EACE,oBAAoB;A/Cu3KtB;;AgD75KA;EAGE,iB7Cy4BuC;E6Cx4BvC,gB7Cw4BuC;EC7wBnC,mBAtCY;E4ClFhB,2C7CAa;E6CCb,4BAA4B;EAC5B,oC7C04BmD;E6Cz4BnD,gD7COa;E6CNb,UAAU;EtCOR,sBPk4BsC;AHqhJ1C;;AgDz6KA;EAeI,sB7C83BsC;AHgiJ1C;;AgD76KA;EAmBI,UAAU;AhD85Kd;;AgDj7KA;EAuBI,cAAc;EACd,UAAU;AhD85Kd;;AgDt7KA;EA4BI,aAAa;AhD85KjB;;AgD15KA;EACE,aAAa;EACb,mBAAmB;EACnB,wB7C02BwC;E6Cz2BxC,c7CvBgB;E6CwBhB,2C7C9Ba;E6C+Bb,4BAA4B;EAC5B,4C7Ck3BoD;EO93BlD,2CQmH4D;ERlH5D,4CQkH4D;AlBwzKhE;;AgD35KA;EACE,gB7Ci2BwC;AH6jJ1C;;AiDp8KA;EAEE,gBAAgB;AjDs8KlB;;AiDx8KA;EAKI,kBAAkB;EAClB,gBAAgB;AjDu8KpB;;AiDl8KA;EACE,eAAe;EACf,MAAM;EACN,OAAO;EACP,a9C2pBsC;E8C1pBtC,aAAa;EACb,WAAW;EACX,YAAY;EACZ,gBAAgB;EAGhB,UAAU;AjDm8KZ;;AiD57KA;EACE,kBAAkB;EAClB,WAAW;EACX,c9C+4BuC;E8C74BvC,oBAAoB;AjD87KtB;;AiD37KE;E7B3BI,mCjBo8BoD;E8Cv6BtD,8B9Cq6BmD;AHyhJvD;;AoBv9KM;E6BuBJ;I7BtBM,gBAAgB;EpB29KtB;AACF;;AiDl8KE;EACE,e9Cm6BoC;AHkiJxC;;AiDj8KE;EACE,sB9Cg6B2C;AHoiJ/C;;AiDh8KA;EACE,aAAa;EACb,6B/BmF8D;AlBg3KhE;;AiDr8KA;EAKI,8B/BgF4D;E+B/E5D,gBAAgB;AjDo8KpB;;AiD18KA;;EAWI,cAAc;AjDo8KlB;;AiD/8KA;EAeI,gBAAgB;AjDo8KpB;;AiDh8KA;EACE,aAAa;EACb,mBAAmB;EACnB,6B/B+D8D;AlBo4KhE;;AiDt8KA;EAOI,cAAc;EACd,0B/B0D4D;E+BzD5D,2BAAmB;EAAnB,wBAAmB;EAAnB,mBAAmB;EACnB,WAAW;AjDm8Kf;;AiD78KA;EAeI,sBAAsB;EACtB,uBAAuB;EACvB,YAAY;AjDk8KhB;;AiDn9KA;EAoBM,gBAAgB;AjDm8KtB;;AiDv9KA;EAwBM,aAAa;AjDm8KnB;;AiD77KA;EACE,kBAAkB;EAClB,aAAa;EACb,sBAAsB;EACtB,WAAW;EAGX,oBAAoB;EACpB,sB9C3Ga;E8C4Gb,4BAA4B;EAC5B,oC9CnGa;EOCX,qBP8N+B;E8CxHjC,UAAU;AjD47KZ;;AiDx7KA;EACE,eAAe;EACf,MAAM;EACN,OAAO;EACP,a9C+iBsC;E8C9iBtC,YAAY;EACZ,aAAa;EACb,sB9ClHa;AH6iLf;;AiDl8KA;EAUW,UAAU;AjD47KrB;;AiDt8KA;EAWW,Y9C6zB2B;AHkoJtC;;AiD17KA;EACE,aAAa;EACb,uBAAuB;EACvB,8BAA8B;EAC9B,kB9C0zBsC;E8CzzBtC,gC9CvIgB;EOiBd,0CQmH4D;ERlH5D,2CQkH4D;AlBk8KhE;;AiDp8KA;EASI,kB9CqzBoC;E8CnzBpC,8BAA6F;AjD87KjG;;AiDz7KA;EACE,gBAAgB;EAChB,gB9CsI+B;AHszKjC;;AiDv7KA;EACE,kBAAkB;EAGlB,cAAc;EACd,a9CwwBsC;AHgrJxC;;AiDp7KA;EACE,aAAa;EACb,eAAe;EACf,mBAAmB;EACnB,yBAAyB;EACzB,gBAAgE;EAChE,6B9CxKgB;EO+Bd,8CQqG4D;ERpG5D,6CQoG4D;AlB69KhE;;AiD/7KA;EAaI,eAAwC;AjDs7K5C;;AiDj7KA;EACE,kBAAkB;EAClB,YAAY;EACZ,WAAW;EACX,YAAY;EACZ,gBAAgB;AjDo7KlB;;Ac3jLI;EmCzBJ;IAuKI,gB9CqwBqC;I8CpwBrC,oBAAyC;EjDk7K3C;EiDpkLF;IAsJI,+B/BjE4D;ElBk/K9D;EiDvkLF;IAyJM,gC/BpE0D;ElBq/K9D;EiDvjLF;IA2II,+B/BzE4D;ElBw/K9D;EiD1jLF;IA8IM,4B/B5E0D;I+B6E1D,2BAAmB;IAAnB,wBAAmB;IAAnB,mBAAmB;EjD+6KvB;EiDv6KA;IAAY,gB9C6uB2B;EH6rJvC;AACF;;AcllLI;EmC2KF;;IAEE,gB9CquBqC;EHssJvC;AACF;;AczlLI;EmCkLF;IAAY,iB9C+tB4B;EH6sJxC;AACF;;AkD1pLA;EACE,kBAAkB;EAClB,a/C+qBsC;E+C9qBtC,cAAc;EACd,S/C21BmC;EgD/1BnC,qNhDmRoO;EgDjRpO,kBAAkB;EAClB,gBhD2R+B;EgD1R/B,gBhD+R+B;EgD9R/B,gBAAgB;EAChB,iBAAiB;EACjB,qBAAqB;EACrB,iBAAiB;EACjB,oBAAoB;EACpB,sBAAsB;EACtB,kBAAkB;EAClB,oBAAoB;EACpB,mBAAmB;EACnB,gBAAgB;E/CgHZ,mBAtCY;E8C9EhB,qBAAqB;EACrB,UAAU;AlDuqLZ;;AkDlrLA;EAaW,Y/C+0B2B;AH01JtC;;AkDtrLA;EAgBI,kBAAkB;EAClB,cAAc;EACd,a/C+0BqC;E+C90BrC,c/C+0BqC;AH21JzC;;AkD7rLA;EAsBM,kBAAkB;EAClB,WAAW;EACX,yBAAyB;EACzB,mBAAmB;AlD2qLzB;;AkDtqLA;EACE,iBAAgC;AlDyqLlC;;AkD1qLA;EAII,SAAS;AlD0qLb;;AkD9qLA;EAOM,MAAM;EACN,6BAAgE;EAChE,sB/CvBS;AHksLf;;AkDtqLA;EACE,iB/CqzBuC;AHo3JzC;;AkD1qLA;EAII,OAAO;EACP,a/CizBqC;E+ChzBrC,c/C+yBqC;AH23JzC;;AkDhrLA;EASM,QAAQ;EACR,oCAA2F;EAC3F,wB/CvCS;AHktLf;;AkDtqLA;EACE,iBAAgC;AlDyqLlC;;AkD1qLA;EAII,MAAM;AlD0qLV;;AkD9qLA;EAOM,SAAS;EACT,6B/C8xBmC;E+C7xBnC,yB/CrDS;AHguLf;;AkDtqLA;EACE,iB/CuxBuC;AHk5JzC;;AkD1qLA;EAII,QAAQ;EACR,a/CmxBqC;E+ClxBrC,c/CixBqC;AHy5JzC;;AkDhrLA;EASM,OAAO;EACP,oC/C8wBmC;E+C7wBnC,uB/CrES;AHgvLf;;AkDtpLA;EACE,gB/C6uBuC;E+C5uBvC,uB/CkvBuC;E+CjvBvC,W/CvGa;E+CwGb,kBAAkB;EAClB,sB/C/Fa;EOCX,sBP6NgC;AH2hLpC;;AoD1wLA;EACE,kBAAkB;EAClB,MAAM;EACN,OAAO;EACP,ajD6qBsC;EiD5qBtC,cAAc;EACd,gBjD62BuC;EgDl3BvC,qNhDmRoO;EgDjRpO,kBAAkB;EAClB,gBhD2R+B;EgD1R/B,gBhD+R+B;EgD9R/B,gBAAgB;EAChB,iBAAiB;EACjB,qBAAqB;EACrB,iBAAiB;EACjB,oBAAoB;EACpB,sBAAsB;EACtB,kBAAkB;EAClB,oBAAoB;EACpB,mBAAmB;EACnB,gBAAgB;E/CgHZ,mBAtCY;EgD7EhB,qBAAqB;EACrB,sBjDNa;EiDOb,4BAA4B;EAC5B,oCjDEa;EOCX,qBP8N+B;AHujLnC;;AoDvyLA;EAoBI,kBAAkB;EAClB,cAAc;EACd,WjD62BoC;EiD52BpC,cjD62BqC;EiD52BrC,gBjDwN+B;AH+jLnC;;AoD/yLA;EA4BM,kBAAkB;EAClB,cAAc;EACd,WAAW;EACX,yBAAyB;EACzB,mBAAmB;ApDuxLzB;;AoDlxLA;EACE,qBjD81BuC;AHu7JzC;;AoDtxLA;EAII,2BlCqG4D;AlBirLhE;;AoD1xLA;EAOM,SAAS;EACT,6BAAgE;EAChE,qCjDy1BiE;AH87JvE;;AoDhyLA;EAaM,WjD0L2B;EiDzL3B,6BAAgE;EAChE,sBjD7CS;AHo0Lf;;AoDlxLA;EACE,mBjD00BuC;AH28JzC;;AoDtxLA;EAII,yBlCiF4D;EkChF5D,ajDs0BqC;EiDr0BrC,YjDo0BoC;EiDn0BpC,gBAAgC;ApDsxLpC;;AoD7xLA;EAUM,OAAO;EACP,oCAA2F;EAC3F,uCjDk0BiE;AHq9JvE;;AoDnyLA;EAgBM,SjDmK2B;EiDlK3B,oCAA2F;EAC3F,wBjDpES;AH21Lf;;AoDlxLA;EACE,kBjDmzBuC;AHk+JzC;;AoDtxLA;EAII,wBlC0D4D;AlB4tLhE;;AoD1xLA;EAOM,MAAM;EACN,oCAA2F;EAC3F,wCjD8yBiE;AHy+JvE;;AoDhyLA;EAaM,QjD+I2B;EiD9I3B,oCAA2F;EAC3F,yBjDxFS;AH+2Lf;;AoDtyLA;EAqBI,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,cAAc;EACd,WjD0xBoC;EiDzxBpC,oBAAsC;EACtC,WAAW;EACX,gCjD8wBuD;AHugK3D;;AoDjxLA;EACE,oBjDmxBuC;AHigKzC;;AoDrxLA;EAII,0BlC0B4D;EkCzB5D,ajD+wBqC;EiD9wBrC,YjD6wBoC;EiD5wBpC,gBAAgC;ApDqxLpC;;AoD5xLA;EAUM,QAAQ;EACR,oCjDywBmC;EiDxwBnC,sCjD2wBiE;AH2gKvE;;AoDlyLA;EAgBM,UjD4G2B;EiD3G3B,oCjDmwBmC;EiDlwBnC,uBjD3HS;AHi5Lf;;AoDhwLA;EACE,uBjDouBwC;EiDnuBxC,gBAAgB;EhD3BZ,eAtCY;EgDoEhB,yBjD6tByD;EiD5tBzD,gCAAyE;E1CnIvE,0CQmH4D;ERlH5D,2CQkH4D;AlBoxLhE;;AoD1wLA;EAUI,aAAa;ApDowLjB;;AoDhwLA;EACE,uBjDstBwC;EiDrtBxC,cjDxJgB;AH25LlB;;AqD95LA;EACE,kBAAkB;ArDi6LpB;;AqD95LA;EACE,mBAAmB;ArDi6LrB;;AqD95LA;EACE,kBAAkB;EAClB,WAAW;EACX,gBAAgB;ArDi6LlB;;AsDx7LE;EACE,cAAc;EACd,WAAW;EACX,WAAW;AtD27Lf;;AqDn6LA;EACE,kBAAkB;EAClB,aAAa;EACb,WAAW;EACX,WAAW;EACX,mBAAmB;EACnB,mCAA2B;EAA3B,2BAA2B;EjClBvB,sCjByjCkF;AHg4JxF;;AoBr7LM;EiCQN;IjCPQ,gBAAgB;EpBy7LtB;AACF;;AqDz6LA;;;EAGE,cAAc;ArD46LhB;;AqDz6LA;;EAEE,2BAA2B;ArD46L7B;;AqDz6LA;;EAEE,4BAA4B;ArD46L9B;;AqDp6LA;EAEI,UAAU;EACV,4BAA4B;EAC5B,eAAe;ArDs6LnB;;AqD16LA;;;EAUI,UAAU;EACV,UAAU;ArDs6Ld;;AqDj7LA;;EAgBI,UAAU;EACV,UAAU;EjC5DR,2BjBwjCkC;AH26JxC;;AoB/9LM;EiCuCN;;IjCtCQ,gBAAgB;EpBo+LtB;AACF;;AqDp6LA;;EAEE,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,UAAU;EAEV,aAAa;EACb,mBAAmB;EACnB,uBAAuB;EACvB,UlDo9BsC;EkDn9BtC,WlD1Fa;EkD2Fb,kBAAkB;EAClB,YlDk9BqC;EiBriCjC,8BjBuiCgD;AHm9JtD;;AoBt/LM;EiCkEN;;IjCjEQ,gBAAgB;EpB2/LtB;AACF;;AKjgME;;;EgDwFE,WlDjGW;EkDkGX,qBAAqB;EACrB,UAAU;EACV,YlD28BmC;AHo+JvC;;AqD56LA;EACE,OAAO;ArD+6LT;;AqD16LA;EACE,QAAQ;ArD66LV;;AqDt6LA;;EAEE,qBAAqB;EACrB,WlDo8BuC;EkDn8BvC,YlDm8BuC;EkDl8BvC,qCAAqC;ArDy6LvC;;AqDv6LA;EACE,sNnCvEgF;AlBi/LlF;;AqDx6LA;EACE,uNnC1EgF;AlBq/LlF;;AqDl6LA;EACE,kBAAkB;EAClB,QAAQ;EACR,SAAS;EACT,OAAO;EACP,WAAW;EACX,aAAa;EACb,uBAAuB;EACvB,eAAe;EAEf,iBlD05BsC;EkDz5BtC,gBlDy5BsC;EkDx5BtC,gBAAgB;ArDo6LlB;;AqDh7LA;EAeI,uBAAuB;EACvB,cAAc;EACd,WlDw5BqC;EkDv5BrC,WlDw5BoC;EkDv5BpC,iBlDy5BoC;EkDx5BpC,gBlDw5BoC;EkDv5BpC,mBAAmB;EACnB,eAAe;EACf,sBlDhKW;EkDiKX,4BAA4B;EAE5B,kCAAiE;EACjE,qCAAoE;EACpE,WAAW;EjC5JT,6BjB8iC+C;AHmhKrD;;AoB7jMM;EiC4HN;IjC3HQ,gBAAgB;EpBikMtB;AACF;;AqDv8LA;EAiCI,UAAU;ArD06Ld;;AqDj6LA;EACE,kBAAkB;EAClB,UAA2C;EAC3C,YAAY;EACZ,SAA0C;EAC1C,WAAW;EACX,iBAAiB;EACjB,oBAAoB;EACpB,WlD3La;EkD4Lb,kBAAkB;ArDo6LpB;;AuDnmMA;EACE;IAAK,yBAAyB;EvDumM9B;AACF;;AuDzmMA;EACE;IAAK,yBAAyB;EvDumM9B;AACF;;AuDrmMA;EACE,qBAAqB;EACrB,WpDokC0B;EoDnkC1B,YpDmkC0B;EoDlkC1B,2BAA2B;EAC3B,iCAAgD;EAChD,+BAA+B;EAE/B,kBAAkB;EAClB,sDAA8C;EAA9C,8CAA8C;AvDumMhD;;AuDpmMA;EACE,WpD6jC4B;EoD5jC5B,YpD4jC4B;EoD3jC5B,mBpD6jC4B;AH0iK9B;;AuDhmMA;EACE;IACE,mBAAmB;EvDmmMrB;EuDjmMA;IACE,UAAU;IACV,eAAe;EvDmmMjB;AACF;;AuD1mMA;EACE;IACE,mBAAmB;EvDmmMrB;EuDjmMA;IACE,UAAU;IACV,eAAe;EvDmmMjB;AACF;;AuDhmMA;EACE,qBAAqB;EACrB,WpDoiC0B;EoDniC1B,YpDmiC0B;EoDliC1B,2BAA2B;EAC3B,8BAA8B;EAE9B,kBAAkB;EAClB,UAAU;EACV,oDAA4C;EAA5C,4CAA4C;AvDkmM9C;;AuD/lMA;EACE,WpD6hC4B;EoD5hC5B,YpD4hC4B;AHskK9B;;AuD9lME;EACE;;IAEE,gCAAwB;IAAxB,wBAAwB;EvDimM5B;AACF;;AwD7pMA;EAAqB,mCAAmC;AxDiqMxD;;AwDhqMA;EAAqB,8BAA8B;AxDoqMnD;;AwDnqMA;EAAqB,iCAAiC;AxDuqMtD;;AwDtqMA;EAAqB,iCAAiC;AxD0qMtD;;AwDzqMA;EAAqB,sCAAsC;AxD6qM3D;;AwD5qMA;EAAqB,mCAAmC;AxDgrMxD;;AyDlrME;EACE,oCAAmC;AzDqrMvC;;AK3qME;;;EoDLI,oCAAgD;AzDsrMtD;;AyD5rME;EACE,oCAAmC;AzD+rMvC;;AKrrME;;;EoDLI,oCAAgD;AzDgsMtD;;AyDtsME;EACE,oCAAmC;AzDysMvC;;AK/rME;;;EoDLI,oCAAgD;AzD0sMtD;;AyDhtME;EACE,oCAAmC;AzDmtMvC;;AKzsME;;;EoDLI,oCAAgD;AzDotMtD;;AyD1tME;EACE,oCAAmC;AzD6tMvC;;AKntME;;;EoDLI,oCAAgD;AzD8tMtD;;AyDpuME;EACE,oCAAmC;AzDuuMvC;;AK7tME;;;EoDLI,oCAAgD;AzDwuMtD;;AyD9uME;EACE,oCAAmC;AzDivMvC;;AKvuME;;;EoDLI,oCAAgD;AzDkvMtD;;AyDxvME;EACE,oCAAmC;AzD2vMvC;;AKjvME;;;EoDLI,oCAAgD;AzD4vMtD;;A0D3vMA;EACE,iCAAmC;A1D8vMrC;;A0D3vMA;EACE,wCAAwC;A1D8vM1C;;A2DzwMA;EAAkB,oCAAoD;A3D6wMtE;;A2D5wMA;EAAkB,wCAAwD;A3DgxM1E;;A2D/wMA;EAAkB,0CAA0D;A3DmxM5E;;A2DlxMA;EAAkB,2CAA2D;A3DsxM7E;;A2DrxMA;EAAkB,yCAAyD;A3DyxM3E;;A2DvxMA;EAAmB,oBAAoB;A3D2xMvC;;A2D1xMA;EAAmB,wBAAwB;A3D8xM3C;;A2D7xMA;EAAmB,0BAA0B;A3DiyM7C;;A2DhyMA;EAAmB,2BAA2B;A3DoyM9C;;A2DnyMA;EAAmB,yBAAyB;A3DuyM5C;;A2DpyME;EACE,gCAA+B;A3DuyMnC;;A2DxyME;EACE,gCAA+B;A3D2yMnC;;A2D5yME;EACE,gCAA+B;A3D+yMnC;;A2DhzME;EACE,gCAA+B;A3DmzMnC;;A2DpzME;EACE,gCAA+B;A3DuzMnC;;A2DxzME;EACE,gCAA+B;A3D2zMnC;;A2D5zME;EACE,gCAA+B;A3D+zMnC;;A2Dh0ME;EACE,gCAA+B;A3Dm0MnC;;A2D/zMA;EACE,6BAA+B;A3Dk0MjC;;A2D3zMA;EACE,gCAA2C;A3D8zM7C;;A2D3zMA;EACE,iCAAwC;A3D8zM1C;;A2D3zMA;EACE,0CAAiD;EACjD,2CAAkD;A3D8zMpD;;A2D3zMA;EACE,2CAAkD;EAClD,8CAAqD;A3D8zMvD;;A2D3zMA;EACE,8CAAqD;EACrD,6CAAoD;A3D8zMtD;;A2D3zMA;EACE,0CAAiD;EACjD,6CAAoD;A3D8zMtD;;A2D3zMA;EACE,gCAA2C;A3D8zM7C;;A2D3zMA;EACE,6BAA6B;A3D8zM/B;;A2D3zMA;EACE,+BAAuC;A3D8zMzC;;A2D3zMA;EACE,2BAA2B;A3D8zM7B;;AsDt4ME;EACE,cAAc;EACd,WAAW;EACX,WAAW;AtDy4Mf;;A4Dl4MM;EAAwB,wBAA0B;A5Ds4MxD;;A4Dt4MM;EAAwB,0BAA0B;A5D04MxD;;A4D14MM;EAAwB,gCAA0B;A5D84MxD;;A4D94MM;EAAwB,yBAA0B;A5Dk5MxD;;A4Dl5MM;EAAwB,yBAA0B;A5Ds5MxD;;A4Dt5MM;EAAwB,6BAA0B;A5D05MxD;;A4D15MM;EAAwB,8BAA0B;A5D85MxD;;A4D95MM;EAAwB,wBAA0B;A5Dk6MxD;;A4Dl6MM;EAAwB,+BAA0B;A5Ds6MxD;;Acr3MI;E8CjDE;IAAwB,wBAA0B;E5D26MtD;E4D36MI;IAAwB,0BAA0B;E5D86MtD;E4D96MI;IAAwB,gCAA0B;E5Di7MtD;E4Dj7MI;IAAwB,yBAA0B;E5Do7MtD;E4Dp7MI;IAAwB,yBAA0B;E5Du7MtD;E4Dv7MI;IAAwB,6BAA0B;E5D07MtD;E4D17MI;IAAwB,8BAA0B;E5D67MtD;E4D77MI;IAAwB,wBAA0B;E5Dg8MtD;E4Dh8MI;IAAwB,+BAA0B;E5Dm8MtD;AACF;;Acn5MI;E8CjDE;IAAwB,wBAA0B;E5Dy8MtD;E4Dz8MI;IAAwB,0BAA0B;E5D48MtD;E4D58MI;IAAwB,gCAA0B;E5D+8MtD;E4D/8MI;IAAwB,yBAA0B;E5Dk9MtD;E4Dl9MI;IAAwB,yBAA0B;E5Dq9MtD;E4Dr9MI;IAAwB,6BAA0B;E5Dw9MtD;E4Dx9MI;IAAwB,8BAA0B;E5D29MtD;E4D39MI;IAAwB,wBAA0B;E5D89MtD;E4D99MI;IAAwB,+BAA0B;E5Di+MtD;AACF;;Acj7MI;E8CjDE;IAAwB,wBAA0B;E5Du+MtD;E4Dv+MI;IAAwB,0BAA0B;E5D0+MtD;E4D1+MI;IAAwB,gCAA0B;E5D6+MtD;E4D7+MI;IAAwB,yBAA0B;E5Dg/MtD;E4Dh/MI;IAAwB,yBAA0B;E5Dm/MtD;E4Dn/MI;IAAwB,6BAA0B;E5Ds/MtD;E4Dt/MI;IAAwB,8BAA0B;E5Dy/MtD;E4Dz/MI;IAAwB,wBAA0B;E5D4/MtD;E4D5/MI;IAAwB,+BAA0B;E5D+/MtD;AACF;;Ac/8MI;E8CjDE;IAAwB,wBAA0B;E5DqgNtD;E4DrgNI;IAAwB,0BAA0B;E5DwgNtD;E4DxgNI;IAAwB,gCAA0B;E5D2gNtD;E4D3gNI;IAAwB,yBAA0B;E5D8gNtD;E4D9gNI;IAAwB,yBAA0B;E5DihNtD;E4DjhNI;IAAwB,6BAA0B;E5DohNtD;E4DphNI;IAAwB,8BAA0B;E5DuhNtD;E4DvhNI;IAAwB,wBAA0B;E5D0hNtD;E4D1hNI;IAAwB,+BAA0B;E5D6hNtD;AACF;;A4DphNA;EAEI;IAAqB,wBAA0B;E5DuhNjD;E4DvhNE;IAAqB,0BAA0B;E5D0hNjD;E4D1hNE;IAAqB,gCAA0B;E5D6hNjD;E4D7hNE;IAAqB,yBAA0B;E5DgiNjD;E4DhiNE;IAAqB,yBAA0B;E5DmiNjD;E4DniNE;IAAqB,6BAA0B;E5DsiNjD;E4DtiNE;IAAqB,8BAA0B;E5DyiNjD;E4DziNE;IAAqB,wBAA0B;E5D4iNjD;E4D5iNE;IAAqB,+BAA0B;E5D+iNjD;AACF;;A6DrkNA;EACE,kBAAkB;EAClB,cAAc;EACd,WAAW;EACX,UAAU;EACV,gBAAgB;A7DwkNlB;;A6D7kNA;EAQI,cAAc;EACd,WAAW;A7DykNf;;A6DllNA;;;;;EAiBI,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;EACP,WAAW;EACX,YAAY;EACZ,SAAS;A7DykNb;;A6DjkNE;EAEI,uBAA4F;A7DmkNlG;;A6DrkNE;EAEI,mBAA4F;A7DukNlG;;A6DzkNE;EAEI,gBAA4F;A7D2kNlG;;A6D7kNE;EAEI,iBAA4F;A7D+kNlG;;A8DxmNI;EAAgC,8BAA8B;A9D4mNlE;;A8D3mNI;EAAgC,iCAAiC;A9D+mNrE;;A8D9mNI;EAAgC,sCAAsC;A9DknN1E;;A8DjnNI;EAAgC,yCAAyC;A9DqnN7E;;A8DnnNI;EAA8B,0BAA0B;A9DunN5D;;A8DtnNI;EAA8B,4BAA4B;A9D0nN9D;;A8DznNI;EAA8B,kCAAkC;A9D6nNpE;;A8D5nNI;EAA8B,yBAAyB;A9DgoN3D;;A8D/nNI;EAA8B,uBAAuB;A9DmoNzD;;A8DloNI;EAA8B,uBAAuB;A9DsoNzD;;A8DroNI;EAA8B,yBAAyB;A9DyoN3D;;A8DxoNI;EAA8B,yBAAyB;A9D4oN3D;;A8D1oNI;EAAoC,sCAAsC;A9D8oN9E;;A8D7oNI;EAAoC,oCAAoC;A9DipN5E;;A8DhpNI;EAAoC,kCAAkC;A9DopN1E;;A8DnpNI;EAAoC,yCAAyC;A9DupNjF;;A8DtpNI;EAAoC,wCAAwC;A9D0pNhF;;A8DxpNI;EAAiC,kCAAkC;A9D4pNvE;;A8D3pNI;EAAiC,gCAAgC;A9D+pNrE;;A8D9pNI;EAAiC,8BAA8B;A9DkqNnE;;A8DjqNI;EAAiC,gCAAgC;A9DqqNrE;;A8DpqNI;EAAiC,+BAA+B;A9DwqNpE;;A8DtqNI;EAAkC,oCAAoC;A9D0qN1E;;A8DzqNI;EAAkC,kCAAkC;A9D6qNxE;;A8D5qNI;EAAkC,gCAAgC;A9DgrNtE;;A8D/qNI;EAAkC,uCAAuC;A9DmrN7E;;A8DlrNI;EAAkC,sCAAsC;A9DsrN5E;;A8DrrNI;EAAkC,iCAAiC;A9DyrNvE;;A8DvrNI;EAAgC,2BAA2B;A9D2rN/D;;A8D1rNI;EAAgC,iCAAiC;A9D8rNrE;;A8D7rNI;EAAgC,+BAA+B;A9DisNnE;;A8DhsNI;EAAgC,6BAA6B;A9DosNjE;;A8DnsNI;EAAgC,+BAA+B;A9DusNnE;;A8DtsNI;EAAgC,8BAA8B;A9D0sNlE;;Ac9rNI;EgDlDA;IAAgC,8BAA8B;E9DqvNhE;E8DpvNE;IAAgC,iCAAiC;E9DuvNnE;E8DtvNE;IAAgC,sCAAsC;E9DyvNxE;E8DxvNE;IAAgC,yCAAyC;E9D2vN3E;E8DzvNE;IAA8B,0BAA0B;E9D4vN1D;E8D3vNE;IAA8B,4BAA4B;E9D8vN5D;E8D7vNE;IAA8B,kCAAkC;E9DgwNlE;E8D/vNE;IAA8B,yBAAyB;E9DkwNzD;E8DjwNE;IAA8B,uBAAuB;E9DowNvD;E8DnwNE;IAA8B,uBAAuB;E9DswNvD;E8DrwNE;IAA8B,yBAAyB;E9DwwNzD;E8DvwNE;IAA8B,yBAAyB;E9D0wNzD;E8DxwNE;IAAoC,sCAAsC;E9D2wN5E;E8D1wNE;IAAoC,oCAAoC;E9D6wN1E;E8D5wNE;IAAoC,kCAAkC;E9D+wNxE;E8D9wNE;IAAoC,yCAAyC;E9DixN/E;E8DhxNE;IAAoC,wCAAwC;E9DmxN9E;E8DjxNE;IAAiC,kCAAkC;E9DoxNrE;E8DnxNE;IAAiC,gCAAgC;E9DsxNnE;E8DrxNE;IAAiC,8BAA8B;E9DwxNjE;E8DvxNE;IAAiC,gCAAgC;E9D0xNnE;E8DzxNE;IAAiC,+BAA+B;E9D4xNlE;E8D1xNE;IAAkC,oCAAoC;E9D6xNxE;E8D5xNE;IAAkC,kCAAkC;E9D+xNtE;E8D9xNE;IAAkC,gCAAgC;E9DiyNpE;E8DhyNE;IAAkC,uCAAuC;E9DmyN3E;E8DlyNE;IAAkC,sCAAsC;E9DqyN1E;E8DpyNE;IAAkC,iCAAiC;E9DuyNrE;E8DryNE;IAAgC,2BAA2B;E9DwyN7D;E8DvyNE;IAAgC,iCAAiC;E9D0yNnE;E8DzyNE;IAAgC,+BAA+B;E9D4yNjE;E8D3yNE;IAAgC,6BAA6B;E9D8yN/D;E8D7yNE;IAAgC,+BAA+B;E9DgzNjE;E8D/yNE;IAAgC,8BAA8B;E9DkzNhE;AACF;;AcvyNI;EgDlDA;IAAgC,8BAA8B;E9D81NhE;E8D71NE;IAAgC,iCAAiC;E9Dg2NnE;E8D/1NE;IAAgC,sCAAsC;E9Dk2NxE;E8Dj2NE;IAAgC,yCAAyC;E9Do2N3E;E8Dl2NE;IAA8B,0BAA0B;E9Dq2N1D;E8Dp2NE;IAA8B,4BAA4B;E9Du2N5D;E8Dt2NE;IAA8B,kCAAkC;E9Dy2NlE;E8Dx2NE;IAA8B,yBAAyB;E9D22NzD;E8D12NE;IAA8B,uBAAuB;E9D62NvD;E8D52NE;IAA8B,uBAAuB;E9D+2NvD;E8D92NE;IAA8B,yBAAyB;E9Di3NzD;E8Dh3NE;IAA8B,yBAAyB;E9Dm3NzD;E8Dj3NE;IAAoC,sCAAsC;E9Do3N5E;E8Dn3NE;IAAoC,oCAAoC;E9Ds3N1E;E8Dr3NE;IAAoC,kCAAkC;E9Dw3NxE;E8Dv3NE;IAAoC,yCAAyC;E9D03N/E;E8Dz3NE;IAAoC,wCAAwC;E9D43N9E;E8D13NE;IAAiC,kCAAkC;E9D63NrE;E8D53NE;IAAiC,gCAAgC;E9D+3NnE;E8D93NE;IAAiC,8BAA8B;E9Di4NjE;E8Dh4NE;IAAiC,gCAAgC;E9Dm4NnE;E8Dl4NE;IAAiC,+BAA+B;E9Dq4NlE;E8Dn4NE;IAAkC,oCAAoC;E9Ds4NxE;E8Dr4NE;IAAkC,kCAAkC;E9Dw4NtE;E8Dv4NE;IAAkC,gCAAgC;E9D04NpE;E8Dz4NE;IAAkC,uCAAuC;E9D44N3E;E8D34NE;IAAkC,sCAAsC;E9D84N1E;E8D74NE;IAAkC,iCAAiC;E9Dg5NrE;E8D94NE;IAAgC,2BAA2B;E9Di5N7D;E8Dh5NE;IAAgC,iCAAiC;E9Dm5NnE;E8Dl5NE;IAAgC,+BAA+B;E9Dq5NjE;E8Dp5NE;IAAgC,6BAA6B;E9Du5N/D;E8Dt5NE;IAAgC,+BAA+B;E9Dy5NjE;E8Dx5NE;IAAgC,8BAA8B;E9D25NhE;AACF;;Ach5NI;EgDlDA;IAAgC,8BAA8B;E9Du8NhE;E8Dt8NE;IAAgC,iCAAiC;E9Dy8NnE;E8Dx8NE;IAAgC,sCAAsC;E9D28NxE;E8D18NE;IAAgC,yCAAyC;E9D68N3E;E8D38NE;IAA8B,0BAA0B;E9D88N1D;E8D78NE;IAA8B,4BAA4B;E9Dg9N5D;E8D/8NE;IAA8B,kCAAkC;E9Dk9NlE;E8Dj9NE;IAA8B,yBAAyB;E9Do9NzD;E8Dn9NE;IAA8B,uBAAuB;E9Ds9NvD;E8Dr9NE;IAA8B,uBAAuB;E9Dw9NvD;E8Dv9NE;IAA8B,yBAAyB;E9D09NzD;E8Dz9NE;IAA8B,yBAAyB;E9D49NzD;E8D19NE;IAAoC,sCAAsC;E9D69N5E;E8D59NE;IAAoC,oCAAoC;E9D+9N1E;E8D99NE;IAAoC,kCAAkC;E9Di+NxE;E8Dh+NE;IAAoC,yCAAyC;E9Dm+N/E;E8Dl+NE;IAAoC,wCAAwC;E9Dq+N9E;E8Dn+NE;IAAiC,kCAAkC;E9Ds+NrE;E8Dr+NE;IAAiC,gCAAgC;E9Dw+NnE;E8Dv+NE;IAAiC,8BAA8B;E9D0+NjE;E8Dz+NE;IAAiC,gCAAgC;E9D4+NnE;E8D3+NE;IAAiC,+BAA+B;E9D8+NlE;E8D5+NE;IAAkC,oCAAoC;E9D++NxE;E8D9+NE;IAAkC,kCAAkC;E9Di/NtE;E8Dh/NE;IAAkC,gCAAgC;E9Dm/NpE;E8Dl/NE;IAAkC,uCAAuC;E9Dq/N3E;E8Dp/NE;IAAkC,sCAAsC;E9Du/N1E;E8Dt/NE;IAAkC,iCAAiC;E9Dy/NrE;E8Dv/NE;IAAgC,2BAA2B;E9D0/N7D;E8Dz/NE;IAAgC,iCAAiC;E9D4/NnE;E8D3/NE;IAAgC,+BAA+B;E9D8/NjE;E8D7/NE;IAAgC,6BAA6B;E9DggO/D;E8D//NE;IAAgC,+BAA+B;E9DkgOjE;E8DjgOE;IAAgC,8BAA8B;E9DogOhE;AACF;;Acz/NI;EgDlDA;IAAgC,8BAA8B;E9DgjOhE;E8D/iOE;IAAgC,iCAAiC;E9DkjOnE;E8DjjOE;IAAgC,sCAAsC;E9DojOxE;E8DnjOE;IAAgC,yCAAyC;E9DsjO3E;E8DpjOE;IAA8B,0BAA0B;E9DujO1D;E8DtjOE;IAA8B,4BAA4B;E9DyjO5D;E8DxjOE;IAA8B,kCAAkC;E9D2jOlE;E8D1jOE;IAA8B,yBAAyB;E9D6jOzD;E8D5jOE;IAA8B,uBAAuB;E9D+jOvD;E8D9jOE;IAA8B,uBAAuB;E9DikOvD;E8DhkOE;IAA8B,yBAAyB;E9DmkOzD;E8DlkOE;IAA8B,yBAAyB;E9DqkOzD;E8DnkOE;IAAoC,sCAAsC;E9DskO5E;E8DrkOE;IAAoC,oCAAoC;E9DwkO1E;E8DvkOE;IAAoC,kCAAkC;E9D0kOxE;E8DzkOE;IAAoC,yCAAyC;E9D4kO/E;E8D3kOE;IAAoC,wCAAwC;E9D8kO9E;E8D5kOE;IAAiC,kCAAkC;E9D+kOrE;E8D9kOE;IAAiC,gCAAgC;E9DilOnE;E8DhlOE;IAAiC,8BAA8B;E9DmlOjE;E8DllOE;IAAiC,gCAAgC;E9DqlOnE;E8DplOE;IAAiC,+BAA+B;E9DulOlE;E8DrlOE;IAAkC,oCAAoC;E9DwlOxE;E8DvlOE;IAAkC,kCAAkC;E9D0lOtE;E8DzlOE;IAAkC,gCAAgC;E9D4lOpE;E8D3lOE;IAAkC,uCAAuC;E9D8lO3E;E8D7lOE;IAAkC,sCAAsC;E9DgmO1E;E8D/lOE;IAAkC,iCAAiC;E9DkmOrE;E8DhmOE;IAAgC,2BAA2B;E9DmmO7D;E8DlmOE;IAAgC,iCAAiC;E9DqmOnE;E8DpmOE;IAAgC,+BAA+B;E9DumOjE;E8DtmOE;IAAgC,6BAA6B;E9DymO/D;E8DxmOE;IAAgC,+BAA+B;E9D2mOjE;E8D1mOE;IAAgC,8BAA8B;E9D6mOhE;AACF;;A+DxpOI;EAAwB,sBAAsB;A/D4pOlD;;A+D3pOI;EAAwB,uBAAuB;A/D+pOnD;;A+D9pOI;EAAwB,sBAAsB;A/DkqOlD;;Ac9mOI;EiDtDA;IAAwB,sBAAsB;E/DyqOhD;E+DxqOE;IAAwB,uBAAuB;E/D2qOjD;E+D1qOE;IAAwB,sBAAsB;E/D6qOhD;AACF;;Ac1nOI;EiDtDA;IAAwB,sBAAsB;E/DqrOhD;E+DprOE;IAAwB,uBAAuB;E/DurOjD;E+DtrOE;IAAwB,sBAAsB;E/DyrOhD;AACF;;ActoOI;EiDtDA;IAAwB,sBAAsB;E/DisOhD;E+DhsOE;IAAwB,uBAAuB;E/DmsOjD;E+DlsOE;IAAwB,sBAAsB;E/DqsOhD;AACF;;AclpOI;EiDtDA;IAAwB,sBAAsB;E/D6sOhD;E+D5sOE;IAAwB,uBAAuB;E/D+sOjD;E+D9sOE;IAAwB,sBAAsB;E/DitOhD;AACF;;AgEvtOE;EAAyB,mCAA8B;EAA9B,gCAA8B;EAA9B,2BAA8B;AhE2tOzD;;AgE3tOE;EAAyB,oCAA8B;EAA9B,iCAA8B;EAA9B,gCAA8B;EAA9B,4BAA8B;AhE+tOzD;;AgE/tOE;EAAyB,oCAA8B;EAA9B,iCAA8B;EAA9B,gCAA8B;EAA9B,4BAA8B;AhEmuOzD;;AiEnuOE;EAAsB,yBAA2B;AjEuuOnD;;AiEvuOE;EAAsB,2BAA2B;AjE2uOnD;;AkE1uOE;EAAyB,2BAA8B;AlE8uOzD;;AkE9uOE;EAAyB,6BAA8B;AlEkvOzD;;AkElvOE;EAAyB,6BAA8B;AlEsvOzD;;AkEtvOE;EAAyB,0BAA8B;AlE0vOzD;;AkE1vOE;EAAyB,mCAA8B;EAA9B,2BAA8B;AlE8vOzD;;AkEzvOA;EACE,eAAe;EACf,MAAM;EACN,QAAQ;EACR,OAAO;EACP,a/DgqBsC;AH4lNxC;;AkEzvOA;EACE,eAAe;EACf,QAAQ;EACR,SAAS;EACT,OAAO;EACP,a/DwpBsC;AHomNxC;;AkExvO8B;EAD9B;IAEI,wBAAgB;IAAhB,gBAAgB;IAChB,MAAM;IACN,a/DgpBoC;EH4mNtC;AACF;;AmEtxOA;ECEE,kBAAkB;EAClB,UAAU;EACV,WAAW;EACX,UAAU;EACV,YAAY;EACZ,gBAAgB;EAChB,sBAAsB;EACtB,mBAAmB;EACnB,SAAS;ApEwxOX;;AoE9wOE;EAEE,gBAAgB;EAChB,WAAW;EACX,YAAY;EACZ,iBAAiB;EACjB,UAAU;EACV,mBAAmB;ApEgxOvB;;AqE7yOA;EAAa,8DAAqC;ArEizOlD;;AqEhzOA;EAAU,wDAAkC;ArEozO5C;;AqEnzOA;EAAa,uDAAqC;ArEuzOlD;;AqEtzOA;EAAe,2BAA2B;ArE0zO1C;;AsEzzOI;EAAuB,qBAA4B;AtE6zOvD;;AsE7zOI;EAAuB,qBAA4B;AtEi0OvD;;AsEj0OI;EAAuB,qBAA4B;AtEq0OvD;;AsEr0OI;EAAuB,sBAA4B;AtEy0OvD;;AsEz0OI;EAAuB,sBAA4B;AtE60OvD;;AsE70OI;EAAuB,sBAA4B;AtEi1OvD;;AsEj1OI;EAAuB,sBAA4B;AtEq1OvD;;AsEr1OI;EAAuB,sBAA4B;AtEy1OvD;;AsEz1OI;EAAuB,uBAA4B;AtE61OvD;;AsE71OI;EAAuB,uBAA4B;AtEi2OvD;;AsE71OA;EAAU,0BAA0B;AtEi2OpC;;AsEh2OA;EAAU,2BAA2B;AtEo2OrC;;AsEh2OA;EAAc,2BAA2B;AtEo2OzC;;AsEn2OA;EAAc,4BAA4B;AtEu2O1C;;AsEr2OA;EAAU,uBAAuB;AtEy2OjC;;AsEx2OA;EAAU,wBAAwB;AtE42OlC;;AuEr3OQ;EAAgC,oBAA4B;AvEy3OpE;;AuEx3OQ;;EAEE,wBAAoC;AvE23O9C;;AuEz3OQ;;EAEE,0BAAwC;AvE43OlD;;AuE13OQ;;EAEE,2BAA0C;AvE63OpD;;AuE33OQ;;EAEE,yBAAsC;AvE83OhD;;AuE74OQ;EAAgC,0BAA4B;AvEi5OpE;;AuEh5OQ;;EAEE,8BAAoC;AvEm5O9C;;AuEj5OQ;;EAEE,gCAAwC;AvEo5OlD;;AuEl5OQ;;EAEE,iCAA0C;AvEq5OpD;;AuEn5OQ;;EAEE,+BAAsC;AvEs5OhD;;AuEr6OQ;EAAgC,yBAA4B;AvEy6OpE;;AuEx6OQ;;EAEE,6BAAoC;AvE26O9C;;AuEz6OQ;;EAEE,+BAAwC;AvE46OlD;;AuE16OQ;;EAEE,gCAA0C;AvE66OpD;;AuE36OQ;;EAEE,8BAAsC;AvE86OhD;;AuE77OQ;EAAgC,uBAA4B;AvEi8OpE;;AuEh8OQ;;EAEE,2BAAoC;AvEm8O9C;;AuEj8OQ;;EAEE,6BAAwC;AvEo8OlD;;AuEl8OQ;;EAEE,8BAA0C;AvEq8OpD;;AuEn8OQ;;EAEE,4BAAsC;AvEs8OhD;;AuEr9OQ;EAAgC,yBAA4B;AvEy9OpE;;AuEx9OQ;;EAEE,6BAAoC;AvE29O9C;;AuEz9OQ;;EAEE,+BAAwC;AvE49OlD;;AuE19OQ;;EAEE,gCAA0C;AvE69OpD;;AuE39OQ;;EAEE,8BAAsC;AvE89OhD;;AuE7+OQ;EAAgC,uBAA4B;AvEi/OpE;;AuEh/OQ;;EAEE,2BAAoC;AvEm/O9C;;AuEj/OQ;;EAEE,6BAAwC;AvEo/OlD;;AuEl/OQ;;EAEE,8BAA0C;AvEq/OpD;;AuEn/OQ;;EAEE,4BAAsC;AvEs/OhD;;AuErgPQ;EAAgC,qBAA4B;AvEygPpE;;AuExgPQ;;EAEE,yBAAoC;AvE2gP9C;;AuEzgPQ;;EAEE,2BAAwC;AvE4gPlD;;AuE1gPQ;;EAEE,4BAA0C;AvE6gPpD;;AuE3gPQ;;EAEE,0BAAsC;AvE8gPhD;;AuE7hPQ;EAAgC,2BAA4B;AvEiiPpE;;AuEhiPQ;;EAEE,+BAAoC;AvEmiP9C;;AuEjiPQ;;EAEE,iCAAwC;AvEoiPlD;;AuEliPQ;;EAEE,kCAA0C;AvEqiPpD;;AuEniPQ;;EAEE,gCAAsC;AvEsiPhD;;AuErjPQ;EAAgC,0BAA4B;AvEyjPpE;;AuExjPQ;;EAEE,8BAAoC;AvE2jP9C;;AuEzjPQ;;EAEE,gCAAwC;AvE4jPlD;;AuE1jPQ;;EAEE,iCAA0C;AvE6jPpD;;AuE3jPQ;;EAEE,+BAAsC;AvE8jPhD;;AuE7kPQ;EAAgC,wBAA4B;AvEilPpE;;AuEhlPQ;;EAEE,4BAAoC;AvEmlP9C;;AuEjlPQ;;EAEE,8BAAwC;AvEolPlD;;AuEllPQ;;EAEE,+BAA0C;AvEqlPpD;;AuEnlPQ;;EAEE,6BAAsC;AvEslPhD;;AuErmPQ;EAAgC,0BAA4B;AvEymPpE;;AuExmPQ;;EAEE,8BAAoC;AvE2mP9C;;AuEzmPQ;;EAEE,gCAAwC;AvE4mPlD;;AuE1mPQ;;EAEE,iCAA0C;AvE6mPpD;;AuE3mPQ;;EAEE,+BAAsC;AvE8mPhD;;AuE7nPQ;EAAgC,wBAA4B;AvEioPpE;;AuEhoPQ;;EAEE,4BAAoC;AvEmoP9C;;AuEjoPQ;;EAEE,8BAAwC;AvEooPlD;;AuEloPQ;;EAEE,+BAA0C;AvEqoPpD;;AuEnoPQ;;EAEE,6BAAsC;AvEsoPhD;;AuE9nPQ;EAAwB,2BAA2B;AvEkoP3D;;AuEjoPQ;;EAEE,+BAA+B;AvEooPzC;;AuEloPQ;;EAEE,iCAAiC;AvEqoP3C;;AuEnoPQ;;EAEE,kCAAkC;AvEsoP5C;;AuEpoPQ;;EAEE,gCAAgC;AvEuoP1C;;AuEtpPQ;EAAwB,0BAA2B;AvE0pP3D;;AuEzpPQ;;EAEE,8BAA+B;AvE4pPzC;;AuE1pPQ;;EAEE,gCAAiC;AvE6pP3C;;AuE3pPQ;;EAEE,iCAAkC;AvE8pP5C;;AuE5pPQ;;EAEE,+BAAgC;AvE+pP1C;;AuE9qPQ;EAAwB,wBAA2B;AvEkrP3D;;AuEjrPQ;;EAEE,4BAA+B;AvEorPzC;;AuElrPQ;;EAEE,8BAAiC;AvEqrP3C;;AuEnrPQ;;EAEE,+BAAkC;AvEsrP5C;;AuEprPQ;;EAEE,6BAAgC;AvEurP1C;;AuEtsPQ;EAAwB,0BAA2B;AvE0sP3D;;AuEzsPQ;;EAEE,8BAA+B;AvE4sPzC;;AuE1sPQ;;EAEE,gCAAiC;AvE6sP3C;;AuE3sPQ;;EAEE,iCAAkC;AvE8sP5C;;AuE5sPQ;;EAEE,+BAAgC;AvE+sP1C;;AuE9tPQ;EAAwB,wBAA2B;AvEkuP3D;;AuEjuPQ;;EAEE,4BAA+B;AvEouPzC;;AuEluPQ;;EAEE,8BAAiC;AvEquP3C;;AuEnuPQ;;EAEE,+BAAkC;AvEsuP5C;;AuEpuPQ;;EAEE,6BAAgC;AvEuuP1C;;AuEjuPI;EAAmB,uBAAuB;AvEquP9C;;AuEpuPI;;EAEE,2BAA2B;AvEuuPjC;;AuEruPI;;EAEE,6BAA6B;AvEwuPnC;;AuEtuPI;;EAEE,8BAA8B;AvEyuPpC;;AuEvuPI;;EAEE,4BAA4B;AvE0uPlC;;AcnvPI;EyDlDI;IAAgC,oBAA4B;EvE0yPlE;EuEzyPM;;IAEE,wBAAoC;EvE2yP5C;EuEzyPM;;IAEE,0BAAwC;EvE2yPhD;EuEzyPM;;IAEE,2BAA0C;EvE2yPlD;EuEzyPM;;IAEE,yBAAsC;EvE2yP9C;EuE1zPM;IAAgC,0BAA4B;EvE6zPlE;EuE5zPM;;IAEE,8BAAoC;EvE8zP5C;EuE5zPM;;IAEE,gCAAwC;EvE8zPhD;EuE5zPM;;IAEE,iCAA0C;EvE8zPlD;EuE5zPM;;IAEE,+BAAsC;EvE8zP9C;EuE70PM;IAAgC,yBAA4B;EvEg1PlE;EuE/0PM;;IAEE,6BAAoC;EvEi1P5C;EuE/0PM;;IAEE,+BAAwC;EvEi1PhD;EuE/0PM;;IAEE,gCAA0C;EvEi1PlD;EuE/0PM;;IAEE,8BAAsC;EvEi1P9C;EuEh2PM;IAAgC,uBAA4B;EvEm2PlE;EuEl2PM;;IAEE,2BAAoC;EvEo2P5C;EuEl2PM;;IAEE,6BAAwC;EvEo2PhD;EuEl2PM;;IAEE,8BAA0C;EvEo2PlD;EuEl2PM;;IAEE,4BAAsC;EvEo2P9C;EuEn3PM;IAAgC,yBAA4B;EvEs3PlE;EuEr3PM;;IAEE,6BAAoC;EvEu3P5C;EuEr3PM;;IAEE,+BAAwC;EvEu3PhD;EuEr3PM;;IAEE,gCAA0C;EvEu3PlD;EuEr3PM;;IAEE,8BAAsC;EvEu3P9C;EuEt4PM;IAAgC,uBAA4B;EvEy4PlE;EuEx4PM;;IAEE,2BAAoC;EvE04P5C;EuEx4PM;;IAEE,6BAAwC;EvE04PhD;EuEx4PM;;IAEE,8BAA0C;EvE04PlD;EuEx4PM;;IAEE,4BAAsC;EvE04P9C;EuEz5PM;IAAgC,qBAA4B;EvE45PlE;EuE35PM;;IAEE,yBAAoC;EvE65P5C;EuE35PM;;IAEE,2BAAwC;EvE65PhD;EuE35PM;;IAEE,4BAA0C;EvE65PlD;EuE35PM;;IAEE,0BAAsC;EvE65P9C;EuE56PM;IAAgC,2BAA4B;EvE+6PlE;EuE96PM;;IAEE,+BAAoC;EvEg7P5C;EuE96PM;;IAEE,iCAAwC;EvEg7PhD;EuE96PM;;IAEE,kCAA0C;EvEg7PlD;EuE96PM;;IAEE,gCAAsC;EvEg7P9C;EuE/7PM;IAAgC,0BAA4B;EvEk8PlE;EuEj8PM;;IAEE,8BAAoC;EvEm8P5C;EuEj8PM;;IAEE,gCAAwC;EvEm8PhD;EuEj8PM;;IAEE,iCAA0C;EvEm8PlD;EuEj8PM;;IAEE,+BAAsC;EvEm8P9C;EuEl9PM;IAAgC,wBAA4B;EvEq9PlE;EuEp9PM;;IAEE,4BAAoC;EvEs9P5C;EuEp9PM;;IAEE,8BAAwC;EvEs9PhD;EuEp9PM;;IAEE,+BAA0C;EvEs9PlD;EuEp9PM;;IAEE,6BAAsC;EvEs9P9C;EuEr+PM;IAAgC,0BAA4B;EvEw+PlE;EuEv+PM;;IAEE,8BAAoC;EvEy+P5C;EuEv+PM;;IAEE,gCAAwC;EvEy+PhD;EuEv+PM;;IAEE,iCAA0C;EvEy+PlD;EuEv+PM;;IAEE,+BAAsC;EvEy+P9C;EuEx/PM;IAAgC,wBAA4B;EvE2/PlE;EuE1/PM;;IAEE,4BAAoC;EvE4/P5C;EuE1/PM;;IAEE,8BAAwC;EvE4/PhD;EuE1/PM;;IAEE,+BAA0C;EvE4/PlD;EuE1/PM;;IAEE,6BAAsC;EvE4/P9C;EuEp/PM;IAAwB,2BAA2B;EvEu/PzD;EuEt/PM;;IAEE,+BAA+B;EvEw/PvC;EuEt/PM;;IAEE,iCAAiC;EvEw/PzC;EuEt/PM;;IAEE,kCAAkC;EvEw/P1C;EuEt/PM;;IAEE,gCAAgC;EvEw/PxC;EuEvgQM;IAAwB,0BAA2B;EvE0gQzD;EuEzgQM;;IAEE,8BAA+B;EvE2gQvC;EuEzgQM;;IAEE,gCAAiC;EvE2gQzC;EuEzgQM;;IAEE,iCAAkC;EvE2gQ1C;EuEzgQM;;IAEE,+BAAgC;EvE2gQxC;EuE1hQM;IAAwB,wBAA2B;EvE6hQzD;EuE5hQM;;IAEE,4BAA+B;EvE8hQvC;EuE5hQM;;IAEE,8BAAiC;EvE8hQzC;EuE5hQM;;IAEE,+BAAkC;EvE8hQ1C;EuE5hQM;;IAEE,6BAAgC;EvE8hQxC;EuE7iQM;IAAwB,0BAA2B;EvEgjQzD;EuE/iQM;;IAEE,8BAA+B;EvEijQvC;EuE/iQM;;IAEE,gCAAiC;EvEijQzC;EuE/iQM;;IAEE,iCAAkC;EvEijQ1C;EuE/iQM;;IAEE,+BAAgC;EvEijQxC;EuEhkQM;IAAwB,wBAA2B;EvEmkQzD;EuElkQM;;IAEE,4BAA+B;EvEokQvC;EuElkQM;;IAEE,8BAAiC;EvEokQzC;EuElkQM;;IAEE,+BAAkC;EvEokQ1C;EuElkQM;;IAEE,6BAAgC;EvEokQxC;EuE9jQE;IAAmB,uBAAuB;EvEikQ5C;EuEhkQE;;IAEE,2BAA2B;EvEkkQ/B;EuEhkQE;;IAEE,6BAA6B;EvEkkQjC;EuEhkQE;;IAEE,8BAA8B;EvEkkQlC;EuEhkQE;;IAEE,4BAA4B;EvEkkQhC;AACF;;Ac5kQI;EyDlDI;IAAgC,oBAA4B;EvEmoQlE;EuEloQM;;IAEE,wBAAoC;EvEooQ5C;EuEloQM;;IAEE,0BAAwC;EvEooQhD;EuEloQM;;IAEE,2BAA0C;EvEooQlD;EuEloQM;;IAEE,yBAAsC;EvEooQ9C;EuEnpQM;IAAgC,0BAA4B;EvEspQlE;EuErpQM;;IAEE,8BAAoC;EvEupQ5C;EuErpQM;;IAEE,gCAAwC;EvEupQhD;EuErpQM;;IAEE,iCAA0C;EvEupQlD;EuErpQM;;IAEE,+BAAsC;EvEupQ9C;EuEtqQM;IAAgC,yBAA4B;EvEyqQlE;EuExqQM;;IAEE,6BAAoC;EvE0qQ5C;EuExqQM;;IAEE,+BAAwC;EvE0qQhD;EuExqQM;;IAEE,gCAA0C;EvE0qQlD;EuExqQM;;IAEE,8BAAsC;EvE0qQ9C;EuEzrQM;IAAgC,uBAA4B;EvE4rQlE;EuE3rQM;;IAEE,2BAAoC;EvE6rQ5C;EuE3rQM;;IAEE,6BAAwC;EvE6rQhD;EuE3rQM;;IAEE,8BAA0C;EvE6rQlD;EuE3rQM;;IAEE,4BAAsC;EvE6rQ9C;EuE5sQM;IAAgC,yBAA4B;EvE+sQlE;EuE9sQM;;IAEE,6BAAoC;EvEgtQ5C;EuE9sQM;;IAEE,+BAAwC;EvEgtQhD;EuE9sQM;;IAEE,gCAA0C;EvEgtQlD;EuE9sQM;;IAEE,8BAAsC;EvEgtQ9C;EuE/tQM;IAAgC,uBAA4B;EvEkuQlE;EuEjuQM;;IAEE,2BAAoC;EvEmuQ5C;EuEjuQM;;IAEE,6BAAwC;EvEmuQhD;EuEjuQM;;IAEE,8BAA0C;EvEmuQlD;EuEjuQM;;IAEE,4BAAsC;EvEmuQ9C;EuElvQM;IAAgC,qBAA4B;EvEqvQlE;EuEpvQM;;IAEE,yBAAoC;EvEsvQ5C;EuEpvQM;;IAEE,2BAAwC;EvEsvQhD;EuEpvQM;;IAEE,4BAA0C;EvEsvQlD;EuEpvQM;;IAEE,0BAAsC;EvEsvQ9C;EuErwQM;IAAgC,2BAA4B;EvEwwQlE;EuEvwQM;;IAEE,+BAAoC;EvEywQ5C;EuEvwQM;;IAEE,iCAAwC;EvEywQhD;EuEvwQM;;IAEE,kCAA0C;EvEywQlD;EuEvwQM;;IAEE,gCAAsC;EvEywQ9C;EuExxQM;IAAgC,0BAA4B;EvE2xQlE;EuE1xQM;;IAEE,8BAAoC;EvE4xQ5C;EuE1xQM;;IAEE,gCAAwC;EvE4xQhD;EuE1xQM;;IAEE,iCAA0C;EvE4xQlD;EuE1xQM;;IAEE,+BAAsC;EvE4xQ9C;EuE3yQM;IAAgC,wBAA4B;EvE8yQlE;EuE7yQM;;IAEE,4BAAoC;EvE+yQ5C;EuE7yQM;;IAEE,8BAAwC;EvE+yQhD;EuE7yQM;;IAEE,+BAA0C;EvE+yQlD;EuE7yQM;;IAEE,6BAAsC;EvE+yQ9C;EuE9zQM;IAAgC,0BAA4B;EvEi0QlE;EuEh0QM;;IAEE,8BAAoC;EvEk0Q5C;EuEh0QM;;IAEE,gCAAwC;EvEk0QhD;EuEh0QM;;IAEE,iCAA0C;EvEk0QlD;EuEh0QM;;IAEE,+BAAsC;EvEk0Q9C;EuEj1QM;IAAgC,wBAA4B;EvEo1QlE;EuEn1QM;;IAEE,4BAAoC;EvEq1Q5C;EuEn1QM;;IAEE,8BAAwC;EvEq1QhD;EuEn1QM;;IAEE,+BAA0C;EvEq1QlD;EuEn1QM;;IAEE,6BAAsC;EvEq1Q9C;EuE70QM;IAAwB,2BAA2B;EvEg1QzD;EuE/0QM;;IAEE,+BAA+B;EvEi1QvC;EuE/0QM;;IAEE,iCAAiC;EvEi1QzC;EuE/0QM;;IAEE,kCAAkC;EvEi1Q1C;EuE/0QM;;IAEE,gCAAgC;EvEi1QxC;EuEh2QM;IAAwB,0BAA2B;EvEm2QzD;EuEl2QM;;IAEE,8BAA+B;EvEo2QvC;EuEl2QM;;IAEE,gCAAiC;EvEo2QzC;EuEl2QM;;IAEE,iCAAkC;EvEo2Q1C;EuEl2QM;;IAEE,+BAAgC;EvEo2QxC;EuEn3QM;IAAwB,wBAA2B;EvEs3QzD;EuEr3QM;;IAEE,4BAA+B;EvEu3QvC;EuEr3QM;;IAEE,8BAAiC;EvEu3QzC;EuEr3QM;;IAEE,+BAAkC;EvEu3Q1C;EuEr3QM;;IAEE,6BAAgC;EvEu3QxC;EuEt4QM;IAAwB,0BAA2B;EvEy4QzD;EuEx4QM;;IAEE,8BAA+B;EvE04QvC;EuEx4QM;;IAEE,gCAAiC;EvE04QzC;EuEx4QM;;IAEE,iCAAkC;EvE04Q1C;EuEx4QM;;IAEE,+BAAgC;EvE04QxC;EuEz5QM;IAAwB,wBAA2B;EvE45QzD;EuE35QM;;IAEE,4BAA+B;EvE65QvC;EuE35QM;;IAEE,8BAAiC;EvE65QzC;EuE35QM;;IAEE,+BAAkC;EvE65Q1C;EuE35QM;;IAEE,6BAAgC;EvE65QxC;EuEv5QE;IAAmB,uBAAuB;EvE05Q5C;EuEz5QE;;IAEE,2BAA2B;EvE25Q/B;EuEz5QE;;IAEE,6BAA6B;EvE25QjC;EuEz5QE;;IAEE,8BAA8B;EvE25QlC;EuEz5QE;;IAEE,4BAA4B;EvE25QhC;AACF;;Acr6QI;EyDlDI;IAAgC,oBAA4B;EvE49QlE;EuE39QM;;IAEE,wBAAoC;EvE69Q5C;EuE39QM;;IAEE,0BAAwC;EvE69QhD;EuE39QM;;IAEE,2BAA0C;EvE69QlD;EuE39QM;;IAEE,yBAAsC;EvE69Q9C;EuE5+QM;IAAgC,0BAA4B;EvE++QlE;EuE9+QM;;IAEE,8BAAoC;EvEg/Q5C;EuE9+QM;;IAEE,gCAAwC;EvEg/QhD;EuE9+QM;;IAEE,iCAA0C;EvEg/QlD;EuE9+QM;;IAEE,+BAAsC;EvEg/Q9C;EuE//QM;IAAgC,yBAA4B;EvEkgRlE;EuEjgRM;;IAEE,6BAAoC;EvEmgR5C;EuEjgRM;;IAEE,+BAAwC;EvEmgRhD;EuEjgRM;;IAEE,gCAA0C;EvEmgRlD;EuEjgRM;;IAEE,8BAAsC;EvEmgR9C;EuElhRM;IAAgC,uBAA4B;EvEqhRlE;EuEphRM;;IAEE,2BAAoC;EvEshR5C;EuEphRM;;IAEE,6BAAwC;EvEshRhD;EuEphRM;;IAEE,8BAA0C;EvEshRlD;EuEphRM;;IAEE,4BAAsC;EvEshR9C;EuEriRM;IAAgC,yBAA4B;EvEwiRlE;EuEviRM;;IAEE,6BAAoC;EvEyiR5C;EuEviRM;;IAEE,+BAAwC;EvEyiRhD;EuEviRM;;IAEE,gCAA0C;EvEyiRlD;EuEviRM;;IAEE,8BAAsC;EvEyiR9C;EuExjRM;IAAgC,uBAA4B;EvE2jRlE;EuE1jRM;;IAEE,2BAAoC;EvE4jR5C;EuE1jRM;;IAEE,6BAAwC;EvE4jRhD;EuE1jRM;;IAEE,8BAA0C;EvE4jRlD;EuE1jRM;;IAEE,4BAAsC;EvE4jR9C;EuE3kRM;IAAgC,qBAA4B;EvE8kRlE;EuE7kRM;;IAEE,yBAAoC;EvE+kR5C;EuE7kRM;;IAEE,2BAAwC;EvE+kRhD;EuE7kRM;;IAEE,4BAA0C;EvE+kRlD;EuE7kRM;;IAEE,0BAAsC;EvE+kR9C;EuE9lRM;IAAgC,2BAA4B;EvEimRlE;EuEhmRM;;IAEE,+BAAoC;EvEkmR5C;EuEhmRM;;IAEE,iCAAwC;EvEkmRhD;EuEhmRM;;IAEE,kCAA0C;EvEkmRlD;EuEhmRM;;IAEE,gCAAsC;EvEkmR9C;EuEjnRM;IAAgC,0BAA4B;EvEonRlE;EuEnnRM;;IAEE,8BAAoC;EvEqnR5C;EuEnnRM;;IAEE,gCAAwC;EvEqnRhD;EuEnnRM;;IAEE,iCAA0C;EvEqnRlD;EuEnnRM;;IAEE,+BAAsC;EvEqnR9C;EuEpoRM;IAAgC,wBAA4B;EvEuoRlE;EuEtoRM;;IAEE,4BAAoC;EvEwoR5C;EuEtoRM;;IAEE,8BAAwC;EvEwoRhD;EuEtoRM;;IAEE,+BAA0C;EvEwoRlD;EuEtoRM;;IAEE,6BAAsC;EvEwoR9C;EuEvpRM;IAAgC,0BAA4B;EvE0pRlE;EuEzpRM;;IAEE,8BAAoC;EvE2pR5C;EuEzpRM;;IAEE,gCAAwC;EvE2pRhD;EuEzpRM;;IAEE,iCAA0C;EvE2pRlD;EuEzpRM;;IAEE,+BAAsC;EvE2pR9C;EuE1qRM;IAAgC,wBAA4B;EvE6qRlE;EuE5qRM;;IAEE,4BAAoC;EvE8qR5C;EuE5qRM;;IAEE,8BAAwC;EvE8qRhD;EuE5qRM;;IAEE,+BAA0C;EvE8qRlD;EuE5qRM;;IAEE,6BAAsC;EvE8qR9C;EuEtqRM;IAAwB,2BAA2B;EvEyqRzD;EuExqRM;;IAEE,+BAA+B;EvE0qRvC;EuExqRM;;IAEE,iCAAiC;EvE0qRzC;EuExqRM;;IAEE,kCAAkC;EvE0qR1C;EuExqRM;;IAEE,gCAAgC;EvE0qRxC;EuEzrRM;IAAwB,0BAA2B;EvE4rRzD;EuE3rRM;;IAEE,8BAA+B;EvE6rRvC;EuE3rRM;;IAEE,gCAAiC;EvE6rRzC;EuE3rRM;;IAEE,iCAAkC;EvE6rR1C;EuE3rRM;;IAEE,+BAAgC;EvE6rRxC;EuE5sRM;IAAwB,wBAA2B;EvE+sRzD;EuE9sRM;;IAEE,4BAA+B;EvEgtRvC;EuE9sRM;;IAEE,8BAAiC;EvEgtRzC;EuE9sRM;;IAEE,+BAAkC;EvEgtR1C;EuE9sRM;;IAEE,6BAAgC;EvEgtRxC;EuE/tRM;IAAwB,0BAA2B;EvEkuRzD;EuEjuRM;;IAEE,8BAA+B;EvEmuRvC;EuEjuRM;;IAEE,gCAAiC;EvEmuRzC;EuEjuRM;;IAEE,iCAAkC;EvEmuR1C;EuEjuRM;;IAEE,+BAAgC;EvEmuRxC;EuElvRM;IAAwB,wBAA2B;EvEqvRzD;EuEpvRM;;IAEE,4BAA+B;EvEsvRvC;EuEpvRM;;IAEE,8BAAiC;EvEsvRzC;EuEpvRM;;IAEE,+BAAkC;EvEsvR1C;EuEpvRM;;IAEE,6BAAgC;EvEsvRxC;EuEhvRE;IAAmB,uBAAuB;EvEmvR5C;EuElvRE;;IAEE,2BAA2B;EvEovR/B;EuElvRE;;IAEE,6BAA6B;EvEovRjC;EuElvRE;;IAEE,8BAA8B;EvEovRlC;EuElvRE;;IAEE,4BAA4B;EvEovRhC;AACF;;Ac9vRI;EyDlDI;IAAgC,oBAA4B;EvEqzRlE;EuEpzRM;;IAEE,wBAAoC;EvEszR5C;EuEpzRM;;IAEE,0BAAwC;EvEszRhD;EuEpzRM;;IAEE,2BAA0C;EvEszRlD;EuEpzRM;;IAEE,yBAAsC;EvEszR9C;EuEr0RM;IAAgC,0BAA4B;EvEw0RlE;EuEv0RM;;IAEE,8BAAoC;EvEy0R5C;EuEv0RM;;IAEE,gCAAwC;EvEy0RhD;EuEv0RM;;IAEE,iCAA0C;EvEy0RlD;EuEv0RM;;IAEE,+BAAsC;EvEy0R9C;EuEx1RM;IAAgC,yBAA4B;EvE21RlE;EuE11RM;;IAEE,6BAAoC;EvE41R5C;EuE11RM;;IAEE,+BAAwC;EvE41RhD;EuE11RM;;IAEE,gCAA0C;EvE41RlD;EuE11RM;;IAEE,8BAAsC;EvE41R9C;EuE32RM;IAAgC,uBAA4B;EvE82RlE;EuE72RM;;IAEE,2BAAoC;EvE+2R5C;EuE72RM;;IAEE,6BAAwC;EvE+2RhD;EuE72RM;;IAEE,8BAA0C;EvE+2RlD;EuE72RM;;IAEE,4BAAsC;EvE+2R9C;EuE93RM;IAAgC,yBAA4B;EvEi4RlE;EuEh4RM;;IAEE,6BAAoC;EvEk4R5C;EuEh4RM;;IAEE,+BAAwC;EvEk4RhD;EuEh4RM;;IAEE,gCAA0C;EvEk4RlD;EuEh4RM;;IAEE,8BAAsC;EvEk4R9C;EuEj5RM;IAAgC,uBAA4B;EvEo5RlE;EuEn5RM;;IAEE,2BAAoC;EvEq5R5C;EuEn5RM;;IAEE,6BAAwC;EvEq5RhD;EuEn5RM;;IAEE,8BAA0C;EvEq5RlD;EuEn5RM;;IAEE,4BAAsC;EvEq5R9C;EuEp6RM;IAAgC,qBAA4B;EvEu6RlE;EuEt6RM;;IAEE,yBAAoC;EvEw6R5C;EuEt6RM;;IAEE,2BAAwC;EvEw6RhD;EuEt6RM;;IAEE,4BAA0C;EvEw6RlD;EuEt6RM;;IAEE,0BAAsC;EvEw6R9C;EuEv7RM;IAAgC,2BAA4B;EvE07RlE;EuEz7RM;;IAEE,+BAAoC;EvE27R5C;EuEz7RM;;IAEE,iCAAwC;EvE27RhD;EuEz7RM;;IAEE,kCAA0C;EvE27RlD;EuEz7RM;;IAEE,gCAAsC;EvE27R9C;EuE18RM;IAAgC,0BAA4B;EvE68RlE;EuE58RM;;IAEE,8BAAoC;EvE88R5C;EuE58RM;;IAEE,gCAAwC;EvE88RhD;EuE58RM;;IAEE,iCAA0C;EvE88RlD;EuE58RM;;IAEE,+BAAsC;EvE88R9C;EuE79RM;IAAgC,wBAA4B;EvEg+RlE;EuE/9RM;;IAEE,4BAAoC;EvEi+R5C;EuE/9RM;;IAEE,8BAAwC;EvEi+RhD;EuE/9RM;;IAEE,+BAA0C;EvEi+RlD;EuE/9RM;;IAEE,6BAAsC;EvEi+R9C;EuEh/RM;IAAgC,0BAA4B;EvEm/RlE;EuEl/RM;;IAEE,8BAAoC;EvEo/R5C;EuEl/RM;;IAEE,gCAAwC;EvEo/RhD;EuEl/RM;;IAEE,iCAA0C;EvEo/RlD;EuEl/RM;;IAEE,+BAAsC;EvEo/R9C;EuEngSM;IAAgC,wBAA4B;EvEsgSlE;EuErgSM;;IAEE,4BAAoC;EvEugS5C;EuErgSM;;IAEE,8BAAwC;EvEugShD;EuErgSM;;IAEE,+BAA0C;EvEugSlD;EuErgSM;;IAEE,6BAAsC;EvEugS9C;EuE//RM;IAAwB,2BAA2B;EvEkgSzD;EuEjgSM;;IAEE,+BAA+B;EvEmgSvC;EuEjgSM;;IAEE,iCAAiC;EvEmgSzC;EuEjgSM;;IAEE,kCAAkC;EvEmgS1C;EuEjgSM;;IAEE,gCAAgC;EvEmgSxC;EuElhSM;IAAwB,0BAA2B;EvEqhSzD;EuEphSM;;IAEE,8BAA+B;EvEshSvC;EuEphSM;;IAEE,gCAAiC;EvEshSzC;EuEphSM;;IAEE,iCAAkC;EvEshS1C;EuEphSM;;IAEE,+BAAgC;EvEshSxC;EuEriSM;IAAwB,wBAA2B;EvEwiSzD;EuEviSM;;IAEE,4BAA+B;EvEyiSvC;EuEviSM;;IAEE,8BAAiC;EvEyiSzC;EuEviSM;;IAEE,+BAAkC;EvEyiS1C;EuEviSM;;IAEE,6BAAgC;EvEyiSxC;EuExjSM;IAAwB,0BAA2B;EvE2jSzD;EuE1jSM;;IAEE,8BAA+B;EvE4jSvC;EuE1jSM;;IAEE,gCAAiC;EvE4jSzC;EuE1jSM;;IAEE,iCAAkC;EvE4jS1C;EuE1jSM;;IAEE,+BAAgC;EvE4jSxC;EuE3kSM;IAAwB,wBAA2B;EvE8kSzD;EuE7kSM;;IAEE,4BAA+B;EvE+kSvC;EuE7kSM;;IAEE,8BAAiC;EvE+kSzC;EuE7kSM;;IAEE,+BAAkC;EvE+kS1C;EuE7kSM;;IAEE,6BAAgC;EvE+kSxC;EuEzkSE;IAAmB,uBAAuB;EvE4kS5C;EuE3kSE;;IAEE,2BAA2B;EvE6kS/B;EuE3kSE;;IAEE,6BAA6B;EvE6kSjC;EuE3kSE;;IAEE,8BAA8B;EvE6kSlC;EuE3kSE;;IAEE,4BAA4B;EvE6kShC;AACF;;AwE/oSA;EAEI,kBAAkB;EAClB,MAAM;EACN,QAAQ;EACR,SAAS;EACT,OAAO;EACP,UAAU;EAEV,oBAAoB;EACpB,WAAW;EAEX,kCAAkC;AxE+oStC;;AyEzpSA;EAAkB,4GAA8C;AzE6pShE;;AyEzpSA;EAAiB,8BAA8B;AzE6pS/C;;AyE5pSA;EAAiB,8BAA8B;AzEgqS/C;;AyE/pSA;EAAiB,8BAA8B;AzEmqS/C;;AyElqSA;ECTE,gBAAgB;EAChB,uBAAuB;EACvB,mBAAmB;A1E+qSrB;;AyEhqSI;EAAwB,2BAA2B;AzEoqSvD;;AyEnqSI;EAAwB,4BAA4B;AzEuqSxD;;AyEtqSI;EAAwB,6BAA6B;AzE0qSzD;;AcroSI;E2DvCA;IAAwB,2BAA2B;EzEirSrD;EyEhrSE;IAAwB,4BAA4B;EzEmrStD;EyElrSE;IAAwB,6BAA6B;EzEqrSvD;AACF;;AcjpSI;E2DvCA;IAAwB,2BAA2B;EzE6rSrD;EyE5rSE;IAAwB,4BAA4B;EzE+rStD;EyE9rSE;IAAwB,6BAA6B;EzEisSvD;AACF;;Ac7pSI;E2DvCA;IAAwB,2BAA2B;EzEysSrD;EyExsSE;IAAwB,4BAA4B;EzE2sStD;EyE1sSE;IAAwB,6BAA6B;EzE6sSvD;AACF;;AczqSI;E2DvCA;IAAwB,2BAA2B;EzEqtSrD;EyEptSE;IAAwB,4BAA4B;EzEutStD;EyEttSE;IAAwB,6BAA6B;EzEytSvD;AACF;;AyEptSA;EAAmB,oCAAoC;AzEwtSvD;;AyEvtSA;EAAmB,oCAAoC;AzE2tSvD;;AyE1tSA;EAAmB,qCAAqC;AzE8tSxD;;AyE1tSA;EAAuB,2BAA0C;AzE8tSjE;;AyE7tSA;EAAuB,+BAA4C;AzEiuSnE;;AyEhuSA;EAAuB,2BAA2C;AzEouSlE;;AyEnuSA;EAAuB,2BAAyC;AzEuuShE;;AyEtuSA;EAAuB,8BAA2C;AzE0uSlE;;AyEzuSA;EAAuB,6BAA6B;AzE6uSpD;;AyEzuSA;EAAc,sBAAwB;AzE6uStC;;A2EpxSE;EACE,yBAAwB;A3EuxS5B;;AK7wSE;EsELM,yBAA0E;A3EsxSlF;;A2E5xSE;EACE,yBAAwB;A3E+xS5B;;AKrxSE;EsELM,yBAA0E;A3E8xSlF;;A2EpySE;EACE,yBAAwB;A3EuyS5B;;AK7xSE;EsELM,yBAA0E;A3EsySlF;;A2E5ySE;EACE,yBAAwB;A3E+yS5B;;AKrySE;EsELM,yBAA0E;A3E8ySlF;;A2EpzSE;EACE,yBAAwB;A3EuzS5B;;AK7ySE;EsELM,yBAA0E;A3EszSlF;;A2E5zSE;EACE,yBAAwB;A3E+zS5B;;AKrzSE;EsELM,yBAA0E;A3E8zSlF;;A2Ep0SE;EACE,yBAAwB;A3Eu0S5B;;AK7zSE;EsELM,yBAA0E;A3Es0SlF;;A2E50SE;EACE,yBAAwB;A3E+0S5B;;AKr0SE;EsELM,yBAA0E;A3E80SlF;;AyEvySA;EAAa,yBAA6B;AzE2yS1C;;AyE1ySA;EAAc,yBAA6B;AzE8yS3C;;AyE5ySA;EAAiB,oCAAkC;AzEgzSnD;;AyE/ySA;EAAiB,0CAAkC;AzEmzSnD;;AyE/ySA;EGvDE,WAAW;EACX,kBAAkB;EAClB,iBAAiB;EACjB,6BAA6B;EAC7B,SAAS;A5E02SX;;AyEnzSA;EAAwB,gCAAgC;AzEuzSxD;;AyErzSA;EACE,iCAAiC;EACjC,gCAAgC;AzEwzSlC;;AyEnzSA;EAAc,yBAAyB;AzEuzSvC;;A6Ex3SA;EACE,8BAA8B;A7E23ShC;;A6Ex3SA;EACE,6BAA6B;A7E23S/B;;A8E33SE;E5EOF;;;I4EDM,4BAA4B;IAE5B,2BAA2B;E9E23S/B;E8Ex3SE;IAEI,0BAA0B;E9Ey3ShC;E8Eh3SE;IACE,6BAA6B;E9Ek3SjC;EEprSF;I4E/KM,gCAAgC;E9Es2SpC;E8Ep2SE;;IAEE,yB3EzCY;I2E0CZ,wBAAwB;E9Es2S5B;E8E91SE;IACE,2BAA2B;E9Eg2S/B;E8E71SE;;IAEE,wBAAwB;E9E+1S5B;E8E51SE;;;IAGE,UAAU;IACV,SAAS;E9E81Sb;E8E31SE;;IAEE,uBAAuB;E9E61S3B;E8Er1SE;IACE,Q3E+hCgC;EHwzQpC;EEn4SF;I4E+CM,2BAA2C;E9Eu1S/C;E8Er1SE;IACE,2BAA2C;E9Eu1S/C;EiCr6SF;I6CmFM,aAAa;E9Eq1SjB;EsCp7SF;IwCkGM,sB3EtFS;EH26Sb;EgBx7SF;I8DuGM,oCAAoC;E9Eo1SxC;E8Er1SE;;IAKI,iCAAmC;E9Eo1SzC;EgBv5SF;;I8D0EQ,oCAAsC;E9Ei1S5C;EgBt0SF;I8DNM,cAAc;E9E+0SlB;EiBr8SA;;;;I6D4HM,qB3EvHU;EHs8ShB;EgBj2SF;I8DuBM,cAAc;IACd,qB3E7HY;EH08ShB;AACF;;A+Er9SA;;EAEE,iBAAiB;EACjB,cAAc;A/Ew9ShB;;A+E39SA;;EAMI,gBAAgB;A/E09SpB;;A+Eh+SA;;EAUI,YAAY;A/E29ShB;;A+Er+SA;;EAcI,qBAAqB;EACrB,iBAAiB;A/E49SrB;;A+E3+SA;;EAmBI,iBAAiB;A/E69SrB;;A+Eh/SA;;EAuBI,sBAAsB;EACtB,kBAAkB;A/E89StB;;A+Et/SA;;EA4BI,QAAQ;EACR,aAAa;EACb,iBAAiB;A/E+9SrB;;A+E7/SA;;EAkCI,sBAAsB;EACtB,qBAAqB;A/Eg+SzB;;A+EngTA;;;;EAwCI,oBAAoB;EACpB,kB5EmM6B;AH+xSjC;;A+E3gTA;;EA6CI,kCAAgD;A/Em+SpD;;A+EhhTA;;;;EAkDI,kC5E6LgC;AHwySpC;;A+EvhTA;;EAsDI,kC5EyLgC;AH6ySpC;;A+E5hTA;;EA0DI,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,iBAAiB;A/Eu+SrB;;A+EpiTA;;EAiEI,QAAQ;EACR,aAAa;A/Ew+SjB;;A+E1iTA;;EAsEI,cAAc;EACd,UAAU;EACV,gCAAgC;A/Ey+SpC;;A+EjjTA;;;;EA6EI,cAAc;EACd,aAAa;A/E2+SjB;;A+EzjTA;;EAkFI,0CAAiJ;EACjJ,+MAAqG;EACrG,yB5EkfwC;AH0/R5C;;A+EhkTA;;EAwFI,sBAA4D;EAC5D,qBAAqB;A/E6+SzB;;A+EtkTA;;EA6FQ,eAAsD;A/E8+S9D;;A+E3kTA;;EAiGQ,2BAAgH;A/E++SxH;;A+EhlTA;;EAuGQ,+BAA8E;A/E8+StF;;A+ErlTA;;;;;;;;;;;;EAkHI,kCAAgD;A/Ek/SpD;;A+EpmTA;;;;;;;;;;;;EA2HI,kC5EoHgC;AHo4SpC;;A+EnnTA;;;;EAgII,kC5E+GgC;AH24SpC;;A+E1nTA;;;;EAqII,kCAAgD;A/E4/SpD;;A+EjoTA;;;;EA0II,gBAAgB;A/E8/SpB;;A+ExoTA;;;;;;;;EAiJI,sBAAsB;EACtB,oBAAoB;A/EkgTxB;;A+EppTA;;EAuJM,qB5E84BmC;E4E74BnC,eAAe;EAOf,c5ElJY;E4EmJZ,Y5E44BuC;AHgnR7C;;A+E5pTA;;EA2JQ,gBAAgB;EAChB,oB5Ey4BiC;AH6nRzC;;A+ElqTA;;EAqKI,gBAAgB;EAChB,kBAAkB;A/EkgTtB;;A+ExqTA;;EA0KI,WAAW;A/EmgTf;;A+E7qTA;;EA8KI,8BAA8B;A/EogTlC;;A+ElrTA;;EAmLM,oBAAoB;A/EogT1B;;A+EvrTA;;EAuLM,mBAAmB;A/EqgTzB;;A+E5rTA;;EA2LM,eAAe;A/EsgTrB;;A+EjsTA;;EA+LM,cAAc;A/EugTpB;;A+EtsTA;;EAoMI,cAAc;EACd,OAAO;A/EugTX;;A+E5sTA;;EAyMI,oBAAoB;EACpB,cAAc;A/EwgTlB;;A+EltTA;;EA8MI,sBAAsB;EACtB,oBAAoB;A/EygTxB;;A+ExtTA;;EAmNI,sBAAsB;EACtB,qBAAqB;A/E0gTzB;;A+E9tTA;;;;;;EA0NI,gBAAgB;EAChB,qBAAqB;A/E6gTzB;;A+ExuTA;;ErEkCI,gCP6MgC;EO5MhC,mCP4MgC;EO/LhC,yBqEmLmC;ErElLnC,4BqEkLmC;A/E6gTvC;;A+EhvTA;;ErEkCI,0BqEuMoC;ErEtMpC,6BqEsMoC;ErEzLpC,+BP+LgC;EO9LhC,kCP8LgC;AHygTpC;;A+ExvTA;;EAkPI,uBAA+C;EAC/C,cAAc;A/E2gTlB;;A+E9vTA;;EAkPI,wBAA+C;EAC/C,cAAc;A/EihTlB;;A+EpwTA;;EAkPI,iBAA+C;EAC/C,cAAc;A/EuhTlB;;A+E1wTA;;EAkPI,wBAA+C;EAC/C,cAAc;A/E6hTlB;;A+EhxTA;;EAkPI,wBAA+C;EAC/C,cAAc;A/EmiTlB;;A+EtxTA;;EAkPI,iBAA+C;EAC/C,cAAc;A/EyiTlB;;A+E5xTA;;EAkPI,wBAA+C;EAC/C,cAAc;A/E+iTlB;;A+ElyTA;;EAkPI,wBAA+C;EAC/C,cAAc;A/EqjTlB;;A+ExyTA;;EAkPI,iBAA+C;EAC/C,cAAc;A/E2jTlB;;A+E9yTA;;EAkPI,wBAA+C;EAC/C,cAAc;A/EikTlB;;A+EpzTA;;EAkPI,wBAA+C;EAC/C,cAAc;A/EukTlB;;Ac9vTI;EiE5DJ;;IAkPI,eAA6B;IAC7B,cAAc;E/E8kThB;E+Ej0TF;;IAkPI,uBAA+C;IAC/C,cAAc;E/EmlThB;E+Et0TF;;IAkPI,wBAA+C;IAC/C,cAAc;E/EwlThB;E+E30TF;;IAkPI,iBAA+C;IAC/C,cAAc;E/E6lThB;E+Eh1TF;;IAkPI,wBAA+C;IAC/C,cAAc;E/EkmThB;E+Er1TF;;IAkPI,wBAA+C;IAC/C,cAAc;E/EumThB;E+E11TF;;IAkPI,iBAA+C;IAC/C,cAAc;E/E4mThB;E+E/1TF;;IAkPI,wBAA+C;IAC/C,cAAc;E/EinThB;E+Ep2TF;;IAkPI,wBAA+C;IAC/C,cAAc;E/EsnThB;E+Ez2TF;;IAkPI,iBAA+C;IAC/C,cAAc;E/E2nThB;E+E92TF;;IAkPI,wBAA+C;IAC/C,cAAc;E/EgoThB;E+En3TF;;IAkPI,wBAA+C;IAC/C,cAAc;E/EqoThB;AACF;;Ac7zTI;EiE5DJ;;IAkPI,eAA6B;IAC7B,cAAc;E/E6oThB;E+Eh4TF;;IAkPI,uBAA+C;IAC/C,cAAc;E/EkpThB;E+Er4TF;;IAkPI,wBAA+C;IAC/C,cAAc;E/EupThB;E+E14TF;;IAkPI,iBAA+C;IAC/C,cAAc;E/E4pThB;E+E/4TF;;IAkPI,wBAA+C;IAC/C,cAAc;E/EiqThB;E+Ep5TF;;IAkPI,wBAA+C;IAC/C,cAAc;E/EsqThB;E+Ez5TF;;IAkPI,iBAA+C;IAC/C,cAAc;E/E2qThB;E+E95TF;;IAkPI,wBAA+C;IAC/C,cAAc;E/EgrThB;E+En6TF;;IAkPI,wBAA+C;IAC/C,cAAc;E/EqrThB;E+Ex6TF;;IAkPI,iBAA+C;IAC/C,cAAc;E/E0rThB;E+E76TF;;IAkPI,wBAA+C;IAC/C,cAAc;E/E+rThB;E+El7TF;;IAkPI,wBAA+C;IAC/C,cAAc;E/EosThB;AACF;;Ac53TI;EiE5DJ;;IAkPI,eAA6B;IAC7B,cAAc;E/E4sThB;E+E/7TF;;IAkPI,uBAA+C;IAC/C,cAAc;E/EitThB;E+Ep8TF;;IAkPI,wBAA+C;IAC/C,cAAc;E/EstThB;E+Ez8TF;;IAkPI,iBAA+C;IAC/C,cAAc;E/E2tThB;E+E98TF;;IAkPI,wBAA+C;IAC/C,cAAc;E/EguThB;E+En9TF;;IAkPI,wBAA+C;IAC/C,cAAc;E/EquThB;E+Ex9TF;;IAkPI,iBAA+C;IAC/C,cAAc;E/E0uThB;E+E79TF;;IAkPI,wBAA+C;IAC/C,cAAc;E/E+uThB;E+El+TF;;IAkPI,wBAA+C;IAC/C,cAAc;E/EovThB;E+Ev+TF;;IAkPI,iBAA+C;IAC/C,cAAc;E/EyvThB;E+E5+TF;;IAkPI,wBAA+C;IAC/C,cAAc;E/E8vThB;E+Ej/TF;;IAkPI,wBAA+C;IAC/C,cAAc;E/EmwThB;AACF;;Ac37TI;EiE5DJ;;IAkPI,eAA6B;IAC7B,cAAc;E/E2wThB;E+E9/TF;;IAkPI,uBAA+C;IAC/C,cAAc;E/EgxThB;E+EngUF;;IAkPI,wBAA+C;IAC/C,cAAc;E/EqxThB;E+ExgUF;;IAkPI,iBAA+C;IAC/C,cAAc;E/E0xThB;E+E7gUF;;IAkPI,wBAA+C;IAC/C,cAAc;E/E+xThB;E+ElhUF;;IAkPI,wBAA+C;IAC/C,cAAc;E/EoyThB;E+EvhUF;;IAkPI,iBAA+C;IAC/C,cAAc;E/EyyThB;E+E5hUF;;IAkPI,wBAA+C;IAC/C,cAAc;E/E8yThB;E+EjiUF;;IAkPI,wBAA+C;IAC/C,cAAc;E/EmzThB;E+EtiUF;;IAkPI,iBAA+C;IAC/C,cAAc;E/EwzThB;E+E3iUF;;IAkPI,wBAA+C;IAC/C,cAAc;E/E6zThB;E+EhjUF;;IAkPI,wBAA+C;IAC/C,cAAc;E/Ek0ThB;AACF;;A+EtjUA;;EAiRY,0BAAkC;EAClC,yBAAsC;A/E0yTlD;;A+E5jUA;;EAqRY,yBAAgC;EAChC,0BAAwC;A/E4yTpD;;A+ElkUA;;EAyRY,yBAAsC;EACtC,0BAAwC;A/E8yTpD;;A+ExkUA;;EAiRY,0BAAkC;EAClC,+BAAsC;A/E4zTlD;;A+E9kUA;;EAqRY,yBAAgC;EAChC,gCAAwC;A/E8zTpD;;A+EplUA;;EAyRY,+BAAsC;EACtC,gCAAwC;A/Eg0TpD;;A+E1lUA;;EAiRY,0BAAkC;EAClC,8BAAsC;A/E80TlD;;A+EhmUA;;EAqRY,yBAAgC;EAChC,+BAAwC;A/Eg1TpD;;A+EtmUA;;EAyRY,8BAAsC;EACtC,+BAAwC;A/Ek1TpD;;A+E5mUA;;EAiRY,0BAAkC;EAClC,4BAAsC;A/Eg2TlD;;A+ElnUA;;EAqRY,yBAAgC;EAChC,6BAAwC;A/Ek2TpD;;A+ExnUA;;EAyRY,4BAAsC;EACtC,6BAAwC;A/Eo2TpD;;A+E9nUA;;EAiRY,0BAAkC;EAClC,8BAAsC;A/Ek3TlD;;A+EpoUA;;EAqRY,yBAAgC;EAChC,+BAAwC;A/Eo3TpD;;A+E1oUA;;EAyRY,8BAAsC;EACtC,+BAAwC;A/Es3TpD;;A+EhpUA;;EAiRY,0BAAkC;EAClC,4BAAsC;A/Eo4TlD;;A+EtpUA;;EAqRY,yBAAgC;EAChC,6BAAwC;A/Es4TpD;;A+E5pUA;;EAyRY,4BAAsC;EACtC,6BAAwC;A/Ew4TpD;;A+ElqUA;;EAiRY,2BAAkC;EAClC,0BAAsC;A/Es5TlD;;A+ExqUA;;EAqRY,0BAAgC;EAChC,2BAAwC;A/Ew5TpD;;A+E9qUA;;EAyRY,0BAAsC;EACtC,2BAAwC;A/E05TpD;;A+EprUA;;EAiRY,2BAAkC;EAClC,gCAAsC;A/Ew6TlD;;A+E1rUA;;EAqRY,0BAAgC;EAChC,iCAAwC;A/E06TpD;;A+EhsUA;;EAyRY,gCAAsC;EACtC,iCAAwC;A/E46TpD;;A+EtsUA;;EAiRY,2BAAkC;EAClC,+BAAsC;A/E07TlD;;A+E5sUA;;EAqRY,0BAAgC;EAChC,gCAAwC;A/E47TpD;;A+EltUA;;EAyRY,+BAAsC;EACtC,gCAAwC;A/E87TpD;;A+ExtUA;;EAiRY,2BAAkC;EAClC,6BAAsC;A/E48TlD;;A+E9tUA;;EAqRY,0BAAgC;EAChC,8BAAwC;A/E88TpD;;A+EpuUA;;EAyRY,6BAAsC;EACtC,8BAAwC;A/Eg9TpD;;A+E1uUA;;EAiRY,2BAAkC;EAClC,+BAAsC;A/E89TlD;;A+EhvUA;;EAqRY,0BAAgC;EAChC,gCAAwC;A/Eg+TpD;;A+EtvUA;;EAyRY,+BAAsC;EACtC,gCAAwC;A/Ek+TpD;;A+E5vUA;;EAiRY,2BAAkC;EAClC,6BAAsC;A/Eg/TlD;;A+ElwUA;;EAqRY,0BAAgC;EAChC,8BAAwC;A/Ek/TpD;;A+ExwUA;;EAyRY,6BAAsC;EACtC,8BAAwC;A/Eo/TpD;;A+E9wUA;;EAgSQ,0BAA0B;EAC1B,4BAA4B;A/Em/TpC;;A+EpxUA;;EAoSQ,6BAA6B;EAC7B,yBAAyB;A/Eq/TjC;;A+E1xUA;;EAwSQ,6BAA6B;EAC7B,4BAA4B;A/Eu/TpC;;AcpuUI;EiE5DJ;;IAiRY,0BAAkC;IAClC,yBAAsC;E/EqhUhD;E+EvyUF;;IAqRY,yBAAgC;IAChC,0BAAwC;E/EshUlD;E+E5yUF;;IAyRY,yBAAsC;IACtC,0BAAwC;E/EuhUlD;E+EjzUF;;IAiRY,0BAAkC;IAClC,+BAAsC;E/EoiUhD;E+EtzUF;;IAqRY,yBAAgC;IAChC,gCAAwC;E/EqiUlD;E+E3zUF;;IAyRY,+BAAsC;IACtC,gCAAwC;E/EsiUlD;E+Eh0UF;;IAiRY,0BAAkC;IAClC,8BAAsC;E/EmjUhD;E+Er0UF;;IAqRY,yBAAgC;IAChC,+BAAwC;E/EojUlD;E+E10UF;;IAyRY,8BAAsC;IACtC,+BAAwC;E/EqjUlD;E+E/0UF;;IAiRY,0BAAkC;IAClC,4BAAsC;E/EkkUhD;E+Ep1UF;;IAqRY,yBAAgC;IAChC,6BAAwC;E/EmkUlD;E+Ez1UF;;IAyRY,4BAAsC;IACtC,6BAAwC;E/EokUlD;E+E91UF;;IAiRY,0BAAkC;IAClC,8BAAsC;E/EilUhD;E+En2UF;;IAqRY,yBAAgC;IAChC,+BAAwC;E/EklUlD;E+Ex2UF;;IAyRY,8BAAsC;IACtC,+BAAwC;E/EmlUlD;E+E72UF;;IAiRY,0BAAkC;IAClC,4BAAsC;E/EgmUhD;E+El3UF;;IAqRY,yBAAgC;IAChC,6BAAwC;E/EimUlD;E+Ev3UF;;IAyRY,4BAAsC;IACtC,6BAAwC;E/EkmUlD;E+E53UF;;IAiRY,2BAAkC;IAClC,0BAAsC;E/E+mUhD;E+Ej4UF;;IAqRY,0BAAgC;IAChC,2BAAwC;E/EgnUlD;E+Et4UF;;IAyRY,0BAAsC;IACtC,2BAAwC;E/EinUlD;E+E34UF;;IAiRY,2BAAkC;IAClC,gCAAsC;E/E8nUhD;E+Eh5UF;;IAqRY,0BAAgC;IAChC,iCAAwC;E/E+nUlD;E+Er5UF;;IAyRY,gCAAsC;IACtC,iCAAwC;E/EgoUlD;E+E15UF;;IAiRY,2BAAkC;IAClC,+BAAsC;E/E6oUhD;E+E/5UF;;IAqRY,0BAAgC;IAChC,gCAAwC;E/E8oUlD;E+Ep6UF;;IAyRY,+BAAsC;IACtC,gCAAwC;E/E+oUlD;E+Ez6UF;;IAiRY,2BAAkC;IAClC,6BAAsC;E/E4pUhD;E+E96UF;;IAqRY,0BAAgC;IAChC,8BAAwC;E/E6pUlD;E+En7UF;;IAyRY,6BAAsC;IACtC,8BAAwC;E/E8pUlD;E+Ex7UF;;IAiRY,2BAAkC;IAClC,+BAAsC;E/E2qUhD;E+E77UF;;IAqRY,0BAAgC;IAChC,gCAAwC;E/E4qUlD;E+El8UF;;IAyRY,+BAAsC;IACtC,gCAAwC;E/E6qUlD;E+Ev8UF;;IAiRY,2BAAkC;IAClC,6BAAsC;E/E0rUhD;E+E58UF;;IAqRY,0BAAgC;IAChC,8BAAwC;E/E2rUlD;E+Ej9UF;;IAyRY,6BAAsC;IACtC,8BAAwC;E/E4rUlD;E+Et9UF;;IAgSQ,0BAA0B;IAC1B,4BAA4B;E/E0rUlC;E+E39UF;;IAoSQ,6BAA6B;IAC7B,yBAAyB;E/E2rU/B;E+Eh+UF;;IAwSQ,6BAA6B;IAC7B,4BAA4B;E/E4rUlC;AACF;;Ac16UI;EiE5DJ;;IAiRY,0BAAkC;IAClC,yBAAsC;E/E2tUhD;E+E7+UF;;IAqRY,yBAAgC;IAChC,0BAAwC;E/E4tUlD;E+El/UF;;IAyRY,yBAAsC;IACtC,0BAAwC;E/E6tUlD;E+Ev/UF;;IAiRY,0BAAkC;IAClC,+BAAsC;E/E0uUhD;E+E5/UF;;IAqRY,yBAAgC;IAChC,gCAAwC;E/E2uUlD;E+EjgVF;;IAyRY,+BAAsC;IACtC,gCAAwC;E/E4uUlD;E+EtgVF;;IAiRY,0BAAkC;IAClC,8BAAsC;E/EyvUhD;E+E3gVF;;IAqRY,yBAAgC;IAChC,+BAAwC;E/E0vUlD;E+EhhVF;;IAyRY,8BAAsC;IACtC,+BAAwC;E/E2vUlD;E+ErhVF;;IAiRY,0BAAkC;IAClC,4BAAsC;E/EwwUhD;E+E1hVF;;IAqRY,yBAAgC;IAChC,6BAAwC;E/EywUlD;E+E/hVF;;IAyRY,4BAAsC;IACtC,6BAAwC;E/E0wUlD;E+EpiVF;;IAiRY,0BAAkC;IAClC,8BAAsC;E/EuxUhD;E+EziVF;;IAqRY,yBAAgC;IAChC,+BAAwC;E/EwxUlD;E+E9iVF;;IAyRY,8BAAsC;IACtC,+BAAwC;E/EyxUlD;E+EnjVF;;IAiRY,0BAAkC;IAClC,4BAAsC;E/EsyUhD;E+ExjVF;;IAqRY,yBAAgC;IAChC,6BAAwC;E/EuyUlD;E+E7jVF;;IAyRY,4BAAsC;IACtC,6BAAwC;E/EwyUlD;E+ElkVF;;IAiRY,2BAAkC;IAClC,0BAAsC;E/EqzUhD;E+EvkVF;;IAqRY,0BAAgC;IAChC,2BAAwC;E/EszUlD;E+E5kVF;;IAyRY,0BAAsC;IACtC,2BAAwC;E/EuzUlD;E+EjlVF;;IAiRY,2BAAkC;IAClC,gCAAsC;E/Eo0UhD;E+EtlVF;;IAqRY,0BAAgC;IAChC,iCAAwC;E/Eq0UlD;E+E3lVF;;IAyRY,gCAAsC;IACtC,iCAAwC;E/Es0UlD;E+EhmVF;;IAiRY,2BAAkC;IAClC,+BAAsC;E/Em1UhD;E+ErmVF;;IAqRY,0BAAgC;IAChC,gCAAwC;E/Eo1UlD;E+E1mVF;;IAyRY,+BAAsC;IACtC,gCAAwC;E/Eq1UlD;E+E/mVF;;IAiRY,2BAAkC;IAClC,6BAAsC;E/Ek2UhD;E+EpnVF;;IAqRY,0BAAgC;IAChC,8BAAwC;E/Em2UlD;E+EznVF;;IAyRY,6BAAsC;IACtC,8BAAwC;E/Eo2UlD;E+E9nVF;;IAiRY,2BAAkC;IAClC,+BAAsC;E/Ei3UhD;E+EnoVF;;IAqRY,0BAAgC;IAChC,gCAAwC;E/Ek3UlD;E+ExoVF;;IAyRY,+BAAsC;IACtC,gCAAwC;E/Em3UlD;E+E7oVF;;IAiRY,2BAAkC;IAClC,6BAAsC;E/Eg4UhD;E+ElpVF;;IAqRY,0BAAgC;IAChC,8BAAwC;E/Ei4UlD;E+EvpVF;;IAyRY,6BAAsC;IACtC,8BAAwC;E/Ek4UlD;E+E5pVF;;IAgSQ,0BAA0B;IAC1B,4BAA4B;E/Eg4UlC;E+EjqVF;;IAoSQ,6BAA6B;IAC7B,yBAAyB;E/Ei4U/B;E+EtqVF;;IAwSQ,6BAA6B;IAC7B,4BAA4B;E/Ek4UlC;AACF;;AchnVI;EiE5DJ;;IAiRY,0BAAkC;IAClC,yBAAsC;E/Ei6UhD;E+EnrVF;;IAqRY,yBAAgC;IAChC,0BAAwC;E/Ek6UlD;E+ExrVF;;IAyRY,yBAAsC;IACtC,0BAAwC;E/Em6UlD;E+E7rVF;;IAiRY,0BAAkC;IAClC,+BAAsC;E/Eg7UhD;E+ElsVF;;IAqRY,yBAAgC;IAChC,gCAAwC;E/Ei7UlD;E+EvsVF;;IAyRY,+BAAsC;IACtC,gCAAwC;E/Ek7UlD;E+E5sVF;;IAiRY,0BAAkC;IAClC,8BAAsC;E/E+7UhD;E+EjtVF;;IAqRY,yBAAgC;IAChC,+BAAwC;E/Eg8UlD;E+EttVF;;IAyRY,8BAAsC;IACtC,+BAAwC;E/Ei8UlD;E+E3tVF;;IAiRY,0BAAkC;IAClC,4BAAsC;E/E88UhD;E+EhuVF;;IAqRY,yBAAgC;IAChC,6BAAwC;E/E+8UlD;E+EruVF;;IAyRY,4BAAsC;IACtC,6BAAwC;E/Eg9UlD;E+E1uVF;;IAiRY,0BAAkC;IAClC,8BAAsC;E/E69UhD;E+E/uVF;;IAqRY,yBAAgC;IAChC,+BAAwC;E/E89UlD;E+EpvVF;;IAyRY,8BAAsC;IACtC,+BAAwC;E/E+9UlD;E+EzvVF;;IAiRY,0BAAkC;IAClC,4BAAsC;E/E4+UhD;E+E9vVF;;IAqRY,yBAAgC;IAChC,6BAAwC;E/E6+UlD;E+EnwVF;;IAyRY,4BAAsC;IACtC,6BAAwC;E/E8+UlD;E+ExwVF;;IAiRY,2BAAkC;IAClC,0BAAsC;E/E2/UhD;E+E7wVF;;IAqRY,0BAAgC;IAChC,2BAAwC;E/E4/UlD;E+ElxVF;;IAyRY,0BAAsC;IACtC,2BAAwC;E/E6/UlD;E+EvxVF;;IAiRY,2BAAkC;IAClC,gCAAsC;E/E0gVhD;E+E5xVF;;IAqRY,0BAAgC;IAChC,iCAAwC;E/E2gVlD;E+EjyVF;;IAyRY,gCAAsC;IACtC,iCAAwC;E/E4gVlD;E+EtyVF;;IAiRY,2BAAkC;IAClC,+BAAsC;E/EyhVhD;E+E3yVF;;IAqRY,0BAAgC;IAChC,gCAAwC;E/E0hVlD;E+EhzVF;;IAyRY,+BAAsC;IACtC,gCAAwC;E/E2hVlD;E+ErzVF;;IAiRY,2BAAkC;IAClC,6BAAsC;E/EwiVhD;E+E1zVF;;IAqRY,0BAAgC;IAChC,8BAAwC;E/EyiVlD;E+E/zVF;;IAyRY,6BAAsC;IACtC,8BAAwC;E/E0iVlD;E+Ep0VF;;IAiRY,2BAAkC;IAClC,+BAAsC;E/EujVhD;E+Ez0VF;;IAqRY,0BAAgC;IAChC,gCAAwC;E/EwjVlD;E+E90VF;;IAyRY,+BAAsC;IACtC,gCAAwC;E/EyjVlD;E+En1VF;;IAiRY,2BAAkC;IAClC,6BAAsC;E/EskVhD;E+Ex1VF;;IAqRY,0BAAgC;IAChC,8BAAwC;E/EukVlD;E+E71VF;;IAyRY,6BAAsC;IACtC,8BAAwC;E/EwkVlD;E+El2VF;;IAgSQ,0BAA0B;IAC1B,4BAA4B;E/EskVlC;E+Ev2VF;;IAoSQ,6BAA6B;IAC7B,yBAAyB;E/EukV/B;E+E52VF;;IAwSQ,6BAA6B;IAC7B,4BAA4B;E/EwkVlC;AACF;;ActzVI;EiE5DJ;;IAiRY,0BAAkC;IAClC,yBAAsC;E/EumVhD;E+Ez3VF;;IAqRY,yBAAgC;IAChC,0BAAwC;E/EwmVlD;E+E93VF;;IAyRY,yBAAsC;IACtC,0BAAwC;E/EymVlD;E+En4VF;;IAiRY,0BAAkC;IAClC,+BAAsC;E/EsnVhD;E+Ex4VF;;IAqRY,yBAAgC;IAChC,gCAAwC;E/EunVlD;E+E74VF;;IAyRY,+BAAsC;IACtC,gCAAwC;E/EwnVlD;E+El5VF;;IAiRY,0BAAkC;IAClC,8BAAsC;E/EqoVhD;E+Ev5VF;;IAqRY,yBAAgC;IAChC,+BAAwC;E/EsoVlD;E+E55VF;;IAyRY,8BAAsC;IACtC,+BAAwC;E/EuoVlD;E+Ej6VF;;IAiRY,0BAAkC;IAClC,4BAAsC;E/EopVhD;E+Et6VF;;IAqRY,yBAAgC;IAChC,6BAAwC;E/EqpVlD;E+E36VF;;IAyRY,4BAAsC;IACtC,6BAAwC;E/EspVlD;E+Eh7VF;;IAiRY,0BAAkC;IAClC,8BAAsC;E/EmqVhD;E+Er7VF;;IAqRY,yBAAgC;IAChC,+BAAwC;E/EoqVlD;E+E17VF;;IAyRY,8BAAsC;IACtC,+BAAwC;E/EqqVlD;E+E/7VF;;IAiRY,0BAAkC;IAClC,4BAAsC;E/EkrVhD;E+Ep8VF;;IAqRY,yBAAgC;IAChC,6BAAwC;E/EmrVlD;E+Ez8VF;;IAyRY,4BAAsC;IACtC,6BAAwC;E/EorVlD;E+E98VF;;IAiRY,2BAAkC;IAClC,0BAAsC;E/EisVhD;E+En9VF;;IAqRY,0BAAgC;IAChC,2BAAwC;E/EksVlD;E+Ex9VF;;IAyRY,0BAAsC;IACtC,2BAAwC;E/EmsVlD;E+E79VF;;IAiRY,2BAAkC;IAClC,gCAAsC;E/EgtVhD;E+El+VF;;IAqRY,0BAAgC;IAChC,iCAAwC;E/EitVlD;E+Ev+VF;;IAyRY,gCAAsC;IACtC,iCAAwC;E/EktVlD;E+E5+VF;;IAiRY,2BAAkC;IAClC,+BAAsC;E/E+tVhD;E+Ej/VF;;IAqRY,0BAAgC;IAChC,gCAAwC;E/EguVlD;E+Et/VF;;IAyRY,+BAAsC;IACtC,gCAAwC;E/EiuVlD;E+E3/VF;;IAiRY,2BAAkC;IAClC,6BAAsC;E/E8uVhD;E+EhgWF;;IAqRY,0BAAgC;IAChC,8BAAwC;E/E+uVlD;E+ErgWF;;IAyRY,6BAAsC;IACtC,8BAAwC;E/EgvVlD;E+E1gWF;;IAiRY,2BAAkC;IAClC,+BAAsC;E/E6vVhD;E+E/gWF;;IAqRY,0BAAgC;IAChC,gCAAwC;E/E8vVlD;E+EphWF;;IAyRY,+BAAsC;IACtC,gCAAwC;E/E+vVlD;E+EzhWF;;IAiRY,2BAAkC;IAClC,6BAAsC;E/E4wVhD;E+E9hWF;;IAqRY,0BAAgC;IAChC,8BAAwC;E/E6wVlD;E+EniWF;;IAyRY,6BAAsC;IACtC,8BAAwC;E/E8wVlD;E+ExiWF;;IAgSQ,0BAA0B;IAC1B,4BAA4B;E/E4wVlC;E+E7iWF;;IAoSQ,6BAA6B;IAC7B,yBAAyB;E/E6wV/B;E+EljWF;;IAwSQ,6BAA6B;IAC7B,4BAA4B;E/E8wVlC;AACF;;A+ExjWA;;EAkTQ,2BAA2B;A/E2wVnC;;A+E7jWA;;EAqTQ,4BAA4B;A/E6wVpC;;ActgWI;EiE5DJ;;IAkTQ,2BAA2B;E/EsxVjC;E+ExkWF;;IAqTQ,4BAA4B;E/EuxVlC;AACF;;AcjhWI;EiE5DJ;;IAkTQ,2BAA2B;E/EiyVjC;E+EnlWF;;IAqTQ,4BAA4B;E/EkyVlC;AACF;;Ac5hWI;EiE5DJ;;IAkTQ,2BAA2B;E/E4yVjC;E+E9lWF;;IAqTQ,4BAA4B;E/E6yVlC;AACF;;AcviWI;EiE5DJ;;IAkTQ,2BAA2B;E/EuzVjC;E+EzmWF;;IAqTQ,4BAA4B;E/EwzVlC;AACF","file":"bootstrap-rtl.css","sourcesContent":["/*!\n * Bootstrap v4.5.2 (https://getbootstrap.com/)\n * Copyright 2011-2020 The Bootstrap Authors\n * Copyright 2011-2020 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n */\n\n @import \"functions\";\n @import \"variables\";\n @import \"mixins\";\n @import \"root\";\n @import \"reboot\";\n @import \"type\";\n @import \"images\";\n @import \"code\";\n @import \"grid\";\n @import \"tables\";\n @import \"forms\";\n @import \"buttons\";\n @import \"transitions\";\n @import \"dropdown\";\n @import \"button-group\";\n @import \"input-group\";\n @import \"custom-forms\";\n @import \"nav\";\n @import \"navbar\";\n @import \"card\";\n @import \"breadcrumb\";\n @import \"pagination\";\n @import \"badge\";\n @import \"jumbotron\";\n @import \"alert\";\n @import \"progress\";\n @import \"media\";\n @import \"list-group\";\n @import \"close\";\n @import \"toasts\";\n @import \"modal\";\n @import \"tooltip\";\n @import \"popover\";\n @import \"carousel\";\n @import \"spinners\";\n @import \"utilities\";\n @import \"print\";\n\n@import \"rtl\";\n","/*!\n * Bootstrap v4.5.2 (https://getbootstrap.com/)\n * Copyright 2011-2020 The Bootstrap Authors\n * Copyright 2011-2020 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n */\n:root {\n --blue: #007bff;\n --indigo: #6610f2;\n --purple: #6f42c1;\n --pink: #e83e8c;\n --red: #dc3545;\n --orange: #fd7e14;\n --yellow: #ffc107;\n --green: #28a745;\n --teal: #20c997;\n --cyan: #17a2b8;\n --white: #fff;\n --gray: #6c757d;\n --gray-dark: #343a40;\n --primary: #007bff;\n --secondary: #6c757d;\n --success: #28a745;\n --info: #17a2b8;\n --warning: #ffc107;\n --danger: #dc3545;\n --light: #f8f9fa;\n --dark: #343a40;\n --breakpoint-xs: 0;\n --breakpoint-sm: 576px;\n --breakpoint-md: 768px;\n --breakpoint-lg: 992px;\n --breakpoint-xl: 1200px;\n --font-family-sans-serif: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Noto Sans\", \"Liberation Sans\", sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\";\n --font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;\n}\n\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\nhtml {\n font-family: sans-serif;\n line-height: 1.15;\n -webkit-text-size-adjust: 100%;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\n\narticle, aside, figcaption, figure, footer, header, hgroup, main, nav, section {\n display: block;\n}\n\nbody {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Noto Sans\", \"Liberation Sans\", sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\";\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.5;\n color: #212529;\n text-align: left;\n background-color: #fff;\n}\n\n[tabindex=\"-1\"]:focus:not(:focus-visible) {\n outline: 0 !important;\n}\n\nhr {\n box-sizing: content-box;\n height: 0;\n overflow: visible;\n}\n\nh1, h2, h3, h4, h5, h6 {\n margin-top: 0;\n margin-bottom: 0.5rem;\n}\n\np {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\nabbr[title],\nabbr[data-original-title] {\n text-decoration: underline;\n text-decoration: underline dotted;\n cursor: help;\n border-bottom: 0;\n text-decoration-skip-ink: none;\n}\n\naddress {\n margin-bottom: 1rem;\n font-style: normal;\n line-height: inherit;\n}\n\nol,\nul,\ndl {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\nol ol,\nul ul,\nol ul,\nul ol {\n margin-bottom: 0;\n}\n\ndt {\n font-weight: 700;\n}\n\ndd {\n margin-bottom: .5rem;\n margin-left: 0;\n}\n\nblockquote {\n margin: 0 0 1rem;\n}\n\nb,\nstrong {\n font-weight: bolder;\n}\n\nsmall {\n font-size: 80%;\n}\n\nsub,\nsup {\n position: relative;\n font-size: 75%;\n line-height: 0;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -.25em;\n}\n\nsup {\n top: -.5em;\n}\n\na {\n color: #007bff;\n text-decoration: none;\n background-color: transparent;\n}\n\na:hover {\n color: #0056b3;\n text-decoration: underline;\n}\n\na:not([href]):not([class]) {\n color: inherit;\n text-decoration: none;\n}\n\na:not([href]):not([class]):hover {\n color: inherit;\n text-decoration: none;\n}\n\npre,\ncode,\nkbd,\nsamp {\n font-family: SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;\n font-size: 1em;\n}\n\npre {\n margin-top: 0;\n margin-bottom: 1rem;\n overflow: auto;\n -ms-overflow-style: scrollbar;\n}\n\nfigure {\n margin: 0 0 1rem;\n}\n\nimg {\n vertical-align: middle;\n border-style: none;\n}\n\nsvg {\n overflow: hidden;\n vertical-align: middle;\n}\n\ntable {\n border-collapse: collapse;\n}\n\ncaption {\n padding-top: 0.75rem;\n padding-bottom: 0.75rem;\n color: #6c757d;\n text-align: left;\n caption-side: bottom;\n}\n\nth {\n text-align: inherit;\n text-align: -webkit-match-parent;\n}\n\nlabel {\n display: inline-block;\n margin-bottom: 0.5rem;\n}\n\nbutton {\n border-radius: 0;\n}\n\nbutton:focus:not(:focus-visible) {\n outline: 0;\n}\n\ninput,\nbutton,\nselect,\noptgroup,\ntextarea {\n margin: 0;\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n}\n\nbutton,\ninput {\n overflow: visible;\n}\n\nbutton,\nselect {\n text-transform: none;\n}\n\n[role=\"button\"] {\n cursor: pointer;\n}\n\nselect {\n word-wrap: normal;\n}\n\nbutton,\n[type=\"button\"],\n[type=\"reset\"],\n[type=\"submit\"] {\n -webkit-appearance: button;\n}\n\nbutton:not(:disabled),\n[type=\"button\"]:not(:disabled),\n[type=\"reset\"]:not(:disabled),\n[type=\"submit\"]:not(:disabled) {\n cursor: pointer;\n}\n\nbutton::-moz-focus-inner,\n[type=\"button\"]::-moz-focus-inner,\n[type=\"reset\"]::-moz-focus-inner,\n[type=\"submit\"]::-moz-focus-inner {\n padding: 0;\n border-style: none;\n}\n\ninput[type=\"radio\"],\ninput[type=\"checkbox\"] {\n box-sizing: border-box;\n padding: 0;\n}\n\ntextarea {\n overflow: auto;\n resize: vertical;\n}\n\nfieldset {\n min-width: 0;\n padding: 0;\n margin: 0;\n border: 0;\n}\n\nlegend {\n display: block;\n width: 100%;\n max-width: 100%;\n padding: 0;\n margin-bottom: .5rem;\n font-size: 1.5rem;\n line-height: inherit;\n color: inherit;\n white-space: normal;\n}\n\nprogress {\n vertical-align: baseline;\n}\n\n[type=\"number\"]::-webkit-inner-spin-button,\n[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n[type=\"search\"] {\n outline-offset: -2px;\n -webkit-appearance: none;\n}\n\n[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n::-webkit-file-upload-button {\n font: inherit;\n -webkit-appearance: button;\n}\n\noutput {\n display: inline-block;\n}\n\nsummary {\n display: list-item;\n cursor: pointer;\n}\n\ntemplate {\n display: none;\n}\n\n[hidden] {\n display: none !important;\n}\n\nh1, h2, h3, h4, h5, h6,\n.h1, .h2, .h3, .h4, .h5, .h6 {\n margin-bottom: 0.5rem;\n font-weight: 500;\n line-height: 1.2;\n}\n\nh1, .h1 {\n font-size: 2.5rem;\n}\n\nh2, .h2 {\n font-size: 2rem;\n}\n\nh3, .h3 {\n font-size: 1.75rem;\n}\n\nh4, .h4 {\n font-size: 1.5rem;\n}\n\nh5, .h5 {\n font-size: 1.25rem;\n}\n\nh6, .h6 {\n font-size: 1rem;\n}\n\n.lead {\n font-size: 1.25rem;\n font-weight: 300;\n}\n\n.display-1 {\n font-size: 6rem;\n font-weight: 300;\n line-height: 1.2;\n}\n\n.display-2 {\n font-size: 5.5rem;\n font-weight: 300;\n line-height: 1.2;\n}\n\n.display-3 {\n font-size: 4.5rem;\n font-weight: 300;\n line-height: 1.2;\n}\n\n.display-4 {\n font-size: 3.5rem;\n font-weight: 300;\n line-height: 1.2;\n}\n\nhr {\n margin-top: 1rem;\n margin-bottom: 1rem;\n border: 0;\n border-top: 1px solid rgba(0, 0, 0, 0.1);\n}\n\nsmall,\n.small {\n font-size: 80%;\n font-weight: 400;\n}\n\nmark,\n.mark {\n padding: 0.2em;\n background-color: #fcf8e3;\n}\n\n.list-unstyled {\n padding-left: 0;\n list-style: none;\n}\n\n.list-inline {\n padding-left: 0;\n list-style: none;\n}\n\n.list-inline-item {\n display: inline-block;\n}\n\n.list-inline-item:not(:last-child) {\n margin-right: 0.5rem;\n}\n\n.initialism {\n font-size: 90%;\n text-transform: uppercase;\n}\n\n.blockquote {\n margin-bottom: 1rem;\n font-size: 1.25rem;\n}\n\n.blockquote-footer {\n display: block;\n font-size: 80%;\n color: #6c757d;\n}\n\n.blockquote-footer::before {\n content: \"\\2014\\00A0\";\n}\n\n.img-fluid {\n max-width: 100%;\n height: auto;\n}\n\n.img-thumbnail {\n padding: 0.25rem;\n background-color: #fff;\n border: 1px solid #dee2e6;\n border-radius: 0.25rem;\n max-width: 100%;\n height: auto;\n}\n\n.figure {\n display: inline-block;\n}\n\n.figure-img {\n margin-bottom: 0.5rem;\n line-height: 1;\n}\n\n.figure-caption {\n font-size: 90%;\n color: #6c757d;\n}\n\ncode {\n font-size: 87.5%;\n color: #e83e8c;\n word-wrap: break-word;\n}\n\na > code {\n color: inherit;\n}\n\nkbd {\n padding: 0.2rem 0.4rem;\n font-size: 87.5%;\n color: #fff;\n background-color: #212529;\n border-radius: 0.2rem;\n}\n\nkbd kbd {\n padding: 0;\n font-size: 100%;\n font-weight: 700;\n}\n\npre {\n display: block;\n font-size: 87.5%;\n color: #212529;\n}\n\npre code {\n font-size: inherit;\n color: inherit;\n word-break: normal;\n}\n\n.pre-scrollable {\n max-height: 340px;\n overflow-y: scroll;\n}\n\n.container,\n.container-fluid,\n.container-sm,\n.container-md,\n.container-lg,\n.container-xl {\n width: 100%;\n padding-right: 15px;\n padding-left: 15px;\n margin-right: auto;\n margin-left: auto;\n}\n\n@media (min-width: 576px) {\n .container, .container-sm {\n max-width: 540px;\n }\n}\n\n@media (min-width: 768px) {\n .container, .container-sm, .container-md {\n max-width: 720px;\n }\n}\n\n@media (min-width: 992px) {\n .container, .container-sm, .container-md, .container-lg {\n max-width: 960px;\n }\n}\n\n@media (min-width: 1200px) {\n .container, .container-sm, .container-md, .container-lg, .container-xl {\n max-width: 1140px;\n }\n}\n\n.row {\n display: flex;\n flex-wrap: wrap;\n margin-right: -15px;\n margin-left: -15px;\n}\n\n.no-gutters {\n margin-right: 0;\n margin-left: 0;\n}\n\n.no-gutters > .col,\n.no-gutters > [class*=\"col-\"] {\n padding-right: 0;\n padding-left: 0;\n}\n\n.col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12, .col,\n.col-auto, .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm,\n.col-sm-auto, .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12, .col-md,\n.col-md-auto, .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg,\n.col-lg-auto, .col-xl-1, .col-xl-2, .col-xl-3, .col-xl-4, .col-xl-5, .col-xl-6, .col-xl-7, .col-xl-8, .col-xl-9, .col-xl-10, .col-xl-11, .col-xl-12, .col-xl,\n.col-xl-auto {\n position: relative;\n width: 100%;\n padding-right: 15px;\n padding-left: 15px;\n}\n\n.col {\n flex-basis: 0;\n flex-grow: 1;\n max-width: 100%;\n}\n\n.row-cols-1 > * {\n flex: 0 0 100%;\n max-width: 100%;\n}\n\n.row-cols-2 > * {\n flex: 0 0 50%;\n max-width: 50%;\n}\n\n.row-cols-3 > * {\n flex: 0 0 33.333333%;\n max-width: 33.333333%;\n}\n\n.row-cols-4 > * {\n flex: 0 0 25%;\n max-width: 25%;\n}\n\n.row-cols-5 > * {\n flex: 0 0 20%;\n max-width: 20%;\n}\n\n.row-cols-6 > * {\n flex: 0 0 16.666667%;\n max-width: 16.666667%;\n}\n\n.col-auto {\n flex: 0 0 auto;\n width: auto;\n max-width: 100%;\n}\n\n.col-1 {\n flex: 0 0 8.333333%;\n max-width: 8.333333%;\n}\n\n.col-2 {\n flex: 0 0 16.666667%;\n max-width: 16.666667%;\n}\n\n.col-3 {\n flex: 0 0 25%;\n max-width: 25%;\n}\n\n.col-4 {\n flex: 0 0 33.333333%;\n max-width: 33.333333%;\n}\n\n.col-5 {\n flex: 0 0 41.666667%;\n max-width: 41.666667%;\n}\n\n.col-6 {\n flex: 0 0 50%;\n max-width: 50%;\n}\n\n.col-7 {\n flex: 0 0 58.333333%;\n max-width: 58.333333%;\n}\n\n.col-8 {\n flex: 0 0 66.666667%;\n max-width: 66.666667%;\n}\n\n.col-9 {\n flex: 0 0 75%;\n max-width: 75%;\n}\n\n.col-10 {\n flex: 0 0 83.333333%;\n max-width: 83.333333%;\n}\n\n.col-11 {\n flex: 0 0 91.666667%;\n max-width: 91.666667%;\n}\n\n.col-12 {\n flex: 0 0 100%;\n max-width: 100%;\n}\n\n.order-first {\n order: -1;\n}\n\n.order-last {\n order: 13;\n}\n\n.order-0 {\n order: 0;\n}\n\n.order-1 {\n order: 1;\n}\n\n.order-2 {\n order: 2;\n}\n\n.order-3 {\n order: 3;\n}\n\n.order-4 {\n order: 4;\n}\n\n.order-5 {\n order: 5;\n}\n\n.order-6 {\n order: 6;\n}\n\n.order-7 {\n order: 7;\n}\n\n.order-8 {\n order: 8;\n}\n\n.order-9 {\n order: 9;\n}\n\n.order-10 {\n order: 10;\n}\n\n.order-11 {\n order: 11;\n}\n\n.order-12 {\n order: 12;\n}\n\n.offset-1 {\n margin-left: 8.333333%;\n}\n\n.offset-2 {\n margin-left: 16.666667%;\n}\n\n.offset-3 {\n margin-left: 25%;\n}\n\n.offset-4 {\n margin-left: 33.333333%;\n}\n\n.offset-5 {\n margin-left: 41.666667%;\n}\n\n.offset-6 {\n margin-left: 50%;\n}\n\n.offset-7 {\n margin-left: 58.333333%;\n}\n\n.offset-8 {\n margin-left: 66.666667%;\n}\n\n.offset-9 {\n margin-left: 75%;\n}\n\n.offset-10 {\n margin-left: 83.333333%;\n}\n\n.offset-11 {\n margin-left: 91.666667%;\n}\n\n@media (min-width: 576px) {\n .col-sm {\n flex-basis: 0;\n flex-grow: 1;\n max-width: 100%;\n }\n .row-cols-sm-1 > * {\n flex: 0 0 100%;\n max-width: 100%;\n }\n .row-cols-sm-2 > * {\n flex: 0 0 50%;\n max-width: 50%;\n }\n .row-cols-sm-3 > * {\n flex: 0 0 33.333333%;\n max-width: 33.333333%;\n }\n .row-cols-sm-4 > * {\n flex: 0 0 25%;\n max-width: 25%;\n }\n .row-cols-sm-5 > * {\n flex: 0 0 20%;\n max-width: 20%;\n }\n .row-cols-sm-6 > * {\n flex: 0 0 16.666667%;\n max-width: 16.666667%;\n }\n .col-sm-auto {\n flex: 0 0 auto;\n width: auto;\n max-width: 100%;\n }\n .col-sm-1 {\n flex: 0 0 8.333333%;\n max-width: 8.333333%;\n }\n .col-sm-2 {\n flex: 0 0 16.666667%;\n max-width: 16.666667%;\n }\n .col-sm-3 {\n flex: 0 0 25%;\n max-width: 25%;\n }\n .col-sm-4 {\n flex: 0 0 33.333333%;\n max-width: 33.333333%;\n }\n .col-sm-5 {\n flex: 0 0 41.666667%;\n max-width: 41.666667%;\n }\n .col-sm-6 {\n flex: 0 0 50%;\n max-width: 50%;\n }\n .col-sm-7 {\n flex: 0 0 58.333333%;\n max-width: 58.333333%;\n }\n .col-sm-8 {\n flex: 0 0 66.666667%;\n max-width: 66.666667%;\n }\n .col-sm-9 {\n flex: 0 0 75%;\n max-width: 75%;\n }\n .col-sm-10 {\n flex: 0 0 83.333333%;\n max-width: 83.333333%;\n }\n .col-sm-11 {\n flex: 0 0 91.666667%;\n max-width: 91.666667%;\n }\n .col-sm-12 {\n flex: 0 0 100%;\n max-width: 100%;\n }\n .order-sm-first {\n order: -1;\n }\n .order-sm-last {\n order: 13;\n }\n .order-sm-0 {\n order: 0;\n }\n .order-sm-1 {\n order: 1;\n }\n .order-sm-2 {\n order: 2;\n }\n .order-sm-3 {\n order: 3;\n }\n .order-sm-4 {\n order: 4;\n }\n .order-sm-5 {\n order: 5;\n }\n .order-sm-6 {\n order: 6;\n }\n .order-sm-7 {\n order: 7;\n }\n .order-sm-8 {\n order: 8;\n }\n .order-sm-9 {\n order: 9;\n }\n .order-sm-10 {\n order: 10;\n }\n .order-sm-11 {\n order: 11;\n }\n .order-sm-12 {\n order: 12;\n }\n .offset-sm-0 {\n margin-left: 0;\n }\n .offset-sm-1 {\n margin-left: 8.333333%;\n }\n .offset-sm-2 {\n margin-left: 16.666667%;\n }\n .offset-sm-3 {\n margin-left: 25%;\n }\n .offset-sm-4 {\n margin-left: 33.333333%;\n }\n .offset-sm-5 {\n margin-left: 41.666667%;\n }\n .offset-sm-6 {\n margin-left: 50%;\n }\n .offset-sm-7 {\n margin-left: 58.333333%;\n }\n .offset-sm-8 {\n margin-left: 66.666667%;\n }\n .offset-sm-9 {\n margin-left: 75%;\n }\n .offset-sm-10 {\n margin-left: 83.333333%;\n }\n .offset-sm-11 {\n margin-left: 91.666667%;\n }\n}\n\n@media (min-width: 768px) {\n .col-md {\n flex-basis: 0;\n flex-grow: 1;\n max-width: 100%;\n }\n .row-cols-md-1 > * {\n flex: 0 0 100%;\n max-width: 100%;\n }\n .row-cols-md-2 > * {\n flex: 0 0 50%;\n max-width: 50%;\n }\n .row-cols-md-3 > * {\n flex: 0 0 33.333333%;\n max-width: 33.333333%;\n }\n .row-cols-md-4 > * {\n flex: 0 0 25%;\n max-width: 25%;\n }\n .row-cols-md-5 > * {\n flex: 0 0 20%;\n max-width: 20%;\n }\n .row-cols-md-6 > * {\n flex: 0 0 16.666667%;\n max-width: 16.666667%;\n }\n .col-md-auto {\n flex: 0 0 auto;\n width: auto;\n max-width: 100%;\n }\n .col-md-1 {\n flex: 0 0 8.333333%;\n max-width: 8.333333%;\n }\n .col-md-2 {\n flex: 0 0 16.666667%;\n max-width: 16.666667%;\n }\n .col-md-3 {\n flex: 0 0 25%;\n max-width: 25%;\n }\n .col-md-4 {\n flex: 0 0 33.333333%;\n max-width: 33.333333%;\n }\n .col-md-5 {\n flex: 0 0 41.666667%;\n max-width: 41.666667%;\n }\n .col-md-6 {\n flex: 0 0 50%;\n max-width: 50%;\n }\n .col-md-7 {\n flex: 0 0 58.333333%;\n max-width: 58.333333%;\n }\n .col-md-8 {\n flex: 0 0 66.666667%;\n max-width: 66.666667%;\n }\n .col-md-9 {\n flex: 0 0 75%;\n max-width: 75%;\n }\n .col-md-10 {\n flex: 0 0 83.333333%;\n max-width: 83.333333%;\n }\n .col-md-11 {\n flex: 0 0 91.666667%;\n max-width: 91.666667%;\n }\n .col-md-12 {\n flex: 0 0 100%;\n max-width: 100%;\n }\n .order-md-first {\n order: -1;\n }\n .order-md-last {\n order: 13;\n }\n .order-md-0 {\n order: 0;\n }\n .order-md-1 {\n order: 1;\n }\n .order-md-2 {\n order: 2;\n }\n .order-md-3 {\n order: 3;\n }\n .order-md-4 {\n order: 4;\n }\n .order-md-5 {\n order: 5;\n }\n .order-md-6 {\n order: 6;\n }\n .order-md-7 {\n order: 7;\n }\n .order-md-8 {\n order: 8;\n }\n .order-md-9 {\n order: 9;\n }\n .order-md-10 {\n order: 10;\n }\n .order-md-11 {\n order: 11;\n }\n .order-md-12 {\n order: 12;\n }\n .offset-md-0 {\n margin-left: 0;\n }\n .offset-md-1 {\n margin-left: 8.333333%;\n }\n .offset-md-2 {\n margin-left: 16.666667%;\n }\n .offset-md-3 {\n margin-left: 25%;\n }\n .offset-md-4 {\n margin-left: 33.333333%;\n }\n .offset-md-5 {\n margin-left: 41.666667%;\n }\n .offset-md-6 {\n margin-left: 50%;\n }\n .offset-md-7 {\n margin-left: 58.333333%;\n }\n .offset-md-8 {\n margin-left: 66.666667%;\n }\n .offset-md-9 {\n margin-left: 75%;\n }\n .offset-md-10 {\n margin-left: 83.333333%;\n }\n .offset-md-11 {\n margin-left: 91.666667%;\n }\n}\n\n@media (min-width: 992px) {\n .col-lg {\n flex-basis: 0;\n flex-grow: 1;\n max-width: 100%;\n }\n .row-cols-lg-1 > * {\n flex: 0 0 100%;\n max-width: 100%;\n }\n .row-cols-lg-2 > * {\n flex: 0 0 50%;\n max-width: 50%;\n }\n .row-cols-lg-3 > * {\n flex: 0 0 33.333333%;\n max-width: 33.333333%;\n }\n .row-cols-lg-4 > * {\n flex: 0 0 25%;\n max-width: 25%;\n }\n .row-cols-lg-5 > * {\n flex: 0 0 20%;\n max-width: 20%;\n }\n .row-cols-lg-6 > * {\n flex: 0 0 16.666667%;\n max-width: 16.666667%;\n }\n .col-lg-auto {\n flex: 0 0 auto;\n width: auto;\n max-width: 100%;\n }\n .col-lg-1 {\n flex: 0 0 8.333333%;\n max-width: 8.333333%;\n }\n .col-lg-2 {\n flex: 0 0 16.666667%;\n max-width: 16.666667%;\n }\n .col-lg-3 {\n flex: 0 0 25%;\n max-width: 25%;\n }\n .col-lg-4 {\n flex: 0 0 33.333333%;\n max-width: 33.333333%;\n }\n .col-lg-5 {\n flex: 0 0 41.666667%;\n max-width: 41.666667%;\n }\n .col-lg-6 {\n flex: 0 0 50%;\n max-width: 50%;\n }\n .col-lg-7 {\n flex: 0 0 58.333333%;\n max-width: 58.333333%;\n }\n .col-lg-8 {\n flex: 0 0 66.666667%;\n max-width: 66.666667%;\n }\n .col-lg-9 {\n flex: 0 0 75%;\n max-width: 75%;\n }\n .col-lg-10 {\n flex: 0 0 83.333333%;\n max-width: 83.333333%;\n }\n .col-lg-11 {\n flex: 0 0 91.666667%;\n max-width: 91.666667%;\n }\n .col-lg-12 {\n flex: 0 0 100%;\n max-width: 100%;\n }\n .order-lg-first {\n order: -1;\n }\n .order-lg-last {\n order: 13;\n }\n .order-lg-0 {\n order: 0;\n }\n .order-lg-1 {\n order: 1;\n }\n .order-lg-2 {\n order: 2;\n }\n .order-lg-3 {\n order: 3;\n }\n .order-lg-4 {\n order: 4;\n }\n .order-lg-5 {\n order: 5;\n }\n .order-lg-6 {\n order: 6;\n }\n .order-lg-7 {\n order: 7;\n }\n .order-lg-8 {\n order: 8;\n }\n .order-lg-9 {\n order: 9;\n }\n .order-lg-10 {\n order: 10;\n }\n .order-lg-11 {\n order: 11;\n }\n .order-lg-12 {\n order: 12;\n }\n .offset-lg-0 {\n margin-left: 0;\n }\n .offset-lg-1 {\n margin-left: 8.333333%;\n }\n .offset-lg-2 {\n margin-left: 16.666667%;\n }\n .offset-lg-3 {\n margin-left: 25%;\n }\n .offset-lg-4 {\n margin-left: 33.333333%;\n }\n .offset-lg-5 {\n margin-left: 41.666667%;\n }\n .offset-lg-6 {\n margin-left: 50%;\n }\n .offset-lg-7 {\n margin-left: 58.333333%;\n }\n .offset-lg-8 {\n margin-left: 66.666667%;\n }\n .offset-lg-9 {\n margin-left: 75%;\n }\n .offset-lg-10 {\n margin-left: 83.333333%;\n }\n .offset-lg-11 {\n margin-left: 91.666667%;\n }\n}\n\n@media (min-width: 1200px) {\n .col-xl {\n flex-basis: 0;\n flex-grow: 1;\n max-width: 100%;\n }\n .row-cols-xl-1 > * {\n flex: 0 0 100%;\n max-width: 100%;\n }\n .row-cols-xl-2 > * {\n flex: 0 0 50%;\n max-width: 50%;\n }\n .row-cols-xl-3 > * {\n flex: 0 0 33.333333%;\n max-width: 33.333333%;\n }\n .row-cols-xl-4 > * {\n flex: 0 0 25%;\n max-width: 25%;\n }\n .row-cols-xl-5 > * {\n flex: 0 0 20%;\n max-width: 20%;\n }\n .row-cols-xl-6 > * {\n flex: 0 0 16.666667%;\n max-width: 16.666667%;\n }\n .col-xl-auto {\n flex: 0 0 auto;\n width: auto;\n max-width: 100%;\n }\n .col-xl-1 {\n flex: 0 0 8.333333%;\n max-width: 8.333333%;\n }\n .col-xl-2 {\n flex: 0 0 16.666667%;\n max-width: 16.666667%;\n }\n .col-xl-3 {\n flex: 0 0 25%;\n max-width: 25%;\n }\n .col-xl-4 {\n flex: 0 0 33.333333%;\n max-width: 33.333333%;\n }\n .col-xl-5 {\n flex: 0 0 41.666667%;\n max-width: 41.666667%;\n }\n .col-xl-6 {\n flex: 0 0 50%;\n max-width: 50%;\n }\n .col-xl-7 {\n flex: 0 0 58.333333%;\n max-width: 58.333333%;\n }\n .col-xl-8 {\n flex: 0 0 66.666667%;\n max-width: 66.666667%;\n }\n .col-xl-9 {\n flex: 0 0 75%;\n max-width: 75%;\n }\n .col-xl-10 {\n flex: 0 0 83.333333%;\n max-width: 83.333333%;\n }\n .col-xl-11 {\n flex: 0 0 91.666667%;\n max-width: 91.666667%;\n }\n .col-xl-12 {\n flex: 0 0 100%;\n max-width: 100%;\n }\n .order-xl-first {\n order: -1;\n }\n .order-xl-last {\n order: 13;\n }\n .order-xl-0 {\n order: 0;\n }\n .order-xl-1 {\n order: 1;\n }\n .order-xl-2 {\n order: 2;\n }\n .order-xl-3 {\n order: 3;\n }\n .order-xl-4 {\n order: 4;\n }\n .order-xl-5 {\n order: 5;\n }\n .order-xl-6 {\n order: 6;\n }\n .order-xl-7 {\n order: 7;\n }\n .order-xl-8 {\n order: 8;\n }\n .order-xl-9 {\n order: 9;\n }\n .order-xl-10 {\n order: 10;\n }\n .order-xl-11 {\n order: 11;\n }\n .order-xl-12 {\n order: 12;\n }\n .offset-xl-0 {\n margin-left: 0;\n }\n .offset-xl-1 {\n margin-left: 8.333333%;\n }\n .offset-xl-2 {\n margin-left: 16.666667%;\n }\n .offset-xl-3 {\n margin-left: 25%;\n }\n .offset-xl-4 {\n margin-left: 33.333333%;\n }\n .offset-xl-5 {\n margin-left: 41.666667%;\n }\n .offset-xl-6 {\n margin-left: 50%;\n }\n .offset-xl-7 {\n margin-left: 58.333333%;\n }\n .offset-xl-8 {\n margin-left: 66.666667%;\n }\n .offset-xl-9 {\n margin-left: 75%;\n }\n .offset-xl-10 {\n margin-left: 83.333333%;\n }\n .offset-xl-11 {\n margin-left: 91.666667%;\n }\n}\n\n.table {\n width: 100%;\n margin-bottom: 1rem;\n color: #212529;\n}\n\n.table th,\n.table td {\n padding: 0.75rem;\n vertical-align: top;\n border-top: 1px solid #dee2e6;\n}\n\n.table thead th {\n vertical-align: bottom;\n border-bottom: 2px solid #dee2e6;\n}\n\n.table tbody + tbody {\n border-top: 2px solid #dee2e6;\n}\n\n.table-sm th,\n.table-sm td {\n padding: 0.3rem;\n}\n\n.table-bordered {\n border: 1px solid #dee2e6;\n}\n\n.table-bordered th,\n.table-bordered td {\n border: 1px solid #dee2e6;\n}\n\n.table-bordered thead th,\n.table-bordered thead td {\n border-bottom-width: 2px;\n}\n\n.table-borderless th,\n.table-borderless td,\n.table-borderless thead th,\n.table-borderless tbody + tbody {\n border: 0;\n}\n\n.table-striped tbody tr:nth-of-type(odd) {\n background-color: rgba(0, 0, 0, 0.05);\n}\n\n.table-hover tbody tr:hover {\n color: #212529;\n background-color: rgba(0, 0, 0, 0.075);\n}\n\n.table-primary,\n.table-primary > th,\n.table-primary > td {\n background-color: #b8daff;\n}\n\n.table-primary th,\n.table-primary td,\n.table-primary thead th,\n.table-primary tbody + tbody {\n border-color: #7abaff;\n}\n\n.table-hover .table-primary:hover {\n background-color: #9fcdff;\n}\n\n.table-hover .table-primary:hover > td,\n.table-hover .table-primary:hover > th {\n background-color: #9fcdff;\n}\n\n.table-secondary,\n.table-secondary > th,\n.table-secondary > td {\n background-color: #d6d8db;\n}\n\n.table-secondary th,\n.table-secondary td,\n.table-secondary thead th,\n.table-secondary tbody + tbody {\n border-color: #b3b7bb;\n}\n\n.table-hover .table-secondary:hover {\n background-color: #c8cbcf;\n}\n\n.table-hover .table-secondary:hover > td,\n.table-hover .table-secondary:hover > th {\n background-color: #c8cbcf;\n}\n\n.table-success,\n.table-success > th,\n.table-success > td {\n background-color: #c3e6cb;\n}\n\n.table-success th,\n.table-success td,\n.table-success thead th,\n.table-success tbody + tbody {\n border-color: #8fd19e;\n}\n\n.table-hover .table-success:hover {\n background-color: #b1dfbb;\n}\n\n.table-hover .table-success:hover > td,\n.table-hover .table-success:hover > th {\n background-color: #b1dfbb;\n}\n\n.table-info,\n.table-info > th,\n.table-info > td {\n background-color: #bee5eb;\n}\n\n.table-info th,\n.table-info td,\n.table-info thead th,\n.table-info tbody + tbody {\n border-color: #86cfda;\n}\n\n.table-hover .table-info:hover {\n background-color: #abdde5;\n}\n\n.table-hover .table-info:hover > td,\n.table-hover .table-info:hover > th {\n background-color: #abdde5;\n}\n\n.table-warning,\n.table-warning > th,\n.table-warning > td {\n background-color: #ffeeba;\n}\n\n.table-warning th,\n.table-warning td,\n.table-warning thead th,\n.table-warning tbody + tbody {\n border-color: #ffdf7e;\n}\n\n.table-hover .table-warning:hover {\n background-color: #ffe8a1;\n}\n\n.table-hover .table-warning:hover > td,\n.table-hover .table-warning:hover > th {\n background-color: #ffe8a1;\n}\n\n.table-danger,\n.table-danger > th,\n.table-danger > td {\n background-color: #f5c6cb;\n}\n\n.table-danger th,\n.table-danger td,\n.table-danger thead th,\n.table-danger tbody + tbody {\n border-color: #ed969e;\n}\n\n.table-hover .table-danger:hover {\n background-color: #f1b0b7;\n}\n\n.table-hover .table-danger:hover > td,\n.table-hover .table-danger:hover > th {\n background-color: #f1b0b7;\n}\n\n.table-light,\n.table-light > th,\n.table-light > td {\n background-color: #fdfdfe;\n}\n\n.table-light th,\n.table-light td,\n.table-light thead th,\n.table-light tbody + tbody {\n border-color: #fbfcfc;\n}\n\n.table-hover .table-light:hover {\n background-color: #ececf6;\n}\n\n.table-hover .table-light:hover > td,\n.table-hover .table-light:hover > th {\n background-color: #ececf6;\n}\n\n.table-dark,\n.table-dark > th,\n.table-dark > td {\n background-color: #c6c8ca;\n}\n\n.table-dark th,\n.table-dark td,\n.table-dark thead th,\n.table-dark tbody + tbody {\n border-color: #95999c;\n}\n\n.table-hover .table-dark:hover {\n background-color: #b9bbbe;\n}\n\n.table-hover .table-dark:hover > td,\n.table-hover .table-dark:hover > th {\n background-color: #b9bbbe;\n}\n\n.table-active,\n.table-active > th,\n.table-active > td {\n background-color: rgba(0, 0, 0, 0.075);\n}\n\n.table-hover .table-active:hover {\n background-color: rgba(0, 0, 0, 0.075);\n}\n\n.table-hover .table-active:hover > td,\n.table-hover .table-active:hover > th {\n background-color: rgba(0, 0, 0, 0.075);\n}\n\n.table .thead-dark th {\n color: #fff;\n background-color: #343a40;\n border-color: #454d55;\n}\n\n.table .thead-light th {\n color: #495057;\n background-color: #e9ecef;\n border-color: #dee2e6;\n}\n\n.table-dark {\n color: #fff;\n background-color: #343a40;\n}\n\n.table-dark th,\n.table-dark td,\n.table-dark thead th {\n border-color: #454d55;\n}\n\n.table-dark.table-bordered {\n border: 0;\n}\n\n.table-dark.table-striped tbody tr:nth-of-type(odd) {\n background-color: rgba(255, 255, 255, 0.05);\n}\n\n.table-dark.table-hover tbody tr:hover {\n color: #fff;\n background-color: rgba(255, 255, 255, 0.075);\n}\n\n@media (max-width: 575.98px) {\n .table-responsive-sm {\n display: block;\n width: 100%;\n overflow-x: auto;\n -webkit-overflow-scrolling: touch;\n }\n .table-responsive-sm > .table-bordered {\n border: 0;\n }\n}\n\n@media (max-width: 767.98px) {\n .table-responsive-md {\n display: block;\n width: 100%;\n overflow-x: auto;\n -webkit-overflow-scrolling: touch;\n }\n .table-responsive-md > .table-bordered {\n border: 0;\n }\n}\n\n@media (max-width: 991.98px) {\n .table-responsive-lg {\n display: block;\n width: 100%;\n overflow-x: auto;\n -webkit-overflow-scrolling: touch;\n }\n .table-responsive-lg > .table-bordered {\n border: 0;\n }\n}\n\n@media (max-width: 1199.98px) {\n .table-responsive-xl {\n display: block;\n width: 100%;\n overflow-x: auto;\n -webkit-overflow-scrolling: touch;\n }\n .table-responsive-xl > .table-bordered {\n border: 0;\n }\n}\n\n.table-responsive {\n display: block;\n width: 100%;\n overflow-x: auto;\n -webkit-overflow-scrolling: touch;\n}\n\n.table-responsive > .table-bordered {\n border: 0;\n}\n\n.form-control {\n display: block;\n width: 100%;\n height: calc(1.5em + 0.75rem + 2px);\n padding: 0.375rem 0.75rem;\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.5;\n color: #495057;\n background-color: #fff;\n background-clip: padding-box;\n border: 1px solid #ced4da;\n border-radius: 0.25rem;\n transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .form-control {\n transition: none;\n }\n}\n\n.form-control::-ms-expand {\n background-color: transparent;\n border: 0;\n}\n\n.form-control:-moz-focusring {\n color: transparent;\n text-shadow: 0 0 0 #495057;\n}\n\n.form-control:focus {\n color: #495057;\n background-color: #fff;\n border-color: #80bdff;\n outline: 0;\n box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);\n}\n\n.form-control::placeholder {\n color: #6c757d;\n opacity: 1;\n}\n\n.form-control:disabled, .form-control[readonly] {\n background-color: #e9ecef;\n opacity: 1;\n}\n\ninput[type=\"date\"].form-control,\ninput[type=\"time\"].form-control,\ninput[type=\"datetime-local\"].form-control,\ninput[type=\"month\"].form-control {\n appearance: none;\n}\n\nselect.form-control:focus::-ms-value {\n color: #495057;\n background-color: #fff;\n}\n\n.form-control-file,\n.form-control-range {\n display: block;\n width: 100%;\n}\n\n.col-form-label {\n padding-top: calc(0.375rem + 1px);\n padding-bottom: calc(0.375rem + 1px);\n margin-bottom: 0;\n font-size: inherit;\n line-height: 1.5;\n}\n\n.col-form-label-lg {\n padding-top: calc(0.5rem + 1px);\n padding-bottom: calc(0.5rem + 1px);\n font-size: 1.25rem;\n line-height: 1.5;\n}\n\n.col-form-label-sm {\n padding-top: calc(0.25rem + 1px);\n padding-bottom: calc(0.25rem + 1px);\n font-size: 0.875rem;\n line-height: 1.5;\n}\n\n.form-control-plaintext {\n display: block;\n width: 100%;\n padding: 0.375rem 0;\n margin-bottom: 0;\n font-size: 1rem;\n line-height: 1.5;\n color: #212529;\n background-color: transparent;\n border: solid transparent;\n border-width: 1px 0;\n}\n\n.form-control-plaintext.form-control-sm, .form-control-plaintext.form-control-lg {\n padding-right: 0;\n padding-left: 0;\n}\n\n.form-control-sm {\n height: calc(1.5em + 0.5rem + 2px);\n padding: 0.25rem 0.5rem;\n font-size: 0.875rem;\n line-height: 1.5;\n border-radius: 0.2rem;\n}\n\n.form-control-lg {\n height: calc(1.5em + 1rem + 2px);\n padding: 0.5rem 1rem;\n font-size: 1.25rem;\n line-height: 1.5;\n border-radius: 0.3rem;\n}\n\nselect.form-control[size], select.form-control[multiple] {\n height: auto;\n}\n\ntextarea.form-control {\n height: auto;\n}\n\n.form-group {\n margin-bottom: 1rem;\n}\n\n.form-text {\n display: block;\n margin-top: 0.25rem;\n}\n\n.form-row {\n display: flex;\n flex-wrap: wrap;\n margin-right: -5px;\n margin-left: -5px;\n}\n\n.form-row > .col,\n.form-row > [class*=\"col-\"] {\n padding-right: 5px;\n padding-left: 5px;\n}\n\n.form-check {\n position: relative;\n display: block;\n padding-left: 1.25rem;\n}\n\n.form-check-input {\n position: absolute;\n margin-top: 0.3rem;\n margin-left: -1.25rem;\n}\n\n.form-check-input[disabled] ~ .form-check-label,\n.form-check-input:disabled ~ .form-check-label {\n color: #6c757d;\n}\n\n.form-check-label {\n margin-bottom: 0;\n}\n\n.form-check-inline {\n display: inline-flex;\n align-items: center;\n padding-left: 0;\n margin-right: 0.75rem;\n}\n\n.form-check-inline .form-check-input {\n position: static;\n margin-top: 0;\n margin-right: 0.3125rem;\n margin-left: 0;\n}\n\n.valid-feedback {\n display: none;\n width: 100%;\n margin-top: 0.25rem;\n font-size: 80%;\n color: #28a745;\n}\n\n.valid-tooltip {\n position: absolute;\n top: 100%;\n left: 0;\n z-index: 5;\n display: none;\n max-width: 100%;\n padding: 0.25rem 0.5rem;\n margin-top: .1rem;\n font-size: 0.875rem;\n line-height: 1.5;\n color: #fff;\n background-color: rgba(40, 167, 69, 0.9);\n border-radius: 0.25rem;\n}\n\n.form-row > .col > .valid-tooltip,\n.form-row > [class*=\"col-\"] > .valid-tooltip {\n left: 5px;\n}\n\n.was-validated :valid ~ .valid-feedback,\n.was-validated :valid ~ .valid-tooltip,\n.is-valid ~ .valid-feedback,\n.is-valid ~ .valid-tooltip {\n display: block;\n}\n\n.was-validated .form-control:valid, .form-control.is-valid {\n border-color: #28a745;\n padding-right: calc(1.5em + 0.75rem);\n background-image: url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e\");\n background-repeat: no-repeat;\n background-position: right calc(0.375em + 0.1875rem) center;\n background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);\n}\n\n.was-validated .form-control:valid:focus, .form-control.is-valid:focus {\n border-color: #28a745;\n box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);\n}\n\n.was-validated textarea.form-control:valid, textarea.form-control.is-valid {\n padding-right: calc(1.5em + 0.75rem);\n background-position: top calc(0.375em + 0.1875rem) right calc(0.375em + 0.1875rem);\n}\n\n.was-validated .custom-select:valid, .custom-select.is-valid {\n border-color: #28a745;\n padding-right: calc(0.75em + 2.3125rem);\n background: url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e\") right 0.75rem center/8px 10px no-repeat, #fff url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e\") center right 1.75rem/calc(0.75em + 0.375rem) calc(0.75em + 0.375rem) no-repeat;\n}\n\n.was-validated .custom-select:valid:focus, .custom-select.is-valid:focus {\n border-color: #28a745;\n box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);\n}\n\n.was-validated .form-check-input:valid ~ .form-check-label, .form-check-input.is-valid ~ .form-check-label {\n color: #28a745;\n}\n\n.was-validated .form-check-input:valid ~ .valid-feedback,\n.was-validated .form-check-input:valid ~ .valid-tooltip, .form-check-input.is-valid ~ .valid-feedback,\n.form-check-input.is-valid ~ .valid-tooltip {\n display: block;\n}\n\n.was-validated .custom-control-input:valid ~ .custom-control-label, .custom-control-input.is-valid ~ .custom-control-label {\n color: #28a745;\n}\n\n.was-validated .custom-control-input:valid ~ .custom-control-label::before, .custom-control-input.is-valid ~ .custom-control-label::before {\n border-color: #28a745;\n}\n\n.was-validated .custom-control-input:valid:checked ~ .custom-control-label::before, .custom-control-input.is-valid:checked ~ .custom-control-label::before {\n border-color: #34ce57;\n background-color: #34ce57;\n}\n\n.was-validated .custom-control-input:valid:focus ~ .custom-control-label::before, .custom-control-input.is-valid:focus ~ .custom-control-label::before {\n box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);\n}\n\n.was-validated .custom-control-input:valid:focus:not(:checked) ~ .custom-control-label::before, .custom-control-input.is-valid:focus:not(:checked) ~ .custom-control-label::before {\n border-color: #28a745;\n}\n\n.was-validated .custom-file-input:valid ~ .custom-file-label, .custom-file-input.is-valid ~ .custom-file-label {\n border-color: #28a745;\n}\n\n.was-validated .custom-file-input:valid:focus ~ .custom-file-label, .custom-file-input.is-valid:focus ~ .custom-file-label {\n border-color: #28a745;\n box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);\n}\n\n.invalid-feedback {\n display: none;\n width: 100%;\n margin-top: 0.25rem;\n font-size: 80%;\n color: #dc3545;\n}\n\n.invalid-tooltip {\n position: absolute;\n top: 100%;\n left: 0;\n z-index: 5;\n display: none;\n max-width: 100%;\n padding: 0.25rem 0.5rem;\n margin-top: .1rem;\n font-size: 0.875rem;\n line-height: 1.5;\n color: #fff;\n background-color: rgba(220, 53, 69, 0.9);\n border-radius: 0.25rem;\n}\n\n.form-row > .col > .invalid-tooltip,\n.form-row > [class*=\"col-\"] > .invalid-tooltip {\n left: 5px;\n}\n\n.was-validated :invalid ~ .invalid-feedback,\n.was-validated :invalid ~ .invalid-tooltip,\n.is-invalid ~ .invalid-feedback,\n.is-invalid ~ .invalid-tooltip {\n display: block;\n}\n\n.was-validated .form-control:invalid, .form-control.is-invalid {\n border-color: #dc3545;\n padding-right: calc(1.5em + 0.75rem);\n background-image: url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e\");\n background-repeat: no-repeat;\n background-position: right calc(0.375em + 0.1875rem) center;\n background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);\n}\n\n.was-validated .form-control:invalid:focus, .form-control.is-invalid:focus {\n border-color: #dc3545;\n box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);\n}\n\n.was-validated textarea.form-control:invalid, textarea.form-control.is-invalid {\n padding-right: calc(1.5em + 0.75rem);\n background-position: top calc(0.375em + 0.1875rem) right calc(0.375em + 0.1875rem);\n}\n\n.was-validated .custom-select:invalid, .custom-select.is-invalid {\n border-color: #dc3545;\n padding-right: calc(0.75em + 2.3125rem);\n background: url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e\") right 0.75rem center/8px 10px no-repeat, #fff url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e\") center right 1.75rem/calc(0.75em + 0.375rem) calc(0.75em + 0.375rem) no-repeat;\n}\n\n.was-validated .custom-select:invalid:focus, .custom-select.is-invalid:focus {\n border-color: #dc3545;\n box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);\n}\n\n.was-validated .form-check-input:invalid ~ .form-check-label, .form-check-input.is-invalid ~ .form-check-label {\n color: #dc3545;\n}\n\n.was-validated .form-check-input:invalid ~ .invalid-feedback,\n.was-validated .form-check-input:invalid ~ .invalid-tooltip, .form-check-input.is-invalid ~ .invalid-feedback,\n.form-check-input.is-invalid ~ .invalid-tooltip {\n display: block;\n}\n\n.was-validated .custom-control-input:invalid ~ .custom-control-label, .custom-control-input.is-invalid ~ .custom-control-label {\n color: #dc3545;\n}\n\n.was-validated .custom-control-input:invalid ~ .custom-control-label::before, .custom-control-input.is-invalid ~ .custom-control-label::before {\n border-color: #dc3545;\n}\n\n.was-validated .custom-control-input:invalid:checked ~ .custom-control-label::before, .custom-control-input.is-invalid:checked ~ .custom-control-label::before {\n border-color: #e4606d;\n background-color: #e4606d;\n}\n\n.was-validated .custom-control-input:invalid:focus ~ .custom-control-label::before, .custom-control-input.is-invalid:focus ~ .custom-control-label::before {\n box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);\n}\n\n.was-validated .custom-control-input:invalid:focus:not(:checked) ~ .custom-control-label::before, .custom-control-input.is-invalid:focus:not(:checked) ~ .custom-control-label::before {\n border-color: #dc3545;\n}\n\n.was-validated .custom-file-input:invalid ~ .custom-file-label, .custom-file-input.is-invalid ~ .custom-file-label {\n border-color: #dc3545;\n}\n\n.was-validated .custom-file-input:invalid:focus ~ .custom-file-label, .custom-file-input.is-invalid:focus ~ .custom-file-label {\n border-color: #dc3545;\n box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);\n}\n\n.form-inline {\n display: flex;\n flex-flow: row wrap;\n align-items: center;\n}\n\n.form-inline .form-check {\n width: 100%;\n}\n\n@media (min-width: 576px) {\n .form-inline label {\n display: flex;\n align-items: center;\n justify-content: center;\n margin-bottom: 0;\n }\n .form-inline .form-group {\n display: flex;\n flex: 0 0 auto;\n flex-flow: row wrap;\n align-items: center;\n margin-bottom: 0;\n }\n .form-inline .form-control {\n display: inline-block;\n width: auto;\n vertical-align: middle;\n }\n .form-inline .form-control-plaintext {\n display: inline-block;\n }\n .form-inline .input-group,\n .form-inline .custom-select {\n width: auto;\n }\n .form-inline .form-check {\n display: flex;\n align-items: center;\n justify-content: center;\n width: auto;\n padding-left: 0;\n }\n .form-inline .form-check-input {\n position: relative;\n flex-shrink: 0;\n margin-top: 0;\n margin-right: 0.25rem;\n margin-left: 0;\n }\n .form-inline .custom-control {\n align-items: center;\n justify-content: center;\n }\n .form-inline .custom-control-label {\n margin-bottom: 0;\n }\n}\n\n.btn {\n display: inline-block;\n font-weight: 400;\n color: #212529;\n text-align: center;\n vertical-align: middle;\n user-select: none;\n background-color: transparent;\n border: 1px solid transparent;\n padding: 0.375rem 0.75rem;\n font-size: 1rem;\n line-height: 1.5;\n border-radius: 0.25rem;\n transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .btn {\n transition: none;\n }\n}\n\n.btn:hover {\n color: #212529;\n text-decoration: none;\n}\n\n.btn:focus, .btn.focus {\n outline: 0;\n box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);\n}\n\n.btn.disabled, .btn:disabled {\n opacity: 0.65;\n}\n\n.btn:not(:disabled):not(.disabled) {\n cursor: pointer;\n}\n\na.btn.disabled,\nfieldset:disabled a.btn {\n pointer-events: none;\n}\n\n.btn-primary {\n color: #fff;\n background-color: #007bff;\n border-color: #007bff;\n}\n\n.btn-primary:hover {\n color: #fff;\n background-color: #0069d9;\n border-color: #0062cc;\n}\n\n.btn-primary:focus, .btn-primary.focus {\n color: #fff;\n background-color: #0069d9;\n border-color: #0062cc;\n box-shadow: 0 0 0 0.2rem rgba(38, 143, 255, 0.5);\n}\n\n.btn-primary.disabled, .btn-primary:disabled {\n color: #fff;\n background-color: #007bff;\n border-color: #007bff;\n}\n\n.btn-primary:not(:disabled):not(.disabled):active, .btn-primary:not(:disabled):not(.disabled).active,\n.show > .btn-primary.dropdown-toggle {\n color: #fff;\n background-color: #0062cc;\n border-color: #005cbf;\n}\n\n.btn-primary:not(:disabled):not(.disabled):active:focus, .btn-primary:not(:disabled):not(.disabled).active:focus,\n.show > .btn-primary.dropdown-toggle:focus {\n box-shadow: 0 0 0 0.2rem rgba(38, 143, 255, 0.5);\n}\n\n.btn-secondary {\n color: #fff;\n background-color: #6c757d;\n border-color: #6c757d;\n}\n\n.btn-secondary:hover {\n color: #fff;\n background-color: #5a6268;\n border-color: #545b62;\n}\n\n.btn-secondary:focus, .btn-secondary.focus {\n color: #fff;\n background-color: #5a6268;\n border-color: #545b62;\n box-shadow: 0 0 0 0.2rem rgba(130, 138, 145, 0.5);\n}\n\n.btn-secondary.disabled, .btn-secondary:disabled {\n color: #fff;\n background-color: #6c757d;\n border-color: #6c757d;\n}\n\n.btn-secondary:not(:disabled):not(.disabled):active, .btn-secondary:not(:disabled):not(.disabled).active,\n.show > .btn-secondary.dropdown-toggle {\n color: #fff;\n background-color: #545b62;\n border-color: #4e555b;\n}\n\n.btn-secondary:not(:disabled):not(.disabled):active:focus, .btn-secondary:not(:disabled):not(.disabled).active:focus,\n.show > .btn-secondary.dropdown-toggle:focus {\n box-shadow: 0 0 0 0.2rem rgba(130, 138, 145, 0.5);\n}\n\n.btn-success {\n color: #fff;\n background-color: #28a745;\n border-color: #28a745;\n}\n\n.btn-success:hover {\n color: #fff;\n background-color: #218838;\n border-color: #1e7e34;\n}\n\n.btn-success:focus, .btn-success.focus {\n color: #fff;\n background-color: #218838;\n border-color: #1e7e34;\n box-shadow: 0 0 0 0.2rem rgba(72, 180, 97, 0.5);\n}\n\n.btn-success.disabled, .btn-success:disabled {\n color: #fff;\n background-color: #28a745;\n border-color: #28a745;\n}\n\n.btn-success:not(:disabled):not(.disabled):active, .btn-success:not(:disabled):not(.disabled).active,\n.show > .btn-success.dropdown-toggle {\n color: #fff;\n background-color: #1e7e34;\n border-color: #1c7430;\n}\n\n.btn-success:not(:disabled):not(.disabled):active:focus, .btn-success:not(:disabled):not(.disabled).active:focus,\n.show > .btn-success.dropdown-toggle:focus {\n box-shadow: 0 0 0 0.2rem rgba(72, 180, 97, 0.5);\n}\n\n.btn-info {\n color: #fff;\n background-color: #17a2b8;\n border-color: #17a2b8;\n}\n\n.btn-info:hover {\n color: #fff;\n background-color: #138496;\n border-color: #117a8b;\n}\n\n.btn-info:focus, .btn-info.focus {\n color: #fff;\n background-color: #138496;\n border-color: #117a8b;\n box-shadow: 0 0 0 0.2rem rgba(58, 176, 195, 0.5);\n}\n\n.btn-info.disabled, .btn-info:disabled {\n color: #fff;\n background-color: #17a2b8;\n border-color: #17a2b8;\n}\n\n.btn-info:not(:disabled):not(.disabled):active, .btn-info:not(:disabled):not(.disabled).active,\n.show > .btn-info.dropdown-toggle {\n color: #fff;\n background-color: #117a8b;\n border-color: #10707f;\n}\n\n.btn-info:not(:disabled):not(.disabled):active:focus, .btn-info:not(:disabled):not(.disabled).active:focus,\n.show > .btn-info.dropdown-toggle:focus {\n box-shadow: 0 0 0 0.2rem rgba(58, 176, 195, 0.5);\n}\n\n.btn-warning {\n color: #212529;\n background-color: #ffc107;\n border-color: #ffc107;\n}\n\n.btn-warning:hover {\n color: #212529;\n background-color: #e0a800;\n border-color: #d39e00;\n}\n\n.btn-warning:focus, .btn-warning.focus {\n color: #212529;\n background-color: #e0a800;\n border-color: #d39e00;\n box-shadow: 0 0 0 0.2rem rgba(222, 170, 12, 0.5);\n}\n\n.btn-warning.disabled, .btn-warning:disabled {\n color: #212529;\n background-color: #ffc107;\n border-color: #ffc107;\n}\n\n.btn-warning:not(:disabled):not(.disabled):active, .btn-warning:not(:disabled):not(.disabled).active,\n.show > .btn-warning.dropdown-toggle {\n color: #212529;\n background-color: #d39e00;\n border-color: #c69500;\n}\n\n.btn-warning:not(:disabled):not(.disabled):active:focus, .btn-warning:not(:disabled):not(.disabled).active:focus,\n.show > .btn-warning.dropdown-toggle:focus {\n box-shadow: 0 0 0 0.2rem rgba(222, 170, 12, 0.5);\n}\n\n.btn-danger {\n color: #fff;\n background-color: #dc3545;\n border-color: #dc3545;\n}\n\n.btn-danger:hover {\n color: #fff;\n background-color: #c82333;\n border-color: #bd2130;\n}\n\n.btn-danger:focus, .btn-danger.focus {\n color: #fff;\n background-color: #c82333;\n border-color: #bd2130;\n box-shadow: 0 0 0 0.2rem rgba(225, 83, 97, 0.5);\n}\n\n.btn-danger.disabled, .btn-danger:disabled {\n color: #fff;\n background-color: #dc3545;\n border-color: #dc3545;\n}\n\n.btn-danger:not(:disabled):not(.disabled):active, .btn-danger:not(:disabled):not(.disabled).active,\n.show > .btn-danger.dropdown-toggle {\n color: #fff;\n background-color: #bd2130;\n border-color: #b21f2d;\n}\n\n.btn-danger:not(:disabled):not(.disabled):active:focus, .btn-danger:not(:disabled):not(.disabled).active:focus,\n.show > .btn-danger.dropdown-toggle:focus {\n box-shadow: 0 0 0 0.2rem rgba(225, 83, 97, 0.5);\n}\n\n.btn-light {\n color: #212529;\n background-color: #f8f9fa;\n border-color: #f8f9fa;\n}\n\n.btn-light:hover {\n color: #212529;\n background-color: #e2e6ea;\n border-color: #dae0e5;\n}\n\n.btn-light:focus, .btn-light.focus {\n color: #212529;\n background-color: #e2e6ea;\n border-color: #dae0e5;\n box-shadow: 0 0 0 0.2rem rgba(216, 217, 219, 0.5);\n}\n\n.btn-light.disabled, .btn-light:disabled {\n color: #212529;\n background-color: #f8f9fa;\n border-color: #f8f9fa;\n}\n\n.btn-light:not(:disabled):not(.disabled):active, .btn-light:not(:disabled):not(.disabled).active,\n.show > .btn-light.dropdown-toggle {\n color: #212529;\n background-color: #dae0e5;\n border-color: #d3d9df;\n}\n\n.btn-light:not(:disabled):not(.disabled):active:focus, .btn-light:not(:disabled):not(.disabled).active:focus,\n.show > .btn-light.dropdown-toggle:focus {\n box-shadow: 0 0 0 0.2rem rgba(216, 217, 219, 0.5);\n}\n\n.btn-dark {\n color: #fff;\n background-color: #343a40;\n border-color: #343a40;\n}\n\n.btn-dark:hover {\n color: #fff;\n background-color: #23272b;\n border-color: #1d2124;\n}\n\n.btn-dark:focus, .btn-dark.focus {\n color: #fff;\n background-color: #23272b;\n border-color: #1d2124;\n box-shadow: 0 0 0 0.2rem rgba(82, 88, 93, 0.5);\n}\n\n.btn-dark.disabled, .btn-dark:disabled {\n color: #fff;\n background-color: #343a40;\n border-color: #343a40;\n}\n\n.btn-dark:not(:disabled):not(.disabled):active, .btn-dark:not(:disabled):not(.disabled).active,\n.show > .btn-dark.dropdown-toggle {\n color: #fff;\n background-color: #1d2124;\n border-color: #171a1d;\n}\n\n.btn-dark:not(:disabled):not(.disabled):active:focus, .btn-dark:not(:disabled):not(.disabled).active:focus,\n.show > .btn-dark.dropdown-toggle:focus {\n box-shadow: 0 0 0 0.2rem rgba(82, 88, 93, 0.5);\n}\n\n.btn-outline-primary {\n color: #007bff;\n border-color: #007bff;\n}\n\n.btn-outline-primary:hover {\n color: #fff;\n background-color: #007bff;\n border-color: #007bff;\n}\n\n.btn-outline-primary:focus, .btn-outline-primary.focus {\n box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5);\n}\n\n.btn-outline-primary.disabled, .btn-outline-primary:disabled {\n color: #007bff;\n background-color: transparent;\n}\n\n.btn-outline-primary:not(:disabled):not(.disabled):active, .btn-outline-primary:not(:disabled):not(.disabled).active,\n.show > .btn-outline-primary.dropdown-toggle {\n color: #fff;\n background-color: #007bff;\n border-color: #007bff;\n}\n\n.btn-outline-primary:not(:disabled):not(.disabled):active:focus, .btn-outline-primary:not(:disabled):not(.disabled).active:focus,\n.show > .btn-outline-primary.dropdown-toggle:focus {\n box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5);\n}\n\n.btn-outline-secondary {\n color: #6c757d;\n border-color: #6c757d;\n}\n\n.btn-outline-secondary:hover {\n color: #fff;\n background-color: #6c757d;\n border-color: #6c757d;\n}\n\n.btn-outline-secondary:focus, .btn-outline-secondary.focus {\n box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.5);\n}\n\n.btn-outline-secondary.disabled, .btn-outline-secondary:disabled {\n color: #6c757d;\n background-color: transparent;\n}\n\n.btn-outline-secondary:not(:disabled):not(.disabled):active, .btn-outline-secondary:not(:disabled):not(.disabled).active,\n.show > .btn-outline-secondary.dropdown-toggle {\n color: #fff;\n background-color: #6c757d;\n border-color: #6c757d;\n}\n\n.btn-outline-secondary:not(:disabled):not(.disabled):active:focus, .btn-outline-secondary:not(:disabled):not(.disabled).active:focus,\n.show > .btn-outline-secondary.dropdown-toggle:focus {\n box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.5);\n}\n\n.btn-outline-success {\n color: #28a745;\n border-color: #28a745;\n}\n\n.btn-outline-success:hover {\n color: #fff;\n background-color: #28a745;\n border-color: #28a745;\n}\n\n.btn-outline-success:focus, .btn-outline-success.focus {\n box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5);\n}\n\n.btn-outline-success.disabled, .btn-outline-success:disabled {\n color: #28a745;\n background-color: transparent;\n}\n\n.btn-outline-success:not(:disabled):not(.disabled):active, .btn-outline-success:not(:disabled):not(.disabled).active,\n.show > .btn-outline-success.dropdown-toggle {\n color: #fff;\n background-color: #28a745;\n border-color: #28a745;\n}\n\n.btn-outline-success:not(:disabled):not(.disabled):active:focus, .btn-outline-success:not(:disabled):not(.disabled).active:focus,\n.show > .btn-outline-success.dropdown-toggle:focus {\n box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5);\n}\n\n.btn-outline-info {\n color: #17a2b8;\n border-color: #17a2b8;\n}\n\n.btn-outline-info:hover {\n color: #fff;\n background-color: #17a2b8;\n border-color: #17a2b8;\n}\n\n.btn-outline-info:focus, .btn-outline-info.focus {\n box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.5);\n}\n\n.btn-outline-info.disabled, .btn-outline-info:disabled {\n color: #17a2b8;\n background-color: transparent;\n}\n\n.btn-outline-info:not(:disabled):not(.disabled):active, .btn-outline-info:not(:disabled):not(.disabled).active,\n.show > .btn-outline-info.dropdown-toggle {\n color: #fff;\n background-color: #17a2b8;\n border-color: #17a2b8;\n}\n\n.btn-outline-info:not(:disabled):not(.disabled):active:focus, .btn-outline-info:not(:disabled):not(.disabled).active:focus,\n.show > .btn-outline-info.dropdown-toggle:focus {\n box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.5);\n}\n\n.btn-outline-warning {\n color: #ffc107;\n border-color: #ffc107;\n}\n\n.btn-outline-warning:hover {\n color: #212529;\n background-color: #ffc107;\n border-color: #ffc107;\n}\n\n.btn-outline-warning:focus, .btn-outline-warning.focus {\n box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.5);\n}\n\n.btn-outline-warning.disabled, .btn-outline-warning:disabled {\n color: #ffc107;\n background-color: transparent;\n}\n\n.btn-outline-warning:not(:disabled):not(.disabled):active, .btn-outline-warning:not(:disabled):not(.disabled).active,\n.show > .btn-outline-warning.dropdown-toggle {\n color: #212529;\n background-color: #ffc107;\n border-color: #ffc107;\n}\n\n.btn-outline-warning:not(:disabled):not(.disabled):active:focus, .btn-outline-warning:not(:disabled):not(.disabled).active:focus,\n.show > .btn-outline-warning.dropdown-toggle:focus {\n box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.5);\n}\n\n.btn-outline-danger {\n color: #dc3545;\n border-color: #dc3545;\n}\n\n.btn-outline-danger:hover {\n color: #fff;\n background-color: #dc3545;\n border-color: #dc3545;\n}\n\n.btn-outline-danger:focus, .btn-outline-danger.focus {\n box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.5);\n}\n\n.btn-outline-danger.disabled, .btn-outline-danger:disabled {\n color: #dc3545;\n background-color: transparent;\n}\n\n.btn-outline-danger:not(:disabled):not(.disabled):active, .btn-outline-danger:not(:disabled):not(.disabled).active,\n.show > .btn-outline-danger.dropdown-toggle {\n color: #fff;\n background-color: #dc3545;\n border-color: #dc3545;\n}\n\n.btn-outline-danger:not(:disabled):not(.disabled):active:focus, .btn-outline-danger:not(:disabled):not(.disabled).active:focus,\n.show > .btn-outline-danger.dropdown-toggle:focus {\n box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.5);\n}\n\n.btn-outline-light {\n color: #f8f9fa;\n border-color: #f8f9fa;\n}\n\n.btn-outline-light:hover {\n color: #212529;\n background-color: #f8f9fa;\n border-color: #f8f9fa;\n}\n\n.btn-outline-light:focus, .btn-outline-light.focus {\n box-shadow: 0 0 0 0.2rem rgba(248, 249, 250, 0.5);\n}\n\n.btn-outline-light.disabled, .btn-outline-light:disabled {\n color: #f8f9fa;\n background-color: transparent;\n}\n\n.btn-outline-light:not(:disabled):not(.disabled):active, .btn-outline-light:not(:disabled):not(.disabled).active,\n.show > .btn-outline-light.dropdown-toggle {\n color: #212529;\n background-color: #f8f9fa;\n border-color: #f8f9fa;\n}\n\n.btn-outline-light:not(:disabled):not(.disabled):active:focus, .btn-outline-light:not(:disabled):not(.disabled).active:focus,\n.show > .btn-outline-light.dropdown-toggle:focus {\n box-shadow: 0 0 0 0.2rem rgba(248, 249, 250, 0.5);\n}\n\n.btn-outline-dark {\n color: #343a40;\n border-color: #343a40;\n}\n\n.btn-outline-dark:hover {\n color: #fff;\n background-color: #343a40;\n border-color: #343a40;\n}\n\n.btn-outline-dark:focus, .btn-outline-dark.focus {\n box-shadow: 0 0 0 0.2rem rgba(52, 58, 64, 0.5);\n}\n\n.btn-outline-dark.disabled, .btn-outline-dark:disabled {\n color: #343a40;\n background-color: transparent;\n}\n\n.btn-outline-dark:not(:disabled):not(.disabled):active, .btn-outline-dark:not(:disabled):not(.disabled).active,\n.show > .btn-outline-dark.dropdown-toggle {\n color: #fff;\n background-color: #343a40;\n border-color: #343a40;\n}\n\n.btn-outline-dark:not(:disabled):not(.disabled):active:focus, .btn-outline-dark:not(:disabled):not(.disabled).active:focus,\n.show > .btn-outline-dark.dropdown-toggle:focus {\n box-shadow: 0 0 0 0.2rem rgba(52, 58, 64, 0.5);\n}\n\n.btn-link {\n font-weight: 400;\n color: #007bff;\n text-decoration: none;\n}\n\n.btn-link:hover {\n color: #0056b3;\n text-decoration: underline;\n}\n\n.btn-link:focus, .btn-link.focus {\n text-decoration: underline;\n}\n\n.btn-link:disabled, .btn-link.disabled {\n color: #6c757d;\n pointer-events: none;\n}\n\n.btn-lg, .btn-group-lg > .btn {\n padding: 0.5rem 1rem;\n font-size: 1.25rem;\n line-height: 1.5;\n border-radius: 0.3rem;\n}\n\n.btn-sm, .btn-group-sm > .btn {\n padding: 0.25rem 0.5rem;\n font-size: 0.875rem;\n line-height: 1.5;\n border-radius: 0.2rem;\n}\n\n.btn-block {\n display: block;\n width: 100%;\n}\n\n.btn-block + .btn-block {\n margin-top: 0.5rem;\n}\n\ninput[type=\"submit\"].btn-block,\ninput[type=\"reset\"].btn-block,\ninput[type=\"button\"].btn-block {\n width: 100%;\n}\n\n.fade {\n transition: opacity 0.15s linear;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .fade {\n transition: none;\n }\n}\n\n.fade:not(.show) {\n opacity: 0;\n}\n\n.collapse:not(.show) {\n display: none;\n}\n\n.collapsing {\n position: relative;\n height: 0;\n overflow: hidden;\n transition: height 0.35s ease;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .collapsing {\n transition: none;\n }\n}\n\n.dropup,\n.dropright,\n.dropdown,\n.dropleft {\n position: relative;\n}\n\n.dropdown-toggle {\n white-space: nowrap;\n}\n\n.dropdown-toggle::after {\n display: inline-block;\n margin-left: 0.255em;\n vertical-align: 0.255em;\n content: \"\";\n border-top: 0.3em solid;\n border-right: 0.3em solid transparent;\n border-bottom: 0;\n border-left: 0.3em solid transparent;\n}\n\n.dropdown-toggle:empty::after {\n margin-left: 0;\n}\n\n.dropdown-menu {\n position: absolute;\n top: 100%;\n left: 0;\n z-index: 1000;\n display: none;\n float: left;\n min-width: 10rem;\n padding: 0.5rem 0;\n margin: 0.125rem 0 0;\n font-size: 1rem;\n color: #212529;\n text-align: left;\n list-style: none;\n background-color: #fff;\n background-clip: padding-box;\n border: 1px solid rgba(0, 0, 0, 0.15);\n border-radius: 0.25rem;\n}\n\n.dropdown-menu-left {\n right: auto;\n left: 0;\n}\n\n.dropdown-menu-right {\n right: 0;\n left: auto;\n}\n\n@media (min-width: 576px) {\n .dropdown-menu-sm-left {\n right: auto;\n left: 0;\n }\n .dropdown-menu-sm-right {\n right: 0;\n left: auto;\n }\n}\n\n@media (min-width: 768px) {\n .dropdown-menu-md-left {\n right: auto;\n left: 0;\n }\n .dropdown-menu-md-right {\n right: 0;\n left: auto;\n }\n}\n\n@media (min-width: 992px) {\n .dropdown-menu-lg-left {\n right: auto;\n left: 0;\n }\n .dropdown-menu-lg-right {\n right: 0;\n left: auto;\n }\n}\n\n@media (min-width: 1200px) {\n .dropdown-menu-xl-left {\n right: auto;\n left: 0;\n }\n .dropdown-menu-xl-right {\n right: 0;\n left: auto;\n }\n}\n\n.dropup .dropdown-menu {\n top: auto;\n bottom: 100%;\n margin-top: 0;\n margin-bottom: 0.125rem;\n}\n\n.dropup .dropdown-toggle::after {\n display: inline-block;\n margin-left: 0.255em;\n vertical-align: 0.255em;\n content: \"\";\n border-top: 0;\n border-right: 0.3em solid transparent;\n border-bottom: 0.3em solid;\n border-left: 0.3em solid transparent;\n}\n\n.dropup .dropdown-toggle:empty::after {\n margin-left: 0;\n}\n\n.dropright .dropdown-menu {\n top: 0;\n right: auto;\n left: 100%;\n margin-top: 0;\n margin-left: 0.125rem;\n}\n\n.dropright .dropdown-toggle::after {\n display: inline-block;\n margin-left: 0.255em;\n vertical-align: 0.255em;\n content: \"\";\n border-top: 0.3em solid transparent;\n border-right: 0;\n border-bottom: 0.3em solid transparent;\n border-left: 0.3em solid;\n}\n\n.dropright .dropdown-toggle:empty::after {\n margin-left: 0;\n}\n\n.dropright .dropdown-toggle::after {\n vertical-align: 0;\n}\n\n.dropleft .dropdown-menu {\n top: 0;\n right: 100%;\n left: auto;\n margin-top: 0;\n margin-right: 0.125rem;\n}\n\n.dropleft .dropdown-toggle::after {\n display: inline-block;\n margin-left: 0.255em;\n vertical-align: 0.255em;\n content: \"\";\n}\n\n.dropleft .dropdown-toggle::after {\n display: none;\n}\n\n.dropleft .dropdown-toggle::before {\n display: inline-block;\n margin-right: 0.255em;\n vertical-align: 0.255em;\n content: \"\";\n border-top: 0.3em solid transparent;\n border-right: 0.3em solid;\n border-bottom: 0.3em solid transparent;\n}\n\n.dropleft .dropdown-toggle:empty::after {\n margin-left: 0;\n}\n\n.dropleft .dropdown-toggle::before {\n vertical-align: 0;\n}\n\n.dropdown-menu[x-placement^=\"top\"], .dropdown-menu[x-placement^=\"right\"], .dropdown-menu[x-placement^=\"bottom\"], .dropdown-menu[x-placement^=\"left\"] {\n right: auto;\n bottom: auto;\n}\n\n.dropdown-divider {\n height: 0;\n margin: 0.5rem 0;\n overflow: hidden;\n border-top: 1px solid #e9ecef;\n}\n\n.dropdown-item {\n display: block;\n width: 100%;\n padding: 0.25rem 1.5rem;\n clear: both;\n font-weight: 400;\n color: #212529;\n text-align: inherit;\n white-space: nowrap;\n background-color: transparent;\n border: 0;\n}\n\n.dropdown-item:hover, .dropdown-item:focus {\n color: #16181b;\n text-decoration: none;\n background-color: #e9ecef;\n}\n\n.dropdown-item.active, .dropdown-item:active {\n color: #fff;\n text-decoration: none;\n background-color: #007bff;\n}\n\n.dropdown-item.disabled, .dropdown-item:disabled {\n color: #adb5bd;\n pointer-events: none;\n background-color: transparent;\n}\n\n.dropdown-menu.show {\n display: block;\n}\n\n.dropdown-header {\n display: block;\n padding: 0.5rem 1.5rem;\n margin-bottom: 0;\n font-size: 0.875rem;\n color: #6c757d;\n white-space: nowrap;\n}\n\n.dropdown-item-text {\n display: block;\n padding: 0.25rem 1.5rem;\n color: #212529;\n}\n\n.btn-group,\n.btn-group-vertical {\n position: relative;\n display: inline-flex;\n vertical-align: middle;\n}\n\n.btn-group > .btn,\n.btn-group-vertical > .btn {\n position: relative;\n flex: 1 1 auto;\n}\n\n.btn-group > .btn:hover,\n.btn-group-vertical > .btn:hover {\n z-index: 1;\n}\n\n.btn-group > .btn:focus, .btn-group > .btn:active, .btn-group > .btn.active,\n.btn-group-vertical > .btn:focus,\n.btn-group-vertical > .btn:active,\n.btn-group-vertical > .btn.active {\n z-index: 1;\n}\n\n.btn-toolbar {\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-start;\n}\n\n.btn-toolbar .input-group {\n width: auto;\n}\n\n.btn-group > .btn:not(:first-child),\n.btn-group > .btn-group:not(:first-child) {\n margin-left: -1px;\n}\n\n.btn-group > .btn:not(:last-child):not(.dropdown-toggle),\n.btn-group > .btn-group:not(:last-child) > .btn {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n\n.btn-group > .btn:not(:first-child),\n.btn-group > .btn-group:not(:first-child) > .btn {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.dropdown-toggle-split {\n padding-right: 0.5625rem;\n padding-left: 0.5625rem;\n}\n\n.dropdown-toggle-split::after,\n.dropup .dropdown-toggle-split::after,\n.dropright .dropdown-toggle-split::after {\n margin-left: 0;\n}\n\n.dropleft .dropdown-toggle-split::before {\n margin-right: 0;\n}\n\n.btn-sm + .dropdown-toggle-split, .btn-group-sm > .btn + .dropdown-toggle-split {\n padding-right: 0.375rem;\n padding-left: 0.375rem;\n}\n\n.btn-lg + .dropdown-toggle-split, .btn-group-lg > .btn + .dropdown-toggle-split {\n padding-right: 0.75rem;\n padding-left: 0.75rem;\n}\n\n.btn-group-vertical {\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n}\n\n.btn-group-vertical > .btn,\n.btn-group-vertical > .btn-group {\n width: 100%;\n}\n\n.btn-group-vertical > .btn:not(:first-child),\n.btn-group-vertical > .btn-group:not(:first-child) {\n margin-top: -1px;\n}\n\n.btn-group-vertical > .btn:not(:last-child):not(.dropdown-toggle),\n.btn-group-vertical > .btn-group:not(:last-child) > .btn {\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.btn-group-vertical > .btn:not(:first-child),\n.btn-group-vertical > .btn-group:not(:first-child) > .btn {\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n}\n\n.btn-group-toggle > .btn,\n.btn-group-toggle > .btn-group > .btn {\n margin-bottom: 0;\n}\n\n.btn-group-toggle > .btn input[type=\"radio\"],\n.btn-group-toggle > .btn input[type=\"checkbox\"],\n.btn-group-toggle > .btn-group > .btn input[type=\"radio\"],\n.btn-group-toggle > .btn-group > .btn input[type=\"checkbox\"] {\n position: absolute;\n clip: rect(0, 0, 0, 0);\n pointer-events: none;\n}\n\n.input-group {\n position: relative;\n display: flex;\n flex-wrap: wrap;\n align-items: stretch;\n width: 100%;\n}\n\n.input-group > .form-control,\n.input-group > .form-control-plaintext,\n.input-group > .custom-select,\n.input-group > .custom-file {\n position: relative;\n flex: 1 1 auto;\n width: 1%;\n min-width: 0;\n margin-bottom: 0;\n}\n\n.input-group > .form-control + .form-control,\n.input-group > .form-control + .custom-select,\n.input-group > .form-control + .custom-file,\n.input-group > .form-control-plaintext + .form-control,\n.input-group > .form-control-plaintext + .custom-select,\n.input-group > .form-control-plaintext + .custom-file,\n.input-group > .custom-select + .form-control,\n.input-group > .custom-select + .custom-select,\n.input-group > .custom-select + .custom-file,\n.input-group > .custom-file + .form-control,\n.input-group > .custom-file + .custom-select,\n.input-group > .custom-file + .custom-file {\n margin-left: -1px;\n}\n\n.input-group > .form-control:focus,\n.input-group > .custom-select:focus,\n.input-group > .custom-file .custom-file-input:focus ~ .custom-file-label {\n z-index: 3;\n}\n\n.input-group > .custom-file .custom-file-input:focus {\n z-index: 4;\n}\n\n.input-group > .form-control:not(:first-child),\n.input-group > .custom-select:not(:first-child) {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.input-group > .custom-file {\n display: flex;\n align-items: center;\n}\n\n.input-group > .custom-file:not(:last-child) .custom-file-label,\n.input-group > .custom-file:not(:first-child) .custom-file-label {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.input-group:not(.has-validation) > .form-control:not(:last-child),\n.input-group:not(.has-validation) > .custom-select:not(:last-child),\n.input-group:not(.has-validation) > .custom-file:not(:last-child) .custom-file-label::after {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n\n.input-group.has-validation > .form-control:nth-last-child(n + 3),\n.input-group.has-validation > .custom-select:nth-last-child(n + 3),\n.input-group.has-validation > .custom-file:nth-last-child(n + 3) .custom-file-label::after {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n\n.input-group-prepend,\n.input-group-append {\n display: flex;\n}\n\n.input-group-prepend .btn,\n.input-group-append .btn {\n position: relative;\n z-index: 2;\n}\n\n.input-group-prepend .btn:focus,\n.input-group-append .btn:focus {\n z-index: 3;\n}\n\n.input-group-prepend .btn + .btn,\n.input-group-prepend .btn + .input-group-text,\n.input-group-prepend .input-group-text + .input-group-text,\n.input-group-prepend .input-group-text + .btn,\n.input-group-append .btn + .btn,\n.input-group-append .btn + .input-group-text,\n.input-group-append .input-group-text + .input-group-text,\n.input-group-append .input-group-text + .btn {\n margin-left: -1px;\n}\n\n.input-group-prepend {\n margin-right: -1px;\n}\n\n.input-group-append {\n margin-left: -1px;\n}\n\n.input-group-text {\n display: flex;\n align-items: center;\n padding: 0.375rem 0.75rem;\n margin-bottom: 0;\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.5;\n color: #495057;\n text-align: center;\n white-space: nowrap;\n background-color: #e9ecef;\n border: 1px solid #ced4da;\n border-radius: 0.25rem;\n}\n\n.input-group-text input[type=\"radio\"],\n.input-group-text input[type=\"checkbox\"] {\n margin-top: 0;\n}\n\n.input-group-lg > .form-control:not(textarea),\n.input-group-lg > .custom-select {\n height: calc(1.5em + 1rem + 2px);\n}\n\n.input-group-lg > .form-control,\n.input-group-lg > .custom-select,\n.input-group-lg > .input-group-prepend > .input-group-text,\n.input-group-lg > .input-group-append > .input-group-text,\n.input-group-lg > .input-group-prepend > .btn,\n.input-group-lg > .input-group-append > .btn {\n padding: 0.5rem 1rem;\n font-size: 1.25rem;\n line-height: 1.5;\n border-radius: 0.3rem;\n}\n\n.input-group-sm > .form-control:not(textarea),\n.input-group-sm > .custom-select {\n height: calc(1.5em + 0.5rem + 2px);\n}\n\n.input-group-sm > .form-control,\n.input-group-sm > .custom-select,\n.input-group-sm > .input-group-prepend > .input-group-text,\n.input-group-sm > .input-group-append > .input-group-text,\n.input-group-sm > .input-group-prepend > .btn,\n.input-group-sm > .input-group-append > .btn {\n padding: 0.25rem 0.5rem;\n font-size: 0.875rem;\n line-height: 1.5;\n border-radius: 0.2rem;\n}\n\n.input-group-lg > .custom-select,\n.input-group-sm > .custom-select {\n padding-right: 1.75rem;\n}\n\n.input-group > .input-group-prepend > .btn,\n.input-group > .input-group-prepend > .input-group-text,\n.input-group:not(.has-validation) > .input-group-append:not(:last-child) > .btn,\n.input-group:not(.has-validation) > .input-group-append:not(:last-child) > .input-group-text,\n.input-group.has-validation > .input-group-append:nth-last-child(n + 3) > .btn,\n.input-group.has-validation > .input-group-append:nth-last-child(n + 3) > .input-group-text,\n.input-group > .input-group-append:last-child > .btn:not(:last-child):not(.dropdown-toggle),\n.input-group > .input-group-append:last-child > .input-group-text:not(:last-child) {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n\n.input-group > .input-group-append > .btn,\n.input-group > .input-group-append > .input-group-text,\n.input-group > .input-group-prepend:not(:first-child) > .btn,\n.input-group > .input-group-prepend:not(:first-child) > .input-group-text,\n.input-group > .input-group-prepend:first-child > .btn:not(:first-child),\n.input-group > .input-group-prepend:first-child > .input-group-text:not(:first-child) {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.custom-control {\n position: relative;\n z-index: 1;\n display: block;\n min-height: 1.5rem;\n padding-left: 1.5rem;\n color-adjust: exact;\n}\n\n.custom-control-inline {\n display: inline-flex;\n margin-right: 1rem;\n}\n\n.custom-control-input {\n position: absolute;\n left: 0;\n z-index: -1;\n width: 1rem;\n height: 1.25rem;\n opacity: 0;\n}\n\n.custom-control-input:checked ~ .custom-control-label::before {\n color: #fff;\n border-color: #007bff;\n background-color: #007bff;\n}\n\n.custom-control-input:focus ~ .custom-control-label::before {\n box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);\n}\n\n.custom-control-input:focus:not(:checked) ~ .custom-control-label::before {\n border-color: #80bdff;\n}\n\n.custom-control-input:not(:disabled):active ~ .custom-control-label::before {\n color: #fff;\n background-color: #b3d7ff;\n border-color: #b3d7ff;\n}\n\n.custom-control-input[disabled] ~ .custom-control-label, .custom-control-input:disabled ~ .custom-control-label {\n color: #6c757d;\n}\n\n.custom-control-input[disabled] ~ .custom-control-label::before, .custom-control-input:disabled ~ .custom-control-label::before {\n background-color: #e9ecef;\n}\n\n.custom-control-label {\n position: relative;\n margin-bottom: 0;\n vertical-align: top;\n}\n\n.custom-control-label::before {\n position: absolute;\n top: 0.25rem;\n left: -1.5rem;\n display: block;\n width: 1rem;\n height: 1rem;\n pointer-events: none;\n content: \"\";\n background-color: #fff;\n border: #adb5bd solid 1px;\n}\n\n.custom-control-label::after {\n position: absolute;\n top: 0.25rem;\n left: -1.5rem;\n display: block;\n width: 1rem;\n height: 1rem;\n content: \"\";\n background: 50% / 50% 50% no-repeat;\n}\n\n.custom-checkbox .custom-control-label::before {\n border-radius: 0.25rem;\n}\n\n.custom-checkbox .custom-control-input:checked ~ .custom-control-label::after {\n background-image: url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z'/%3e%3c/svg%3e\");\n}\n\n.custom-checkbox .custom-control-input:indeterminate ~ .custom-control-label::before {\n border-color: #007bff;\n background-color: #007bff;\n}\n\n.custom-checkbox .custom-control-input:indeterminate ~ .custom-control-label::after {\n background-image: url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3e%3cpath stroke='%23fff' d='M0 2h4'/%3e%3c/svg%3e\");\n}\n\n.custom-checkbox .custom-control-input:disabled:checked ~ .custom-control-label::before {\n background-color: rgba(0, 123, 255, 0.5);\n}\n\n.custom-checkbox .custom-control-input:disabled:indeterminate ~ .custom-control-label::before {\n background-color: rgba(0, 123, 255, 0.5);\n}\n\n.custom-radio .custom-control-label::before {\n border-radius: 50%;\n}\n\n.custom-radio .custom-control-input:checked ~ .custom-control-label::after {\n background-image: url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e\");\n}\n\n.custom-radio .custom-control-input:disabled:checked ~ .custom-control-label::before {\n background-color: rgba(0, 123, 255, 0.5);\n}\n\n.custom-switch {\n padding-left: 2.25rem;\n}\n\n.custom-switch .custom-control-label::before {\n left: -2.25rem;\n width: 1.75rem;\n pointer-events: all;\n border-radius: 0.5rem;\n}\n\n.custom-switch .custom-control-label::after {\n top: calc(0.25rem + 2px);\n left: calc(-2.25rem + 2px);\n width: calc(1rem - 4px);\n height: calc(1rem - 4px);\n background-color: #adb5bd;\n border-radius: 0.5rem;\n transition: transform 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .custom-switch .custom-control-label::after {\n transition: none;\n }\n}\n\n.custom-switch .custom-control-input:checked ~ .custom-control-label::after {\n background-color: #fff;\n transform: translateX(0.75rem);\n}\n\n.custom-switch .custom-control-input:disabled:checked ~ .custom-control-label::before {\n background-color: rgba(0, 123, 255, 0.5);\n}\n\n.custom-select {\n display: inline-block;\n width: 100%;\n height: calc(1.5em + 0.75rem + 2px);\n padding: 0.375rem 1.75rem 0.375rem 0.75rem;\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.5;\n color: #495057;\n vertical-align: middle;\n background: #fff url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e\") right 0.75rem center/8px 10px no-repeat;\n border: 1px solid #ced4da;\n border-radius: 0.25rem;\n appearance: none;\n}\n\n.custom-select:focus {\n border-color: #80bdff;\n outline: 0;\n box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);\n}\n\n.custom-select:focus::-ms-value {\n color: #495057;\n background-color: #fff;\n}\n\n.custom-select[multiple], .custom-select[size]:not([size=\"1\"]) {\n height: auto;\n padding-right: 0.75rem;\n background-image: none;\n}\n\n.custom-select:disabled {\n color: #6c757d;\n background-color: #e9ecef;\n}\n\n.custom-select::-ms-expand {\n display: none;\n}\n\n.custom-select:-moz-focusring {\n color: transparent;\n text-shadow: 0 0 0 #495057;\n}\n\n.custom-select-sm {\n height: calc(1.5em + 0.5rem + 2px);\n padding-top: 0.25rem;\n padding-bottom: 0.25rem;\n padding-left: 0.5rem;\n font-size: 0.875rem;\n}\n\n.custom-select-lg {\n height: calc(1.5em + 1rem + 2px);\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n padding-left: 1rem;\n font-size: 1.25rem;\n}\n\n.custom-file {\n position: relative;\n display: inline-block;\n width: 100%;\n height: calc(1.5em + 0.75rem + 2px);\n margin-bottom: 0;\n}\n\n.custom-file-input {\n position: relative;\n z-index: 2;\n width: 100%;\n height: calc(1.5em + 0.75rem + 2px);\n margin: 0;\n overflow: hidden;\n opacity: 0;\n}\n\n.custom-file-input:focus ~ .custom-file-label {\n border-color: #80bdff;\n box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);\n}\n\n.custom-file-input[disabled] ~ .custom-file-label,\n.custom-file-input:disabled ~ .custom-file-label {\n background-color: #e9ecef;\n}\n\n.custom-file-input:lang(en) ~ .custom-file-label::after {\n content: \"Browse\";\n}\n\n.custom-file-input ~ .custom-file-label[data-browse]::after {\n content: attr(data-browse);\n}\n\n.custom-file-label {\n position: absolute;\n top: 0;\n right: 0;\n left: 0;\n z-index: 1;\n height: calc(1.5em + 0.75rem + 2px);\n padding: 0.375rem 0.75rem;\n overflow: hidden;\n font-weight: 400;\n line-height: 1.5;\n color: #495057;\n background-color: #fff;\n border: 1px solid #ced4da;\n border-radius: 0.25rem;\n}\n\n.custom-file-label::after {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n z-index: 3;\n display: block;\n height: calc(1.5em + 0.75rem);\n padding: 0.375rem 0.75rem;\n line-height: 1.5;\n color: #495057;\n content: \"Browse\";\n background-color: #e9ecef;\n border-left: inherit;\n border-radius: 0 0.25rem 0.25rem 0;\n}\n\n.custom-range {\n width: 100%;\n height: 1.4rem;\n padding: 0;\n background-color: transparent;\n appearance: none;\n}\n\n.custom-range:focus {\n outline: 0;\n}\n\n.custom-range:focus::-webkit-slider-thumb {\n box-shadow: 0 0 0 1px #fff, 0 0 0 0.2rem rgba(0, 123, 255, 0.25);\n}\n\n.custom-range:focus::-moz-range-thumb {\n box-shadow: 0 0 0 1px #fff, 0 0 0 0.2rem rgba(0, 123, 255, 0.25);\n}\n\n.custom-range:focus::-ms-thumb {\n box-shadow: 0 0 0 1px #fff, 0 0 0 0.2rem rgba(0, 123, 255, 0.25);\n}\n\n.custom-range::-moz-focus-outer {\n border: 0;\n}\n\n.custom-range::-webkit-slider-thumb {\n width: 1rem;\n height: 1rem;\n margin-top: -0.25rem;\n background-color: #007bff;\n border: 0;\n border-radius: 1rem;\n transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n appearance: none;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .custom-range::-webkit-slider-thumb {\n transition: none;\n }\n}\n\n.custom-range::-webkit-slider-thumb:active {\n background-color: #b3d7ff;\n}\n\n.custom-range::-webkit-slider-runnable-track {\n width: 100%;\n height: 0.5rem;\n color: transparent;\n cursor: pointer;\n background-color: #dee2e6;\n border-color: transparent;\n border-radius: 1rem;\n}\n\n.custom-range::-moz-range-thumb {\n width: 1rem;\n height: 1rem;\n background-color: #007bff;\n border: 0;\n border-radius: 1rem;\n transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n appearance: none;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .custom-range::-moz-range-thumb {\n transition: none;\n }\n}\n\n.custom-range::-moz-range-thumb:active {\n background-color: #b3d7ff;\n}\n\n.custom-range::-moz-range-track {\n width: 100%;\n height: 0.5rem;\n color: transparent;\n cursor: pointer;\n background-color: #dee2e6;\n border-color: transparent;\n border-radius: 1rem;\n}\n\n.custom-range::-ms-thumb {\n width: 1rem;\n height: 1rem;\n margin-top: 0;\n margin-right: 0.2rem;\n margin-left: 0.2rem;\n background-color: #007bff;\n border: 0;\n border-radius: 1rem;\n transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n appearance: none;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .custom-range::-ms-thumb {\n transition: none;\n }\n}\n\n.custom-range::-ms-thumb:active {\n background-color: #b3d7ff;\n}\n\n.custom-range::-ms-track {\n width: 100%;\n height: 0.5rem;\n color: transparent;\n cursor: pointer;\n background-color: transparent;\n border-color: transparent;\n border-width: 0.5rem;\n}\n\n.custom-range::-ms-fill-lower {\n background-color: #dee2e6;\n border-radius: 1rem;\n}\n\n.custom-range::-ms-fill-upper {\n margin-right: 15px;\n background-color: #dee2e6;\n border-radius: 1rem;\n}\n\n.custom-range:disabled::-webkit-slider-thumb {\n background-color: #adb5bd;\n}\n\n.custom-range:disabled::-webkit-slider-runnable-track {\n cursor: default;\n}\n\n.custom-range:disabled::-moz-range-thumb {\n background-color: #adb5bd;\n}\n\n.custom-range:disabled::-moz-range-track {\n cursor: default;\n}\n\n.custom-range:disabled::-ms-thumb {\n background-color: #adb5bd;\n}\n\n.custom-control-label::before,\n.custom-file-label,\n.custom-select {\n transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .custom-control-label::before,\n .custom-file-label,\n .custom-select {\n transition: none;\n }\n}\n\n.nav {\n display: flex;\n flex-wrap: wrap;\n padding-left: 0;\n margin-bottom: 0;\n list-style: none;\n}\n\n.nav-link {\n display: block;\n padding: 0.5rem 1rem;\n}\n\n.nav-link:hover, .nav-link:focus {\n text-decoration: none;\n}\n\n.nav-link.disabled {\n color: #6c757d;\n pointer-events: none;\n cursor: default;\n}\n\n.nav-tabs {\n border-bottom: 1px solid #dee2e6;\n}\n\n.nav-tabs .nav-link {\n margin-bottom: -1px;\n border: 1px solid transparent;\n border-top-left-radius: 0.25rem;\n border-top-right-radius: 0.25rem;\n}\n\n.nav-tabs .nav-link:hover, .nav-tabs .nav-link:focus {\n border-color: #e9ecef #e9ecef #dee2e6;\n}\n\n.nav-tabs .nav-link.disabled {\n color: #6c757d;\n background-color: transparent;\n border-color: transparent;\n}\n\n.nav-tabs .nav-link.active,\n.nav-tabs .nav-item.show .nav-link {\n color: #495057;\n background-color: #fff;\n border-color: #dee2e6 #dee2e6 #fff;\n}\n\n.nav-tabs .dropdown-menu {\n margin-top: -1px;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n}\n\n.nav-pills .nav-link {\n border-radius: 0.25rem;\n}\n\n.nav-pills .nav-link.active,\n.nav-pills .show > .nav-link {\n color: #fff;\n background-color: #007bff;\n}\n\n.nav-fill > .nav-link,\n.nav-fill .nav-item {\n flex: 1 1 auto;\n text-align: center;\n}\n\n.nav-justified > .nav-link,\n.nav-justified .nav-item {\n flex-basis: 0;\n flex-grow: 1;\n text-align: center;\n}\n\n.tab-content > .tab-pane {\n display: none;\n}\n\n.tab-content > .active {\n display: block;\n}\n\n.navbar {\n position: relative;\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: space-between;\n padding: 0.5rem 1rem;\n}\n\n.navbar .container,\n.navbar .container-fluid, .navbar .container-sm, .navbar .container-md, .navbar .container-lg, .navbar .container-xl {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: space-between;\n}\n\n.navbar-brand {\n display: inline-block;\n padding-top: 0.3125rem;\n padding-bottom: 0.3125rem;\n margin-right: 1rem;\n font-size: 1.25rem;\n line-height: inherit;\n white-space: nowrap;\n}\n\n.navbar-brand:hover, .navbar-brand:focus {\n text-decoration: none;\n}\n\n.navbar-nav {\n display: flex;\n flex-direction: column;\n padding-left: 0;\n margin-bottom: 0;\n list-style: none;\n}\n\n.navbar-nav .nav-link {\n padding-right: 0;\n padding-left: 0;\n}\n\n.navbar-nav .dropdown-menu {\n position: static;\n float: none;\n}\n\n.navbar-text {\n display: inline-block;\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n\n.navbar-collapse {\n flex-basis: 100%;\n flex-grow: 1;\n align-items: center;\n}\n\n.navbar-toggler {\n padding: 0.25rem 0.75rem;\n font-size: 1.25rem;\n line-height: 1;\n background-color: transparent;\n border: 1px solid transparent;\n border-radius: 0.25rem;\n}\n\n.navbar-toggler:hover, .navbar-toggler:focus {\n text-decoration: none;\n}\n\n.navbar-toggler-icon {\n display: inline-block;\n width: 1.5em;\n height: 1.5em;\n vertical-align: middle;\n content: \"\";\n background: 50% / 100% 100% no-repeat;\n}\n\n.navbar-nav-scroll {\n max-height: 75vh;\n overflow-y: auto;\n}\n\n@media (max-width: 575.98px) {\n .navbar-expand-sm > .container,\n .navbar-expand-sm > .container-fluid, .navbar-expand-sm > .container-sm, .navbar-expand-sm > .container-md, .navbar-expand-sm > .container-lg, .navbar-expand-sm > .container-xl {\n padding-right: 0;\n padding-left: 0;\n }\n}\n\n@media (min-width: 576px) {\n .navbar-expand-sm {\n flex-flow: row nowrap;\n justify-content: flex-start;\n }\n .navbar-expand-sm .navbar-nav {\n flex-direction: row;\n }\n .navbar-expand-sm .navbar-nav .dropdown-menu {\n position: absolute;\n }\n .navbar-expand-sm .navbar-nav .nav-link {\n padding-right: 0.5rem;\n padding-left: 0.5rem;\n }\n .navbar-expand-sm > .container,\n .navbar-expand-sm > .container-fluid, .navbar-expand-sm > .container-sm, .navbar-expand-sm > .container-md, .navbar-expand-sm > .container-lg, .navbar-expand-sm > .container-xl {\n flex-wrap: nowrap;\n }\n .navbar-expand-sm .navbar-nav-scroll {\n overflow: visible;\n }\n .navbar-expand-sm .navbar-collapse {\n display: flex !important;\n flex-basis: auto;\n }\n .navbar-expand-sm .navbar-toggler {\n display: none;\n }\n}\n\n@media (max-width: 767.98px) {\n .navbar-expand-md > .container,\n .navbar-expand-md > .container-fluid, .navbar-expand-md > .container-sm, .navbar-expand-md > .container-md, .navbar-expand-md > .container-lg, .navbar-expand-md > .container-xl {\n padding-right: 0;\n padding-left: 0;\n }\n}\n\n@media (min-width: 768px) {\n .navbar-expand-md {\n flex-flow: row nowrap;\n justify-content: flex-start;\n }\n .navbar-expand-md .navbar-nav {\n flex-direction: row;\n }\n .navbar-expand-md .navbar-nav .dropdown-menu {\n position: absolute;\n }\n .navbar-expand-md .navbar-nav .nav-link {\n padding-right: 0.5rem;\n padding-left: 0.5rem;\n }\n .navbar-expand-md > .container,\n .navbar-expand-md > .container-fluid, .navbar-expand-md > .container-sm, .navbar-expand-md > .container-md, .navbar-expand-md > .container-lg, .navbar-expand-md > .container-xl {\n flex-wrap: nowrap;\n }\n .navbar-expand-md .navbar-nav-scroll {\n overflow: visible;\n }\n .navbar-expand-md .navbar-collapse {\n display: flex !important;\n flex-basis: auto;\n }\n .navbar-expand-md .navbar-toggler {\n display: none;\n }\n}\n\n@media (max-width: 991.98px) {\n .navbar-expand-lg > .container,\n .navbar-expand-lg > .container-fluid, .navbar-expand-lg > .container-sm, .navbar-expand-lg > .container-md, .navbar-expand-lg > .container-lg, .navbar-expand-lg > .container-xl {\n padding-right: 0;\n padding-left: 0;\n }\n}\n\n@media (min-width: 992px) {\n .navbar-expand-lg {\n flex-flow: row nowrap;\n justify-content: flex-start;\n }\n .navbar-expand-lg .navbar-nav {\n flex-direction: row;\n }\n .navbar-expand-lg .navbar-nav .dropdown-menu {\n position: absolute;\n }\n .navbar-expand-lg .navbar-nav .nav-link {\n padding-right: 0.5rem;\n padding-left: 0.5rem;\n }\n .navbar-expand-lg > .container,\n .navbar-expand-lg > .container-fluid, .navbar-expand-lg > .container-sm, .navbar-expand-lg > .container-md, .navbar-expand-lg > .container-lg, .navbar-expand-lg > .container-xl {\n flex-wrap: nowrap;\n }\n .navbar-expand-lg .navbar-nav-scroll {\n overflow: visible;\n }\n .navbar-expand-lg .navbar-collapse {\n display: flex !important;\n flex-basis: auto;\n }\n .navbar-expand-lg .navbar-toggler {\n display: none;\n }\n}\n\n@media (max-width: 1199.98px) {\n .navbar-expand-xl > .container,\n .navbar-expand-xl > .container-fluid, .navbar-expand-xl > .container-sm, .navbar-expand-xl > .container-md, .navbar-expand-xl > .container-lg, .navbar-expand-xl > .container-xl {\n padding-right: 0;\n padding-left: 0;\n }\n}\n\n@media (min-width: 1200px) {\n .navbar-expand-xl {\n flex-flow: row nowrap;\n justify-content: flex-start;\n }\n .navbar-expand-xl .navbar-nav {\n flex-direction: row;\n }\n .navbar-expand-xl .navbar-nav .dropdown-menu {\n position: absolute;\n }\n .navbar-expand-xl .navbar-nav .nav-link {\n padding-right: 0.5rem;\n padding-left: 0.5rem;\n }\n .navbar-expand-xl > .container,\n .navbar-expand-xl > .container-fluid, .navbar-expand-xl > .container-sm, .navbar-expand-xl > .container-md, .navbar-expand-xl > .container-lg, .navbar-expand-xl > .container-xl {\n flex-wrap: nowrap;\n }\n .navbar-expand-xl .navbar-nav-scroll {\n overflow: visible;\n }\n .navbar-expand-xl .navbar-collapse {\n display: flex !important;\n flex-basis: auto;\n }\n .navbar-expand-xl .navbar-toggler {\n display: none;\n }\n}\n\n.navbar-expand {\n flex-flow: row nowrap;\n justify-content: flex-start;\n}\n\n.navbar-expand > .container,\n.navbar-expand > .container-fluid, .navbar-expand > .container-sm, .navbar-expand > .container-md, .navbar-expand > .container-lg, .navbar-expand > .container-xl {\n padding-right: 0;\n padding-left: 0;\n}\n\n.navbar-expand .navbar-nav {\n flex-direction: row;\n}\n\n.navbar-expand .navbar-nav .dropdown-menu {\n position: absolute;\n}\n\n.navbar-expand .navbar-nav .nav-link {\n padding-right: 0.5rem;\n padding-left: 0.5rem;\n}\n\n.navbar-expand > .container,\n.navbar-expand > .container-fluid, .navbar-expand > .container-sm, .navbar-expand > .container-md, .navbar-expand > .container-lg, .navbar-expand > .container-xl {\n flex-wrap: nowrap;\n}\n\n.navbar-expand .navbar-nav-scroll {\n overflow: visible;\n}\n\n.navbar-expand .navbar-collapse {\n display: flex !important;\n flex-basis: auto;\n}\n\n.navbar-expand .navbar-toggler {\n display: none;\n}\n\n.navbar-light .navbar-brand {\n color: rgba(0, 0, 0, 0.9);\n}\n\n.navbar-light .navbar-brand:hover, .navbar-light .navbar-brand:focus {\n color: rgba(0, 0, 0, 0.9);\n}\n\n.navbar-light .navbar-nav .nav-link {\n color: rgba(0, 0, 0, 0.5);\n}\n\n.navbar-light .navbar-nav .nav-link:hover, .navbar-light .navbar-nav .nav-link:focus {\n color: rgba(0, 0, 0, 0.7);\n}\n\n.navbar-light .navbar-nav .nav-link.disabled {\n color: rgba(0, 0, 0, 0.3);\n}\n\n.navbar-light .navbar-nav .show > .nav-link,\n.navbar-light .navbar-nav .active > .nav-link,\n.navbar-light .navbar-nav .nav-link.show,\n.navbar-light .navbar-nav .nav-link.active {\n color: rgba(0, 0, 0, 0.9);\n}\n\n.navbar-light .navbar-toggler {\n color: rgba(0, 0, 0, 0.5);\n border-color: rgba(0, 0, 0, 0.1);\n}\n\n.navbar-light .navbar-toggler-icon {\n background-image: url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 0, 0, 0.5%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e\");\n}\n\n.navbar-light .navbar-text {\n color: rgba(0, 0, 0, 0.5);\n}\n\n.navbar-light .navbar-text a {\n color: rgba(0, 0, 0, 0.9);\n}\n\n.navbar-light .navbar-text a:hover, .navbar-light .navbar-text a:focus {\n color: rgba(0, 0, 0, 0.9);\n}\n\n.navbar-dark .navbar-brand {\n color: #fff;\n}\n\n.navbar-dark .navbar-brand:hover, .navbar-dark .navbar-brand:focus {\n color: #fff;\n}\n\n.navbar-dark .navbar-nav .nav-link {\n color: rgba(255, 255, 255, 0.5);\n}\n\n.navbar-dark .navbar-nav .nav-link:hover, .navbar-dark .navbar-nav .nav-link:focus {\n color: rgba(255, 255, 255, 0.75);\n}\n\n.navbar-dark .navbar-nav .nav-link.disabled {\n color: rgba(255, 255, 255, 0.25);\n}\n\n.navbar-dark .navbar-nav .show > .nav-link,\n.navbar-dark .navbar-nav .active > .nav-link,\n.navbar-dark .navbar-nav .nav-link.show,\n.navbar-dark .navbar-nav .nav-link.active {\n color: #fff;\n}\n\n.navbar-dark .navbar-toggler {\n color: rgba(255, 255, 255, 0.5);\n border-color: rgba(255, 255, 255, 0.1);\n}\n\n.navbar-dark .navbar-toggler-icon {\n background-image: url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.5%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e\");\n}\n\n.navbar-dark .navbar-text {\n color: rgba(255, 255, 255, 0.5);\n}\n\n.navbar-dark .navbar-text a {\n color: #fff;\n}\n\n.navbar-dark .navbar-text a:hover, .navbar-dark .navbar-text a:focus {\n color: #fff;\n}\n\n.card {\n position: relative;\n display: flex;\n flex-direction: column;\n min-width: 0;\n word-wrap: break-word;\n background-color: #fff;\n background-clip: border-box;\n border: 1px solid rgba(0, 0, 0, 0.125);\n border-radius: 0.25rem;\n}\n\n.card > hr {\n margin-right: 0;\n margin-left: 0;\n}\n\n.card > .list-group {\n border-top: inherit;\n border-bottom: inherit;\n}\n\n.card > .list-group:first-child {\n border-top-width: 0;\n border-top-left-radius: calc(0.25rem - 1px);\n border-top-right-radius: calc(0.25rem - 1px);\n}\n\n.card > .list-group:last-child {\n border-bottom-width: 0;\n border-bottom-right-radius: calc(0.25rem - 1px);\n border-bottom-left-radius: calc(0.25rem - 1px);\n}\n\n.card > .card-header + .list-group,\n.card > .list-group + .card-footer {\n border-top: 0;\n}\n\n.card-body {\n flex: 1 1 auto;\n min-height: 1px;\n padding: 1.25rem;\n}\n\n.card-title {\n margin-bottom: 0.75rem;\n}\n\n.card-subtitle {\n margin-top: -0.375rem;\n margin-bottom: 0;\n}\n\n.card-text:last-child {\n margin-bottom: 0;\n}\n\n.card-link:hover {\n text-decoration: none;\n}\n\n.card-link + .card-link {\n margin-left: 1.25rem;\n}\n\n.card-header {\n padding: 0.75rem 1.25rem;\n margin-bottom: 0;\n background-color: rgba(0, 0, 0, 0.03);\n border-bottom: 1px solid rgba(0, 0, 0, 0.125);\n}\n\n.card-header:first-child {\n border-radius: calc(0.25rem - 1px) calc(0.25rem - 1px) 0 0;\n}\n\n.card-footer {\n padding: 0.75rem 1.25rem;\n background-color: rgba(0, 0, 0, 0.03);\n border-top: 1px solid rgba(0, 0, 0, 0.125);\n}\n\n.card-footer:last-child {\n border-radius: 0 0 calc(0.25rem - 1px) calc(0.25rem - 1px);\n}\n\n.card-header-tabs {\n margin-right: -0.625rem;\n margin-bottom: -0.75rem;\n margin-left: -0.625rem;\n border-bottom: 0;\n}\n\n.card-header-pills {\n margin-right: -0.625rem;\n margin-left: -0.625rem;\n}\n\n.card-img-overlay {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n padding: 1.25rem;\n border-radius: calc(0.25rem - 1px);\n}\n\n.card-img,\n.card-img-top,\n.card-img-bottom {\n flex-shrink: 0;\n width: 100%;\n}\n\n.card-img,\n.card-img-top {\n border-top-left-radius: calc(0.25rem - 1px);\n border-top-right-radius: calc(0.25rem - 1px);\n}\n\n.card-img,\n.card-img-bottom {\n border-bottom-right-radius: calc(0.25rem - 1px);\n border-bottom-left-radius: calc(0.25rem - 1px);\n}\n\n.card-deck .card {\n margin-bottom: 15px;\n}\n\n@media (min-width: 576px) {\n .card-deck {\n display: flex;\n flex-flow: row wrap;\n margin-right: -15px;\n margin-left: -15px;\n }\n .card-deck .card {\n flex: 1 0 0%;\n margin-right: 15px;\n margin-bottom: 0;\n margin-left: 15px;\n }\n}\n\n.card-group > .card {\n margin-bottom: 15px;\n}\n\n@media (min-width: 576px) {\n .card-group {\n display: flex;\n flex-flow: row wrap;\n }\n .card-group > .card {\n flex: 1 0 0%;\n margin-bottom: 0;\n }\n .card-group > .card + .card {\n margin-left: 0;\n border-left: 0;\n }\n .card-group > .card:not(:last-child) {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n }\n .card-group > .card:not(:last-child) .card-img-top,\n .card-group > .card:not(:last-child) .card-header {\n border-top-right-radius: 0;\n }\n .card-group > .card:not(:last-child) .card-img-bottom,\n .card-group > .card:not(:last-child) .card-footer {\n border-bottom-right-radius: 0;\n }\n .card-group > .card:not(:first-child) {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n }\n .card-group > .card:not(:first-child) .card-img-top,\n .card-group > .card:not(:first-child) .card-header {\n border-top-left-radius: 0;\n }\n .card-group > .card:not(:first-child) .card-img-bottom,\n .card-group > .card:not(:first-child) .card-footer {\n border-bottom-left-radius: 0;\n }\n}\n\n.card-columns .card {\n margin-bottom: 0.75rem;\n}\n\n@media (min-width: 576px) {\n .card-columns {\n column-count: 3;\n column-gap: 1.25rem;\n orphans: 1;\n widows: 1;\n }\n .card-columns .card {\n display: inline-block;\n width: 100%;\n }\n}\n\n.accordion {\n overflow-anchor: none;\n}\n\n.accordion > .card {\n overflow: hidden;\n}\n\n.accordion > .card:not(:last-of-type) {\n border-bottom: 0;\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.accordion > .card:not(:first-of-type) {\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n}\n\n.accordion > .card > .card-header {\n border-radius: 0;\n margin-bottom: -1px;\n}\n\n.breadcrumb {\n display: flex;\n flex-wrap: wrap;\n padding: 0.75rem 1rem;\n margin-bottom: 1rem;\n list-style: none;\n background-color: #e9ecef;\n border-radius: 0.25rem;\n}\n\n.breadcrumb-item + .breadcrumb-item {\n padding-left: 0.5rem;\n}\n\n.breadcrumb-item + .breadcrumb-item::before {\n float: left;\n padding-right: 0.5rem;\n color: #6c757d;\n content: \"/\";\n}\n\n.breadcrumb-item + .breadcrumb-item:hover::before {\n text-decoration: underline;\n}\n\n.breadcrumb-item + .breadcrumb-item:hover::before {\n text-decoration: none;\n}\n\n.breadcrumb-item.active {\n color: #6c757d;\n}\n\n.pagination {\n display: flex;\n padding-left: 0;\n list-style: none;\n border-radius: 0.25rem;\n}\n\n.page-link {\n position: relative;\n display: block;\n padding: 0.5rem 0.75rem;\n margin-left: -1px;\n line-height: 1.25;\n color: #007bff;\n background-color: #fff;\n border: 1px solid #dee2e6;\n}\n\n.page-link:hover {\n z-index: 2;\n color: #0056b3;\n text-decoration: none;\n background-color: #e9ecef;\n border-color: #dee2e6;\n}\n\n.page-link:focus {\n z-index: 3;\n outline: 0;\n box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);\n}\n\n.page-item:first-child .page-link {\n margin-left: 0;\n border-top-left-radius: 0.25rem;\n border-bottom-left-radius: 0.25rem;\n}\n\n.page-item:last-child .page-link {\n border-top-right-radius: 0.25rem;\n border-bottom-right-radius: 0.25rem;\n}\n\n.page-item.active .page-link {\n z-index: 3;\n color: #fff;\n background-color: #007bff;\n border-color: #007bff;\n}\n\n.page-item.disabled .page-link {\n color: #6c757d;\n pointer-events: none;\n cursor: auto;\n background-color: #fff;\n border-color: #dee2e6;\n}\n\n.pagination-lg .page-link {\n padding: 0.75rem 1.5rem;\n font-size: 1.25rem;\n line-height: 1.5;\n}\n\n.pagination-lg .page-item:first-child .page-link {\n border-top-left-radius: 0.3rem;\n border-bottom-left-radius: 0.3rem;\n}\n\n.pagination-lg .page-item:last-child .page-link {\n border-top-right-radius: 0.3rem;\n border-bottom-right-radius: 0.3rem;\n}\n\n.pagination-sm .page-link {\n padding: 0.25rem 0.5rem;\n font-size: 0.875rem;\n line-height: 1.5;\n}\n\n.pagination-sm .page-item:first-child .page-link {\n border-top-left-radius: 0.2rem;\n border-bottom-left-radius: 0.2rem;\n}\n\n.pagination-sm .page-item:last-child .page-link {\n border-top-right-radius: 0.2rem;\n border-bottom-right-radius: 0.2rem;\n}\n\n.badge {\n display: inline-block;\n padding: 0.25em 0.4em;\n font-size: 75%;\n font-weight: 700;\n line-height: 1;\n text-align: center;\n white-space: nowrap;\n vertical-align: baseline;\n border-radius: 0.25rem;\n transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .badge {\n transition: none;\n }\n}\n\na.badge:hover, a.badge:focus {\n text-decoration: none;\n}\n\n.badge:empty {\n display: none;\n}\n\n.btn .badge {\n position: relative;\n top: -1px;\n}\n\n.badge-pill {\n padding-right: 0.6em;\n padding-left: 0.6em;\n border-radius: 10rem;\n}\n\n.badge-primary {\n color: #fff;\n background-color: #007bff;\n}\n\na.badge-primary:hover, a.badge-primary:focus {\n color: #fff;\n background-color: #0062cc;\n}\n\na.badge-primary:focus, a.badge-primary.focus {\n outline: 0;\n box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5);\n}\n\n.badge-secondary {\n color: #fff;\n background-color: #6c757d;\n}\n\na.badge-secondary:hover, a.badge-secondary:focus {\n color: #fff;\n background-color: #545b62;\n}\n\na.badge-secondary:focus, a.badge-secondary.focus {\n outline: 0;\n box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.5);\n}\n\n.badge-success {\n color: #fff;\n background-color: #28a745;\n}\n\na.badge-success:hover, a.badge-success:focus {\n color: #fff;\n background-color: #1e7e34;\n}\n\na.badge-success:focus, a.badge-success.focus {\n outline: 0;\n box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5);\n}\n\n.badge-info {\n color: #fff;\n background-color: #17a2b8;\n}\n\na.badge-info:hover, a.badge-info:focus {\n color: #fff;\n background-color: #117a8b;\n}\n\na.badge-info:focus, a.badge-info.focus {\n outline: 0;\n box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.5);\n}\n\n.badge-warning {\n color: #212529;\n background-color: #ffc107;\n}\n\na.badge-warning:hover, a.badge-warning:focus {\n color: #212529;\n background-color: #d39e00;\n}\n\na.badge-warning:focus, a.badge-warning.focus {\n outline: 0;\n box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.5);\n}\n\n.badge-danger {\n color: #fff;\n background-color: #dc3545;\n}\n\na.badge-danger:hover, a.badge-danger:focus {\n color: #fff;\n background-color: #bd2130;\n}\n\na.badge-danger:focus, a.badge-danger.focus {\n outline: 0;\n box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.5);\n}\n\n.badge-light {\n color: #212529;\n background-color: #f8f9fa;\n}\n\na.badge-light:hover, a.badge-light:focus {\n color: #212529;\n background-color: #dae0e5;\n}\n\na.badge-light:focus, a.badge-light.focus {\n outline: 0;\n box-shadow: 0 0 0 0.2rem rgba(248, 249, 250, 0.5);\n}\n\n.badge-dark {\n color: #fff;\n background-color: #343a40;\n}\n\na.badge-dark:hover, a.badge-dark:focus {\n color: #fff;\n background-color: #1d2124;\n}\n\na.badge-dark:focus, a.badge-dark.focus {\n outline: 0;\n box-shadow: 0 0 0 0.2rem rgba(52, 58, 64, 0.5);\n}\n\n.jumbotron {\n padding: 2rem 1rem;\n margin-bottom: 2rem;\n background-color: #e9ecef;\n border-radius: 0.3rem;\n}\n\n@media (min-width: 576px) {\n .jumbotron {\n padding: 4rem 2rem;\n }\n}\n\n.jumbotron-fluid {\n padding-right: 0;\n padding-left: 0;\n border-radius: 0;\n}\n\n.alert {\n position: relative;\n padding: 0.75rem 1.25rem;\n margin-bottom: 1rem;\n border: 1px solid transparent;\n border-radius: 0.25rem;\n}\n\n.alert-heading {\n color: inherit;\n}\n\n.alert-link {\n font-weight: 700;\n}\n\n.alert-dismissible {\n padding-right: 4rem;\n}\n\n.alert-dismissible .close {\n position: absolute;\n top: 0;\n right: 0;\n z-index: 2;\n padding: 0.75rem 1.25rem;\n color: inherit;\n}\n\n.alert-primary {\n color: #004085;\n background-color: #cce5ff;\n border-color: #b8daff;\n}\n\n.alert-primary hr {\n border-top-color: #9fcdff;\n}\n\n.alert-primary .alert-link {\n color: #002752;\n}\n\n.alert-secondary {\n color: #383d41;\n background-color: #e2e3e5;\n border-color: #d6d8db;\n}\n\n.alert-secondary hr {\n border-top-color: #c8cbcf;\n}\n\n.alert-secondary .alert-link {\n color: #202326;\n}\n\n.alert-success {\n color: #155724;\n background-color: #d4edda;\n border-color: #c3e6cb;\n}\n\n.alert-success hr {\n border-top-color: #b1dfbb;\n}\n\n.alert-success .alert-link {\n color: #0b2e13;\n}\n\n.alert-info {\n color: #0c5460;\n background-color: #d1ecf1;\n border-color: #bee5eb;\n}\n\n.alert-info hr {\n border-top-color: #abdde5;\n}\n\n.alert-info .alert-link {\n color: #062c33;\n}\n\n.alert-warning {\n color: #856404;\n background-color: #fff3cd;\n border-color: #ffeeba;\n}\n\n.alert-warning hr {\n border-top-color: #ffe8a1;\n}\n\n.alert-warning .alert-link {\n color: #533f03;\n}\n\n.alert-danger {\n color: #721c24;\n background-color: #f8d7da;\n border-color: #f5c6cb;\n}\n\n.alert-danger hr {\n border-top-color: #f1b0b7;\n}\n\n.alert-danger .alert-link {\n color: #491217;\n}\n\n.alert-light {\n color: #818182;\n background-color: #fefefe;\n border-color: #fdfdfe;\n}\n\n.alert-light hr {\n border-top-color: #ececf6;\n}\n\n.alert-light .alert-link {\n color: #686868;\n}\n\n.alert-dark {\n color: #1b1e21;\n background-color: #d6d8d9;\n border-color: #c6c8ca;\n}\n\n.alert-dark hr {\n border-top-color: #b9bbbe;\n}\n\n.alert-dark .alert-link {\n color: #040505;\n}\n\n@keyframes progress-bar-stripes {\n from {\n background-position: 1rem 0;\n }\n to {\n background-position: 0 0;\n }\n}\n\n.progress {\n display: flex;\n height: 1rem;\n overflow: hidden;\n line-height: 0;\n font-size: 0.75rem;\n background-color: #e9ecef;\n border-radius: 0.25rem;\n}\n\n.progress-bar {\n display: flex;\n flex-direction: column;\n justify-content: center;\n overflow: hidden;\n color: #fff;\n text-align: center;\n white-space: nowrap;\n background-color: #007bff;\n transition: width 0.6s ease;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .progress-bar {\n transition: none;\n }\n}\n\n.progress-bar-striped {\n background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-size: 1rem 1rem;\n}\n\n.progress-bar-animated {\n animation: 1s linear infinite progress-bar-stripes;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .progress-bar-animated {\n animation: none;\n }\n}\n\n.media {\n display: flex;\n align-items: flex-start;\n}\n\n.media-body {\n flex: 1;\n}\n\n.list-group {\n display: flex;\n flex-direction: column;\n padding-left: 0;\n margin-bottom: 0;\n border-radius: 0.25rem;\n}\n\n.list-group-item-action {\n width: 100%;\n color: #495057;\n text-align: inherit;\n}\n\n.list-group-item-action:hover, .list-group-item-action:focus {\n z-index: 1;\n color: #495057;\n text-decoration: none;\n background-color: #f8f9fa;\n}\n\n.list-group-item-action:active {\n color: #212529;\n background-color: #e9ecef;\n}\n\n.list-group-item {\n position: relative;\n display: block;\n padding: 0.75rem 1.25rem;\n background-color: #fff;\n border: 1px solid rgba(0, 0, 0, 0.125);\n}\n\n.list-group-item:first-child {\n border-top-left-radius: inherit;\n border-top-right-radius: inherit;\n}\n\n.list-group-item:last-child {\n border-bottom-right-radius: inherit;\n border-bottom-left-radius: inherit;\n}\n\n.list-group-item.disabled, .list-group-item:disabled {\n color: #6c757d;\n pointer-events: none;\n background-color: #fff;\n}\n\n.list-group-item.active {\n z-index: 2;\n color: #fff;\n background-color: #007bff;\n border-color: #007bff;\n}\n\n.list-group-item + .list-group-item {\n border-top-width: 0;\n}\n\n.list-group-item + .list-group-item.active {\n margin-top: -1px;\n border-top-width: 1px;\n}\n\n.list-group-horizontal {\n flex-direction: row;\n}\n\n.list-group-horizontal > .list-group-item:first-child {\n border-bottom-left-radius: 0.25rem;\n border-top-right-radius: 0;\n}\n\n.list-group-horizontal > .list-group-item:last-child {\n border-top-right-radius: 0.25rem;\n border-bottom-left-radius: 0;\n}\n\n.list-group-horizontal > .list-group-item.active {\n margin-top: 0;\n}\n\n.list-group-horizontal > .list-group-item + .list-group-item {\n border-top-width: 1px;\n border-left-width: 0;\n}\n\n.list-group-horizontal > .list-group-item + .list-group-item.active {\n margin-left: -1px;\n border-left-width: 1px;\n}\n\n@media (min-width: 576px) {\n .list-group-horizontal-sm {\n flex-direction: row;\n }\n .list-group-horizontal-sm > .list-group-item:first-child {\n border-bottom-left-radius: 0.25rem;\n border-top-right-radius: 0;\n }\n .list-group-horizontal-sm > .list-group-item:last-child {\n border-top-right-radius: 0.25rem;\n border-bottom-left-radius: 0;\n }\n .list-group-horizontal-sm > .list-group-item.active {\n margin-top: 0;\n }\n .list-group-horizontal-sm > .list-group-item + .list-group-item {\n border-top-width: 1px;\n border-left-width: 0;\n }\n .list-group-horizontal-sm > .list-group-item + .list-group-item.active {\n margin-left: -1px;\n border-left-width: 1px;\n }\n}\n\n@media (min-width: 768px) {\n .list-group-horizontal-md {\n flex-direction: row;\n }\n .list-group-horizontal-md > .list-group-item:first-child {\n border-bottom-left-radius: 0.25rem;\n border-top-right-radius: 0;\n }\n .list-group-horizontal-md > .list-group-item:last-child {\n border-top-right-radius: 0.25rem;\n border-bottom-left-radius: 0;\n }\n .list-group-horizontal-md > .list-group-item.active {\n margin-top: 0;\n }\n .list-group-horizontal-md > .list-group-item + .list-group-item {\n border-top-width: 1px;\n border-left-width: 0;\n }\n .list-group-horizontal-md > .list-group-item + .list-group-item.active {\n margin-left: -1px;\n border-left-width: 1px;\n }\n}\n\n@media (min-width: 992px) {\n .list-group-horizontal-lg {\n flex-direction: row;\n }\n .list-group-horizontal-lg > .list-group-item:first-child {\n border-bottom-left-radius: 0.25rem;\n border-top-right-radius: 0;\n }\n .list-group-horizontal-lg > .list-group-item:last-child {\n border-top-right-radius: 0.25rem;\n border-bottom-left-radius: 0;\n }\n .list-group-horizontal-lg > .list-group-item.active {\n margin-top: 0;\n }\n .list-group-horizontal-lg > .list-group-item + .list-group-item {\n border-top-width: 1px;\n border-left-width: 0;\n }\n .list-group-horizontal-lg > .list-group-item + .list-group-item.active {\n margin-left: -1px;\n border-left-width: 1px;\n }\n}\n\n@media (min-width: 1200px) {\n .list-group-horizontal-xl {\n flex-direction: row;\n }\n .list-group-horizontal-xl > .list-group-item:first-child {\n border-bottom-left-radius: 0.25rem;\n border-top-right-radius: 0;\n }\n .list-group-horizontal-xl > .list-group-item:last-child {\n border-top-right-radius: 0.25rem;\n border-bottom-left-radius: 0;\n }\n .list-group-horizontal-xl > .list-group-item.active {\n margin-top: 0;\n }\n .list-group-horizontal-xl > .list-group-item + .list-group-item {\n border-top-width: 1px;\n border-left-width: 0;\n }\n .list-group-horizontal-xl > .list-group-item + .list-group-item.active {\n margin-left: -1px;\n border-left-width: 1px;\n }\n}\n\n.list-group-flush {\n border-radius: 0;\n}\n\n.list-group-flush > .list-group-item {\n border-width: 0 0 1px;\n}\n\n.list-group-flush > .list-group-item:last-child {\n border-bottom-width: 0;\n}\n\n.list-group-item-primary {\n color: #004085;\n background-color: #b8daff;\n}\n\n.list-group-item-primary.list-group-item-action:hover, .list-group-item-primary.list-group-item-action:focus {\n color: #004085;\n background-color: #9fcdff;\n}\n\n.list-group-item-primary.list-group-item-action.active {\n color: #fff;\n background-color: #004085;\n border-color: #004085;\n}\n\n.list-group-item-secondary {\n color: #383d41;\n background-color: #d6d8db;\n}\n\n.list-group-item-secondary.list-group-item-action:hover, .list-group-item-secondary.list-group-item-action:focus {\n color: #383d41;\n background-color: #c8cbcf;\n}\n\n.list-group-item-secondary.list-group-item-action.active {\n color: #fff;\n background-color: #383d41;\n border-color: #383d41;\n}\n\n.list-group-item-success {\n color: #155724;\n background-color: #c3e6cb;\n}\n\n.list-group-item-success.list-group-item-action:hover, .list-group-item-success.list-group-item-action:focus {\n color: #155724;\n background-color: #b1dfbb;\n}\n\n.list-group-item-success.list-group-item-action.active {\n color: #fff;\n background-color: #155724;\n border-color: #155724;\n}\n\n.list-group-item-info {\n color: #0c5460;\n background-color: #bee5eb;\n}\n\n.list-group-item-info.list-group-item-action:hover, .list-group-item-info.list-group-item-action:focus {\n color: #0c5460;\n background-color: #abdde5;\n}\n\n.list-group-item-info.list-group-item-action.active {\n color: #fff;\n background-color: #0c5460;\n border-color: #0c5460;\n}\n\n.list-group-item-warning {\n color: #856404;\n background-color: #ffeeba;\n}\n\n.list-group-item-warning.list-group-item-action:hover, .list-group-item-warning.list-group-item-action:focus {\n color: #856404;\n background-color: #ffe8a1;\n}\n\n.list-group-item-warning.list-group-item-action.active {\n color: #fff;\n background-color: #856404;\n border-color: #856404;\n}\n\n.list-group-item-danger {\n color: #721c24;\n background-color: #f5c6cb;\n}\n\n.list-group-item-danger.list-group-item-action:hover, .list-group-item-danger.list-group-item-action:focus {\n color: #721c24;\n background-color: #f1b0b7;\n}\n\n.list-group-item-danger.list-group-item-action.active {\n color: #fff;\n background-color: #721c24;\n border-color: #721c24;\n}\n\n.list-group-item-light {\n color: #818182;\n background-color: #fdfdfe;\n}\n\n.list-group-item-light.list-group-item-action:hover, .list-group-item-light.list-group-item-action:focus {\n color: #818182;\n background-color: #ececf6;\n}\n\n.list-group-item-light.list-group-item-action.active {\n color: #fff;\n background-color: #818182;\n border-color: #818182;\n}\n\n.list-group-item-dark {\n color: #1b1e21;\n background-color: #c6c8ca;\n}\n\n.list-group-item-dark.list-group-item-action:hover, .list-group-item-dark.list-group-item-action:focus {\n color: #1b1e21;\n background-color: #b9bbbe;\n}\n\n.list-group-item-dark.list-group-item-action.active {\n color: #fff;\n background-color: #1b1e21;\n border-color: #1b1e21;\n}\n\n.close {\n float: right;\n font-size: 1.5rem;\n font-weight: 700;\n line-height: 1;\n color: #000;\n text-shadow: 0 1px 0 #fff;\n opacity: .5;\n}\n\n.close:hover {\n color: #000;\n text-decoration: none;\n}\n\n.close:not(:disabled):not(.disabled):hover, .close:not(:disabled):not(.disabled):focus {\n opacity: .75;\n}\n\nbutton.close {\n padding: 0;\n background-color: transparent;\n border: 0;\n}\n\na.close.disabled {\n pointer-events: none;\n}\n\n.toast {\n flex-basis: 350px;\n max-width: 350px;\n font-size: 0.875rem;\n background-color: rgba(255, 255, 255, 0.85);\n background-clip: padding-box;\n border: 1px solid rgba(0, 0, 0, 0.1);\n box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);\n opacity: 0;\n border-radius: 0.25rem;\n}\n\n.toast:not(:last-child) {\n margin-bottom: 0.75rem;\n}\n\n.toast.showing {\n opacity: 1;\n}\n\n.toast.show {\n display: block;\n opacity: 1;\n}\n\n.toast.hide {\n display: none;\n}\n\n.toast-header {\n display: flex;\n align-items: center;\n padding: 0.25rem 0.75rem;\n color: #6c757d;\n background-color: rgba(255, 255, 255, 0.85);\n background-clip: padding-box;\n border-bottom: 1px solid rgba(0, 0, 0, 0.05);\n border-top-left-radius: calc(0.25rem - 1px);\n border-top-right-radius: calc(0.25rem - 1px);\n}\n\n.toast-body {\n padding: 0.75rem;\n}\n\n.modal-open {\n overflow: hidden;\n}\n\n.modal-open .modal {\n overflow-x: hidden;\n overflow-y: auto;\n}\n\n.modal {\n position: fixed;\n top: 0;\n left: 0;\n z-index: 1050;\n display: none;\n width: 100%;\n height: 100%;\n overflow: hidden;\n outline: 0;\n}\n\n.modal-dialog {\n position: relative;\n width: auto;\n margin: 0.5rem;\n pointer-events: none;\n}\n\n.modal.fade .modal-dialog {\n transition: transform 0.3s ease-out;\n transform: translate(0, -50px);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .modal.fade .modal-dialog {\n transition: none;\n }\n}\n\n.modal.show .modal-dialog {\n transform: none;\n}\n\n.modal.modal-static .modal-dialog {\n transform: scale(1.02);\n}\n\n.modal-dialog-scrollable {\n display: flex;\n max-height: calc(100% - 1rem);\n}\n\n.modal-dialog-scrollable .modal-content {\n max-height: calc(100vh - 1rem);\n overflow: hidden;\n}\n\n.modal-dialog-scrollable .modal-header,\n.modal-dialog-scrollable .modal-footer {\n flex-shrink: 0;\n}\n\n.modal-dialog-scrollable .modal-body {\n overflow-y: auto;\n}\n\n.modal-dialog-centered {\n display: flex;\n align-items: center;\n min-height: calc(100% - 1rem);\n}\n\n.modal-dialog-centered::before {\n display: block;\n height: calc(100vh - 1rem);\n height: min-content;\n content: \"\";\n}\n\n.modal-dialog-centered.modal-dialog-scrollable {\n flex-direction: column;\n justify-content: center;\n height: 100%;\n}\n\n.modal-dialog-centered.modal-dialog-scrollable .modal-content {\n max-height: none;\n}\n\n.modal-dialog-centered.modal-dialog-scrollable::before {\n content: none;\n}\n\n.modal-content {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n pointer-events: auto;\n background-color: #fff;\n background-clip: padding-box;\n border: 1px solid rgba(0, 0, 0, 0.2);\n border-radius: 0.3rem;\n outline: 0;\n}\n\n.modal-backdrop {\n position: fixed;\n top: 0;\n left: 0;\n z-index: 1040;\n width: 100vw;\n height: 100vh;\n background-color: #000;\n}\n\n.modal-backdrop.fade {\n opacity: 0;\n}\n\n.modal-backdrop.show {\n opacity: 0.5;\n}\n\n.modal-header {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n padding: 1rem 1rem;\n border-bottom: 1px solid #dee2e6;\n border-top-left-radius: calc(0.3rem - 1px);\n border-top-right-radius: calc(0.3rem - 1px);\n}\n\n.modal-header .close {\n padding: 1rem 1rem;\n margin: -1rem -1rem -1rem auto;\n}\n\n.modal-title {\n margin-bottom: 0;\n line-height: 1.5;\n}\n\n.modal-body {\n position: relative;\n flex: 1 1 auto;\n padding: 1rem;\n}\n\n.modal-footer {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: flex-end;\n padding: 0.75rem;\n border-top: 1px solid #dee2e6;\n border-bottom-right-radius: calc(0.3rem - 1px);\n border-bottom-left-radius: calc(0.3rem - 1px);\n}\n\n.modal-footer > * {\n margin: 0.25rem;\n}\n\n.modal-scrollbar-measure {\n position: absolute;\n top: -9999px;\n width: 50px;\n height: 50px;\n overflow: scroll;\n}\n\n@media (min-width: 576px) {\n .modal-dialog {\n max-width: 500px;\n margin: 1.75rem auto;\n }\n .modal-dialog-scrollable {\n max-height: calc(100% - 3.5rem);\n }\n .modal-dialog-scrollable .modal-content {\n max-height: calc(100vh - 3.5rem);\n }\n .modal-dialog-centered {\n min-height: calc(100% - 3.5rem);\n }\n .modal-dialog-centered::before {\n height: calc(100vh - 3.5rem);\n height: min-content;\n }\n .modal-sm {\n max-width: 300px;\n }\n}\n\n@media (min-width: 992px) {\n .modal-lg,\n .modal-xl {\n max-width: 800px;\n }\n}\n\n@media (min-width: 1200px) {\n .modal-xl {\n max-width: 1140px;\n }\n}\n\n.tooltip {\n position: absolute;\n z-index: 1070;\n display: block;\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Noto Sans\", \"Liberation Sans\", sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\";\n font-style: normal;\n font-weight: 400;\n line-height: 1.5;\n text-align: left;\n text-align: start;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n letter-spacing: normal;\n word-break: normal;\n word-spacing: normal;\n white-space: normal;\n line-break: auto;\n font-size: 0.875rem;\n word-wrap: break-word;\n opacity: 0;\n}\n\n.tooltip.show {\n opacity: 0.9;\n}\n\n.tooltip .arrow {\n position: absolute;\n display: block;\n width: 0.8rem;\n height: 0.4rem;\n}\n\n.tooltip .arrow::before {\n position: absolute;\n content: \"\";\n border-color: transparent;\n border-style: solid;\n}\n\n.bs-tooltip-top, .bs-tooltip-auto[x-placement^=\"top\"] {\n padding: 0.4rem 0;\n}\n\n.bs-tooltip-top .arrow, .bs-tooltip-auto[x-placement^=\"top\"] .arrow {\n bottom: 0;\n}\n\n.bs-tooltip-top .arrow::before, .bs-tooltip-auto[x-placement^=\"top\"] .arrow::before {\n top: 0;\n border-width: 0.4rem 0.4rem 0;\n border-top-color: #000;\n}\n\n.bs-tooltip-right, .bs-tooltip-auto[x-placement^=\"right\"] {\n padding: 0 0.4rem;\n}\n\n.bs-tooltip-right .arrow, .bs-tooltip-auto[x-placement^=\"right\"] .arrow {\n left: 0;\n width: 0.4rem;\n height: 0.8rem;\n}\n\n.bs-tooltip-right .arrow::before, .bs-tooltip-auto[x-placement^=\"right\"] .arrow::before {\n right: 0;\n border-width: 0.4rem 0.4rem 0.4rem 0;\n border-right-color: #000;\n}\n\n.bs-tooltip-bottom, .bs-tooltip-auto[x-placement^=\"bottom\"] {\n padding: 0.4rem 0;\n}\n\n.bs-tooltip-bottom .arrow, .bs-tooltip-auto[x-placement^=\"bottom\"] .arrow {\n top: 0;\n}\n\n.bs-tooltip-bottom .arrow::before, .bs-tooltip-auto[x-placement^=\"bottom\"] .arrow::before {\n bottom: 0;\n border-width: 0 0.4rem 0.4rem;\n border-bottom-color: #000;\n}\n\n.bs-tooltip-left, .bs-tooltip-auto[x-placement^=\"left\"] {\n padding: 0 0.4rem;\n}\n\n.bs-tooltip-left .arrow, .bs-tooltip-auto[x-placement^=\"left\"] .arrow {\n right: 0;\n width: 0.4rem;\n height: 0.8rem;\n}\n\n.bs-tooltip-left .arrow::before, .bs-tooltip-auto[x-placement^=\"left\"] .arrow::before {\n left: 0;\n border-width: 0.4rem 0 0.4rem 0.4rem;\n border-left-color: #000;\n}\n\n.tooltip-inner {\n max-width: 200px;\n padding: 0.25rem 0.5rem;\n color: #fff;\n text-align: center;\n background-color: #000;\n border-radius: 0.25rem;\n}\n\n.popover {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 1060;\n display: block;\n max-width: 276px;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Noto Sans\", \"Liberation Sans\", sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\";\n font-style: normal;\n font-weight: 400;\n line-height: 1.5;\n text-align: left;\n text-align: start;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n letter-spacing: normal;\n word-break: normal;\n word-spacing: normal;\n white-space: normal;\n line-break: auto;\n font-size: 0.875rem;\n word-wrap: break-word;\n background-color: #fff;\n background-clip: padding-box;\n border: 1px solid rgba(0, 0, 0, 0.2);\n border-radius: 0.3rem;\n}\n\n.popover .arrow {\n position: absolute;\n display: block;\n width: 1rem;\n height: 0.5rem;\n margin: 0 0.3rem;\n}\n\n.popover .arrow::before, .popover .arrow::after {\n position: absolute;\n display: block;\n content: \"\";\n border-color: transparent;\n border-style: solid;\n}\n\n.bs-popover-top, .bs-popover-auto[x-placement^=\"top\"] {\n margin-bottom: 0.5rem;\n}\n\n.bs-popover-top > .arrow, .bs-popover-auto[x-placement^=\"top\"] > .arrow {\n bottom: calc(-0.5rem - 1px);\n}\n\n.bs-popover-top > .arrow::before, .bs-popover-auto[x-placement^=\"top\"] > .arrow::before {\n bottom: 0;\n border-width: 0.5rem 0.5rem 0;\n border-top-color: rgba(0, 0, 0, 0.25);\n}\n\n.bs-popover-top > .arrow::after, .bs-popover-auto[x-placement^=\"top\"] > .arrow::after {\n bottom: 1px;\n border-width: 0.5rem 0.5rem 0;\n border-top-color: #fff;\n}\n\n.bs-popover-right, .bs-popover-auto[x-placement^=\"right\"] {\n margin-left: 0.5rem;\n}\n\n.bs-popover-right > .arrow, .bs-popover-auto[x-placement^=\"right\"] > .arrow {\n left: calc(-0.5rem - 1px);\n width: 0.5rem;\n height: 1rem;\n margin: 0.3rem 0;\n}\n\n.bs-popover-right > .arrow::before, .bs-popover-auto[x-placement^=\"right\"] > .arrow::before {\n left: 0;\n border-width: 0.5rem 0.5rem 0.5rem 0;\n border-right-color: rgba(0, 0, 0, 0.25);\n}\n\n.bs-popover-right > .arrow::after, .bs-popover-auto[x-placement^=\"right\"] > .arrow::after {\n left: 1px;\n border-width: 0.5rem 0.5rem 0.5rem 0;\n border-right-color: #fff;\n}\n\n.bs-popover-bottom, .bs-popover-auto[x-placement^=\"bottom\"] {\n margin-top: 0.5rem;\n}\n\n.bs-popover-bottom > .arrow, .bs-popover-auto[x-placement^=\"bottom\"] > .arrow {\n top: calc(-0.5rem - 1px);\n}\n\n.bs-popover-bottom > .arrow::before, .bs-popover-auto[x-placement^=\"bottom\"] > .arrow::before {\n top: 0;\n border-width: 0 0.5rem 0.5rem 0.5rem;\n border-bottom-color: rgba(0, 0, 0, 0.25);\n}\n\n.bs-popover-bottom > .arrow::after, .bs-popover-auto[x-placement^=\"bottom\"] > .arrow::after {\n top: 1px;\n border-width: 0 0.5rem 0.5rem 0.5rem;\n border-bottom-color: #fff;\n}\n\n.bs-popover-bottom .popover-header::before, .bs-popover-auto[x-placement^=\"bottom\"] .popover-header::before {\n position: absolute;\n top: 0;\n left: 50%;\n display: block;\n width: 1rem;\n margin-left: -0.5rem;\n content: \"\";\n border-bottom: 1px solid #f7f7f7;\n}\n\n.bs-popover-left, .bs-popover-auto[x-placement^=\"left\"] {\n margin-right: 0.5rem;\n}\n\n.bs-popover-left > .arrow, .bs-popover-auto[x-placement^=\"left\"] > .arrow {\n right: calc(-0.5rem - 1px);\n width: 0.5rem;\n height: 1rem;\n margin: 0.3rem 0;\n}\n\n.bs-popover-left > .arrow::before, .bs-popover-auto[x-placement^=\"left\"] > .arrow::before {\n right: 0;\n border-width: 0.5rem 0 0.5rem 0.5rem;\n border-left-color: rgba(0, 0, 0, 0.25);\n}\n\n.bs-popover-left > .arrow::after, .bs-popover-auto[x-placement^=\"left\"] > .arrow::after {\n right: 1px;\n border-width: 0.5rem 0 0.5rem 0.5rem;\n border-left-color: #fff;\n}\n\n.popover-header {\n padding: 0.5rem 0.75rem;\n margin-bottom: 0;\n font-size: 1rem;\n background-color: #f7f7f7;\n border-bottom: 1px solid #ebebeb;\n border-top-left-radius: calc(0.3rem - 1px);\n border-top-right-radius: calc(0.3rem - 1px);\n}\n\n.popover-header:empty {\n display: none;\n}\n\n.popover-body {\n padding: 0.5rem 0.75rem;\n color: #212529;\n}\n\n.carousel {\n position: relative;\n}\n\n.carousel.pointer-event {\n touch-action: pan-y;\n}\n\n.carousel-inner {\n position: relative;\n width: 100%;\n overflow: hidden;\n}\n\n.carousel-inner::after {\n display: block;\n clear: both;\n content: \"\";\n}\n\n.carousel-item {\n position: relative;\n display: none;\n float: left;\n width: 100%;\n margin-right: -100%;\n backface-visibility: hidden;\n transition: transform 0.6s ease-in-out;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .carousel-item {\n transition: none;\n }\n}\n\n.carousel-item.active,\n.carousel-item-next,\n.carousel-item-prev {\n display: block;\n}\n\n.carousel-item-next:not(.carousel-item-left),\n.active.carousel-item-right {\n transform: translateX(100%);\n}\n\n.carousel-item-prev:not(.carousel-item-right),\n.active.carousel-item-left {\n transform: translateX(-100%);\n}\n\n.carousel-fade .carousel-item {\n opacity: 0;\n transition-property: opacity;\n transform: none;\n}\n\n.carousel-fade .carousel-item.active,\n.carousel-fade .carousel-item-next.carousel-item-left,\n.carousel-fade .carousel-item-prev.carousel-item-right {\n z-index: 1;\n opacity: 1;\n}\n\n.carousel-fade .active.carousel-item-left,\n.carousel-fade .active.carousel-item-right {\n z-index: 0;\n opacity: 0;\n transition: opacity 0s 0.6s;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .carousel-fade .active.carousel-item-left,\n .carousel-fade .active.carousel-item-right {\n transition: none;\n }\n}\n\n.carousel-control-prev,\n.carousel-control-next {\n position: absolute;\n top: 0;\n bottom: 0;\n z-index: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 15%;\n color: #fff;\n text-align: center;\n opacity: 0.5;\n transition: opacity 0.15s ease;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .carousel-control-prev,\n .carousel-control-next {\n transition: none;\n }\n}\n\n.carousel-control-prev:hover, .carousel-control-prev:focus,\n.carousel-control-next:hover,\n.carousel-control-next:focus {\n color: #fff;\n text-decoration: none;\n outline: 0;\n opacity: 0.9;\n}\n\n.carousel-control-prev {\n left: 0;\n}\n\n.carousel-control-next {\n right: 0;\n}\n\n.carousel-control-prev-icon,\n.carousel-control-next-icon {\n display: inline-block;\n width: 20px;\n height: 20px;\n background: 50% / 100% 100% no-repeat;\n}\n\n.carousel-control-prev-icon {\n background-image: url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath d='M5.25 0l-4 4 4 4 1.5-1.5L4.25 4l2.5-2.5L5.25 0z'/%3e%3c/svg%3e\");\n}\n\n.carousel-control-next-icon {\n background-image: url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath d='M2.75 0l-1.5 1.5L3.75 4l-2.5 2.5L2.75 8l4-4-4-4z'/%3e%3c/svg%3e\");\n}\n\n.carousel-indicators {\n position: absolute;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 15;\n display: flex;\n justify-content: center;\n padding-left: 0;\n margin-right: 15%;\n margin-left: 15%;\n list-style: none;\n}\n\n.carousel-indicators li {\n box-sizing: content-box;\n flex: 0 1 auto;\n width: 30px;\n height: 3px;\n margin-right: 3px;\n margin-left: 3px;\n text-indent: -999px;\n cursor: pointer;\n background-color: #fff;\n background-clip: padding-box;\n border-top: 10px solid transparent;\n border-bottom: 10px solid transparent;\n opacity: .5;\n transition: opacity 0.6s ease;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .carousel-indicators li {\n transition: none;\n }\n}\n\n.carousel-indicators .active {\n opacity: 1;\n}\n\n.carousel-caption {\n position: absolute;\n right: 15%;\n bottom: 20px;\n left: 15%;\n z-index: 10;\n padding-top: 20px;\n padding-bottom: 20px;\n color: #fff;\n text-align: center;\n}\n\n@keyframes spinner-border {\n to {\n transform: rotate(360deg);\n }\n}\n\n.spinner-border {\n display: inline-block;\n width: 2rem;\n height: 2rem;\n vertical-align: text-bottom;\n border: 0.25em solid currentColor;\n border-right-color: transparent;\n border-radius: 50%;\n animation: .75s linear infinite spinner-border;\n}\n\n.spinner-border-sm {\n width: 1rem;\n height: 1rem;\n border-width: 0.2em;\n}\n\n@keyframes spinner-grow {\n 0% {\n transform: scale(0);\n }\n 50% {\n opacity: 1;\n transform: none;\n }\n}\n\n.spinner-grow {\n display: inline-block;\n width: 2rem;\n height: 2rem;\n vertical-align: text-bottom;\n background-color: currentColor;\n border-radius: 50%;\n opacity: 0;\n animation: .75s linear infinite spinner-grow;\n}\n\n.spinner-grow-sm {\n width: 1rem;\n height: 1rem;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .spinner-border,\n .spinner-grow {\n animation-duration: 1.5s;\n }\n}\n\n.align-baseline {\n vertical-align: baseline !important;\n}\n\n.align-top {\n vertical-align: top !important;\n}\n\n.align-middle {\n vertical-align: middle !important;\n}\n\n.align-bottom {\n vertical-align: bottom !important;\n}\n\n.align-text-bottom {\n vertical-align: text-bottom !important;\n}\n\n.align-text-top {\n vertical-align: text-top !important;\n}\n\n.bg-primary {\n background-color: #007bff !important;\n}\n\na.bg-primary:hover, a.bg-primary:focus,\nbutton.bg-primary:hover,\nbutton.bg-primary:focus {\n background-color: #0062cc !important;\n}\n\n.bg-secondary {\n background-color: #6c757d !important;\n}\n\na.bg-secondary:hover, a.bg-secondary:focus,\nbutton.bg-secondary:hover,\nbutton.bg-secondary:focus {\n background-color: #545b62 !important;\n}\n\n.bg-success {\n background-color: #28a745 !important;\n}\n\na.bg-success:hover, a.bg-success:focus,\nbutton.bg-success:hover,\nbutton.bg-success:focus {\n background-color: #1e7e34 !important;\n}\n\n.bg-info {\n background-color: #17a2b8 !important;\n}\n\na.bg-info:hover, a.bg-info:focus,\nbutton.bg-info:hover,\nbutton.bg-info:focus {\n background-color: #117a8b !important;\n}\n\n.bg-warning {\n background-color: #ffc107 !important;\n}\n\na.bg-warning:hover, a.bg-warning:focus,\nbutton.bg-warning:hover,\nbutton.bg-warning:focus {\n background-color: #d39e00 !important;\n}\n\n.bg-danger {\n background-color: #dc3545 !important;\n}\n\na.bg-danger:hover, a.bg-danger:focus,\nbutton.bg-danger:hover,\nbutton.bg-danger:focus {\n background-color: #bd2130 !important;\n}\n\n.bg-light {\n background-color: #f8f9fa !important;\n}\n\na.bg-light:hover, a.bg-light:focus,\nbutton.bg-light:hover,\nbutton.bg-light:focus {\n background-color: #dae0e5 !important;\n}\n\n.bg-dark {\n background-color: #343a40 !important;\n}\n\na.bg-dark:hover, a.bg-dark:focus,\nbutton.bg-dark:hover,\nbutton.bg-dark:focus {\n background-color: #1d2124 !important;\n}\n\n.bg-white {\n background-color: #fff !important;\n}\n\n.bg-transparent {\n background-color: transparent !important;\n}\n\n.border {\n border: 1px solid #dee2e6 !important;\n}\n\n.border-top {\n border-top: 1px solid #dee2e6 !important;\n}\n\n.border-right {\n border-right: 1px solid #dee2e6 !important;\n}\n\n.border-bottom {\n border-bottom: 1px solid #dee2e6 !important;\n}\n\n.border-left {\n border-left: 1px solid #dee2e6 !important;\n}\n\n.border-0 {\n border: 0 !important;\n}\n\n.border-top-0 {\n border-top: 0 !important;\n}\n\n.border-right-0 {\n border-right: 0 !important;\n}\n\n.border-bottom-0 {\n border-bottom: 0 !important;\n}\n\n.border-left-0 {\n border-left: 0 !important;\n}\n\n.border-primary {\n border-color: #007bff !important;\n}\n\n.border-secondary {\n border-color: #6c757d !important;\n}\n\n.border-success {\n border-color: #28a745 !important;\n}\n\n.border-info {\n border-color: #17a2b8 !important;\n}\n\n.border-warning {\n border-color: #ffc107 !important;\n}\n\n.border-danger {\n border-color: #dc3545 !important;\n}\n\n.border-light {\n border-color: #f8f9fa !important;\n}\n\n.border-dark {\n border-color: #343a40 !important;\n}\n\n.border-white {\n border-color: #fff !important;\n}\n\n.rounded-sm {\n border-radius: 0.2rem !important;\n}\n\n.rounded {\n border-radius: 0.25rem !important;\n}\n\n.rounded-top {\n border-top-left-radius: 0.25rem !important;\n border-top-right-radius: 0.25rem !important;\n}\n\n.rounded-right {\n border-top-right-radius: 0.25rem !important;\n border-bottom-right-radius: 0.25rem !important;\n}\n\n.rounded-bottom {\n border-bottom-right-radius: 0.25rem !important;\n border-bottom-left-radius: 0.25rem !important;\n}\n\n.rounded-left {\n border-top-left-radius: 0.25rem !important;\n border-bottom-left-radius: 0.25rem !important;\n}\n\n.rounded-lg {\n border-radius: 0.3rem !important;\n}\n\n.rounded-circle {\n border-radius: 50% !important;\n}\n\n.rounded-pill {\n border-radius: 50rem !important;\n}\n\n.rounded-0 {\n border-radius: 0 !important;\n}\n\n.clearfix::after {\n display: block;\n clear: both;\n content: \"\";\n}\n\n.d-none {\n display: none !important;\n}\n\n.d-inline {\n display: inline !important;\n}\n\n.d-inline-block {\n display: inline-block !important;\n}\n\n.d-block {\n display: block !important;\n}\n\n.d-table {\n display: table !important;\n}\n\n.d-table-row {\n display: table-row !important;\n}\n\n.d-table-cell {\n display: table-cell !important;\n}\n\n.d-flex {\n display: flex !important;\n}\n\n.d-inline-flex {\n display: inline-flex !important;\n}\n\n@media (min-width: 576px) {\n .d-sm-none {\n display: none !important;\n }\n .d-sm-inline {\n display: inline !important;\n }\n .d-sm-inline-block {\n display: inline-block !important;\n }\n .d-sm-block {\n display: block !important;\n }\n .d-sm-table {\n display: table !important;\n }\n .d-sm-table-row {\n display: table-row !important;\n }\n .d-sm-table-cell {\n display: table-cell !important;\n }\n .d-sm-flex {\n display: flex !important;\n }\n .d-sm-inline-flex {\n display: inline-flex !important;\n }\n}\n\n@media (min-width: 768px) {\n .d-md-none {\n display: none !important;\n }\n .d-md-inline {\n display: inline !important;\n }\n .d-md-inline-block {\n display: inline-block !important;\n }\n .d-md-block {\n display: block !important;\n }\n .d-md-table {\n display: table !important;\n }\n .d-md-table-row {\n display: table-row !important;\n }\n .d-md-table-cell {\n display: table-cell !important;\n }\n .d-md-flex {\n display: flex !important;\n }\n .d-md-inline-flex {\n display: inline-flex !important;\n }\n}\n\n@media (min-width: 992px) {\n .d-lg-none {\n display: none !important;\n }\n .d-lg-inline {\n display: inline !important;\n }\n .d-lg-inline-block {\n display: inline-block !important;\n }\n .d-lg-block {\n display: block !important;\n }\n .d-lg-table {\n display: table !important;\n }\n .d-lg-table-row {\n display: table-row !important;\n }\n .d-lg-table-cell {\n display: table-cell !important;\n }\n .d-lg-flex {\n display: flex !important;\n }\n .d-lg-inline-flex {\n display: inline-flex !important;\n }\n}\n\n@media (min-width: 1200px) {\n .d-xl-none {\n display: none !important;\n }\n .d-xl-inline {\n display: inline !important;\n }\n .d-xl-inline-block {\n display: inline-block !important;\n }\n .d-xl-block {\n display: block !important;\n }\n .d-xl-table {\n display: table !important;\n }\n .d-xl-table-row {\n display: table-row !important;\n }\n .d-xl-table-cell {\n display: table-cell !important;\n }\n .d-xl-flex {\n display: flex !important;\n }\n .d-xl-inline-flex {\n display: inline-flex !important;\n }\n}\n\n@media print {\n .d-print-none {\n display: none !important;\n }\n .d-print-inline {\n display: inline !important;\n }\n .d-print-inline-block {\n display: inline-block !important;\n }\n .d-print-block {\n display: block !important;\n }\n .d-print-table {\n display: table !important;\n }\n .d-print-table-row {\n display: table-row !important;\n }\n .d-print-table-cell {\n display: table-cell !important;\n }\n .d-print-flex {\n display: flex !important;\n }\n .d-print-inline-flex {\n display: inline-flex !important;\n }\n}\n\n.embed-responsive {\n position: relative;\n display: block;\n width: 100%;\n padding: 0;\n overflow: hidden;\n}\n\n.embed-responsive::before {\n display: block;\n content: \"\";\n}\n\n.embed-responsive .embed-responsive-item,\n.embed-responsive iframe,\n.embed-responsive embed,\n.embed-responsive object,\n.embed-responsive video {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border: 0;\n}\n\n.embed-responsive-21by9::before {\n padding-top: 42.857143%;\n}\n\n.embed-responsive-16by9::before {\n padding-top: 56.25%;\n}\n\n.embed-responsive-4by3::before {\n padding-top: 75%;\n}\n\n.embed-responsive-1by1::before {\n padding-top: 100%;\n}\n\n.flex-row {\n flex-direction: row !important;\n}\n\n.flex-column {\n flex-direction: column !important;\n}\n\n.flex-row-reverse {\n flex-direction: row-reverse !important;\n}\n\n.flex-column-reverse {\n flex-direction: column-reverse !important;\n}\n\n.flex-wrap {\n flex-wrap: wrap !important;\n}\n\n.flex-nowrap {\n flex-wrap: nowrap !important;\n}\n\n.flex-wrap-reverse {\n flex-wrap: wrap-reverse !important;\n}\n\n.flex-fill {\n flex: 1 1 auto !important;\n}\n\n.flex-grow-0 {\n flex-grow: 0 !important;\n}\n\n.flex-grow-1 {\n flex-grow: 1 !important;\n}\n\n.flex-shrink-0 {\n flex-shrink: 0 !important;\n}\n\n.flex-shrink-1 {\n flex-shrink: 1 !important;\n}\n\n.justify-content-start {\n justify-content: flex-start !important;\n}\n\n.justify-content-end {\n justify-content: flex-end !important;\n}\n\n.justify-content-center {\n justify-content: center !important;\n}\n\n.justify-content-between {\n justify-content: space-between !important;\n}\n\n.justify-content-around {\n justify-content: space-around !important;\n}\n\n.align-items-start {\n align-items: flex-start !important;\n}\n\n.align-items-end {\n align-items: flex-end !important;\n}\n\n.align-items-center {\n align-items: center !important;\n}\n\n.align-items-baseline {\n align-items: baseline !important;\n}\n\n.align-items-stretch {\n align-items: stretch !important;\n}\n\n.align-content-start {\n align-content: flex-start !important;\n}\n\n.align-content-end {\n align-content: flex-end !important;\n}\n\n.align-content-center {\n align-content: center !important;\n}\n\n.align-content-between {\n align-content: space-between !important;\n}\n\n.align-content-around {\n align-content: space-around !important;\n}\n\n.align-content-stretch {\n align-content: stretch !important;\n}\n\n.align-self-auto {\n align-self: auto !important;\n}\n\n.align-self-start {\n align-self: flex-start !important;\n}\n\n.align-self-end {\n align-self: flex-end !important;\n}\n\n.align-self-center {\n align-self: center !important;\n}\n\n.align-self-baseline {\n align-self: baseline !important;\n}\n\n.align-self-stretch {\n align-self: stretch !important;\n}\n\n@media (min-width: 576px) {\n .flex-sm-row {\n flex-direction: row !important;\n }\n .flex-sm-column {\n flex-direction: column !important;\n }\n .flex-sm-row-reverse {\n flex-direction: row-reverse !important;\n }\n .flex-sm-column-reverse {\n flex-direction: column-reverse !important;\n }\n .flex-sm-wrap {\n flex-wrap: wrap !important;\n }\n .flex-sm-nowrap {\n flex-wrap: nowrap !important;\n }\n .flex-sm-wrap-reverse {\n flex-wrap: wrap-reverse !important;\n }\n .flex-sm-fill {\n flex: 1 1 auto !important;\n }\n .flex-sm-grow-0 {\n flex-grow: 0 !important;\n }\n .flex-sm-grow-1 {\n flex-grow: 1 !important;\n }\n .flex-sm-shrink-0 {\n flex-shrink: 0 !important;\n }\n .flex-sm-shrink-1 {\n flex-shrink: 1 !important;\n }\n .justify-content-sm-start {\n justify-content: flex-start !important;\n }\n .justify-content-sm-end {\n justify-content: flex-end !important;\n }\n .justify-content-sm-center {\n justify-content: center !important;\n }\n .justify-content-sm-between {\n justify-content: space-between !important;\n }\n .justify-content-sm-around {\n justify-content: space-around !important;\n }\n .align-items-sm-start {\n align-items: flex-start !important;\n }\n .align-items-sm-end {\n align-items: flex-end !important;\n }\n .align-items-sm-center {\n align-items: center !important;\n }\n .align-items-sm-baseline {\n align-items: baseline !important;\n }\n .align-items-sm-stretch {\n align-items: stretch !important;\n }\n .align-content-sm-start {\n align-content: flex-start !important;\n }\n .align-content-sm-end {\n align-content: flex-end !important;\n }\n .align-content-sm-center {\n align-content: center !important;\n }\n .align-content-sm-between {\n align-content: space-between !important;\n }\n .align-content-sm-around {\n align-content: space-around !important;\n }\n .align-content-sm-stretch {\n align-content: stretch !important;\n }\n .align-self-sm-auto {\n align-self: auto !important;\n }\n .align-self-sm-start {\n align-self: flex-start !important;\n }\n .align-self-sm-end {\n align-self: flex-end !important;\n }\n .align-self-sm-center {\n align-self: center !important;\n }\n .align-self-sm-baseline {\n align-self: baseline !important;\n }\n .align-self-sm-stretch {\n align-self: stretch !important;\n }\n}\n\n@media (min-width: 768px) {\n .flex-md-row {\n flex-direction: row !important;\n }\n .flex-md-column {\n flex-direction: column !important;\n }\n .flex-md-row-reverse {\n flex-direction: row-reverse !important;\n }\n .flex-md-column-reverse {\n flex-direction: column-reverse !important;\n }\n .flex-md-wrap {\n flex-wrap: wrap !important;\n }\n .flex-md-nowrap {\n flex-wrap: nowrap !important;\n }\n .flex-md-wrap-reverse {\n flex-wrap: wrap-reverse !important;\n }\n .flex-md-fill {\n flex: 1 1 auto !important;\n }\n .flex-md-grow-0 {\n flex-grow: 0 !important;\n }\n .flex-md-grow-1 {\n flex-grow: 1 !important;\n }\n .flex-md-shrink-0 {\n flex-shrink: 0 !important;\n }\n .flex-md-shrink-1 {\n flex-shrink: 1 !important;\n }\n .justify-content-md-start {\n justify-content: flex-start !important;\n }\n .justify-content-md-end {\n justify-content: flex-end !important;\n }\n .justify-content-md-center {\n justify-content: center !important;\n }\n .justify-content-md-between {\n justify-content: space-between !important;\n }\n .justify-content-md-around {\n justify-content: space-around !important;\n }\n .align-items-md-start {\n align-items: flex-start !important;\n }\n .align-items-md-end {\n align-items: flex-end !important;\n }\n .align-items-md-center {\n align-items: center !important;\n }\n .align-items-md-baseline {\n align-items: baseline !important;\n }\n .align-items-md-stretch {\n align-items: stretch !important;\n }\n .align-content-md-start {\n align-content: flex-start !important;\n }\n .align-content-md-end {\n align-content: flex-end !important;\n }\n .align-content-md-center {\n align-content: center !important;\n }\n .align-content-md-between {\n align-content: space-between !important;\n }\n .align-content-md-around {\n align-content: space-around !important;\n }\n .align-content-md-stretch {\n align-content: stretch !important;\n }\n .align-self-md-auto {\n align-self: auto !important;\n }\n .align-self-md-start {\n align-self: flex-start !important;\n }\n .align-self-md-end {\n align-self: flex-end !important;\n }\n .align-self-md-center {\n align-self: center !important;\n }\n .align-self-md-baseline {\n align-self: baseline !important;\n }\n .align-self-md-stretch {\n align-self: stretch !important;\n }\n}\n\n@media (min-width: 992px) {\n .flex-lg-row {\n flex-direction: row !important;\n }\n .flex-lg-column {\n flex-direction: column !important;\n }\n .flex-lg-row-reverse {\n flex-direction: row-reverse !important;\n }\n .flex-lg-column-reverse {\n flex-direction: column-reverse !important;\n }\n .flex-lg-wrap {\n flex-wrap: wrap !important;\n }\n .flex-lg-nowrap {\n flex-wrap: nowrap !important;\n }\n .flex-lg-wrap-reverse {\n flex-wrap: wrap-reverse !important;\n }\n .flex-lg-fill {\n flex: 1 1 auto !important;\n }\n .flex-lg-grow-0 {\n flex-grow: 0 !important;\n }\n .flex-lg-grow-1 {\n flex-grow: 1 !important;\n }\n .flex-lg-shrink-0 {\n flex-shrink: 0 !important;\n }\n .flex-lg-shrink-1 {\n flex-shrink: 1 !important;\n }\n .justify-content-lg-start {\n justify-content: flex-start !important;\n }\n .justify-content-lg-end {\n justify-content: flex-end !important;\n }\n .justify-content-lg-center {\n justify-content: center !important;\n }\n .justify-content-lg-between {\n justify-content: space-between !important;\n }\n .justify-content-lg-around {\n justify-content: space-around !important;\n }\n .align-items-lg-start {\n align-items: flex-start !important;\n }\n .align-items-lg-end {\n align-items: flex-end !important;\n }\n .align-items-lg-center {\n align-items: center !important;\n }\n .align-items-lg-baseline {\n align-items: baseline !important;\n }\n .align-items-lg-stretch {\n align-items: stretch !important;\n }\n .align-content-lg-start {\n align-content: flex-start !important;\n }\n .align-content-lg-end {\n align-content: flex-end !important;\n }\n .align-content-lg-center {\n align-content: center !important;\n }\n .align-content-lg-between {\n align-content: space-between !important;\n }\n .align-content-lg-around {\n align-content: space-around !important;\n }\n .align-content-lg-stretch {\n align-content: stretch !important;\n }\n .align-self-lg-auto {\n align-self: auto !important;\n }\n .align-self-lg-start {\n align-self: flex-start !important;\n }\n .align-self-lg-end {\n align-self: flex-end !important;\n }\n .align-self-lg-center {\n align-self: center !important;\n }\n .align-self-lg-baseline {\n align-self: baseline !important;\n }\n .align-self-lg-stretch {\n align-self: stretch !important;\n }\n}\n\n@media (min-width: 1200px) {\n .flex-xl-row {\n flex-direction: row !important;\n }\n .flex-xl-column {\n flex-direction: column !important;\n }\n .flex-xl-row-reverse {\n flex-direction: row-reverse !important;\n }\n .flex-xl-column-reverse {\n flex-direction: column-reverse !important;\n }\n .flex-xl-wrap {\n flex-wrap: wrap !important;\n }\n .flex-xl-nowrap {\n flex-wrap: nowrap !important;\n }\n .flex-xl-wrap-reverse {\n flex-wrap: wrap-reverse !important;\n }\n .flex-xl-fill {\n flex: 1 1 auto !important;\n }\n .flex-xl-grow-0 {\n flex-grow: 0 !important;\n }\n .flex-xl-grow-1 {\n flex-grow: 1 !important;\n }\n .flex-xl-shrink-0 {\n flex-shrink: 0 !important;\n }\n .flex-xl-shrink-1 {\n flex-shrink: 1 !important;\n }\n .justify-content-xl-start {\n justify-content: flex-start !important;\n }\n .justify-content-xl-end {\n justify-content: flex-end !important;\n }\n .justify-content-xl-center {\n justify-content: center !important;\n }\n .justify-content-xl-between {\n justify-content: space-between !important;\n }\n .justify-content-xl-around {\n justify-content: space-around !important;\n }\n .align-items-xl-start {\n align-items: flex-start !important;\n }\n .align-items-xl-end {\n align-items: flex-end !important;\n }\n .align-items-xl-center {\n align-items: center !important;\n }\n .align-items-xl-baseline {\n align-items: baseline !important;\n }\n .align-items-xl-stretch {\n align-items: stretch !important;\n }\n .align-content-xl-start {\n align-content: flex-start !important;\n }\n .align-content-xl-end {\n align-content: flex-end !important;\n }\n .align-content-xl-center {\n align-content: center !important;\n }\n .align-content-xl-between {\n align-content: space-between !important;\n }\n .align-content-xl-around {\n align-content: space-around !important;\n }\n .align-content-xl-stretch {\n align-content: stretch !important;\n }\n .align-self-xl-auto {\n align-self: auto !important;\n }\n .align-self-xl-start {\n align-self: flex-start !important;\n }\n .align-self-xl-end {\n align-self: flex-end !important;\n }\n .align-self-xl-center {\n align-self: center !important;\n }\n .align-self-xl-baseline {\n align-self: baseline !important;\n }\n .align-self-xl-stretch {\n align-self: stretch !important;\n }\n}\n\n.float-left {\n float: left !important;\n}\n\n.float-right {\n float: right !important;\n}\n\n.float-none {\n float: none !important;\n}\n\n@media (min-width: 576px) {\n .float-sm-left {\n float: left !important;\n }\n .float-sm-right {\n float: right !important;\n }\n .float-sm-none {\n float: none !important;\n }\n}\n\n@media (min-width: 768px) {\n .float-md-left {\n float: left !important;\n }\n .float-md-right {\n float: right !important;\n }\n .float-md-none {\n float: none !important;\n }\n}\n\n@media (min-width: 992px) {\n .float-lg-left {\n float: left !important;\n }\n .float-lg-right {\n float: right !important;\n }\n .float-lg-none {\n float: none !important;\n }\n}\n\n@media (min-width: 1200px) {\n .float-xl-left {\n float: left !important;\n }\n .float-xl-right {\n float: right !important;\n }\n .float-xl-none {\n float: none !important;\n }\n}\n\n.user-select-all {\n user-select: all !important;\n}\n\n.user-select-auto {\n user-select: auto !important;\n}\n\n.user-select-none {\n user-select: none !important;\n}\n\n.overflow-auto {\n overflow: auto !important;\n}\n\n.overflow-hidden {\n overflow: hidden !important;\n}\n\n.position-static {\n position: static !important;\n}\n\n.position-relative {\n position: relative !important;\n}\n\n.position-absolute {\n position: absolute !important;\n}\n\n.position-fixed {\n position: fixed !important;\n}\n\n.position-sticky {\n position: sticky !important;\n}\n\n.fixed-top {\n position: fixed;\n top: 0;\n right: 0;\n left: 0;\n z-index: 1030;\n}\n\n.fixed-bottom {\n position: fixed;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 1030;\n}\n\n@supports (position: sticky) {\n .sticky-top {\n position: sticky;\n top: 0;\n z-index: 1020;\n }\n}\n\n.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n}\n\n.sr-only-focusable:active, .sr-only-focusable:focus {\n position: static;\n width: auto;\n height: auto;\n overflow: visible;\n clip: auto;\n white-space: normal;\n}\n\n.shadow-sm {\n box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;\n}\n\n.shadow {\n box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;\n}\n\n.shadow-lg {\n box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;\n}\n\n.shadow-none {\n box-shadow: none !important;\n}\n\n.w-25 {\n width: 25% !important;\n}\n\n.w-50 {\n width: 50% !important;\n}\n\n.w-75 {\n width: 75% !important;\n}\n\n.w-100 {\n width: 100% !important;\n}\n\n.w-auto {\n width: auto !important;\n}\n\n.h-25 {\n height: 25% !important;\n}\n\n.h-50 {\n height: 50% !important;\n}\n\n.h-75 {\n height: 75% !important;\n}\n\n.h-100 {\n height: 100% !important;\n}\n\n.h-auto {\n height: auto !important;\n}\n\n.mw-100 {\n max-width: 100% !important;\n}\n\n.mh-100 {\n max-height: 100% !important;\n}\n\n.min-vw-100 {\n min-width: 100vw !important;\n}\n\n.min-vh-100 {\n min-height: 100vh !important;\n}\n\n.vw-100 {\n width: 100vw !important;\n}\n\n.vh-100 {\n height: 100vh !important;\n}\n\n.m-0 {\n margin: 0 !important;\n}\n\n.mt-0,\n.my-0 {\n margin-top: 0 !important;\n}\n\n.mr-0,\n.mx-0 {\n margin-right: 0 !important;\n}\n\n.mb-0,\n.my-0 {\n margin-bottom: 0 !important;\n}\n\n.ml-0,\n.mx-0 {\n margin-left: 0 !important;\n}\n\n.m-1 {\n margin: 0.25rem !important;\n}\n\n.mt-1,\n.my-1 {\n margin-top: 0.25rem !important;\n}\n\n.mr-1,\n.mx-1 {\n margin-right: 0.25rem !important;\n}\n\n.mb-1,\n.my-1 {\n margin-bottom: 0.25rem !important;\n}\n\n.ml-1,\n.mx-1 {\n margin-left: 0.25rem !important;\n}\n\n.m-2 {\n margin: 0.5rem !important;\n}\n\n.mt-2,\n.my-2 {\n margin-top: 0.5rem !important;\n}\n\n.mr-2,\n.mx-2 {\n margin-right: 0.5rem !important;\n}\n\n.mb-2,\n.my-2 {\n margin-bottom: 0.5rem !important;\n}\n\n.ml-2,\n.mx-2 {\n margin-left: 0.5rem !important;\n}\n\n.m-3 {\n margin: 1rem !important;\n}\n\n.mt-3,\n.my-3 {\n margin-top: 1rem !important;\n}\n\n.mr-3,\n.mx-3 {\n margin-right: 1rem !important;\n}\n\n.mb-3,\n.my-3 {\n margin-bottom: 1rem !important;\n}\n\n.ml-3,\n.mx-3 {\n margin-left: 1rem !important;\n}\n\n.m-4 {\n margin: 1.5rem !important;\n}\n\n.mt-4,\n.my-4 {\n margin-top: 1.5rem !important;\n}\n\n.mr-4,\n.mx-4 {\n margin-right: 1.5rem !important;\n}\n\n.mb-4,\n.my-4 {\n margin-bottom: 1.5rem !important;\n}\n\n.ml-4,\n.mx-4 {\n margin-left: 1.5rem !important;\n}\n\n.m-5 {\n margin: 3rem !important;\n}\n\n.mt-5,\n.my-5 {\n margin-top: 3rem !important;\n}\n\n.mr-5,\n.mx-5 {\n margin-right: 3rem !important;\n}\n\n.mb-5,\n.my-5 {\n margin-bottom: 3rem !important;\n}\n\n.ml-5,\n.mx-5 {\n margin-left: 3rem !important;\n}\n\n.p-0 {\n padding: 0 !important;\n}\n\n.pt-0,\n.py-0 {\n padding-top: 0 !important;\n}\n\n.pr-0,\n.px-0 {\n padding-right: 0 !important;\n}\n\n.pb-0,\n.py-0 {\n padding-bottom: 0 !important;\n}\n\n.pl-0,\n.px-0 {\n padding-left: 0 !important;\n}\n\n.p-1 {\n padding: 0.25rem !important;\n}\n\n.pt-1,\n.py-1 {\n padding-top: 0.25rem !important;\n}\n\n.pr-1,\n.px-1 {\n padding-right: 0.25rem !important;\n}\n\n.pb-1,\n.py-1 {\n padding-bottom: 0.25rem !important;\n}\n\n.pl-1,\n.px-1 {\n padding-left: 0.25rem !important;\n}\n\n.p-2 {\n padding: 0.5rem !important;\n}\n\n.pt-2,\n.py-2 {\n padding-top: 0.5rem !important;\n}\n\n.pr-2,\n.px-2 {\n padding-right: 0.5rem !important;\n}\n\n.pb-2,\n.py-2 {\n padding-bottom: 0.5rem !important;\n}\n\n.pl-2,\n.px-2 {\n padding-left: 0.5rem !important;\n}\n\n.p-3 {\n padding: 1rem !important;\n}\n\n.pt-3,\n.py-3 {\n padding-top: 1rem !important;\n}\n\n.pr-3,\n.px-3 {\n padding-right: 1rem !important;\n}\n\n.pb-3,\n.py-3 {\n padding-bottom: 1rem !important;\n}\n\n.pl-3,\n.px-3 {\n padding-left: 1rem !important;\n}\n\n.p-4 {\n padding: 1.5rem !important;\n}\n\n.pt-4,\n.py-4 {\n padding-top: 1.5rem !important;\n}\n\n.pr-4,\n.px-4 {\n padding-right: 1.5rem !important;\n}\n\n.pb-4,\n.py-4 {\n padding-bottom: 1.5rem !important;\n}\n\n.pl-4,\n.px-4 {\n padding-left: 1.5rem !important;\n}\n\n.p-5 {\n padding: 3rem !important;\n}\n\n.pt-5,\n.py-5 {\n padding-top: 3rem !important;\n}\n\n.pr-5,\n.px-5 {\n padding-right: 3rem !important;\n}\n\n.pb-5,\n.py-5 {\n padding-bottom: 3rem !important;\n}\n\n.pl-5,\n.px-5 {\n padding-left: 3rem !important;\n}\n\n.m-n1 {\n margin: -0.25rem !important;\n}\n\n.mt-n1,\n.my-n1 {\n margin-top: -0.25rem !important;\n}\n\n.mr-n1,\n.mx-n1 {\n margin-right: -0.25rem !important;\n}\n\n.mb-n1,\n.my-n1 {\n margin-bottom: -0.25rem !important;\n}\n\n.ml-n1,\n.mx-n1 {\n margin-left: -0.25rem !important;\n}\n\n.m-n2 {\n margin: -0.5rem !important;\n}\n\n.mt-n2,\n.my-n2 {\n margin-top: -0.5rem !important;\n}\n\n.mr-n2,\n.mx-n2 {\n margin-right: -0.5rem !important;\n}\n\n.mb-n2,\n.my-n2 {\n margin-bottom: -0.5rem !important;\n}\n\n.ml-n2,\n.mx-n2 {\n margin-left: -0.5rem !important;\n}\n\n.m-n3 {\n margin: -1rem !important;\n}\n\n.mt-n3,\n.my-n3 {\n margin-top: -1rem !important;\n}\n\n.mr-n3,\n.mx-n3 {\n margin-right: -1rem !important;\n}\n\n.mb-n3,\n.my-n3 {\n margin-bottom: -1rem !important;\n}\n\n.ml-n3,\n.mx-n3 {\n margin-left: -1rem !important;\n}\n\n.m-n4 {\n margin: -1.5rem !important;\n}\n\n.mt-n4,\n.my-n4 {\n margin-top: -1.5rem !important;\n}\n\n.mr-n4,\n.mx-n4 {\n margin-right: -1.5rem !important;\n}\n\n.mb-n4,\n.my-n4 {\n margin-bottom: -1.5rem !important;\n}\n\n.ml-n4,\n.mx-n4 {\n margin-left: -1.5rem !important;\n}\n\n.m-n5 {\n margin: -3rem !important;\n}\n\n.mt-n5,\n.my-n5 {\n margin-top: -3rem !important;\n}\n\n.mr-n5,\n.mx-n5 {\n margin-right: -3rem !important;\n}\n\n.mb-n5,\n.my-n5 {\n margin-bottom: -3rem !important;\n}\n\n.ml-n5,\n.mx-n5 {\n margin-left: -3rem !important;\n}\n\n.m-auto {\n margin: auto !important;\n}\n\n.mt-auto,\n.my-auto {\n margin-top: auto !important;\n}\n\n.mr-auto,\n.mx-auto {\n margin-right: auto !important;\n}\n\n.mb-auto,\n.my-auto {\n margin-bottom: auto !important;\n}\n\n.ml-auto,\n.mx-auto {\n margin-left: auto !important;\n}\n\n@media (min-width: 576px) {\n .m-sm-0 {\n margin: 0 !important;\n }\n .mt-sm-0,\n .my-sm-0 {\n margin-top: 0 !important;\n }\n .mr-sm-0,\n .mx-sm-0 {\n margin-right: 0 !important;\n }\n .mb-sm-0,\n .my-sm-0 {\n margin-bottom: 0 !important;\n }\n .ml-sm-0,\n .mx-sm-0 {\n margin-left: 0 !important;\n }\n .m-sm-1 {\n margin: 0.25rem !important;\n }\n .mt-sm-1,\n .my-sm-1 {\n margin-top: 0.25rem !important;\n }\n .mr-sm-1,\n .mx-sm-1 {\n margin-right: 0.25rem !important;\n }\n .mb-sm-1,\n .my-sm-1 {\n margin-bottom: 0.25rem !important;\n }\n .ml-sm-1,\n .mx-sm-1 {\n margin-left: 0.25rem !important;\n }\n .m-sm-2 {\n margin: 0.5rem !important;\n }\n .mt-sm-2,\n .my-sm-2 {\n margin-top: 0.5rem !important;\n }\n .mr-sm-2,\n .mx-sm-2 {\n margin-right: 0.5rem !important;\n }\n .mb-sm-2,\n .my-sm-2 {\n margin-bottom: 0.5rem !important;\n }\n .ml-sm-2,\n .mx-sm-2 {\n margin-left: 0.5rem !important;\n }\n .m-sm-3 {\n margin: 1rem !important;\n }\n .mt-sm-3,\n .my-sm-3 {\n margin-top: 1rem !important;\n }\n .mr-sm-3,\n .mx-sm-3 {\n margin-right: 1rem !important;\n }\n .mb-sm-3,\n .my-sm-3 {\n margin-bottom: 1rem !important;\n }\n .ml-sm-3,\n .mx-sm-3 {\n margin-left: 1rem !important;\n }\n .m-sm-4 {\n margin: 1.5rem !important;\n }\n .mt-sm-4,\n .my-sm-4 {\n margin-top: 1.5rem !important;\n }\n .mr-sm-4,\n .mx-sm-4 {\n margin-right: 1.5rem !important;\n }\n .mb-sm-4,\n .my-sm-4 {\n margin-bottom: 1.5rem !important;\n }\n .ml-sm-4,\n .mx-sm-4 {\n margin-left: 1.5rem !important;\n }\n .m-sm-5 {\n margin: 3rem !important;\n }\n .mt-sm-5,\n .my-sm-5 {\n margin-top: 3rem !important;\n }\n .mr-sm-5,\n .mx-sm-5 {\n margin-right: 3rem !important;\n }\n .mb-sm-5,\n .my-sm-5 {\n margin-bottom: 3rem !important;\n }\n .ml-sm-5,\n .mx-sm-5 {\n margin-left: 3rem !important;\n }\n .p-sm-0 {\n padding: 0 !important;\n }\n .pt-sm-0,\n .py-sm-0 {\n padding-top: 0 !important;\n }\n .pr-sm-0,\n .px-sm-0 {\n padding-right: 0 !important;\n }\n .pb-sm-0,\n .py-sm-0 {\n padding-bottom: 0 !important;\n }\n .pl-sm-0,\n .px-sm-0 {\n padding-left: 0 !important;\n }\n .p-sm-1 {\n padding: 0.25rem !important;\n }\n .pt-sm-1,\n .py-sm-1 {\n padding-top: 0.25rem !important;\n }\n .pr-sm-1,\n .px-sm-1 {\n padding-right: 0.25rem !important;\n }\n .pb-sm-1,\n .py-sm-1 {\n padding-bottom: 0.25rem !important;\n }\n .pl-sm-1,\n .px-sm-1 {\n padding-left: 0.25rem !important;\n }\n .p-sm-2 {\n padding: 0.5rem !important;\n }\n .pt-sm-2,\n .py-sm-2 {\n padding-top: 0.5rem !important;\n }\n .pr-sm-2,\n .px-sm-2 {\n padding-right: 0.5rem !important;\n }\n .pb-sm-2,\n .py-sm-2 {\n padding-bottom: 0.5rem !important;\n }\n .pl-sm-2,\n .px-sm-2 {\n padding-left: 0.5rem !important;\n }\n .p-sm-3 {\n padding: 1rem !important;\n }\n .pt-sm-3,\n .py-sm-3 {\n padding-top: 1rem !important;\n }\n .pr-sm-3,\n .px-sm-3 {\n padding-right: 1rem !important;\n }\n .pb-sm-3,\n .py-sm-3 {\n padding-bottom: 1rem !important;\n }\n .pl-sm-3,\n .px-sm-3 {\n padding-left: 1rem !important;\n }\n .p-sm-4 {\n padding: 1.5rem !important;\n }\n .pt-sm-4,\n .py-sm-4 {\n padding-top: 1.5rem !important;\n }\n .pr-sm-4,\n .px-sm-4 {\n padding-right: 1.5rem !important;\n }\n .pb-sm-4,\n .py-sm-4 {\n padding-bottom: 1.5rem !important;\n }\n .pl-sm-4,\n .px-sm-4 {\n padding-left: 1.5rem !important;\n }\n .p-sm-5 {\n padding: 3rem !important;\n }\n .pt-sm-5,\n .py-sm-5 {\n padding-top: 3rem !important;\n }\n .pr-sm-5,\n .px-sm-5 {\n padding-right: 3rem !important;\n }\n .pb-sm-5,\n .py-sm-5 {\n padding-bottom: 3rem !important;\n }\n .pl-sm-5,\n .px-sm-5 {\n padding-left: 3rem !important;\n }\n .m-sm-n1 {\n margin: -0.25rem !important;\n }\n .mt-sm-n1,\n .my-sm-n1 {\n margin-top: -0.25rem !important;\n }\n .mr-sm-n1,\n .mx-sm-n1 {\n margin-right: -0.25rem !important;\n }\n .mb-sm-n1,\n .my-sm-n1 {\n margin-bottom: -0.25rem !important;\n }\n .ml-sm-n1,\n .mx-sm-n1 {\n margin-left: -0.25rem !important;\n }\n .m-sm-n2 {\n margin: -0.5rem !important;\n }\n .mt-sm-n2,\n .my-sm-n2 {\n margin-top: -0.5rem !important;\n }\n .mr-sm-n2,\n .mx-sm-n2 {\n margin-right: -0.5rem !important;\n }\n .mb-sm-n2,\n .my-sm-n2 {\n margin-bottom: -0.5rem !important;\n }\n .ml-sm-n2,\n .mx-sm-n2 {\n margin-left: -0.5rem !important;\n }\n .m-sm-n3 {\n margin: -1rem !important;\n }\n .mt-sm-n3,\n .my-sm-n3 {\n margin-top: -1rem !important;\n }\n .mr-sm-n3,\n .mx-sm-n3 {\n margin-right: -1rem !important;\n }\n .mb-sm-n3,\n .my-sm-n3 {\n margin-bottom: -1rem !important;\n }\n .ml-sm-n3,\n .mx-sm-n3 {\n margin-left: -1rem !important;\n }\n .m-sm-n4 {\n margin: -1.5rem !important;\n }\n .mt-sm-n4,\n .my-sm-n4 {\n margin-top: -1.5rem !important;\n }\n .mr-sm-n4,\n .mx-sm-n4 {\n margin-right: -1.5rem !important;\n }\n .mb-sm-n4,\n .my-sm-n4 {\n margin-bottom: -1.5rem !important;\n }\n .ml-sm-n4,\n .mx-sm-n4 {\n margin-left: -1.5rem !important;\n }\n .m-sm-n5 {\n margin: -3rem !important;\n }\n .mt-sm-n5,\n .my-sm-n5 {\n margin-top: -3rem !important;\n }\n .mr-sm-n5,\n .mx-sm-n5 {\n margin-right: -3rem !important;\n }\n .mb-sm-n5,\n .my-sm-n5 {\n margin-bottom: -3rem !important;\n }\n .ml-sm-n5,\n .mx-sm-n5 {\n margin-left: -3rem !important;\n }\n .m-sm-auto {\n margin: auto !important;\n }\n .mt-sm-auto,\n .my-sm-auto {\n margin-top: auto !important;\n }\n .mr-sm-auto,\n .mx-sm-auto {\n margin-right: auto !important;\n }\n .mb-sm-auto,\n .my-sm-auto {\n margin-bottom: auto !important;\n }\n .ml-sm-auto,\n .mx-sm-auto {\n margin-left: auto !important;\n }\n}\n\n@media (min-width: 768px) {\n .m-md-0 {\n margin: 0 !important;\n }\n .mt-md-0,\n .my-md-0 {\n margin-top: 0 !important;\n }\n .mr-md-0,\n .mx-md-0 {\n margin-right: 0 !important;\n }\n .mb-md-0,\n .my-md-0 {\n margin-bottom: 0 !important;\n }\n .ml-md-0,\n .mx-md-0 {\n margin-left: 0 !important;\n }\n .m-md-1 {\n margin: 0.25rem !important;\n }\n .mt-md-1,\n .my-md-1 {\n margin-top: 0.25rem !important;\n }\n .mr-md-1,\n .mx-md-1 {\n margin-right: 0.25rem !important;\n }\n .mb-md-1,\n .my-md-1 {\n margin-bottom: 0.25rem !important;\n }\n .ml-md-1,\n .mx-md-1 {\n margin-left: 0.25rem !important;\n }\n .m-md-2 {\n margin: 0.5rem !important;\n }\n .mt-md-2,\n .my-md-2 {\n margin-top: 0.5rem !important;\n }\n .mr-md-2,\n .mx-md-2 {\n margin-right: 0.5rem !important;\n }\n .mb-md-2,\n .my-md-2 {\n margin-bottom: 0.5rem !important;\n }\n .ml-md-2,\n .mx-md-2 {\n margin-left: 0.5rem !important;\n }\n .m-md-3 {\n margin: 1rem !important;\n }\n .mt-md-3,\n .my-md-3 {\n margin-top: 1rem !important;\n }\n .mr-md-3,\n .mx-md-3 {\n margin-right: 1rem !important;\n }\n .mb-md-3,\n .my-md-3 {\n margin-bottom: 1rem !important;\n }\n .ml-md-3,\n .mx-md-3 {\n margin-left: 1rem !important;\n }\n .m-md-4 {\n margin: 1.5rem !important;\n }\n .mt-md-4,\n .my-md-4 {\n margin-top: 1.5rem !important;\n }\n .mr-md-4,\n .mx-md-4 {\n margin-right: 1.5rem !important;\n }\n .mb-md-4,\n .my-md-4 {\n margin-bottom: 1.5rem !important;\n }\n .ml-md-4,\n .mx-md-4 {\n margin-left: 1.5rem !important;\n }\n .m-md-5 {\n margin: 3rem !important;\n }\n .mt-md-5,\n .my-md-5 {\n margin-top: 3rem !important;\n }\n .mr-md-5,\n .mx-md-5 {\n margin-right: 3rem !important;\n }\n .mb-md-5,\n .my-md-5 {\n margin-bottom: 3rem !important;\n }\n .ml-md-5,\n .mx-md-5 {\n margin-left: 3rem !important;\n }\n .p-md-0 {\n padding: 0 !important;\n }\n .pt-md-0,\n .py-md-0 {\n padding-top: 0 !important;\n }\n .pr-md-0,\n .px-md-0 {\n padding-right: 0 !important;\n }\n .pb-md-0,\n .py-md-0 {\n padding-bottom: 0 !important;\n }\n .pl-md-0,\n .px-md-0 {\n padding-left: 0 !important;\n }\n .p-md-1 {\n padding: 0.25rem !important;\n }\n .pt-md-1,\n .py-md-1 {\n padding-top: 0.25rem !important;\n }\n .pr-md-1,\n .px-md-1 {\n padding-right: 0.25rem !important;\n }\n .pb-md-1,\n .py-md-1 {\n padding-bottom: 0.25rem !important;\n }\n .pl-md-1,\n .px-md-1 {\n padding-left: 0.25rem !important;\n }\n .p-md-2 {\n padding: 0.5rem !important;\n }\n .pt-md-2,\n .py-md-2 {\n padding-top: 0.5rem !important;\n }\n .pr-md-2,\n .px-md-2 {\n padding-right: 0.5rem !important;\n }\n .pb-md-2,\n .py-md-2 {\n padding-bottom: 0.5rem !important;\n }\n .pl-md-2,\n .px-md-2 {\n padding-left: 0.5rem !important;\n }\n .p-md-3 {\n padding: 1rem !important;\n }\n .pt-md-3,\n .py-md-3 {\n padding-top: 1rem !important;\n }\n .pr-md-3,\n .px-md-3 {\n padding-right: 1rem !important;\n }\n .pb-md-3,\n .py-md-3 {\n padding-bottom: 1rem !important;\n }\n .pl-md-3,\n .px-md-3 {\n padding-left: 1rem !important;\n }\n .p-md-4 {\n padding: 1.5rem !important;\n }\n .pt-md-4,\n .py-md-4 {\n padding-top: 1.5rem !important;\n }\n .pr-md-4,\n .px-md-4 {\n padding-right: 1.5rem !important;\n }\n .pb-md-4,\n .py-md-4 {\n padding-bottom: 1.5rem !important;\n }\n .pl-md-4,\n .px-md-4 {\n padding-left: 1.5rem !important;\n }\n .p-md-5 {\n padding: 3rem !important;\n }\n .pt-md-5,\n .py-md-5 {\n padding-top: 3rem !important;\n }\n .pr-md-5,\n .px-md-5 {\n padding-right: 3rem !important;\n }\n .pb-md-5,\n .py-md-5 {\n padding-bottom: 3rem !important;\n }\n .pl-md-5,\n .px-md-5 {\n padding-left: 3rem !important;\n }\n .m-md-n1 {\n margin: -0.25rem !important;\n }\n .mt-md-n1,\n .my-md-n1 {\n margin-top: -0.25rem !important;\n }\n .mr-md-n1,\n .mx-md-n1 {\n margin-right: -0.25rem !important;\n }\n .mb-md-n1,\n .my-md-n1 {\n margin-bottom: -0.25rem !important;\n }\n .ml-md-n1,\n .mx-md-n1 {\n margin-left: -0.25rem !important;\n }\n .m-md-n2 {\n margin: -0.5rem !important;\n }\n .mt-md-n2,\n .my-md-n2 {\n margin-top: -0.5rem !important;\n }\n .mr-md-n2,\n .mx-md-n2 {\n margin-right: -0.5rem !important;\n }\n .mb-md-n2,\n .my-md-n2 {\n margin-bottom: -0.5rem !important;\n }\n .ml-md-n2,\n .mx-md-n2 {\n margin-left: -0.5rem !important;\n }\n .m-md-n3 {\n margin: -1rem !important;\n }\n .mt-md-n3,\n .my-md-n3 {\n margin-top: -1rem !important;\n }\n .mr-md-n3,\n .mx-md-n3 {\n margin-right: -1rem !important;\n }\n .mb-md-n3,\n .my-md-n3 {\n margin-bottom: -1rem !important;\n }\n .ml-md-n3,\n .mx-md-n3 {\n margin-left: -1rem !important;\n }\n .m-md-n4 {\n margin: -1.5rem !important;\n }\n .mt-md-n4,\n .my-md-n4 {\n margin-top: -1.5rem !important;\n }\n .mr-md-n4,\n .mx-md-n4 {\n margin-right: -1.5rem !important;\n }\n .mb-md-n4,\n .my-md-n4 {\n margin-bottom: -1.5rem !important;\n }\n .ml-md-n4,\n .mx-md-n4 {\n margin-left: -1.5rem !important;\n }\n .m-md-n5 {\n margin: -3rem !important;\n }\n .mt-md-n5,\n .my-md-n5 {\n margin-top: -3rem !important;\n }\n .mr-md-n5,\n .mx-md-n5 {\n margin-right: -3rem !important;\n }\n .mb-md-n5,\n .my-md-n5 {\n margin-bottom: -3rem !important;\n }\n .ml-md-n5,\n .mx-md-n5 {\n margin-left: -3rem !important;\n }\n .m-md-auto {\n margin: auto !important;\n }\n .mt-md-auto,\n .my-md-auto {\n margin-top: auto !important;\n }\n .mr-md-auto,\n .mx-md-auto {\n margin-right: auto !important;\n }\n .mb-md-auto,\n .my-md-auto {\n margin-bottom: auto !important;\n }\n .ml-md-auto,\n .mx-md-auto {\n margin-left: auto !important;\n }\n}\n\n@media (min-width: 992px) {\n .m-lg-0 {\n margin: 0 !important;\n }\n .mt-lg-0,\n .my-lg-0 {\n margin-top: 0 !important;\n }\n .mr-lg-0,\n .mx-lg-0 {\n margin-right: 0 !important;\n }\n .mb-lg-0,\n .my-lg-0 {\n margin-bottom: 0 !important;\n }\n .ml-lg-0,\n .mx-lg-0 {\n margin-left: 0 !important;\n }\n .m-lg-1 {\n margin: 0.25rem !important;\n }\n .mt-lg-1,\n .my-lg-1 {\n margin-top: 0.25rem !important;\n }\n .mr-lg-1,\n .mx-lg-1 {\n margin-right: 0.25rem !important;\n }\n .mb-lg-1,\n .my-lg-1 {\n margin-bottom: 0.25rem !important;\n }\n .ml-lg-1,\n .mx-lg-1 {\n margin-left: 0.25rem !important;\n }\n .m-lg-2 {\n margin: 0.5rem !important;\n }\n .mt-lg-2,\n .my-lg-2 {\n margin-top: 0.5rem !important;\n }\n .mr-lg-2,\n .mx-lg-2 {\n margin-right: 0.5rem !important;\n }\n .mb-lg-2,\n .my-lg-2 {\n margin-bottom: 0.5rem !important;\n }\n .ml-lg-2,\n .mx-lg-2 {\n margin-left: 0.5rem !important;\n }\n .m-lg-3 {\n margin: 1rem !important;\n }\n .mt-lg-3,\n .my-lg-3 {\n margin-top: 1rem !important;\n }\n .mr-lg-3,\n .mx-lg-3 {\n margin-right: 1rem !important;\n }\n .mb-lg-3,\n .my-lg-3 {\n margin-bottom: 1rem !important;\n }\n .ml-lg-3,\n .mx-lg-3 {\n margin-left: 1rem !important;\n }\n .m-lg-4 {\n margin: 1.5rem !important;\n }\n .mt-lg-4,\n .my-lg-4 {\n margin-top: 1.5rem !important;\n }\n .mr-lg-4,\n .mx-lg-4 {\n margin-right: 1.5rem !important;\n }\n .mb-lg-4,\n .my-lg-4 {\n margin-bottom: 1.5rem !important;\n }\n .ml-lg-4,\n .mx-lg-4 {\n margin-left: 1.5rem !important;\n }\n .m-lg-5 {\n margin: 3rem !important;\n }\n .mt-lg-5,\n .my-lg-5 {\n margin-top: 3rem !important;\n }\n .mr-lg-5,\n .mx-lg-5 {\n margin-right: 3rem !important;\n }\n .mb-lg-5,\n .my-lg-5 {\n margin-bottom: 3rem !important;\n }\n .ml-lg-5,\n .mx-lg-5 {\n margin-left: 3rem !important;\n }\n .p-lg-0 {\n padding: 0 !important;\n }\n .pt-lg-0,\n .py-lg-0 {\n padding-top: 0 !important;\n }\n .pr-lg-0,\n .px-lg-0 {\n padding-right: 0 !important;\n }\n .pb-lg-0,\n .py-lg-0 {\n padding-bottom: 0 !important;\n }\n .pl-lg-0,\n .px-lg-0 {\n padding-left: 0 !important;\n }\n .p-lg-1 {\n padding: 0.25rem !important;\n }\n .pt-lg-1,\n .py-lg-1 {\n padding-top: 0.25rem !important;\n }\n .pr-lg-1,\n .px-lg-1 {\n padding-right: 0.25rem !important;\n }\n .pb-lg-1,\n .py-lg-1 {\n padding-bottom: 0.25rem !important;\n }\n .pl-lg-1,\n .px-lg-1 {\n padding-left: 0.25rem !important;\n }\n .p-lg-2 {\n padding: 0.5rem !important;\n }\n .pt-lg-2,\n .py-lg-2 {\n padding-top: 0.5rem !important;\n }\n .pr-lg-2,\n .px-lg-2 {\n padding-right: 0.5rem !important;\n }\n .pb-lg-2,\n .py-lg-2 {\n padding-bottom: 0.5rem !important;\n }\n .pl-lg-2,\n .px-lg-2 {\n padding-left: 0.5rem !important;\n }\n .p-lg-3 {\n padding: 1rem !important;\n }\n .pt-lg-3,\n .py-lg-3 {\n padding-top: 1rem !important;\n }\n .pr-lg-3,\n .px-lg-3 {\n padding-right: 1rem !important;\n }\n .pb-lg-3,\n .py-lg-3 {\n padding-bottom: 1rem !important;\n }\n .pl-lg-3,\n .px-lg-3 {\n padding-left: 1rem !important;\n }\n .p-lg-4 {\n padding: 1.5rem !important;\n }\n .pt-lg-4,\n .py-lg-4 {\n padding-top: 1.5rem !important;\n }\n .pr-lg-4,\n .px-lg-4 {\n padding-right: 1.5rem !important;\n }\n .pb-lg-4,\n .py-lg-4 {\n padding-bottom: 1.5rem !important;\n }\n .pl-lg-4,\n .px-lg-4 {\n padding-left: 1.5rem !important;\n }\n .p-lg-5 {\n padding: 3rem !important;\n }\n .pt-lg-5,\n .py-lg-5 {\n padding-top: 3rem !important;\n }\n .pr-lg-5,\n .px-lg-5 {\n padding-right: 3rem !important;\n }\n .pb-lg-5,\n .py-lg-5 {\n padding-bottom: 3rem !important;\n }\n .pl-lg-5,\n .px-lg-5 {\n padding-left: 3rem !important;\n }\n .m-lg-n1 {\n margin: -0.25rem !important;\n }\n .mt-lg-n1,\n .my-lg-n1 {\n margin-top: -0.25rem !important;\n }\n .mr-lg-n1,\n .mx-lg-n1 {\n margin-right: -0.25rem !important;\n }\n .mb-lg-n1,\n .my-lg-n1 {\n margin-bottom: -0.25rem !important;\n }\n .ml-lg-n1,\n .mx-lg-n1 {\n margin-left: -0.25rem !important;\n }\n .m-lg-n2 {\n margin: -0.5rem !important;\n }\n .mt-lg-n2,\n .my-lg-n2 {\n margin-top: -0.5rem !important;\n }\n .mr-lg-n2,\n .mx-lg-n2 {\n margin-right: -0.5rem !important;\n }\n .mb-lg-n2,\n .my-lg-n2 {\n margin-bottom: -0.5rem !important;\n }\n .ml-lg-n2,\n .mx-lg-n2 {\n margin-left: -0.5rem !important;\n }\n .m-lg-n3 {\n margin: -1rem !important;\n }\n .mt-lg-n3,\n .my-lg-n3 {\n margin-top: -1rem !important;\n }\n .mr-lg-n3,\n .mx-lg-n3 {\n margin-right: -1rem !important;\n }\n .mb-lg-n3,\n .my-lg-n3 {\n margin-bottom: -1rem !important;\n }\n .ml-lg-n3,\n .mx-lg-n3 {\n margin-left: -1rem !important;\n }\n .m-lg-n4 {\n margin: -1.5rem !important;\n }\n .mt-lg-n4,\n .my-lg-n4 {\n margin-top: -1.5rem !important;\n }\n .mr-lg-n4,\n .mx-lg-n4 {\n margin-right: -1.5rem !important;\n }\n .mb-lg-n4,\n .my-lg-n4 {\n margin-bottom: -1.5rem !important;\n }\n .ml-lg-n4,\n .mx-lg-n4 {\n margin-left: -1.5rem !important;\n }\n .m-lg-n5 {\n margin: -3rem !important;\n }\n .mt-lg-n5,\n .my-lg-n5 {\n margin-top: -3rem !important;\n }\n .mr-lg-n5,\n .mx-lg-n5 {\n margin-right: -3rem !important;\n }\n .mb-lg-n5,\n .my-lg-n5 {\n margin-bottom: -3rem !important;\n }\n .ml-lg-n5,\n .mx-lg-n5 {\n margin-left: -3rem !important;\n }\n .m-lg-auto {\n margin: auto !important;\n }\n .mt-lg-auto,\n .my-lg-auto {\n margin-top: auto !important;\n }\n .mr-lg-auto,\n .mx-lg-auto {\n margin-right: auto !important;\n }\n .mb-lg-auto,\n .my-lg-auto {\n margin-bottom: auto !important;\n }\n .ml-lg-auto,\n .mx-lg-auto {\n margin-left: auto !important;\n }\n}\n\n@media (min-width: 1200px) {\n .m-xl-0 {\n margin: 0 !important;\n }\n .mt-xl-0,\n .my-xl-0 {\n margin-top: 0 !important;\n }\n .mr-xl-0,\n .mx-xl-0 {\n margin-right: 0 !important;\n }\n .mb-xl-0,\n .my-xl-0 {\n margin-bottom: 0 !important;\n }\n .ml-xl-0,\n .mx-xl-0 {\n margin-left: 0 !important;\n }\n .m-xl-1 {\n margin: 0.25rem !important;\n }\n .mt-xl-1,\n .my-xl-1 {\n margin-top: 0.25rem !important;\n }\n .mr-xl-1,\n .mx-xl-1 {\n margin-right: 0.25rem !important;\n }\n .mb-xl-1,\n .my-xl-1 {\n margin-bottom: 0.25rem !important;\n }\n .ml-xl-1,\n .mx-xl-1 {\n margin-left: 0.25rem !important;\n }\n .m-xl-2 {\n margin: 0.5rem !important;\n }\n .mt-xl-2,\n .my-xl-2 {\n margin-top: 0.5rem !important;\n }\n .mr-xl-2,\n .mx-xl-2 {\n margin-right: 0.5rem !important;\n }\n .mb-xl-2,\n .my-xl-2 {\n margin-bottom: 0.5rem !important;\n }\n .ml-xl-2,\n .mx-xl-2 {\n margin-left: 0.5rem !important;\n }\n .m-xl-3 {\n margin: 1rem !important;\n }\n .mt-xl-3,\n .my-xl-3 {\n margin-top: 1rem !important;\n }\n .mr-xl-3,\n .mx-xl-3 {\n margin-right: 1rem !important;\n }\n .mb-xl-3,\n .my-xl-3 {\n margin-bottom: 1rem !important;\n }\n .ml-xl-3,\n .mx-xl-3 {\n margin-left: 1rem !important;\n }\n .m-xl-4 {\n margin: 1.5rem !important;\n }\n .mt-xl-4,\n .my-xl-4 {\n margin-top: 1.5rem !important;\n }\n .mr-xl-4,\n .mx-xl-4 {\n margin-right: 1.5rem !important;\n }\n .mb-xl-4,\n .my-xl-4 {\n margin-bottom: 1.5rem !important;\n }\n .ml-xl-4,\n .mx-xl-4 {\n margin-left: 1.5rem !important;\n }\n .m-xl-5 {\n margin: 3rem !important;\n }\n .mt-xl-5,\n .my-xl-5 {\n margin-top: 3rem !important;\n }\n .mr-xl-5,\n .mx-xl-5 {\n margin-right: 3rem !important;\n }\n .mb-xl-5,\n .my-xl-5 {\n margin-bottom: 3rem !important;\n }\n .ml-xl-5,\n .mx-xl-5 {\n margin-left: 3rem !important;\n }\n .p-xl-0 {\n padding: 0 !important;\n }\n .pt-xl-0,\n .py-xl-0 {\n padding-top: 0 !important;\n }\n .pr-xl-0,\n .px-xl-0 {\n padding-right: 0 !important;\n }\n .pb-xl-0,\n .py-xl-0 {\n padding-bottom: 0 !important;\n }\n .pl-xl-0,\n .px-xl-0 {\n padding-left: 0 !important;\n }\n .p-xl-1 {\n padding: 0.25rem !important;\n }\n .pt-xl-1,\n .py-xl-1 {\n padding-top: 0.25rem !important;\n }\n .pr-xl-1,\n .px-xl-1 {\n padding-right: 0.25rem !important;\n }\n .pb-xl-1,\n .py-xl-1 {\n padding-bottom: 0.25rem !important;\n }\n .pl-xl-1,\n .px-xl-1 {\n padding-left: 0.25rem !important;\n }\n .p-xl-2 {\n padding: 0.5rem !important;\n }\n .pt-xl-2,\n .py-xl-2 {\n padding-top: 0.5rem !important;\n }\n .pr-xl-2,\n .px-xl-2 {\n padding-right: 0.5rem !important;\n }\n .pb-xl-2,\n .py-xl-2 {\n padding-bottom: 0.5rem !important;\n }\n .pl-xl-2,\n .px-xl-2 {\n padding-left: 0.5rem !important;\n }\n .p-xl-3 {\n padding: 1rem !important;\n }\n .pt-xl-3,\n .py-xl-3 {\n padding-top: 1rem !important;\n }\n .pr-xl-3,\n .px-xl-3 {\n padding-right: 1rem !important;\n }\n .pb-xl-3,\n .py-xl-3 {\n padding-bottom: 1rem !important;\n }\n .pl-xl-3,\n .px-xl-3 {\n padding-left: 1rem !important;\n }\n .p-xl-4 {\n padding: 1.5rem !important;\n }\n .pt-xl-4,\n .py-xl-4 {\n padding-top: 1.5rem !important;\n }\n .pr-xl-4,\n .px-xl-4 {\n padding-right: 1.5rem !important;\n }\n .pb-xl-4,\n .py-xl-4 {\n padding-bottom: 1.5rem !important;\n }\n .pl-xl-4,\n .px-xl-4 {\n padding-left: 1.5rem !important;\n }\n .p-xl-5 {\n padding: 3rem !important;\n }\n .pt-xl-5,\n .py-xl-5 {\n padding-top: 3rem !important;\n }\n .pr-xl-5,\n .px-xl-5 {\n padding-right: 3rem !important;\n }\n .pb-xl-5,\n .py-xl-5 {\n padding-bottom: 3rem !important;\n }\n .pl-xl-5,\n .px-xl-5 {\n padding-left: 3rem !important;\n }\n .m-xl-n1 {\n margin: -0.25rem !important;\n }\n .mt-xl-n1,\n .my-xl-n1 {\n margin-top: -0.25rem !important;\n }\n .mr-xl-n1,\n .mx-xl-n1 {\n margin-right: -0.25rem !important;\n }\n .mb-xl-n1,\n .my-xl-n1 {\n margin-bottom: -0.25rem !important;\n }\n .ml-xl-n1,\n .mx-xl-n1 {\n margin-left: -0.25rem !important;\n }\n .m-xl-n2 {\n margin: -0.5rem !important;\n }\n .mt-xl-n2,\n .my-xl-n2 {\n margin-top: -0.5rem !important;\n }\n .mr-xl-n2,\n .mx-xl-n2 {\n margin-right: -0.5rem !important;\n }\n .mb-xl-n2,\n .my-xl-n2 {\n margin-bottom: -0.5rem !important;\n }\n .ml-xl-n2,\n .mx-xl-n2 {\n margin-left: -0.5rem !important;\n }\n .m-xl-n3 {\n margin: -1rem !important;\n }\n .mt-xl-n3,\n .my-xl-n3 {\n margin-top: -1rem !important;\n }\n .mr-xl-n3,\n .mx-xl-n3 {\n margin-right: -1rem !important;\n }\n .mb-xl-n3,\n .my-xl-n3 {\n margin-bottom: -1rem !important;\n }\n .ml-xl-n3,\n .mx-xl-n3 {\n margin-left: -1rem !important;\n }\n .m-xl-n4 {\n margin: -1.5rem !important;\n }\n .mt-xl-n4,\n .my-xl-n4 {\n margin-top: -1.5rem !important;\n }\n .mr-xl-n4,\n .mx-xl-n4 {\n margin-right: -1.5rem !important;\n }\n .mb-xl-n4,\n .my-xl-n4 {\n margin-bottom: -1.5rem !important;\n }\n .ml-xl-n4,\n .mx-xl-n4 {\n margin-left: -1.5rem !important;\n }\n .m-xl-n5 {\n margin: -3rem !important;\n }\n .mt-xl-n5,\n .my-xl-n5 {\n margin-top: -3rem !important;\n }\n .mr-xl-n5,\n .mx-xl-n5 {\n margin-right: -3rem !important;\n }\n .mb-xl-n5,\n .my-xl-n5 {\n margin-bottom: -3rem !important;\n }\n .ml-xl-n5,\n .mx-xl-n5 {\n margin-left: -3rem !important;\n }\n .m-xl-auto {\n margin: auto !important;\n }\n .mt-xl-auto,\n .my-xl-auto {\n margin-top: auto !important;\n }\n .mr-xl-auto,\n .mx-xl-auto {\n margin-right: auto !important;\n }\n .mb-xl-auto,\n .my-xl-auto {\n margin-bottom: auto !important;\n }\n .ml-xl-auto,\n .mx-xl-auto {\n margin-left: auto !important;\n }\n}\n\n.stretched-link::after {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 1;\n pointer-events: auto;\n content: \"\";\n background-color: rgba(0, 0, 0, 0);\n}\n\n.text-monospace {\n font-family: SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace !important;\n}\n\n.text-justify {\n text-align: justify !important;\n}\n\n.text-wrap {\n white-space: normal !important;\n}\n\n.text-nowrap {\n white-space: nowrap !important;\n}\n\n.text-truncate {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.text-left {\n text-align: left !important;\n}\n\n.text-right {\n text-align: right !important;\n}\n\n.text-center {\n text-align: center !important;\n}\n\n@media (min-width: 576px) {\n .text-sm-left {\n text-align: left !important;\n }\n .text-sm-right {\n text-align: right !important;\n }\n .text-sm-center {\n text-align: center !important;\n }\n}\n\n@media (min-width: 768px) {\n .text-md-left {\n text-align: left !important;\n }\n .text-md-right {\n text-align: right !important;\n }\n .text-md-center {\n text-align: center !important;\n }\n}\n\n@media (min-width: 992px) {\n .text-lg-left {\n text-align: left !important;\n }\n .text-lg-right {\n text-align: right !important;\n }\n .text-lg-center {\n text-align: center !important;\n }\n}\n\n@media (min-width: 1200px) {\n .text-xl-left {\n text-align: left !important;\n }\n .text-xl-right {\n text-align: right !important;\n }\n .text-xl-center {\n text-align: center !important;\n }\n}\n\n.text-lowercase {\n text-transform: lowercase !important;\n}\n\n.text-uppercase {\n text-transform: uppercase !important;\n}\n\n.text-capitalize {\n text-transform: capitalize !important;\n}\n\n.font-weight-light {\n font-weight: 300 !important;\n}\n\n.font-weight-lighter {\n font-weight: lighter !important;\n}\n\n.font-weight-normal {\n font-weight: 400 !important;\n}\n\n.font-weight-bold {\n font-weight: 700 !important;\n}\n\n.font-weight-bolder {\n font-weight: bolder !important;\n}\n\n.font-italic {\n font-style: italic !important;\n}\n\n.text-white {\n color: #fff !important;\n}\n\n.text-primary {\n color: #007bff !important;\n}\n\na.text-primary:hover, a.text-primary:focus {\n color: #0056b3 !important;\n}\n\n.text-secondary {\n color: #6c757d !important;\n}\n\na.text-secondary:hover, a.text-secondary:focus {\n color: #494f54 !important;\n}\n\n.text-success {\n color: #28a745 !important;\n}\n\na.text-success:hover, a.text-success:focus {\n color: #19692c !important;\n}\n\n.text-info {\n color: #17a2b8 !important;\n}\n\na.text-info:hover, a.text-info:focus {\n color: #0f6674 !important;\n}\n\n.text-warning {\n color: #ffc107 !important;\n}\n\na.text-warning:hover, a.text-warning:focus {\n color: #ba8b00 !important;\n}\n\n.text-danger {\n color: #dc3545 !important;\n}\n\na.text-danger:hover, a.text-danger:focus {\n color: #a71d2a !important;\n}\n\n.text-light {\n color: #f8f9fa !important;\n}\n\na.text-light:hover, a.text-light:focus {\n color: #cbd3da !important;\n}\n\n.text-dark {\n color: #343a40 !important;\n}\n\na.text-dark:hover, a.text-dark:focus {\n color: #121416 !important;\n}\n\n.text-body {\n color: #212529 !important;\n}\n\n.text-muted {\n color: #6c757d !important;\n}\n\n.text-black-50 {\n color: rgba(0, 0, 0, 0.5) !important;\n}\n\n.text-white-50 {\n color: rgba(255, 255, 255, 0.5) !important;\n}\n\n.text-hide {\n font: 0/0 a;\n color: transparent;\n text-shadow: none;\n background-color: transparent;\n border: 0;\n}\n\n.text-decoration-none {\n text-decoration: none !important;\n}\n\n.text-break {\n word-break: break-word !important;\n word-wrap: break-word !important;\n}\n\n.text-reset {\n color: inherit !important;\n}\n\n.visible {\n visibility: visible !important;\n}\n\n.invisible {\n visibility: hidden !important;\n}\n\n@media print {\n *,\n *::before,\n *::after {\n text-shadow: none !important;\n box-shadow: none !important;\n }\n a:not(.btn) {\n text-decoration: underline;\n }\n abbr[title]::after {\n content: \" (\" attr(title) \")\";\n }\n pre {\n white-space: pre-wrap !important;\n }\n pre,\n blockquote {\n border: 1px solid #adb5bd;\n page-break-inside: avoid;\n }\n thead {\n display: table-header-group;\n }\n tr,\n img {\n page-break-inside: avoid;\n }\n p,\n h2,\n h3 {\n orphans: 3;\n widows: 3;\n }\n h2,\n h3 {\n page-break-after: avoid;\n }\n @page {\n size: a3;\n }\n body {\n min-width: 992px !important;\n }\n .container {\n min-width: 992px !important;\n }\n .navbar {\n display: none;\n }\n .badge {\n border: 1px solid #000;\n }\n .table {\n border-collapse: collapse !important;\n }\n .table td,\n .table th {\n background-color: #fff !important;\n }\n .table-bordered th,\n .table-bordered td {\n border: 1px solid #dee2e6 !important;\n }\n .table-dark {\n color: inherit;\n }\n .table-dark th,\n .table-dark td,\n .table-dark thead th,\n .table-dark tbody + tbody {\n border-color: #dee2e6;\n }\n .table .thead-dark th {\n color: inherit;\n border-color: #dee2e6;\n }\n}\n\n.rtl,\n[dir=\"rtl\"] {\n text-align: right;\n direction: rtl;\n}\n\n.rtl .nav,\n[dir=\"rtl\"] .nav {\n padding-right: 0;\n}\n\n.rtl .navbar-nav .nav-item,\n[dir=\"rtl\"] .navbar-nav .nav-item {\n float: right;\n}\n\n.rtl .navbar-nav .nav-item + .nav-item,\n[dir=\"rtl\"] .navbar-nav .nav-item + .nav-item {\n margin-right: inherit;\n margin-left: 1rem;\n}\n\n.rtl th,\n[dir=\"rtl\"] th {\n text-align: right;\n}\n\n.rtl .alert-dismissible,\n[dir=\"rtl\"] .alert-dismissible {\n padding-right: 1.25rem;\n padding-left: 4rem;\n}\n\n.rtl .dropdown-menu,\n[dir=\"rtl\"] .dropdown-menu {\n right: 0;\n left: inherit;\n text-align: right;\n}\n\n.rtl .checkbox label,\n[dir=\"rtl\"] .checkbox label {\n padding-right: 1.25rem;\n padding-left: inherit;\n}\n\n.rtl .btn-group > .btn:not(:first-child),\n.rtl .btn-group > .btn-group:not(:first-child),\n[dir=\"rtl\"] .btn-group > .btn:not(:first-child),\n[dir=\"rtl\"] .btn-group > .btn-group:not(:first-child) {\n margin-left: initial;\n margin-right: -1px;\n}\n\n.rtl .btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle),\n[dir=\"rtl\"] .btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) {\n border-radius: 0 0.25rem 0.25rem 0;\n}\n\n.rtl .btn-group > .btn:last-child:not(:first-child),\n.rtl .btn-group > .dropdown-toggle:not(:first-child),\n[dir=\"rtl\"] .btn-group > .btn:last-child:not(:first-child),\n[dir=\"rtl\"] .btn-group > .dropdown-toggle:not(:first-child) {\n border-radius: 0.25rem 0 0 0.25rem;\n}\n\n.rtl .btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child,\n[dir=\"rtl\"] .btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child {\n border-radius: 0.25rem 0 0 0.25rem;\n}\n\n.rtl .custom-control,\n[dir=\"rtl\"] .custom-control {\n padding-right: 1.5rem;\n padding-left: inherit;\n margin-right: inherit;\n margin-left: 1rem;\n}\n\n.rtl .custom-control-indicator,\n[dir=\"rtl\"] .custom-control-indicator {\n right: 0;\n left: inherit;\n}\n\n.rtl .custom-file-label::after,\n[dir=\"rtl\"] .custom-file-label::after {\n right: initial;\n left: -1px;\n border-radius: .25rem 0 0 .25rem;\n}\n\n.rtl .custom-control-label::after,\n.rtl .custom-control-label::before,\n[dir=\"rtl\"] .custom-control-label::after,\n[dir=\"rtl\"] .custom-control-label::before {\n right: -1.5rem;\n left: inherit;\n}\n\n.rtl .custom-select,\n[dir=\"rtl\"] .custom-select {\n padding: 0.375rem 0.75rem 0.375rem 1.75rem;\n background: #fff url(\"data:image/svg+xml,\") no-repeat left 0.75rem center;\n background-size: 8px 10px;\n}\n\n.rtl .custom-switch,\n[dir=\"rtl\"] .custom-switch {\n padding-right: 2.25rem;\n padding-left: inherit;\n}\n\n.rtl .custom-switch .custom-control-label::before,\n[dir=\"rtl\"] .custom-switch .custom-control-label::before {\n right: -2.25rem;\n}\n\n.rtl .custom-switch .custom-control-label::after,\n[dir=\"rtl\"] .custom-switch .custom-control-label::after {\n right: calc(-2.25rem + 2px);\n}\n\n.rtl .custom-switch .custom-control-input:checked ~ .custom-control-label::after,\n[dir=\"rtl\"] .custom-switch .custom-control-input:checked ~ .custom-control-label::after {\n transform: translateX(-0.75rem);\n}\n\n.rtl .input-group > .input-group-append:last-child > .btn:not(:last-child):not(.dropdown-toggle),\n.rtl .input-group > .input-group-append:last-child > .input-group-text:not(:last-child),\n.rtl .input-group > .input-group-append:not(:last-child) > .btn,\n.rtl .input-group > .input-group-append:not(:last-child) > .input-group-text,\n.rtl .input-group > .input-group-prepend > .btn,\n.rtl .input-group > .input-group-prepend > .input-group-text,\n[dir=\"rtl\"] .input-group > .input-group-append:last-child > .btn:not(:last-child):not(.dropdown-toggle),\n[dir=\"rtl\"] .input-group > .input-group-append:last-child > .input-group-text:not(:last-child),\n[dir=\"rtl\"] .input-group > .input-group-append:not(:last-child) > .btn,\n[dir=\"rtl\"] .input-group > .input-group-append:not(:last-child) > .input-group-text,\n[dir=\"rtl\"] .input-group > .input-group-prepend > .btn,\n[dir=\"rtl\"] .input-group > .input-group-prepend > .input-group-text {\n border-radius: 0 0.25rem 0.25rem 0;\n}\n\n.rtl .input-group > .input-group-append > .btn,\n.rtl .input-group > .input-group-append > .input-group-text,\n.rtl .input-group > .input-group-prepend:first-child > .btn:not(:first-child),\n.rtl .input-group > .input-group-prepend:first-child > .input-group-text:not(:first-child),\n.rtl .input-group > .input-group-prepend:not(:first-child) > .btn,\n.rtl .input-group > .input-group-prepend:not(:first-child) > .input-group-text,\n[dir=\"rtl\"] .input-group > .input-group-append > .btn,\n[dir=\"rtl\"] .input-group > .input-group-append > .input-group-text,\n[dir=\"rtl\"] .input-group > .input-group-prepend:first-child > .btn:not(:first-child),\n[dir=\"rtl\"] .input-group > .input-group-prepend:first-child > .input-group-text:not(:first-child),\n[dir=\"rtl\"] .input-group > .input-group-prepend:not(:first-child) > .btn,\n[dir=\"rtl\"] .input-group > .input-group-prepend:not(:first-child) > .input-group-text {\n border-radius: 0.25rem 0 0 0.25rem;\n}\n\n.rtl .input-group > .custom-select:not(:first-child),\n.rtl .input-group > .form-control:not(:first-child),\n[dir=\"rtl\"] .input-group > .custom-select:not(:first-child),\n[dir=\"rtl\"] .input-group > .form-control:not(:first-child) {\n border-radius: 0.25rem 0 0 0.25rem;\n}\n\n.rtl .input-group > .custom-select:not(:last-child),\n.rtl .input-group > .form-control:not(:last-child),\n[dir=\"rtl\"] .input-group > .custom-select:not(:last-child),\n[dir=\"rtl\"] .input-group > .form-control:not(:last-child) {\n border-radius: 0 0.25rem 0.25rem 0;\n}\n\n.rtl .input-group > .custom-select:not(:last-child):not(:first-child),\n.rtl .input-group > .form-control:not(:last-child):not(:first-child),\n[dir=\"rtl\"] .input-group > .custom-select:not(:last-child):not(:first-child),\n[dir=\"rtl\"] .input-group > .form-control:not(:last-child):not(:first-child) {\n border-radius: 0;\n}\n\n.rtl .radio input,\n.rtl .radio-inline,\n.rtl .checkbox input,\n.rtl .checkbox-inline input,\n[dir=\"rtl\"] .radio input,\n[dir=\"rtl\"] .radio-inline,\n[dir=\"rtl\"] .checkbox input,\n[dir=\"rtl\"] .checkbox-inline input {\n margin-right: -1.25rem;\n margin-left: inherit;\n}\n\n.rtl .breadcrumb-item + .breadcrumb-item,\n[dir=\"rtl\"] .breadcrumb-item + .breadcrumb-item {\n padding-right: 0.5rem;\n padding-left: 0;\n color: #6c757d;\n content: \"/\";\n}\n\n.rtl .breadcrumb-item + .breadcrumb-item::before,\n[dir=\"rtl\"] .breadcrumb-item + .breadcrumb-item::before {\n padding-right: 0;\n padding-left: 0.5rem;\n}\n\n.rtl .list-group,\n[dir=\"rtl\"] .list-group {\n padding-right: 0;\n padding-left: 40px;\n}\n\n.rtl .close,\n[dir=\"rtl\"] .close {\n float: left;\n}\n\n.rtl .modal-header .close,\n[dir=\"rtl\"] .modal-header .close {\n margin: -15px auto -15px -15px;\n}\n\n.rtl .modal-footer > :not(:first-child),\n[dir=\"rtl\"] .modal-footer > :not(:first-child) {\n margin-right: .25rem;\n}\n\n.rtl .modal-footer > :not(:last-child),\n[dir=\"rtl\"] .modal-footer > :not(:last-child) {\n margin-left: .25rem;\n}\n\n.rtl .modal-footer > :first-child,\n[dir=\"rtl\"] .modal-footer > :first-child {\n margin-right: 0;\n}\n\n.rtl .modal-footer > :last-child,\n[dir=\"rtl\"] .modal-footer > :last-child {\n margin-left: 0;\n}\n\n.rtl .alert-dismissible .close,\n[dir=\"rtl\"] .alert-dismissible .close {\n right: inherit;\n left: 0;\n}\n\n.rtl .dropdown-toggle::after,\n[dir=\"rtl\"] .dropdown-toggle::after {\n margin-right: .255em;\n margin-left: 0;\n}\n\n.rtl .form-check-input,\n[dir=\"rtl\"] .form-check-input {\n margin-right: -1.25rem;\n margin-left: inherit;\n}\n\n.rtl .form-check-label,\n[dir=\"rtl\"] .form-check-label {\n padding-right: 1.25rem;\n padding-left: inherit;\n}\n\n.rtl .pagination,\n.rtl .list-unstyled,\n.rtl .list-inline,\n[dir=\"rtl\"] .pagination,\n[dir=\"rtl\"] .list-unstyled,\n[dir=\"rtl\"] .list-inline {\n padding-right: 0;\n padding-left: inherit;\n}\n\n.rtl .pagination .page-item:first-child .page-link,\n[dir=\"rtl\"] .pagination .page-item:first-child .page-link {\n border-top-right-radius: 0.25rem;\n border-bottom-right-radius: 0.25rem;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.rtl .pagination .page-item:last-child .page-link,\n[dir=\"rtl\"] .pagination .page-item:last-child .page-link {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n border-top-left-radius: 0.25rem;\n border-bottom-left-radius: 0.25rem;\n}\n\n.rtl .offset-1,\n[dir=\"rtl\"] .offset-1 {\n margin-right: 8.333333%;\n margin-left: 0;\n}\n\n.rtl .offset-2,\n[dir=\"rtl\"] .offset-2 {\n margin-right: 16.666667%;\n margin-left: 0;\n}\n\n.rtl .offset-3,\n[dir=\"rtl\"] .offset-3 {\n margin-right: 25%;\n margin-left: 0;\n}\n\n.rtl .offset-4,\n[dir=\"rtl\"] .offset-4 {\n margin-right: 33.333333%;\n margin-left: 0;\n}\n\n.rtl .offset-5,\n[dir=\"rtl\"] .offset-5 {\n margin-right: 41.666667%;\n margin-left: 0;\n}\n\n.rtl .offset-6,\n[dir=\"rtl\"] .offset-6 {\n margin-right: 50%;\n margin-left: 0;\n}\n\n.rtl .offset-7,\n[dir=\"rtl\"] .offset-7 {\n margin-right: 58.333333%;\n margin-left: 0;\n}\n\n.rtl .offset-8,\n[dir=\"rtl\"] .offset-8 {\n margin-right: 66.666667%;\n margin-left: 0;\n}\n\n.rtl .offset-9,\n[dir=\"rtl\"] .offset-9 {\n margin-right: 75%;\n margin-left: 0;\n}\n\n.rtl .offset-10,\n[dir=\"rtl\"] .offset-10 {\n margin-right: 83.333333%;\n margin-left: 0;\n}\n\n.rtl .offset-11,\n[dir=\"rtl\"] .offset-11 {\n margin-right: 91.666667%;\n margin-left: 0;\n}\n\n@media (min-width: 576px) {\n .rtl .offset-sm-0,\n [dir=\"rtl\"] .offset-sm-0 {\n margin-right: 0;\n margin-left: 0;\n }\n .rtl .offset-sm-1,\n [dir=\"rtl\"] .offset-sm-1 {\n margin-right: 8.333333%;\n margin-left: 0;\n }\n .rtl .offset-sm-2,\n [dir=\"rtl\"] .offset-sm-2 {\n margin-right: 16.666667%;\n margin-left: 0;\n }\n .rtl .offset-sm-3,\n [dir=\"rtl\"] .offset-sm-3 {\n margin-right: 25%;\n margin-left: 0;\n }\n .rtl .offset-sm-4,\n [dir=\"rtl\"] .offset-sm-4 {\n margin-right: 33.333333%;\n margin-left: 0;\n }\n .rtl .offset-sm-5,\n [dir=\"rtl\"] .offset-sm-5 {\n margin-right: 41.666667%;\n margin-left: 0;\n }\n .rtl .offset-sm-6,\n [dir=\"rtl\"] .offset-sm-6 {\n margin-right: 50%;\n margin-left: 0;\n }\n .rtl .offset-sm-7,\n [dir=\"rtl\"] .offset-sm-7 {\n margin-right: 58.333333%;\n margin-left: 0;\n }\n .rtl .offset-sm-8,\n [dir=\"rtl\"] .offset-sm-8 {\n margin-right: 66.666667%;\n margin-left: 0;\n }\n .rtl .offset-sm-9,\n [dir=\"rtl\"] .offset-sm-9 {\n margin-right: 75%;\n margin-left: 0;\n }\n .rtl .offset-sm-10,\n [dir=\"rtl\"] .offset-sm-10 {\n margin-right: 83.333333%;\n margin-left: 0;\n }\n .rtl .offset-sm-11,\n [dir=\"rtl\"] .offset-sm-11 {\n margin-right: 91.666667%;\n margin-left: 0;\n }\n}\n\n@media (min-width: 768px) {\n .rtl .offset-md-0,\n [dir=\"rtl\"] .offset-md-0 {\n margin-right: 0;\n margin-left: 0;\n }\n .rtl .offset-md-1,\n [dir=\"rtl\"] .offset-md-1 {\n margin-right: 8.333333%;\n margin-left: 0;\n }\n .rtl .offset-md-2,\n [dir=\"rtl\"] .offset-md-2 {\n margin-right: 16.666667%;\n margin-left: 0;\n }\n .rtl .offset-md-3,\n [dir=\"rtl\"] .offset-md-3 {\n margin-right: 25%;\n margin-left: 0;\n }\n .rtl .offset-md-4,\n [dir=\"rtl\"] .offset-md-4 {\n margin-right: 33.333333%;\n margin-left: 0;\n }\n .rtl .offset-md-5,\n [dir=\"rtl\"] .offset-md-5 {\n margin-right: 41.666667%;\n margin-left: 0;\n }\n .rtl .offset-md-6,\n [dir=\"rtl\"] .offset-md-6 {\n margin-right: 50%;\n margin-left: 0;\n }\n .rtl .offset-md-7,\n [dir=\"rtl\"] .offset-md-7 {\n margin-right: 58.333333%;\n margin-left: 0;\n }\n .rtl .offset-md-8,\n [dir=\"rtl\"] .offset-md-8 {\n margin-right: 66.666667%;\n margin-left: 0;\n }\n .rtl .offset-md-9,\n [dir=\"rtl\"] .offset-md-9 {\n margin-right: 75%;\n margin-left: 0;\n }\n .rtl .offset-md-10,\n [dir=\"rtl\"] .offset-md-10 {\n margin-right: 83.333333%;\n margin-left: 0;\n }\n .rtl .offset-md-11,\n [dir=\"rtl\"] .offset-md-11 {\n margin-right: 91.666667%;\n margin-left: 0;\n }\n}\n\n@media (min-width: 992px) {\n .rtl .offset-lg-0,\n [dir=\"rtl\"] .offset-lg-0 {\n margin-right: 0;\n margin-left: 0;\n }\n .rtl .offset-lg-1,\n [dir=\"rtl\"] .offset-lg-1 {\n margin-right: 8.333333%;\n margin-left: 0;\n }\n .rtl .offset-lg-2,\n [dir=\"rtl\"] .offset-lg-2 {\n margin-right: 16.666667%;\n margin-left: 0;\n }\n .rtl .offset-lg-3,\n [dir=\"rtl\"] .offset-lg-3 {\n margin-right: 25%;\n margin-left: 0;\n }\n .rtl .offset-lg-4,\n [dir=\"rtl\"] .offset-lg-4 {\n margin-right: 33.333333%;\n margin-left: 0;\n }\n .rtl .offset-lg-5,\n [dir=\"rtl\"] .offset-lg-5 {\n margin-right: 41.666667%;\n margin-left: 0;\n }\n .rtl .offset-lg-6,\n [dir=\"rtl\"] .offset-lg-6 {\n margin-right: 50%;\n margin-left: 0;\n }\n .rtl .offset-lg-7,\n [dir=\"rtl\"] .offset-lg-7 {\n margin-right: 58.333333%;\n margin-left: 0;\n }\n .rtl .offset-lg-8,\n [dir=\"rtl\"] .offset-lg-8 {\n margin-right: 66.666667%;\n margin-left: 0;\n }\n .rtl .offset-lg-9,\n [dir=\"rtl\"] .offset-lg-9 {\n margin-right: 75%;\n margin-left: 0;\n }\n .rtl .offset-lg-10,\n [dir=\"rtl\"] .offset-lg-10 {\n margin-right: 83.333333%;\n margin-left: 0;\n }\n .rtl .offset-lg-11,\n [dir=\"rtl\"] .offset-lg-11 {\n margin-right: 91.666667%;\n margin-left: 0;\n }\n}\n\n@media (min-width: 1200px) {\n .rtl .offset-xl-0,\n [dir=\"rtl\"] .offset-xl-0 {\n margin-right: 0;\n margin-left: 0;\n }\n .rtl .offset-xl-1,\n [dir=\"rtl\"] .offset-xl-1 {\n margin-right: 8.333333%;\n margin-left: 0;\n }\n .rtl .offset-xl-2,\n [dir=\"rtl\"] .offset-xl-2 {\n margin-right: 16.666667%;\n margin-left: 0;\n }\n .rtl .offset-xl-3,\n [dir=\"rtl\"] .offset-xl-3 {\n margin-right: 25%;\n margin-left: 0;\n }\n .rtl .offset-xl-4,\n [dir=\"rtl\"] .offset-xl-4 {\n margin-right: 33.333333%;\n margin-left: 0;\n }\n .rtl .offset-xl-5,\n [dir=\"rtl\"] .offset-xl-5 {\n margin-right: 41.666667%;\n margin-left: 0;\n }\n .rtl .offset-xl-6,\n [dir=\"rtl\"] .offset-xl-6 {\n margin-right: 50%;\n margin-left: 0;\n }\n .rtl .offset-xl-7,\n [dir=\"rtl\"] .offset-xl-7 {\n margin-right: 58.333333%;\n margin-left: 0;\n }\n .rtl .offset-xl-8,\n [dir=\"rtl\"] .offset-xl-8 {\n margin-right: 66.666667%;\n margin-left: 0;\n }\n .rtl .offset-xl-9,\n [dir=\"rtl\"] .offset-xl-9 {\n margin-right: 75%;\n margin-left: 0;\n }\n .rtl .offset-xl-10,\n [dir=\"rtl\"] .offset-xl-10 {\n margin-right: 83.333333%;\n margin-left: 0;\n }\n .rtl .offset-xl-11,\n [dir=\"rtl\"] .offset-xl-11 {\n margin-right: 91.666667%;\n margin-left: 0;\n }\n}\n\n.rtl .mr-0,\n[dir=\"rtl\"] .mr-0 {\n margin-right: 0 !important;\n margin-left: 0 !important;\n}\n\n.rtl .ml-0,\n[dir=\"rtl\"] .ml-0 {\n margin-left: 0 !important;\n margin-right: 0 !important;\n}\n\n.rtl mx-0,\n[dir=\"rtl\"] mx-0 {\n margin-left: 0 !important;\n margin-right: 0 !important;\n}\n\n.rtl .mr-1,\n[dir=\"rtl\"] .mr-1 {\n margin-right: 0 !important;\n margin-left: 0.25rem !important;\n}\n\n.rtl .ml-1,\n[dir=\"rtl\"] .ml-1 {\n margin-left: 0 !important;\n margin-right: 0.25rem !important;\n}\n\n.rtl mx-1,\n[dir=\"rtl\"] mx-1 {\n margin-left: 0.25rem !important;\n margin-right: 0.25rem !important;\n}\n\n.rtl .mr-2,\n[dir=\"rtl\"] .mr-2 {\n margin-right: 0 !important;\n margin-left: 0.5rem !important;\n}\n\n.rtl .ml-2,\n[dir=\"rtl\"] .ml-2 {\n margin-left: 0 !important;\n margin-right: 0.5rem !important;\n}\n\n.rtl mx-2,\n[dir=\"rtl\"] mx-2 {\n margin-left: 0.5rem !important;\n margin-right: 0.5rem !important;\n}\n\n.rtl .mr-3,\n[dir=\"rtl\"] .mr-3 {\n margin-right: 0 !important;\n margin-left: 1rem !important;\n}\n\n.rtl .ml-3,\n[dir=\"rtl\"] .ml-3 {\n margin-left: 0 !important;\n margin-right: 1rem !important;\n}\n\n.rtl mx-3,\n[dir=\"rtl\"] mx-3 {\n margin-left: 1rem !important;\n margin-right: 1rem !important;\n}\n\n.rtl .mr-4,\n[dir=\"rtl\"] .mr-4 {\n margin-right: 0 !important;\n margin-left: 1.5rem !important;\n}\n\n.rtl .ml-4,\n[dir=\"rtl\"] .ml-4 {\n margin-left: 0 !important;\n margin-right: 1.5rem !important;\n}\n\n.rtl mx-4,\n[dir=\"rtl\"] mx-4 {\n margin-left: 1.5rem !important;\n margin-right: 1.5rem !important;\n}\n\n.rtl .mr-5,\n[dir=\"rtl\"] .mr-5 {\n margin-right: 0 !important;\n margin-left: 3rem !important;\n}\n\n.rtl .ml-5,\n[dir=\"rtl\"] .ml-5 {\n margin-left: 0 !important;\n margin-right: 3rem !important;\n}\n\n.rtl mx-5,\n[dir=\"rtl\"] mx-5 {\n margin-left: 3rem !important;\n margin-right: 3rem !important;\n}\n\n.rtl .pr-0,\n[dir=\"rtl\"] .pr-0 {\n padding-right: 0 !important;\n padding-left: 0 !important;\n}\n\n.rtl .pl-0,\n[dir=\"rtl\"] .pl-0 {\n padding-left: 0 !important;\n padding-right: 0 !important;\n}\n\n.rtl px-0,\n[dir=\"rtl\"] px-0 {\n padding-left: 0 !important;\n padding-right: 0 !important;\n}\n\n.rtl .pr-1,\n[dir=\"rtl\"] .pr-1 {\n padding-right: 0 !important;\n padding-left: 0.25rem !important;\n}\n\n.rtl .pl-1,\n[dir=\"rtl\"] .pl-1 {\n padding-left: 0 !important;\n padding-right: 0.25rem !important;\n}\n\n.rtl px-1,\n[dir=\"rtl\"] px-1 {\n padding-left: 0.25rem !important;\n padding-right: 0.25rem !important;\n}\n\n.rtl .pr-2,\n[dir=\"rtl\"] .pr-2 {\n padding-right: 0 !important;\n padding-left: 0.5rem !important;\n}\n\n.rtl .pl-2,\n[dir=\"rtl\"] .pl-2 {\n padding-left: 0 !important;\n padding-right: 0.5rem !important;\n}\n\n.rtl px-2,\n[dir=\"rtl\"] px-2 {\n padding-left: 0.5rem !important;\n padding-right: 0.5rem !important;\n}\n\n.rtl .pr-3,\n[dir=\"rtl\"] .pr-3 {\n padding-right: 0 !important;\n padding-left: 1rem !important;\n}\n\n.rtl .pl-3,\n[dir=\"rtl\"] .pl-3 {\n padding-left: 0 !important;\n padding-right: 1rem !important;\n}\n\n.rtl px-3,\n[dir=\"rtl\"] px-3 {\n padding-left: 1rem !important;\n padding-right: 1rem !important;\n}\n\n.rtl .pr-4,\n[dir=\"rtl\"] .pr-4 {\n padding-right: 0 !important;\n padding-left: 1.5rem !important;\n}\n\n.rtl .pl-4,\n[dir=\"rtl\"] .pl-4 {\n padding-left: 0 !important;\n padding-right: 1.5rem !important;\n}\n\n.rtl px-4,\n[dir=\"rtl\"] px-4 {\n padding-left: 1.5rem !important;\n padding-right: 1.5rem !important;\n}\n\n.rtl .pr-5,\n[dir=\"rtl\"] .pr-5 {\n padding-right: 0 !important;\n padding-left: 3rem !important;\n}\n\n.rtl .pl-5,\n[dir=\"rtl\"] .pl-5 {\n padding-left: 0 !important;\n padding-right: 3rem !important;\n}\n\n.rtl px-5,\n[dir=\"rtl\"] px-5 {\n padding-left: 3rem !important;\n padding-right: 3rem !important;\n}\n\n.rtl .mr-auto,\n[dir=\"rtl\"] .mr-auto {\n margin-right: 0 !important;\n margin-left: auto !important;\n}\n\n.rtl .ml-auto,\n[dir=\"rtl\"] .ml-auto {\n margin-right: auto !important;\n margin-left: 0 !important;\n}\n\n.rtl .mx-auto,\n[dir=\"rtl\"] .mx-auto {\n margin-right: auto !important;\n margin-left: auto !important;\n}\n\n@media (min-width: 576px) {\n .rtl .mr-sm-0,\n [dir=\"rtl\"] .mr-sm-0 {\n margin-right: 0 !important;\n margin-left: 0 !important;\n }\n .rtl .ml-sm-0,\n [dir=\"rtl\"] .ml-sm-0 {\n margin-left: 0 !important;\n margin-right: 0 !important;\n }\n .rtl mx-sm-0,\n [dir=\"rtl\"] mx-sm-0 {\n margin-left: 0 !important;\n margin-right: 0 !important;\n }\n .rtl .mr-sm-1,\n [dir=\"rtl\"] .mr-sm-1 {\n margin-right: 0 !important;\n margin-left: 0.25rem !important;\n }\n .rtl .ml-sm-1,\n [dir=\"rtl\"] .ml-sm-1 {\n margin-left: 0 !important;\n margin-right: 0.25rem !important;\n }\n .rtl mx-sm-1,\n [dir=\"rtl\"] mx-sm-1 {\n margin-left: 0.25rem !important;\n margin-right: 0.25rem !important;\n }\n .rtl .mr-sm-2,\n [dir=\"rtl\"] .mr-sm-2 {\n margin-right: 0 !important;\n margin-left: 0.5rem !important;\n }\n .rtl .ml-sm-2,\n [dir=\"rtl\"] .ml-sm-2 {\n margin-left: 0 !important;\n margin-right: 0.5rem !important;\n }\n .rtl mx-sm-2,\n [dir=\"rtl\"] mx-sm-2 {\n margin-left: 0.5rem !important;\n margin-right: 0.5rem !important;\n }\n .rtl .mr-sm-3,\n [dir=\"rtl\"] .mr-sm-3 {\n margin-right: 0 !important;\n margin-left: 1rem !important;\n }\n .rtl .ml-sm-3,\n [dir=\"rtl\"] .ml-sm-3 {\n margin-left: 0 !important;\n margin-right: 1rem !important;\n }\n .rtl mx-sm-3,\n [dir=\"rtl\"] mx-sm-3 {\n margin-left: 1rem !important;\n margin-right: 1rem !important;\n }\n .rtl .mr-sm-4,\n [dir=\"rtl\"] .mr-sm-4 {\n margin-right: 0 !important;\n margin-left: 1.5rem !important;\n }\n .rtl .ml-sm-4,\n [dir=\"rtl\"] .ml-sm-4 {\n margin-left: 0 !important;\n margin-right: 1.5rem !important;\n }\n .rtl mx-sm-4,\n [dir=\"rtl\"] mx-sm-4 {\n margin-left: 1.5rem !important;\n margin-right: 1.5rem !important;\n }\n .rtl .mr-sm-5,\n [dir=\"rtl\"] .mr-sm-5 {\n margin-right: 0 !important;\n margin-left: 3rem !important;\n }\n .rtl .ml-sm-5,\n [dir=\"rtl\"] .ml-sm-5 {\n margin-left: 0 !important;\n margin-right: 3rem !important;\n }\n .rtl mx-sm-5,\n [dir=\"rtl\"] mx-sm-5 {\n margin-left: 3rem !important;\n margin-right: 3rem !important;\n }\n .rtl .pr-sm-0,\n [dir=\"rtl\"] .pr-sm-0 {\n padding-right: 0 !important;\n padding-left: 0 !important;\n }\n .rtl .pl-sm-0,\n [dir=\"rtl\"] .pl-sm-0 {\n padding-left: 0 !important;\n padding-right: 0 !important;\n }\n .rtl px-sm-0,\n [dir=\"rtl\"] px-sm-0 {\n padding-left: 0 !important;\n padding-right: 0 !important;\n }\n .rtl .pr-sm-1,\n [dir=\"rtl\"] .pr-sm-1 {\n padding-right: 0 !important;\n padding-left: 0.25rem !important;\n }\n .rtl .pl-sm-1,\n [dir=\"rtl\"] .pl-sm-1 {\n padding-left: 0 !important;\n padding-right: 0.25rem !important;\n }\n .rtl px-sm-1,\n [dir=\"rtl\"] px-sm-1 {\n padding-left: 0.25rem !important;\n padding-right: 0.25rem !important;\n }\n .rtl .pr-sm-2,\n [dir=\"rtl\"] .pr-sm-2 {\n padding-right: 0 !important;\n padding-left: 0.5rem !important;\n }\n .rtl .pl-sm-2,\n [dir=\"rtl\"] .pl-sm-2 {\n padding-left: 0 !important;\n padding-right: 0.5rem !important;\n }\n .rtl px-sm-2,\n [dir=\"rtl\"] px-sm-2 {\n padding-left: 0.5rem !important;\n padding-right: 0.5rem !important;\n }\n .rtl .pr-sm-3,\n [dir=\"rtl\"] .pr-sm-3 {\n padding-right: 0 !important;\n padding-left: 1rem !important;\n }\n .rtl .pl-sm-3,\n [dir=\"rtl\"] .pl-sm-3 {\n padding-left: 0 !important;\n padding-right: 1rem !important;\n }\n .rtl px-sm-3,\n [dir=\"rtl\"] px-sm-3 {\n padding-left: 1rem !important;\n padding-right: 1rem !important;\n }\n .rtl .pr-sm-4,\n [dir=\"rtl\"] .pr-sm-4 {\n padding-right: 0 !important;\n padding-left: 1.5rem !important;\n }\n .rtl .pl-sm-4,\n [dir=\"rtl\"] .pl-sm-4 {\n padding-left: 0 !important;\n padding-right: 1.5rem !important;\n }\n .rtl px-sm-4,\n [dir=\"rtl\"] px-sm-4 {\n padding-left: 1.5rem !important;\n padding-right: 1.5rem !important;\n }\n .rtl .pr-sm-5,\n [dir=\"rtl\"] .pr-sm-5 {\n padding-right: 0 !important;\n padding-left: 3rem !important;\n }\n .rtl .pl-sm-5,\n [dir=\"rtl\"] .pl-sm-5 {\n padding-left: 0 !important;\n padding-right: 3rem !important;\n }\n .rtl px-sm-5,\n [dir=\"rtl\"] px-sm-5 {\n padding-left: 3rem !important;\n padding-right: 3rem !important;\n }\n .rtl .mr-sm-auto,\n [dir=\"rtl\"] .mr-sm-auto {\n margin-right: 0 !important;\n margin-left: auto !important;\n }\n .rtl .ml-sm-auto,\n [dir=\"rtl\"] .ml-sm-auto {\n margin-right: auto !important;\n margin-left: 0 !important;\n }\n .rtl .mx-sm-auto,\n [dir=\"rtl\"] .mx-sm-auto {\n margin-right: auto !important;\n margin-left: auto !important;\n }\n}\n\n@media (min-width: 768px) {\n .rtl .mr-md-0,\n [dir=\"rtl\"] .mr-md-0 {\n margin-right: 0 !important;\n margin-left: 0 !important;\n }\n .rtl .ml-md-0,\n [dir=\"rtl\"] .ml-md-0 {\n margin-left: 0 !important;\n margin-right: 0 !important;\n }\n .rtl mx-md-0,\n [dir=\"rtl\"] mx-md-0 {\n margin-left: 0 !important;\n margin-right: 0 !important;\n }\n .rtl .mr-md-1,\n [dir=\"rtl\"] .mr-md-1 {\n margin-right: 0 !important;\n margin-left: 0.25rem !important;\n }\n .rtl .ml-md-1,\n [dir=\"rtl\"] .ml-md-1 {\n margin-left: 0 !important;\n margin-right: 0.25rem !important;\n }\n .rtl mx-md-1,\n [dir=\"rtl\"] mx-md-1 {\n margin-left: 0.25rem !important;\n margin-right: 0.25rem !important;\n }\n .rtl .mr-md-2,\n [dir=\"rtl\"] .mr-md-2 {\n margin-right: 0 !important;\n margin-left: 0.5rem !important;\n }\n .rtl .ml-md-2,\n [dir=\"rtl\"] .ml-md-2 {\n margin-left: 0 !important;\n margin-right: 0.5rem !important;\n }\n .rtl mx-md-2,\n [dir=\"rtl\"] mx-md-2 {\n margin-left: 0.5rem !important;\n margin-right: 0.5rem !important;\n }\n .rtl .mr-md-3,\n [dir=\"rtl\"] .mr-md-3 {\n margin-right: 0 !important;\n margin-left: 1rem !important;\n }\n .rtl .ml-md-3,\n [dir=\"rtl\"] .ml-md-3 {\n margin-left: 0 !important;\n margin-right: 1rem !important;\n }\n .rtl mx-md-3,\n [dir=\"rtl\"] mx-md-3 {\n margin-left: 1rem !important;\n margin-right: 1rem !important;\n }\n .rtl .mr-md-4,\n [dir=\"rtl\"] .mr-md-4 {\n margin-right: 0 !important;\n margin-left: 1.5rem !important;\n }\n .rtl .ml-md-4,\n [dir=\"rtl\"] .ml-md-4 {\n margin-left: 0 !important;\n margin-right: 1.5rem !important;\n }\n .rtl mx-md-4,\n [dir=\"rtl\"] mx-md-4 {\n margin-left: 1.5rem !important;\n margin-right: 1.5rem !important;\n }\n .rtl .mr-md-5,\n [dir=\"rtl\"] .mr-md-5 {\n margin-right: 0 !important;\n margin-left: 3rem !important;\n }\n .rtl .ml-md-5,\n [dir=\"rtl\"] .ml-md-5 {\n margin-left: 0 !important;\n margin-right: 3rem !important;\n }\n .rtl mx-md-5,\n [dir=\"rtl\"] mx-md-5 {\n margin-left: 3rem !important;\n margin-right: 3rem !important;\n }\n .rtl .pr-md-0,\n [dir=\"rtl\"] .pr-md-0 {\n padding-right: 0 !important;\n padding-left: 0 !important;\n }\n .rtl .pl-md-0,\n [dir=\"rtl\"] .pl-md-0 {\n padding-left: 0 !important;\n padding-right: 0 !important;\n }\n .rtl px-md-0,\n [dir=\"rtl\"] px-md-0 {\n padding-left: 0 !important;\n padding-right: 0 !important;\n }\n .rtl .pr-md-1,\n [dir=\"rtl\"] .pr-md-1 {\n padding-right: 0 !important;\n padding-left: 0.25rem !important;\n }\n .rtl .pl-md-1,\n [dir=\"rtl\"] .pl-md-1 {\n padding-left: 0 !important;\n padding-right: 0.25rem !important;\n }\n .rtl px-md-1,\n [dir=\"rtl\"] px-md-1 {\n padding-left: 0.25rem !important;\n padding-right: 0.25rem !important;\n }\n .rtl .pr-md-2,\n [dir=\"rtl\"] .pr-md-2 {\n padding-right: 0 !important;\n padding-left: 0.5rem !important;\n }\n .rtl .pl-md-2,\n [dir=\"rtl\"] .pl-md-2 {\n padding-left: 0 !important;\n padding-right: 0.5rem !important;\n }\n .rtl px-md-2,\n [dir=\"rtl\"] px-md-2 {\n padding-left: 0.5rem !important;\n padding-right: 0.5rem !important;\n }\n .rtl .pr-md-3,\n [dir=\"rtl\"] .pr-md-3 {\n padding-right: 0 !important;\n padding-left: 1rem !important;\n }\n .rtl .pl-md-3,\n [dir=\"rtl\"] .pl-md-3 {\n padding-left: 0 !important;\n padding-right: 1rem !important;\n }\n .rtl px-md-3,\n [dir=\"rtl\"] px-md-3 {\n padding-left: 1rem !important;\n padding-right: 1rem !important;\n }\n .rtl .pr-md-4,\n [dir=\"rtl\"] .pr-md-4 {\n padding-right: 0 !important;\n padding-left: 1.5rem !important;\n }\n .rtl .pl-md-4,\n [dir=\"rtl\"] .pl-md-4 {\n padding-left: 0 !important;\n padding-right: 1.5rem !important;\n }\n .rtl px-md-4,\n [dir=\"rtl\"] px-md-4 {\n padding-left: 1.5rem !important;\n padding-right: 1.5rem !important;\n }\n .rtl .pr-md-5,\n [dir=\"rtl\"] .pr-md-5 {\n padding-right: 0 !important;\n padding-left: 3rem !important;\n }\n .rtl .pl-md-5,\n [dir=\"rtl\"] .pl-md-5 {\n padding-left: 0 !important;\n padding-right: 3rem !important;\n }\n .rtl px-md-5,\n [dir=\"rtl\"] px-md-5 {\n padding-left: 3rem !important;\n padding-right: 3rem !important;\n }\n .rtl .mr-md-auto,\n [dir=\"rtl\"] .mr-md-auto {\n margin-right: 0 !important;\n margin-left: auto !important;\n }\n .rtl .ml-md-auto,\n [dir=\"rtl\"] .ml-md-auto {\n margin-right: auto !important;\n margin-left: 0 !important;\n }\n .rtl .mx-md-auto,\n [dir=\"rtl\"] .mx-md-auto {\n margin-right: auto !important;\n margin-left: auto !important;\n }\n}\n\n@media (min-width: 992px) {\n .rtl .mr-lg-0,\n [dir=\"rtl\"] .mr-lg-0 {\n margin-right: 0 !important;\n margin-left: 0 !important;\n }\n .rtl .ml-lg-0,\n [dir=\"rtl\"] .ml-lg-0 {\n margin-left: 0 !important;\n margin-right: 0 !important;\n }\n .rtl mx-lg-0,\n [dir=\"rtl\"] mx-lg-0 {\n margin-left: 0 !important;\n margin-right: 0 !important;\n }\n .rtl .mr-lg-1,\n [dir=\"rtl\"] .mr-lg-1 {\n margin-right: 0 !important;\n margin-left: 0.25rem !important;\n }\n .rtl .ml-lg-1,\n [dir=\"rtl\"] .ml-lg-1 {\n margin-left: 0 !important;\n margin-right: 0.25rem !important;\n }\n .rtl mx-lg-1,\n [dir=\"rtl\"] mx-lg-1 {\n margin-left: 0.25rem !important;\n margin-right: 0.25rem !important;\n }\n .rtl .mr-lg-2,\n [dir=\"rtl\"] .mr-lg-2 {\n margin-right: 0 !important;\n margin-left: 0.5rem !important;\n }\n .rtl .ml-lg-2,\n [dir=\"rtl\"] .ml-lg-2 {\n margin-left: 0 !important;\n margin-right: 0.5rem !important;\n }\n .rtl mx-lg-2,\n [dir=\"rtl\"] mx-lg-2 {\n margin-left: 0.5rem !important;\n margin-right: 0.5rem !important;\n }\n .rtl .mr-lg-3,\n [dir=\"rtl\"] .mr-lg-3 {\n margin-right: 0 !important;\n margin-left: 1rem !important;\n }\n .rtl .ml-lg-3,\n [dir=\"rtl\"] .ml-lg-3 {\n margin-left: 0 !important;\n margin-right: 1rem !important;\n }\n .rtl mx-lg-3,\n [dir=\"rtl\"] mx-lg-3 {\n margin-left: 1rem !important;\n margin-right: 1rem !important;\n }\n .rtl .mr-lg-4,\n [dir=\"rtl\"] .mr-lg-4 {\n margin-right: 0 !important;\n margin-left: 1.5rem !important;\n }\n .rtl .ml-lg-4,\n [dir=\"rtl\"] .ml-lg-4 {\n margin-left: 0 !important;\n margin-right: 1.5rem !important;\n }\n .rtl mx-lg-4,\n [dir=\"rtl\"] mx-lg-4 {\n margin-left: 1.5rem !important;\n margin-right: 1.5rem !important;\n }\n .rtl .mr-lg-5,\n [dir=\"rtl\"] .mr-lg-5 {\n margin-right: 0 !important;\n margin-left: 3rem !important;\n }\n .rtl .ml-lg-5,\n [dir=\"rtl\"] .ml-lg-5 {\n margin-left: 0 !important;\n margin-right: 3rem !important;\n }\n .rtl mx-lg-5,\n [dir=\"rtl\"] mx-lg-5 {\n margin-left: 3rem !important;\n margin-right: 3rem !important;\n }\n .rtl .pr-lg-0,\n [dir=\"rtl\"] .pr-lg-0 {\n padding-right: 0 !important;\n padding-left: 0 !important;\n }\n .rtl .pl-lg-0,\n [dir=\"rtl\"] .pl-lg-0 {\n padding-left: 0 !important;\n padding-right: 0 !important;\n }\n .rtl px-lg-0,\n [dir=\"rtl\"] px-lg-0 {\n padding-left: 0 !important;\n padding-right: 0 !important;\n }\n .rtl .pr-lg-1,\n [dir=\"rtl\"] .pr-lg-1 {\n padding-right: 0 !important;\n padding-left: 0.25rem !important;\n }\n .rtl .pl-lg-1,\n [dir=\"rtl\"] .pl-lg-1 {\n padding-left: 0 !important;\n padding-right: 0.25rem !important;\n }\n .rtl px-lg-1,\n [dir=\"rtl\"] px-lg-1 {\n padding-left: 0.25rem !important;\n padding-right: 0.25rem !important;\n }\n .rtl .pr-lg-2,\n [dir=\"rtl\"] .pr-lg-2 {\n padding-right: 0 !important;\n padding-left: 0.5rem !important;\n }\n .rtl .pl-lg-2,\n [dir=\"rtl\"] .pl-lg-2 {\n padding-left: 0 !important;\n padding-right: 0.5rem !important;\n }\n .rtl px-lg-2,\n [dir=\"rtl\"] px-lg-2 {\n padding-left: 0.5rem !important;\n padding-right: 0.5rem !important;\n }\n .rtl .pr-lg-3,\n [dir=\"rtl\"] .pr-lg-3 {\n padding-right: 0 !important;\n padding-left: 1rem !important;\n }\n .rtl .pl-lg-3,\n [dir=\"rtl\"] .pl-lg-3 {\n padding-left: 0 !important;\n padding-right: 1rem !important;\n }\n .rtl px-lg-3,\n [dir=\"rtl\"] px-lg-3 {\n padding-left: 1rem !important;\n padding-right: 1rem !important;\n }\n .rtl .pr-lg-4,\n [dir=\"rtl\"] .pr-lg-4 {\n padding-right: 0 !important;\n padding-left: 1.5rem !important;\n }\n .rtl .pl-lg-4,\n [dir=\"rtl\"] .pl-lg-4 {\n padding-left: 0 !important;\n padding-right: 1.5rem !important;\n }\n .rtl px-lg-4,\n [dir=\"rtl\"] px-lg-4 {\n padding-left: 1.5rem !important;\n padding-right: 1.5rem !important;\n }\n .rtl .pr-lg-5,\n [dir=\"rtl\"] .pr-lg-5 {\n padding-right: 0 !important;\n padding-left: 3rem !important;\n }\n .rtl .pl-lg-5,\n [dir=\"rtl\"] .pl-lg-5 {\n padding-left: 0 !important;\n padding-right: 3rem !important;\n }\n .rtl px-lg-5,\n [dir=\"rtl\"] px-lg-5 {\n padding-left: 3rem !important;\n padding-right: 3rem !important;\n }\n .rtl .mr-lg-auto,\n [dir=\"rtl\"] .mr-lg-auto {\n margin-right: 0 !important;\n margin-left: auto !important;\n }\n .rtl .ml-lg-auto,\n [dir=\"rtl\"] .ml-lg-auto {\n margin-right: auto !important;\n margin-left: 0 !important;\n }\n .rtl .mx-lg-auto,\n [dir=\"rtl\"] .mx-lg-auto {\n margin-right: auto !important;\n margin-left: auto !important;\n }\n}\n\n@media (min-width: 1200px) {\n .rtl .mr-xl-0,\n [dir=\"rtl\"] .mr-xl-0 {\n margin-right: 0 !important;\n margin-left: 0 !important;\n }\n .rtl .ml-xl-0,\n [dir=\"rtl\"] .ml-xl-0 {\n margin-left: 0 !important;\n margin-right: 0 !important;\n }\n .rtl mx-xl-0,\n [dir=\"rtl\"] mx-xl-0 {\n margin-left: 0 !important;\n margin-right: 0 !important;\n }\n .rtl .mr-xl-1,\n [dir=\"rtl\"] .mr-xl-1 {\n margin-right: 0 !important;\n margin-left: 0.25rem !important;\n }\n .rtl .ml-xl-1,\n [dir=\"rtl\"] .ml-xl-1 {\n margin-left: 0 !important;\n margin-right: 0.25rem !important;\n }\n .rtl mx-xl-1,\n [dir=\"rtl\"] mx-xl-1 {\n margin-left: 0.25rem !important;\n margin-right: 0.25rem !important;\n }\n .rtl .mr-xl-2,\n [dir=\"rtl\"] .mr-xl-2 {\n margin-right: 0 !important;\n margin-left: 0.5rem !important;\n }\n .rtl .ml-xl-2,\n [dir=\"rtl\"] .ml-xl-2 {\n margin-left: 0 !important;\n margin-right: 0.5rem !important;\n }\n .rtl mx-xl-2,\n [dir=\"rtl\"] mx-xl-2 {\n margin-left: 0.5rem !important;\n margin-right: 0.5rem !important;\n }\n .rtl .mr-xl-3,\n [dir=\"rtl\"] .mr-xl-3 {\n margin-right: 0 !important;\n margin-left: 1rem !important;\n }\n .rtl .ml-xl-3,\n [dir=\"rtl\"] .ml-xl-3 {\n margin-left: 0 !important;\n margin-right: 1rem !important;\n }\n .rtl mx-xl-3,\n [dir=\"rtl\"] mx-xl-3 {\n margin-left: 1rem !important;\n margin-right: 1rem !important;\n }\n .rtl .mr-xl-4,\n [dir=\"rtl\"] .mr-xl-4 {\n margin-right: 0 !important;\n margin-left: 1.5rem !important;\n }\n .rtl .ml-xl-4,\n [dir=\"rtl\"] .ml-xl-4 {\n margin-left: 0 !important;\n margin-right: 1.5rem !important;\n }\n .rtl mx-xl-4,\n [dir=\"rtl\"] mx-xl-4 {\n margin-left: 1.5rem !important;\n margin-right: 1.5rem !important;\n }\n .rtl .mr-xl-5,\n [dir=\"rtl\"] .mr-xl-5 {\n margin-right: 0 !important;\n margin-left: 3rem !important;\n }\n .rtl .ml-xl-5,\n [dir=\"rtl\"] .ml-xl-5 {\n margin-left: 0 !important;\n margin-right: 3rem !important;\n }\n .rtl mx-xl-5,\n [dir=\"rtl\"] mx-xl-5 {\n margin-left: 3rem !important;\n margin-right: 3rem !important;\n }\n .rtl .pr-xl-0,\n [dir=\"rtl\"] .pr-xl-0 {\n padding-right: 0 !important;\n padding-left: 0 !important;\n }\n .rtl .pl-xl-0,\n [dir=\"rtl\"] .pl-xl-0 {\n padding-left: 0 !important;\n padding-right: 0 !important;\n }\n .rtl px-xl-0,\n [dir=\"rtl\"] px-xl-0 {\n padding-left: 0 !important;\n padding-right: 0 !important;\n }\n .rtl .pr-xl-1,\n [dir=\"rtl\"] .pr-xl-1 {\n padding-right: 0 !important;\n padding-left: 0.25rem !important;\n }\n .rtl .pl-xl-1,\n [dir=\"rtl\"] .pl-xl-1 {\n padding-left: 0 !important;\n padding-right: 0.25rem !important;\n }\n .rtl px-xl-1,\n [dir=\"rtl\"] px-xl-1 {\n padding-left: 0.25rem !important;\n padding-right: 0.25rem !important;\n }\n .rtl .pr-xl-2,\n [dir=\"rtl\"] .pr-xl-2 {\n padding-right: 0 !important;\n padding-left: 0.5rem !important;\n }\n .rtl .pl-xl-2,\n [dir=\"rtl\"] .pl-xl-2 {\n padding-left: 0 !important;\n padding-right: 0.5rem !important;\n }\n .rtl px-xl-2,\n [dir=\"rtl\"] px-xl-2 {\n padding-left: 0.5rem !important;\n padding-right: 0.5rem !important;\n }\n .rtl .pr-xl-3,\n [dir=\"rtl\"] .pr-xl-3 {\n padding-right: 0 !important;\n padding-left: 1rem !important;\n }\n .rtl .pl-xl-3,\n [dir=\"rtl\"] .pl-xl-3 {\n padding-left: 0 !important;\n padding-right: 1rem !important;\n }\n .rtl px-xl-3,\n [dir=\"rtl\"] px-xl-3 {\n padding-left: 1rem !important;\n padding-right: 1rem !important;\n }\n .rtl .pr-xl-4,\n [dir=\"rtl\"] .pr-xl-4 {\n padding-right: 0 !important;\n padding-left: 1.5rem !important;\n }\n .rtl .pl-xl-4,\n [dir=\"rtl\"] .pl-xl-4 {\n padding-left: 0 !important;\n padding-right: 1.5rem !important;\n }\n .rtl px-xl-4,\n [dir=\"rtl\"] px-xl-4 {\n padding-left: 1.5rem !important;\n padding-right: 1.5rem !important;\n }\n .rtl .pr-xl-5,\n [dir=\"rtl\"] .pr-xl-5 {\n padding-right: 0 !important;\n padding-left: 3rem !important;\n }\n .rtl .pl-xl-5,\n [dir=\"rtl\"] .pl-xl-5 {\n padding-left: 0 !important;\n padding-right: 3rem !important;\n }\n .rtl px-xl-5,\n [dir=\"rtl\"] px-xl-5 {\n padding-left: 3rem !important;\n padding-right: 3rem !important;\n }\n .rtl .mr-xl-auto,\n [dir=\"rtl\"] .mr-xl-auto {\n margin-right: 0 !important;\n margin-left: auto !important;\n }\n .rtl .ml-xl-auto,\n [dir=\"rtl\"] .ml-xl-auto {\n margin-right: auto !important;\n margin-left: 0 !important;\n }\n .rtl .mx-xl-auto,\n [dir=\"rtl\"] .mx-xl-auto {\n margin-right: auto !important;\n margin-left: auto !important;\n }\n}\n\n.rtl .text-right,\n[dir=\"rtl\"] .text-right {\n text-align: left !important;\n}\n\n.rtl .text-left,\n[dir=\"rtl\"] .text-left {\n text-align: right !important;\n}\n\n@media (min-width: 576px) {\n .rtl .text-sm-right,\n [dir=\"rtl\"] .text-sm-right {\n text-align: left !important;\n }\n .rtl .text-sm-left,\n [dir=\"rtl\"] .text-sm-left {\n text-align: right !important;\n }\n}\n\n@media (min-width: 768px) {\n .rtl .text-md-right,\n [dir=\"rtl\"] .text-md-right {\n text-align: left !important;\n }\n .rtl .text-md-left,\n [dir=\"rtl\"] .text-md-left {\n text-align: right !important;\n }\n}\n\n@media (min-width: 992px) {\n .rtl .text-lg-right,\n [dir=\"rtl\"] .text-lg-right {\n text-align: left !important;\n }\n .rtl .text-lg-left,\n [dir=\"rtl\"] .text-lg-left {\n text-align: right !important;\n }\n}\n\n@media (min-width: 1200px) {\n .rtl .text-xl-right,\n [dir=\"rtl\"] .text-xl-right {\n text-align: left !important;\n }\n .rtl .text-xl-left,\n [dir=\"rtl\"] .text-xl-left {\n text-align: right !important;\n }\n}\n\n/*# sourceMappingURL=bootstrap-rtl.css.map */",":root {\n // Custom variable values only support SassScript inside `#{}`.\n @each $color, $value in $colors {\n --#{$color}: #{$value};\n }\n\n @each $color, $value in $theme-colors {\n --#{$color}: #{$value};\n }\n\n @each $bp, $value in $grid-breakpoints {\n --breakpoint-#{$bp}: #{$value};\n }\n\n // Use `inspect` for lists so that quoted items keep the quotes.\n // See https://github.com/sass/sass/issues/2383#issuecomment-336349172\n --font-family-sans-serif: #{inspect($font-family-sans-serif)};\n --font-family-monospace: #{inspect($font-family-monospace)};\n}\n","// stylelint-disable declaration-no-important, selector-no-qualifying-type, property-no-vendor-prefix\n\n// Reboot\n//\n// Normalization of HTML elements, manually forked from Normalize.css to remove\n// styles targeting irrelevant browsers while applying new styles.\n//\n// Normalize is licensed MIT. https://github.com/necolas/normalize.css\n\n\n// Document\n//\n// 1. Change from `box-sizing: content-box` so that `width` is not affected by `padding` or `border`.\n// 2. Change the default font family in all browsers.\n// 3. Correct the line height in all browsers.\n// 4. Prevent adjustments of font size after orientation changes in IE on Windows Phone and in iOS.\n// 5. Change the default tap highlight to be completely transparent in iOS.\n\n*,\n*::before,\n*::after {\n box-sizing: border-box; // 1\n}\n\nhtml {\n font-family: sans-serif; // 2\n line-height: 1.15; // 3\n -webkit-text-size-adjust: 100%; // 4\n -webkit-tap-highlight-color: rgba($black, 0); // 5\n}\n\n// Shim for \"new\" HTML5 structural elements to display correctly (IE10, older browsers)\n// TODO: remove in v5\n// stylelint-disable-next-line selector-list-comma-newline-after\narticle, aside, figcaption, figure, footer, header, hgroup, main, nav, section {\n display: block;\n}\n\n// Body\n//\n// 1. Remove the margin in all browsers.\n// 2. As a best practice, apply a default `background-color`.\n// 3. Set an explicit initial text-align value so that we can later use\n// the `inherit` value on things like `` elements.\n\nbody {\n margin: 0; // 1\n font-family: $font-family-base;\n @include font-size($font-size-base);\n font-weight: $font-weight-base;\n line-height: $line-height-base;\n color: $body-color;\n text-align: left; // 3\n background-color: $body-bg; // 2\n}\n\n// Future-proof rule: in browsers that support :focus-visible, suppress the focus outline\n// on elements that programmatically receive focus but wouldn't normally show a visible\n// focus outline. In general, this would mean that the outline is only applied if the\n// interaction that led to the element receiving programmatic focus was a keyboard interaction,\n// or the browser has somehow determined that the user is primarily a keyboard user and/or\n// wants focus outlines to always be presented.\n//\n// See https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible\n// and https://developer.paciellogroup.com/blog/2018/03/focus-visible-and-backwards-compatibility/\n[tabindex=\"-1\"]:focus:not(:focus-visible) {\n outline: 0 !important;\n}\n\n\n// Content grouping\n//\n// 1. Add the correct box sizing in Firefox.\n// 2. Show the overflow in Edge and IE.\n\nhr {\n box-sizing: content-box; // 1\n height: 0; // 1\n overflow: visible; // 2\n}\n\n\n//\n// Typography\n//\n\n// Remove top margins from headings\n//\n// By default, `

`-`

` all receive top and bottom margins. We nuke the top\n// margin for easier control within type scales as it avoids margin collapsing.\n// stylelint-disable-next-line selector-list-comma-newline-after\nh1, h2, h3, h4, h5, h6 {\n margin-top: 0;\n margin-bottom: $headings-margin-bottom;\n}\n\n// Reset margins on paragraphs\n//\n// Similarly, the top margin on `

`s get reset. However, we also reset the\n// bottom margin to use `rem` units instead of `em`.\np {\n margin-top: 0;\n margin-bottom: $paragraph-margin-bottom;\n}\n\n// Abbreviations\n//\n// 1. Duplicate behavior to the data-* attribute for our tooltip plugin\n// 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.\n// 3. Add explicit cursor to indicate changed behavior.\n// 4. Remove the bottom border in Firefox 39-.\n// 5. Prevent the text-decoration to be skipped.\n\nabbr[title],\nabbr[data-original-title] { // 1\n text-decoration: underline; // 2\n text-decoration: underline dotted; // 2\n cursor: help; // 3\n border-bottom: 0; // 4\n text-decoration-skip-ink: none; // 5\n}\n\naddress {\n margin-bottom: 1rem;\n font-style: normal;\n line-height: inherit;\n}\n\nol,\nul,\ndl {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\nol ol,\nul ul,\nol ul,\nul ol {\n margin-bottom: 0;\n}\n\ndt {\n font-weight: $dt-font-weight;\n}\n\ndd {\n margin-bottom: .5rem;\n margin-left: 0; // Undo browser default\n}\n\nblockquote {\n margin: 0 0 1rem;\n}\n\nb,\nstrong {\n font-weight: $font-weight-bolder; // Add the correct font weight in Chrome, Edge, and Safari\n}\n\nsmall {\n @include font-size(80%); // Add the correct font size in all browsers\n}\n\n//\n// Prevent `sub` and `sup` elements from affecting the line height in\n// all browsers.\n//\n\nsub,\nsup {\n position: relative;\n @include font-size(75%);\n line-height: 0;\n vertical-align: baseline;\n}\n\nsub { bottom: -.25em; }\nsup { top: -.5em; }\n\n\n//\n// Links\n//\n\na {\n color: $link-color;\n text-decoration: $link-decoration;\n background-color: transparent; // Remove the gray background on active links in IE 10.\n\n @include hover() {\n color: $link-hover-color;\n text-decoration: $link-hover-decoration;\n }\n}\n\n// And undo these styles for placeholder links/named anchors (without href).\n// It would be more straightforward to just use a[href] in previous block, but that\n// causes specificity issues in many other styles that are too complex to fix.\n// See https://github.com/twbs/bootstrap/issues/19402\n\na:not([href]):not([class]) {\n color: inherit;\n text-decoration: none;\n\n @include hover() {\n color: inherit;\n text-decoration: none;\n }\n}\n\n\n//\n// Code\n//\n\npre,\ncode,\nkbd,\nsamp {\n font-family: $font-family-monospace;\n @include font-size(1em); // Correct the odd `em` font sizing in all browsers.\n}\n\npre {\n // Remove browser default top margin\n margin-top: 0;\n // Reset browser default of `1em` to use `rem`s\n margin-bottom: 1rem;\n // Don't allow content to break outside\n overflow: auto;\n // Disable auto-hiding scrollbar in IE & legacy Edge to avoid overlap,\n // making it impossible to interact with the content\n -ms-overflow-style: scrollbar;\n}\n\n\n//\n// Figures\n//\n\nfigure {\n // Apply a consistent margin strategy (matches our type styles).\n margin: 0 0 1rem;\n}\n\n\n//\n// Images and content\n//\n\nimg {\n vertical-align: middle;\n border-style: none; // Remove the border on images inside links in IE 10-.\n}\n\nsvg {\n // Workaround for the SVG overflow bug in IE10/11 is still required.\n // See https://github.com/twbs/bootstrap/issues/26878\n overflow: hidden;\n vertical-align: middle;\n}\n\n\n//\n// Tables\n//\n\ntable {\n border-collapse: collapse; // Prevent double borders\n}\n\ncaption {\n padding-top: $table-cell-padding;\n padding-bottom: $table-cell-padding;\n color: $table-caption-color;\n text-align: left;\n caption-side: bottom;\n}\n\n// 1. Removes font-weight bold by inheriting\n// 2. Matches default `` alignment by inheriting `text-align`.\n// 3. Fix alignment for Safari\n\nth {\n font-weight: $table-th-font-weight; // 1\n text-align: inherit; // 2\n text-align: -webkit-match-parent; // 3\n}\n\n\n//\n// Forms\n//\n\nlabel {\n // Allow labels to use `margin` for spacing.\n display: inline-block;\n margin-bottom: $label-margin-bottom;\n}\n\n// Remove the default `border-radius` that macOS Chrome adds.\n//\n// Details at https://github.com/twbs/bootstrap/issues/24093\nbutton {\n // stylelint-disable-next-line property-disallowed-list\n border-radius: 0;\n}\n\n// Explicitly remove focus outline in Chromium when it shouldn't be\n// visible (e.g. as result of mouse click or touch tap). It already\n// should be doing this automatically, but seems to currently be\n// confused and applies its very visible two-tone outline anyway.\n\nbutton:focus:not(:focus-visible) {\n outline: 0;\n}\n\ninput,\nbutton,\nselect,\noptgroup,\ntextarea {\n margin: 0; // Remove the margin in Firefox and Safari\n font-family: inherit;\n @include font-size(inherit);\n line-height: inherit;\n}\n\nbutton,\ninput {\n overflow: visible; // Show the overflow in Edge\n}\n\nbutton,\nselect {\n text-transform: none; // Remove the inheritance of text transform in Firefox\n}\n\n// Set the cursor for non-`