From fce050f1ea25adead76f980e9584d8ce278092a8 Mon Sep 17 00:00:00 2001 From: cKey <35512826+colinin@users.noreply.github.com> Date: Sun, 1 Nov 2020 11:57:29 +0800 Subject: [PATCH] Enhance IM functionality --- aspnet-core/LINGYUN.MicroService.sln | 23 +- .../database/ApiGateway-Init-SqlServer.sql | 20 +- aspnet-core/database/ApiGateway-Init.sql | 98 ++- ...bp.AspNetCore.SignalR.Protocol.Json.csproj | 15 + .../AbpAspNetCoreSignalRProtocolJsonModule.cs | 22 + ...Abp.ExceptionHandling.Notifications.csproj | 15 + ...nHandlingNotificationDefinitionProvider.cs | 22 +- .../AbpExceptionHandlingNotificationNames.cs | 3 +- ...AbpNotificationsExceptionHandlingModule.cs | 19 +- .../AbpNotificationsExceptionSubscriber.cs | 29 +- .../Localization/Resources/en.json | 7 + .../Localization/Resources/zh-Hans.json | 7 + .../LINGYUN.Abp.ExceptionHandling.csproj | 2 +- .../AbpExceptionHandlingModule.cs | 12 +- .../Localization/ExceptionHandlingResource.cs | 9 + .../Abp/IM/SignalR/AbpIMSignalRModule.cs | 9 +- .../Abp/IM/SignalR/Hubs/MessagesHub.cs | 74 +- ...der.cs => SignalRMessageSenderProvider.cs} | 15 +- .../LINGYUN.Abp.IM/LINGYUN.Abp.IM.csproj | 1 + .../LINGYUN/Abp/IM/AbpIMModule.cs | 10 + .../LINGYUN/Abp/IM/AbpIMOptions.cs | 15 + .../LINGYUN/Abp/IM/Contract/IFriendStore.cs | 47 +- .../LINGYUN/Abp/IM/Group/IUserGroupStore.cs | 44 +- .../LINGYUN/Abp/IM/Messages/ChatMessage.cs | 2 +- .../Abp/IM/Messages/IMessageSenderProvider.cs | 10 + .../Messages/IMessageSenderProviderManager.cs | 9 + .../LINGYUN/Abp/IM/Messages/IMessageStore.cs | 20 +- .../LINGYUN/Abp/IM/Messages/MessageSender.cs | 26 + .../Abp/IM/Messages/MessageSenderBase.cs | 47 -- .../IM/Messages/MessageSenderProviderBase.cs | 70 ++ .../Messages/MessageSenderProviderManager.cs | 33 + .../Abp/IM/Messages/NullMessageSender.cs | 26 - .../SignalR/Hubs/NotificationsHub.cs | 41 +- .../SignalRNotificationPublishProvider.cs | 71 +- ...GYUN.Abp.Notifications.WeChat.WeApp.csproj | 1 + .../WeChatWeAppFeatureDefinitionProvider.cs | 54 ++ .../WeApp/Features/WeChatWeAppFeatures.cs | 30 + .../WeApp/IWeChatWeAppNotificationSender.cs | 5 +- .../WeChatWeAppNotificationPublishProvider.cs | 58 +- .../WeApp/WeChatWeAppNotificationSender.cs | 21 +- .../Notifications/AbpNotificationModule.cs | 5 - .../INotificationDefinitionContext.cs | 15 +- .../INotificationDefinitionManager.cs | 6 +- .../Notifications/INotificationDispatcher.cs | 41 +- .../Abp/Notifications/INotificationSender.cs | 41 + .../Abp/Notifications/INotificationStore.cs | 151 +++- .../INotificationSubscriptionManager.cs | 53 +- .../Internal/DefaultNotificationDispatcher.cs | 220 ----- .../Internal/NotificationSender.cs | 78 ++ .../NotificationSubscriptionManager.cs | 72 +- .../Notifications/LocalizableStringInfo.cs | 23 + .../Abp/Notifications/NotificationData.cs | 91 +-- .../NotificationDataConverter.cs | 31 + .../NotificationDataMappingDictionary.cs | 14 +- .../Notifications/NotificationDefinition.cs | 27 +- .../NotificationDefinitionContext.cs | 46 +- .../NotificationDefinitionManager.cs | 78 +- .../Notifications/NotificationEventData.cs | 30 +- .../NotificationGroupDefinition.cs | 70 ++ .../Abp/Notifications/NotificationInfo.cs | 30 +- .../Abp/Notifications/NotificationName.cs | 14 - .../NotificationNameNormalizer.cs | 15 - .../Notifications/NotificationPublishJob.cs | 4 +- .../NotificationPublishProvider.cs | 12 +- .../Notifications/NullNotificationStore.cs | 123 ++- .../LINGYUN.Abp.RealTime.SignalR/Class1.cs | 8 - .../SignalR/AbpRealTimeSignalRModule.cs | 1 + .../SignalR/Hubs/OnlineClientHubBase.cs | 86 +- .../LINGYUN/Abp/RealTime/Client/IClient.cs | 10 + .../Abp/RealTime/Client/IOnlineClient.cs | 6 +- .../RealTime/Client/IOnlineClientManager.cs | 3 + .../Abp/RealTime/Client/IOnlineClientStore.cs | 6 +- .../Client/InMemoryOnlineClientStore.cs | 12 +- .../Abp/RealTime/Client/OnlineClient.cs | 11 +- .../RealTime/Client/OnlineClientManager.cs | 11 +- .../LINGYUN.Abp.WeChat.Authorization.csproj | 4 + .../AbpWeChatAuthorizationModule.cs | 5 +- .../OpenId/IUserWeChatCodeFinder.cs | 12 + .../OpenId/IWeChatOpenIdFinder.cs | 7 +- .../OpenId/NullUserWeChatCodeFinder.cs | 19 + .../OpenId/WeChatOpenIdCacheItem.cs | 6 +- .../OpenId/WeChatOpenIdFinder.cs | 27 +- .../Token/IWeChatTokenProvider.cs | 5 +- .../Token/WeChatTokenProvider.cs | 13 +- .../WeChatAuthorizationConsts.cs | 22 + .../Abp/Identity/IIdentityUserAppService.cs | 1 - .../WeChatTokenGrantValidator.cs | 8 +- .../Authorization/UserWeChatCodeFinder.cs | 40 + .../Chat/Dto/MyFriendAddRequestDto.cs | 7 + .../Chat/Dto/MyFriendCreateDto.cs | 1 - .../Chat/IMyFriendAppService.cs | 2 + .../Localization/ApplicationContracts/en.json | 4 +- .../ApplicationContracts/zh-Hans.json | 4 +- .../Notifications/Dto/NotificationDto.cs | 28 + .../Notifications/Dto/NotificationGroupDto.cs | 11 + .../Notifications/Dto/NotificationSendDto.cs | 22 + .../Dto/UserNotificationGetByPagedDto.cs | 2 + .../IMyNotificationAppService.cs | 21 + .../Notifications/INotificationAppService.cs | 41 - .../Permissions/MessageServicePermissions.cs | 7 + ...ageServicePermissionsDefinitionProvider.cs | 3 + .../Dto/SubscriptionsGetByNameDto.cs | 2 +- .../Dto/UserSubscreNotificationDto.cs | 7 + .../Dto/UserSubscriptionsResult.cs | 22 + .../IMySubscriptionAppService.cs | 39 + .../Subscriptions/ISubscriptionAppService.cs | 35 - .../MessageService/Chat/MyFriendAppService.cs | 19 +- .../Notifications/MyNotificationAppService.cs | 119 +++ .../Notifications/NotificationAppService.cs | 68 -- .../Subscriptions/MySubscriptionAppService.cs | 76 ++ .../Subscriptions/SubscriptionAppService.cs | 65 -- ...UN.Abp.MessageService.Domain.Shared.csproj | 4 + .../Chat/UserChatFriendConsts.cs | 8 + ...sageServiceModuleExtensionConfiguration.cs | 17 + ...ensionConfigurationDictionaryExtensions.cs | 18 + .../MessageServiceModuleExtensionConsts.cs | 12 + .../AbpMessageServiceDomainModule.cs | 18 +- .../Abp/MessageService/Chat/FriendStore.cs | 213 +++-- .../Chat/IUserChatFriendRepository.cs | 7 +- .../Chat/IUserChatSettingRepository.cs | 5 +- .../Abp/MessageService/Chat/Message.cs | 3 +- .../Abp/MessageService/Chat/MessageStore.cs | 147 ++-- .../Abp/MessageService/Chat/UserCardFinder.cs | 24 +- .../Abp/MessageService/Chat/UserChatFriend.cs | 11 +- .../Local/UserChatFriendEventHandler.cs | 71 +- .../Local/UserCreateJoinIMEventHandler.cs | 35 +- .../UserCreateSendWelcomeEventHandler.cs | 131 +-- .../MessageService/Group/UserGroupStore.cs | 112 ++- .../Localization/Resources/en.json | 18 +- .../Localization/Resources/zh-Hans.json | 18 +- .../MessageServiceDomainAutoMapperProfile.cs | 83 +- .../Mapper/NotificationTypeConverter.cs | 39 + ...geServiceNotificationDefinitionProvider.cs | 71 +- .../Notifications/INotificationRepository.cs | 11 +- .../IUserNotificationRepository.cs | 43 +- .../MessageServiceNotificationNames.cs | 33 + .../Notifications/Notification.cs | 10 +- .../Notifications/NotificationStore.cs | 343 +++++--- .../Abp/MessageService/Packages/Emoji.cs | 29 + .../Subscriptions/IUserSubscribeRepository.cs | 56 +- .../Chat/EfCoreUserChatFriendRepository.cs | 12 +- .../Chat/EfCoreUserChatSettingRepository.cs | 9 +- ...MessageServiceEntityFrameworkCoreModule.cs | 1 + .../IMessageServiceDbContext.cs | 1 + .../MessageServiceDbContext.cs | 1 + ...ServiceDbContextModelCreatingExtensions.cs | 28 +- .../Group/EfCoreUserChatGroupRepository.cs | 2 +- .../EfCoreNotificationRepository.cs | 14 +- .../EfCoreUserNotificationRepository.cs | 119 ++- .../EfCoreUserSubscribeRepository.cs | 85 +- .../MessageService/Chat/MyFriendController.cs | 7 + .../Notifications/MyNotificationController.cs | 55 ++ .../Notifications/NotificationController.cs | 56 -- .../Subscriptions/MySubscriptionController.cs | 53 ++ .../Subscriptions/SubscriptionController.cs | 47 -- .../LINGYUN.Abp.WeChat.csproj | 24 + .../LINGYUN/Abp/WeChat/AbpWeChatModule.cs | 27 + .../WeChatFeatureDefinitionProvider.cs | 19 + .../Abp/WeChat/Features/WeChatFeatures.cs | 7 + .../Abp/WeChat/Localization/Resources/en.json | 6 + .../Localization/Resources/zh-Hans.json | 6 + .../Abp/WeChat/Localization/WeChatResource.cs | 9 + .../LINGYUN.ApiGateway.Host/event-bus-cap.db | Bin 40960 -> 40960 bytes .../ApiGatewayHttpApiHostModule.cs | 3 +- .../AbpMessageServiceHttpApiHostModule.cs | 2 + .../Distributed/ChatMessageEventHandler.cs | 52 ++ .../Distributed/NotificationEventHandler.cs | 129 ++- .../Distributed/TenantCreateEventHandler.cs | 24 +- .../Hangfire/HangfireDashboardRouteOptions.cs | 26 +- ...YUN.Abp.MessageService.HttpApi.Host.csproj | 1 + .../Localization/HttpApiHost/en.json | 6 +- .../Localization/HttpApiHost/zh-Hans.json | 6 +- ...rChatFriend-Column-Description.Designer.cs | 588 +++++++++++++ ...6_Add-UserChatFriend-Column-Description.cs | 116 +++ ...essage-Entity-To-AggregateRoot.Designer.cs | 612 ++++++++++++++ ...9_Based-Message-Entity-To-AggregateRoot.cs | 51 ++ ...iceHostMigrationsDbContextModelSnapshot.cs | 424 +++++----- .../MessageServiceDefinitionProvider.cs | 25 - ...sageServicePermissionDefinitionProvider.cs | 22 - .../AbpMessageServicePermissions.cs | 12 - vueJs/package-lock.json | 187 +---- vueJs/package.json | 1 - vueJs/src/api/instant-message.ts | 15 + vueJs/src/api/notification.ts | 116 +++ vueJs/src/assets/im-images/top-buttom.png | Bin 0 -> 5520 bytes vueJs/src/components/InstantMessage/index.vue | 465 ----------- .../components/AddFriend.vue | 7 +- .../Lemon-IMUI/components/Avatar.vue | 54 -- vueJs/src/components/Lemon-IMUI/index.vue | 773 ++++++++++++++++++ .../components/UserNofitications.vue | 115 ++- vueJs/src/components/Notification/index.vue | 4 +- vueJs/src/icons/components/im.ts | 12 + vueJs/src/icons/components/index.ts | 1 + vueJs/src/icons/svg/im.svg | 1 + vueJs/src/layout/index.vue | 50 +- vueJs/src/shims.d.ts | 4 + vueJs/src/views/dashboard/index.vue | 13 +- .../profile-setting/components/MyNotifier.vue | 79 ++ vueJs/src/views/profile-setting/index.vue | 6 +- 199 files changed, 6557 insertions(+), 2883 deletions(-) create mode 100644 aspnet-core/modules/common/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json.csproj create mode 100644 aspnet-core/modules/common/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json/LINGYUN/Abp/AspNetCore/SignalR/Protocol/Json/AbpAspNetCoreSignalRProtocolJsonModule.cs create mode 100644 aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/Localization/Resources/en.json create mode 100644 aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/Localization/Resources/zh-Hans.json create mode 100644 aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling/LINGYUN/Abp/ExceptionHandling/Localization/ExceptionHandlingResource.cs rename aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Messages/{SignalRMessageSender.cs => SignalRMessageSenderProvider.cs} (84%) create mode 100644 aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/AbpIMModule.cs create mode 100644 aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/AbpIMOptions.cs create mode 100644 aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageSenderProvider.cs create mode 100644 aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageSenderProviderManager.cs create mode 100644 aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSender.cs delete mode 100644 aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSenderBase.cs create mode 100644 aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSenderProviderBase.cs create mode 100644 aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSenderProviderManager.cs delete mode 100644 aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/NullMessageSender.cs create mode 100644 aspnet-core/modules/common/LINGYUN.Abp.Notifications.WeChat/LINGYUN/Abp/Notifications/WeChat/WeApp/Features/WeChatWeAppFeatureDefinitionProvider.cs create mode 100644 aspnet-core/modules/common/LINGYUN.Abp.Notifications.WeChat/LINGYUN/Abp/Notifications/WeChat/WeApp/Features/WeChatWeAppFeatures.cs create mode 100644 aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationSender.cs delete mode 100644 aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Internal/DefaultNotificationDispatcher.cs create mode 100644 aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Internal/NotificationSender.cs create mode 100644 aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/LocalizableStringInfo.cs create mode 100644 aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDataConverter.cs create mode 100644 aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationGroupDefinition.cs delete mode 100644 aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationName.cs delete mode 100644 aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationNameNormalizer.cs delete mode 100644 aspnet-core/modules/common/LINGYUN.Abp.RealTime.SignalR/Class1.cs create mode 100644 aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Client/IClient.cs create mode 100644 aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/OpenId/IUserWeChatCodeFinder.cs create mode 100644 aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/OpenId/NullUserWeChatCodeFinder.cs create mode 100644 aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/WeChatAuthorizationConsts.cs create mode 100644 aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChatValidator/LINGYUN/Abp/WeChat/Authorization/UserWeChatCodeFinder.cs create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/MyFriendAddRequestDto.cs create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Notifications/Dto/NotificationDto.cs create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Notifications/Dto/NotificationGroupDto.cs create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Notifications/Dto/NotificationSendDto.cs create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Notifications/IMyNotificationAppService.cs delete mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Notifications/INotificationAppService.cs create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Subscriptions/Dto/UserSubscreNotificationDto.cs create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Subscriptions/Dto/UserSubscriptionsResult.cs create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Subscriptions/IMySubscriptionAppService.cs delete mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Subscriptions/ISubscriptionAppService.cs create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Notifications/MyNotificationAppService.cs delete mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Notifications/NotificationAppService.cs create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Subscriptions/MySubscriptionAppService.cs delete mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Subscriptions/SubscriptionAppService.cs create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Chat/UserChatFriendConsts.cs create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/ObjectExtending/MessageServiceModuleExtensionConfiguration.cs create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/ObjectExtending/MessageServiceModuleExtensionConfigurationDictionaryExtensions.cs create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/ObjectExtending/MessageServiceModuleExtensionConsts.cs create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Mapper/NotificationTypeConverter.cs create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/MessageServiceNotificationNames.cs create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Packages/Emoji.cs create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Notifications/MyNotificationController.cs delete mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Notifications/NotificationController.cs create mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Subscriptions/MySubscriptionController.cs delete mode 100644 aspnet-core/modules/message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Subscriptions/SubscriptionController.cs create mode 100644 aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN.Abp.WeChat.csproj create mode 100644 aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/AbpWeChatModule.cs create mode 100644 aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Features/WeChatFeatureDefinitionProvider.cs create mode 100644 aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Features/WeChatFeatures.cs create mode 100644 aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Localization/Resources/en.json create mode 100644 aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Localization/Resources/zh-Hans.json create mode 100644 aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Localization/WeChatResource.cs create mode 100644 aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/ChatMessageEventHandler.cs create mode 100644 aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20201029102936_Add-UserChatFriend-Column-Description.Designer.cs create mode 100644 aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20201029102936_Add-UserChatFriend-Column-Description.cs create mode 100644 aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20201030032219_Based-Message-Entity-To-AggregateRoot.Designer.cs create mode 100644 aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20201030032219_Based-Message-Entity-To-AggregateRoot.cs delete mode 100644 aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Notifications/MessageServiceDefinitionProvider.cs delete mode 100644 aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Permissions/AbpMessageServicePermissionDefinitionProvider.cs delete mode 100644 aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Permissions/AbpMessageServicePermissions.cs create mode 100644 vueJs/src/api/notification.ts create mode 100644 vueJs/src/assets/im-images/top-buttom.png delete mode 100644 vueJs/src/components/InstantMessage/index.vue rename vueJs/src/components/{InstantMessage => Lemon-IMUI}/components/AddFriend.vue (95%) delete mode 100644 vueJs/src/components/Lemon-IMUI/components/Avatar.vue create mode 100644 vueJs/src/icons/components/im.ts create mode 100644 vueJs/src/icons/svg/im.svg create mode 100644 vueJs/src/views/profile-setting/components/MyNotifier.vue diff --git a/aspnet-core/LINGYUN.MicroService.sln b/aspnet-core/LINGYUN.MicroService.sln index 8c07c2fe9..a2aaa2ce2 100644 --- a/aspnet-core/LINGYUN.MicroService.sln +++ b/aspnet-core/LINGYUN.MicroService.sln @@ -253,7 +253,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Account.Web", " EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.AspNetCore.SignalR.JwtToken", "modules\common\LINGYUN.Abp.AspNetCore.SignalR\LINGYUN.Abp.AspNetCore.SignalR.JwtToken.csproj", "{A66D48C9-F141-4111-9169-CEB64AFFF61D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.RealTime.SignalR", "modules\common\LINGYUN.Abp.RealTime.SignalR\LINGYUN.Abp.RealTime.SignalR.csproj", "{524276E1-053D-4191-ABF7-4CDA01BFFBC3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.RealTime.SignalR", "modules\common\LINGYUN.Abp.RealTime.SignalR\LINGYUN.Abp.RealTime.SignalR.csproj", "{524276E1-053D-4191-ABF7-4CDA01BFFBC3}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json", "modules\common\LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json\LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json.csproj", "{43083268-74DE-4C68-824A-FB0CEC77358D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "wechat", "wechat", "{DD9BE9E7-F6BF-4869-BCD2-82F5072BDA21}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.WeChat", "modules\wechat\LINGYUN.Abp.WeChat\LINGYUN.Abp.WeChat.csproj", "{BAE74ABC-1096-495F-A624-BEBFBC1896F2}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -677,6 +683,14 @@ Global {524276E1-053D-4191-ABF7-4CDA01BFFBC3}.Debug|Any CPU.Build.0 = Debug|Any CPU {524276E1-053D-4191-ABF7-4CDA01BFFBC3}.Release|Any CPU.ActiveCfg = Release|Any CPU {524276E1-053D-4191-ABF7-4CDA01BFFBC3}.Release|Any CPU.Build.0 = Release|Any CPU + {43083268-74DE-4C68-824A-FB0CEC77358D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {43083268-74DE-4C68-824A-FB0CEC77358D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {43083268-74DE-4C68-824A-FB0CEC77358D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {43083268-74DE-4C68-824A-FB0CEC77358D}.Release|Any CPU.Build.0 = Release|Any CPU + {BAE74ABC-1096-495F-A624-BEBFBC1896F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BAE74ABC-1096-495F-A624-BEBFBC1896F2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BAE74ABC-1096-495F-A624-BEBFBC1896F2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BAE74ABC-1096-495F-A624-BEBFBC1896F2}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -736,8 +750,8 @@ Global {0D1DB712-B48D-4FB7-9A47-694C668A62E3} = {608A3BD0-FC8D-48B0-B1C5-F3203A3BE99F} {9E12ADBF-713B-4FE7-B71F-52B5078A57CE} = {3CDBA2A6-DC8A-48C5-8A6C-AF207394B43D} {02043AD5-5E06-4EDD-8162-983E766C38EC} = {0439B173-F41E-4CE0-A44A-CCB70328F272} - {85EF4251-EFC4-4CC9-912B-EA5DB1E2E359} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E} - {263A8A1C-69D0-4C3F-B33E-8F0831C146EB} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E} + {85EF4251-EFC4-4CC9-912B-EA5DB1E2E359} = {DD9BE9E7-F6BF-4869-BCD2-82F5072BDA21} + {263A8A1C-69D0-4C3F-B33E-8F0831C146EB} = {DD9BE9E7-F6BF-4869-BCD2-82F5072BDA21} {47CC8F7A-681D-42B9-AE04-78453782C1B6} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E} {F595CB9F-B117-4D62-A1AE-48599927DB36} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E} {5CF403B2-47C9-4E4E-8856-0294BDD64884} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E} @@ -805,6 +819,9 @@ Global {5F43141B-6C63-4547-B9D6-D69EC3D7CA7E} = {9E72FEB9-A626-4312-892B-CDD043879758} {A66D48C9-F141-4111-9169-CEB64AFFF61D} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E} {524276E1-053D-4191-ABF7-4CDA01BFFBC3} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E} + {43083268-74DE-4C68-824A-FB0CEC77358D} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E} + {DD9BE9E7-F6BF-4869-BCD2-82F5072BDA21} = {C5CAD011-DF84-4914-939C-0C029DCEF26F} + {BAE74ABC-1096-495F-A624-BEBFBC1896F2} = {DD9BE9E7-F6BF-4869-BCD2-82F5072BDA21} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {C95FDF91-16F2-4A8B-A4BE-0E62D1B66718} diff --git a/aspnet-core/database/ApiGateway-Init-SqlServer.sql b/aspnet-core/database/ApiGateway-Init-SqlServer.sql index 2948fa0a7..07fb68143 100644 --- a/aspnet-core/database/ApiGateway-Init-SqlServer.sql +++ b/aspnet-core/database/ApiGateway-Init-SqlServer.sql @@ -11,7 +11,7 @@ Target Server Version : 12000000 File Encoding : 65001 - Date: 23/10/2020 19:14:11 + Date: 31/10/2020 11:29:14 */ @@ -120,7 +120,7 @@ GO BEGIN TRANSACTION GO -INSERT INTO [apigateway].[appapigatewayauthoptions] VALUES (N'3', N'1261299170387169280', NULL, N''), (N'4', N'1261585859064872960', NULL, N''), (N'5', N'1261586605810368512', NULL, N''), (N'6', N'1261587558609436672', NULL, N''), (N'7', N'1261588213298348032', NULL, N''), (N'8', N'1261588367619375104', NULL, N''), (N'9', N'1261588628450557952', NULL, N''), (N'10', N'1261588881564221440', NULL, N''), (N'11', N'1261588983053795328', NULL, N''), (N'12', N'1261589139039961088', NULL, N''), (N'13', N'1261589197483393024', NULL, N''), (N'14', N'1261589278857084928', NULL, N''), (N'15', N'1261589420356124672', NULL, N''), (N'16', N'1261589960393736192', NULL, N''), (N'17', N'1261606600242085888', NULL, N''), (N'18', N'1261606689601732608', NULL, N''), (N'21', N'1262220447629058048', NULL, N''), (N'22', N'1262230734939758592', NULL, N''), (N'23', N'1262296916350869504', NULL, N''), (N'24', N'1262632376348594176', N'', N''), (N'25', N'1262632791869902848', N'', N''), (N'28', N'1262660336921235456', N'', N''), (N'29', N'1262660528277966848', N'', N''), (N'30', N'1262660706875625472', N'', N''), (N'31', N'1262660966393991168', N'', N''), (N'32', N'1262661109474283520', N'', N''), (N'33', N'1262663888804663296', N'', N''), (N'34', N'1262664024096133120', N'', N''), (N'35', N'1262664186252120064', N'', N''), (N'36', N'1262664357044178944', N'', N''), (N'37', N'1262664632928718848', N'', N''), (N'38', N'1262664751409418240', N'', N''), (N'39', N'1262664871274237952', N'', N''), (N'40', N'1262665026111164416', N'', N''), (N'41', N'1262665159905267712', N'', N''), (N'42', N'1262665329829105664', N'', N''), (N'43', N'1262665456471920640', N'', N''), (N'44', N'1262665628165754880', N'', N''), (N'45', N'1262666172682883072', N'', N''), (N'47', N'1262723402331885568', N'', N''), (N'48', N'1262935771746734080', N'', N''), (N'49', N'1262935906522304512', N'', N''), (N'52', N'1263074419073593344', N'', N''), (N'53', N'1263075249394790400', N'', N''), (N'54', N'1263075593499684864', N'', N''), (N'56', N'1263101898440146944', N'', N''), (N'57', N'1263303878648569856', N'', N''), (N'58', N'1263304204797648896', N'', N''), (N'59', N'1263304872891555840', N'', N''), (N'60', N'1263305106250047488', N'', N''), (N'61', N'1263305244594970624', N'', N''), (N'62', N'1263305430536855552', N'', N''), (N'63', N'1263639172959174656', N'', N''), (N'64', N'1264799968944640000', N'', N''), (N'65', N'1264800070161584128', N'', N''), (N'66', N'1267360794414161920', N'', N''), (N'67', N'1267383367629807616', N'', N''), (N'68', N'1267817055527632896', N'', N''), (N'69', N'1267817221286526976', N'', N''), (N'70', N'1268893687085518848', N'', N''), (N'94', N'1288657613998579712', N'', N''), (N'95', N'1288657941770854400', N'', N''), (N'96', N'1288658134067109888', N'', N''), (N'97', N'1288658305156964352', N'', N''), (N'98', N'1288658491216289792', N'', N''), (N'99', N'1288658638302142464', N'', N''), (N'100', N'1288658791784308736', N'', N''), (N'101', N'1290849478956199936', N'', N''), (N'102', N'1290849628051124224', N'', N''), (N'103', N'1290849798553776128', N'', N''), (N'105', N'1291259822512693248', N'', N''), (N'106', N'1292620505149145088', N'', N''), (N'107', N'1292620665505775616', N'', N''), (N'108', N'1292620843398791168', N'', N''), (N'109', N'1292621027574874112', N'', N''), (N'110', N'1292621363161137152', N'', N''), (N'111', N'1292621494837116928', N'', N''), (N'112', N'1292621629260365824', N'', N''), (N'113', N'1292622526073864192', N'', N''), (N'114', N'1293470838745821184', N'', N''), (N'115', N'1293471661785706496', N'', N''), (N'116', N'1293472678392721408', N'', N''), (N'117', N'1293472857510473728', N'', N''), (N'118', N'1299273336009359360', N'', N''), (N'119', N'1299273436282585088', N'', N''), (N'120', N'1299273618470567936', N'', N''), (N'121', N'1299273770182737920', N'', N''), (N'122', N'1299273978023084032', N'', N''), (N'123', N'1299274123225694208', N'', N''), (N'124', N'1299274222299348992', N'', N''), (N'125', N'1304238876758495232', N'', N''), (N'126', N'1304678610343383040', N'', N''), (N'127', N'1304679169305694208', N'', N''), (N'128', N'1310460417141817344', N'', N''), (N'129', N'1310502391475519488', N'', N''), (N'130', N'1310515546943569920', N'', N''), (N'131', N'1310515735292985344', N'', N''), (N'132', N'1316628769783480320', N'', N''), (N'133', N'1316628940663619584', N'', N''), (N'134', N'1316629112428756992', N'', N''), (N'135', N'1316652047017246720', N'', N''), (N'136', N'1316913899996737536', N'', N''), (N'137', N'1319200951383199744', N'', N''), (N'138', N'1319221929807024128', N'', N''), (N'139', N'1319554431134306304', N'', N''), (N'140', N'1319554550458060800', N'', N''), (N'141', N'1319554948434595840', N'', N''), (N'142', N'1319555067183730688', N'', N''), (N'143', N'1319555230765780992', N'', N''), (N'144', N'1319555333790470144', N'', N'') +INSERT INTO [apigateway].[appapigatewayauthoptions] VALUES (N'3', N'1261299170387169280', NULL, N''), (N'4', N'1261585859064872960', NULL, N''), (N'5', N'1261586605810368512', NULL, N''), (N'6', N'1261587558609436672', NULL, N''), (N'7', N'1261588213298348032', NULL, N''), (N'8', N'1261588367619375104', NULL, N''), (N'9', N'1261588628450557952', NULL, N''), (N'10', N'1261588881564221440', NULL, N''), (N'11', N'1261588983053795328', NULL, N''), (N'12', N'1261589139039961088', NULL, N''), (N'13', N'1261589197483393024', NULL, N''), (N'14', N'1261589278857084928', NULL, N''), (N'15', N'1261589420356124672', NULL, N''), (N'16', N'1261589960393736192', NULL, N''), (N'17', N'1261606600242085888', NULL, N''), (N'18', N'1261606689601732608', NULL, N''), (N'21', N'1262220447629058048', NULL, N''), (N'22', N'1262230734939758592', NULL, N''), (N'23', N'1262296916350869504', NULL, N''), (N'24', N'1262632376348594176', N'', N''), (N'25', N'1262632791869902848', N'', N''), (N'28', N'1262660336921235456', N'', N''), (N'29', N'1262660528277966848', N'', N''), (N'30', N'1262660706875625472', N'', N''), (N'31', N'1262660966393991168', N'', N''), (N'32', N'1262661109474283520', N'', N''), (N'33', N'1262663888804663296', N'', N''), (N'34', N'1262664024096133120', N'', N''), (N'35', N'1262664186252120064', N'', N''), (N'36', N'1262664357044178944', N'', N''), (N'37', N'1262664632928718848', N'', N''), (N'38', N'1262664751409418240', N'', N''), (N'39', N'1262664871274237952', N'', N''), (N'40', N'1262665026111164416', N'', N''), (N'41', N'1262665159905267712', N'', N''), (N'42', N'1262665329829105664', N'', N''), (N'43', N'1262665456471920640', N'', N''), (N'44', N'1262665628165754880', N'', N''), (N'45', N'1262666172682883072', N'', N''), (N'47', N'1262723402331885568', N'', N''), (N'48', N'1262935771746734080', N'', N''), (N'49', N'1262935906522304512', N'', N''), (N'52', N'1263074419073593344', N'', N''), (N'53', N'1263075249394790400', N'', N''), (N'54', N'1263075593499684864', N'', N''), (N'56', N'1263101898440146944', N'', N''), (N'57', N'1263303878648569856', N'', N''), (N'58', N'1263304204797648896', N'', N''), (N'59', N'1263304872891555840', N'', N''), (N'60', N'1263305106250047488', N'', N''), (N'61', N'1263305244594970624', N'', N''), (N'62', N'1263305430536855552', N'', N''), (N'63', N'1263639172959174656', N'', N''), (N'64', N'1264799968944640000', N'', N''), (N'65', N'1264800070161584128', N'', N''), (N'66', N'1267360794414161920', N'', N''), (N'67', N'1267383367629807616', N'', N''), (N'68', N'1267817055527632896', N'', N''), (N'69', N'1267817221286526976', N'', N''), (N'70', N'1268893687085518848', N'', N''), (N'94', N'1288657613998579712', N'', N''), (N'95', N'1288657941770854400', N'', N''), (N'96', N'1288658134067109888', N'', N''), (N'97', N'1288658305156964352', N'', N''), (N'98', N'1288658491216289792', N'', N''), (N'99', N'1288658638302142464', N'', N''), (N'100', N'1288658791784308736', N'', N''), (N'101', N'1290849478956199936', N'', N''), (N'102', N'1290849628051124224', N'', N''), (N'103', N'1290849798553776128', N'', N''), (N'105', N'1291259822512693248', N'', N''), (N'106', N'1292620505149145088', N'', N''), (N'107', N'1292620665505775616', N'', N''), (N'108', N'1292620843398791168', N'', N''), (N'109', N'1292621027574874112', N'', N''), (N'110', N'1292621363161137152', N'', N''), (N'111', N'1292621494837116928', N'', N''), (N'112', N'1292621629260365824', N'', N''), (N'113', N'1292622526073864192', N'', N''), (N'114', N'1293470838745821184', N'', N''), (N'115', N'1293471661785706496', N'', N''), (N'116', N'1293472678392721408', N'', N''), (N'117', N'1293472857510473728', N'', N''), (N'118', N'1299273336009359360', N'', N''), (N'119', N'1299273436282585088', N'', N''), (N'120', N'1299273618470567936', N'', N''), (N'121', N'1299273770182737920', N'', N''), (N'122', N'1299273978023084032', N'', N''), (N'123', N'1299274123225694208', N'', N''), (N'124', N'1299274222299348992', N'', N''), (N'125', N'1304238876758495232', N'', N''), (N'126', N'1304678610343383040', N'', N''), (N'127', N'1304679169305694208', N'', N''), (N'128', N'1310460417141817344', N'', N''), (N'129', N'1310502391475519488', N'', N''), (N'130', N'1310515546943569920', N'', N''), (N'131', N'1310515735292985344', N'', N''), (N'132', N'1316628769783480320', N'', N''), (N'133', N'1316628940663619584', N'', N''), (N'134', N'1316629112428756992', N'', N''), (N'135', N'1316652047017246720', N'', N''), (N'136', N'1316913899996737536', N'', N''), (N'137', N'1319200951383199744', N'', N''), (N'138', N'1319221929807024128', N'', N''), (N'139', N'1319554431134306304', N'', N''), (N'140', N'1319554550458060800', N'', N''), (N'141', N'1319554948434595840', N'', N''), (N'142', N'1319555067183730688', N'', N''), (N'143', N'1319555230765780992', N'', N''), (N'144', N'1319555333790470144', N'', N''), (N'145', N'1321001932510203904', N'', N''), (N'146', N'1321002059803136000', N'', N''), (N'147', N'1321002256440496128', N'', N''), (N'148', N'1321002350686507008', N'', N''), (N'149', N'1322190027988525056', N'', N'') GO COMMIT @@ -151,7 +151,7 @@ GO BEGIN TRANSACTION GO -INSERT INTO [apigateway].[appapigatewaybalanceroptions] VALUES (N'1', N'1260841964962947072', NULL, N'LeastConnection', NULL, NULL), (N'4', NULL, N'1261299170387169280', N'LeastConnection', NULL, N'60000'), (N'5', NULL, N'1261585859064872960', NULL, NULL, NULL), (N'6', NULL, N'1261586605810368512', NULL, NULL, NULL), (N'7', NULL, N'1261587558609436672', NULL, NULL, NULL), (N'8', NULL, N'1261588213298348032', NULL, NULL, NULL), (N'9', NULL, N'1261588367619375104', NULL, NULL, NULL), (N'10', NULL, N'1261588628450557952', NULL, NULL, NULL), (N'11', NULL, N'1261588881564221440', NULL, NULL, NULL), (N'12', NULL, N'1261588983053795328', NULL, NULL, NULL), (N'13', NULL, N'1261589139039961088', NULL, NULL, NULL), (N'14', NULL, N'1261589197483393024', NULL, NULL, NULL), (N'15', NULL, N'1261589278857084928', NULL, NULL, NULL), (N'16', NULL, N'1261589420356124672', NULL, NULL, NULL), (N'17', NULL, N'1261589960393736192', N'LeastConnection', NULL, N'60000'), (N'18', NULL, N'1261606600242085888', NULL, NULL, NULL), (N'19', NULL, N'1261606689601732608', NULL, NULL, NULL), (N'22', NULL, N'1262220447629058048', NULL, NULL, NULL), (N'23', NULL, N'1262230734939758592', NULL, NULL, NULL), (N'24', NULL, N'1262296916350869504', NULL, NULL, NULL), (N'25', NULL, N'1262632376348594176', N'', N'', N'0'), (N'26', NULL, N'1262632791869902848', N'', N'', N'0'), (N'29', NULL, N'1262660336921235456', N'', N'', N'0'), (N'30', NULL, N'1262660528277966848', N'', N'', N'0'), (N'31', NULL, N'1262660706875625472', N'', N'', N'0'), (N'32', NULL, N'1262660966393991168', N'', N'', N'0'), (N'33', NULL, N'1262661109474283520', N'', N'', N'0'), (N'34', NULL, N'1262663888804663296', N'', N'', N'0'), (N'35', NULL, N'1262664024096133120', N'', N'', N'0'), (N'36', NULL, N'1262664186252120064', N'', N'', N'0'), (N'37', NULL, N'1262664357044178944', N'', N'', N'0'), (N'38', NULL, N'1262664632928718848', N'', N'', N'0'), (N'39', NULL, N'1262664751409418240', N'', N'', N'0'), (N'40', NULL, N'1262664871274237952', N'', N'', N'0'), (N'41', NULL, N'1262665026111164416', N'', N'', N'0'), (N'42', NULL, N'1262665159905267712', N'', N'', N'0'), (N'43', NULL, N'1262665329829105664', N'', N'', N'0'), (N'44', NULL, N'1262665456471920640', N'', N'', N'0'), (N'45', NULL, N'1262665628165754880', N'', N'', N'0'), (N'46', NULL, N'1262666172682883072', N'', N'', N'0'), (N'48', NULL, N'1262723402331885568', N'', N'', N'0'), (N'49', NULL, N'1262935771746734080', N'', N'', N'0'), (N'50', NULL, N'1262935906522304512', N'', N'', N'0'), (N'53', NULL, N'1263074419073593344', N'', N'', N'0'), (N'54', NULL, N'1263075249394790400', N'', N'', N'0'), (N'55', NULL, N'1263075593499684864', N'', N'', N'0'), (N'57', NULL, N'1263101898440146944', N'', N'', N'0'), (N'58', NULL, N'1263303878648569856', N'', N'', N'0'), (N'59', NULL, N'1263304204797648896', N'', N'', N'0'), (N'60', NULL, N'1263304872891555840', N'', N'', N'0'), (N'61', NULL, N'1263305106250047488', N'', N'', N'0'), (N'62', NULL, N'1263305244594970624', N'', N'', N'0'), (N'63', NULL, N'1263305430536855552', N'', N'', N'0'), (N'64', NULL, N'1263639172959174656', N'', N'', N'0'), (N'65', NULL, N'1264799968944640000', N'', N'', N'0'), (N'66', NULL, N'1264800070161584128', N'', N'', N'0'), (N'68', NULL, N'1267360794414161920', N'', N'', N'0'), (N'69', NULL, N'1267383367629807616', N'', N'', N'0'), (N'70', NULL, N'1267817055527632896', N'', N'', N'0'), (N'71', NULL, N'1267817221286526976', N'', N'', N'0'), (N'72', NULL, N'1268893687085518848', N'', N'', N'0'), (N'97', NULL, N'1288657613998579712', N'LeastConnection', N'', N'60000'), (N'98', NULL, N'1288657941770854400', N'', N'', N'0'), (N'99', NULL, N'1288658134067109888', N'', N'', N'0'), (N'100', NULL, N'1288658305156964352', N'', N'', N'0'), (N'101', NULL, N'1288658491216289792', N'', N'', N'0'), (N'102', NULL, N'1288658638302142464', N'', N'', N'0'), (N'103', NULL, N'1288658791784308736', N'', N'', N'0'), (N'104', NULL, N'1290849478956199936', N'', N'', N'0'), (N'105', NULL, N'1290849628051124224', N'', N'', N'0'), (N'106', NULL, N'1290849798553776128', N'', N'', N'0'), (N'108', NULL, N'1291259822512693248', N'', N'', N'0'), (N'109', NULL, N'1292620505149145088', N'', N'', N'0'), (N'110', NULL, N'1292620665505775616', N'', N'', N'0'), (N'111', NULL, N'1292620843398791168', N'', N'', N'0'), (N'112', NULL, N'1292621027574874112', N'', N'', N'0'), (N'113', NULL, N'1292621363161137152', N'', N'', N'0'), (N'114', NULL, N'1292621494837116928', N'', N'', N'0'), (N'115', NULL, N'1292621629260365824', N'', N'', N'0'), (N'116', NULL, N'1292622526073864192', N'', N'', N'0'), (N'117', NULL, N'1293470838745821184', N'', N'', N'0'), (N'118', NULL, N'1293471661785706496', N'', N'', N'0'), (N'119', NULL, N'1293472678392721408', N'', N'', N'0'), (N'120', NULL, N'1293472857510473728', N'', N'', N'0'), (N'121', NULL, N'1299273336009359360', N'', N'', N'0'), (N'122', NULL, N'1299273436282585088', N'', N'', N'0'), (N'123', NULL, N'1299273618470567936', N'', N'', N'0'), (N'124', NULL, N'1299273770182737920', N'', N'', N'0'), (N'125', NULL, N'1299273978023084032', N'', N'', N'0'), (N'126', NULL, N'1299274123225694208', N'', N'', N'0'), (N'127', NULL, N'1299274222299348992', N'', N'', N'0'), (N'128', NULL, N'1304238876758495232', N'', N'', N'0'), (N'129', NULL, N'1304678610343383040', N'', N'', N'0'), (N'130', NULL, N'1304679169305694208', N'', N'', N'0'), (N'131', NULL, N'1310460417141817344', N'', N'', N'0'), (N'132', NULL, N'1310502391475519488', N'', N'', N'0'), (N'133', NULL, N'1310515546943569920', N'', N'', N'0'), (N'134', NULL, N'1310515735292985344', N'', N'', N'0'), (N'135', NULL, N'1316628769783480320', N'', N'', N'0'), (N'136', NULL, N'1316628940663619584', N'', N'', N'0'), (N'137', NULL, N'1316629112428756992', N'', N'', N'0'), (N'138', NULL, N'1316652047017246720', N'', N'', N'0'), (N'139', NULL, N'1316913899996737536', N'', N'', N'0'), (N'140', NULL, N'1319200951383199744', N'', N'', N'0'), (N'141', NULL, N'1319221929807024128', N'', N'', N'0'), (N'142', NULL, N'1319554431134306304', N'', N'', N'0'), (N'143', NULL, N'1319554550458060800', N'', N'', N'0'), (N'144', NULL, N'1319554948434595840', N'', N'', N'0'), (N'145', NULL, N'1319555067183730688', N'', N'', N'0'), (N'146', NULL, N'1319555230765780992', N'', N'', N'0'), (N'147', NULL, N'1319555333790470144', N'', N'', N'0') +INSERT INTO [apigateway].[appapigatewaybalanceroptions] VALUES (N'1', N'1260841964962947072', NULL, N'LeastConnection', NULL, NULL), (N'4', NULL, N'1261299170387169280', N'LeastConnection', NULL, N'60000'), (N'5', NULL, N'1261585859064872960', NULL, NULL, NULL), (N'6', NULL, N'1261586605810368512', NULL, NULL, NULL), (N'7', NULL, N'1261587558609436672', NULL, NULL, NULL), (N'8', NULL, N'1261588213298348032', NULL, NULL, NULL), (N'9', NULL, N'1261588367619375104', NULL, NULL, NULL), (N'10', NULL, N'1261588628450557952', NULL, NULL, NULL), (N'11', NULL, N'1261588881564221440', NULL, NULL, NULL), (N'12', NULL, N'1261588983053795328', NULL, NULL, NULL), (N'13', NULL, N'1261589139039961088', NULL, NULL, NULL), (N'14', NULL, N'1261589197483393024', NULL, NULL, NULL), (N'15', NULL, N'1261589278857084928', NULL, NULL, NULL), (N'16', NULL, N'1261589420356124672', NULL, NULL, NULL), (N'17', NULL, N'1261589960393736192', N'LeastConnection', NULL, N'60000'), (N'18', NULL, N'1261606600242085888', NULL, NULL, NULL), (N'19', NULL, N'1261606689601732608', NULL, NULL, NULL), (N'22', NULL, N'1262220447629058048', NULL, NULL, NULL), (N'23', NULL, N'1262230734939758592', NULL, NULL, NULL), (N'24', NULL, N'1262296916350869504', NULL, NULL, NULL), (N'25', NULL, N'1262632376348594176', N'', N'', N'0'), (N'26', NULL, N'1262632791869902848', N'', N'', N'0'), (N'29', NULL, N'1262660336921235456', N'', N'', N'0'), (N'30', NULL, N'1262660528277966848', N'', N'', N'0'), (N'31', NULL, N'1262660706875625472', N'', N'', N'0'), (N'32', NULL, N'1262660966393991168', N'', N'', N'0'), (N'33', NULL, N'1262661109474283520', N'', N'', N'0'), (N'34', NULL, N'1262663888804663296', N'', N'', N'0'), (N'35', NULL, N'1262664024096133120', N'', N'', N'0'), (N'36', NULL, N'1262664186252120064', N'', N'', N'0'), (N'37', NULL, N'1262664357044178944', N'', N'', N'0'), (N'38', NULL, N'1262664632928718848', N'', N'', N'0'), (N'39', NULL, N'1262664751409418240', N'', N'', N'0'), (N'40', NULL, N'1262664871274237952', N'', N'', N'0'), (N'41', NULL, N'1262665026111164416', N'', N'', N'0'), (N'42', NULL, N'1262665159905267712', N'', N'', N'0'), (N'43', NULL, N'1262665329829105664', N'', N'', N'0'), (N'44', NULL, N'1262665456471920640', N'', N'', N'0'), (N'45', NULL, N'1262665628165754880', N'', N'', N'0'), (N'46', NULL, N'1262666172682883072', N'', N'', N'0'), (N'48', NULL, N'1262723402331885568', N'', N'', N'0'), (N'49', NULL, N'1262935771746734080', N'', N'', N'0'), (N'50', NULL, N'1262935906522304512', N'', N'', N'0'), (N'53', NULL, N'1263074419073593344', N'', N'', N'0'), (N'54', NULL, N'1263075249394790400', N'', N'', N'0'), (N'55', NULL, N'1263075593499684864', N'', N'', N'0'), (N'57', NULL, N'1263101898440146944', N'', N'', N'0'), (N'58', NULL, N'1263303878648569856', N'', N'', N'0'), (N'59', NULL, N'1263304204797648896', N'', N'', N'0'), (N'60', NULL, N'1263304872891555840', N'', N'', N'0'), (N'61', NULL, N'1263305106250047488', N'', N'', N'0'), (N'62', NULL, N'1263305244594970624', N'', N'', N'0'), (N'63', NULL, N'1263305430536855552', N'', N'', N'0'), (N'64', NULL, N'1263639172959174656', N'', N'', N'0'), (N'65', NULL, N'1264799968944640000', N'', N'', N'0'), (N'66', NULL, N'1264800070161584128', N'', N'', N'0'), (N'68', NULL, N'1267360794414161920', N'', N'', N'0'), (N'69', NULL, N'1267383367629807616', N'', N'', N'0'), (N'70', NULL, N'1267817055527632896', N'', N'', N'0'), (N'71', NULL, N'1267817221286526976', N'', N'', N'0'), (N'72', NULL, N'1268893687085518848', N'', N'', N'0'), (N'97', NULL, N'1288657613998579712', N'LeastConnection', N'', N'60000'), (N'98', NULL, N'1288657941770854400', N'', N'', N'0'), (N'99', NULL, N'1288658134067109888', N'', N'', N'0'), (N'100', NULL, N'1288658305156964352', N'', N'', N'0'), (N'101', NULL, N'1288658491216289792', N'', N'', N'0'), (N'102', NULL, N'1288658638302142464', N'', N'', N'0'), (N'103', NULL, N'1288658791784308736', N'', N'', N'0'), (N'104', NULL, N'1290849478956199936', N'', N'', N'0'), (N'105', NULL, N'1290849628051124224', N'', N'', N'0'), (N'106', NULL, N'1290849798553776128', N'', N'', N'0'), (N'108', NULL, N'1291259822512693248', N'', N'', N'0'), (N'109', NULL, N'1292620505149145088', N'', N'', N'0'), (N'110', NULL, N'1292620665505775616', N'', N'', N'0'), (N'111', NULL, N'1292620843398791168', N'', N'', N'0'), (N'112', NULL, N'1292621027574874112', N'', N'', N'0'), (N'113', NULL, N'1292621363161137152', N'', N'', N'0'), (N'114', NULL, N'1292621494837116928', N'', N'', N'0'), (N'115', NULL, N'1292621629260365824', N'', N'', N'0'), (N'116', NULL, N'1292622526073864192', N'', N'', N'0'), (N'117', NULL, N'1293470838745821184', N'', N'', N'0'), (N'118', NULL, N'1293471661785706496', N'', N'', N'0'), (N'119', NULL, N'1293472678392721408', N'', N'', N'0'), (N'120', NULL, N'1293472857510473728', N'', N'', N'0'), (N'121', NULL, N'1299273336009359360', N'', N'', N'0'), (N'122', NULL, N'1299273436282585088', N'', N'', N'0'), (N'123', NULL, N'1299273618470567936', N'', N'', N'0'), (N'124', NULL, N'1299273770182737920', N'', N'', N'0'), (N'125', NULL, N'1299273978023084032', N'', N'', N'0'), (N'126', NULL, N'1299274123225694208', N'', N'', N'0'), (N'127', NULL, N'1299274222299348992', N'', N'', N'0'), (N'128', NULL, N'1304238876758495232', N'', N'', N'0'), (N'129', NULL, N'1304678610343383040', N'', N'', N'0'), (N'130', NULL, N'1304679169305694208', N'', N'', N'0'), (N'131', NULL, N'1310460417141817344', N'', N'', N'0'), (N'132', NULL, N'1310502391475519488', N'', N'', N'0'), (N'133', NULL, N'1310515546943569920', N'', N'', N'0'), (N'134', NULL, N'1310515735292985344', N'', N'', N'0'), (N'135', NULL, N'1316628769783480320', N'', N'', N'0'), (N'136', NULL, N'1316628940663619584', N'', N'', N'0'), (N'137', NULL, N'1316629112428756992', N'', N'', N'0'), (N'138', NULL, N'1316652047017246720', N'', N'', N'0'), (N'139', NULL, N'1316913899996737536', N'', N'', N'0'), (N'140', NULL, N'1319200951383199744', N'', N'', N'0'), (N'141', NULL, N'1319221929807024128', N'', N'', N'0'), (N'142', NULL, N'1319554431134306304', N'', N'', N'0'), (N'143', NULL, N'1319554550458060800', N'', N'', N'0'), (N'144', NULL, N'1319554948434595840', N'', N'', N'0'), (N'145', NULL, N'1319555067183730688', N'', N'', N'0'), (N'146', NULL, N'1319555230765780992', N'', N'', N'0'), (N'147', NULL, N'1319555333790470144', N'', N'', N'0'), (N'148', NULL, N'1321001932510203904', N'', N'', N'0'), (N'149', NULL, N'1321002059803136000', N'', N'', N'0'), (N'150', NULL, N'1321002256440496128', N'', N'', N'0'), (N'151', NULL, N'1321002350686507008', N'', N'', N'0'), (N'152', NULL, N'1322190027988525056', N'', N'', N'0') GO COMMIT @@ -180,7 +180,7 @@ GO BEGIN TRANSACTION GO -INSERT INTO [apigateway].[appapigatewaycacheoptions] VALUES (N'3', N'1261299170387169280', NULL, NULL), (N'4', N'1261585859064872960', NULL, NULL), (N'5', N'1261586605810368512', NULL, NULL), (N'6', N'1261587558609436672', NULL, NULL), (N'7', N'1261588213298348032', NULL, NULL), (N'8', N'1261588367619375104', NULL, NULL), (N'9', N'1261588628450557952', NULL, NULL), (N'10', N'1261588881564221440', NULL, NULL), (N'11', N'1261588983053795328', NULL, NULL), (N'12', N'1261589139039961088', NULL, NULL), (N'13', N'1261589197483393024', NULL, NULL), (N'14', N'1261589278857084928', NULL, NULL), (N'15', N'1261589420356124672', NULL, NULL), (N'16', N'1261589960393736192', NULL, NULL), (N'17', N'1261606600242085888', NULL, NULL), (N'18', N'1261606689601732608', NULL, NULL), (N'21', N'1262220447629058048', NULL, NULL), (N'22', N'1262230734939758592', NULL, NULL), (N'23', N'1262296916350869504', NULL, NULL), (N'24', N'1262632376348594176', NULL, NULL), (N'25', N'1262632791869902848', NULL, NULL), (N'28', N'1262660336921235456', N'0', N''), (N'29', N'1262660528277966848', N'0', N''), (N'30', N'1262660706875625472', N'0', N''), (N'31', N'1262660966393991168', N'0', N''), (N'32', N'1262661109474283520', N'0', N''), (N'33', N'1262663888804663296', N'0', N''), (N'34', N'1262664024096133120', N'0', N''), (N'35', N'1262664186252120064', N'0', N''), (N'36', N'1262664357044178944', N'0', N''), (N'37', N'1262664632928718848', N'0', N''), (N'38', N'1262664751409418240', N'0', N''), (N'39', N'1262664871274237952', N'0', N''), (N'40', N'1262665026111164416', N'0', N''), (N'41', N'1262665159905267712', N'0', N''), (N'42', N'1262665329829105664', N'0', N''), (N'43', N'1262665456471920640', N'0', N''), (N'44', N'1262665628165754880', NULL, NULL), (N'45', N'1262666172682883072', NULL, NULL), (N'47', N'1262723402331885568', NULL, NULL), (N'48', N'1262935771746734080', NULL, NULL), (N'49', N'1262935906522304512', NULL, NULL), (N'52', N'1263074419073593344', NULL, NULL), (N'53', N'1263075249394790400', N'0', N''), (N'54', N'1263075593499684864', N'0', N''), (N'56', N'1263101898440146944', NULL, NULL), (N'57', N'1263303878648569856', NULL, NULL), (N'58', N'1263304204797648896', NULL, NULL), (N'59', N'1263304872891555840', NULL, NULL), (N'60', N'1263305106250047488', NULL, NULL), (N'61', N'1263305244594970624', NULL, NULL), (N'62', N'1263305430536855552', NULL, NULL), (N'63', N'1263639172959174656', NULL, NULL), (N'64', N'1264799968944640000', NULL, NULL), (N'65', N'1264800070161584128', NULL, NULL), (N'66', N'1267360794414161920', NULL, NULL), (N'67', N'1267383367629807616', NULL, NULL), (N'68', N'1267817055527632896', NULL, NULL), (N'69', N'1267817221286526976', NULL, NULL), (N'70', N'1268893687085518848', NULL, NULL), (N'94', N'1288657613998579712', NULL, NULL), (N'95', N'1288657941770854400', N'0', N''), (N'96', N'1288658134067109888', N'0', N''), (N'97', N'1288658305156964352', N'0', N''), (N'98', N'1288658491216289792', N'0', N''), (N'99', N'1288658638302142464', NULL, NULL), (N'100', N'1288658791784308736', NULL, NULL), (N'101', N'1290849478956199936', NULL, NULL), (N'102', N'1290849628051124224', NULL, NULL), (N'103', N'1290849798553776128', NULL, NULL), (N'105', N'1291259822512693248', N'0', N''), (N'106', N'1292620505149145088', N'0', N''), (N'107', N'1292620665505775616', N'0', N''), (N'108', N'1292620843398791168', NULL, NULL), (N'109', N'1292621027574874112', N'0', N''), (N'110', N'1292621363161137152', N'0', N''), (N'111', N'1292621494837116928', N'0', N''), (N'112', N'1292621629260365824', N'0', N''), (N'113', N'1292622526073864192', N'0', N''), (N'114', N'1293470838745821184', N'0', N''), (N'115', N'1293471661785706496', N'0', N''), (N'116', N'1293472678392721408', N'0', N''), (N'117', N'1293472857510473728', N'0', N''), (N'118', N'1299273336009359360', NULL, NULL), (N'119', N'1299273436282585088', NULL, NULL), (N'120', N'1299273618470567936', NULL, NULL), (N'121', N'1299273770182737920', NULL, NULL), (N'122', N'1299273978023084032', NULL, NULL), (N'123', N'1299274123225694208', NULL, NULL), (N'124', N'1299274222299348992', NULL, NULL), (N'125', N'1304238876758495232', N'0', N''), (N'126', N'1304678610343383040', NULL, NULL), (N'127', N'1304679169305694208', NULL, NULL), (N'128', N'1310460417141817344', N'0', N''), (N'129', N'1310502391475519488', N'0', N''), (N'130', N'1310515546943569920', NULL, NULL), (N'131', N'1310515735292985344', NULL, NULL), (N'132', N'1316628769783480320', N'0', N''), (N'133', N'1316628940663619584', N'0', N''), (N'134', N'1316629112428756992', N'0', N''), (N'135', N'1316652047017246720', N'0', N''), (N'136', N'1316913899996737536', N'0', N''), (N'137', N'1319200951383199744', N'0', N''), (N'138', N'1319221929807024128', N'0', N''), (N'139', N'1319554431134306304', NULL, NULL), (N'140', N'1319554550458060800', NULL, NULL), (N'141', N'1319554948434595840', N'0', N''), (N'142', N'1319555067183730688', N'0', N''), (N'143', N'1319555230765780992', N'0', N''), (N'144', N'1319555333790470144', N'0', N'') +INSERT INTO [apigateway].[appapigatewaycacheoptions] VALUES (N'3', N'1261299170387169280', NULL, NULL), (N'4', N'1261585859064872960', NULL, NULL), (N'5', N'1261586605810368512', NULL, NULL), (N'6', N'1261587558609436672', NULL, NULL), (N'7', N'1261588213298348032', NULL, NULL), (N'8', N'1261588367619375104', NULL, NULL), (N'9', N'1261588628450557952', NULL, NULL), (N'10', N'1261588881564221440', NULL, NULL), (N'11', N'1261588983053795328', NULL, NULL), (N'12', N'1261589139039961088', NULL, NULL), (N'13', N'1261589197483393024', NULL, NULL), (N'14', N'1261589278857084928', NULL, NULL), (N'15', N'1261589420356124672', NULL, NULL), (N'16', N'1261589960393736192', NULL, NULL), (N'17', N'1261606600242085888', NULL, NULL), (N'18', N'1261606689601732608', NULL, NULL), (N'21', N'1262220447629058048', NULL, NULL), (N'22', N'1262230734939758592', NULL, NULL), (N'23', N'1262296916350869504', NULL, NULL), (N'24', N'1262632376348594176', NULL, NULL), (N'25', N'1262632791869902848', NULL, NULL), (N'28', N'1262660336921235456', N'0', N''), (N'29', N'1262660528277966848', N'0', N''), (N'30', N'1262660706875625472', N'0', N''), (N'31', N'1262660966393991168', N'0', N''), (N'32', N'1262661109474283520', N'0', N''), (N'33', N'1262663888804663296', N'0', N''), (N'34', N'1262664024096133120', N'0', N''), (N'35', N'1262664186252120064', N'0', N''), (N'36', N'1262664357044178944', N'0', N''), (N'37', N'1262664632928718848', N'0', N''), (N'38', N'1262664751409418240', N'0', N''), (N'39', N'1262664871274237952', N'0', N''), (N'40', N'1262665026111164416', N'0', N''), (N'41', N'1262665159905267712', N'0', N''), (N'42', N'1262665329829105664', N'0', N''), (N'43', N'1262665456471920640', N'0', N''), (N'44', N'1262665628165754880', NULL, NULL), (N'45', N'1262666172682883072', NULL, NULL), (N'47', N'1262723402331885568', NULL, NULL), (N'48', N'1262935771746734080', NULL, NULL), (N'49', N'1262935906522304512', NULL, NULL), (N'52', N'1263074419073593344', NULL, NULL), (N'53', N'1263075249394790400', N'0', N''), (N'54', N'1263075593499684864', N'0', N''), (N'56', N'1263101898440146944', NULL, NULL), (N'57', N'1263303878648569856', NULL, NULL), (N'58', N'1263304204797648896', NULL, NULL), (N'59', N'1263304872891555840', NULL, NULL), (N'60', N'1263305106250047488', NULL, NULL), (N'61', N'1263305244594970624', NULL, NULL), (N'62', N'1263305430536855552', NULL, NULL), (N'63', N'1263639172959174656', NULL, NULL), (N'64', N'1264799968944640000', NULL, NULL), (N'65', N'1264800070161584128', NULL, NULL), (N'66', N'1267360794414161920', NULL, NULL), (N'67', N'1267383367629807616', NULL, NULL), (N'68', N'1267817055527632896', NULL, NULL), (N'69', N'1267817221286526976', NULL, NULL), (N'70', N'1268893687085518848', NULL, NULL), (N'94', N'1288657613998579712', NULL, NULL), (N'95', N'1288657941770854400', N'0', N''), (N'96', N'1288658134067109888', N'0', N''), (N'97', N'1288658305156964352', N'0', N''), (N'98', N'1288658491216289792', N'0', N''), (N'99', N'1288658638302142464', NULL, NULL), (N'100', N'1288658791784308736', NULL, NULL), (N'101', N'1290849478956199936', NULL, NULL), (N'102', N'1290849628051124224', NULL, NULL), (N'103', N'1290849798553776128', NULL, NULL), (N'105', N'1291259822512693248', N'0', N''), (N'106', N'1292620505149145088', N'0', N''), (N'107', N'1292620665505775616', N'0', N''), (N'108', N'1292620843398791168', NULL, NULL), (N'109', N'1292621027574874112', N'0', N''), (N'110', N'1292621363161137152', N'0', N''), (N'111', N'1292621494837116928', N'0', N''), (N'112', N'1292621629260365824', N'0', N''), (N'113', N'1292622526073864192', N'0', N''), (N'114', N'1293470838745821184', N'0', N''), (N'115', N'1293471661785706496', N'0', N''), (N'116', N'1293472678392721408', N'0', N''), (N'117', N'1293472857510473728', N'0', N''), (N'118', N'1299273336009359360', NULL, NULL), (N'119', N'1299273436282585088', NULL, NULL), (N'120', N'1299273618470567936', NULL, NULL), (N'121', N'1299273770182737920', NULL, NULL), (N'122', N'1299273978023084032', NULL, NULL), (N'123', N'1299274123225694208', NULL, NULL), (N'124', N'1299274222299348992', NULL, NULL), (N'125', N'1304238876758495232', N'0', N''), (N'126', N'1304678610343383040', NULL, NULL), (N'127', N'1304679169305694208', NULL, NULL), (N'128', N'1310460417141817344', N'0', N''), (N'129', N'1310502391475519488', N'0', N''), (N'130', N'1310515546943569920', NULL, NULL), (N'131', N'1310515735292985344', NULL, NULL), (N'132', N'1316628769783480320', N'0', N''), (N'133', N'1316628940663619584', N'0', N''), (N'134', N'1316629112428756992', N'0', N''), (N'135', N'1316652047017246720', N'0', N''), (N'136', N'1316913899996737536', N'0', N''), (N'137', N'1319200951383199744', N'0', N''), (N'138', N'1319221929807024128', N'0', N''), (N'139', N'1319554431134306304', NULL, NULL), (N'140', N'1319554550458060800', NULL, NULL), (N'141', N'1319554948434595840', N'0', N''), (N'142', N'1319555067183730688', N'0', N''), (N'143', N'1319555230765780992', N'0', N''), (N'144', N'1319555333790470144', N'0', N''), (N'145', N'1321001932510203904', N'0', N''), (N'146', N'1321002059803136000', N'0', N''), (N'147', N'1321002256440496128', N'0', N''), (N'148', N'1321002350686507008', N'0', N''), (N'149', N'1322190027988525056', N'0', N'') GO COMMIT @@ -335,7 +335,7 @@ GO BEGIN TRANSACTION GO -INSERT INTO [apigateway].[appapigatewayhttpoptions] VALUES (N'1', N'1260841964962947072', NULL, NULL, N'0', N'0', N'1', N'0'), (N'4', NULL, N'1261299170387169280', N'1000', N'1', N'0', N'1', N'0'), (N'5', NULL, N'1261585859064872960', NULL, N'0', N'0', N'1', N'0'), (N'6', NULL, N'1261586605810368512', NULL, N'0', N'0', N'0', N'0'), (N'7', NULL, N'1261587558609436672', NULL, N'0', N'0', N'0', N'0'), (N'8', NULL, N'1261588213298348032', NULL, N'0', N'0', N'0', N'0'), (N'9', NULL, N'1261588367619375104', NULL, N'0', N'0', N'0', N'0'), (N'10', NULL, N'1261588628450557952', NULL, N'0', N'0', N'0', N'0'), (N'11', NULL, N'1261588881564221440', NULL, N'0', N'0', N'0', N'0'), (N'12', NULL, N'1261588983053795328', NULL, N'0', N'0', N'0', N'0'), (N'13', NULL, N'1261589139039961088', NULL, N'0', N'0', N'0', N'0'), (N'14', NULL, N'1261589197483393024', NULL, N'0', N'0', N'0', N'0'), (N'15', NULL, N'1261589278857084928', NULL, N'0', N'0', N'0', N'0'), (N'16', NULL, N'1261589420356124672', NULL, N'0', N'0', N'0', N'0'), (N'17', NULL, N'1261589960393736192', N'1000', N'1', N'0', N'1', N'0'), (N'18', NULL, N'1261606600242085888', NULL, N'0', N'0', N'0', N'0'), (N'19', NULL, N'1261606689601732608', NULL, N'0', N'0', N'0', N'0'), (N'22', NULL, N'1262220447629058048', NULL, N'0', N'0', N'1', N'0'), (N'23', NULL, N'1262230734939758592', NULL, N'0', N'0', N'1', N'0'), (N'24', NULL, N'1262296916350869504', NULL, N'0', N'0', N'1', N'0'), (N'25', NULL, N'1262632376348594176', N'0', N'0', N'0', N'0', N'0'), (N'26', NULL, N'1262632791869902848', N'0', N'0', N'0', N'0', N'0'), (N'29', NULL, N'1262660336921235456', N'0', N'0', N'0', N'0', N'0'), (N'30', NULL, N'1262660528277966848', N'0', N'0', N'0', N'0', N'0'), (N'31', NULL, N'1262660706875625472', N'0', N'0', N'0', N'0', N'0'), (N'32', NULL, N'1262660966393991168', N'0', N'0', N'0', N'0', N'0'), (N'33', NULL, N'1262661109474283520', N'0', N'0', N'0', N'0', N'0'), (N'34', NULL, N'1262663888804663296', N'0', N'0', N'0', N'0', N'0'), (N'35', NULL, N'1262664024096133120', N'0', N'0', N'0', N'0', N'0'), (N'36', NULL, N'1262664186252120064', N'0', N'0', N'0', N'0', N'0'), (N'37', NULL, N'1262664357044178944', N'0', N'0', N'0', N'0', N'0'), (N'38', NULL, N'1262664632928718848', N'0', N'0', N'0', N'0', N'0'), (N'39', NULL, N'1262664751409418240', N'0', N'0', N'0', N'0', N'0'), (N'40', NULL, N'1262664871274237952', N'0', N'0', N'0', N'0', N'0'), (N'41', NULL, N'1262665026111164416', N'0', N'0', N'0', N'0', N'0'), (N'42', NULL, N'1262665159905267712', N'0', N'0', N'0', N'0', N'0'), (N'43', NULL, N'1262665329829105664', N'0', N'0', N'0', N'0', N'0'), (N'44', NULL, N'1262665456471920640', N'0', N'0', N'0', N'0', N'0'), (N'45', NULL, N'1262665628165754880', N'0', N'0', N'0', N'0', N'0'), (N'46', NULL, N'1262666172682883072', N'0', N'0', N'0', N'0', N'0'), (N'48', NULL, N'1262723402331885568', N'0', N'0', N'0', N'0', N'0'), (N'49', NULL, N'1262935771746734080', N'0', N'0', N'0', N'0', N'0'), (N'50', NULL, N'1262935906522304512', N'0', N'0', N'0', N'0', N'0'), (N'53', NULL, N'1263074419073593344', N'0', N'0', N'0', N'0', N'0'), (N'54', NULL, N'1263075249394790400', N'0', N'0', N'0', N'0', N'0'), (N'55', NULL, N'1263075593499684864', N'0', N'0', N'0', N'0', N'0'), (N'57', NULL, N'1263101898440146944', N'0', N'0', N'0', N'0', N'0'), (N'58', NULL, N'1263303878648569856', N'0', N'0', N'0', N'0', N'0'), (N'59', NULL, N'1263304204797648896', N'0', N'0', N'0', N'0', N'0'), (N'60', NULL, N'1263304872891555840', N'0', N'0', N'0', N'0', N'0'), (N'61', NULL, N'1263305106250047488', N'0', N'0', N'0', N'0', N'0'), (N'62', NULL, N'1263305244594970624', N'0', N'0', N'0', N'0', N'0'), (N'63', NULL, N'1263305430536855552', N'0', N'0', N'0', N'0', N'0'), (N'64', NULL, N'1263639172959174656', N'0', N'0', N'0', N'0', N'0'), (N'65', NULL, N'1264799968944640000', N'0', N'0', N'0', N'0', N'0'), (N'66', NULL, N'1264800070161584128', N'0', N'0', N'0', N'0', N'0'), (N'68', NULL, N'1267360794414161920', N'0', N'0', N'0', N'0', N'0'), (N'69', NULL, N'1267383367629807616', N'0', N'0', N'0', N'0', N'0'), (N'70', NULL, N'1267817055527632896', N'0', N'0', N'0', N'0', N'0'), (N'71', NULL, N'1267817221286526976', N'0', N'0', N'0', N'0', N'0'), (N'72', NULL, N'1268893687085518848', N'0', N'0', N'0', N'0', N'0'), (N'97', NULL, N'1288657613998579712', N'1000', N'0', N'0', N'0', N'0'), (N'98', NULL, N'1288657941770854400', N'1000', N'0', N'0', N'0', N'0'), (N'99', NULL, N'1288658134067109888', N'1000', N'0', N'0', N'0', N'0'), (N'100', NULL, N'1288658305156964352', N'1000', N'0', N'0', N'0', N'0'), (N'101', NULL, N'1288658491216289792', N'1000', N'0', N'0', N'0', N'0'), (N'102', NULL, N'1288658638302142464', N'1000', N'0', N'0', N'0', N'0'), (N'103', NULL, N'1288658791784308736', N'1000', N'0', N'0', N'0', N'0'), (N'104', NULL, N'1290849478956199936', N'0', N'0', N'0', N'0', N'0'), (N'105', NULL, N'1290849628051124224', N'0', N'0', N'0', N'0', N'0'), (N'106', NULL, N'1290849798553776128', N'0', N'0', N'0', N'0', N'0'), (N'108', NULL, N'1291259822512693248', N'0', N'0', N'0', N'0', N'0'), (N'109', NULL, N'1292620505149145088', N'0', N'0', N'0', N'0', N'0'), (N'110', NULL, N'1292620665505775616', N'0', N'0', N'0', N'0', N'0'), (N'111', NULL, N'1292620843398791168', N'100', N'0', N'0', N'0', N'0'), (N'112', NULL, N'1292621027574874112', N'0', N'0', N'0', N'0', N'0'), (N'113', NULL, N'1292621363161137152', N'0', N'0', N'0', N'0', N'0'), (N'114', NULL, N'1292621494837116928', N'0', N'0', N'0', N'0', N'0'), (N'115', NULL, N'1292621629260365824', N'0', N'0', N'0', N'0', N'0'), (N'116', NULL, N'1292622526073864192', N'0', N'0', N'0', N'0', N'0'), (N'117', NULL, N'1293470838745821184', N'0', N'0', N'0', N'0', N'0'), (N'118', NULL, N'1293471661785706496', N'0', N'0', N'0', N'0', N'0'), (N'119', NULL, N'1293472678392721408', N'0', N'0', N'0', N'0', N'0'), (N'120', NULL, N'1293472857510473728', N'0', N'0', N'0', N'0', N'0'), (N'121', NULL, N'1299273336009359360', N'0', N'0', N'0', N'0', N'0'), (N'122', NULL, N'1299273436282585088', N'0', N'0', N'0', N'0', N'0'), (N'123', NULL, N'1299273618470567936', N'0', N'0', N'0', N'0', N'0'), (N'124', NULL, N'1299273770182737920', N'0', N'0', N'0', N'0', N'0'), (N'125', NULL, N'1299273978023084032', N'0', N'0', N'0', N'0', N'0'), (N'126', NULL, N'1299274123225694208', N'0', N'0', N'0', N'0', N'0'), (N'127', NULL, N'1299274222299348992', N'0', N'0', N'0', N'0', N'0'), (N'128', NULL, N'1304238876758495232', N'0', N'0', N'0', N'0', N'0'), (N'129', NULL, N'1304678610343383040', N'0', N'0', N'0', N'0', N'0'), (N'130', NULL, N'1304679169305694208', N'0', N'0', N'0', N'0', N'0'), (N'131', NULL, N'1310460417141817344', N'0', N'0', N'0', N'0', N'0'), (N'132', NULL, N'1310502391475519488', N'0', N'0', N'0', N'0', N'0'), (N'133', NULL, N'1310515546943569920', N'0', N'0', N'0', N'0', N'0'), (N'134', NULL, N'1310515735292985344', N'0', N'0', N'0', N'0', N'0'), (N'135', NULL, N'1316628769783480320', N'0', N'0', N'0', N'0', N'0'), (N'136', NULL, N'1316628940663619584', N'0', N'0', N'0', N'0', N'0'), (N'137', NULL, N'1316629112428756992', N'0', N'0', N'0', N'0', N'0'), (N'138', NULL, N'1316652047017246720', N'0', N'0', N'0', N'0', N'0'), (N'139', NULL, N'1316913899996737536', N'0', N'0', N'0', N'0', N'0'), (N'140', NULL, N'1319200951383199744', N'0', N'0', N'0', N'0', N'0'), (N'141', NULL, N'1319221929807024128', N'0', N'0', N'0', N'0', N'0'), (N'142', NULL, N'1319554431134306304', N'0', N'0', N'0', N'0', N'0'), (N'143', NULL, N'1319554550458060800', N'0', N'0', N'0', N'0', N'0'), (N'144', NULL, N'1319554948434595840', N'0', N'0', N'0', N'0', N'0'), (N'145', NULL, N'1319555067183730688', N'0', N'0', N'0', N'0', N'0'), (N'146', NULL, N'1319555230765780992', N'0', N'0', N'0', N'0', N'0'), (N'147', NULL, N'1319555333790470144', N'0', N'0', N'0', N'0', N'0') +INSERT INTO [apigateway].[appapigatewayhttpoptions] VALUES (N'1', N'1260841964962947072', NULL, NULL, N'0', N'0', N'1', N'0'), (N'4', NULL, N'1261299170387169280', N'1000', N'1', N'0', N'1', N'0'), (N'5', NULL, N'1261585859064872960', NULL, N'0', N'0', N'1', N'0'), (N'6', NULL, N'1261586605810368512', NULL, N'0', N'0', N'0', N'0'), (N'7', NULL, N'1261587558609436672', NULL, N'0', N'0', N'0', N'0'), (N'8', NULL, N'1261588213298348032', NULL, N'0', N'0', N'0', N'0'), (N'9', NULL, N'1261588367619375104', NULL, N'0', N'0', N'0', N'0'), (N'10', NULL, N'1261588628450557952', NULL, N'0', N'0', N'0', N'0'), (N'11', NULL, N'1261588881564221440', NULL, N'0', N'0', N'0', N'0'), (N'12', NULL, N'1261588983053795328', NULL, N'0', N'0', N'0', N'0'), (N'13', NULL, N'1261589139039961088', NULL, N'0', N'0', N'0', N'0'), (N'14', NULL, N'1261589197483393024', NULL, N'0', N'0', N'0', N'0'), (N'15', NULL, N'1261589278857084928', NULL, N'0', N'0', N'0', N'0'), (N'16', NULL, N'1261589420356124672', NULL, N'0', N'0', N'0', N'0'), (N'17', NULL, N'1261589960393736192', N'1000', N'1', N'0', N'1', N'0'), (N'18', NULL, N'1261606600242085888', NULL, N'0', N'0', N'0', N'0'), (N'19', NULL, N'1261606689601732608', NULL, N'0', N'0', N'0', N'0'), (N'22', NULL, N'1262220447629058048', NULL, N'0', N'0', N'1', N'0'), (N'23', NULL, N'1262230734939758592', NULL, N'0', N'0', N'1', N'0'), (N'24', NULL, N'1262296916350869504', NULL, N'0', N'0', N'1', N'0'), (N'25', NULL, N'1262632376348594176', N'0', N'0', N'0', N'0', N'0'), (N'26', NULL, N'1262632791869902848', N'0', N'0', N'0', N'0', N'0'), (N'29', NULL, N'1262660336921235456', N'0', N'0', N'0', N'0', N'0'), (N'30', NULL, N'1262660528277966848', N'0', N'0', N'0', N'0', N'0'), (N'31', NULL, N'1262660706875625472', N'0', N'0', N'0', N'0', N'0'), (N'32', NULL, N'1262660966393991168', N'0', N'0', N'0', N'0', N'0'), (N'33', NULL, N'1262661109474283520', N'0', N'0', N'0', N'0', N'0'), (N'34', NULL, N'1262663888804663296', N'0', N'0', N'0', N'0', N'0'), (N'35', NULL, N'1262664024096133120', N'0', N'0', N'0', N'0', N'0'), (N'36', NULL, N'1262664186252120064', N'0', N'0', N'0', N'0', N'0'), (N'37', NULL, N'1262664357044178944', N'0', N'0', N'0', N'0', N'0'), (N'38', NULL, N'1262664632928718848', N'0', N'0', N'0', N'0', N'0'), (N'39', NULL, N'1262664751409418240', N'0', N'0', N'0', N'0', N'0'), (N'40', NULL, N'1262664871274237952', N'0', N'0', N'0', N'0', N'0'), (N'41', NULL, N'1262665026111164416', N'0', N'0', N'0', N'0', N'0'), (N'42', NULL, N'1262665159905267712', N'0', N'0', N'0', N'0', N'0'), (N'43', NULL, N'1262665329829105664', N'0', N'0', N'0', N'0', N'0'), (N'44', NULL, N'1262665456471920640', N'0', N'0', N'0', N'0', N'0'), (N'45', NULL, N'1262665628165754880', N'0', N'0', N'0', N'0', N'0'), (N'46', NULL, N'1262666172682883072', N'0', N'0', N'0', N'0', N'0'), (N'48', NULL, N'1262723402331885568', N'0', N'0', N'0', N'0', N'0'), (N'49', NULL, N'1262935771746734080', N'0', N'0', N'0', N'0', N'0'), (N'50', NULL, N'1262935906522304512', N'0', N'0', N'0', N'0', N'0'), (N'53', NULL, N'1263074419073593344', N'0', N'0', N'0', N'0', N'0'), (N'54', NULL, N'1263075249394790400', N'0', N'0', N'0', N'0', N'0'), (N'55', NULL, N'1263075593499684864', N'0', N'0', N'0', N'0', N'0'), (N'57', NULL, N'1263101898440146944', N'0', N'0', N'0', N'0', N'0'), (N'58', NULL, N'1263303878648569856', N'0', N'0', N'0', N'0', N'0'), (N'59', NULL, N'1263304204797648896', N'0', N'0', N'0', N'0', N'0'), (N'60', NULL, N'1263304872891555840', N'0', N'0', N'0', N'0', N'0'), (N'61', NULL, N'1263305106250047488', N'0', N'0', N'0', N'0', N'0'), (N'62', NULL, N'1263305244594970624', N'0', N'0', N'0', N'0', N'0'), (N'63', NULL, N'1263305430536855552', N'0', N'0', N'0', N'0', N'0'), (N'64', NULL, N'1263639172959174656', N'0', N'0', N'0', N'0', N'0'), (N'65', NULL, N'1264799968944640000', N'0', N'0', N'0', N'0', N'0'), (N'66', NULL, N'1264800070161584128', N'0', N'0', N'0', N'0', N'0'), (N'68', NULL, N'1267360794414161920', N'0', N'0', N'0', N'0', N'0'), (N'69', NULL, N'1267383367629807616', N'0', N'0', N'0', N'0', N'0'), (N'70', NULL, N'1267817055527632896', N'0', N'0', N'0', N'0', N'0'), (N'71', NULL, N'1267817221286526976', N'0', N'0', N'0', N'0', N'0'), (N'72', NULL, N'1268893687085518848', N'0', N'0', N'0', N'0', N'0'), (N'97', NULL, N'1288657613998579712', N'1000', N'0', N'0', N'0', N'0'), (N'98', NULL, N'1288657941770854400', N'1000', N'0', N'0', N'0', N'0'), (N'99', NULL, N'1288658134067109888', N'1000', N'0', N'0', N'0', N'0'), (N'100', NULL, N'1288658305156964352', N'1000', N'0', N'0', N'0', N'0'), (N'101', NULL, N'1288658491216289792', N'1000', N'0', N'0', N'0', N'0'), (N'102', NULL, N'1288658638302142464', N'1000', N'0', N'0', N'0', N'0'), (N'103', NULL, N'1288658791784308736', N'1000', N'0', N'0', N'0', N'0'), (N'104', NULL, N'1290849478956199936', N'0', N'0', N'0', N'0', N'0'), (N'105', NULL, N'1290849628051124224', N'0', N'0', N'0', N'0', N'0'), (N'106', NULL, N'1290849798553776128', N'0', N'0', N'0', N'0', N'0'), (N'108', NULL, N'1291259822512693248', N'0', N'0', N'0', N'0', N'0'), (N'109', NULL, N'1292620505149145088', N'0', N'0', N'0', N'0', N'0'), (N'110', NULL, N'1292620665505775616', N'0', N'0', N'0', N'0', N'0'), (N'111', NULL, N'1292620843398791168', N'100', N'0', N'0', N'0', N'0'), (N'112', NULL, N'1292621027574874112', N'0', N'0', N'0', N'0', N'0'), (N'113', NULL, N'1292621363161137152', N'0', N'0', N'0', N'0', N'0'), (N'114', NULL, N'1292621494837116928', N'0', N'0', N'0', N'0', N'0'), (N'115', NULL, N'1292621629260365824', N'0', N'0', N'0', N'0', N'0'), (N'116', NULL, N'1292622526073864192', N'0', N'0', N'0', N'0', N'0'), (N'117', NULL, N'1293470838745821184', N'0', N'0', N'0', N'0', N'0'), (N'118', NULL, N'1293471661785706496', N'0', N'0', N'0', N'0', N'0'), (N'119', NULL, N'1293472678392721408', N'0', N'0', N'0', N'0', N'0'), (N'120', NULL, N'1293472857510473728', N'0', N'0', N'0', N'0', N'0'), (N'121', NULL, N'1299273336009359360', N'0', N'0', N'0', N'0', N'0'), (N'122', NULL, N'1299273436282585088', N'0', N'0', N'0', N'0', N'0'), (N'123', NULL, N'1299273618470567936', N'0', N'0', N'0', N'0', N'0'), (N'124', NULL, N'1299273770182737920', N'0', N'0', N'0', N'0', N'0'), (N'125', NULL, N'1299273978023084032', N'0', N'0', N'0', N'0', N'0'), (N'126', NULL, N'1299274123225694208', N'0', N'0', N'0', N'0', N'0'), (N'127', NULL, N'1299274222299348992', N'0', N'0', N'0', N'0', N'0'), (N'128', NULL, N'1304238876758495232', N'0', N'0', N'0', N'0', N'0'), (N'129', NULL, N'1304678610343383040', N'0', N'0', N'0', N'0', N'0'), (N'130', NULL, N'1304679169305694208', N'0', N'0', N'0', N'0', N'0'), (N'131', NULL, N'1310460417141817344', N'0', N'0', N'0', N'0', N'0'), (N'132', NULL, N'1310502391475519488', N'0', N'0', N'0', N'0', N'0'), (N'133', NULL, N'1310515546943569920', N'0', N'0', N'0', N'0', N'0'), (N'134', NULL, N'1310515735292985344', N'0', N'0', N'0', N'0', N'0'), (N'135', NULL, N'1316628769783480320', N'0', N'0', N'0', N'0', N'0'), (N'136', NULL, N'1316628940663619584', N'0', N'0', N'0', N'0', N'0'), (N'137', NULL, N'1316629112428756992', N'0', N'0', N'0', N'0', N'0'), (N'138', NULL, N'1316652047017246720', N'0', N'0', N'0', N'0', N'0'), (N'139', NULL, N'1316913899996737536', N'0', N'0', N'0', N'0', N'0'), (N'140', NULL, N'1319200951383199744', N'0', N'0', N'0', N'0', N'0'), (N'141', NULL, N'1319221929807024128', N'0', N'0', N'0', N'0', N'0'), (N'142', NULL, N'1319554431134306304', N'0', N'0', N'0', N'0', N'0'), (N'143', NULL, N'1319554550458060800', N'0', N'0', N'0', N'0', N'0'), (N'144', NULL, N'1319554948434595840', N'0', N'0', N'0', N'0', N'0'), (N'145', NULL, N'1319555067183730688', N'0', N'0', N'0', N'0', N'0'), (N'146', NULL, N'1319555230765780992', N'0', N'0', N'0', N'0', N'0'), (N'147', NULL, N'1319555333790470144', N'0', N'0', N'0', N'0', N'0'), (N'148', NULL, N'1321001932510203904', N'0', N'0', N'0', N'0', N'0'), (N'149', NULL, N'1321002059803136000', N'0', N'0', N'0', N'0', N'0'), (N'150', NULL, N'1321002256440496128', N'0', N'0', N'0', N'0', N'0'), (N'151', NULL, N'1321002350686507008', N'0', N'0', N'0', N'0', N'0'), (N'152', NULL, N'1322190027988525056', N'0', N'0', N'0', N'0', N'0') GO COMMIT @@ -366,7 +366,7 @@ GO BEGIN TRANSACTION GO -INSERT INTO [apigateway].[appapigatewayqosoptions] VALUES (N'1', N'1260841964962947072', NULL, N'60', N'60000', N'30000'), (N'4', NULL, N'1261299170387169280', N'60', N'60000', N'30000'), (N'5', NULL, N'1261585859064872960', N'60', N'60000', N'30000'), (N'6', NULL, N'1261586605810368512', N'60', N'60000', N'30000'), (N'7', NULL, N'1261587558609436672', N'60', N'60000', N'30000'), (N'8', NULL, N'1261588213298348032', N'60', N'60000', N'30000'), (N'9', NULL, N'1261588367619375104', N'60', N'60000', N'30000'), (N'10', NULL, N'1261588628450557952', N'60', N'60000', N'30000'), (N'11', NULL, N'1261588881564221440', N'60', N'60000', N'30000'), (N'12', NULL, N'1261588983053795328', N'60', N'60000', N'30000'), (N'13', NULL, N'1261589139039961088', N'60', N'60000', N'30000'), (N'14', NULL, N'1261589197483393024', N'60', N'60000', N'30000'), (N'15', NULL, N'1261589278857084928', N'60', N'60000', N'30000'), (N'16', NULL, N'1261589420356124672', N'60', N'60000', N'30000'), (N'17', NULL, N'1261589960393736192', N'60', N'60000', N'30000'), (N'18', NULL, N'1261606600242085888', NULL, NULL, NULL), (N'19', NULL, N'1261606689601732608', NULL, NULL, NULL), (N'22', NULL, N'1262220447629058048', N'60', N'60000', N'30000'), (N'23', NULL, N'1262230734939758592', N'60', N'60000', N'30000'), (N'24', NULL, N'1262296916350869504', N'60', N'60000', N'30000'), (N'25', NULL, N'1262632376348594176', N'50', N'60000', N'30000'), (N'26', NULL, N'1262632791869902848', N'50', N'60000', N'30000'), (N'29', NULL, N'1262660336921235456', N'50', N'60000', N'30000'), (N'30', NULL, N'1262660528277966848', N'50', N'60000', N'30000'), (N'31', NULL, N'1262660706875625472', N'50', N'60000', N'30000'), (N'32', NULL, N'1262660966393991168', N'50', N'60000', N'30000'), (N'33', NULL, N'1262661109474283520', N'50', N'60000', N'30000'), (N'34', NULL, N'1262663888804663296', N'50', N'60000', N'30000'), (N'35', NULL, N'1262664024096133120', N'50', N'60000', N'30000'), (N'36', NULL, N'1262664186252120064', N'50', N'60000', N'30000'), (N'37', NULL, N'1262664357044178944', N'50', N'60000', N'30000'), (N'38', NULL, N'1262664632928718848', N'50', N'60000', N'30000'), (N'39', NULL, N'1262664751409418240', N'50', N'60000', N'30000'), (N'40', NULL, N'1262664871274237952', N'50', N'60000', N'30000'), (N'41', NULL, N'1262665026111164416', N'50', N'60000', N'30000'), (N'42', NULL, N'1262665159905267712', N'50', N'60000', N'30000'), (N'43', NULL, N'1262665329829105664', N'50', N'60000', N'30000'), (N'44', NULL, N'1262665456471920640', N'50', N'60000', N'30000'), (N'45', NULL, N'1262665628165754880', N'50', N'60000', N'30000'), (N'46', NULL, N'1262666172682883072', N'50', N'60000', N'30000'), (N'48', NULL, N'1262723402331885568', N'50', N'60000', N'30000'), (N'49', NULL, N'1262935771746734080', N'50', N'60000', N'30000'), (N'50', NULL, N'1262935906522304512', N'50', N'60000', N'30000'), (N'53', NULL, N'1263074419073593344', N'50', N'60000', N'30000'), (N'54', NULL, N'1263075249394790400', N'50', N'60000', N'30000'), (N'55', NULL, N'1263075593499684864', N'50', N'60000', N'30000'), (N'57', NULL, N'1263101898440146944', N'50', N'60000', N'120000'), (N'58', NULL, N'1263303878648569856', N'50', N'60000', N'30000'), (N'59', NULL, N'1263304204797648896', N'50', N'60000', N'120000'), (N'60', NULL, N'1263304872891555840', N'50', N'60000', N'30000'), (N'61', NULL, N'1263305106250047488', N'50', N'60000', N'30000'), (N'62', NULL, N'1263305244594970624', N'50', N'60000', N'30000'), (N'63', NULL, N'1263305430536855552', N'50', N'60000', N'30000'), (N'64', NULL, N'1263639172959174656', N'50', N'60000', N'30000'), (N'65', NULL, N'1264799968944640000', N'50', N'60000', N'30000'), (N'66', NULL, N'1264800070161584128', N'50', N'60000', N'30000'), (N'68', NULL, N'1267360794414161920', N'50', N'60000', N'30000'), (N'69', NULL, N'1267383367629807616', N'50', N'60000', N'30000'), (N'70', NULL, N'1267817055527632896', N'50', N'60000', N'30000'), (N'71', NULL, N'1267817221286526976', N'50', N'60000', N'30000'), (N'72', NULL, N'1268893687085518848', N'50', N'60000', N'30000'), (N'97', NULL, N'1288657613998579712', N'50', N'60000', N'30000'), (N'98', NULL, N'1288657941770854400', N'50', N'60000', N'30000'), (N'99', NULL, N'1288658134067109888', N'50', N'60000', N'30000'), (N'100', NULL, N'1288658305156964352', N'50', N'60000', N'30000'), (N'101', NULL, N'1288658491216289792', N'50', N'60000', N'30000'), (N'102', NULL, N'1288658638302142464', N'50', N'60000', N'30000'), (N'103', NULL, N'1288658791784308736', N'50', N'60000', N'30000'), (N'104', NULL, N'1290849478956199936', N'50', N'60000', N'30000'), (N'105', NULL, N'1290849628051124224', N'50', N'60000', N'30000'), (N'106', NULL, N'1290849798553776128', N'50', N'60000', N'30000'), (N'108', NULL, N'1291259822512693248', N'50', N'60000', N'30000'), (N'109', NULL, N'1292620505149145088', N'50', N'60000', N'30000'), (N'110', NULL, N'1292620665505775616', N'50', N'60000', N'30000'), (N'111', NULL, N'1292620843398791168', N'50', N'60000', N'1200000'), (N'112', NULL, N'1292621027574874112', N'50', N'60000', N'30000'), (N'113', NULL, N'1292621363161137152', N'50', N'60000', N'30000'), (N'114', NULL, N'1292621494837116928', N'50', N'60000', N'30000'), (N'115', NULL, N'1292621629260365824', N'50', N'60000', N'30000'), (N'116', NULL, N'1292622526073864192', N'50', N'60000', N'30000'), (N'117', NULL, N'1293470838745821184', N'50', N'60000', N'30000'), (N'118', NULL, N'1293471661785706496', N'50', N'60000', N'30000'), (N'119', NULL, N'1293472678392721408', N'50', N'60000', N'30000'), (N'120', NULL, N'1293472857510473728', N'50', N'60000', N'30000'), (N'121', NULL, N'1299273336009359360', N'50', N'60000', N'30000'), (N'122', NULL, N'1299273436282585088', N'50', N'60000', N'30000'), (N'123', NULL, N'1299273618470567936', N'50', N'60000', N'30000'), (N'124', NULL, N'1299273770182737920', N'50', N'60000', N'30000'), (N'125', NULL, N'1299273978023084032', N'50', N'60000', N'30000'), (N'126', NULL, N'1299274123225694208', N'50', N'60000', N'30000'), (N'127', NULL, N'1299274222299348992', N'50', N'60000', N'30000'), (N'128', NULL, N'1304238876758495232', N'50', N'60000', N'30000'), (N'129', NULL, N'1304678610343383040', N'50', N'60000', N'30000'), (N'130', NULL, N'1304679169305694208', N'50', N'60000', N'30000'), (N'131', NULL, N'1310460417141817344', N'50', N'60000', N'30000'), (N'132', NULL, N'1310502391475519488', N'50', N'60000', N'30000'), (N'133', NULL, N'1310515546943569920', N'50', N'60000', N'30000'), (N'134', NULL, N'1310515735292985344', N'50', N'60000', N'30000'), (N'135', NULL, N'1316628769783480320', N'50', N'60000', N'30000'), (N'136', NULL, N'1316628940663619584', N'50', N'60000', N'30000'), (N'137', NULL, N'1316629112428756992', N'50', N'60000', N'30000'), (N'138', NULL, N'1316652047017246720', N'50', N'60000', N'30000'), (N'139', NULL, N'1316913899996737536', N'50', N'60000', N'30000'), (N'140', NULL, N'1319200951383199744', N'50', N'60000', N'30000'), (N'141', NULL, N'1319221929807024128', N'50', N'60000', N'30000'), (N'142', NULL, N'1319554431134306304', N'50', N'60000', N'30000'), (N'143', NULL, N'1319554550458060800', N'50', N'60000', N'30000'), (N'144', NULL, N'1319554948434595840', N'50', N'60000', N'30000'), (N'145', NULL, N'1319555067183730688', N'50', N'60000', N'30000'), (N'146', NULL, N'1319555230765780992', N'50', N'60000', N'30000'), (N'147', NULL, N'1319555333790470144', N'50', N'60000', N'30000') +INSERT INTO [apigateway].[appapigatewayqosoptions] VALUES (N'1', N'1260841964962947072', NULL, N'60', N'60000', N'30000'), (N'4', NULL, N'1261299170387169280', N'60', N'60000', N'30000'), (N'5', NULL, N'1261585859064872960', N'60', N'60000', N'30000'), (N'6', NULL, N'1261586605810368512', N'60', N'60000', N'30000'), (N'7', NULL, N'1261587558609436672', N'60', N'60000', N'30000'), (N'8', NULL, N'1261588213298348032', N'60', N'60000', N'30000'), (N'9', NULL, N'1261588367619375104', N'60', N'60000', N'30000'), (N'10', NULL, N'1261588628450557952', N'60', N'60000', N'30000'), (N'11', NULL, N'1261588881564221440', N'60', N'60000', N'30000'), (N'12', NULL, N'1261588983053795328', N'60', N'60000', N'30000'), (N'13', NULL, N'1261589139039961088', N'60', N'60000', N'30000'), (N'14', NULL, N'1261589197483393024', N'60', N'60000', N'30000'), (N'15', NULL, N'1261589278857084928', N'60', N'60000', N'30000'), (N'16', NULL, N'1261589420356124672', N'60', N'60000', N'30000'), (N'17', NULL, N'1261589960393736192', N'60', N'60000', N'30000'), (N'18', NULL, N'1261606600242085888', NULL, NULL, NULL), (N'19', NULL, N'1261606689601732608', NULL, NULL, NULL), (N'22', NULL, N'1262220447629058048', N'60', N'60000', N'30000'), (N'23', NULL, N'1262230734939758592', N'60', N'60000', N'30000'), (N'24', NULL, N'1262296916350869504', N'60', N'60000', N'30000'), (N'25', NULL, N'1262632376348594176', N'50', N'60000', N'30000'), (N'26', NULL, N'1262632791869902848', N'50', N'60000', N'30000'), (N'29', NULL, N'1262660336921235456', N'50', N'60000', N'30000'), (N'30', NULL, N'1262660528277966848', N'50', N'60000', N'30000'), (N'31', NULL, N'1262660706875625472', N'50', N'60000', N'30000'), (N'32', NULL, N'1262660966393991168', N'50', N'60000', N'30000'), (N'33', NULL, N'1262661109474283520', N'50', N'60000', N'30000'), (N'34', NULL, N'1262663888804663296', N'50', N'60000', N'30000'), (N'35', NULL, N'1262664024096133120', N'50', N'60000', N'30000'), (N'36', NULL, N'1262664186252120064', N'50', N'60000', N'30000'), (N'37', NULL, N'1262664357044178944', N'50', N'60000', N'30000'), (N'38', NULL, N'1262664632928718848', N'50', N'60000', N'30000'), (N'39', NULL, N'1262664751409418240', N'50', N'60000', N'30000'), (N'40', NULL, N'1262664871274237952', N'50', N'60000', N'30000'), (N'41', NULL, N'1262665026111164416', N'50', N'60000', N'30000'), (N'42', NULL, N'1262665159905267712', N'50', N'60000', N'30000'), (N'43', NULL, N'1262665329829105664', N'50', N'60000', N'30000'), (N'44', NULL, N'1262665456471920640', N'50', N'60000', N'30000'), (N'45', NULL, N'1262665628165754880', N'50', N'60000', N'30000'), (N'46', NULL, N'1262666172682883072', N'50', N'60000', N'30000'), (N'48', NULL, N'1262723402331885568', N'50', N'60000', N'30000'), (N'49', NULL, N'1262935771746734080', N'50', N'60000', N'30000'), (N'50', NULL, N'1262935906522304512', N'50', N'60000', N'30000'), (N'53', NULL, N'1263074419073593344', N'50', N'60000', N'30000'), (N'54', NULL, N'1263075249394790400', N'50', N'60000', N'30000'), (N'55', NULL, N'1263075593499684864', N'50', N'60000', N'30000'), (N'57', NULL, N'1263101898440146944', N'50', N'60000', N'120000'), (N'58', NULL, N'1263303878648569856', N'50', N'60000', N'30000'), (N'59', NULL, N'1263304204797648896', N'50', N'60000', N'120000'), (N'60', NULL, N'1263304872891555840', N'50', N'60000', N'30000'), (N'61', NULL, N'1263305106250047488', N'50', N'60000', N'30000'), (N'62', NULL, N'1263305244594970624', N'50', N'60000', N'30000'), (N'63', NULL, N'1263305430536855552', N'50', N'60000', N'30000'), (N'64', NULL, N'1263639172959174656', N'50', N'60000', N'30000'), (N'65', NULL, N'1264799968944640000', N'50', N'60000', N'30000'), (N'66', NULL, N'1264800070161584128', N'50', N'60000', N'30000'), (N'68', NULL, N'1267360794414161920', N'50', N'60000', N'30000'), (N'69', NULL, N'1267383367629807616', N'50', N'60000', N'30000'), (N'70', NULL, N'1267817055527632896', N'50', N'60000', N'30000'), (N'71', NULL, N'1267817221286526976', N'50', N'60000', N'30000'), (N'72', NULL, N'1268893687085518848', N'50', N'60000', N'30000'), (N'97', NULL, N'1288657613998579712', N'50', N'60000', N'30000'), (N'98', NULL, N'1288657941770854400', N'50', N'60000', N'30000'), (N'99', NULL, N'1288658134067109888', N'50', N'60000', N'30000'), (N'100', NULL, N'1288658305156964352', N'50', N'60000', N'30000'), (N'101', NULL, N'1288658491216289792', N'50', N'60000', N'30000'), (N'102', NULL, N'1288658638302142464', N'50', N'60000', N'30000'), (N'103', NULL, N'1288658791784308736', N'50', N'60000', N'30000'), (N'104', NULL, N'1290849478956199936', N'50', N'60000', N'30000'), (N'105', NULL, N'1290849628051124224', N'50', N'60000', N'30000'), (N'106', NULL, N'1290849798553776128', N'50', N'60000', N'30000'), (N'108', NULL, N'1291259822512693248', N'50', N'60000', N'30000'), (N'109', NULL, N'1292620505149145088', N'50', N'60000', N'30000'), (N'110', NULL, N'1292620665505775616', N'50', N'60000', N'30000'), (N'111', NULL, N'1292620843398791168', N'50', N'60000', N'1200000'), (N'112', NULL, N'1292621027574874112', N'50', N'60000', N'30000'), (N'113', NULL, N'1292621363161137152', N'50', N'60000', N'30000'), (N'114', NULL, N'1292621494837116928', N'50', N'60000', N'30000'), (N'115', NULL, N'1292621629260365824', N'50', N'60000', N'30000'), (N'116', NULL, N'1292622526073864192', N'50', N'60000', N'30000'), (N'117', NULL, N'1293470838745821184', N'50', N'60000', N'30000'), (N'118', NULL, N'1293471661785706496', N'50', N'60000', N'30000'), (N'119', NULL, N'1293472678392721408', N'50', N'60000', N'30000'), (N'120', NULL, N'1293472857510473728', N'50', N'60000', N'30000'), (N'121', NULL, N'1299273336009359360', N'50', N'60000', N'30000'), (N'122', NULL, N'1299273436282585088', N'50', N'60000', N'30000'), (N'123', NULL, N'1299273618470567936', N'50', N'60000', N'30000'), (N'124', NULL, N'1299273770182737920', N'50', N'60000', N'30000'), (N'125', NULL, N'1299273978023084032', N'50', N'60000', N'30000'), (N'126', NULL, N'1299274123225694208', N'50', N'60000', N'30000'), (N'127', NULL, N'1299274222299348992', N'50', N'60000', N'30000'), (N'128', NULL, N'1304238876758495232', N'50', N'60000', N'30000'), (N'129', NULL, N'1304678610343383040', N'50', N'60000', N'30000'), (N'130', NULL, N'1304679169305694208', N'50', N'60000', N'30000'), (N'131', NULL, N'1310460417141817344', N'50', N'60000', N'30000'), (N'132', NULL, N'1310502391475519488', N'50', N'60000', N'30000'), (N'133', NULL, N'1310515546943569920', N'50', N'60000', N'30000'), (N'134', NULL, N'1310515735292985344', N'50', N'60000', N'30000'), (N'135', NULL, N'1316628769783480320', N'50', N'60000', N'30000'), (N'136', NULL, N'1316628940663619584', N'50', N'60000', N'30000'), (N'137', NULL, N'1316629112428756992', N'50', N'60000', N'30000'), (N'138', NULL, N'1316652047017246720', N'50', N'60000', N'30000'), (N'139', NULL, N'1316913899996737536', N'50', N'60000', N'30000'), (N'140', NULL, N'1319200951383199744', N'50', N'60000', N'30000'), (N'141', NULL, N'1319221929807024128', N'50', N'60000', N'30000'), (N'142', NULL, N'1319554431134306304', N'50', N'60000', N'30000'), (N'143', NULL, N'1319554550458060800', N'50', N'60000', N'30000'), (N'144', NULL, N'1319554948434595840', N'50', N'60000', N'30000'), (N'145', NULL, N'1319555067183730688', N'50', N'60000', N'30000'), (N'146', NULL, N'1319555230765780992', N'50', N'60000', N'30000'), (N'147', NULL, N'1319555333790470144', N'50', N'60000', N'30000'), (N'148', NULL, N'1321001932510203904', N'50', N'60000', N'30000'), (N'149', NULL, N'1321002059803136000', N'50', N'60000', N'30000'), (N'150', NULL, N'1321002256440496128', N'50', N'60000', N'30000'), (N'151', NULL, N'1321002350686507008', N'50', N'60000', N'30000'), (N'152', NULL, N'1322190027988525056', N'50', N'60000', N'30000') GO COMMIT @@ -431,7 +431,7 @@ GO BEGIN TRANSACTION GO -INSERT INTO [apigateway].[appapigatewayratelimitrule] VALUES (N'3', N'1261299170387169280', NULL, N'', N'0', NULL, NULL, NULL), (N'4', N'1261585859064872960', NULL, N'', N'0', NULL, NULL, NULL), (N'5', N'1261586605810368512', NULL, N'', N'0', NULL, NULL, NULL), (N'6', N'1261587558609436672', NULL, N'', N'0', NULL, NULL, NULL), (N'7', N'1261588213298348032', NULL, N'', N'0', NULL, NULL, NULL), (N'8', N'1261588367619375104', NULL, N'', N'0', NULL, NULL, NULL), (N'9', N'1261588628450557952', NULL, N'', N'0', NULL, NULL, NULL), (N'10', N'1261588881564221440', NULL, N'', N'0', NULL, NULL, NULL), (N'11', N'1261588983053795328', NULL, N'', N'0', NULL, NULL, NULL), (N'12', N'1261589139039961088', NULL, N'', N'0', NULL, NULL, NULL), (N'13', N'1261589197483393024', NULL, N'', N'0', NULL, NULL, NULL), (N'14', N'1261589278857084928', NULL, N'', N'0', NULL, NULL, NULL), (N'15', N'1261589420356124672', NULL, N'', N'0', NULL, NULL, NULL), (N'16', N'1261589960393736192', NULL, N'', N'0', NULL, NULL, NULL), (N'17', N'1261606600242085888', NULL, N'', N'0', NULL, NULL, NULL), (N'18', N'1261606689601732608', NULL, N'', N'0', NULL, NULL, NULL), (N'21', N'1262220447629058048', NULL, N'', N'0', NULL, NULL, NULL), (N'22', N'1262230734939758592', NULL, N'', N'0', NULL, NULL, NULL), (N'23', N'1262296916350869504', NULL, N'', N'0', NULL, NULL, NULL), (N'24', N'1262632376348594176', NULL, N'', N'0', NULL, NULL, NULL), (N'25', N'1262632791869902848', NULL, N'', N'0', NULL, NULL, NULL), (N'28', N'1262660336921235456', NULL, N'', N'0', NULL, NULL, NULL), (N'29', N'1262660528277966848', NULL, N'', N'0', NULL, NULL, NULL), (N'30', N'1262660706875625472', NULL, N'', N'0', NULL, NULL, NULL), (N'31', N'1262660966393991168', NULL, N'', N'0', NULL, NULL, NULL), (N'32', N'1262661109474283520', NULL, N'', N'0', NULL, NULL, NULL), (N'33', N'1262663888804663296', NULL, N'', N'0', NULL, NULL, NULL), (N'34', N'1262664024096133120', NULL, N'', N'0', NULL, NULL, NULL), (N'35', N'1262664186252120064', NULL, N'', N'0', NULL, NULL, NULL), (N'36', N'1262664357044178944', NULL, N'', N'0', NULL, NULL, NULL), (N'37', N'1262664632928718848', NULL, N'', N'0', NULL, NULL, NULL), (N'38', N'1262664751409418240', NULL, N'', N'0', NULL, NULL, NULL), (N'39', N'1262664871274237952', NULL, N'', N'0', NULL, NULL, NULL), (N'40', N'1262665026111164416', NULL, N'', N'0', NULL, NULL, NULL), (N'41', N'1262665159905267712', NULL, N'', N'0', NULL, NULL, NULL), (N'42', N'1262665329829105664', NULL, N'', N'0', NULL, NULL, NULL), (N'43', N'1262665456471920640', NULL, N'', N'0', NULL, NULL, NULL), (N'44', N'1262665628165754880', NULL, N'', N'0', NULL, NULL, NULL), (N'45', N'1262666172682883072', NULL, N'', N'0', NULL, NULL, NULL), (N'47', N'1262723402331885568', NULL, N'', N'0', NULL, NULL, NULL), (N'48', N'1262935771746734080', NULL, N'', N'0', NULL, NULL, NULL), (N'49', N'1262935906522304512', NULL, N'', N'0', NULL, NULL, NULL), (N'52', N'1263074419073593344', NULL, N'', N'0', NULL, NULL, NULL), (N'53', N'1263075249394790400', NULL, N'', N'0', NULL, NULL, NULL), (N'54', N'1263075593499684864', NULL, N'', N'0', NULL, NULL, NULL), (N'56', N'1263101898440146944', NULL, N'', N'0', NULL, NULL, NULL), (N'57', N'1263303878648569856', NULL, N'', N'0', NULL, NULL, NULL), (N'58', N'1263304204797648896', NULL, N'', N'0', NULL, NULL, NULL), (N'59', N'1263304872891555840', NULL, N'', N'0', NULL, NULL, NULL), (N'60', N'1263305106250047488', NULL, N'', N'0', NULL, NULL, NULL), (N'61', N'1263305244594970624', NULL, N'', N'0', NULL, NULL, NULL), (N'62', N'1263305430536855552', NULL, N'', N'0', NULL, NULL, NULL), (N'63', N'1263639172959174656', NULL, N'', N'0', NULL, NULL, NULL), (N'64', N'1264799968944640000', NULL, N'', N'0', NULL, NULL, NULL), (N'65', N'1264800070161584128', NULL, N'', N'0', NULL, NULL, NULL), (N'66', N'1267360794414161920', NULL, N'', N'0', NULL, NULL, NULL), (N'67', N'1267383367629807616', NULL, N'', N'0', NULL, NULL, NULL), (N'68', N'1267817055527632896', NULL, N'', N'0', NULL, NULL, NULL), (N'69', N'1267817221286526976', NULL, N'', N'0', NULL, NULL, NULL), (N'70', N'1268893687085518848', NULL, N'', N'0', NULL, NULL, NULL), (N'94', N'1288657613998579712', NULL, N'', N'1', N'1m', N'60', N'200'), (N'95', N'1288657941770854400', NULL, N'', N'0', NULL, NULL, NULL), (N'96', N'1288658134067109888', NULL, N'', N'0', NULL, NULL, NULL), (N'97', N'1288658305156964352', NULL, N'', N'0', NULL, NULL, NULL), (N'98', N'1288658491216289792', NULL, N'', N'0', NULL, NULL, NULL), (N'99', N'1288658638302142464', NULL, N'', N'0', NULL, NULL, NULL), (N'100', N'1288658791784308736', NULL, N'', N'0', NULL, NULL, NULL), (N'101', N'1290849478956199936', NULL, N'', N'0', NULL, NULL, NULL), (N'102', N'1290849628051124224', NULL, N'', N'0', NULL, NULL, NULL), (N'103', N'1290849798553776128', NULL, N'', N'0', NULL, NULL, NULL), (N'105', N'1291259822512693248', NULL, N'', N'0', NULL, NULL, NULL), (N'106', N'1292620505149145088', NULL, N'', N'0', NULL, NULL, NULL), (N'107', N'1292620665505775616', NULL, N'', N'0', NULL, NULL, NULL), (N'108', N'1292620843398791168', NULL, N'', N'0', NULL, NULL, NULL), (N'109', N'1292621027574874112', NULL, N'', N'0', NULL, NULL, NULL), (N'110', N'1292621363161137152', NULL, N'', N'0', NULL, NULL, NULL), (N'111', N'1292621494837116928', NULL, N'', N'0', NULL, NULL, NULL), (N'112', N'1292621629260365824', NULL, N'', N'0', NULL, NULL, NULL), (N'113', N'1292622526073864192', NULL, N'', N'0', NULL, NULL, NULL), (N'114', N'1293470838745821184', NULL, N'', N'0', NULL, NULL, NULL), (N'115', N'1293471661785706496', NULL, N'', N'0', NULL, NULL, NULL), (N'116', N'1293472678392721408', NULL, N'', N'0', NULL, NULL, NULL), (N'117', N'1293472857510473728', NULL, N'', N'0', NULL, NULL, NULL), (N'118', N'1299273336009359360', NULL, N'', N'0', NULL, NULL, NULL), (N'119', N'1299273436282585088', NULL, N'', N'0', NULL, NULL, NULL), (N'120', N'1299273618470567936', NULL, N'', N'0', NULL, NULL, NULL), (N'121', N'1299273770182737920', NULL, N'', N'0', NULL, NULL, NULL), (N'122', N'1299273978023084032', NULL, N'', N'0', NULL, NULL, NULL), (N'123', N'1299274123225694208', NULL, N'', N'0', NULL, NULL, NULL), (N'124', N'1299274222299348992', NULL, N'', N'0', NULL, NULL, NULL), (N'125', N'1304238876758495232', NULL, N'', N'0', NULL, NULL, NULL), (N'126', N'1304678610343383040', NULL, N'', N'0', NULL, NULL, NULL), (N'127', N'1304679169305694208', NULL, N'', N'0', NULL, NULL, NULL), (N'128', N'1310460417141817344', NULL, N'', N'0', NULL, NULL, NULL), (N'129', N'1310502391475519488', NULL, N'', N'0', NULL, NULL, NULL), (N'130', N'1310515546943569920', NULL, N'', N'0', NULL, NULL, NULL), (N'131', N'1310515735292985344', NULL, N'', N'0', NULL, NULL, NULL), (N'132', N'1316628769783480320', NULL, N'', N'0', NULL, NULL, NULL), (N'133', N'1316628940663619584', NULL, N'', N'0', NULL, NULL, NULL), (N'134', N'1316629112428756992', NULL, N'', N'0', NULL, NULL, NULL), (N'135', N'1316652047017246720', NULL, N'', N'0', NULL, NULL, NULL), (N'136', N'1316913899996737536', NULL, N'', N'0', NULL, NULL, NULL), (N'137', N'1319200951383199744', NULL, N'', N'0', NULL, NULL, NULL), (N'138', N'1319221929807024128', NULL, N'', N'0', NULL, NULL, NULL), (N'139', N'1319554431134306304', NULL, N'', N'0', NULL, NULL, NULL), (N'140', N'1319554550458060800', NULL, N'', N'0', NULL, NULL, NULL), (N'141', N'1319554948434595840', NULL, N'', N'0', NULL, NULL, NULL), (N'142', N'1319555067183730688', NULL, N'', N'0', NULL, NULL, NULL), (N'143', N'1319555230765780992', NULL, N'', N'0', NULL, NULL, NULL), (N'144', N'1319555333790470144', NULL, N'', N'0', NULL, NULL, NULL) +INSERT INTO [apigateway].[appapigatewayratelimitrule] VALUES (N'3', N'1261299170387169280', NULL, N'', N'0', NULL, NULL, NULL), (N'4', N'1261585859064872960', NULL, N'', N'0', NULL, NULL, NULL), (N'5', N'1261586605810368512', NULL, N'', N'0', NULL, NULL, NULL), (N'6', N'1261587558609436672', NULL, N'', N'0', NULL, NULL, NULL), (N'7', N'1261588213298348032', NULL, N'', N'0', NULL, NULL, NULL), (N'8', N'1261588367619375104', NULL, N'', N'0', NULL, NULL, NULL), (N'9', N'1261588628450557952', NULL, N'', N'0', NULL, NULL, NULL), (N'10', N'1261588881564221440', NULL, N'', N'0', NULL, NULL, NULL), (N'11', N'1261588983053795328', NULL, N'', N'0', NULL, NULL, NULL), (N'12', N'1261589139039961088', NULL, N'', N'0', NULL, NULL, NULL), (N'13', N'1261589197483393024', NULL, N'', N'0', NULL, NULL, NULL), (N'14', N'1261589278857084928', NULL, N'', N'0', NULL, NULL, NULL), (N'15', N'1261589420356124672', NULL, N'', N'0', NULL, NULL, NULL), (N'16', N'1261589960393736192', NULL, N'', N'0', NULL, NULL, NULL), (N'17', N'1261606600242085888', NULL, N'', N'0', NULL, NULL, NULL), (N'18', N'1261606689601732608', NULL, N'', N'0', NULL, NULL, NULL), (N'21', N'1262220447629058048', NULL, N'', N'0', NULL, NULL, NULL), (N'22', N'1262230734939758592', NULL, N'', N'0', NULL, NULL, NULL), (N'23', N'1262296916350869504', NULL, N'', N'0', NULL, NULL, NULL), (N'24', N'1262632376348594176', NULL, N'', N'0', NULL, NULL, NULL), (N'25', N'1262632791869902848', NULL, N'', N'0', NULL, NULL, NULL), (N'28', N'1262660336921235456', NULL, N'', N'0', NULL, NULL, NULL), (N'29', N'1262660528277966848', NULL, N'', N'0', NULL, NULL, NULL), (N'30', N'1262660706875625472', NULL, N'', N'0', NULL, NULL, NULL), (N'31', N'1262660966393991168', NULL, N'', N'0', NULL, NULL, NULL), (N'32', N'1262661109474283520', NULL, N'', N'0', NULL, NULL, NULL), (N'33', N'1262663888804663296', NULL, N'', N'0', NULL, NULL, NULL), (N'34', N'1262664024096133120', NULL, N'', N'0', NULL, NULL, NULL), (N'35', N'1262664186252120064', NULL, N'', N'0', NULL, NULL, NULL), (N'36', N'1262664357044178944', NULL, N'', N'0', NULL, NULL, NULL), (N'37', N'1262664632928718848', NULL, N'', N'0', NULL, NULL, NULL), (N'38', N'1262664751409418240', NULL, N'', N'0', NULL, NULL, NULL), (N'39', N'1262664871274237952', NULL, N'', N'0', NULL, NULL, NULL), (N'40', N'1262665026111164416', NULL, N'', N'0', NULL, NULL, NULL), (N'41', N'1262665159905267712', NULL, N'', N'0', NULL, NULL, NULL), (N'42', N'1262665329829105664', NULL, N'', N'0', NULL, NULL, NULL), (N'43', N'1262665456471920640', NULL, N'', N'0', NULL, NULL, NULL), (N'44', N'1262665628165754880', NULL, N'', N'0', NULL, NULL, NULL), (N'45', N'1262666172682883072', NULL, N'', N'0', NULL, NULL, NULL), (N'47', N'1262723402331885568', NULL, N'', N'0', NULL, NULL, NULL), (N'48', N'1262935771746734080', NULL, N'', N'0', NULL, NULL, NULL), (N'49', N'1262935906522304512', NULL, N'', N'0', NULL, NULL, NULL), (N'52', N'1263074419073593344', NULL, N'', N'0', NULL, NULL, NULL), (N'53', N'1263075249394790400', NULL, N'', N'0', NULL, NULL, NULL), (N'54', N'1263075593499684864', NULL, N'', N'0', NULL, NULL, NULL), (N'56', N'1263101898440146944', NULL, N'', N'0', NULL, NULL, NULL), (N'57', N'1263303878648569856', NULL, N'', N'0', NULL, NULL, NULL), (N'58', N'1263304204797648896', NULL, N'', N'0', NULL, NULL, NULL), (N'59', N'1263304872891555840', NULL, N'', N'0', NULL, NULL, NULL), (N'60', N'1263305106250047488', NULL, N'', N'0', NULL, NULL, NULL), (N'61', N'1263305244594970624', NULL, N'', N'0', NULL, NULL, NULL), (N'62', N'1263305430536855552', NULL, N'', N'0', NULL, NULL, NULL), (N'63', N'1263639172959174656', NULL, N'', N'0', NULL, NULL, NULL), (N'64', N'1264799968944640000', NULL, N'', N'0', NULL, NULL, NULL), (N'65', N'1264800070161584128', NULL, N'', N'0', NULL, NULL, NULL), (N'66', N'1267360794414161920', NULL, N'', N'0', NULL, NULL, NULL), (N'67', N'1267383367629807616', NULL, N'', N'0', NULL, NULL, NULL), (N'68', N'1267817055527632896', NULL, N'', N'0', NULL, NULL, NULL), (N'69', N'1267817221286526976', NULL, N'', N'0', NULL, NULL, NULL), (N'70', N'1268893687085518848', NULL, N'', N'0', NULL, NULL, NULL), (N'94', N'1288657613998579712', NULL, N'', N'1', N'1m', N'60', N'200'), (N'95', N'1288657941770854400', NULL, N'', N'0', NULL, NULL, NULL), (N'96', N'1288658134067109888', NULL, N'', N'0', NULL, NULL, NULL), (N'97', N'1288658305156964352', NULL, N'', N'0', NULL, NULL, NULL), (N'98', N'1288658491216289792', NULL, N'', N'0', NULL, NULL, NULL), (N'99', N'1288658638302142464', NULL, N'', N'0', NULL, NULL, NULL), (N'100', N'1288658791784308736', NULL, N'', N'0', NULL, NULL, NULL), (N'101', N'1290849478956199936', NULL, N'', N'0', NULL, NULL, NULL), (N'102', N'1290849628051124224', NULL, N'', N'0', NULL, NULL, NULL), (N'103', N'1290849798553776128', NULL, N'', N'0', NULL, NULL, NULL), (N'105', N'1291259822512693248', NULL, N'', N'0', NULL, NULL, NULL), (N'106', N'1292620505149145088', NULL, N'', N'0', NULL, NULL, NULL), (N'107', N'1292620665505775616', NULL, N'', N'0', NULL, NULL, NULL), (N'108', N'1292620843398791168', NULL, N'', N'0', NULL, NULL, NULL), (N'109', N'1292621027574874112', NULL, N'', N'0', NULL, NULL, NULL), (N'110', N'1292621363161137152', NULL, N'', N'0', NULL, NULL, NULL), (N'111', N'1292621494837116928', NULL, N'', N'0', NULL, NULL, NULL), (N'112', N'1292621629260365824', NULL, N'', N'0', NULL, NULL, NULL), (N'113', N'1292622526073864192', NULL, N'', N'0', NULL, NULL, NULL), (N'114', N'1293470838745821184', NULL, N'', N'0', NULL, NULL, NULL), (N'115', N'1293471661785706496', NULL, N'', N'0', NULL, NULL, NULL), (N'116', N'1293472678392721408', NULL, N'', N'0', NULL, NULL, NULL), (N'117', N'1293472857510473728', NULL, N'', N'0', NULL, NULL, NULL), (N'118', N'1299273336009359360', NULL, N'', N'0', NULL, NULL, NULL), (N'119', N'1299273436282585088', NULL, N'', N'0', NULL, NULL, NULL), (N'120', N'1299273618470567936', NULL, N'', N'0', NULL, NULL, NULL), (N'121', N'1299273770182737920', NULL, N'', N'0', NULL, NULL, NULL), (N'122', N'1299273978023084032', NULL, N'', N'0', NULL, NULL, NULL), (N'123', N'1299274123225694208', NULL, N'', N'0', NULL, NULL, NULL), (N'124', N'1299274222299348992', NULL, N'', N'0', NULL, NULL, NULL), (N'125', N'1304238876758495232', NULL, N'', N'0', NULL, NULL, NULL), (N'126', N'1304678610343383040', NULL, N'', N'0', NULL, NULL, NULL), (N'127', N'1304679169305694208', NULL, N'', N'0', NULL, NULL, NULL), (N'128', N'1310460417141817344', NULL, N'', N'0', NULL, NULL, NULL), (N'129', N'1310502391475519488', NULL, N'', N'0', NULL, NULL, NULL), (N'130', N'1310515546943569920', NULL, N'', N'0', NULL, NULL, NULL), (N'131', N'1310515735292985344', NULL, N'', N'0', NULL, NULL, NULL), (N'132', N'1316628769783480320', NULL, N'', N'0', NULL, NULL, NULL), (N'133', N'1316628940663619584', NULL, N'', N'0', NULL, NULL, NULL), (N'134', N'1316629112428756992', NULL, N'', N'0', NULL, NULL, NULL), (N'135', N'1316652047017246720', NULL, N'', N'0', NULL, NULL, NULL), (N'136', N'1316913899996737536', NULL, N'', N'0', NULL, NULL, NULL), (N'137', N'1319200951383199744', NULL, N'', N'0', NULL, NULL, NULL), (N'138', N'1319221929807024128', NULL, N'', N'0', NULL, NULL, NULL), (N'139', N'1319554431134306304', NULL, N'', N'0', NULL, NULL, NULL), (N'140', N'1319554550458060800', NULL, N'', N'0', NULL, NULL, NULL), (N'141', N'1319554948434595840', NULL, N'', N'0', NULL, NULL, NULL), (N'142', N'1319555067183730688', NULL, N'', N'0', NULL, NULL, NULL), (N'143', N'1319555230765780992', NULL, N'', N'0', NULL, NULL, NULL), (N'144', N'1319555333790470144', NULL, N'', N'0', NULL, NULL, NULL), (N'145', N'1321001932510203904', NULL, N'', N'0', NULL, NULL, NULL), (N'146', N'1321002059803136000', NULL, N'', N'0', NULL, NULL, NULL), (N'147', N'1321002256440496128', NULL, N'', N'0', NULL, NULL, NULL), (N'148', N'1321002350686507008', NULL, N'', N'0', NULL, NULL, NULL), (N'149', N'1322190027988525056', NULL, N'', N'0', NULL, NULL, NULL) GO COMMIT @@ -486,7 +486,7 @@ GO BEGIN TRANSACTION GO -INSERT INTO [apigateway].[appapigatewayreroute] VALUES (N'4', N'{}', N'84059fcecc91498b9beafac914865e2c', N'1261299170387169280', N'【后台管理】- 权限管理', N'/api/permission-management/permissions', N'', NULL, N'/api/permission-management/permissions', N'GET,PUT,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30010,', N'', NULL, NULL, NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'5', N'{}', N'f2312eed73cc4d3cbefcd1816849fd74', N'1261585859064872960', N'【身份认证服务】- 客户端', N'/api/identity-server/clients', N'', NULL, N'/api/identity-server/clients', N'POST,GET,', N'', N'', N'X-Forwarded-For:{RemoteIpAddress},', N'', N'', N'', NULL, N'1', N'', NULL, N'HTTP', N'127.0.0.1:30015,', N'', NULL, NULL, NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'6', N'{}', N'b764ec7b994147abb12974bfcee4a0a9', N'1261586605810368512', N'【身份认证服务】- 管理客户端', N'/api/identity-server/clients/{Id}', N'', NULL, N'/api/identity-server/clients/{Id}', N'GET,DELETE,PUT,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30015,', N'', NULL, NULL, NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'7', N'{}', N'b4ce189320804dc6b87e602594e93d35', N'1261587558609436672', N'【服务网关管理】- 路由组管理', N'/api/ApiGateway/RouteGroups', N'', N'', N'/api/ApiGateway/RouteGroups', N'GET,POST,PUT,DELETE,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30001,', N'', NULL, N'', NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'8', N'{}', N'8736fefa36da4b129f3fcf6aa095f2ce', N'1261588213298348032', N'【服务网关管理】- 查询单个路由组', N'/api/ApiGateway/RouteGroups/By-AppId/{AppId}', N'', N'', N'/api/ApiGateway/RouteGroups/By-AppId/{AppId}', N'GET,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30001,', N'', NULL, N'', NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'9', N'{}', N'befd14ad39e244bc9dea7e0c01e642ce', N'1261588367619375104', N'【服务网关管理】- 查询所有有效路由组', N'/api/ApiGateway/RouteGroups/Actived', N'', N'', N'/api/ApiGateway/RouteGroups/Actived', N'GET,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30001,', N'', NULL, N'', NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'10', N'{}', N'0a95945d77144ce69addb0d1e8d37837', N'1261588628450557952', N'【服务网关管理】- 基础配置', N'/api/ApiGateway/Globals', N'', N'', N'/api/ApiGateway/Globals', N'GET,POST,PUT,DELETE,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30001,', N'', NULL, N'', NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'11', N'{}', N'70ee7f919bf44b42b549c905316bfd75', N'1261588881564221440', N'【服务网关管理】- 查询单个基础配置', N'/api/ApiGateway/Globals/By-AppId/{AppId}', N'', N'', N'/api/ApiGateway/Globals/By-AppId/{AppId}', N'GET,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30001,', N'', NULL, N'', NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'12', N'{}', N'caf54542d561428a9123ebed88e4b2e9', N'1261588983053795328', N'【服务网关管理】- 路由配置', N'/api/ApiGateway/Routes', N'', N'', N'/api/ApiGateway/Routes', N'GET,POST,PUT,DELETE,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30001,', N'', NULL, N'', NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'13', N'{}', N'df6c48fdaab44a37842992ae61c59dc5', N'1261589139039961088', N'【服务网关管理】- 通过标识查询路由', N'/api/ApiGateway/Routes/By-RouteId/{RouteId}', N'', N'', N'/api/ApiGateway/Routes/By-RouteId/{RouteId}', N'GET,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30001,', N'', NULL, N'', NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'14', N'{}', N'aaeaedebd24a4011ad565b5559f84c5f', N'1261589197483393024', N'【服务网关管理】- 通过名称查询路由', N'/api/ApiGateway/Routes/By-RouteName/{RouteName}', N'', N'', N'/api/ApiGateway/Routes/By-RouteName/{RouteName}', N'GET,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30001,', N'', NULL, N'', NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'15', N'{}', N'559c9f1b2b8c44caac86f7a643a16aaa', N'1261589278857084928', N'【服务网关管理】- 通过应用标识查询路由', N'/api/ApiGateway/Routes/By-AppId/{AppId}', N'', N'', N'/api/ApiGateway/Routes/By-AppId/{AppId}', N'GET,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30001,', N'', NULL, N'', NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'16', N'{}', N'00d0a12f403a4a919c99c534bd76d0d0', N'1261589420356124672', N'【服务网关管理】- 清空应用标识下所有路由', N'/api/ApiGateway/Routes/Clear', N'', N'', N'/api/ApiGateway/Routes/Clear', N'DELETE,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30001,', N'', NULL, N'', NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'17', N'{}', N'8c308f1386ad49c799cd281eb95170ac', N'1261589960393736192', N'【服务网关管理】- 通过应用标识查询动态路由', N'/api/ApiGateway/DynamicRoutes/By-AppId/{AppId}', N'', NULL, N'/api/ApiGateway/DynamicRoutes/By-AppId/{AppId}', N'GET,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30001,', N'', NULL, NULL, NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'18', N'{}', N'e659ebbf61534a978335cfeabdc0b375', N'1261606600242085888', N'【服务网关管理】- 通过应用标识查询聚合路由', N'/api/ApiGateway/Aggregates/by-AppId/{AppId}', N'', NULL, N'/api/ApiGateway/Aggregates/by-AppId/{AppId}', N'GET,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30001,', N'', NULL, NULL, NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'19', N'{}', N'd665e4491b81413385858601d9cf9a1d', N'1261606689601732608', N'【服务网关管理】- 聚合路由', N'/api/ApiGateway/Aggregates', N'', NULL, N'/api/ApiGateway/Aggregates', N'GET,POST,PUT,DELETE,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30001,', N'', NULL, NULL, NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'22', N'{}', N'2aad614e2c2a497593a4784ff639c3d9', N'1262220447629058048', N'【身份认证服务】- 克隆客户端', N'/api/identity-server/clients/{id}/clone', N'', NULL, N'/api/identity-server/clients/{id}/clone', N'POST,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30015,', N'', NULL, NULL, NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'23', N'{}', N'1504c5e4a7334298878339a305445b21', N'1262230734939758592', N'【身份认证服务】- 可用的Api资源', N'/api/identity-server/clients/assignable-api-resources', N'', NULL, N'/api/identity-server/clients/assignable-api-resources', N'GET,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30015,', N'', NULL, N'assignable-api-resources', NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'25', N'{}', N'53dd1751d9104940a966006a5e93d1fa', N'1262296916350869504', N'【身份认证服务】- 可用的身份资源', N'/api/identity-server/clients/assignable-identity-resources', N'', NULL, N'/api/identity-server/clients/assignable-identity-resources', N'GET,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30015,', N'', NULL, N'assignable-identity-resources', NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'26', N'{}', N'3fccd1318d0d47d9aef85542668829a6', N'1262632376348594176', N'【身份认证服务】- Api资源', N'/api/identity-server/api-resources', N'', N'', N'/api/identity-server/api-resources', N'GET,POST,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'27', N'{}', N'de6bd0ddea6d4019b4855be5442fafdc', N'1262632791869902848', N'【身份认证服务】- 管理Api资源', N'/api/identity-server/api-resources/{id}', N'', N'', N'/api/identity-server/api-resources/{id}', N'GET,DELETE,PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'30', N'{}', N'0f9875697b74420c9dc2eaf77099b210', N'1262660336921235456', N'【身份认证服务】- 用户登录', N'/api/account/login', N'', N'', N'/api/account/login', N'POST,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'31', N'{}', N'a890c6ecc6a64c9fa313a0f6b5406e1c', N'1262660528277966848', N'【身份认证服务】- 用户登出', N'/api/account/logout', N'', N'', N'/api/account/logout', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'32', N'{}', N'88de580b6beb4d9d9d4367840ba1fcea', N'1262660706875625472', N'【身份认证服务】- 检查密码', N'/api/account/checkPassword', N'', N'', N'/api/account/checkPassword', N'POST,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'33', N'{}', N'78f3c1adc7a54696af37a419eda47c62', N'1262660966393991168', N'【身份认证服务】- 个人信息页', N'/api/identity/my-profile', N'', N'', N'/api/identity/my-profile', N'GET,PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'34', N'{}', N'95b23aa5cebb40598a78c0761cfd0b26', N'1262661109474283520', N'【身份认证服务】- 修改密码', N'/api/identity/my-profile/change-password', N'', N'', N'/api/identity/my-profile/change-password', N'POST,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'35', N'{}', N'4828f7c2aff8485189f37aba5de62d60', N'1262663888804663296', N'【身份认证管理】- 角色管理', N'/api/identity/roles', N'', N'', N'/api/identity/roles', N'GET,POST,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'36', N'{}', N'0fddcd3b50a24c6795ec9034fdb44778', N'1262664024096133120', N'【身份认证服务】- 角色列表', N'/api/identity/roles/all', N'', N'', N'/api/identity/roles/all', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'37', N'{}', N'191e555219e845069dfd93793263a840', N'1262664186252120064', N'【身份认证服务】- 单个角色', N'/api/identity/roles/{id}', N'', N'', N'/api/identity/roles/{id}', N'GET,PUT,DELETE,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'38', N'{}', N'c316858e82f74e6ca6e923d6b3a3fa76', N'1262664357044178944', N'【身份认证服务】- 用户注册', N'/api/account/register', N'', N'', N'/api/account/register', N'POST,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'39', N'{}', N'db53b6f957914a10a6a97ba306b1f6ef', N'1262664632928718848', N'【身份认证服务】- 单个用户', N'/api/identity/users/{id}', N'', N'', N'/api/identity/users/{id}', N'GET,PUT,DELETE,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'40', N'{}', N'1833434b8ce34f8ab791e7e950f4c61f', N'1262664751409418240', N'【身份认证服务】- 用户管理', N'/api/identity/users', N'', N'', N'/api/identity/users', N'GET,POST,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'41', N'{}', N'b3c963a1612144918bffaf272697498c', N'1262664871274237952', N'【身份认证服务】- 用户角色', N'/api/identity/users/{id}/roles', N'', N'', N'/api/identity/users/{id}/roles', N'GET,POST,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'42', N'{}', N'33dd757b79cb4f52994af13bfb4f6783', N'1262665026111164416', N'【身份认证服务】- 通过用户名查询用户', N'/api/identity/users/by-username/{userName}', N'', N'', N'/api/identity/users/by-username/{userName}', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'43', N'{}', N'e46fd6cb3a104da3aadfe0149fe4de68', N'1262665159905267712', N'【身份认证服务】- 通过邮件查询用户', N'/api/identity/users/by-email/{email}', N'', N'', N'/api/identity/users/by-email/{email}', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'44', N'{}', N'8c8ec5ad6aaa4145981ee7ac876c36c9', N'1262665329829105664', N'【身份认证服务】- 通过标识查询用户', N'/api/identity/users/lookup/{id}', N'', N'', N'/api/identity/users/lookup/{id}', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'45', N'{}', N'f5c0c8c02c0846fdbe5015cd86f3d81b', N'1262665456471920640', N'【身份认证服务】- 通过名称查询用户', N'/api/identity/users/lookup/by-username/{userName}', N'', N'', N'/api/identity/users/lookup/by-username/{userName}', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'46', N'{}', N'ecf0ea4a3e3c4b2e8fa3621514d00c74', N'1262665628165754880', N'【基础服务】- 通过名称查询租户', N'/api/abp/multi-tenancy/tenants/by-name/{name}', N'', N'', N'/api/abp/multi-tenancy/tenants/by-name/{name}', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30010,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'47', N'{}', N'69132bc515b64005af4292ce0dee5626', N'1262666172682883072', N'【基础服务】- 通过标识查询租户', N'/api/abp/multi-tenancy/tenants/by-id/{id}', N'', N'', N'/api/abp/multi-tenancy/tenants/by-id/{id}', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30010,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'49', N'{}', N'35f48d7bc3694bbf95d64fe59aa631ac', N'1262723402331885568', N'【身份认证服务】- 已有的跨域资源', N'/api/identity-server/clients/distinct-cors-origins', N'', N'', N'/api/identity-server/clients/distinct-cors-origins', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'distinct-cors-origins', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'50', N'{}', N'f333d028839d4fc2aafa8509e674d7dd', N'1262935771746734080', N'【身份认证服务】- 身份资源', N'/api/identity-server/identity-resources', N'', N'', N'/api/identity-server/identity-resources', N'GET,POST,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'51', N'{}', N'dffd1bfaca5b4c1890221678f2b16cd5', N'1262935906522304512', N'【身份认证服务】- 身份资源管理', N'/api/identity-server/identity-resources/{id}', N'', N'', N'/api/identity-server/identity-resources/{id}', N'GET,PUT,DELETE,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'54', N'{}', N'7b847d8434bc4d1db07fa8961d90c14a', N'1263074419073593344', N'【服务网关管理】- 接口代理', N'/api/abp/api-definition', N'', N'', N'/api/abp/apigateway/api-definition', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30001,', N'', N'', N'apigateway-api-definition', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'55', N'{}', N'ca2cedfa620045a9adef0be2f958c4bc', N'1263075249394790400', N'【服务网关管理】- 查询聚合路由', N'/api/ApiGateway/Aggregates/{RouteId}', N'', N'', N'/api/ApiGateway/Aggregates/{RouteId}', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30001,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'57', N'{}', N'98fbc99fc8644946ac0a72cc3dc5fd1f', N'1263075593499684864', N'【服务网关管理】- 聚合路由配置', N'/api/ApiGateway/Aggregates/RouteConfig', N'', N'', N'/api/ApiGateway/Aggregates/RouteConfig', N'POST,DELETE,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30001,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'59', N'{}', N'c692b30c72d4424eb4740ac49f4e9373', N'1263101898440146944', N'【服务网关管理】- 框架配置', N'/api/abp/application-configuration', N'', N'', N'/api/abp/apigateway/application-configuration', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30001,', N'', N'', N'apigateway-configuration', N'0', N'120000', N'1', N'', N'TEST-APP'), (N'60', N'{}', N'8409117162504f71aa66982f05c38a80', N'1263303878648569856', N'【平台服务】- 接口代理', N'/api/abp/api-definition', N'', N'', N'/api/abp/platform/api-definition', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30025,', N'', N'', N'platform-api-definition', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'61', N'{}', N'9f520820071b4e14bc94ab57989cea1f', N'1263304204797648896', N'【平台服务】- 框架配置', N'/api/abp/application-configuration', N'', N'', N'/api/abp/platform/application-configuration', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30025,', N'', N'', N'platform-configuration', N'0', N'120000', N'1', N'', N'TEST-APP'), (N'62', N'{}', N'530ab314560f41678b40f48da9383d51', N'1263304872891555840', N'【后台管理】- 租户管理', N'/api/tenant-management/tenants', N'', N'', N'/api/tenant-management/tenants', N'GET,POST,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30010,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'63', N'{}', N'21334c6da4c349cc883c38c13de0e754', N'1263305106250047488', N'【后台管理】- 特定租户管理', N'/api/tenant-management/tenants/{id}', N'', N'', N'/api/tenant-management/tenants/{id}', N'GET,PUT,DELETE,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30010,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'64', N'{}', N'cc8fdf1b2d0b414ebf2dc51a6dc78305', N'1263305244594970624', N'【后台管理】- 租户连接字符串', N'/api/tenant-management/tenants/{id}/connection-string', N'', N'', N'/api/tenant-management/tenants/{id}/concatenation', N'GET,PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30010,', N'', N'', N'', N'2', N'30000', N'1', N'', N'TEST-APP'), (N'65', N'{}', N'aaf285ed10da4024ba561d5cf8c6322b', N'1263305430536855552', N'【后台管理】- 特定租户连接字符串', N'/api/tenant-management/tenants/{id}/connection-string/{name}', N'', N'', N'/api/tenant-management/tenants/{id}/concatenation/{name}', N'GET,DELETE,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30010,', N'', N'', N'', N'1', N'30000', N'1', N'', N'TEST-APP'), (N'66', N'{}', N'b6ec80673b354c239def3bdce31b4cc0', N'1263639172959174656', N'【后台管理】- 全局设置', N'/api/setting-management/settings/by-global', N'', N'', N'/api/setting-management/settings/by-global', N'GET,PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30010,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'67', N'{}', N'755b4dce5c34444785fa3b647fef4131', N'1264799968944640000', N'【身份认证服务】- 验证手机号', N'/api/account/phone/verify', N'', N'', N'/api/account/phone/verify', N'POST,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'68', N'{}', N'535191c570ae453ab320012304d7a62c', N'1264800070161584128', N'【身份认证服务】- 手机号注册', N'/api/account/phone/register', N'', N'', N'/api/account/phone/register', N'POST,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'69', N'{}', N'723c9b111f9f4a1aa804118cdde193d3', N'1267360794414161920', N'【消息服务】- 通知', N'/signalr-hubs/notifications/{everything}', N'', N'', N'/signalr-hubs/notifications/{everything}', N'POST,GET,OPTIONS,PUT,DELETE,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'ws', N'127.0.0.1:30020,', N'', N'', N'', N'1', N'30000', N'1', N'', N'TEST-APP'), (N'70', N'{}', N'f3aa2b42dd9f468aa5aae4ef64754427', N'1267383367629807616', N'【消息服务】- 通知0', N'/signalr-hubs/notifications', N'', N'', N'/signalr-hubs/notifications', N'GET,POST,PUT,DELETE,OPTIONS,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'ws', N'127.0.0.1:30020,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'71', N'{}', N'99dc8259c50044008c8aede7442ddde3', N'1267817055527632896', N'【消息服务】- 聊天', N'/signalr-hubs/message', N'', N'', N'/signalr-hubs/message', N'GET,POST,PUT,DELETE,OPTIONS,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'ws', N'127.0.0.1:30020,', N'', N'', N'', N'1', N'30000', N'1', N'', N'TEST-APP'), (N'72', N'{}', N'4ec40b72d469474ba10ae02e8d3298bb', N'1267817221286526976', N'【消息服务】- 聊天1', N'/signalr-hubs/message/{everything}', N'', N'', N'/signalr-hubs/message/{everything}', N'GET,POST,PUT,DELETE,OPTIONS,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'ws', N'127.0.0.1:30020,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'73', N'{}', N'cfb5f09a12bf495fbcaf2fa5d9123a40', N'1268893687085518848', N'【身份认证服务】- 重置密码', N'/api/account/phone/reset-password', N'', N'', N'/api/account/phone/reset-password', N'PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'1', N'30000', N'1', N'', N'TEST-APP'), (N'101', N'{}', N'997a4c27a433458aafed9b8aa252d957', N'1288657613998579712', N'【身份认证服务】- 组织机构列表', N'/api/identity/organization-units', N'', N'', N'/api/identity/organization-units', N'GET,POST,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'102', N'{}', N'a2c6acc9882a425ab26bd3ad5a9c17c6', N'1288657941770854400', N'【身份认证服务】- 组织机构管理', N'/api/identity/organization-units/{id}', N'', N'', N'/api/identity/organization-units/{id}', N'GET,PUT,DELETE,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'1', N'30000', N'1', N'', N'TEST-APP'), (N'103', N'{}', N'390acfb0e16943c6b61e731d47c282e9', N'1288658134067109888', N'【身份认证服务】- 组织机构移动', N'/api/identity/organization-units/{id}/move', N'', N'', N'/api/identity/organization-units/{id}/move', N'PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'104', N'{}', N'3515e75becf9447492ad60466b27c397', N'1288658305156964352', N'【身份认证服务】- 查询组织机构子级', N'/api/identity/organization-units/find-children', N'', N'', N'/api/identity/organization-units/find-children', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'105', N'{}', N'aab0a24d930f4f9687497e5ccaac2a31', N'1288658491216289792', N'【身份认证服务】- 查询组织机构最后一个子节点', N'/api/identity/organization-units/last-children', N'', N'', N'/api/identity/organization-units/last-children', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'106', N'{}', N'9b7c999b1c5140c497bc15914a815401', N'1288658638302142464', N'【身份认证服务】- 未加入组织机构角色', N'/api/identity/organization-units/{id}/unadded-roles', N'', N'', N'/api/identity/organization-units/{id}/unadded-roles', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'107', N'{}', N'b0cdb3f6908e42bd934ca99a78f22c3f', N'1288658791784308736', N'【身份认证服务】- 未加入组织机构用户', N'/api/identity/organization-units/{id}/unadded-users', N'', N'', N'/api/identity/organization-units/{id}/unadded-users', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'108', N'{}', N'1982bc6ffd92445b9b3f47067378d1fc', N'1290849478956199936', N'【后台管理】- 当前租户设置', N'/api/setting-management/settings/by-current-tenant', N'', N'', N'/api/setting-management/settings/by-current-tenant', N'GET,PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30010,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'109', N'{}', N'a7df3a04805d4cc8a6e6b3823c6dd468', N'1290849628051124224', N'【后台管理】- 用户设置', N'/api/setting-management/settings/by-user/{userId}', N'', N'', N'/api/setting-management/settings/by-user/{userId}', N'GET,PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30010,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'110', N'{}', N'ef6e38a529a345fab67f6a627cf20635', N'1290849798553776128', N'【后台管理】- 当前用户设置', N'/api/setting-management/settings/by-current-user', N'', N'', N'/api/setting-management/settings/by-current-user', N'GET,PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30010,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'112', N'{}', N'9844fed6507844f2ac64bd08649bd3a6', N'1291259822512693248', N'【身份认证服务】- 查询组织机构根节点', N'/api/identity/organization-units/root-node', N'', N'', N'/api/identity/organization-units/root-node', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'113', N'{}', N'24d8794cf8f943b4ac45d2bcccf7c128', N'1292620505149145088', N'【平台服务】- 文件系统', N'/api/file-management/file-system', N'', N'', N'/api/file-management/file-system', N'GET,PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30025,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'114', N'{}', N'0acf6762d3af43efb655107e0039f5fc', N'1292620665505775616', N'【平台服务】- 文件系统 - 目录管理', N'/api/file-management/file-system/folders', N'', N'', N'/api/file-management/file-system/folders', N'POST,DELETE,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30025,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'115', N'{}', N'8b4363f70865419089b5f62ba35382df', N'1292620843398791168', N'【平台服务】- 文件系统 - 文件管理', N'/api/file-management/file-system/files', N'', N'', N'/api/file-management/file-system/files', N'GET,POST,DELETE,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30025,', N'', N'', N'', N'0', N'1200000', N'1', N'', N'TEST-APP'), (N'116', N'{}', N'7eb315567bbc470bbbfd26923c5d0aba', N'1292621027574874112', N'【平台服务】- 文件系统 - 复制目录', N'/api/file-management/file-system/folders/copy', N'', N'', N'/api/file-management/file-system/folders/copy', N'PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30025,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'117', N'{}', N'af5853680cff454fa66ff6022f18da23', N'1292621363161137152', N'【平台服务】- 文件系统 - 移动目录', N'/api/file-management/file-system/folders/move', N'', N'', N'/api/file-management/file-system/folders/move', N'PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30025,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'118', N'{}', N'6daa6d8c8adb466899988fd8181c29a8', N'1292621494837116928', N'【平台服务】- 文件系统 - 复制文件', N'/api/file-management/file-system/files/copy', N'', N'', N'/api/file-management/file-system/files/copy', N'PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30025,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'119', N'{}', N'9560caaa3bd9424984c44724aa54bfe9', N'1292621629260365824', N'【平台服务】- 文件系统 - 移动文件', N'/api/file-management/file-system/files/move', N'', N'', N'/api/file-management/file-system/files/move', N'PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30025,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'120', N'{}', N'fc2aaa6035484201b9014912930fb7cb', N'1292622526073864192', N'【平台服务】- 文件系统 - 详情页', N'/api/file-management/file-system/profile', N'', N'', N'/api/file-management/file-system/profile', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30025,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'121', N'{}', N'c6c7b027000942dda8ba0d2e2d8cf705', N'1293470838745821184', N'【后台管理】- 框架配置', N'/api/abp/application-configuration', N'', N'', N'/api/abp/backend-admin/application-configuration', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30010,', N'', N'', N'backend-admin-configuration', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'122', N'{}', N'becd4342079d4399abda5b5ba3b46fdc', N'1293471661785706496', N'【消息服务】- 框架配置', N'/api/abp/application-configuration', N'', N'', N'/api/abp/messages/application-configuration', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30020,', N'', N'', N'messages-configuration', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'123', N'{}', N'c828140cee3043c18ffc274f6461f0f2', N'1293472678392721408', N'【后台管理】- 接口代理', N'/api/abp/api-definition', N'', N'', N'/api/abp/backend-admin/api-definition', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30010,', N'', N'', N'backend-admin-api-definition', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'124', N'{}', N'e683cff8066d4c2899a17d0f618f1a0b', N'1293472857510473728', N'【消息服务】- 接口代理', N'/api/abp/api-definition', N'', N'', N'/api/abp/messages/api-definition', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30020,', N'', N'', N'messages-api-definition', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'125', N'{}', N'0e9c3bff5b58428eba97a5516140ba5e', N'1299273336009359360', N'【消息服务】- Hangfire仪表板 ', N'/hangfire', N'', N'', N'/hangfire', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30020,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'126', N'{}', N'e906924ad3a947cf8e6956e2dd258192', N'1299273436282585088', N'【消息服务】- Hangfire仪表板 - 主页', N'/hangfire/', N'', N'', N'/hangfire/', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30020,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'127', N'{}', N'e02f2049efbc4ee1ad6629bd0341ed2b', N'1299273618470567936', N'【消息服务】- Hangfire仪表板 - 状态', N'/hangfire/stats', N'', N'', N'/hangfire/stats', N'POST,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30020,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'128', N'{}', N'f8d2b2f0f1d649c2a07eeef23d6adb0e', N'1299273770182737920', N'【消息服务】- Hangfire仪表板 - 作业管理', N'/hangfire/jobs/{everything}', N'', N'', N'/hangfire/jobs/{everything}', N'GET,POST,PUT,DELETE,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30020,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'129', N'{}', N'9785be7a29774b468e271b23009fe115', N'1299273978023084032', N'【消息服务】- Hangfire仪表板 - 重试', N'/hangfire/retries', N'', N'', N'/hangfire/retries', N'GET,POST,PUT,DELETE,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30020,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'130', N'{}', N'9c0c1cd196bb45c0bc03fafb7a1eb8f2', N'1299274123225694208', N'【消息服务】- Hangfire仪表板 - 周期性作业', N'/hangfire/recurring', N'', N'', N'/hangfire/recurring', N'GET,POST,DELETE,PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30020,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'131', N'{}', N'243bafe828be463ea63a3e2b521f9923', N'1299274222299348992', N'【消息服务】- Hangfire仪表板 - 服务器列表', N'/hangfire/servers', N'', N'', N'/hangfire/servers', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30020,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'132', N'{}', N'57a8ac1b41bb434cad38fbde0e2ba2f0', N'1304238876758495232', N'【后台管理】- 管理功能', N'/api/feature-management/features', N'', N'', N'/api/feature-management/features', N'GET,PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30010,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'133', N'{}', N'40a150f629b047f587c91a9436a699c0', N'1304678610343383040', N'【身份认证服务】- 接口代理', N'/api/abp/api-definition', N'', N'', N'/api/abp/identity-server/api-definition', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'identity-server-api-definition', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'134', N'{}', N'3a2d5d538fa44ac690402fc5c4e1a401', N'1304679169305694208', N'【身份认证服务】- 框架配置', N'/api/abp/application-configuration', N'', N'', N'/api/abp/identity-server/application-configuration', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'identity-server-configuration', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'135', N'{}', N'2ecfe7483bc94c28ad0769b654eb765d', N'1310460417141817344', N'【后台管理】- 审计日志列表', N'/api/auditing/audit-log', N'', N'', N'/api/auditing/audit-log', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30010,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'136', N'{}', N'744e340c0024462d88458b7ea9605b3c', N'1310502391475519488', N'【后台服务】- 安全日志列表', N'/api/auditing/security-log', N'', N'', N'/api/auditing/security-log', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30010,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'137', N'{}', N'a99639f4172547c4ba9b4f4ca5cb4ab9', N'1310515546943569920', N'【后台服务】- 安全日志', N'/api/auditing/security-log/{id}', N'', N'', N'/api/auditing/security-log/{id}', N'DELETE,GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30010,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'138', N'{}', N'c3ebc82d55f640fb9d70a911e97e4ec1', N'1310515735292985344', N'【后台管理】- 审计日志', N'/api/auditing/audit-log/{id}', N'', N'', N'/api/auditing/audit-log/{id}', N'DELETE,GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30010,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'139', N'{}', N'0379fcb3a9cd4b13b562b3b5b5c3eb7d', N'1316628769783480320', N'【身份认证服务】- 声明类型', N'/api/identity/claim-types', N'', N'', N'/api/identity/claim-types', N'GET,POST,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'140', N'{}', N'de25c9a80d994f728b37eb483b2f5127', N'1316628940663619584', N'【身份认证服务】- 管理声明类型', N'/api/identity/claim-types/{id}', N'', N'', N'/api/identity/claim-types/{id}', N'GET,PUT,DELETE,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'141', N'{}', N'25c19106baff4cf3a877ae8cd690a1b5', N'1316629112428756992', N'【身份认证服务】- 查询在用的声明类型列表', N'/api/identity/claim-types/actived-list', N'', N'', N'/api/identity/claim-types/actived-list', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'142', N'{}', N'd42f8b779cf344eeaa24df0ae37fb7cf', N'1316652047017246720', N'【身份认证服务】- 管理用户声明', N'/api/identity/users/claims/{id}', N'', N'', N'/api/identity/users/claims/{id}', N'POST,PUT,DELETE,GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'143', N'{}', N'b86af44a34a14db4b482df8550f1bde1', N'1316913899996737536', N'【身份认证管理】- 管理角色声明', N'/api/identity/roles/claims/{id}', N'', N'', N'/api/identity/roles/claims/{id}', N'GET,POST,PUT,DELETE,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'144', N'{}', N'51a14bc295044de985ae014fbcc5bddf', N'1319200951383199744', N'【IdentityServer4】- 发现端点', N'/.well-known/openid-configuration', N'', N'', N'/.well-known/openid-configuration', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:44385,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'145', N'{}', N'9d859a444d774e93818237e53b6cc102', N'1319221929807024128', N'【身份认证服务】- 查询所有组织机构', N'/api/identity/organization-units/all', N'', N'', N'/api/identity/organization-units/all', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'146', N'{}', N'89f42175b24540caba2a1fded145acf8', N'1319554431134306304', N'【身份认证服务】- 管理组织机构用户', N'/api/identity/organization-units/{id}/users', N'', N'', N'/api/identity/organization-units/{id}/users', N'POST,GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'147', N'{}', N'126d82509cec43eda712e94737b01039', N'1319554550458060800', N'【身份认证服务】- 管理组织机构角色', N'/api/identity/organization-units/{id}/roles', N'', N'', N'/api/identity/organization-units/{id}/roles', N'POST,GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'148', N'{}', N'824f5eee6877489f96f1022e306c968a', N'1319554948434595840', N'【身份认证服务】- 管理角色组织机构', N'/api/identity/roles/{id}/organization-units', N'', N'', N'/api/identity/roles/{id}/organization-units', N'GET,PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'149', N'{}', N'fe1379d4a13f41afb6410f4c948871f3', N'1319555067183730688', N'【身份认证服务】- 删除角色组织机构', N'/api/identity/roles/{id}/organization-units/{ouId}', N'', N'', N'/api/identity/roles/{id}/organization-units/{ouId}', N'DELETE,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'150', N'{}', N'197a69bb723346aba3601bd61e7fa655', N'1319555230765780992', N'【身份认证服务】- 管理用户组织机构', N'/api/identity/users/{id}/organization-units', N'', N'', N'/api/identity/users/{id}/organization-units', N'GET,PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'151', N'{}', N'1a7e6d0b1c95484f82a75a2ce6e6f453', N'1319555333790470144', N'【身份认证服务】- 删除用户组织机构', N'/api/identity/users/{id}/organization-units/{ouId}', N'', N'', N'/api/identity/users/{id}/organization-units/{ouId}', N'DELETE,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP') +INSERT INTO [apigateway].[appapigatewayreroute] VALUES (N'4', N'{}', N'84059fcecc91498b9beafac914865e2c', N'1261299170387169280', N'【后台管理】- 权限管理', N'/api/permission-management/permissions', N'', NULL, N'/api/permission-management/permissions', N'GET,PUT,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30010,', N'', NULL, NULL, NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'5', N'{}', N'f2312eed73cc4d3cbefcd1816849fd74', N'1261585859064872960', N'【身份认证服务】- 客户端', N'/api/identity-server/clients', N'', NULL, N'/api/identity-server/clients', N'POST,GET,', N'', N'', N'X-Forwarded-For:{RemoteIpAddress},', N'', N'', N'', NULL, N'1', N'', NULL, N'HTTP', N'127.0.0.1:30015,', N'', NULL, NULL, NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'6', N'{}', N'b764ec7b994147abb12974bfcee4a0a9', N'1261586605810368512', N'【身份认证服务】- 管理客户端', N'/api/identity-server/clients/{Id}', N'', NULL, N'/api/identity-server/clients/{Id}', N'GET,DELETE,PUT,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30015,', N'', NULL, NULL, NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'7', N'{}', N'b4ce189320804dc6b87e602594e93d35', N'1261587558609436672', N'【服务网关管理】- 路由组管理', N'/api/ApiGateway/RouteGroups', N'', N'', N'/api/ApiGateway/RouteGroups', N'GET,POST,PUT,DELETE,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30001,', N'', NULL, N'', NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'8', N'{}', N'8736fefa36da4b129f3fcf6aa095f2ce', N'1261588213298348032', N'【服务网关管理】- 查询单个路由组', N'/api/ApiGateway/RouteGroups/By-AppId/{AppId}', N'', N'', N'/api/ApiGateway/RouteGroups/By-AppId/{AppId}', N'GET,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30001,', N'', NULL, N'', NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'9', N'{}', N'befd14ad39e244bc9dea7e0c01e642ce', N'1261588367619375104', N'【服务网关管理】- 查询所有有效路由组', N'/api/ApiGateway/RouteGroups/Actived', N'', N'', N'/api/ApiGateway/RouteGroups/Actived', N'GET,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30001,', N'', NULL, N'', NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'10', N'{}', N'0a95945d77144ce69addb0d1e8d37837', N'1261588628450557952', N'【服务网关管理】- 基础配置', N'/api/ApiGateway/Globals', N'', N'', N'/api/ApiGateway/Globals', N'GET,POST,PUT,DELETE,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30001,', N'', NULL, N'', NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'11', N'{}', N'70ee7f919bf44b42b549c905316bfd75', N'1261588881564221440', N'【服务网关管理】- 查询单个基础配置', N'/api/ApiGateway/Globals/By-AppId/{AppId}', N'', N'', N'/api/ApiGateway/Globals/By-AppId/{AppId}', N'GET,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30001,', N'', NULL, N'', NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'12', N'{}', N'caf54542d561428a9123ebed88e4b2e9', N'1261588983053795328', N'【服务网关管理】- 路由配置', N'/api/ApiGateway/Routes', N'', N'', N'/api/ApiGateway/Routes', N'GET,POST,PUT,DELETE,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30001,', N'', NULL, N'', NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'13', N'{}', N'df6c48fdaab44a37842992ae61c59dc5', N'1261589139039961088', N'【服务网关管理】- 通过标识查询路由', N'/api/ApiGateway/Routes/By-RouteId/{RouteId}', N'', N'', N'/api/ApiGateway/Routes/By-RouteId/{RouteId}', N'GET,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30001,', N'', NULL, N'', NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'14', N'{}', N'aaeaedebd24a4011ad565b5559f84c5f', N'1261589197483393024', N'【服务网关管理】- 通过名称查询路由', N'/api/ApiGateway/Routes/By-RouteName/{RouteName}', N'', N'', N'/api/ApiGateway/Routes/By-RouteName/{RouteName}', N'GET,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30001,', N'', NULL, N'', NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'15', N'{}', N'559c9f1b2b8c44caac86f7a643a16aaa', N'1261589278857084928', N'【服务网关管理】- 通过应用标识查询路由', N'/api/ApiGateway/Routes/By-AppId/{AppId}', N'', N'', N'/api/ApiGateway/Routes/By-AppId/{AppId}', N'GET,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30001,', N'', NULL, N'', NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'16', N'{}', N'00d0a12f403a4a919c99c534bd76d0d0', N'1261589420356124672', N'【服务网关管理】- 清空应用标识下所有路由', N'/api/ApiGateway/Routes/Clear', N'', N'', N'/api/ApiGateway/Routes/Clear', N'DELETE,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30001,', N'', NULL, N'', NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'17', N'{}', N'8c308f1386ad49c799cd281eb95170ac', N'1261589960393736192', N'【服务网关管理】- 通过应用标识查询动态路由', N'/api/ApiGateway/DynamicRoutes/By-AppId/{AppId}', N'', NULL, N'/api/ApiGateway/DynamicRoutes/By-AppId/{AppId}', N'GET,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30001,', N'', NULL, NULL, NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'18', N'{}', N'e659ebbf61534a978335cfeabdc0b375', N'1261606600242085888', N'【服务网关管理】- 通过应用标识查询聚合路由', N'/api/ApiGateway/Aggregates/by-AppId/{AppId}', N'', NULL, N'/api/ApiGateway/Aggregates/by-AppId/{AppId}', N'GET,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30001,', N'', NULL, NULL, NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'19', N'{}', N'd665e4491b81413385858601d9cf9a1d', N'1261606689601732608', N'【服务网关管理】- 聚合路由', N'/api/ApiGateway/Aggregates', N'', NULL, N'/api/ApiGateway/Aggregates', N'GET,POST,PUT,DELETE,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30001,', N'', NULL, NULL, NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'22', N'{}', N'2aad614e2c2a497593a4784ff639c3d9', N'1262220447629058048', N'【身份认证服务】- 克隆客户端', N'/api/identity-server/clients/{id}/clone', N'', NULL, N'/api/identity-server/clients/{id}/clone', N'POST,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30015,', N'', NULL, NULL, NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'23', N'{}', N'1504c5e4a7334298878339a305445b21', N'1262230734939758592', N'【身份认证服务】- 可用的Api资源', N'/api/identity-server/clients/assignable-api-resources', N'', NULL, N'/api/identity-server/clients/assignable-api-resources', N'GET,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30015,', N'', NULL, N'assignable-api-resources', NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'25', N'{}', N'53dd1751d9104940a966006a5e93d1fa', N'1262296916350869504', N'【身份认证服务】- 可用的身份资源', N'/api/identity-server/clients/assignable-identity-resources', N'', NULL, N'/api/identity-server/clients/assignable-identity-resources', N'GET,', N'', N'', N'', N'', N'', N'', NULL, N'1', NULL, NULL, N'HTTP', N'127.0.0.1:30015,', N'', NULL, N'assignable-identity-resources', NULL, N'30000', N'1', NULL, N'TEST-APP'), (N'26', N'{}', N'3fccd1318d0d47d9aef85542668829a6', N'1262632376348594176', N'【身份认证服务】- Api资源', N'/api/identity-server/api-resources', N'', N'', N'/api/identity-server/api-resources', N'GET,POST,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'27', N'{}', N'de6bd0ddea6d4019b4855be5442fafdc', N'1262632791869902848', N'【身份认证服务】- 管理Api资源', N'/api/identity-server/api-resources/{id}', N'', N'', N'/api/identity-server/api-resources/{id}', N'GET,DELETE,PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'30', N'{}', N'0f9875697b74420c9dc2eaf77099b210', N'1262660336921235456', N'【身份认证服务】- 用户登录', N'/api/account/login', N'', N'', N'/api/account/login', N'POST,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'31', N'{}', N'a890c6ecc6a64c9fa313a0f6b5406e1c', N'1262660528277966848', N'【身份认证服务】- 用户登出', N'/api/account/logout', N'', N'', N'/api/account/logout', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'32', N'{}', N'88de580b6beb4d9d9d4367840ba1fcea', N'1262660706875625472', N'【身份认证服务】- 检查密码', N'/api/account/checkPassword', N'', N'', N'/api/account/checkPassword', N'POST,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'33', N'{}', N'78f3c1adc7a54696af37a419eda47c62', N'1262660966393991168', N'【身份认证服务】- 个人信息页', N'/api/identity/my-profile', N'', N'', N'/api/identity/my-profile', N'GET,PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'34', N'{}', N'95b23aa5cebb40598a78c0761cfd0b26', N'1262661109474283520', N'【身份认证服务】- 修改密码', N'/api/identity/my-profile/change-password', N'', N'', N'/api/identity/my-profile/change-password', N'POST,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'35', N'{}', N'4828f7c2aff8485189f37aba5de62d60', N'1262663888804663296', N'【身份认证管理】- 角色管理', N'/api/identity/roles', N'', N'', N'/api/identity/roles', N'GET,POST,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'36', N'{}', N'0fddcd3b50a24c6795ec9034fdb44778', N'1262664024096133120', N'【身份认证服务】- 角色列表', N'/api/identity/roles/all', N'', N'', N'/api/identity/roles/all', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'37', N'{}', N'191e555219e845069dfd93793263a840', N'1262664186252120064', N'【身份认证服务】- 单个角色', N'/api/identity/roles/{id}', N'', N'', N'/api/identity/roles/{id}', N'GET,PUT,DELETE,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'38', N'{}', N'c316858e82f74e6ca6e923d6b3a3fa76', N'1262664357044178944', N'【身份认证服务】- 用户注册', N'/api/account/register', N'', N'', N'/api/account/register', N'POST,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'39', N'{}', N'db53b6f957914a10a6a97ba306b1f6ef', N'1262664632928718848', N'【身份认证服务】- 单个用户', N'/api/identity/users/{id}', N'', N'', N'/api/identity/users/{id}', N'GET,PUT,DELETE,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'40', N'{}', N'1833434b8ce34f8ab791e7e950f4c61f', N'1262664751409418240', N'【身份认证服务】- 用户管理', N'/api/identity/users', N'', N'', N'/api/identity/users', N'GET,POST,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'41', N'{}', N'b3c963a1612144918bffaf272697498c', N'1262664871274237952', N'【身份认证服务】- 用户角色', N'/api/identity/users/{id}/roles', N'', N'', N'/api/identity/users/{id}/roles', N'GET,POST,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'42', N'{}', N'33dd757b79cb4f52994af13bfb4f6783', N'1262665026111164416', N'【身份认证服务】- 通过用户名查询用户', N'/api/identity/users/by-username/{userName}', N'', N'', N'/api/identity/users/by-username/{userName}', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'43', N'{}', N'e46fd6cb3a104da3aadfe0149fe4de68', N'1262665159905267712', N'【身份认证服务】- 通过邮件查询用户', N'/api/identity/users/by-email/{email}', N'', N'', N'/api/identity/users/by-email/{email}', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'44', N'{}', N'8c8ec5ad6aaa4145981ee7ac876c36c9', N'1262665329829105664', N'【身份认证服务】- 通过标识查询用户', N'/api/identity/users/lookup/{id}', N'', N'', N'/api/identity/users/lookup/{id}', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'45', N'{}', N'f5c0c8c02c0846fdbe5015cd86f3d81b', N'1262665456471920640', N'【身份认证服务】- 通过名称查询用户', N'/api/identity/users/lookup/by-username/{userName}', N'', N'', N'/api/identity/users/lookup/by-username/{userName}', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'46', N'{}', N'ecf0ea4a3e3c4b2e8fa3621514d00c74', N'1262665628165754880', N'【基础服务】- 通过名称查询租户', N'/api/abp/multi-tenancy/tenants/by-name/{name}', N'', N'', N'/api/abp/multi-tenancy/tenants/by-name/{name}', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30010,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'47', N'{}', N'69132bc515b64005af4292ce0dee5626', N'1262666172682883072', N'【基础服务】- 通过标识查询租户', N'/api/abp/multi-tenancy/tenants/by-id/{id}', N'', N'', N'/api/abp/multi-tenancy/tenants/by-id/{id}', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30010,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'49', N'{}', N'35f48d7bc3694bbf95d64fe59aa631ac', N'1262723402331885568', N'【身份认证服务】- 已有的跨域资源', N'/api/identity-server/clients/distinct-cors-origins', N'', N'', N'/api/identity-server/clients/distinct-cors-origins', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'distinct-cors-origins', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'50', N'{}', N'f333d028839d4fc2aafa8509e674d7dd', N'1262935771746734080', N'【身份认证服务】- 身份资源', N'/api/identity-server/identity-resources', N'', N'', N'/api/identity-server/identity-resources', N'GET,POST,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'51', N'{}', N'dffd1bfaca5b4c1890221678f2b16cd5', N'1262935906522304512', N'【身份认证服务】- 身份资源管理', N'/api/identity-server/identity-resources/{id}', N'', N'', N'/api/identity-server/identity-resources/{id}', N'GET,PUT,DELETE,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'54', N'{}', N'7b847d8434bc4d1db07fa8961d90c14a', N'1263074419073593344', N'【服务网关管理】- 接口代理', N'/api/abp/api-definition', N'', N'', N'/api/abp/apigateway/api-definition', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30001,', N'', N'', N'apigateway-api-definition', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'55', N'{}', N'ca2cedfa620045a9adef0be2f958c4bc', N'1263075249394790400', N'【服务网关管理】- 查询聚合路由', N'/api/ApiGateway/Aggregates/{RouteId}', N'', N'', N'/api/ApiGateway/Aggregates/{RouteId}', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30001,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'57', N'{}', N'98fbc99fc8644946ac0a72cc3dc5fd1f', N'1263075593499684864', N'【服务网关管理】- 聚合路由配置', N'/api/ApiGateway/Aggregates/RouteConfig', N'', N'', N'/api/ApiGateway/Aggregates/RouteConfig', N'POST,DELETE,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30001,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'59', N'{}', N'c692b30c72d4424eb4740ac49f4e9373', N'1263101898440146944', N'【服务网关管理】- 框架配置', N'/api/abp/application-configuration', N'', N'', N'/api/abp/apigateway/application-configuration', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30001,', N'', N'', N'apigateway-configuration', N'0', N'120000', N'1', N'', N'TEST-APP'), (N'60', N'{}', N'8409117162504f71aa66982f05c38a80', N'1263303878648569856', N'【平台服务】- 接口代理', N'/api/abp/api-definition', N'', N'', N'/api/abp/platform/api-definition', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30025,', N'', N'', N'platform-api-definition', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'61', N'{}', N'9f520820071b4e14bc94ab57989cea1f', N'1263304204797648896', N'【平台服务】- 框架配置', N'/api/abp/application-configuration', N'', N'', N'/api/abp/platform/application-configuration', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30025,', N'', N'', N'platform-configuration', N'0', N'120000', N'1', N'', N'TEST-APP'), (N'62', N'{}', N'530ab314560f41678b40f48da9383d51', N'1263304872891555840', N'【后台管理】- 租户管理', N'/api/tenant-management/tenants', N'', N'', N'/api/tenant-management/tenants', N'GET,POST,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30010,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'63', N'{}', N'21334c6da4c349cc883c38c13de0e754', N'1263305106250047488', N'【后台管理】- 特定租户管理', N'/api/tenant-management/tenants/{id}', N'', N'', N'/api/tenant-management/tenants/{id}', N'GET,PUT,DELETE,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30010,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'64', N'{}', N'cc8fdf1b2d0b414ebf2dc51a6dc78305', N'1263305244594970624', N'【后台管理】- 租户连接字符串', N'/api/tenant-management/tenants/{id}/connection-string', N'', N'', N'/api/tenant-management/tenants/{id}/concatenation', N'GET,PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30010,', N'', N'', N'', N'2', N'30000', N'1', N'', N'TEST-APP'), (N'65', N'{}', N'aaf285ed10da4024ba561d5cf8c6322b', N'1263305430536855552', N'【后台管理】- 特定租户连接字符串', N'/api/tenant-management/tenants/{id}/connection-string/{name}', N'', N'', N'/api/tenant-management/tenants/{id}/concatenation/{name}', N'GET,DELETE,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30010,', N'', N'', N'', N'1', N'30000', N'1', N'', N'TEST-APP'), (N'66', N'{}', N'b6ec80673b354c239def3bdce31b4cc0', N'1263639172959174656', N'【后台管理】- 全局设置', N'/api/setting-management/settings/by-global', N'', N'', N'/api/setting-management/settings/by-global', N'GET,PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30010,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'67', N'{}', N'755b4dce5c34444785fa3b647fef4131', N'1264799968944640000', N'【身份认证服务】- 验证手机号', N'/api/account/phone/verify', N'', N'', N'/api/account/phone/verify', N'POST,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'68', N'{}', N'535191c570ae453ab320012304d7a62c', N'1264800070161584128', N'【身份认证服务】- 手机号注册', N'/api/account/phone/register', N'', N'', N'/api/account/phone/register', N'POST,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'69', N'{}', N'723c9b111f9f4a1aa804118cdde193d3', N'1267360794414161920', N'【消息服务】- 通知', N'/signalr-hubs/notifications/{everything}', N'', N'', N'/signalr-hubs/notifications/{everything}', N'POST,GET,OPTIONS,PUT,DELETE,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'ws', N'127.0.0.1:30020,', N'', N'', N'', N'1', N'30000', N'1', N'', N'TEST-APP'), (N'70', N'{}', N'f3aa2b42dd9f468aa5aae4ef64754427', N'1267383367629807616', N'【消息服务】- 通知0', N'/signalr-hubs/notifications', N'', N'', N'/signalr-hubs/notifications', N'GET,POST,PUT,DELETE,OPTIONS,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'ws', N'127.0.0.1:30020,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'71', N'{}', N'0344947bb79b401baa2ef7b4e58297f6', N'1267817055527632896', N'【消息服务】- 聊天', N'/signalr-hubs/messages', N'', N'', N'/signalr-hubs/messages', N'GET,POST,PUT,DELETE,OPTIONS,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'ws', N'127.0.0.1:30020,', N'', N'', N'', N'1', N'30000', N'1', N'', N'TEST-APP'), (N'72', N'{}', N'6676b5e5f76d40739f9ccc3e371e2f18', N'1267817221286526976', N'【消息服务】- 聊天1', N'/signalr-hubs/messages/{everything}', N'', N'', N'/signalr-hubs/messages/{everything}', N'GET,POST,PUT,DELETE,OPTIONS,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'ws', N'127.0.0.1:30020,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'73', N'{}', N'cfb5f09a12bf495fbcaf2fa5d9123a40', N'1268893687085518848', N'【身份认证服务】- 重置密码', N'/api/account/phone/reset-password', N'', N'', N'/api/account/phone/reset-password', N'PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'1', N'30000', N'1', N'', N'TEST-APP'), (N'101', N'{}', N'997a4c27a433458aafed9b8aa252d957', N'1288657613998579712', N'【身份认证服务】- 组织机构列表', N'/api/identity/organization-units', N'', N'', N'/api/identity/organization-units', N'GET,POST,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'102', N'{}', N'a2c6acc9882a425ab26bd3ad5a9c17c6', N'1288657941770854400', N'【身份认证服务】- 组织机构管理', N'/api/identity/organization-units/{id}', N'', N'', N'/api/identity/organization-units/{id}', N'GET,PUT,DELETE,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'1', N'30000', N'1', N'', N'TEST-APP'), (N'103', N'{}', N'390acfb0e16943c6b61e731d47c282e9', N'1288658134067109888', N'【身份认证服务】- 组织机构移动', N'/api/identity/organization-units/{id}/move', N'', N'', N'/api/identity/organization-units/{id}/move', N'PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'104', N'{}', N'3515e75becf9447492ad60466b27c397', N'1288658305156964352', N'【身份认证服务】- 查询组织机构子级', N'/api/identity/organization-units/find-children', N'', N'', N'/api/identity/organization-units/find-children', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'105', N'{}', N'aab0a24d930f4f9687497e5ccaac2a31', N'1288658491216289792', N'【身份认证服务】- 查询组织机构最后一个子节点', N'/api/identity/organization-units/last-children', N'', N'', N'/api/identity/organization-units/last-children', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'106', N'{}', N'9b7c999b1c5140c497bc15914a815401', N'1288658638302142464', N'【身份认证服务】- 未加入组织机构角色', N'/api/identity/organization-units/{id}/unadded-roles', N'', N'', N'/api/identity/organization-units/{id}/unadded-roles', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'107', N'{}', N'b0cdb3f6908e42bd934ca99a78f22c3f', N'1288658791784308736', N'【身份认证服务】- 未加入组织机构用户', N'/api/identity/organization-units/{id}/unadded-users', N'', N'', N'/api/identity/organization-units/{id}/unadded-users', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'108', N'{}', N'1982bc6ffd92445b9b3f47067378d1fc', N'1290849478956199936', N'【后台管理】- 当前租户设置', N'/api/setting-management/settings/by-current-tenant', N'', N'', N'/api/setting-management/settings/by-current-tenant', N'GET,PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30010,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'109', N'{}', N'a7df3a04805d4cc8a6e6b3823c6dd468', N'1290849628051124224', N'【后台管理】- 用户设置', N'/api/setting-management/settings/by-user/{userId}', N'', N'', N'/api/setting-management/settings/by-user/{userId}', N'GET,PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30010,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'110', N'{}', N'ef6e38a529a345fab67f6a627cf20635', N'1290849798553776128', N'【后台管理】- 当前用户设置', N'/api/setting-management/settings/by-current-user', N'', N'', N'/api/setting-management/settings/by-current-user', N'GET,PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30010,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'112', N'{}', N'9844fed6507844f2ac64bd08649bd3a6', N'1291259822512693248', N'【身份认证服务】- 查询组织机构根节点', N'/api/identity/organization-units/root-node', N'', N'', N'/api/identity/organization-units/root-node', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'113', N'{}', N'24d8794cf8f943b4ac45d2bcccf7c128', N'1292620505149145088', N'【平台服务】- 文件系统', N'/api/file-management/file-system', N'', N'', N'/api/file-management/file-system', N'GET,PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30025,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'114', N'{}', N'0acf6762d3af43efb655107e0039f5fc', N'1292620665505775616', N'【平台服务】- 文件系统 - 目录管理', N'/api/file-management/file-system/folders', N'', N'', N'/api/file-management/file-system/folders', N'POST,DELETE,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30025,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'115', N'{}', N'8b4363f70865419089b5f62ba35382df', N'1292620843398791168', N'【平台服务】- 文件系统 - 文件管理', N'/api/file-management/file-system/files', N'', N'', N'/api/file-management/file-system/files', N'GET,POST,DELETE,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30025,', N'', N'', N'', N'0', N'1200000', N'1', N'', N'TEST-APP'), (N'116', N'{}', N'7eb315567bbc470bbbfd26923c5d0aba', N'1292621027574874112', N'【平台服务】- 文件系统 - 复制目录', N'/api/file-management/file-system/folders/copy', N'', N'', N'/api/file-management/file-system/folders/copy', N'PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30025,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'117', N'{}', N'af5853680cff454fa66ff6022f18da23', N'1292621363161137152', N'【平台服务】- 文件系统 - 移动目录', N'/api/file-management/file-system/folders/move', N'', N'', N'/api/file-management/file-system/folders/move', N'PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30025,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'118', N'{}', N'6daa6d8c8adb466899988fd8181c29a8', N'1292621494837116928', N'【平台服务】- 文件系统 - 复制文件', N'/api/file-management/file-system/files/copy', N'', N'', N'/api/file-management/file-system/files/copy', N'PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30025,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'119', N'{}', N'9560caaa3bd9424984c44724aa54bfe9', N'1292621629260365824', N'【平台服务】- 文件系统 - 移动文件', N'/api/file-management/file-system/files/move', N'', N'', N'/api/file-management/file-system/files/move', N'PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30025,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'120', N'{}', N'fc2aaa6035484201b9014912930fb7cb', N'1292622526073864192', N'【平台服务】- 文件系统 - 详情页', N'/api/file-management/file-system/profile', N'', N'', N'/api/file-management/file-system/profile', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30025,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'121', N'{}', N'c6c7b027000942dda8ba0d2e2d8cf705', N'1293470838745821184', N'【后台管理】- 框架配置', N'/api/abp/application-configuration', N'', N'', N'/api/abp/backend-admin/application-configuration', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30010,', N'', N'', N'backend-admin-configuration', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'122', N'{}', N'becd4342079d4399abda5b5ba3b46fdc', N'1293471661785706496', N'【消息服务】- 框架配置', N'/api/abp/application-configuration', N'', N'', N'/api/abp/messages/application-configuration', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30020,', N'', N'', N'messages-configuration', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'123', N'{}', N'c828140cee3043c18ffc274f6461f0f2', N'1293472678392721408', N'【后台管理】- 接口代理', N'/api/abp/api-definition', N'', N'', N'/api/abp/backend-admin/api-definition', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30010,', N'', N'', N'backend-admin-api-definition', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'124', N'{}', N'e683cff8066d4c2899a17d0f618f1a0b', N'1293472857510473728', N'【消息服务】- 接口代理', N'/api/abp/api-definition', N'', N'', N'/api/abp/messages/api-definition', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30020,', N'', N'', N'messages-api-definition', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'125', N'{}', N'0e9c3bff5b58428eba97a5516140ba5e', N'1299273336009359360', N'【消息服务】- Hangfire仪表板 ', N'/hangfire', N'', N'', N'/hangfire', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30020,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'126', N'{}', N'e906924ad3a947cf8e6956e2dd258192', N'1299273436282585088', N'【消息服务】- Hangfire仪表板 - 主页', N'/hangfire/', N'', N'', N'/hangfire/', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30020,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'127', N'{}', N'e02f2049efbc4ee1ad6629bd0341ed2b', N'1299273618470567936', N'【消息服务】- Hangfire仪表板 - 状态', N'/hangfire/stats', N'', N'', N'/hangfire/stats', N'POST,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30020,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'128', N'{}', N'f8d2b2f0f1d649c2a07eeef23d6adb0e', N'1299273770182737920', N'【消息服务】- Hangfire仪表板 - 作业管理', N'/hangfire/jobs/{everything}', N'', N'', N'/hangfire/jobs/{everything}', N'GET,POST,PUT,DELETE,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30020,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'129', N'{}', N'9785be7a29774b468e271b23009fe115', N'1299273978023084032', N'【消息服务】- Hangfire仪表板 - 重试', N'/hangfire/retries', N'', N'', N'/hangfire/retries', N'GET,POST,PUT,DELETE,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30020,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'130', N'{}', N'9c0c1cd196bb45c0bc03fafb7a1eb8f2', N'1299274123225694208', N'【消息服务】- Hangfire仪表板 - 周期性作业', N'/hangfire/recurring', N'', N'', N'/hangfire/recurring', N'GET,POST,DELETE,PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30020,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'131', N'{}', N'243bafe828be463ea63a3e2b521f9923', N'1299274222299348992', N'【消息服务】- Hangfire仪表板 - 服务器列表', N'/hangfire/servers', N'', N'', N'/hangfire/servers', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30020,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'132', N'{}', N'57a8ac1b41bb434cad38fbde0e2ba2f0', N'1304238876758495232', N'【后台管理】- 管理功能', N'/api/feature-management/features', N'', N'', N'/api/feature-management/features', N'GET,PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30010,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'133', N'{}', N'40a150f629b047f587c91a9436a699c0', N'1304678610343383040', N'【身份认证服务】- 接口代理', N'/api/abp/api-definition', N'', N'', N'/api/abp/identity-server/api-definition', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'identity-server-api-definition', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'134', N'{}', N'3a2d5d538fa44ac690402fc5c4e1a401', N'1304679169305694208', N'【身份认证服务】- 框架配置', N'/api/abp/application-configuration', N'', N'', N'/api/abp/identity-server/application-configuration', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'identity-server-configuration', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'135', N'{}', N'2ecfe7483bc94c28ad0769b654eb765d', N'1310460417141817344', N'【后台管理】- 审计日志列表', N'/api/auditing/audit-log', N'', N'', N'/api/auditing/audit-log', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30010,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'136', N'{}', N'744e340c0024462d88458b7ea9605b3c', N'1310502391475519488', N'【后台服务】- 安全日志列表', N'/api/auditing/security-log', N'', N'', N'/api/auditing/security-log', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30010,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'137', N'{}', N'a99639f4172547c4ba9b4f4ca5cb4ab9', N'1310515546943569920', N'【后台服务】- 安全日志', N'/api/auditing/security-log/{id}', N'', N'', N'/api/auditing/security-log/{id}', N'DELETE,GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30010,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'138', N'{}', N'c3ebc82d55f640fb9d70a911e97e4ec1', N'1310515735292985344', N'【后台管理】- 审计日志', N'/api/auditing/audit-log/{id}', N'', N'', N'/api/auditing/audit-log/{id}', N'DELETE,GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30010,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'139', N'{}', N'0379fcb3a9cd4b13b562b3b5b5c3eb7d', N'1316628769783480320', N'【身份认证服务】- 声明类型', N'/api/identity/claim-types', N'', N'', N'/api/identity/claim-types', N'GET,POST,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'140', N'{}', N'de25c9a80d994f728b37eb483b2f5127', N'1316628940663619584', N'【身份认证服务】- 管理声明类型', N'/api/identity/claim-types/{id}', N'', N'', N'/api/identity/claim-types/{id}', N'GET,PUT,DELETE,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'141', N'{}', N'25c19106baff4cf3a877ae8cd690a1b5', N'1316629112428756992', N'【身份认证服务】- 查询在用的声明类型列表', N'/api/identity/claim-types/actived-list', N'', N'', N'/api/identity/claim-types/actived-list', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'142', N'{}', N'd42f8b779cf344eeaa24df0ae37fb7cf', N'1316652047017246720', N'【身份认证服务】- 管理用户声明', N'/api/identity/users/claims/{id}', N'', N'', N'/api/identity/users/claims/{id}', N'POST,PUT,DELETE,GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'143', N'{}', N'b86af44a34a14db4b482df8550f1bde1', N'1316913899996737536', N'【身份认证管理】- 管理角色声明', N'/api/identity/roles/claims/{id}', N'', N'', N'/api/identity/roles/claims/{id}', N'GET,POST,PUT,DELETE,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'144', N'{}', N'51a14bc295044de985ae014fbcc5bddf', N'1319200951383199744', N'【IdentityServer4】- 发现端点', N'/.well-known/openid-configuration', N'', N'', N'/.well-known/openid-configuration', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:44385,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'145', N'{}', N'9d859a444d774e93818237e53b6cc102', N'1319221929807024128', N'【身份认证服务】- 查询所有组织机构', N'/api/identity/organization-units/all', N'', N'', N'/api/identity/organization-units/all', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'146', N'{}', N'89f42175b24540caba2a1fded145acf8', N'1319554431134306304', N'【身份认证服务】- 管理组织机构用户', N'/api/identity/organization-units/{id}/users', N'', N'', N'/api/identity/organization-units/{id}/users', N'POST,GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'147', N'{}', N'126d82509cec43eda712e94737b01039', N'1319554550458060800', N'【身份认证服务】- 管理组织机构角色', N'/api/identity/organization-units/{id}/roles', N'', N'', N'/api/identity/organization-units/{id}/roles', N'POST,GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'148', N'{}', N'824f5eee6877489f96f1022e306c968a', N'1319554948434595840', N'【身份认证服务】- 管理角色组织机构', N'/api/identity/roles/{id}/organization-units', N'', N'', N'/api/identity/roles/{id}/organization-units', N'GET,PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'149', N'{}', N'fe1379d4a13f41afb6410f4c948871f3', N'1319555067183730688', N'【身份认证服务】- 删除角色组织机构', N'/api/identity/roles/{id}/organization-units/{ouId}', N'', N'', N'/api/identity/roles/{id}/organization-units/{ouId}', N'DELETE,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'150', N'{}', N'197a69bb723346aba3601bd61e7fa655', N'1319555230765780992', N'【身份认证服务】- 管理用户组织机构', N'/api/identity/users/{id}/organization-units', N'', N'', N'/api/identity/users/{id}/organization-units', N'GET,PUT,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'151', N'{}', N'1a7e6d0b1c95484f82a75a2ce6e6f453', N'1319555333790470144', N'【身份认证服务】- 删除用户组织机构', N'/api/identity/users/{id}/organization-units/{ouId}', N'', N'', N'/api/identity/users/{id}/organization-units/{ouId}', N'DELETE,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30015,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'152', N'{}', N'ecfa9bbd19694097b33e691b653f2124', N'1321001932510203904', N'【消息服务】- 我的消息', N'/api/im/chat/my-messages', N'', N'', N'/api/im/chat/my-messages', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30020,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'153', N'{}', N'4867ad188ca54acb8b961d20297b6545', N'1321002059803136000', N'【消息服务】- 我的最近消息', N'/api/im/chat/my-last-messages', N'', N'', N'/api/im/chat/my-last-messages', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30020,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'154', N'{}', N'291ab802d7bc4af98fc15c509f98fa75', N'1321002256440496128', N'【消息服务】- 我的朋友', N'/api/im/my-friends', N'', N'', N'/api/im/my-friends', N'GET,POST,DELETE,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30020,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'155', N'{}', N'08438dabb1e849988e0c304f82b08a10', N'1321002350686507008', N'【消息服务】- 我的所有朋友', N'/api/im/my-friends/all', N'', N'', N'/api/im/my-friends/all', N'GET,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30020,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP'), (N'156', N'{}', N'cecf632785b7402299764698369c751f', N'1322190027988525056', N'【消息服务】- 发送好友请求', N'/api/im/my-friends/add-request', N'', N'', N'/api/im/my-friends/add-request', N'POST,', N'', N'', N'', N'', N'', N'', N'', N'1', N'', N'', N'HTTP', N'127.0.0.1:30020,', N'', N'', N'', N'0', N'30000', N'1', N'', N'TEST-APP') GO COMMIT @@ -556,7 +556,7 @@ GO BEGIN TRANSACTION GO -INSERT INTO [apigateway].[appapigatewaysecurityoptions] VALUES (N'3', N'1261299170387169280', N'', N''), (N'4', N'1261585859064872960', N'', N''), (N'5', N'1261586605810368512', N'', N''), (N'6', N'1261587558609436672', N'', N''), (N'7', N'1261588213298348032', N'', N''), (N'8', N'1261588367619375104', N'', N''), (N'9', N'1261588628450557952', N'', N''), (N'10', N'1261588881564221440', N'', N''), (N'11', N'1261588983053795328', N'', N''), (N'12', N'1261589139039961088', N'', N''), (N'13', N'1261589197483393024', N'', N''), (N'14', N'1261589278857084928', N'', N''), (N'15', N'1261589420356124672', N'', N''), (N'16', N'1261589960393736192', N'', N''), (N'17', N'1261606600242085888', N'', N''), (N'18', N'1261606689601732608', N'', N''), (N'21', N'1262220447629058048', N'', N''), (N'22', N'1262230734939758592', N'', N''), (N'23', N'1262296916350869504', N'', N''), (N'24', N'1262632376348594176', N'', N''), (N'25', N'1262632791869902848', N'', N''), (N'28', N'1262660336921235456', N'', N''), (N'29', N'1262660528277966848', N'', N''), (N'30', N'1262660706875625472', N'', N''), (N'31', N'1262660966393991168', N'', N''), (N'32', N'1262661109474283520', N'', N''), (N'33', N'1262663888804663296', N'', N''), (N'34', N'1262664024096133120', N'', N''), (N'35', N'1262664186252120064', N'', N''), (N'36', N'1262664357044178944', N'', N''), (N'37', N'1262664632928718848', N'', N''), (N'38', N'1262664751409418240', N'', N''), (N'39', N'1262664871274237952', N'', N''), (N'40', N'1262665026111164416', N'', N''), (N'41', N'1262665159905267712', N'', N''), (N'42', N'1262665329829105664', N'', N''), (N'43', N'1262665456471920640', N'', N''), (N'44', N'1262665628165754880', N'', N''), (N'45', N'1262666172682883072', N'', N''), (N'47', N'1262723402331885568', N'', N''), (N'48', N'1262935771746734080', N'', N''), (N'49', N'1262935906522304512', N'', N''), (N'52', N'1263074419073593344', N'', N''), (N'53', N'1263075249394790400', N'', N''), (N'54', N'1263075593499684864', N'', N''), (N'56', N'1263101898440146944', N'', N''), (N'57', N'1263303878648569856', N'', N''), (N'58', N'1263304204797648896', N'', N''), (N'59', N'1263304872891555840', N'', N''), (N'60', N'1263305106250047488', N'', N''), (N'61', N'1263305244594970624', N'', N''), (N'62', N'1263305430536855552', N'', N''), (N'63', N'1263639172959174656', N'', N''), (N'64', N'1264799968944640000', N'', N''), (N'65', N'1264800070161584128', N'', N''), (N'66', N'1267360794414161920', N'', N''), (N'67', N'1267383367629807616', N'', N''), (N'68', N'1267817055527632896', N'', N''), (N'69', N'1267817221286526976', N'', N''), (N'70', N'1268893687085518848', N'', N''), (N'94', N'1288657613998579712', N'', N''), (N'95', N'1288657941770854400', N'', N''), (N'96', N'1288658134067109888', N'', N''), (N'97', N'1288658305156964352', N'', N''), (N'98', N'1288658491216289792', N'', N''), (N'99', N'1288658638302142464', N'', N''), (N'100', N'1288658791784308736', N'', N''), (N'101', N'1290849478956199936', N'', N''), (N'102', N'1290849628051124224', N'', N''), (N'103', N'1290849798553776128', N'', N''), (N'105', N'1291259822512693248', N'', N''), (N'106', N'1292620505149145088', N'', N''), (N'107', N'1292620665505775616', N'', N''), (N'108', N'1292620843398791168', N'', N''), (N'109', N'1292621027574874112', N'', N''), (N'110', N'1292621363161137152', N'', N''), (N'111', N'1292621494837116928', N'', N''), (N'112', N'1292621629260365824', N'', N''), (N'113', N'1292622526073864192', N'', N''), (N'114', N'1293470838745821184', N'', N''), (N'115', N'1293471661785706496', N'', N''), (N'116', N'1293472678392721408', N'', N''), (N'117', N'1293472857510473728', N'', N''), (N'118', N'1299273336009359360', N'127.0.0.1', N''), (N'119', N'1299273436282585088', N'127.0.0.1', N''), (N'120', N'1299273618470567936', N'127.0.0.1', N''), (N'121', N'1299273770182737920', N'127.0.0.1', N''), (N'122', N'1299273978023084032', N'127.0.0.1', N''), (N'123', N'1299274123225694208', N'127.0.0.1', N''), (N'124', N'1299274222299348992', N'127.0.0.1', N''), (N'125', N'1304238876758495232', N'', N''), (N'126', N'1304678610343383040', N'', N''), (N'127', N'1304679169305694208', N'', N''), (N'128', N'1310460417141817344', N'', N''), (N'129', N'1310502391475519488', N'', N''), (N'130', N'1310515546943569920', N'', N''), (N'131', N'1310515735292985344', N'', N''), (N'132', N'1316628769783480320', N'', N''), (N'133', N'1316628940663619584', N'', N''), (N'134', N'1316629112428756992', N'', N''), (N'135', N'1316652047017246720', N'', N''), (N'136', N'1316913899996737536', N'', N''), (N'137', N'1319200951383199744', N'', N''), (N'138', N'1319221929807024128', N'', N''), (N'139', N'1319554431134306304', N'', N''), (N'140', N'1319554550458060800', N'', N''), (N'141', N'1319554948434595840', N'', N''), (N'142', N'1319555067183730688', N'', N''), (N'143', N'1319555230765780992', N'', N''), (N'144', N'1319555333790470144', N'', N'') +INSERT INTO [apigateway].[appapigatewaysecurityoptions] VALUES (N'3', N'1261299170387169280', N'', N''), (N'4', N'1261585859064872960', N'', N''), (N'5', N'1261586605810368512', N'', N''), (N'6', N'1261587558609436672', N'', N''), (N'7', N'1261588213298348032', N'', N''), (N'8', N'1261588367619375104', N'', N''), (N'9', N'1261588628450557952', N'', N''), (N'10', N'1261588881564221440', N'', N''), (N'11', N'1261588983053795328', N'', N''), (N'12', N'1261589139039961088', N'', N''), (N'13', N'1261589197483393024', N'', N''), (N'14', N'1261589278857084928', N'', N''), (N'15', N'1261589420356124672', N'', N''), (N'16', N'1261589960393736192', N'', N''), (N'17', N'1261606600242085888', N'', N''), (N'18', N'1261606689601732608', N'', N''), (N'21', N'1262220447629058048', N'', N''), (N'22', N'1262230734939758592', N'', N''), (N'23', N'1262296916350869504', N'', N''), (N'24', N'1262632376348594176', N'', N''), (N'25', N'1262632791869902848', N'', N''), (N'28', N'1262660336921235456', N'', N''), (N'29', N'1262660528277966848', N'', N''), (N'30', N'1262660706875625472', N'', N''), (N'31', N'1262660966393991168', N'', N''), (N'32', N'1262661109474283520', N'', N''), (N'33', N'1262663888804663296', N'', N''), (N'34', N'1262664024096133120', N'', N''), (N'35', N'1262664186252120064', N'', N''), (N'36', N'1262664357044178944', N'', N''), (N'37', N'1262664632928718848', N'', N''), (N'38', N'1262664751409418240', N'', N''), (N'39', N'1262664871274237952', N'', N''), (N'40', N'1262665026111164416', N'', N''), (N'41', N'1262665159905267712', N'', N''), (N'42', N'1262665329829105664', N'', N''), (N'43', N'1262665456471920640', N'', N''), (N'44', N'1262665628165754880', N'', N''), (N'45', N'1262666172682883072', N'', N''), (N'47', N'1262723402331885568', N'', N''), (N'48', N'1262935771746734080', N'', N''), (N'49', N'1262935906522304512', N'', N''), (N'52', N'1263074419073593344', N'', N''), (N'53', N'1263075249394790400', N'', N''), (N'54', N'1263075593499684864', N'', N''), (N'56', N'1263101898440146944', N'', N''), (N'57', N'1263303878648569856', N'', N''), (N'58', N'1263304204797648896', N'', N''), (N'59', N'1263304872891555840', N'', N''), (N'60', N'1263305106250047488', N'', N''), (N'61', N'1263305244594970624', N'', N''), (N'62', N'1263305430536855552', N'', N''), (N'63', N'1263639172959174656', N'', N''), (N'64', N'1264799968944640000', N'', N''), (N'65', N'1264800070161584128', N'', N''), (N'66', N'1267360794414161920', N'', N''), (N'67', N'1267383367629807616', N'', N''), (N'68', N'1267817055527632896', N'', N''), (N'69', N'1267817221286526976', N'', N''), (N'70', N'1268893687085518848', N'', N''), (N'94', N'1288657613998579712', N'', N''), (N'95', N'1288657941770854400', N'', N''), (N'96', N'1288658134067109888', N'', N''), (N'97', N'1288658305156964352', N'', N''), (N'98', N'1288658491216289792', N'', N''), (N'99', N'1288658638302142464', N'', N''), (N'100', N'1288658791784308736', N'', N''), (N'101', N'1290849478956199936', N'', N''), (N'102', N'1290849628051124224', N'', N''), (N'103', N'1290849798553776128', N'', N''), (N'105', N'1291259822512693248', N'', N''), (N'106', N'1292620505149145088', N'', N''), (N'107', N'1292620665505775616', N'', N''), (N'108', N'1292620843398791168', N'', N''), (N'109', N'1292621027574874112', N'', N''), (N'110', N'1292621363161137152', N'', N''), (N'111', N'1292621494837116928', N'', N''), (N'112', N'1292621629260365824', N'', N''), (N'113', N'1292622526073864192', N'', N''), (N'114', N'1293470838745821184', N'', N''), (N'115', N'1293471661785706496', N'', N''), (N'116', N'1293472678392721408', N'', N''), (N'117', N'1293472857510473728', N'', N''), (N'118', N'1299273336009359360', N'127.0.0.1', N''), (N'119', N'1299273436282585088', N'127.0.0.1', N''), (N'120', N'1299273618470567936', N'127.0.0.1', N''), (N'121', N'1299273770182737920', N'127.0.0.1', N''), (N'122', N'1299273978023084032', N'127.0.0.1', N''), (N'123', N'1299274123225694208', N'127.0.0.1', N''), (N'124', N'1299274222299348992', N'127.0.0.1', N''), (N'125', N'1304238876758495232', N'', N''), (N'126', N'1304678610343383040', N'', N''), (N'127', N'1304679169305694208', N'', N''), (N'128', N'1310460417141817344', N'', N''), (N'129', N'1310502391475519488', N'', N''), (N'130', N'1310515546943569920', N'', N''), (N'131', N'1310515735292985344', N'', N''), (N'132', N'1316628769783480320', N'', N''), (N'133', N'1316628940663619584', N'', N''), (N'134', N'1316629112428756992', N'', N''), (N'135', N'1316652047017246720', N'', N''), (N'136', N'1316913899996737536', N'', N''), (N'137', N'1319200951383199744', N'', N''), (N'138', N'1319221929807024128', N'', N''), (N'139', N'1319554431134306304', N'', N''), (N'140', N'1319554550458060800', N'', N''), (N'141', N'1319554948434595840', N'', N''), (N'142', N'1319555067183730688', N'', N''), (N'143', N'1319555230765780992', N'', N''), (N'144', N'1319555333790470144', N'', N''), (N'145', N'1321001932510203904', N'', N''), (N'146', N'1321002059803136000', N'', N''), (N'147', N'1321002256440496128', N'', N''), (N'148', N'1321002350686507008', N'', N''), (N'149', N'1322190027988525056', N'', N'') GO COMMIT @@ -589,7 +589,7 @@ GO BEGIN TRANSACTION GO -INSERT INTO [apigateway].[cap.published] VALUES (N'1319249373444280320', N'v1', N'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', N'{"Headers":{"cap-callback-name":null,"cap-msg-id":"1319249373444280320","cap-msg-name":"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData","cap-msg-type":"Object","cap-senttime":"2020/10/22 20:08:55 +08:00","cap-corr-id":"1319249373444280320","cap-corr-seq":"0"},"Value":{"DateTime":"2020-10-22T20:08:55.7543668+08:00","AppId":"TEST-APP","Method":"Modify","Object":"ReRoute"}}', N'0', N'2020-10-22 20:08:56', N'2020-10-23 20:08:56', N'Succeeded'), (N'1319249405602009088', N'v1', N'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', N'{"Headers":{"cap-callback-name":null,"cap-msg-id":"1319249405602009088","cap-msg-name":"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData","cap-msg-type":"Object","cap-senttime":"2020/10/22 20:09:03 +08:00","cap-corr-id":"1319249405602009088","cap-corr-seq":"0"},"Value":{"DateTime":"2020-10-22T20:09:03.4203308+08:00","AppId":"TEST-APP","Method":"Modify","Object":"ReRoute"}}', N'0', N'2020-10-22 20:09:03', N'2020-10-23 20:09:03', N'Succeeded'), (N'1319249482190000128', N'v1', N'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', N'{"Headers":{"cap-callback-name":null,"cap-msg-id":"1319249482190000128","cap-msg-name":"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData","cap-msg-type":"Object","cap-senttime":"2020/10/22 20:09:21 +08:00","cap-corr-id":"1319249482190000128","cap-corr-seq":"0"},"Value":{"DateTime":"2020-10-22T20:09:21.681402+08:00","AppId":"TEST-APP","Method":"Modify","Object":"ReRoute"}}', N'0', N'2020-10-22 20:09:22', N'2020-10-23 20:09:22', N'Succeeded'), (N'1319249848986079232', N'v1', N'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', N'{"Headers":{"cap-callback-name":null,"cap-msg-id":"1319249848986079232","cap-msg-name":"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData","cap-msg-type":"Object","cap-senttime":"2020/10/22 20:10:49 +08:00","cap-corr-id":"1319249848986079232","cap-corr-seq":"0"},"Value":{"DateTime":"2020-10-22T20:10:49.1328929+08:00","AppId":"TEST-APP","Method":"Create","Object":"AggregateRoute"}}', N'0', N'2020-10-22 20:10:49', N'2020-10-23 20:10:49', N'Succeeded'), (N'1319250220064542720', N'v1', N'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', N'{"Headers":{"cap-callback-name":null,"cap-msg-id":"1319250220064542720","cap-msg-name":"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData","cap-msg-type":"Object","cap-senttime":"2020/10/22 20:12:17 +08:00","cap-corr-id":"1319250220064542720","cap-corr-seq":"0"},"Value":{"DateTime":"2020-10-22T20:12:17.6028009+08:00","AppId":"TEST-APP","Method":"Update","Object":"AggregateRoute"}}', N'0', N'2020-10-22 20:12:18', N'2020-10-23 20:12:18', N'Succeeded'), (N'1319253036082499584', N'v1', N'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', N'{"Headers":{"cap-callback-name":null,"cap-msg-id":"1319253036082499584","cap-msg-name":"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData","cap-msg-type":"Object","cap-senttime":"2020/10/22 20:23:28 +08:00","cap-corr-id":"1319253036082499584","cap-corr-seq":"0"},"Value":{"DateTime":"2020-10-22T20:23:28.995489+08:00","AppId":"TEST-APP","Method":"AddRouteConfig","Object":"AggregateRoute"}}', N'0', N'2020-10-22 20:23:29', N'2020-10-23 20:23:29', N'Succeeded'), (N'1319269094700978176', N'v1', N'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', N'{"Headers":{"cap-callback-name":null,"cap-msg-id":"1319269094700978176","cap-msg-name":"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData","cap-msg-type":"Object","cap-senttime":"2020/10/22 21:27:17 +08:00","cap-corr-id":"1319269094700978176","cap-corr-seq":"0"},"Value":{"DateTime":"2020-10-22T21:27:17.6683764+08:00","AppId":"TEST-APP","Method":"Delete","Object":"AggregateRoute"}}', N'0', N'2020-10-22 21:27:18', N'2020-10-23 21:27:18', N'Succeeded'), (N'1319269302629404672', N'v1', N'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', N'{"Headers":{"cap-callback-name":null,"cap-msg-id":"1319269302629404672","cap-msg-name":"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData","cap-msg-type":"Object","cap-senttime":"2020/10/22 21:28:07 +08:00","cap-corr-id":"1319269302629404672","cap-corr-seq":"0"},"Value":{"DateTime":"2020-10-22T21:28:07.2407943+08:00","AppId":"TEST-APP","Method":"Delete","Object":"AggregateRoute"}}', N'0', N'2020-10-22 21:28:07', N'2020-10-23 21:28:07', N'Succeeded'), (N'1319269513921662976', N'v1', N'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', N'{"Headers":{"cap-callback-name":null,"cap-msg-id":"1319269513921662976","cap-msg-name":"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData","cap-msg-type":"Object","cap-senttime":"2020/10/22 21:28:57 +08:00","cap-corr-id":"1319269513921662976","cap-corr-seq":"0"},"Value":{"DateTime":"2020-10-22T21:28:57.6185875+08:00","AppId":"TEST-APP","Method":"Delete","Object":"AggregateRoute"}}', N'0', N'2020-10-22 21:28:58', N'2020-10-23 21:28:58', N'Succeeded'), (N'1319554100082085888', N'v1', N'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', N'{"Headers":{"cap-callback-name":null,"cap-msg-id":"1319554100082085888","cap-msg-name":"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData","cap-msg-type":"Object","cap-senttime":"2020/10/23 16:19:48 +08:00","cap-corr-id":"1319554100082085888","cap-corr-seq":"0"},"Value":{"DateTime":"2020-10-23T16:19:48.2464771+08:00","AppId":"TEST-APP","Method":"Modify","Object":"ReRoute"}}', N'0', N'2020-10-23 16:19:48', N'2020-10-24 16:19:48', N'Succeeded'), (N'1319554182298832896', N'v1', N'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', N'{"Headers":{"cap-callback-name":null,"cap-msg-id":"1319554182298832896","cap-msg-name":"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData","cap-msg-type":"Object","cap-senttime":"2020/10/23 16:20:07 +08:00","cap-corr-id":"1319554182298832896","cap-corr-seq":"0"},"Value":{"DateTime":"2020-10-23T16:20:07.8366727+08:00","AppId":"TEST-APP","Method":"Modify","Object":"ReRoute"}}', N'0', N'2020-10-23 16:20:08', N'2020-10-24 16:20:08', N'Succeeded'), (N'1319554431205609472', N'v1', N'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', N'{"Headers":{"cap-callback-name":null,"cap-msg-id":"1319554431205609472","cap-msg-name":"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData","cap-msg-type":"Object","cap-senttime":"2020/10/23 16:21:07 +08:00","cap-corr-id":"1319554431205609472","cap-corr-seq":"0"},"Value":{"DateTime":"2020-10-23T16:21:07.192283+08:00","AppId":"TEST-APP","Method":"Create","Object":"ReRoute"}}', N'0', N'2020-10-23 16:21:07', N'2020-10-24 16:21:07', N'Succeeded'), (N'1319554550520975360', N'v1', N'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', N'{"Headers":{"cap-callback-name":null,"cap-msg-id":"1319554550520975360","cap-msg-name":"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData","cap-msg-type":"Object","cap-senttime":"2020/10/23 16:21:35 +08:00","cap-corr-id":"1319554550520975360","cap-corr-seq":"0"},"Value":{"DateTime":"2020-10-23T16:21:35.6396895+08:00","AppId":"TEST-APP","Method":"Create","Object":"ReRoute"}}', N'0', N'2020-10-23 16:21:36', N'2020-10-24 16:21:36', N'Succeeded'), (N'1319554948505899008', N'v1', N'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', N'{"Headers":{"cap-callback-name":null,"cap-msg-id":"1319554948505899008","cap-msg-name":"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData","cap-msg-type":"Object","cap-senttime":"2020/10/23 16:23:10 +08:00","cap-corr-id":"1319554948505899008","cap-corr-seq":"0"},"Value":{"DateTime":"2020-10-23T16:23:10.5258597+08:00","AppId":"TEST-APP","Method":"Create","Object":"ReRoute"}}', N'0', N'2020-10-23 16:23:11', N'2020-10-24 16:23:11', N'Succeeded'), (N'1319555067250839552', N'v1', N'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', N'{"Headers":{"cap-callback-name":null,"cap-msg-id":"1319555067250839552","cap-msg-name":"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData","cap-msg-type":"Object","cap-senttime":"2020/10/23 16:23:38 +08:00","cap-corr-id":"1319555067250839552","cap-corr-seq":"0"},"Value":{"DateTime":"2020-10-23T16:23:38.8355819+08:00","AppId":"TEST-APP","Method":"Create","Object":"ReRoute"}}', N'0', N'2020-10-23 16:23:39', N'2020-10-24 16:23:39', N'Succeeded'), (N'1319555230837084160', N'v1', N'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', N'{"Headers":{"cap-callback-name":null,"cap-msg-id":"1319555230837084160","cap-msg-name":"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData","cap-msg-type":"Object","cap-senttime":"2020/10/23 16:24:17 +08:00","cap-corr-id":"1319555230837084160","cap-corr-seq":"0"},"Value":{"DateTime":"2020-10-23T16:24:17.8394311+08:00","AppId":"TEST-APP","Method":"Create","Object":"ReRoute"}}', N'0', N'2020-10-23 16:24:18', N'2020-10-24 16:24:18', N'Succeeded'), (N'1319555333865967616', N'v1', N'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', N'{"Headers":{"cap-callback-name":null,"cap-msg-id":"1319555333865967616","cap-msg-name":"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData","cap-msg-type":"Object","cap-senttime":"2020/10/23 16:24:42 +08:00","cap-corr-id":"1319555333865967616","cap-corr-seq":"0"},"Value":{"DateTime":"2020-10-23T16:24:42.403288+08:00","AppId":"TEST-APP","Method":"Create","Object":"ReRoute"}}', N'0', N'2020-10-23 16:24:42', N'2020-10-24 16:24:42', N'Succeeded'), (N'1319567388383744000', N'v1', N'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', N'{"Headers":{"cap-callback-name":null,"cap-msg-id":"1319567388383744000","cap-msg-name":"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData","cap-msg-type":"Object","cap-senttime":"2020/10/23 17:12:36 +08:00","cap-corr-id":"1319567388383744000","cap-corr-seq":"0"},"Value":{"DateTime":"2020-10-23T17:12:36.4191302+08:00","AppId":"TEST-APP","Method":"Modify","Object":"ReRoute"}}', N'0', N'2020-10-23 17:12:36', N'2020-10-24 17:12:36', N'Succeeded'), (N'1319567469363171328', N'v1', N'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', N'{"Headers":{"cap-callback-name":null,"cap-msg-id":"1319567469363171328","cap-msg-name":"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData","cap-msg-type":"Object","cap-senttime":"2020/10/23 17:12:55 +08:00","cap-corr-id":"1319567469363171328","cap-corr-seq":"0"},"Value":{"DateTime":"2020-10-23T17:12:55.7317902+08:00","AppId":"TEST-APP","Method":"Modify","Object":"ReRoute"}}', N'0', N'2020-10-23 17:12:56', N'2020-10-24 17:12:56', N'Succeeded') +INSERT INTO [apigateway].[cap.published] VALUES (N'1322190029573971968', N'v1', N'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', N'{"Headers":{"cap-callback-name":null,"cap-msg-id":"1322190029573971968","cap-msg-name":"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData","cap-msg-type":"Object","cap-senttime":"2020/10/30 22:54:02 +08:00","cap-corr-id":"1322190029573971968","cap-corr-seq":"0"},"Value":{"DateTime":"2020-10-30T22:54:02.8070185+08:00","AppId":"TEST-APP","Method":"Create","Object":"ReRoute"}}', N'0', N'2020-10-30 22:54:03', N'2020-10-31 22:54:03', N'Succeeded') GO COMMIT diff --git a/aspnet-core/database/ApiGateway-Init.sql b/aspnet-core/database/ApiGateway-Init.sql index 8cec26d70..2c56ac290 100644 --- a/aspnet-core/database/ApiGateway-Init.sql +++ b/aspnet-core/database/ApiGateway-Init.sql @@ -11,7 +11,7 @@ Target Server Version : 80020 File Encoding : 65001 - Date: 23/10/2020 19:13:56 + Date: 31/10/2020 11:28:59 */ SET NAMES utf8mb4; @@ -54,7 +54,7 @@ CREATE TABLE `appapigatewayaggregate` ( `Priority` int(0) NULL DEFAULT NULL, `UpstreamHttpMethod` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, PRIMARY KEY (`Id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; +) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of appapigatewayaggregate @@ -76,7 +76,7 @@ CREATE TABLE `appapigatewayaggregateconfig` ( PRIMARY KEY (`Id`) USING BTREE, INDEX `IX_AppApiGatewayAggregateConfig_AggregateReRouteId`(`AggregateReRouteId`) USING BTREE, CONSTRAINT `FK_AppApiGatewayAggregateConfig_AppApiGatewayAggregate_Aggregat~` FOREIGN KEY (`AggregateReRouteId`) REFERENCES `appapigatewayaggregate` (`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT -) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; +) ENGINE = InnoDB CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for appapigatewayauthoptions @@ -90,7 +90,7 @@ CREATE TABLE `appapigatewayauthoptions` ( PRIMARY KEY (`Id`) USING BTREE, UNIQUE INDEX `IX_AppApiGatewayAuthOptions_ReRouteId`(`ReRouteId`) USING BTREE, CONSTRAINT `FK_AppApiGatewayAuthOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT -) ENGINE = InnoDB AUTO_INCREMENT = 145 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; +) ENGINE = InnoDB AUTO_INCREMENT = 149 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of appapigatewayauthoptions @@ -205,6 +205,11 @@ INSERT INTO `appapigatewayauthoptions` VALUES (141, 1319554948434595840, '', '') INSERT INTO `appapigatewayauthoptions` VALUES (142, 1319555067183730688, '', ''); INSERT INTO `appapigatewayauthoptions` VALUES (143, 1319555230765780992, '', ''); INSERT INTO `appapigatewayauthoptions` VALUES (144, 1319555333790470144, '', ''); +INSERT INTO `appapigatewayauthoptions` VALUES (145, 1321001932510203904, '', ''); +INSERT INTO `appapigatewayauthoptions` VALUES (146, 1321002059803136000, '', ''); +INSERT INTO `appapigatewayauthoptions` VALUES (147, 1321002256440496128, '', ''); +INSERT INTO `appapigatewayauthoptions` VALUES (148, 1321002350686507008, '', ''); +INSERT INTO `appapigatewayauthoptions` VALUES (149, 1322190027988525056, '', ''); -- ---------------------------- -- Table structure for appapigatewaybalanceroptions @@ -222,7 +227,7 @@ CREATE TABLE `appapigatewaybalanceroptions` ( UNIQUE INDEX `IX_AppApiGatewayBalancerOptions_ReRouteId`(`ReRouteId`) USING BTREE, CONSTRAINT `FK_AppApiGatewayBalancerOptions_AppApiGatewayGlobalConfiguratio~` FOREIGN KEY (`ItemId`) REFERENCES `appapigatewayglobalconfiguration` (`ItemId`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `FK_AppApiGatewayBalancerOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT -) ENGINE = InnoDB AUTO_INCREMENT = 148 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; +) ENGINE = InnoDB AUTO_INCREMENT = 152 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of appapigatewaybalanceroptions @@ -338,6 +343,11 @@ INSERT INTO `appapigatewaybalanceroptions` VALUES (144, NULL, 131955494843459584 INSERT INTO `appapigatewaybalanceroptions` VALUES (145, NULL, 1319555067183730688, '', '', 0); INSERT INTO `appapigatewaybalanceroptions` VALUES (146, NULL, 1319555230765780992, '', '', 0); INSERT INTO `appapigatewaybalanceroptions` VALUES (147, NULL, 1319555333790470144, '', '', 0); +INSERT INTO `appapigatewaybalanceroptions` VALUES (148, NULL, 1321001932510203904, '', '', 0); +INSERT INTO `appapigatewaybalanceroptions` VALUES (149, NULL, 1321002059803136000, '', '', 0); +INSERT INTO `appapigatewaybalanceroptions` VALUES (150, NULL, 1321002256440496128, '', '', 0); +INSERT INTO `appapigatewaybalanceroptions` VALUES (151, NULL, 1321002350686507008, '', '', 0); +INSERT INTO `appapigatewaybalanceroptions` VALUES (152, NULL, 1322190027988525056, '', '', 0); -- ---------------------------- -- Table structure for appapigatewaycacheoptions @@ -351,7 +361,7 @@ CREATE TABLE `appapigatewaycacheoptions` ( PRIMARY KEY (`Id`) USING BTREE, UNIQUE INDEX `IX_AppApiGatewayCacheOptions_ReRouteId`(`ReRouteId`) USING BTREE, CONSTRAINT `FK_AppApiGatewayCacheOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT -) ENGINE = InnoDB AUTO_INCREMENT = 145 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; +) ENGINE = InnoDB AUTO_INCREMENT = 149 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of appapigatewaycacheoptions @@ -466,6 +476,11 @@ INSERT INTO `appapigatewaycacheoptions` VALUES (141, 1319554948434595840, 0, '') INSERT INTO `appapigatewaycacheoptions` VALUES (142, 1319555067183730688, 0, ''); INSERT INTO `appapigatewaycacheoptions` VALUES (143, 1319555230765780992, 0, ''); INSERT INTO `appapigatewaycacheoptions` VALUES (144, 1319555333790470144, 0, ''); +INSERT INTO `appapigatewaycacheoptions` VALUES (145, 1321001932510203904, 0, ''); +INSERT INTO `appapigatewaycacheoptions` VALUES (146, 1321002059803136000, 0, ''); +INSERT INTO `appapigatewaycacheoptions` VALUES (147, 1321002256440496128, 0, ''); +INSERT INTO `appapigatewaycacheoptions` VALUES (148, 1321002350686507008, 0, ''); +INSERT INTO `appapigatewaycacheoptions` VALUES (149, 1322190027988525056, 0, ''); -- ---------------------------- -- Table structure for appapigatewaydiscovery @@ -485,7 +500,7 @@ CREATE TABLE `appapigatewaydiscovery` ( PRIMARY KEY (`Id`) USING BTREE, UNIQUE INDEX `IX_AppApiGatewayDiscovery_ItemId`(`ItemId`) USING BTREE, CONSTRAINT `FK_AppApiGatewayDiscovery_AppApiGatewayGlobalConfiguration_Item~` FOREIGN KEY (`ItemId`) REFERENCES `appapigatewayglobalconfiguration` (`ItemId`) ON DELETE CASCADE ON UPDATE RESTRICT -) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of appapigatewaydiscovery @@ -506,7 +521,7 @@ CREATE TABLE `appapigatewaydynamicreroute` ( `AppId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, PRIMARY KEY (`Id`) USING BTREE, UNIQUE INDEX `AK_AppApiGatewayDynamicReRoute_DynamicReRouteId`(`DynamicReRouteId`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; +) ENGINE = InnoDB CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for appapigatewayglobalconfiguration @@ -526,7 +541,7 @@ CREATE TABLE `appapigatewayglobalconfiguration` ( `AppId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, PRIMARY KEY (`Id`) USING BTREE, UNIQUE INDEX `AK_AppApiGatewayGlobalConfiguration_ItemId`(`ItemId`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of appapigatewayglobalconfiguration @@ -543,7 +558,7 @@ CREATE TABLE `appapigatewayheaders` ( `Key` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, `Value` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, PRIMARY KEY (`Id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; +) ENGINE = InnoDB CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for appapigatewayhostandport @@ -555,7 +570,7 @@ CREATE TABLE `appapigatewayhostandport` ( `Host` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `Port` int(0) NULL DEFAULT 0, PRIMARY KEY (`Id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; +) ENGINE = InnoDB CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for appapigatewayhttpoptions @@ -575,7 +590,7 @@ CREATE TABLE `appapigatewayhttpoptions` ( UNIQUE INDEX `IX_AppApiGatewayHttpOptions_ReRouteId`(`ReRouteId`) USING BTREE, CONSTRAINT `FK_AppApiGatewayHttpOptions_AppApiGatewayGlobalConfiguration_It~` FOREIGN KEY (`ItemId`) REFERENCES `appapigatewayglobalconfiguration` (`ItemId`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `FK_AppApiGatewayHttpOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT -) ENGINE = InnoDB AUTO_INCREMENT = 148 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; +) ENGINE = InnoDB AUTO_INCREMENT = 152 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of appapigatewayhttpoptions @@ -691,6 +706,11 @@ INSERT INTO `appapigatewayhttpoptions` VALUES (144, NULL, 1319554948434595840, 0 INSERT INTO `appapigatewayhttpoptions` VALUES (145, NULL, 1319555067183730688, 0, 0, 0, 0, 0); INSERT INTO `appapigatewayhttpoptions` VALUES (146, NULL, 1319555230765780992, 0, 0, 0, 0, 0); INSERT INTO `appapigatewayhttpoptions` VALUES (147, NULL, 1319555333790470144, 0, 0, 0, 0, 0); +INSERT INTO `appapigatewayhttpoptions` VALUES (148, NULL, 1321001932510203904, 0, 0, 0, 0, 0); +INSERT INTO `appapigatewayhttpoptions` VALUES (149, NULL, 1321002059803136000, 0, 0, 0, 0, 0); +INSERT INTO `appapigatewayhttpoptions` VALUES (150, NULL, 1321002256440496128, 0, 0, 0, 0, 0); +INSERT INTO `appapigatewayhttpoptions` VALUES (151, NULL, 1321002350686507008, 0, 0, 0, 0, 0); +INSERT INTO `appapigatewayhttpoptions` VALUES (152, NULL, 1322190027988525056, 0, 0, 0, 0, 0); -- ---------------------------- -- Table structure for appapigatewayqosoptions @@ -708,7 +728,7 @@ CREATE TABLE `appapigatewayqosoptions` ( UNIQUE INDEX `IX_AppApiGatewayQoSOptions_ReRouteId`(`ReRouteId`) USING BTREE, CONSTRAINT `FK_AppApiGatewayQoSOptions_AppApiGatewayGlobalConfiguration_Ite~` FOREIGN KEY (`ItemId`) REFERENCES `appapigatewayglobalconfiguration` (`ItemId`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `FK_AppApiGatewayQoSOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT -) ENGINE = InnoDB AUTO_INCREMENT = 148 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; +) ENGINE = InnoDB AUTO_INCREMENT = 152 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of appapigatewayqosoptions @@ -824,6 +844,11 @@ INSERT INTO `appapigatewayqosoptions` VALUES (144, NULL, 1319554948434595840, 50 INSERT INTO `appapigatewayqosoptions` VALUES (145, NULL, 1319555067183730688, 50, 60000, 30000); INSERT INTO `appapigatewayqosoptions` VALUES (146, NULL, 1319555230765780992, 50, 60000, 30000); INSERT INTO `appapigatewayqosoptions` VALUES (147, NULL, 1319555333790470144, 50, 60000, 30000); +INSERT INTO `appapigatewayqosoptions` VALUES (148, NULL, 1321001932510203904, 50, 60000, 30000); +INSERT INTO `appapigatewayqosoptions` VALUES (149, NULL, 1321002059803136000, 50, 60000, 30000); +INSERT INTO `appapigatewayqosoptions` VALUES (150, NULL, 1321002256440496128, 50, 60000, 30000); +INSERT INTO `appapigatewayqosoptions` VALUES (151, NULL, 1321002350686507008, 50, 60000, 30000); +INSERT INTO `appapigatewayqosoptions` VALUES (152, NULL, 1322190027988525056, 50, 60000, 30000); -- ---------------------------- -- Table structure for appapigatewayratelimitoptions @@ -840,7 +865,7 @@ CREATE TABLE `appapigatewayratelimitoptions` ( PRIMARY KEY (`Id`) USING BTREE, UNIQUE INDEX `IX_AppApiGatewayRateLimitOptions_ItemId`(`ItemId`) USING BTREE, CONSTRAINT `FK_AppApiGatewayRateLimitOptions_AppApiGatewayGlobalConfigurati~` FOREIGN KEY (`ItemId`) REFERENCES `appapigatewayglobalconfiguration` (`ItemId`) ON DELETE CASCADE ON UPDATE RESTRICT -) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of appapigatewayratelimitoptions @@ -865,7 +890,7 @@ CREATE TABLE `appapigatewayratelimitrule` ( UNIQUE INDEX `IX_AppApiGatewayRateLimitRule_ReRouteId`(`ReRouteId`) USING BTREE, CONSTRAINT `FK_AppApiGatewayRateLimitRule_AppApiGatewayDynamicReRoute_Dynam~` FOREIGN KEY (`DynamicReRouteId`) REFERENCES `appapigatewaydynamicreroute` (`DynamicReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `FK_AppApiGatewayRateLimitRule_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT -) ENGINE = InnoDB AUTO_INCREMENT = 145 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; +) ENGINE = InnoDB AUTO_INCREMENT = 149 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of appapigatewayratelimitrule @@ -980,6 +1005,11 @@ INSERT INTO `appapigatewayratelimitrule` VALUES (141, 1319554948434595840, NULL, INSERT INTO `appapigatewayratelimitrule` VALUES (142, 1319555067183730688, NULL, '', 0, NULL, NULL, NULL); INSERT INTO `appapigatewayratelimitrule` VALUES (143, 1319555230765780992, NULL, '', 0, NULL, NULL, NULL); INSERT INTO `appapigatewayratelimitrule` VALUES (144, 1319555333790470144, NULL, '', 0, NULL, NULL, NULL); +INSERT INTO `appapigatewayratelimitrule` VALUES (145, 1321001932510203904, NULL, '', 0, NULL, NULL, NULL); +INSERT INTO `appapigatewayratelimitrule` VALUES (146, 1321002059803136000, NULL, '', 0, NULL, NULL, NULL); +INSERT INTO `appapigatewayratelimitrule` VALUES (147, 1321002256440496128, NULL, '', 0, NULL, NULL, NULL); +INSERT INTO `appapigatewayratelimitrule` VALUES (148, 1321002350686507008, NULL, '', 0, NULL, NULL, NULL); +INSERT INTO `appapigatewayratelimitrule` VALUES (149, 1322190027988525056, NULL, '', 0, NULL, NULL, NULL); -- ---------------------------- -- Table structure for appapigatewayreroute @@ -1019,7 +1049,7 @@ CREATE TABLE `appapigatewayreroute` ( PRIMARY KEY (`Id`) USING BTREE, UNIQUE INDEX `AK_AppApiGatewayReRoute_ReRouteId`(`ReRouteId`) USING BTREE, UNIQUE INDEX `IX_AppApiGatewayReRoute_AppId_DownstreamPathTemplate_UpstreamPa~`(`AppId`, `DownstreamPathTemplate`, `UpstreamPathTemplate`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 152 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; +) ENGINE = InnoDB AUTO_INCREMENT = 156 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of appapigatewayreroute @@ -1081,8 +1111,8 @@ INSERT INTO `appapigatewayreroute` VALUES (67, '{}', '755b4dce5c34444785fa3b647f INSERT INTO `appapigatewayreroute` VALUES (68, '{}', '535191c570ae453ab320012304d7a62c', 1264800070161584128, '【身份认证服务】- 手机号注册', '/api/account/phone/register', '', '', '/api/account/phone/register', 'POST,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP'); INSERT INTO `appapigatewayreroute` VALUES (69, '{}', '723c9b111f9f4a1aa804118cdde193d3', 1267360794414161920, '【消息服务】- 通知', '/signalr-hubs/notifications/{everything}', '', '', '/signalr-hubs/notifications/{everything}', 'POST,GET,OPTIONS,PUT,DELETE,', '', '', '', '', '', '', '', 1, '', '', 'ws', '127.0.0.1:30020,', '', '', '', 1, 30000, 1, '', 'TEST-APP'); INSERT INTO `appapigatewayreroute` VALUES (70, '{}', 'f3aa2b42dd9f468aa5aae4ef64754427', 1267383367629807616, '【消息服务】- 通知0', '/signalr-hubs/notifications', '', '', '/signalr-hubs/notifications', 'GET,POST,PUT,DELETE,OPTIONS,', '', '', '', '', '', '', '', 1, '', '', 'ws', '127.0.0.1:30020,', '', '', '', 0, 30000, 1, '', 'TEST-APP'); -INSERT INTO `appapigatewayreroute` VALUES (71, '{}', '99dc8259c50044008c8aede7442ddde3', 1267817055527632896, '【消息服务】- 聊天', '/signalr-hubs/message', '', '', '/signalr-hubs/message', 'GET,POST,PUT,DELETE,OPTIONS,', '', '', '', '', '', '', '', 1, '', '', 'ws', '127.0.0.1:30020,', '', '', '', 1, 30000, 1, '', 'TEST-APP'); -INSERT INTO `appapigatewayreroute` VALUES (72, '{}', '4ec40b72d469474ba10ae02e8d3298bb', 1267817221286526976, '【消息服务】- 聊天1', '/signalr-hubs/message/{everything}', '', '', '/signalr-hubs/message/{everything}', 'GET,POST,PUT,DELETE,OPTIONS,', '', '', '', '', '', '', '', 1, '', '', 'ws', '127.0.0.1:30020,', '', '', '', 0, 30000, 1, '', 'TEST-APP'); +INSERT INTO `appapigatewayreroute` VALUES (71, '{}', '0344947bb79b401baa2ef7b4e58297f6', 1267817055527632896, '【消息服务】- 聊天', '/signalr-hubs/messages', '', '', '/signalr-hubs/messages', 'GET,POST,PUT,DELETE,OPTIONS,', '', '', '', '', '', '', '', 1, '', '', 'ws', '127.0.0.1:30020,', '', '', '', 1, 30000, 1, '', 'TEST-APP'); +INSERT INTO `appapigatewayreroute` VALUES (72, '{}', '6676b5e5f76d40739f9ccc3e371e2f18', 1267817221286526976, '【消息服务】- 聊天1', '/signalr-hubs/messages/{everything}', '', '', '/signalr-hubs/messages/{everything}', 'GET,POST,PUT,DELETE,OPTIONS,', '', '', '', '', '', '', '', 1, '', '', 'ws', '127.0.0.1:30020,', '', '', '', 0, 30000, 1, '', 'TEST-APP'); INSERT INTO `appapigatewayreroute` VALUES (73, '{}', 'cfb5f09a12bf495fbcaf2fa5d9123a40', 1268893687085518848, '【身份认证服务】- 重置密码', '/api/account/phone/reset-password', '', '', '/api/account/phone/reset-password', 'PUT,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 1, 30000, 1, '', 'TEST-APP'); INSERT INTO `appapigatewayreroute` VALUES (101, '{}', '997a4c27a433458aafed9b8aa252d957', 1288657613998579712, '【身份认证服务】- 组织机构列表', '/api/identity/organization-units', '', '', '/api/identity/organization-units', 'GET,POST,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP'); INSERT INTO `appapigatewayreroute` VALUES (102, '{}', 'a2c6acc9882a425ab26bd3ad5a9c17c6', 1288657941770854400, '【身份认证服务】- 组织机构管理', '/api/identity/organization-units/{id}', '', '', '/api/identity/organization-units/{id}', 'GET,PUT,DELETE,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 1, 30000, 1, '', 'TEST-APP'); @@ -1134,6 +1164,11 @@ INSERT INTO `appapigatewayreroute` VALUES (148, '{}', '824f5eee6877489f96f1022e3 INSERT INTO `appapigatewayreroute` VALUES (149, '{}', 'fe1379d4a13f41afb6410f4c948871f3', 1319555067183730688, '【身份认证服务】- 删除角色组织机构', '/api/identity/roles/{id}/organization-units/{ouId}', '', '', '/api/identity/roles/{id}/organization-units/{ouId}', 'DELETE,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP'); INSERT INTO `appapigatewayreroute` VALUES (150, '{}', '197a69bb723346aba3601bd61e7fa655', 1319555230765780992, '【身份认证服务】- 管理用户组织机构', '/api/identity/users/{id}/organization-units', '', '', '/api/identity/users/{id}/organization-units', 'GET,PUT,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP'); INSERT INTO `appapigatewayreroute` VALUES (151, '{}', '1a7e6d0b1c95484f82a75a2ce6e6f453', 1319555333790470144, '【身份认证服务】- 删除用户组织机构', '/api/identity/users/{id}/organization-units/{ouId}', '', '', '/api/identity/users/{id}/organization-units/{ouId}', 'DELETE,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30015,', '', '', '', 0, 30000, 1, '', 'TEST-APP'); +INSERT INTO `appapigatewayreroute` VALUES (152, '{}', 'ecfa9bbd19694097b33e691b653f2124', 1321001932510203904, '【消息服务】- 我的消息', '/api/im/chat/my-messages', '', '', '/api/im/chat/my-messages', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30020,', '', '', '', 0, 30000, 1, '', 'TEST-APP'); +INSERT INTO `appapigatewayreroute` VALUES (153, '{}', '4867ad188ca54acb8b961d20297b6545', 1321002059803136000, '【消息服务】- 我的最近消息', '/api/im/chat/my-last-messages', '', '', '/api/im/chat/my-last-messages', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30020,', '', '', '', 0, 30000, 1, '', 'TEST-APP'); +INSERT INTO `appapigatewayreroute` VALUES (154, '{}', '291ab802d7bc4af98fc15c509f98fa75', 1321002256440496128, '【消息服务】- 我的朋友', '/api/im/my-friends', '', '', '/api/im/my-friends', 'GET,POST,DELETE,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30020,', '', '', '', 0, 30000, 1, '', 'TEST-APP'); +INSERT INTO `appapigatewayreroute` VALUES (155, '{}', '08438dabb1e849988e0c304f82b08a10', 1321002350686507008, '【消息服务】- 我的所有朋友', '/api/im/my-friends/all', '', '', '/api/im/my-friends/all', 'GET,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30020,', '', '', '', 0, 30000, 1, '', 'TEST-APP'); +INSERT INTO `appapigatewayreroute` VALUES (156, '{}', 'cecf632785b7402299764698369c751f', 1322190027988525056, '【消息服务】- 发送好友请求', '/api/im/my-friends/add-request', '', '', '/api/im/my-friends/add-request', 'POST,', '', '', '', '', '', '', '', 1, '', '', 'HTTP', '127.0.0.1:30020,', '', '', '', 0, 30000, 1, '', 'TEST-APP'); -- ---------------------------- -- Table structure for appapigatewayroutegroup @@ -1177,7 +1212,7 @@ CREATE TABLE `appapigatewaysecurityoptions` ( PRIMARY KEY (`Id`) USING BTREE, UNIQUE INDEX `IX_AppApiGatewaySecurityOptions_ReRouteId`(`ReRouteId`) USING BTREE, CONSTRAINT `FK_AppApiGatewaySecurityOptions_AppApiGatewayReRoute_ReRouteId` FOREIGN KEY (`ReRouteId`) REFERENCES `appapigatewayreroute` (`ReRouteId`) ON DELETE CASCADE ON UPDATE RESTRICT -) ENGINE = InnoDB AUTO_INCREMENT = 145 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; +) ENGINE = InnoDB AUTO_INCREMENT = 149 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of appapigatewaysecurityoptions @@ -1292,6 +1327,11 @@ INSERT INTO `appapigatewaysecurityoptions` VALUES (141, 1319554948434595840, '', INSERT INTO `appapigatewaysecurityoptions` VALUES (142, 1319555067183730688, '', ''); INSERT INTO `appapigatewaysecurityoptions` VALUES (143, 1319555230765780992, '', ''); INSERT INTO `appapigatewaysecurityoptions` VALUES (144, 1319555333790470144, '', ''); +INSERT INTO `appapigatewaysecurityoptions` VALUES (145, 1321001932510203904, '', ''); +INSERT INTO `appapigatewaysecurityoptions` VALUES (146, 1321002059803136000, '', ''); +INSERT INTO `appapigatewaysecurityoptions` VALUES (147, 1321002256440496128, '', ''); +INSERT INTO `appapigatewaysecurityoptions` VALUES (148, 1321002350686507008, '', ''); +INSERT INTO `appapigatewaysecurityoptions` VALUES (149, 1322190027988525056, '', ''); -- ---------------------------- -- Table structure for cap.published @@ -1313,25 +1353,7 @@ CREATE TABLE `cap.published` ( -- ---------------------------- -- Records of cap.published -- ---------------------------- -INSERT INTO `cap.published` VALUES (1319249373444280320, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319249373444280320\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/22 20:08:55 +08:00\",\"cap-corr-id\":\"1319249373444280320\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-22T20:08:55.7543668+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Modify\",\"Object\":\"ReRoute\"}}', 0, '2020-10-22 20:08:56', '2020-10-23 20:08:56', 'Succeeded'); -INSERT INTO `cap.published` VALUES (1319249405602009088, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319249405602009088\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/22 20:09:03 +08:00\",\"cap-corr-id\":\"1319249405602009088\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-22T20:09:03.4203308+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Modify\",\"Object\":\"ReRoute\"}}', 0, '2020-10-22 20:09:03', '2020-10-23 20:09:03', 'Succeeded'); -INSERT INTO `cap.published` VALUES (1319249482190000128, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319249482190000128\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/22 20:09:21 +08:00\",\"cap-corr-id\":\"1319249482190000128\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-22T20:09:21.681402+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Modify\",\"Object\":\"ReRoute\"}}', 0, '2020-10-22 20:09:22', '2020-10-23 20:09:22', 'Succeeded'); -INSERT INTO `cap.published` VALUES (1319249848986079232, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319249848986079232\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/22 20:10:49 +08:00\",\"cap-corr-id\":\"1319249848986079232\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-22T20:10:49.1328929+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"AggregateRoute\"}}', 0, '2020-10-22 20:10:49', '2020-10-23 20:10:49', 'Succeeded'); -INSERT INTO `cap.published` VALUES (1319250220064542720, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319250220064542720\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/22 20:12:17 +08:00\",\"cap-corr-id\":\"1319250220064542720\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-22T20:12:17.6028009+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Update\",\"Object\":\"AggregateRoute\"}}', 0, '2020-10-22 20:12:18', '2020-10-23 20:12:18', 'Succeeded'); -INSERT INTO `cap.published` VALUES (1319253036082499584, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319253036082499584\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/22 20:23:28 +08:00\",\"cap-corr-id\":\"1319253036082499584\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-22T20:23:28.995489+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"AddRouteConfig\",\"Object\":\"AggregateRoute\"}}', 0, '2020-10-22 20:23:29', '2020-10-23 20:23:29', 'Succeeded'); -INSERT INTO `cap.published` VALUES (1319269094700978176, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319269094700978176\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/22 21:27:17 +08:00\",\"cap-corr-id\":\"1319269094700978176\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-22T21:27:17.6683764+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Delete\",\"Object\":\"AggregateRoute\"}}', 0, '2020-10-22 21:27:18', '2020-10-23 21:27:18', 'Succeeded'); -INSERT INTO `cap.published` VALUES (1319269302629404672, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319269302629404672\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/22 21:28:07 +08:00\",\"cap-corr-id\":\"1319269302629404672\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-22T21:28:07.2407943+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Delete\",\"Object\":\"AggregateRoute\"}}', 0, '2020-10-22 21:28:07', '2020-10-23 21:28:07', 'Succeeded'); -INSERT INTO `cap.published` VALUES (1319269513921662976, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319269513921662976\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/22 21:28:57 +08:00\",\"cap-corr-id\":\"1319269513921662976\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-22T21:28:57.6185875+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Delete\",\"Object\":\"AggregateRoute\"}}', 0, '2020-10-22 21:28:58', '2020-10-23 21:28:58', 'Succeeded'); -INSERT INTO `cap.published` VALUES (1319554100082085888, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319554100082085888\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/23 16:19:48 +08:00\",\"cap-corr-id\":\"1319554100082085888\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-23T16:19:48.2464771+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Modify\",\"Object\":\"ReRoute\"}}', 0, '2020-10-23 16:19:48', '2020-10-24 16:19:48', 'Succeeded'); -INSERT INTO `cap.published` VALUES (1319554182298832896, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319554182298832896\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/23 16:20:07 +08:00\",\"cap-corr-id\":\"1319554182298832896\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-23T16:20:07.8366727+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Modify\",\"Object\":\"ReRoute\"}}', 0, '2020-10-23 16:20:08', '2020-10-24 16:20:08', 'Succeeded'); -INSERT INTO `cap.published` VALUES (1319554431205609472, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319554431205609472\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/23 16:21:07 +08:00\",\"cap-corr-id\":\"1319554431205609472\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-23T16:21:07.192283+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"ReRoute\"}}', 0, '2020-10-23 16:21:07', '2020-10-24 16:21:07', 'Succeeded'); -INSERT INTO `cap.published` VALUES (1319554550520975360, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319554550520975360\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/23 16:21:35 +08:00\",\"cap-corr-id\":\"1319554550520975360\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-23T16:21:35.6396895+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"ReRoute\"}}', 0, '2020-10-23 16:21:36', '2020-10-24 16:21:36', 'Succeeded'); -INSERT INTO `cap.published` VALUES (1319554948505899008, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319554948505899008\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/23 16:23:10 +08:00\",\"cap-corr-id\":\"1319554948505899008\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-23T16:23:10.5258597+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"ReRoute\"}}', 0, '2020-10-23 16:23:11', '2020-10-24 16:23:11', 'Succeeded'); -INSERT INTO `cap.published` VALUES (1319555067250839552, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319555067250839552\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/23 16:23:38 +08:00\",\"cap-corr-id\":\"1319555067250839552\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-23T16:23:38.8355819+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"ReRoute\"}}', 0, '2020-10-23 16:23:39', '2020-10-24 16:23:39', 'Succeeded'); -INSERT INTO `cap.published` VALUES (1319555230837084160, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319555230837084160\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/23 16:24:17 +08:00\",\"cap-corr-id\":\"1319555230837084160\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-23T16:24:17.8394311+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"ReRoute\"}}', 0, '2020-10-23 16:24:18', '2020-10-24 16:24:18', 'Succeeded'); -INSERT INTO `cap.published` VALUES (1319555333865967616, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319555333865967616\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/23 16:24:42 +08:00\",\"cap-corr-id\":\"1319555333865967616\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-23T16:24:42.403288+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"ReRoute\"}}', 0, '2020-10-23 16:24:42', '2020-10-24 16:24:42', 'Succeeded'); -INSERT INTO `cap.published` VALUES (1319567388383744000, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319567388383744000\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/23 17:12:36 +08:00\",\"cap-corr-id\":\"1319567388383744000\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-23T17:12:36.4191302+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Modify\",\"Object\":\"ReRoute\"}}', 0, '2020-10-23 17:12:36', '2020-10-24 17:12:36', 'Succeeded'); -INSERT INTO `cap.published` VALUES (1319567469363171328, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1319567469363171328\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/23 17:12:55 +08:00\",\"cap-corr-id\":\"1319567469363171328\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-23T17:12:55.7317902+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Modify\",\"Object\":\"ReRoute\"}}', 0, '2020-10-23 17:12:56', '2020-10-24 17:12:56', 'Succeeded'); +INSERT INTO `cap.published` VALUES (1322190029573971968, 'v1', 'LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData', '{\"Headers\":{\"cap-callback-name\":null,\"cap-msg-id\":\"1322190029573971968\",\"cap-msg-name\":\"LINGYUN.ApiGateway.EventBus.ApigatewayConfigChangeEventData\",\"cap-msg-type\":\"Object\",\"cap-senttime\":\"2020/10/30 22:54:02 +08:00\",\"cap-corr-id\":\"1322190029573971968\",\"cap-corr-seq\":\"0\"},\"Value\":{\"DateTime\":\"2020-10-30T22:54:02.8070185+08:00\",\"AppId\":\"TEST-APP\",\"Method\":\"Create\",\"Object\":\"ReRoute\"}}', 0, '2020-10-30 22:54:03', '2020-10-31 22:54:03', 'Succeeded'); -- ---------------------------- -- Table structure for cap.received diff --git a/aspnet-core/modules/common/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json.csproj b/aspnet-core/modules/common/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json.csproj new file mode 100644 index 000000000..c076ced26 --- /dev/null +++ b/aspnet-core/modules/common/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json.csproj @@ -0,0 +1,15 @@ + + + + + + netcoreapp3.1 + + + + + + + + + diff --git a/aspnet-core/modules/common/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json/LINGYUN/Abp/AspNetCore/SignalR/Protocol/Json/AbpAspNetCoreSignalRProtocolJsonModule.cs b/aspnet-core/modules/common/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json/LINGYUN/Abp/AspNetCore/SignalR/Protocol/Json/AbpAspNetCoreSignalRProtocolJsonModule.cs new file mode 100644 index 000000000..8fe7468cb --- /dev/null +++ b/aspnet-core/modules/common/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json/LINGYUN/Abp/AspNetCore/SignalR/Protocol/Json/AbpAspNetCoreSignalRProtocolJsonModule.cs @@ -0,0 +1,22 @@ +using Microsoft.AspNetCore.SignalR; +using Microsoft.AspNetCore.SignalR.Protocol; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection.Extensions; +using Volo.Abp.AspNetCore.SignalR; +using Volo.Abp.Modularity; + +namespace LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json +{ + [DependsOn( + typeof(AbpAspNetCoreSignalRModule))] + public class AbpAspNetCoreSignalRProtocolJsonModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + var newtonsoftJsonOptions = new NewtonsoftJsonHubProtocolOptions(); + context.Services.ExecutePreConfiguredActions(newtonsoftJsonOptions); + + context.Services.TryAddEnumerable(ServiceDescriptor.Singleton()); + } + } +} diff --git a/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN.Abp.ExceptionHandling.Notifications.csproj b/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN.Abp.ExceptionHandling.Notifications.csproj index 022a6eeb1..199296896 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN.Abp.ExceptionHandling.Notifications.csproj +++ b/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN.Abp.ExceptionHandling.Notifications.csproj @@ -7,6 +7,21 @@ + + + + + + + + + + + + + + + diff --git a/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpExceptionHandlingNotificationDefinitionProvider.cs b/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpExceptionHandlingNotificationDefinitionProvider.cs index 2e1904193..cbddc8a83 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpExceptionHandlingNotificationDefinitionProvider.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpExceptionHandlingNotificationDefinitionProvider.cs @@ -1,4 +1,6 @@ -using LINGYUN.Abp.Notifications; +using LINGYUN.Abp.ExceptionHandling.Localization; +using LINGYUN.Abp.Notifications; +using Volo.Abp.Localization; namespace LINGYUN.Abp.ExceptionHandling.Notifications { @@ -6,7 +8,23 @@ namespace LINGYUN.Abp.ExceptionHandling.Notifications { public override void Define(INotificationDefinitionContext context) { - context.Add(new NotificationDefinition(AbpExceptionHandlingNotificationNames.NotificationName)); + var exceptionGroup = context.AddGroup( + AbpExceptionHandlingNotificationNames.GroupName, + L("Notifications:Exception"), + false); + + exceptionGroup.AddNotification( + name: AbpExceptionHandlingNotificationNames.NotificationName, + displayName: L("Notifications:ExceptionNotifier"), + description: L("Notifications:ExceptionNotifier"), + notificationType: NotificationType.System, + lifetime: NotificationLifetime.Persistent, + allowSubscriptionToClients: false); + } + + protected LocalizableString L(string name) + { + return LocalizableString.Create(name); } } } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpExceptionHandlingNotificationNames.cs b/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpExceptionHandlingNotificationNames.cs index 4299d63c9..9c8b2caa2 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpExceptionHandlingNotificationNames.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpExceptionHandlingNotificationNames.cs @@ -2,6 +2,7 @@ { public class AbpExceptionHandlingNotificationNames { - public const string NotificationName = "Abp.ExceptionHandling.Notifier"; + public const string GroupName = "LINGYUN.Abp.ExceptionHandling"; + public const string NotificationName = GroupName + ".Notifier"; } } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpNotificationsExceptionHandlingModule.cs b/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpNotificationsExceptionHandlingModule.cs index d48d84368..1f9d501f9 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpNotificationsExceptionHandlingModule.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpNotificationsExceptionHandlingModule.cs @@ -1,5 +1,8 @@ -using LINGYUN.Abp.Notifications; +using LINGYUN.Abp.ExceptionHandling.Localization; +using LINGYUN.Abp.Notifications; +using Volo.Abp.Localization; using Volo.Abp.Modularity; +using Volo.Abp.VirtualFileSystem; namespace LINGYUN.Abp.ExceptionHandling.Notifications { @@ -8,5 +11,19 @@ namespace LINGYUN.Abp.ExceptionHandling.Notifications typeof(AbpNotificationModule))] public class AbpNotificationsExceptionHandlingModule : AbpModule { + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + + Configure(options => + { + options.Resources + .Get() + .AddVirtualJson("/LINGYUN/Abp/ExceptionHandling/Notifications/Localization/Resources"); + }); + } } } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpNotificationsExceptionSubscriber.cs b/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpNotificationsExceptionSubscriber.cs index 26c2a5c2a..d7b30abf9 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpNotificationsExceptionSubscriber.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/AbpNotificationsExceptionSubscriber.cs @@ -21,26 +21,23 @@ namespace LINGYUN.Abp.ExceptionHandling.Notifications protected override async Task SendErrorNotifierAsync(ExceptionSendNotifierContext context) { - var notificationDispatcher = context.ServiceProvider.GetRequiredService(); - var notificationName = NotificationNameNormalizer - .NormalizerName(AbpExceptionHandlingNotificationNames.NotificationName); - NotificationData notificationData; - if (CurrentTenant.IsAvailable) - { - notificationData = NotificationData.CreateTenantNotificationData(CurrentTenant.Id.Value); - } - else - { - notificationData = NotificationData.CreateNotificationData(); - } + var notificationSender = context.ServiceProvider.GetRequiredService(); + + NotificationData notificationData = new NotificationData(); // 写入通知数据 //TODO:集成TextTemplate完成格式化的推送 notificationData.WriteStandardData( - context.Exception.GetType().FullName, context.Exception.Message, - DateTime.Now, "System"); + context.Exception.GetType().FullName, + context.Exception.Message, + DateTime.Now, + "System"); - await notificationDispatcher.DispatchAsync(notificationName, notificationData, - CurrentTenant.Id, NotificationSeverity.Error); + await notificationSender.SendNofiterAsync( + AbpExceptionHandlingNotificationNames.NotificationName, + notificationData, + null, + CurrentTenant.Id, + NotificationSeverity.Error); } } } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/Localization/Resources/en.json b/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/Localization/Resources/en.json new file mode 100644 index 000000000..16edd1673 --- /dev/null +++ b/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/Localization/Resources/en.json @@ -0,0 +1,7 @@ +{ + "culture": "en", + "texts": { + "Notifications:Exception": "Exception", + "Notifications:ExceptionNotifier": "Exception Notifier" + } +} \ No newline at end of file diff --git a/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/Localization/Resources/zh-Hans.json b/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/Localization/Resources/zh-Hans.json new file mode 100644 index 000000000..9649f9c04 --- /dev/null +++ b/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling.Notifications/LINGYUN/Abp/ExceptionHandling/Notifications/Localization/Resources/zh-Hans.json @@ -0,0 +1,7 @@ +{ + "culture": "zh-Hans", + "texts": { + "Notifications:Exception": "异常通知", + "Notifications:ExceptionNotifier": "异常推送" + } +} \ No newline at end of file diff --git a/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling/LINGYUN.Abp.ExceptionHandling.csproj b/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling/LINGYUN.Abp.ExceptionHandling.csproj index c630ff1f8..161c30c4d 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling/LINGYUN.Abp.ExceptionHandling.csproj +++ b/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling/LINGYUN.Abp.ExceptionHandling.csproj @@ -8,7 +8,7 @@ - + diff --git a/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling/LINGYUN/Abp/ExceptionHandling/AbpExceptionHandlingModule.cs b/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling/LINGYUN/Abp/ExceptionHandling/AbpExceptionHandlingModule.cs index acd417376..17823f27a 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling/LINGYUN/Abp/ExceptionHandling/AbpExceptionHandlingModule.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling/LINGYUN/Abp/ExceptionHandling/AbpExceptionHandlingModule.cs @@ -1,8 +1,18 @@ -using Volo.Abp.Modularity; +using LINGYUN.Abp.ExceptionHandling.Localization; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; namespace LINGYUN.Abp.ExceptionHandling { + [DependsOn(typeof(AbpLocalizationModule))] public class AbpExceptionHandlingModule : AbpModule { + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.Resources.Add("en"); + }); + } } } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling/LINGYUN/Abp/ExceptionHandling/Localization/ExceptionHandlingResource.cs b/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling/LINGYUN/Abp/ExceptionHandling/Localization/ExceptionHandlingResource.cs new file mode 100644 index 000000000..4eba5b5fa --- /dev/null +++ b/aspnet-core/modules/common/LINGYUN.Abp.ExceptionHandling/LINGYUN/Abp/ExceptionHandling/Localization/ExceptionHandlingResource.cs @@ -0,0 +1,9 @@ +using Volo.Abp.Localization; + +namespace LINGYUN.Abp.ExceptionHandling.Localization +{ + [LocalizationResourceName("AbpExceptionHandling")] + public class ExceptionHandlingResource + { + } +} diff --git a/aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/AbpIMSignalRModule.cs b/aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/AbpIMSignalRModule.cs index 4eaf55790..b994e8239 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/AbpIMSignalRModule.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/AbpIMSignalRModule.cs @@ -1,18 +1,23 @@ using LINGYUN.Abp.AspNetCore.SignalR.JwtToken; +using LINGYUN.Abp.IM.SignalR.Messages; using LINGYUN.Abp.RealTime.SignalR; -using Volo.Abp.AspNetCore.SignalR; using Volo.Abp.Modularity; namespace LINGYUN.Abp.IM.SignalR { [DependsOn( + typeof(AbpIMModule), typeof(AbpRealTimeSignalRModule), - typeof(AbpAspNetCoreSignalRModule), typeof(AbpAspNetCoreSignalRJwtTokenModule))] public class AbpIMSignalRModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) { + Configure(options => + { + options.Providers.Add(); + }); + Configure(options => { options.MapPath("messages"); diff --git a/aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Hubs/MessagesHub.cs b/aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Hubs/MessagesHub.cs index 014a9032e..8dbedb09c 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Hubs/MessagesHub.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Hubs/MessagesHub.cs @@ -10,7 +10,6 @@ using System; using System.Collections.Immutable; using System.Linq; using System.Threading.Tasks; -using Volo.Abp; using Volo.Abp.Application.Dtos; using Volo.Abp.Users; @@ -35,6 +34,7 @@ namespace LINGYUN.Abp.IM.SignalR.Hubs protected override async Task OnClientConnectedAsync(IOnlineClient client) { + await base.OnClientConnectedAsync(client); // 加入通讯组 var userGroups = await UserGroupStore.GetUserGroupsAsync(client.TenantId, client.UserId.Value); foreach (var group in userGroups) @@ -61,33 +61,35 @@ namespace LINGYUN.Abp.IM.SignalR.Hubs } } - protected override async Task OnClientDisconnectedAsync(IOnlineClient client) - { - // 从通讯组断开会话 - var userGroups = await UserGroupStore.GetUserGroupsAsync(client.TenantId, client.UserId.Value); - foreach (var group in userGroups) - { - await Groups.RemoveFromGroupAsync(client.ConnectionId, group.Name); - var groupClient = Clients.Group(group.Name); - if (groupClient != null) - { - // 发送用户下线指令 - await groupClient.SendAsync("onUserOfflined", client.TenantId, client.UserId.Value); - } - } - - // 发送好友下线通知 - var userFriends = await FriendStore.GetListAsync(client.TenantId, client.UserId.Value); - if (userFriends.Count > 0) - { - var friendClientIds = userFriends.Select(friend => friend.FriendId.ToString()).ToImmutableArray(); - var userClients = Clients.Users(friendClientIds); - if (userClients != null) - { - await userClients.SendAsync("onUserOfflined", client.TenantId, client.UserId.Value); - } - } - } + //protected override async Task OnClientDisconnectedAsync(IOnlineClient client) + //{ + // // 从通讯组断开会话 + // var userGroups = await UserGroupStore.GetUserGroupsAsync(client.TenantId, client.UserId.Value, Context.ConnectionAborted); + // foreach (var group in userGroups) + // { + // await Groups.RemoveFromGroupAsync(client.ConnectionId, group.Name, Context.ConnectionAborted); + // var groupClient = Clients.Group(group.Name); + // if (groupClient != null) + // { + // // 发送用户下线指令 + // await groupClient.SendAsync("onUserOfflined", client.TenantId, client.UserId.Value, Context.ConnectionAborted); + // } + // } + + // // 发送好友下线通知 + // var userFriends = await FriendStore.GetListAsync(client.TenantId, client.UserId.Value, cancellationToken: Context.ConnectionAborted); + // if (userFriends.Count > 0) + // { + // var friendClientIds = userFriends.Select(friend => friend.FriendId.ToString()).ToImmutableArray(); + // var userClients = Clients.Users(friendClientIds); + // if (userClients != null) + // { + // await userClients.SendAsync("onUserOfflined", client.TenantId, client.UserId.Value, Context.ConnectionAborted); + // } + // } + + // await base.OnClientDisconnectedAsync(client); + //} [HubMethodName("LastContactFriends")] public virtual async Task> GetLastContactFriendsAsync( @@ -99,7 +101,7 @@ namespace LINGYUN.Abp.IM.SignalR.Hubs var myFrientCount = await FriendStore.GetCountAsync(tenantId, userId); var lastContractFriends = await FriendStore - .GetLastContactListAsync(tenantId, userId, skipCount, maxResultCount); + .GetLastContactListAsync(tenantId, userId, skipCount, maxResultCount, cancellationToken: Context.ConnectionAborted); return new PagedResultDto(myFrientCount, lastContractFriends); } @@ -123,7 +125,7 @@ namespace LINGYUN.Abp.IM.SignalR.Hubs { var messages = await MessageStore .GetLastChatMessagesAsync( - CurrentTenant.Id, userId, sorting, reverse, maxResultCount); + CurrentTenant.Id, userId, sorting, reverse, maxResultCount, cancellationToken: Context.ConnectionAborted); return new ListResultDto(messages); } @@ -144,7 +146,7 @@ namespace LINGYUN.Abp.IM.SignalR.Hubs bool reverse = false) { var userFriends = await FriendStore - .GetListAsync(CurrentTenant.Id, userId, sorting, reverse); + .GetListAsync(CurrentTenant.Id, userId, sorting, reverse, cancellationToken: Context.ConnectionAborted); return new ListResultDto(userFriends); } @@ -156,7 +158,7 @@ namespace LINGYUN.Abp.IM.SignalR.Hubs Guid friendId, string remarkName = "") { - await FriendStore.AddMemberAsync(tenantId, userId, friendId, remarkName); + await FriendStore.AddRequestAsync(tenantId, userId, friendId, remarkName); } [HubMethodName("RemoveFriend")] @@ -166,7 +168,7 @@ namespace LINGYUN.Abp.IM.SignalR.Hubs Guid friendId, string remarkName = "") { - await FriendStore.RemoveMemberAsync(tenantId, userId, friendId); + await FriendStore.RemoveMemberAsync(tenantId, userId, friendId, cancellationToken: Context.ConnectionAborted); } /// @@ -178,7 +180,7 @@ namespace LINGYUN.Abp.IM.SignalR.Hubs public virtual async Task SendMessageAsync(ChatMessage chatMessage) { // 持久化 - await MessageStore.StoreMessageAsync(chatMessage); + await MessageStore.StoreMessageAsync(chatMessage, cancellationToken: Context.ConnectionAborted); if (!chatMessage.GroupId.IsNullOrWhiteSpace()) { @@ -199,7 +201,7 @@ namespace LINGYUN.Abp.IM.SignalR.Hubs return; } - await signalRClient.SendAsync("getChatMessage", chatMessage); + await signalRClient.SendAsync("getChatMessage", chatMessage, cancellationToken: Context.ConnectionAborted); } protected virtual async Task SendMessageToUserAsync(ChatMessage chatMessage) @@ -217,7 +219,7 @@ namespace LINGYUN.Abp.IM.SignalR.Hubs Logger.LogDebug("Can not get user " + onlineClientContext.UserId + " with connectionId " + onlineClient.ConnectionId + " from SignalR hub!"); continue; } - await signalRClient.SendAsync("getChatMessage", chatMessage); + await signalRClient.SendAsync("getChatMessage", chatMessage, cancellationToken: Context.ConnectionAborted); } catch (Exception ex) { diff --git a/aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Messages/SignalRMessageSender.cs b/aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Messages/SignalRMessageSenderProvider.cs similarity index 84% rename from aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Messages/SignalRMessageSender.cs rename to aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Messages/SignalRMessageSenderProvider.cs index 705649860..923a3b211 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Messages/SignalRMessageSender.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Messages/SignalRMessageSenderProvider.cs @@ -2,30 +2,27 @@ using LINGYUN.Abp.IM.SignalR.Hubs; using LINGYUN.Abp.RealTime.Client; using Microsoft.AspNetCore.SignalR; -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using System; using System.Collections.Immutable; using System.Linq; using System.Threading.Tasks; -using Volo.Abp.DependencyInjection; namespace LINGYUN.Abp.IM.SignalR.Messages { - [Dependency(ServiceLifetime.Transient, ReplaceServices = true)] - [ExposeServices(typeof(IMessageSender))] - public class SignalRMessageSender : MessageSenderBase + public class SignalRMessageSenderProvider : MessageSenderProviderBase { + public override string Name => "SignalR"; + private readonly IOnlineClientManager _onlineClientManager; private readonly IHubContext _hubContext; - public SignalRMessageSender( + public SignalRMessageSenderProvider( IOnlineClientManager onlineClientManager, IHubContext hubContext, - IMessageStore messageStore, - ILogger logger) - : base(messageStore, logger) + IServiceProvider serviceProvider) + : base(serviceProvider) { _hubContext = hubContext; _onlineClientManager = onlineClientManager; diff --git a/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN.Abp.IM.csproj b/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN.Abp.IM.csproj index f42bdd24c..7f324bea2 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN.Abp.IM.csproj +++ b/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN.Abp.IM.csproj @@ -9,6 +9,7 @@ + diff --git a/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/AbpIMModule.cs b/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/AbpIMModule.cs new file mode 100644 index 000000000..1b3bc6012 --- /dev/null +++ b/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/AbpIMModule.cs @@ -0,0 +1,10 @@ +using Volo.Abp.EventBus; +using Volo.Abp.Modularity; + +namespace LINGYUN.Abp.IM +{ + [DependsOn(typeof(AbpEventBusModule))] + public class AbpIMModule : AbpModule + { + } +} diff --git a/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/AbpIMOptions.cs b/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/AbpIMOptions.cs new file mode 100644 index 000000000..01b49fd6e --- /dev/null +++ b/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/AbpIMOptions.cs @@ -0,0 +1,15 @@ +using LINGYUN.Abp.IM.Messages; +using Volo.Abp.Collections; + +namespace LINGYUN.Abp.IM +{ + public class AbpIMOptions + { + public ITypeList Providers { get; } + + public AbpIMOptions() + { + Providers = new TypeList(); + } + } +} diff --git a/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/IFriendStore.cs b/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/IFriendStore.cs index 8f0aae9ef..237a9a486 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/IFriendStore.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Contract/IFriendStore.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Threading; using System.Threading.Tasks; namespace LINGYUN.Abp.IM.Contract @@ -16,7 +17,8 @@ namespace LINGYUN.Abp.IM.Contract Task IsFriendAsync( Guid? tenantId, Guid userId, - Guid friendId + Guid friendId, + CancellationToken cancellationToken = default ); /// /// 查询好友列表 @@ -30,7 +32,8 @@ namespace LINGYUN.Abp.IM.Contract Guid? tenantId, Guid userId, string sorting = nameof(UserFriend.UserId), - bool reverse = false + bool reverse = false, + CancellationToken cancellationToken = default ); /// /// 获取好友数量 @@ -42,7 +45,8 @@ namespace LINGYUN.Abp.IM.Contract Task GetCountAsync( Guid? tenantId, Guid userId, - string filter = ""); + string filter = "", + CancellationToken cancellationToken = default); /// /// 获取好友列表 /// @@ -61,7 +65,8 @@ namespace LINGYUN.Abp.IM.Contract string sorting = nameof(UserFriend.UserId), bool reverse = false, int skipCount = 0, - int maxResultCount = 10); + int maxResultCount = 10, + CancellationToken cancellationToken = default); /// /// 获取最近联系好友列表 /// @@ -74,7 +79,8 @@ namespace LINGYUN.Abp.IM.Contract Guid? tenantId, Guid userId, int skipCount = 0, - int maxResultCount = 10); + int maxResultCount = 10, + CancellationToken cancellationToken = default); /// /// 获取好友信息 /// @@ -85,20 +91,36 @@ namespace LINGYUN.Abp.IM.Contract Task GetMemberAsync( Guid? tenantId, Guid userId, - Guid friendId); + Guid friendId, + CancellationToken cancellationToken = default); /// /// 添加好友 /// /// /// /// + /// + Task AddMemberAsync( + Guid? tenantId, + Guid userId, + Guid friendId, + string remarkName = "", + CancellationToken cancellationToken = default); + /// + /// 添加好友请求 + /// + /// + /// + /// /// /// - Task AddMemberAsync( + Task AddRequestAsync( Guid? tenantId, Guid userId, Guid friendId, - string remarkName = ""); + string remarkName = "", + string description = "", + CancellationToken cancellationToken = default); /// /// 移除好友 /// @@ -109,7 +131,8 @@ namespace LINGYUN.Abp.IM.Contract Task RemoveMemberAsync( Guid? tenantId, Guid userId, - Guid friendId); + Guid friendId, + CancellationToken cancellationToken = default); /// /// 添加黑名单 /// @@ -120,7 +143,8 @@ namespace LINGYUN.Abp.IM.Contract Task AddShieldMemberAsync( Guid? tenantId, Guid userId, - Guid friendId); + Guid friendId, + CancellationToken cancellationToken = default); /// /// 移除黑名单 /// @@ -131,6 +155,7 @@ namespace LINGYUN.Abp.IM.Contract Task RemoveShieldMemberAsync( Guid? tenantId, Guid userId, - Guid friendId); + Guid friendId, + CancellationToken cancellationToken = default); } } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Group/IUserGroupStore.cs b/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Group/IUserGroupStore.cs index d46dbf9ef..ea7212f7f 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Group/IUserGroupStore.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Group/IUserGroupStore.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Threading; using System.Threading.Tasks; namespace LINGYUN.Abp.IM.Group @@ -13,7 +14,11 @@ namespace LINGYUN.Abp.IM.Group /// /// /// - Task MemberHasInGroupAsync(Guid? tenantId, long groupId, Guid userId); + Task MemberHasInGroupAsync( + Guid? tenantId, + long groupId, + Guid userId, + CancellationToken cancellationToken = default); /// /// 获取群组用户身份 /// @@ -21,28 +26,41 @@ namespace LINGYUN.Abp.IM.Group /// /// /// - Task GetUserGroupCardAsync(Guid? tenantId, long groupId, Guid userId); + Task GetUserGroupCardAsync( + Guid? tenantId, + long groupId, + Guid userId, + CancellationToken cancellationToken = default); /// /// 获取用户所在通讯组列表 /// /// /// /// - Task> GetUserGroupsAsync(Guid? tenantId, Guid userId); + Task> GetUserGroupsAsync( + Guid? tenantId, + Guid userId, + CancellationToken cancellationToken = default); /// /// 获取群组成员列表 /// /// /// /// - Task> GetMembersAsync(Guid? tenantId, long groupId); + Task> GetMembersAsync( + Guid? tenantId, + long groupId, + CancellationToken cancellationToken = default); /// /// 获取群组成员数 /// /// /// /// - Task GetMembersCountAsync(Guid? tenantId, long groupId); + Task GetMembersCountAsync( + Guid? tenantId, + long groupId, + CancellationToken cancellationToken = default); /// /// 获取通讯组用户 /// @@ -59,7 +77,8 @@ namespace LINGYUN.Abp.IM.Group string sorting = nameof(GroupUserCard.UserId), bool reverse = false, int skipCount = 0, - int maxResultCount = 10); + int maxResultCount = 10, + CancellationToken cancellationToken = default); /// /// 用户加入通讯组 /// @@ -67,7 +86,12 @@ namespace LINGYUN.Abp.IM.Group /// /// /// - Task AddUserToGroupAsync(Guid? tenantId, Guid userId, long groupId, Guid acceptUserId); + Task AddUserToGroupAsync( + Guid? tenantId, + Guid userId, + long groupId, + Guid acceptUserId, + CancellationToken cancellationToken = default); /// /// 用户退出通讯组 /// @@ -75,6 +99,10 @@ namespace LINGYUN.Abp.IM.Group /// /// /// - Task RemoveUserFormGroupAsync(Guid? tenantId, Guid userId, long groupId); + Task RemoveUserFormGroupAsync( + Guid? tenantId, + Guid userId, + long groupId, + CancellationToken cancellationToken = default); } } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/ChatMessage.cs b/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/ChatMessage.cs index 28a4aa492..d3bae7b7e 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/ChatMessage.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/ChatMessage.cs @@ -48,7 +48,7 @@ namespace LINGYUN.Abp.IM.Messages /// public DateTime SendTime { get; set; } /// - /// 是否匿名发送 + /// 是否匿名发送(存储在扩展字段) /// public bool IsAnonymous { get; set; } /// diff --git a/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageSenderProvider.cs b/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageSenderProvider.cs new file mode 100644 index 000000000..fb7862084 --- /dev/null +++ b/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageSenderProvider.cs @@ -0,0 +1,10 @@ +using System.Threading.Tasks; + +namespace LINGYUN.Abp.IM.Messages +{ + public interface IMessageSenderProvider + { + string Name { get; } + Task SendMessageAsync(ChatMessage chatMessage); + } +} diff --git a/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageSenderProviderManager.cs b/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageSenderProviderManager.cs new file mode 100644 index 000000000..08a292d1d --- /dev/null +++ b/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageSenderProviderManager.cs @@ -0,0 +1,9 @@ +using System.Collections.Generic; + +namespace LINGYUN.Abp.IM.Messages +{ + public interface IMessageSenderProviderManager + { + List Providers { get; } + } +} diff --git a/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageStore.cs b/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageStore.cs index 81ac75b7f..560548237 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageStore.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageStore.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Threading; using System.Threading.Tasks; namespace LINGYUN.Abp.IM.Messages @@ -13,7 +14,9 @@ namespace LINGYUN.Abp.IM.Messages /// /// /// - Task StoreMessageAsync(ChatMessage chatMessage); + Task StoreMessageAsync( + ChatMessage chatMessage, + CancellationToken cancellationToken = default); /// /// 获取群组聊天记录总数 /// @@ -26,7 +29,8 @@ namespace LINGYUN.Abp.IM.Messages Guid? tenantId, long groupId, string filter = "", - MessageType? type = null); + MessageType? type = null, + CancellationToken cancellationToken = default); /// /// 获取群组聊天记录 /// @@ -47,7 +51,8 @@ namespace LINGYUN.Abp.IM.Messages bool reverse = true, MessageType? type = null, int skipCount = 0, - int maxResultCount = 10); + int maxResultCount = 10, + CancellationToken cancellationToken = default); /// /// 获取上一次通讯消息记录 /// @@ -62,7 +67,8 @@ namespace LINGYUN.Abp.IM.Messages Guid userId, string sorting = nameof(LastChatMessage.SendTime), bool reverse = true, - int maxResultCount = 10 + int maxResultCount = 10, + CancellationToken cancellationToken = default ); /// /// 获取与某个用户的聊天记录总数 @@ -78,7 +84,8 @@ namespace LINGYUN.Abp.IM.Messages Guid sendUserId, Guid receiveUserId, string filter = "", - MessageType? type = null); + MessageType? type = null, + CancellationToken cancellationToken = default); /// /// 获取与某个用户的聊天记录 /// @@ -95,6 +102,7 @@ namespace LINGYUN.Abp.IM.Messages bool reverse = true, MessageType? type = null, int skipCount = 0, - int maxResultCount = 10); + int maxResultCount = 10, + CancellationToken cancellationToken = default); } } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSender.cs b/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSender.cs new file mode 100644 index 000000000..1197b62f0 --- /dev/null +++ b/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSender.cs @@ -0,0 +1,26 @@ +using System.Threading.Tasks; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.EventBus.Distributed; + +namespace LINGYUN.Abp.IM.Messages +{ + public class MessageSender : IMessageSender, ITransientDependency + { + protected IDistributedEventBus EventBus { get; } + public MessageSender(IDistributedEventBus eventBus) + { + EventBus = eventBus; + } + + public virtual async Task SendMessageAsync(ChatMessage chatMessage) + { + chatMessage.SetProperty(nameof(ChatMessage.IsAnonymous), chatMessage.IsAnonymous); + + // 如果先存储的话,就紧耦合消息处理模块了 + // await Store.StoreMessageAsync(chatMessage); + + await EventBus.PublishAsync(chatMessage); + } + } +} diff --git a/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSenderBase.cs b/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSenderBase.cs deleted file mode 100644 index f39a4c428..000000000 --- a/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSenderBase.cs +++ /dev/null @@ -1,47 +0,0 @@ -using Microsoft.Extensions.Logging; -using System; -using System.Threading.Tasks; - -namespace LINGYUN.Abp.IM.Messages -{ - public abstract class MessageSenderBase : IMessageSender - { - protected IMessageStore Store { get; } - protected ILogger Logger { get; } - protected MessageSenderBase( - IMessageStore store, - ILogger logger) - { - Store = store; - Logger = logger; - } - - public virtual async Task SendMessageAsync(ChatMessage chatMessage) - { - // 持久化 - await Store.StoreMessageAsync(chatMessage); - - try - { - if (!chatMessage.GroupId.IsNullOrWhiteSpace()) - { - await SendMessageToGroupAsync(chatMessage); - } - else - { - await SendMessageToUserAsync(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/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSenderProviderBase.cs b/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSenderProviderBase.cs new file mode 100644 index 000000000..ef8f3223c --- /dev/null +++ b/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSenderProviderBase.cs @@ -0,0 +1,70 @@ +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; +using System; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; + +namespace LINGYUN.Abp.IM.Messages +{ + public abstract class MessageSenderProviderBase : IMessageSenderProvider, ITransientDependency + { + public abstract string Name { get; } + + protected IServiceProvider ServiceProvider { get; } + + protected readonly object ServiceProviderLock = new object(); + + public ILoggerFactory LoggerFactory => LazyGetRequiredService(ref _loggerFactory); + private ILoggerFactory _loggerFactory; + + protected ILogger Logger => _lazyLogger.Value; + private Lazy _lazyLogger => new Lazy(() => LoggerFactory?.CreateLogger(GetType().FullName) ?? NullLogger.Instance, true); + + protected TService LazyGetRequiredService(ref TService reference) + { + if (reference == null) + { + lock (ServiceProviderLock) + { + if (reference == null) + { + reference = ServiceProvider.GetRequiredService(); + } + } + } + + return reference; + } + + protected MessageSenderProviderBase(IServiceProvider serviceProvider) + { + ServiceProvider = serviceProvider; + } + + public virtual async Task SendMessageAsync(ChatMessage chatMessage) + { + try + { + if (!chatMessage.GroupId.IsNullOrWhiteSpace()) + { + await SendMessageToGroupAsync(chatMessage); + } + else + { + await SendMessageToUserAsync(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/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSenderProviderManager.cs b/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSenderProviderManager.cs new file mode 100644 index 000000000..3b0c4ec16 --- /dev/null +++ b/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSenderProviderManager.cs @@ -0,0 +1,33 @@ +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; +using System; +using System.Collections.Generic; +using System.Linq; +using Volo.Abp.DependencyInjection; + +namespace LINGYUN.Abp.IM.Messages +{ + public class MessageSenderProviderManager : IMessageSenderProviderManager, ISingletonDependency + { + public List Providers => _lazyProviders.Value; + + protected AbpIMOptions Options { get; } + + private readonly Lazy> _lazyProviders; + + public MessageSenderProviderManager( + IServiceProvider serviceProvider, + IOptions options) + { + Options = options.Value; + + _lazyProviders = new Lazy>( + () => Options + .Providers + .Select(type => serviceProvider.GetRequiredService(type) as IMessageSenderProvider) + .ToList(), + true + ); + } + } +} diff --git a/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/NullMessageSender.cs b/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/NullMessageSender.cs deleted file mode 100644 index dd1469d1f..000000000 --- a/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/NullMessageSender.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Microsoft.Extensions.Logging; -using System.Threading.Tasks; -using Volo.Abp.DependencyInjection; - -namespace LINGYUN.Abp.IM.Messages -{ - public class NullMessageSender : MessageSenderBase, ITransientDependency - { - public NullMessageSender(IMessageStore store, ILogger logger) - : base(store, logger) - { - } - - protected override Task SendMessageToGroupAsync(ChatMessage chatMessage) - { - Logger.LogWarning("No IMessageSender Interface implementation!"); - return Task.CompletedTask; - } - - protected override Task SendMessageToUserAsync(ChatMessage chatMessage) - { - Logger.LogWarning("No IMessageSender Interface implementation!"); - return Task.CompletedTask; - } - } -} diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/Hubs/NotificationsHub.cs b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/Hubs/NotificationsHub.cs index 0b89ef241..2259961b2 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/Hubs/NotificationsHub.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/Hubs/NotificationsHub.cs @@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.SignalR; using System.Threading.Tasks; using Volo.Abp.Application.Dtos; +using Volo.Abp.Uow; using Volo.Abp.Users; namespace LINGYUN.Abp.Notifications.SignalR.Hubs @@ -16,27 +17,49 @@ namespace LINGYUN.Abp.Notifications.SignalR.Hubs protected override async Task OnClientConnectedAsync(IOnlineClient client) { + await base.OnClientConnectedAsync(client); + if (client.TenantId.HasValue) { // 以租户为分组,将用户加入租户通讯组 - await Groups.AddToGroupAsync(client.ConnectionId, client.TenantId.Value.ToString()); + await Groups.AddToGroupAsync(client.ConnectionId, client.TenantId.Value.ToString(), Context.ConnectionAborted); + } + else + { + await Groups.AddToGroupAsync(client.ConnectionId, "Global", Context.ConnectionAborted); } } protected override async Task OnClientDisconnectedAsync(IOnlineClient client) { + await base.OnClientDisconnectedAsync(client); + if (client.TenantId.HasValue) { // 以租户为分组,将移除租户通讯组 - await Groups.RemoveFromGroupAsync(client.ConnectionId, client.TenantId.Value.ToString()); + await Groups.RemoveFromGroupAsync(client.ConnectionId, client.TenantId.Value.ToString(), Context.ConnectionAborted); + } + else + { + await Groups.RemoveFromGroupAsync(client.ConnectionId, "Global", Context.ConnectionAborted); } } + [HubMethodName("MySubscriptions")] + public virtual async Task> GetMySubscriptionsAsync() + { + var subscriptions = await NotificationStore + .GetUserSubscriptionsAsync(CurrentTenant.Id, CurrentUser.GetId()); + + return new ListResultDto(subscriptions); + } + + [UnitOfWork] [HubMethodName("GetNotification")] - public virtual async Task> GetNotificationAsync( - NotificationReadState readState = NotificationReadState.UnRead, int maxResultCount = 10) + public virtual async Task> GetNotificationAsync() { - var userNotifications = await NotificationStore.GetUserNotificationsAsync(CurrentTenant.Id, CurrentUser.GetId(), readState, maxResultCount); + var userNotifications = await NotificationStore + .GetUserNotificationsAsync(CurrentTenant.Id, CurrentUser.GetId(), NotificationReadState.UnRead, 10); return new ListResultDto(userNotifications); } @@ -44,7 +67,13 @@ namespace LINGYUN.Abp.Notifications.SignalR.Hubs [HubMethodName("ChangeState")] public virtual async Task ChangeStateAsync(string id, NotificationReadState readState = NotificationReadState.Read) { - await NotificationStore.ChangeUserNotificationReadStateAsync(CurrentTenant.Id, CurrentUser.GetId(), long.Parse(id), readState); + await NotificationStore + .ChangeUserNotificationReadStateAsync( + CurrentTenant.Id, + CurrentUser.GetId(), + long.Parse(id), + readState, + Context.ConnectionAborted); } } } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/SignalRNotificationPublishProvider.cs b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/SignalRNotificationPublishProvider.cs index 505af781c..252459ff8 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/SignalRNotificationPublishProvider.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/SignalRNotificationPublishProvider.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; +using System.Threading; using System.Threading.Tasks; namespace LINGYUN.Abp.Notifications.SignalR @@ -29,69 +30,41 @@ namespace LINGYUN.Abp.Notifications.SignalR _onlineClientManager = onlineClientManager; } - public override async Task PublishAsync(NotificationInfo notification, IEnumerable identifiers) + protected override async Task PublishAsync(NotificationInfo notification, IEnumerable identifiers, CancellationToken cancellationToken = default) { - if (notification.Data.HasTenantNotification(out Guid tenantId)) + if (identifiers?.Count() == 0) { - // 返回标准数据给前端 - notification.Data = NotificationData.ToStandardData(notification.Data); - var singalRGroup = _hubContext.Clients.Group(tenantId.ToString()); + var groupName = notification.TenantId?.ToString() ?? "Global"; + + var singalRGroup = _hubContext.Clients.Group(groupName); if (singalRGroup == null) { - Logger.LogDebug("Can not get group " + tenantId + " from SignalR hub!"); + Logger.LogDebug("Can not get group " + groupName + " from SignalR hub!"); return; } // 租户通知群发 Logger.LogDebug($"Found a singalr group, begin senging notifications"); - await singalRGroup.SendAsync("getNotification", notification); + await singalRGroup.SendAsync("getNotification", notification, cancellationToken); } else { - // 返回标准数据给前端 - notification.Data = NotificationData.ToStandardData(notification.Data); - foreach (var identifier in identifiers) + var onlineClients = _onlineClientManager.GetAllClients(client => identifiers.Any(ids => client.UserId == ids.UserId)); + var onlineClientConnectionIds = onlineClients.Select(client => client.ConnectionId).ToImmutableArray(); + try { - Logger.LogDebug($"Find online client with user {identifier.UserId} - {identifier.UserName}"); - var onlineClientContext = new OnlineClientContext(notification.TenantId, identifier.UserId); - var onlineClients = _onlineClientManager.GetAllByContext(onlineClientContext); - var onlineClientConnectionIds = onlineClients.Select(client => client.ConnectionId).ToImmutableArray(); - try - { - var signalRClients = _hubContext.Clients.Clients(onlineClientConnectionIds); - if (signalRClients == null) - { - Logger.LogDebug("Can not get user " + onlineClientContext.UserId + " connection from SignalR hub!"); - return; - } - Logger.LogDebug($"Found a singalr client, begin senging notifications"); - await signalRClients.SendAsync("getNotification", notification); - } - catch (Exception ex) + var signalRClients = _hubContext.Clients.Clients(onlineClientConnectionIds); + if (signalRClients == null) { - Logger.LogWarning("Could not send notifications to user: {0}", identifier.UserId); - Logger.LogWarning("Send to user notifications error: {0}", ex.Message); + Logger.LogDebug("Can not get users connection from SignalR hub!"); + return; } - - //foreach (var onlineClient in onlineClients) - //{ - // try - // { - // Logger.LogDebug($"Find online client {onlineClient.UserId} - {onlineClient.ConnectionId}"); - // var signalRClient = _hubContext.Clients.Client(onlineClient.ConnectionId); - // if (signalRClient == null) - // { - // Logger.LogDebug("Can not get user " + onlineClientContext.UserId + " with connectionId " + onlineClient.ConnectionId + " from SignalR hub!"); - // continue; - // } - // Logger.LogDebug($"Found a singalr client, begin senging notifications"); - // await signalRClient.SendAsync("getNotification", notification); - // } - // catch (Exception ex) - // { - // Logger.LogWarning("Could not send notifications to user: {0}", identifier.UserId); - // Logger.LogWarning("Send to user notifications error: {0}", ex.Message); - // } - //} + Logger.LogDebug($"Found a singalr client, begin senging notifications"); + await signalRClients.SendAsync("getNotification", notification, cancellationToken); + } + catch (Exception ex) + { + 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/common/LINGYUN.Abp.Notifications.WeChat/LINGYUN.Abp.Notifications.WeChat.WeApp.csproj b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.WeChat/LINGYUN.Abp.Notifications.WeChat.WeApp.csproj index 8c8c48113..f42eeff2c 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.WeChat/LINGYUN.Abp.Notifications.WeChat.WeApp.csproj +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.WeChat/LINGYUN.Abp.Notifications.WeChat.WeApp.csproj @@ -9,6 +9,7 @@ + diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.WeChat/LINGYUN/Abp/Notifications/WeChat/WeApp/Features/WeChatWeAppFeatureDefinitionProvider.cs b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.WeChat/LINGYUN/Abp/Notifications/WeChat/WeApp/Features/WeChatWeAppFeatureDefinitionProvider.cs new file mode 100644 index 000000000..a140583bd --- /dev/null +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.WeChat/LINGYUN/Abp/Notifications/WeChat/WeApp/Features/WeChatWeAppFeatureDefinitionProvider.cs @@ -0,0 +1,54 @@ +using LINGYUN.Abp.WeChat.Features; +using LINGYUN.Abp.WeChat.Localization; +using Volo.Abp.Features; +using Volo.Abp.Localization; +using Volo.Abp.Validation.StringValues; + +namespace LINGYUN.Abp.Notifications.WeChat.WeApp.Features +{ + public class WeChatWeAppFeatureDefinitionProvider : FeatureDefinitionProvider + { + public override void Define(IFeatureDefinitionContext context) + { + var wechatGroup = context.GetGroupOrNull(WeChatFeatures.GroupName); + if (wechatGroup != null) + { + var weappFeature = wechatGroup + .AddFeature( + WeChatWeAppFeatures.GroupName, + true.ToString(), + L("Features:WeApp"), + L("Features:WeAppDescription"), + new ToggleStringValueType(new BooleanValueValidator())); + + + var weappNofitication = weappFeature + .CreateChild( + WeChatWeAppFeatures.Notifications.Default, + true.ToString(), + L("Features:Notifications"), + L("Features:Notifications"), + new ToggleStringValueType(new BooleanValueValidator())); + weappNofitication + .CreateChild( + WeChatWeAppFeatures.Notifications.PublishLimit, + WeChatWeAppFeatures.Notifications.DefaultPublishLimit.ToString(), + L("Features:PublishLimit"), + L("Features:PublishLimitDescription"), + new ToggleStringValueType(new NumericValueValidator(0, 100000))); + weappNofitication + .CreateChild( + WeChatWeAppFeatures.Notifications.PublishLimitInterval, + WeChatWeAppFeatures.Notifications.DefaultPublishLimitInterval.ToString(), + L("Features:PublishLimitInterval"), + L("Features:PublishLimitIntervalDescription"), + new ToggleStringValueType(new NumericValueValidator(1, 12))); + } + } + + protected LocalizableString L(string name) + { + return LocalizableString.Create(name); + } + } +} diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.WeChat/LINGYUN/Abp/Notifications/WeChat/WeApp/Features/WeChatWeAppFeatures.cs b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.WeChat/LINGYUN/Abp/Notifications/WeChat/WeApp/Features/WeChatWeAppFeatures.cs new file mode 100644 index 000000000..909cd33fc --- /dev/null +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.WeChat/LINGYUN/Abp/Notifications/WeChat/WeApp/Features/WeChatWeAppFeatures.cs @@ -0,0 +1,30 @@ +using LINGYUN.Abp.WeChat.Features; + +namespace LINGYUN.Abp.Notifications.WeChat.WeApp.Features +{ + public static class WeChatWeAppFeatures + { + public const string GroupName = WeChatFeatures.GroupName + ".WeApp"; + + public static class Notifications + { + public const string Default = GroupName + ".Notifications"; + /// + /// 发布次数上限 + /// + public const string PublishLimit = Default + ".PublishLimit"; + /// + /// 发布次数上限时长 + /// + public const string PublishLimitInterval = Default + ".PublishLimitInterval"; + /// + /// 默认发布次数上限 + /// + public const int DefaultPublishLimit = 1000; + /// + /// 默认发布次数上限时长 + /// + public const int DefaultPublishLimitInterval = 1; + } + } +} diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.WeChat/LINGYUN/Abp/Notifications/WeChat/WeApp/IWeChatWeAppNotificationSender.cs b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.WeChat/LINGYUN/Abp/Notifications/WeChat/WeApp/IWeChatWeAppNotificationSender.cs index de5d8c500..27ee8d1d3 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.WeChat/LINGYUN/Abp/Notifications/WeChat/WeApp/IWeChatWeAppNotificationSender.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.WeChat/LINGYUN/Abp/Notifications/WeChat/WeApp/IWeChatWeAppNotificationSender.cs @@ -1,9 +1,10 @@ -using System.Threading.Tasks; +using System.Threading; +using System.Threading.Tasks; namespace LINGYUN.Abp.Notifications.WeChat.WeApp { public interface IWeChatWeAppNotificationSender { - Task SendAsync(WeChatWeAppSendNotificationData notificationData); + Task SendAsync(WeChatWeAppSendNotificationData notificationData, CancellationToken cancellationToken = default); } } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.WeChat/LINGYUN/Abp/Notifications/WeChat/WeApp/WeChatWeAppNotificationPublishProvider.cs b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.WeChat/LINGYUN/Abp/Notifications/WeChat/WeApp/WeChatWeAppNotificationPublishProvider.cs index e6c21fac6..42f7e3b15 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.WeChat/LINGYUN/Abp/Notifications/WeChat/WeApp/WeChatWeAppNotificationPublishProvider.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.WeChat/LINGYUN/Abp/Notifications/WeChat/WeApp/WeChatWeAppNotificationPublishProvider.cs @@ -1,9 +1,12 @@ -using Microsoft.Extensions.Logging; +using LINGYUN.Abp.Notifications.WeChat.WeApp.Features; +using LINGYUN.Abp.WeChat.Authorization; +using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using System; using System.Collections.Generic; -using System.Linq; +using System.Threading; using System.Threading.Tasks; +using Volo.Abp.Features; namespace LINGYUN.Abp.Notifications.WeChat.WeApp { @@ -13,8 +16,13 @@ namespace LINGYUN.Abp.Notifications.WeChat.WeApp public class WeChatWeAppNotificationPublishProvider : NotificationPublishProvider { public override string Name => "WeChat.WeApp"; - private INotificationSubscriptionManager _notificationSubscriptionManager; - protected INotificationSubscriptionManager NotificationSubscriptionManager => LazyGetRequiredService(ref _notificationSubscriptionManager); + + private IFeatureChecker _featureChecker; + protected IFeatureChecker FeatureChecker => LazyGetRequiredService(ref _featureChecker); + + private IWeChatOpenIdFinder _weChatOpenIdFinder; + protected IWeChatOpenIdFinder WeChatOpenIdFinder => LazyGetRequiredService(ref _weChatOpenIdFinder); + protected IWeChatWeAppNotificationSender NotificationSender { get; } protected AbpWeChatWeAppNotificationOptions Options { get; } public WeChatWeAppNotificationPublishProvider( @@ -27,32 +35,39 @@ namespace LINGYUN.Abp.Notifications.WeChat.WeApp NotificationSender = notificationSender; } - public override async Task PublishAsync(NotificationInfo notification, IEnumerable identifiers) + protected override async Task PublishAsync(NotificationInfo notification, IEnumerable identifiers, CancellationToken cancellationToken = default) { + + // 先检测微信小程序的功能限制 + var publishEnabled = await FeatureChecker.GetAsync(WeChatWeAppFeatures.Notifications.Default, false); + + if (!publishEnabled) + { + return; + } + // step1 默认微信openid绑定的就是username, // 如果不是,需要自行处理openid获取逻辑 // step2 调用微信消息推送接口 - // 微信不支持推送到所有用户,需要获取订阅列表再发送 + // 微信不支持推送到所有用户 // 在小程序里用户订阅消息后通过 api/subscribes/subscribe 接口订阅对应模板消息 - if (identifiers == null) - { - var userSubscriptions = await NotificationSubscriptionManager - .GetSubscriptionsAsync(notification.TenantId, notification.Name); - identifiers = userSubscriptions - .Select(us => new UserIdentifier(us.UserId, us.UserName)); - - } foreach (var identifier in identifiers) { - await SendWeChatTemplateMessagAsync(notification, identifier); + await SendWeChatTemplateMessagAsync(notification, identifier, cancellationToken); } } - protected virtual async Task SendWeChatTemplateMessagAsync(NotificationInfo notification, UserIdentifier identifier) + protected virtual async Task SendWeChatTemplateMessagAsync(NotificationInfo notification, UserIdentifier identifier, CancellationToken cancellationToken = default) { 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); @@ -64,13 +79,22 @@ namespace LINGYUN.Abp.Notifications.WeChat.WeApp var weAppLang = GetOrDefault(notification.Data, "WeAppLanguage", Options.DefaultWeAppLanguage); Logger.LogDebug($"Get wechat weapp language: {weAppLang ?? null}"); - var weChatWeAppNotificationData = new WeChatWeAppSendNotificationData(identifier.UserName, + // TODO: 如果微信端发布通知,请组装好 wx-code 字段在通知数据内容里面 + string weChatCode = GetOrDefault(notification.Data, "wx-code", ""); + + WeChatOpenId openId = weChatCode.IsNullOrWhiteSpace() + ? await WeChatOpenIdFinder.FindByUserNameAsync(identifier.UserName) // 按照实际情况,需要自行实现 IUserWeChatCodeFinder 接口以获取微信Code,然后通过Code来获取OpenId + : await WeChatOpenIdFinder.FindAsync(weChatCode); + + + var weChatWeAppNotificationData = new WeChatWeAppSendNotificationData(openId.OpenId, templateId, redirect, weAppState, weAppLang); // 写入模板数据 weChatWeAppNotificationData.WriteStandardData(NotificationData.ToStandardData(Options.DefaultMsgPrefix, notification.Data)); Logger.LogDebug($"Sending wechat weapp notification: {notification.Name}"); + // 发送小程序订阅消息 await NotificationSender.SendAsync(weChatWeAppNotificationData); } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.WeChat/LINGYUN/Abp/Notifications/WeChat/WeApp/WeChatWeAppNotificationSender.cs b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.WeChat/LINGYUN/Abp/Notifications/WeChat/WeApp/WeChatWeAppNotificationSender.cs index 44ecac7db..7d680ff9d 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.WeChat/LINGYUN/Abp/Notifications/WeChat/WeApp/WeChatWeAppNotificationSender.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.WeChat/LINGYUN/Abp/Notifications/WeChat/WeApp/WeChatWeAppNotificationSender.cs @@ -1,13 +1,17 @@ -using LINGYUN.Abp.WeChat.Authorization; +using LINGYUN.Abp.Features.LimitValidation; +using LINGYUN.Abp.Notifications.WeChat.WeApp.Features; +using LINGYUN.Abp.WeChat.Authorization; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using Newtonsoft.Json; using System.Collections.Generic; using System.Net.Http; using System.Text; +using System.Threading; using System.Threading.Tasks; using Volo.Abp; using Volo.Abp.DependencyInjection; +using Volo.Abp.Features; using Volo.Abp.Json; namespace LINGYUN.Abp.Notifications.WeChat.WeApp @@ -31,7 +35,14 @@ namespace LINGYUN.Abp.Notifications.WeChat.WeApp Logger = NullLogger.Instance; } - public virtual async Task SendAsync(WeChatWeAppSendNotificationData notificationData) + [RequiresLimitFeature( // 检查消息发布功能限制 + WeChatWeAppFeatures.Notifications.PublishLimit, + WeChatWeAppFeatures.Notifications.PublishLimitInterval, + LimitPolicy.Month, + WeChatWeAppFeatures.Notifications.DefaultPublishLimit, + WeChatWeAppFeatures.Notifications.DefaultPublishLimitInterval + )] + public virtual async Task SendAsync(WeChatWeAppSendNotificationData notificationData, CancellationToken cancellationToken = default) { var weChatToken = await WeChatTokenProvider.GetTokenAsync(); var requestParamters = new Dictionary @@ -41,7 +52,7 @@ namespace LINGYUN.Abp.Notifications.WeChat.WeApp 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, notificationData); + var responseContent = await MakeRequestAndGetResultAsync(requestUrl, notificationData, cancellationToken); var weChatSenNotificationResponse = JsonSerializer.Deserialize(responseContent); if (!weChatSenNotificationResponse.IsSuccessed) @@ -52,7 +63,7 @@ namespace LINGYUN.Abp.Notifications.WeChat.WeApp // 失败是否抛出异常 // weChatSenNotificationResponse.ThrowIfNotSuccess(); } - protected virtual async Task MakeRequestAndGetResultAsync(string url, WeChatWeAppSendNotificationData notificationData) + protected virtual async Task MakeRequestAndGetResultAsync(string url, WeChatWeAppSendNotificationData notificationData, CancellationToken cancellationToken = default) { var client = HttpClientFactory.CreateClient(SendNotificationClientName); var sendDataContent = JsonSerializer.Serialize(notificationData); @@ -62,7 +73,7 @@ namespace LINGYUN.Abp.Notifications.WeChat.WeApp Content = requestContent }; - var response = await client.SendAsync(requestMessage); + 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}"); diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/AbpNotificationModule.cs b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/AbpNotificationModule.cs index f4eeb1ff5..250744007 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/AbpNotificationModule.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/AbpNotificationModule.cs @@ -22,11 +22,6 @@ namespace LINGYUN.Abp.Notifications AutoAddDefinitionProviders(context.Services); } - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddTransient(); - } - public override void OnApplicationInitialization(ApplicationInitializationContext context) { var options = context.ServiceProvider.GetRequiredService>().Value; diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationDefinitionContext.cs b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationDefinitionContext.cs index 00aaf52e6..a576eae97 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationDefinitionContext.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationDefinitionContext.cs @@ -1,9 +1,18 @@ -namespace LINGYUN.Abp.Notifications +using JetBrains.Annotations; +using Volo.Abp.Localization; +using Volo.Abp.MultiTenancy; + +namespace LINGYUN.Abp.Notifications { public interface INotificationDefinitionContext { - NotificationDefinition GetOrNull(string category); + NotificationGroupDefinition AddGroup( + [NotNull] string name, + ILocalizableString displayName = null, + bool allowSubscriptionToClients = true); + + NotificationGroupDefinition GetGroupOrNull(string name); - void Add(params NotificationDefinition[] definitions); + void RemoveGroup(string name); } } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationDefinitionManager.cs b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationDefinitionManager.cs index ab958ee8f..0eb55cf4a 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationDefinitionManager.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationDefinitionManager.cs @@ -6,10 +6,12 @@ namespace LINGYUN.Abp.Notifications public interface INotificationDefinitionManager { [NotNull] - NotificationDefinition Get([NotNull] string category); + NotificationDefinition Get([NotNull] string name); IReadOnlyList GetAll(); - NotificationDefinition GetOrNull(string category); + NotificationDefinition GetOrNull(string name); + + IReadOnlyList GetGroups(); } } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationDispatcher.cs b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationDispatcher.cs index cc450bb9f..7b3338970 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationDispatcher.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationDispatcher.cs @@ -6,28 +6,29 @@ namespace LINGYUN.Abp.Notifications /// /// 通知发送者接口 /// + [Obsolete("Notification system redesigned, publisher interface deactivated, please use INotificationSender")] public interface INotificationDispatcher { - /// - /// 发送通知 - /// - /// 通知名称 - /// 数据 - /// 租户 - /// 级别 - /// - Task DispatchAsync(NotificationName notificationName, NotificationData data, Guid? tenantId = null, - NotificationSeverity notificationSeverity = NotificationSeverity.Info); + ///// + ///// 发送通知 + ///// + ///// 通知名称 + ///// 数据 + ///// 租户 + ///// 级别 + ///// + //Task DispatchAsync(NotificationName notificationName, NotificationData data, Guid? tenantId = null, + // NotificationSeverity notificationSeverity = NotificationSeverity.Info); - /// - /// 发送通知事件 - /// - /// 通知名称 - /// 数据 - /// 租户 - /// 级别 - /// - Task DispatchEventAsync(NotificationName notificationName, NotificationData data, Guid? tenantId = null, - NotificationSeverity notificationSeverity = NotificationSeverity.Info); + ///// + ///// 发送通知事件 + ///// + ///// 通知名称 + ///// 数据 + ///// 租户 + ///// 级别 + ///// + //Task DispatchEventAsync(NotificationName notificationName, NotificationData data, Guid? tenantId = null, + // NotificationSeverity notificationSeverity = NotificationSeverity.Info); } } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationSender.cs b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationSender.cs new file mode 100644 index 000000000..2ad50913a --- /dev/null +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationSender.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace LINGYUN.Abp.Notifications +{ + /// + /// 发送通知接口 + /// + public interface INotificationSender + { + /// + /// 发送通知 + /// + /// 名称 + /// 数据 + /// 用户,为空标识发给所有订阅用户 + /// 租户 + /// 严重级别 + Task SendNofiterAsync( + string name, + NotificationData data, + UserIdentifier user = null, + Guid? tenantId = null, + NotificationSeverity severity = NotificationSeverity.Info); + /// + /// 发送通知 + /// + /// 名称 + /// 数据 + /// 用户列表,为空标识发给所有订阅用户 + /// 租户 + /// 严重级别 + Task SendNofitersAsync( + string name, + NotificationData data, + IEnumerable users = null, + Guid? tenantId = null, + NotificationSeverity severity = NotificationSeverity.Info); + } +} diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationStore.cs b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationStore.cs index e90af6509..57040f150 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationStore.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationStore.cs @@ -1,45 +1,126 @@ using System; using System.Collections.Generic; +using System.Threading; using System.Threading.Tasks; namespace LINGYUN.Abp.Notifications { public interface INotificationStore { - Task InsertUserSubscriptionAsync(Guid? tenantId, UserIdentifier identifier, string notificationName); - - Task InsertUserSubscriptionAsync(Guid? tenantId, IEnumerable identifiers, string notificationName); - - Task DeleteUserSubscriptionAsync(Guid? tenantId, Guid userId, string notificationName); - - Task DeleteAllUserSubscriptionAsync(Guid? tenantId, string notificationName); - - Task DeleteUserSubscriptionAsync(Guid? tenantId, IEnumerable identifiers, string notificationName); - - Task> GetSubscriptionsAsync(Guid? tenantId, string notificationName); - - Task> GetUserSubscriptionsAsync(Guid? tenantId, Guid userId); - - Task> GetUserSubscriptionsAsync(Guid? tenantId, string userName); - - Task IsSubscribedAsync(Guid? tenantId, Guid userId, string notificationName); - - Task InsertNotificationAsync(NotificationInfo notification); - - Task DeleteNotificationAsync(NotificationInfo notification); - - Task DeleteNotificationAsync(int batchCount); - - Task InsertUserNotificationAsync(NotificationInfo notification, Guid userId); - - Task InsertUserNotificationsAsync(NotificationInfo notification, IEnumerable userIds); - - Task DeleteUserNotificationAsync(Guid? tenantId, Guid userId, long notificationId); - - Task GetNotificationOrNullAsync(Guid? tenantId, long notificationId); - - Task> GetUserNotificationsAsync(Guid? tenantId, Guid userId, NotificationReadState readState = NotificationReadState.UnRead, int maxResultCount = 10); - - Task ChangeUserNotificationReadStateAsync(Guid? tenantId, Guid userId, long notificationId, NotificationReadState readState); + 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 = NotificationReadState.UnRead, + int maxResultCount = 10, + CancellationToken cancellationToken = default); + + Task GetUserNotificationsCountAsync( + Guid? tenantId, + Guid userId, + string filter = "", + NotificationReadState readState = NotificationReadState.UnRead, + CancellationToken cancellationToken = default); + + Task> GetUserNotificationsAsync( + Guid? tenantId, + Guid userId, + string filter = "", + string sorting = nameof(NotificationInfo.CreationTime), + bool reverse = true, + NotificationReadState readState = NotificationReadState.UnRead, + int skipCount = 1, + int maxResultCount = 10, + CancellationToken cancellationToken = default); + + Task ChangeUserNotificationReadStateAsync( + Guid? tenantId, + Guid userId, + long notificationId, + NotificationReadState readState, + CancellationToken cancellationToken = default); } } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationSubscriptionManager.cs b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationSubscriptionManager.cs index 2754a872a..04b32eaea 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationSubscriptionManager.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationSubscriptionManager.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Threading; using System.Threading.Tasks; namespace LINGYUN.Abp.Notifications @@ -16,7 +17,11 @@ namespace LINGYUN.Abp.Notifications /// 用户标识 /// 通知名称 /// - Task IsSubscribedAsync(Guid? tenantId, Guid userId, string notificationName); + Task IsSubscribedAsync( + Guid? tenantId, + Guid userId, + string notificationName, + CancellationToken cancellationToken = default); /// /// 订阅通知 /// @@ -24,7 +29,11 @@ namespace LINGYUN.Abp.Notifications /// 用户标识 /// 通知名称 /// - Task SubscribeAsync(Guid? tenantId, UserIdentifier identifier, string notificationName); + Task SubscribeAsync( + Guid? tenantId, + UserIdentifier identifier, + string notificationName, + CancellationToken cancellationToken = default); /// /// 订阅通知 /// @@ -32,14 +41,21 @@ namespace LINGYUN.Abp.Notifications /// 用户标识列表 /// 通知名称 /// - Task SubscribeAsync(Guid? tenantId, IEnumerable identifiers, string notificationName); + Task SubscribeAsync( + Guid? tenantId, + IEnumerable identifiers, + string notificationName, + CancellationToken cancellationToken = default); /// /// 取消所有用户订阅 /// /// 租户 /// 通知名称 /// - Task UnsubscribeAllAsync(Guid? tenantId, string notificationName); + Task UnsubscribeAllAsync( + Guid? tenantId, + string notificationName, + CancellationToken cancellationToken = default); /// /// 取消订阅 /// @@ -47,7 +63,11 @@ namespace LINGYUN.Abp.Notifications /// 用户标识 /// 通知名称 /// - Task UnsubscribeAsync(Guid? tenantId, UserIdentifier identifier, string notificationName); + Task UnsubscribeAsync( + Guid? tenantId, + UserIdentifier identifier, + string notificationName, + CancellationToken cancellationToken = default); /// /// 取消订阅 /// @@ -55,27 +75,42 @@ namespace LINGYUN.Abp.Notifications /// 用户标识列表 /// 通知名称 /// - Task UnsubscribeAsync(Guid? tenantId, IEnumerable identifiers, string notificationName); + Task UnsubscribeAsync( + Guid? tenantId, + IEnumerable identifiers, + string notificationName, + CancellationToken cancellationToken = default); /// /// 获取通知被订阅用户列表 /// /// 租户 /// 通知名称 + /// 需要检查的用户列表 /// - Task> GetSubscriptionsAsync(Guid? tenantId, string notificationName); + Task> GetUsersSubscriptionsAsync( + Guid? tenantId, + string notificationName, + IEnumerable identifiers = null, + CancellationToken cancellationToken = default); /// /// 获取用户订阅列表 /// /// 租户 /// 用户标识 /// - Task> GetUserSubscriptionsAsync(Guid? tenantId, Guid userId); + Task> GetUserSubscriptionsAsync( + Guid? tenantId, + Guid userId, + CancellationToken cancellationToken = default); /// /// 获取用户订阅列表 /// /// 租户 /// 用户名 /// - Task> GetUserSubscriptionsAsync(Guid? tenantId, string userName); + Task> GetUserSubscriptionsAsync( + Guid? tenantId, + string userName, + CancellationToken cancellationToken = default); } } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Internal/DefaultNotificationDispatcher.cs b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Internal/DefaultNotificationDispatcher.cs deleted file mode 100644 index f27df960c..000000000 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Internal/DefaultNotificationDispatcher.cs +++ /dev/null @@ -1,220 +0,0 @@ -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Logging.Abstractions; -using Microsoft.Extensions.Options; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Volo.Abp.BackgroundJobs; -using Volo.Abp.EventBus.Distributed; - -namespace LINGYUN.Abp.Notifications.Internal -{ - /// - /// Implements . - /// - internal class DefaultNotificationDispatcher : INotificationDispatcher - { - /// - /// Reference to . - /// - public ILogger Logger { get; set; } - /// - /// Reference to . - /// - public IDistributedEventBus DistributedEventBus { get; set; } - /// - /// Reference to . - /// - private readonly AbpNotificationOptions _notificationOptions; - /// - /// Reference to . - /// - private readonly IBackgroundJobManager _backgroundJobManager; - /// - /// Reference to . - /// - private readonly INotificationStore _notificationStore; - /// - /// Reference to . - /// - private readonly INotificationDefinitionManager _notificationDefinitionManager; - /// - /// Reference to . - /// - private readonly INotificationPublishProviderManager _notificationPublishProviderManager; - /// - /// Initializes a new instance of the class. - /// - public DefaultNotificationDispatcher( - IBackgroundJobManager backgroundJobManager, - IOptions options, - INotificationStore notificationStore, - INotificationDefinitionManager notificationDefinitionManager, - INotificationPublishProviderManager notificationPublishProviderManager) - { - _backgroundJobManager = backgroundJobManager; - _notificationOptions = options.Value; - _notificationStore = notificationStore; - _notificationDefinitionManager = notificationDefinitionManager; - _notificationPublishProviderManager = notificationPublishProviderManager; - - DistributedEventBus = NullDistributedEventBus.Instance; - Logger = NullLogger.Instance; - } - /// - /// 发送通知 - /// - /// 通知名称 - /// 通知数据 - /// 租户 - /// 级别 - /// - public virtual async Task DispatchAsync(NotificationName notificationName, NotificationData data, Guid? tenantId = null, - NotificationSeverity notificationSeverity = NotificationSeverity.Info) - { - // 获取自定义的通知 - var defineNotification = _notificationDefinitionManager.Get(notificationName.CateGory); - - //// 没有定义的通知,应该也要能发布、订阅, - //// 比如订单之类的,是以订单编号为通知名称,这是动态的,没法自定义 - //if(defineNotification == null) - //{ - // defineNotification = new NotificationDefinition(notificationName.CateGory); - //} - - var notificationInfo = new NotificationInfo - { - CateGory = notificationName.CateGory, - Name = notificationName.Name, - CreationTime = DateTime.Now, - NotificationSeverity = notificationSeverity, - Lifetime = defineNotification.NotificationLifetime, - NotificationType = defineNotification.NotificationType, - TenantId = tenantId, - Data = data - }; - - var providers = Enumerable - .Reverse(_notificationPublishProviderManager.Providers); - - if (defineNotification.Providers.Any()) - { - providers = providers.Where(p => defineNotification.Providers.Contains(p.Name)); - } - - await PublishFromProvidersAsync(providers, notificationInfo); - - if (notificationInfo.Lifetime == NotificationLifetime.OnlyOne) - { - // 一次性通知在发送完成后就取消用户订阅 - await _notificationStore.DeleteAllUserSubscriptionAsync(notificationInfo.TenantId, - notificationInfo.Name); - } - } - /// - /// 发送通知事件 - /// - /// - /// - /// - /// - /// - public virtual async Task DispatchEventAsync(NotificationName notificationName, NotificationData data, Guid? tenantId = null, - NotificationSeverity notificationSeverity = NotificationSeverity.Info) - { - // 获取自定义的通知 - var defineNotification = _notificationDefinitionManager.Get(notificationName.CateGory); - - var notificationEventData = new NotificationEventData - { - CateGory = notificationName.CateGory, - Name = notificationName.Name, - CreationTime = DateTime.Now, - NotificationSeverity = notificationSeverity, - Lifetime = defineNotification.NotificationLifetime, - NotificationType = defineNotification.NotificationType, - TenantId = tenantId, - Data = data - }; - // 发布分布式通知事件,让消息中心统一处理 - await DistributedEventBus.PublishAsync(notificationEventData); - } - /// - /// 指定提供者发布通知 - /// - /// 提供者列表 - /// 通知信息 - /// - protected async Task PublishFromProvidersAsync(IEnumerable providers, - NotificationInfo notificationInfo) - { - Logger.LogDebug($"Persistent notification {notificationInfo.Name}"); - // 持久化通知 - await _notificationStore.InsertNotificationAsync(notificationInfo); - - Logger.LogDebug($"Gets a list of user subscriptions {notificationInfo.Name}"); - // 获取用户订阅列表 - var userSubscriptions = await _notificationStore.GetSubscriptionsAsync(notificationInfo.TenantId, notificationInfo.Name); - - Logger.LogDebug($"Persistent user notifications {notificationInfo.Name}"); - // 持久化用户通知 - var subscriptionUserIdentifiers = userSubscriptions.Select(us => new UserIdentifier(us.UserId, us.UserName)); - - await _notificationStore.InsertUserNotificationsAsync(notificationInfo, - subscriptionUserIdentifiers.Select(u => u.UserId)); - - // 发布通知 - foreach (var provider in providers) - { - await PublishAsync(provider, notificationInfo, subscriptionUserIdentifiers); - } - - // TODO: 需要计算队列大小,根据情况是否需要并行发布消息 - //Parallel.ForEach(providers, async (provider) => - //{ - // await PublishAsync(provider, notificationInfo, subscriptionUserIdentifiers); - //}); - } - /// - /// 发布通知 - /// - /// 通知发布者 - /// 通知信息 - /// 订阅用户列表 - /// - protected async Task PublishAsync(INotificationPublishProvider provider, NotificationInfo notificationInfo, - IEnumerable subscriptionUserIdentifiers) - { - try - { - Logger.LogDebug($"Sending notification with provider {provider.Name}"); - var notifacationDataMapping = _notificationOptions.NotificationDataMappings - .GetMapItemOrNull(notificationInfo.CateGory, provider.Name); - if (notifacationDataMapping != null) - { - notificationInfo.Data = notifacationDataMapping.MappingFunc(notificationInfo.Data); - } - // 发布 - await provider.PublishAsync(notificationInfo, subscriptionUserIdentifiers); - - Logger.LogDebug($"Send notification {notificationInfo.Name} with provider {provider.Name} was successful"); - } - catch (Exception ex) - { - Logger.LogWarning($"Send notification error with provider {provider.Name}"); - Logger.LogWarning($"Error message:{ex.Message}"); - - Logger.LogTrace(ex, $"Send notification error with provider { provider.Name}"); - - Logger.LogDebug($"Send notification error, notification {notificationInfo.Name} entry queue"); - // 发送失败的消息进入后台队列 - await _backgroundJobManager.EnqueueAsync( - new NotificationPublishJobArgs(notificationInfo.GetId(), - provider.GetType().AssemblyQualifiedName, - subscriptionUserIdentifiers.ToList(), - notificationInfo.TenantId)); - } - } - } -} diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Internal/NotificationSender.cs b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Internal/NotificationSender.cs new file mode 100644 index 000000000..65845d7c2 --- /dev/null +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Internal/NotificationSender.cs @@ -0,0 +1,78 @@ +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; +using Volo.Abp.EventBus.Distributed; + +namespace LINGYUN.Abp.Notifications +{ + public class NotificationSender : INotificationSender, ITransientDependency + { + /// + /// Reference to . + /// + public ILogger Logger { get; set; } + /// + /// Reference to . + /// + public IDistributedEventBus DistributedEventBus { get; } + + public NotificationSender( + IDistributedEventBus distributedEventBus) + { + DistributedEventBus = distributedEventBus; + Logger = NullLogger.Instance; + } + + public async Task SendNofiterAsync( + string name, + NotificationData data, + UserIdentifier user = null, + Guid? tenantId = null, + NotificationSeverity severity = NotificationSeverity.Info) + { + if (user == null) + { + await PublishNofiterAsync(name, data, null, tenantId, severity); + + } + else + { + await PublishNofiterAsync(name, data, new List { user }, tenantId, severity); + } + } + + public async Task SendNofitersAsync( + string name, + NotificationData data, + IEnumerable users = null, + Guid? tenantId = null, + NotificationSeverity severity = NotificationSeverity.Info) + { + await PublishNofiterAsync(name, data, users, tenantId, severity); + } + + protected async Task PublishNofiterAsync( + string name, + NotificationData data, + IEnumerable users = null, + Guid? tenantId = null, + NotificationSeverity severity = NotificationSeverity.Info) + { + await DistributedEventBus + .PublishAsync( + new NotificationEventData + { + TenantId = tenantId, + Users = users?.ToList(), + Name = name, + Data = data, + CreationTime = DateTime.Now, + Severity = severity + }); + } + } +} diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Internal/NotificationSubscriptionManager.cs b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Internal/NotificationSubscriptionManager.cs index 3754d72d3..006ee9c83 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Internal/NotificationSubscriptionManager.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Internal/NotificationSubscriptionManager.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Threading; using System.Threading.Tasks; using Volo.Abp.DependencyInjection; @@ -15,56 +16,89 @@ namespace LINGYUN.Abp.Notifications.Internal _store = store; } - public virtual async Task> GetSubscriptionsAsync(Guid? tenantId, string notificationName) + public virtual async Task> GetUsersSubscriptionsAsync( + Guid? tenantId, + string notificationName, + IEnumerable identifiers = null, + CancellationToken cancellationToken = default) { - return await _store.GetSubscriptionsAsync(tenantId, notificationName); + return await _store.GetUserSubscriptionsAsync(tenantId, notificationName, identifiers, cancellationToken); } - public virtual async Task> GetUserSubscriptionsAsync(Guid? tenantId, Guid userId) + public virtual async Task> GetUserSubscriptionsAsync( + Guid? tenantId, + Guid userId, + CancellationToken cancellationToken = default) { - return await _store.GetUserSubscriptionsAsync(tenantId, userId); + return await _store.GetUserSubscriptionsAsync(tenantId, userId, cancellationToken); } - public virtual async Task> GetUserSubscriptionsAsync(Guid? tenantId, string userName) + public virtual async Task> GetUserSubscriptionsAsync( + Guid? tenantId, + string userName, + CancellationToken cancellationToken = default) { - return await _store.GetUserSubscriptionsAsync(tenantId, userName); + return await _store.GetUserSubscriptionsAsync(tenantId, userName, cancellationToken); } - public virtual async Task IsSubscribedAsync(Guid? tenantId, Guid userId, string notificationName) + public virtual async Task IsSubscribedAsync( + Guid? tenantId, + Guid userId, + string notificationName, + CancellationToken cancellationToken = default) { - return await _store.IsSubscribedAsync(tenantId, userId, notificationName); + return await _store.IsSubscribedAsync(tenantId, userId, notificationName, cancellationToken); } - public virtual async Task SubscribeAsync(Guid? tenantId, UserIdentifier identifier, string notificationName) + public virtual async Task SubscribeAsync( + Guid? tenantId, + UserIdentifier identifier, + string notificationName, + CancellationToken cancellationToken = default) { - if (await IsSubscribedAsync(tenantId, identifier.UserId, notificationName)) + if (await IsSubscribedAsync(tenantId, identifier.UserId, notificationName, cancellationToken)) { return; } - await _store.InsertUserSubscriptionAsync(tenantId, identifier, notificationName); + await _store.InsertUserSubscriptionAsync(tenantId, identifier, notificationName, cancellationToken); } - public virtual async Task SubscribeAsync(Guid? tenantId, IEnumerable identifiers, string notificationName) + public virtual async Task SubscribeAsync( + Guid? tenantId, + IEnumerable identifiers, + string notificationName, + CancellationToken cancellationToken = default) { foreach(var identifier in identifiers) { - await SubscribeAsync(tenantId, identifier, notificationName); + await SubscribeAsync(tenantId, identifier, notificationName, cancellationToken); } } - public virtual async Task UnsubscribeAsync(Guid? tenantId, UserIdentifier identifier, string notificationName) + public virtual async Task UnsubscribeAsync( + Guid? tenantId, + UserIdentifier identifier, + string notificationName, + CancellationToken cancellationToken = default) { - await _store.DeleteUserSubscriptionAsync(tenantId, identifier.UserId, notificationName); + await _store.DeleteUserSubscriptionAsync(tenantId, identifier.UserId, notificationName, cancellationToken); } - public virtual async Task UnsubscribeAllAsync(Guid? tenantId, string notificationName) + public virtual async Task UnsubscribeAllAsync( + Guid? tenantId, + string notificationName, + CancellationToken cancellationToken = default) { - await _store.DeleteAllUserSubscriptionAsync(tenantId, notificationName); + await _store.DeleteAllUserSubscriptionAsync(tenantId, notificationName, cancellationToken); } - public virtual async Task UnsubscribeAsync(Guid? tenantId, IEnumerable identifiers, string notificationName) + public virtual async Task UnsubscribeAsync( + Guid? tenantId, + IEnumerable identifiers, + string notificationName, + CancellationToken cancellationToken = default) { - await _store.DeleteUserSubscriptionAsync(tenantId, identifiers, notificationName); + await _store.DeleteUserSubscriptionAsync(tenantId, identifiers, notificationName, cancellationToken); } } } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/LocalizableStringInfo.cs b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/LocalizableStringInfo.cs new file mode 100644 index 000000000..ce26dbf68 --- /dev/null +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/LocalizableStringInfo.cs @@ -0,0 +1,23 @@ +using System.Collections.Generic; + +namespace LINGYUN.Abp.Notifications +{ + public class LocalizableStringInfo + { + public string ResourceName { get; } + + public string Name { get; } + + public Dictionary Values { get; } + + public LocalizableStringInfo( + string resourceName, + string name, + Dictionary values = null) + { + ResourceName = resourceName; + Name = name; + Values = values; + } + } +} diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationData.cs b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationData.cs index 7548d8d0b..a53de5bea 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationData.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationData.cs @@ -8,14 +8,11 @@ namespace LINGYUN.Abp.Notifications /// /// /// TODO: 2020-10-29 针对不同语言的用户,如果在发布时期就本地化语言是错误的设计 - /// 把通知的标题和内容设计为 让客户端自行本地化 + /// 把通知的标题和内容设计为 让客户端自行本地化 /// public class NotificationData { - public const string NotificationKey = "N:G"; - public const string UserIdNotificationKey = "N:UI"; - public const string UserNameNotificationKey = "N:UN"; - public const string TenantNotificationKey = "N:T"; + public const string LocalizerKey = "localizer"; public virtual string Type => GetType().FullName; public object this[string key] @@ -55,30 +52,35 @@ namespace LINGYUN.Abp.Notifications public NotificationData() { _properties = new Dictionary(); + TrySetData(LocalizerKey, false); } - - public static NotificationData CreateNotificationData() - { - var data = new NotificationData(); - data.TrySetData(NotificationKey, "AbpNotification"); - return data; - } - - public static NotificationData CreateUserNotificationData(Guid userId, string userName) - { - var data = new NotificationData(); - data.TrySetData(UserIdNotificationKey, userId); - data.TrySetData(UserNameNotificationKey, userName); - return data; - } - - public static NotificationData CreateTenantNotificationData(Guid tenantId) + /// + /// 写入本地化的消息数据 + /// + /// + /// + /// + /// + /// + /// + public NotificationData WriteLocalizedData( + LocalizableStringInfo title, + LocalizableStringInfo message, + DateTime createTime, + string formUser, + LocalizableStringInfo description = null) { - var data = new NotificationData(); - data.TrySetData(TenantNotificationKey, tenantId); - return data; + TrySetData("title", title); + TrySetData("message", message); + TrySetData("formUser", formUser); + TrySetData("createTime", createTime); + TrySetData(LocalizerKey, true); + if (description != null) + { + TrySetData("description", description); + } + return this; } - /// /// 写入标准数据 /// @@ -86,13 +88,16 @@ namespace LINGYUN.Abp.Notifications /// 内容 /// 创建时间 /// 来源用户 + /// 附加说明 /// - public NotificationData WriteStandardData(string title, string message, DateTime createTime, string formUser) + 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; } /// @@ -105,6 +110,7 @@ namespace LINGYUN.Abp.Notifications public NotificationData WriteStandardData(string prefix, string key, object value) { TrySetData(string.Concat(prefix, key), value); + TrySetData(LocalizerKey, false); return this; } /// @@ -117,8 +123,10 @@ namespace LINGYUN.Abp.Notifications 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; } /// @@ -154,29 +162,20 @@ namespace LINGYUN.Abp.Notifications { if (value != null && !Properties.ContainsKey(key)) { - Properties[key] = value; + Properties.Add(key, value); } + Properties[key] = value; } - - public bool HasUserNotification(out Guid userId, out string userName) - { - userName = ""; - if (Properties.TryGetValue(UserIdNotificationKey, out object userKey)) - { - userId = (Guid)userKey; - var name = TryGetData(UserNameNotificationKey); - userName = name?.ToString() ?? userName; - return true; - } - return false; - } - - public bool HasTenantNotification(out Guid tenantId) + /// + /// 需要本地化 + /// + /// + public bool NeedLocalizer() { - if (Properties.TryGetValue(TenantNotificationKey, out object tenantKey)) + var localizer = TryGetData(LocalizerKey); + if (localizer != null && localizer is bool needLocalizer) { - tenantId = (Guid)tenantKey; - return true; + return needLocalizer; } return false; } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDataConverter.cs b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDataConverter.cs new file mode 100644 index 000000000..f9a2d0880 --- /dev/null +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDataConverter.cs @@ -0,0 +1,31 @@ +using Newtonsoft.Json; + +namespace LINGYUN.Abp.Notifications +{ + public class NotificationDataConverter + { + public static NotificationData Convert(NotificationData notificationData) + { + if (notificationData != null) + { + if (notificationData.NeedLocalizer()) + { + var title = JsonConvert.DeserializeObject(notificationData.TryGetData("title").ToString()); + var message = JsonConvert.DeserializeObject(notificationData.TryGetData("message").ToString()); + notificationData.TrySetData("title", title); + notificationData.TrySetData("message", message); + + if (notificationData.Properties.TryGetValue("description", out object description) && description != null) + { + notificationData.TrySetData("description", JsonConvert.DeserializeObject(description.ToString())); + } + } + } + else + { + notificationData = new NotificationData(); + } + return notificationData; + } + } +} diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDataMappingDictionary.cs b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDataMappingDictionary.cs index 008355e2a..da81cac62 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDataMappingDictionary.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDataMappingDictionary.cs @@ -6,13 +6,13 @@ namespace LINGYUN.Abp.Notifications { public class NotificationDataMappingDictionary : Dictionary> { - public void Mapping(string cateGory, string provider, Func func) + public void Mapping(string name, string provider, Func func) { - if (ContainsKey(cateGory)) + if (ContainsKey(name)) { - this[cateGory] = new List(); + this[name] = new List(); } - this[cateGory].Add(new NotificationDataMappingDictionaryItem(provider, func)); + this[name].Add(new NotificationDataMappingDictionaryItem(provider, func)); } public void MappingAll(string provider, Func func) @@ -23,11 +23,11 @@ namespace LINGYUN.Abp.Notifications } } - public NotificationDataMappingDictionaryItem GetMapItemOrNull(string cateGory, string provider) + public NotificationDataMappingDictionaryItem GetMapItemOrNull(string name, string provider) { - if (ContainsKey(cateGory)) + if (ContainsKey(name)) { - return this[cateGory].FirstOrDefault(map => map.Provider.Equals(provider)); + return this[name].FirstOrDefault(map => map.Provider.Equals(provider)); } return null; } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDefinition.cs b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDefinition.cs index 3a0c8f3c5..b6b356a21 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDefinition.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDefinition.cs @@ -3,17 +3,11 @@ using System; using System.Collections.Generic; using Volo.Abp; using Volo.Abp.Localization; +using Volo.Abp.MultiTenancy; /* - * 通知系统的设计不应该定死通知名称 - * 而是规范通知的一些属性,因此不应该是自定义通知名称,而是定义通知的类目,类似于Catalog - * 或者Prefix - * - * TODO: 2020-08-26 如果需要用户或者租户特定的消息该如何来发送通知? - * 是否追加字段:通知类别(宿主、租户、用户、通用),主要可以在运行时判断发布消息的来源, - * 如果是用户通知(NotificationData[FormUser])则只会查询用户对于用户通知的订阅(用户互动:站内信、私信、好友请求、留言等),优先级最低 - * 租户通知(NotificationData[FormTenant])则只会查询用户对于租户通知的订阅(系统发布、应用通知),优先级次于用户 - * 全局通知(NotificationData[FormGlobal])则查询用户对于全局通知的订阅(一般用于系统发布、应用通知),优先级最高 + * 2020-10-29 重构通知 + * INotificationSender指定接收者,未指定才会查询所有订阅用户,已指定发布者,直接发布(检验是否订阅) */ namespace LINGYUN.Abp.Notifications @@ -21,10 +15,10 @@ namespace LINGYUN.Abp.Notifications public class NotificationDefinition { /// - /// 通知类目 + /// 通知名称 /// [NotNull] - public string CateGory { get; set; } + public string Name { get; set; } /// /// 通知显示名称 /// @@ -58,15 +52,15 @@ namespace LINGYUN.Abp.Notifications public List Providers { get; } public NotificationDefinition( - string category, + string name, ILocalizableString displayName = null, ILocalizableString description = null, NotificationType notificationType = NotificationType.Application, NotificationLifetime lifetime = NotificationLifetime.Persistent, bool allowSubscriptionToClients = false) { - CateGory = category; - DisplayName = displayName ?? new FixedLocalizableString(category); + Name = name; + DisplayName = displayName ?? new FixedLocalizableString(name); Description = description; NotificationLifetime = lifetime; NotificationType = notificationType; @@ -84,5 +78,10 @@ namespace LINGYUN.Abp.Notifications return this; } + + public override string ToString() + { + return $"[{nameof(NotificationDefinition)} {Name}]"; + } } } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDefinitionContext.cs b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDefinitionContext.cs index db8b40bdc..64e674e24 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDefinitionContext.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDefinitionContext.cs @@ -1,33 +1,57 @@ -using System; +using JetBrains.Annotations; using System.Collections.Generic; +using Volo.Abp; +using Volo.Abp.Localization; +using Volo.Abp.MultiTenancy; namespace LINGYUN.Abp.Notifications { public class NotificationDefinitionContext : INotificationDefinitionContext { - protected Dictionary Notifications { get; } + internal Dictionary Groups { get; } - public NotificationDefinitionContext(Dictionary notifications) + public NotificationDefinitionContext() { - Notifications = notifications; + Groups = new Dictionary(); } - public void Add(params NotificationDefinition[] definitions) + public NotificationGroupDefinition AddGroup( + [NotNull] string name, + ILocalizableString displayName = null, + bool allowSubscriptionToClients = true) { - if (definitions.IsNullOrEmpty()) + Check.NotNull(name, nameof(name)); + + if (Groups.ContainsKey(name)) { - return; + throw new AbpException($"There is already an existing notification group with name: {name}"); } - foreach (var definition in definitions) + return Groups[name] = new NotificationGroupDefinition(name, displayName, allowSubscriptionToClients); + } + + public NotificationGroupDefinition GetGroupOrNull(string name) + { + Check.NotNull(name, nameof(name)); + + if (!Groups.ContainsKey(name)) { - Notifications[definition.CateGory] = definition; + return null; } + + return Groups[name]; } - public NotificationDefinition GetOrNull(string category) + public void RemoveGroup(string name) { - return Notifications.GetOrDefault(category); + Check.NotNull(name, nameof(name)); + + if (!Groups.ContainsKey(name)) + { + throw new AbpException($"Undefined notification group: '{name}'."); + } + + Groups.Remove(name); } } } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDefinitionManager.cs b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDefinitionManager.cs index 6c92aa695..079e666a4 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDefinitionManager.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDefinitionManager.cs @@ -1,5 +1,4 @@ -using JetBrains.Annotations; -using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using System; using System.Collections.Generic; @@ -12,51 +11,88 @@ namespace LINGYUN.Abp.Notifications { public class NotificationDefinitionManager : INotificationDefinitionManager, ISingletonDependency { - protected Lazy> NotificationDefinitions { get; } - protected AbpNotificationOptions Options { get; } - protected IServiceProvider ServiceProvider { get; } + protected IDictionary NotificationGroupDefinitions => _lazyNotificationGroupDefinitions.Value; + private readonly Lazy> _lazyNotificationGroupDefinitions; + + protected IDictionary NotificationDefinitions => _lazyNotificationDefinitions.Value; + private readonly Lazy> _lazyNotificationDefinitions; + + private readonly IServiceScopeFactory _serviceScopeFactory; public NotificationDefinitionManager( IOptions options, - IServiceProvider serviceProvider) + IServiceScopeFactory serviceScopeFactory) { - ServiceProvider = serviceProvider; + _serviceScopeFactory = serviceScopeFactory; Options = options.Value; - NotificationDefinitions = new Lazy>(CreateNotificationDefinitions, true); + _lazyNotificationDefinitions = new Lazy>( + CreateNotificationDefinitions, + isThreadSafe: true + ); + + _lazyNotificationGroupDefinitions = new Lazy>( + CreateNotificationGroupDefinitions, + isThreadSafe: true + ); } - public virtual NotificationDefinition Get([NotNull] string category) + public virtual NotificationDefinition Get(string name) { - Check.NotNull(category, nameof(category)); + Check.NotNull(name, nameof(name)); - var notification = GetOrNull(category); + var feature = GetOrNull(name); - if (notification == null) + if (feature == null) { - throw new AbpException("Undefined notification category: " + category); + throw new AbpException("Undefined notification: " + name); } - return notification; + return feature; } public virtual IReadOnlyList GetAll() { - return NotificationDefinitions.Value.Values.ToImmutableList(); + return NotificationDefinitions.Values.ToImmutableList(); + } + + public virtual NotificationDefinition GetOrNull(string name) + { + return NotificationDefinitions.GetOrDefault(name); } - public virtual NotificationDefinition GetOrNull(string category) + public IReadOnlyList GetGroups() { - return NotificationDefinitions.Value.GetOrDefault(category); + return NotificationGroupDefinitions.Values.ToImmutableList(); } - protected virtual IDictionary CreateNotificationDefinitions() + protected virtual Dictionary CreateNotificationDefinitions() { var notifications = new Dictionary(); - using (var scope = ServiceProvider.CreateScope()) + foreach (var groupDefinition in NotificationGroupDefinitions.Values) + { + foreach (var notification in groupDefinition.Notifications) + { + if (notifications.ContainsKey(notification.Name)) + { + throw new AbpException("Duplicate notification name: " + notification.Name); + } + + notifications[notification.Name] = notification; + } + } + + return notifications; + } + + protected virtual Dictionary CreateNotificationGroupDefinitions() + { + var context = new NotificationDefinitionContext(); + + using (var scope = _serviceScopeFactory.CreateScope()) { var providers = Options .DefinitionProviders @@ -65,11 +101,11 @@ namespace LINGYUN.Abp.Notifications foreach (var provider in providers) { - provider.Define(new NotificationDefinitionContext(notifications)); + provider.Define(context); } } - return notifications; + return context.Groups; } } } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationEventData.cs b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationEventData.cs index 6eebfcd41..3fca3b84a 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationEventData.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationEventData.cs @@ -1,38 +1,20 @@ using System; +using System.Collections.Generic; +using Volo.Abp.MultiTenancy; namespace LINGYUN.Abp.Notifications { - public class NotificationEventData + public class NotificationEventData : IMultiTenant { public Guid? TenantId { get; set; } - public string CateGory { 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 NotificationType { get; set; } - public NotificationSeverity NotificationSeverity { get; set; } - + public NotificationSeverity Severity { get; set; } + public List Users { get; set; } public NotificationEventData() { - - } - - public NotificationInfo ToNotificationInfo() - { - return new NotificationInfo - { - NotificationSeverity = NotificationSeverity, - CreationTime = CreationTime, - Data = Data, - Id = Id, - Name = Name, - CateGory = CateGory, - NotificationType = NotificationType, - Lifetime = Lifetime, - TenantId = TenantId - }; + Users = new List(); } } } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationGroupDefinition.cs b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationGroupDefinition.cs new file mode 100644 index 000000000..088ba6447 --- /dev/null +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationGroupDefinition.cs @@ -0,0 +1,70 @@ +using JetBrains.Annotations; +using System.Collections.Generic; +using System.Collections.Immutable; +using Volo.Abp; +using Volo.Abp.Localization; +using Volo.Abp.MultiTenancy; + +namespace LINGYUN.Abp.Notifications +{ + public class NotificationGroupDefinition + { + /// + /// 通知组名称 + /// + [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; + + protected internal NotificationGroupDefinition( + string name, + ILocalizableString displayName = null, + bool allowSubscriptionToClients = false) + { + Name = name; + DisplayName = displayName ?? new FixedLocalizableString(Name); + AllowSubscriptionToClients = allowSubscriptionToClients; + + _notifications = new List(); + } + + public virtual NotificationDefinition AddNotification( + string name, + ILocalizableString displayName = null, + ILocalizableString description = null, + NotificationType notificationType = NotificationType.Application, + NotificationLifetime lifetime = NotificationLifetime.Persistent, + bool allowSubscriptionToClients = false) + { + var notification = new NotificationDefinition( + name, + displayName, + description, + notificationType, + lifetime, + allowSubscriptionToClients + ); + + _notifications.Add(notification); + + return notification; + } + } +} diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationInfo.cs b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationInfo.cs index 8b5745359..2b2f6db31 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationInfo.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationInfo.cs @@ -6,53 +6,33 @@ namespace LINGYUN.Abp.Notifications { public Guid? TenantId { get; set; } public string Name { get; set; } - public string CateGory { get; set; } public string Id { get; set; } public NotificationData Data { get; set; } public DateTime CreationTime { get; set; } public NotificationLifetime Lifetime { get; set; } - public NotificationType NotificationType { get; set; } - public NotificationSeverity NotificationSeverity { get; set; } + public NotificationType Type { get; set; } + public NotificationSeverity Severity { get; set; } public NotificationInfo() { Data = new NotificationData(); Lifetime = NotificationLifetime.Persistent; - NotificationType = NotificationType.Application; - NotificationSeverity = NotificationSeverity.Info; + Type = NotificationType.Application; + Severity = NotificationSeverity.Info; CreationTime = DateTime.Now; } - public long SetId(long id) + public void SetId(long id) { if (Id.IsNullOrWhiteSpace()) { Id = id.ToString(); - return id; } - - return GetId(); } public long GetId() { return long.Parse(Id); } - - public NotificationEventData ToNotificationEventData() - { - return new NotificationEventData - { - NotificationSeverity = NotificationSeverity, - CreationTime = CreationTime, - Data = Data, - Id = Id, - Name = Name, - CateGory = CateGory, - Lifetime = Lifetime, - NotificationType = NotificationType, - TenantId = TenantId - }; - } } } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationName.cs b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationName.cs deleted file mode 100644 index 057259ded..000000000 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationName.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace LINGYUN.Abp.Notifications -{ - public class NotificationName - { - public string CateGory { get; } - public string Name { get; } - - public NotificationName(string cateGory, string name) - { - Name = name; - CateGory = cateGory; - } - } -} diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationNameNormalizer.cs b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationNameNormalizer.cs deleted file mode 100644 index 1d4ada3d1..000000000 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationNameNormalizer.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace LINGYUN.Abp.Notifications -{ - public static class NotificationNameNormalizer - { - public static NotificationName NormalizerName(string name) - { - return new NotificationName(name, name); - } - public static NotificationName NormalizerName(string category, string name) - { - var notifyName = string.Concat(category, ":", name); - return new NotificationName(category, notifyName); - } - } -} diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationPublishJob.cs b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationPublishJob.cs index 194739e49..d1023e4c6 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationPublishJob.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationPublishJob.cs @@ -30,8 +30,10 @@ namespace LINGYUN.Abp.Notifications if (ServiceProvider.GetRequiredService(providerType) is INotificationPublishProvider publishProvider) { var notification = await Store.GetNotificationOrNullAsync(args.TenantId, args.NotificationId); + notification.Data = NotificationDataConverter.Convert(notification.Data); + var notifacationDataMapping = Options.NotificationDataMappings - .GetMapItemOrNull(publishProvider.Name, notification.CateGory); + .GetMapItemOrNull(notification.Name, publishProvider.Name); if (notifacationDataMapping != null) { notification.Data = notifacationDataMapping.MappingFunc(notification.Data); diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationPublishProvider.cs b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationPublishProvider.cs index c2f4fda24..7e44c30ea 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationPublishProvider.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationPublishProvider.cs @@ -3,8 +3,10 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using System; using System.Collections.Generic; +using System.Threading; using System.Threading.Tasks; using Volo.Abp.DependencyInjection; +using Volo.Abp.Threading; namespace LINGYUN.Abp.Notifications { @@ -39,11 +41,19 @@ namespace LINGYUN.Abp.Notifications return reference; } + public ICancellationTokenProvider CancellationTokenProvider { get; set; } + protected NotificationPublishProvider(IServiceProvider serviceProvider) { ServiceProvider = serviceProvider; + CancellationTokenProvider = NullCancellationTokenProvider.Instance; + } + + public async Task PublishAsync(NotificationInfo notification, IEnumerable identifiers) + { + await PublishAsync(notification, identifiers, CancellationTokenProvider.Token); } - public abstract Task PublishAsync(NotificationInfo notification, IEnumerable identifiers); + protected abstract Task PublishAsync(NotificationInfo notification, IEnumerable identifiers, CancellationToken cancellationToken = default); } } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NullNotificationStore.cs b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NullNotificationStore.cs index 4aebff7f6..a954bdddc 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NullNotificationStore.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NullNotificationStore.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Threading; using System.Threading.Tasks; using Volo.Abp.DependencyInjection; @@ -9,92 +10,178 @@ namespace LINGYUN.Abp.Notifications [ExposeServices(typeof(INotificationStore))] public class NullNotificationStore : INotificationStore { - public Task ChangeUserNotificationReadStateAsync(Guid? tenantId, Guid userId, long notificationId, NotificationReadState readState) + public Task ChangeUserNotificationReadStateAsync( + Guid? tenantId, + Guid userId, + long notificationId, + NotificationReadState readState, + CancellationToken cancellationToken = default) { return Task.CompletedTask; } - public Task DeleteAllUserSubscriptionAsync(Guid? tenantId, string notificationName) + public Task DeleteAllUserSubscriptionAsync( + Guid? tenantId, + string notificationName, + CancellationToken cancellationToken = default) { return Task.CompletedTask; } - public Task DeleteNotificationAsync(NotificationInfo notification) + public Task DeleteNotificationAsync( + NotificationInfo notification, + CancellationToken cancellationToken = default) { return Task.CompletedTask; } - public Task DeleteNotificationAsync(int batchCount) + public Task DeleteNotificationAsync( + int batchCount, + CancellationToken cancellationToken = default) { return Task.CompletedTask; } - public Task DeleteUserNotificationAsync(Guid? tenantId, Guid userId, long notificationId) + public Task DeleteUserNotificationAsync( + Guid? tenantId, + Guid userId, + long notificationId, + CancellationToken cancellationToken = default) { return Task.CompletedTask; } - public Task DeleteUserSubscriptionAsync(Guid? tenantId, Guid userId, string notificationName) + public Task DeleteUserSubscriptionAsync( + Guid? tenantId, + Guid userId, + string notificationName, + CancellationToken cancellationToken = default) { return Task.CompletedTask; } - public Task DeleteUserSubscriptionAsync(Guid? tenantId, IEnumerable identifiers, string notificationName) + public Task DeleteUserSubscriptionAsync( + Guid? tenantId, + IEnumerable identifiers, + string notificationName, + CancellationToken cancellationToken = default) { return Task.CompletedTask; } - public Task GetNotificationOrNullAsync(Guid? tenantId, long notificationId) + public Task GetNotificationOrNullAsync( + Guid? tenantId, + long notificationId, + CancellationToken cancellationToken = default) { return Task.FromResult(new NotificationInfo()); } - public Task> GetSubscriptionsAsync(Guid? tenantId, string notificationName) + 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 = NotificationReadState.UnRead, int maxResultCount = 10) + public Task> GetUserNotificationsAsync( + Guid? tenantId, + Guid userId, + NotificationReadState readState = NotificationReadState.UnRead, + int maxResultCount = 10, + CancellationToken cancellationToken = default) { return Task.FromResult(new List()); } - public Task> GetUserSubscriptionsAsync(Guid? tenantId, Guid userId) + public Task GetUserNotificationsCountAsync( + Guid? tenantId, + Guid userId, + string filter = "", + NotificationReadState readState = NotificationReadState.UnRead, + CancellationToken cancellationToken = default) + { + return Task.FromResult(0); + } + + public Task> GetUserNotificationsAsync( + Guid? tenantId, + Guid userId, + string filter = "", + string sorting = nameof(NotificationInfo.CreationTime), + bool reverse = true, + NotificationReadState readState = NotificationReadState.UnRead, + 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) + public Task> GetUserSubscriptionsAsync( + Guid? tenantId, + string userName, + CancellationToken cancellationToken = default) { return Task.FromResult(new List()); } - public Task InsertNotificationAsync(NotificationInfo notification) + public Task InsertNotificationAsync( + NotificationInfo notification, + CancellationToken cancellationToken = default) { return Task.CompletedTask; } - public Task InsertUserNotificationAsync(NotificationInfo notification, Guid userId) + public Task InsertUserNotificationAsync( + NotificationInfo notification, + Guid userId, + CancellationToken cancellationToken = default) { return Task.CompletedTask; } - public Task InsertUserNotificationsAsync(NotificationInfo notification, IEnumerable userIds) + public Task InsertUserNotificationsAsync( + NotificationInfo notification, + IEnumerable userIds, + CancellationToken cancellationToken = default) { return Task.CompletedTask; } - public Task InsertUserSubscriptionAsync(Guid? tenantId, UserIdentifier identifier, string notificationName) + public Task InsertUserSubscriptionAsync( + Guid? tenantId, + UserIdentifier identifier, + string notificationName, + CancellationToken cancellationToken = default) { return Task.CompletedTask; } - public Task InsertUserSubscriptionAsync(Guid? tenantId, IEnumerable identifiers, string notificationName) + public Task InsertUserSubscriptionAsync( + Guid? tenantId, + IEnumerable identifiers, + string notificationName, + CancellationToken cancellationToken = default) { return Task.CompletedTask; } - public Task IsSubscribedAsync(Guid? tenantId, Guid userId, string notificationName) + public Task IsSubscribedAsync( + Guid? tenantId, + Guid userId, + string notificationName, + CancellationToken cancellationToken = default) { return Task.FromResult(false); } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.RealTime.SignalR/Class1.cs b/aspnet-core/modules/common/LINGYUN.Abp.RealTime.SignalR/Class1.cs deleted file mode 100644 index 06fc047ee..000000000 --- a/aspnet-core/modules/common/LINGYUN.Abp.RealTime.SignalR/Class1.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System; - -namespace LINGYUN.Abp.RealTime.SignalR -{ - public class Class1 - { - } -} diff --git a/aspnet-core/modules/common/LINGYUN.Abp.RealTime.SignalR/LINGYUN/Abp/RealTime/SignalR/AbpRealTimeSignalRModule.cs b/aspnet-core/modules/common/LINGYUN.Abp.RealTime.SignalR/LINGYUN/Abp/RealTime/SignalR/AbpRealTimeSignalRModule.cs index 3e8995e8d..190b91a1d 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.RealTime.SignalR/LINGYUN/Abp/RealTime/SignalR/AbpRealTimeSignalRModule.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.RealTime.SignalR/LINGYUN/Abp/RealTime/SignalR/AbpRealTimeSignalRModule.cs @@ -4,6 +4,7 @@ using Volo.Abp.Modularity; namespace LINGYUN.Abp.RealTime.SignalR { [DependsOn( + typeof(AbpRealTimeModule), typeof(AbpAspNetCoreSignalRModule))] public class AbpRealTimeSignalRModule : AbpModule { diff --git a/aspnet-core/modules/common/LINGYUN.Abp.RealTime.SignalR/LINGYUN/Abp/RealTime/SignalR/Hubs/OnlineClientHubBase.cs b/aspnet-core/modules/common/LINGYUN.Abp.RealTime.SignalR/LINGYUN/Abp/RealTime/SignalR/Hubs/OnlineClientHubBase.cs index c8d6f3307..6701cd9cd 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.RealTime.SignalR/LINGYUN/Abp/RealTime/SignalR/Hubs/OnlineClientHubBase.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.RealTime.SignalR/LINGYUN/Abp/RealTime/SignalR/Hubs/OnlineClientHubBase.cs @@ -1,80 +1,94 @@ using LINGYUN.Abp.RealTime.Client; -using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; using System; using System.Threading.Tasks; using Volo.Abp.AspNetCore.SignalR; +using Volo.Abp.AspNetCore.WebClientInfo; namespace LINGYUN.Abp.RealTime.SignalR { - public abstract class OnlineClientHubBase : AbpHub + public abstract class OnlineClientHubBase : AbpHub, IClient { + private IWebClientInfoProvider _webClientInfoProvider; + protected IWebClientInfoProvider WebClientInfoProvider => LazyGetRequiredService(ref _webClientInfoProvider); + private IOnlineClientManager _onlineClientManager; protected IOnlineClientManager OnlineClientManager => LazyGetRequiredService(ref _onlineClientManager); - private IHttpContextAccessor _httpContextAccessor; - protected IHttpContextAccessor HttpContextAccessor => LazyGetRequiredService(ref _httpContextAccessor); - public override async Task OnConnectedAsync() { await base.OnConnectedAsync(); + IOnlineClient onlineClient = CreateClientForCurrentConnection(); - Logger.LogDebug("A client is connected: " + onlineClient.ToString()); - OnlineClientManager.Add(onlineClient); - await OnClientConnectedAsync(onlineClient); + await OnConnectedAsync(onlineClient); + } + + public virtual async Task OnConnectedAsync(IOnlineClient client) + { + Logger.LogDebug("A client is connected: " + client.ToString()); + OnlineClientManager.Add(client); + await OnClientConnectedAsync(client); } public override async Task OnDisconnectedAsync(Exception exception) { + // 从通讯组移除 + var onlineClient = OnlineClientManager.GetByConnectionIdOrNull(Context.ConnectionId); + await OnDisconnectedAsync(onlineClient); + await base.OnDisconnectedAsync(exception); - Logger.LogDebug("A client is disconnected: " + Context.ConnectionId); - try + } + + public virtual async Task OnDisconnectedAsync(IOnlineClient client) + { + if (client != null) { - // 从通讯组移除 - var onlineClient = OnlineClientManager.GetByConnectionIdOrNull(Context.ConnectionId); - if(onlineClient != null) + try { + Logger.LogDebug("A client is disconnected: " + client); // 移除在线客户端 OnlineClientManager.Remove(Context.ConnectionId); - await OnClientDisconnectedAsync(onlineClient); + await OnClientDisconnectedAsync(client); + } + catch (Exception ex) + { + Logger.LogWarning(ex.ToString(), ex); } - } - catch (Exception ex) - { - Logger.LogWarning(ex.ToString(), ex); } } protected virtual IOnlineClient CreateClientForCurrentConnection() { - return new OnlineClient(Context.ConnectionId, GetClientIpAddress(), - CurrentTenant.Id, CurrentUser.Id) + return new OnlineClient( + Context.ConnectionId, + WebClientInfoProvider.ClientIpAddress, + CurrentTenant.Id, + CurrentUser.Id) { - ConnectTime = Clock.Now + ConnectTime = Clock.Now, + UserName = CurrentUser.UserName, + UserAccount = CurrentUser.UserName, + Roles = CurrentUser.Roles ?? new string[0], + Properties = Context.Items }; } - protected virtual string GetClientIpAddress() + protected virtual async Task OnClientConnectedAsync(IOnlineClient client) { - try - { - return HttpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(); - } - catch (Exception ex) + // 角色添加进组 + foreach (var role in client.Roles) { - Logger.LogException(ex, LogLevel.Warning); - return null; + await Groups.AddToGroupAsync(client.ConnectionId, role); } } - protected virtual Task OnClientConnectedAsync(IOnlineClient client) + protected virtual async Task OnClientDisconnectedAsync(IOnlineClient client) { - return Task.CompletedTask; - } - - protected virtual Task OnClientDisconnectedAsync(IOnlineClient client) - { - return Task.CompletedTask; + // 角色添加进组 + foreach (var role in client.Roles) + { + await Groups.RemoveFromGroupAsync(client.ConnectionId, role); + } } } } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Client/IClient.cs b/aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Client/IClient.cs new file mode 100644 index 000000000..1df9e6b3d --- /dev/null +++ b/aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Client/IClient.cs @@ -0,0 +1,10 @@ +using System.Threading.Tasks; + +namespace LINGYUN.Abp.RealTime.Client +{ + public interface IClient + { + Task OnConnectedAsync(IOnlineClient client); + Task OnDisconnectedAsync(IOnlineClient client); + } +} diff --git a/aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Client/IOnlineClient.cs b/aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Client/IOnlineClient.cs index 00f465a89..fc66eaed2 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Client/IOnlineClient.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Client/IOnlineClient.cs @@ -19,8 +19,10 @@ namespace LINGYUN.Abp.RealTime.Client DateTime ConnectTime { get; } - object this[string key] { get; set; } + string[] Roles { get; } - Dictionary Properties { get; } + object this[object key] { get; set; } + + IDictionary Properties { get; } } } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Client/IOnlineClientManager.cs b/aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Client/IOnlineClientManager.cs index 7f83b96bb..9afb77bc1 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Client/IOnlineClientManager.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Client/IOnlineClientManager.cs @@ -1,6 +1,7 @@ using JetBrains.Annotations; using System; using System.Collections.Generic; +using System.Linq.Expressions; namespace LINGYUN.Abp.RealTime.Client { @@ -22,6 +23,8 @@ namespace LINGYUN.Abp.RealTime.Client IReadOnlyList GetAllClients(); + IReadOnlyList GetAllClients(Expression> predicate); + IReadOnlyList GetAllByContext([NotNull] OnlineClientContext context); } } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Client/IOnlineClientStore.cs b/aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Client/IOnlineClientStore.cs index 9affcabbc..ea294bfa1 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Client/IOnlineClientStore.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Client/IOnlineClientStore.cs @@ -1,4 +1,6 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; namespace LINGYUN.Abp.RealTime.Client { @@ -15,5 +17,7 @@ namespace LINGYUN.Abp.RealTime.Client bool Contains(string connectionId); IReadOnlyList GetAll(); + + IReadOnlyList GetAll(Expression> predicate); } } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Client/InMemoryOnlineClientStore.cs b/aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Client/InMemoryOnlineClientStore.cs index 20b8de95c..568b1be9c 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Client/InMemoryOnlineClientStore.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Client/InMemoryOnlineClientStore.cs @@ -1,6 +1,9 @@ -using System.Collections.Concurrent; +using System; +using System.Collections.Concurrent; using System.Collections.Generic; using System.Collections.Immutable; +using System.Linq; +using System.Linq.Expressions; using Volo.Abp.DependencyInjection; namespace LINGYUN.Abp.RealTime.Client @@ -43,5 +46,12 @@ namespace LINGYUN.Abp.RealTime.Client { return Clients.Values.ToImmutableList(); } + + public IReadOnlyList GetAll(Expression> predicate) + { + return Clients.Values + .Where(predicate.Compile()) + .ToImmutableList(); + } } } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Client/OnlineClient.cs b/aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Client/OnlineClient.cs index 43dc48b1c..0341c0007 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Client/OnlineClient.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Client/OnlineClient.cs @@ -6,7 +6,7 @@ namespace LINGYUN.Abp.RealTime.Client [Serializable] public class OnlineClient : IOnlineClient { - public object this[string key] + public object this[object key] { get { return Properties[key]; } set { Properties[key] = value; } @@ -23,10 +23,12 @@ namespace LINGYUN.Abp.RealTime.Client public string UserName { get; set; } + public string[] Roles { get; set; } + public DateTime ConnectTime { get; set; } - private Dictionary _properties; - public Dictionary Properties + private IDictionary _properties; + public IDictionary Properties { get { return _properties; } set @@ -53,7 +55,8 @@ namespace LINGYUN.Abp.RealTime.Client TenantId = tenantId; UserId = userId; - Properties = new Dictionary(); + Roles = new string[0]; + Properties = new Dictionary(); } public override string ToString() diff --git a/aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Client/OnlineClientManager.cs b/aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Client/OnlineClientManager.cs index e02405cf4..68e1bcfd9 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Client/OnlineClientManager.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/Client/OnlineClientManager.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; +using System.Linq.Expressions; using Volo.Abp; using Volo.Abp.DependencyInjection; @@ -89,10 +90,12 @@ namespace LINGYUN.Abp.RealTime.Client public virtual IReadOnlyList GetAllClients() { - lock (SyncObj) - { - return Store.GetAll(); - } + return Store.GetAll(); + } + + public virtual IReadOnlyList GetAllClients(Expression> predicate) + { + return Store.GetAll(predicate); } [NotNull] diff --git a/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN.Abp.WeChat.Authorization.csproj b/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN.Abp.WeChat.Authorization.csproj index 19ec414a5..85bf57c60 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN.Abp.WeChat.Authorization.csproj +++ b/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN.Abp.WeChat.Authorization.csproj @@ -13,4 +13,8 @@ + + + + diff --git a/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/AbpWeChatAuthorizationModule.cs b/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/AbpWeChatAuthorizationModule.cs index cb8ba8810..e69091dd7 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/AbpWeChatAuthorizationModule.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/AbpWeChatAuthorizationModule.cs @@ -7,7 +7,10 @@ using Volo.Abp.Modularity; namespace LINGYUN.Abp.WeChat.Authorization { - [DependsOn(typeof(AbpJsonModule), typeof(AbpCachingModule))] + [DependsOn( + typeof(AbpWeChatModule), + typeof(AbpJsonModule), + typeof(AbpCachingModule))] public class AbpWeChatAuthorizationModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) diff --git a/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/OpenId/IUserWeChatCodeFinder.cs b/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/OpenId/IUserWeChatCodeFinder.cs new file mode 100644 index 000000000..1edba6807 --- /dev/null +++ b/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/OpenId/IUserWeChatCodeFinder.cs @@ -0,0 +1,12 @@ +using System; +using System.Threading.Tasks; + +namespace LINGYUN.Abp.WeChat.Authorization +{ + public interface IUserWeChatCodeFinder + { + Task FindByUserIdAsync(Guid userId); + + Task FindByUserNameAsync(string userName); + } +} diff --git a/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/OpenId/IWeChatOpenIdFinder.cs b/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/OpenId/IWeChatOpenIdFinder.cs index 3fa47002a..6fb15bcd9 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/OpenId/IWeChatOpenIdFinder.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/OpenId/IWeChatOpenIdFinder.cs @@ -1,9 +1,14 @@ -using System.Threading.Tasks; +using System; +using System.Threading.Tasks; namespace LINGYUN.Abp.WeChat.Authorization { public interface IWeChatOpenIdFinder { Task FindAsync(string code); + + Task FindByUserIdAsync(Guid userId); + + Task FindByUserNameAsync(string userName); } } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/OpenId/NullUserWeChatCodeFinder.cs b/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/OpenId/NullUserWeChatCodeFinder.cs new file mode 100644 index 000000000..364da9ef0 --- /dev/null +++ b/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/OpenId/NullUserWeChatCodeFinder.cs @@ -0,0 +1,19 @@ +using System; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; + +namespace LINGYUN.Abp.WeChat.Authorization +{ + public class NullUserWeChatCodeFinder : IUserWeChatCodeFinder, ISingletonDependency + { + public Task FindByUserIdAsync(Guid userId) + { + return Task.FromResult(userId.ToString()); + } + + public Task FindByUserNameAsync(string userName) + { + return Task.FromResult(userName); + } + } +} diff --git a/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/OpenId/WeChatOpenIdCacheItem.cs b/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/OpenId/WeChatOpenIdCacheItem.cs index 52950c532..888f7dd5f 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/OpenId/WeChatOpenIdCacheItem.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/OpenId/WeChatOpenIdCacheItem.cs @@ -18,11 +18,9 @@ namespace LINGYUN.Abp.WeChat.Authorization WeChatOpenId = weChatOpenId; } - public static string CalculateCacheKey(string code, Guid? tenantId = null) + public static string CalculateCacheKey(string code) { - string tenant = tenantId != null ? tenantId.Value.ToString("D") : "host"; - - return "t:" + tenant + ",c:" + code; + return "c:" + code; } } } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/OpenId/WeChatOpenIdFinder.cs b/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/OpenId/WeChatOpenIdFinder.cs index 553f356e1..fcf22aecc 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/OpenId/WeChatOpenIdFinder.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/OpenId/WeChatOpenIdFinder.cs @@ -22,16 +22,19 @@ namespace LINGYUN.Abp.WeChat.Authorization protected ICurrentTenant CurrentTenant { get; } protected IHttpClientFactory HttpClientFactory { get; } protected IJsonSerializer JsonSerializer { get; } + protected IUserWeChatCodeFinder UserWeChatCodeFinder { get; } protected IDistributedCache Cache { get; } public WeChatOpenIdFinder( ICurrentTenant currentTenant, IJsonSerializer jsonSerializer, + IUserWeChatCodeFinder userWeChatCodeFinder, IHttpClientFactory httpClientFactory, IOptions options, IDistributedCache cache) { CurrentTenant = currentTenant; JsonSerializer = jsonSerializer; + UserWeChatCodeFinder = userWeChatCodeFinder; HttpClientFactory = httpClientFactory; Cache = cache; @@ -43,12 +46,30 @@ namespace LINGYUN.Abp.WeChat.Authorization { // TODO: 如果需要获取SessionKey的话呢,需要再以openid作为标识来缓存一下吗 // 或者前端保存code,通过传递code来获取 - return (await GetCacheItemAsync(code, CurrentTenant.Id)).WeChatOpenId; + return (await GetCacheItemAsync(code)).WeChatOpenId; } - protected virtual async Task GetCacheItemAsync(string code, Guid? tenantId = null) + public virtual async Task FindByUserIdAsync(Guid userId) { - var cacheKey = WeChatOpenIdCacheItem.CalculateCacheKey(code, tenantId); + var code = await UserWeChatCodeFinder.FindByUserIdAsync(userId); + // TODO: 如果需要获取SessionKey的话呢,需要再以openid作为标识来缓存一下吗 + // 或者前端保存code,通过传递code来获取 + return (await GetCacheItemAsync(code)).WeChatOpenId; + } + + public virtual async Task FindByUserNameAsync(string userName) + { + var code = await UserWeChatCodeFinder.FindByUserNameAsync(userName); + // TODO: 如果需要获取SessionKey的话呢,需要再以openid作为标识来缓存一下吗 + // 或者前端保存code,通过传递code来获取 + return (await GetCacheItemAsync(code)).WeChatOpenId; + } + + + + protected virtual async Task GetCacheItemAsync(string code) + { + var cacheKey = WeChatOpenIdCacheItem.CalculateCacheKey(code); Logger.LogDebug($"WeChatOpenIdFinder.GetCacheItemAsync: {cacheKey}"); diff --git a/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/Token/IWeChatTokenProvider.cs b/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/Token/IWeChatTokenProvider.cs index dddf69239..0fdd7ceb2 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/Token/IWeChatTokenProvider.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/Token/IWeChatTokenProvider.cs @@ -1,9 +1,10 @@ -using System.Threading.Tasks; +using System.Threading; +using System.Threading.Tasks; namespace LINGYUN.Abp.WeChat.Authorization { public interface IWeChatTokenProvider { - Task GetTokenAsync(); + Task GetTokenAsync(CancellationToken cancellationToken = default); } } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/Token/WeChatTokenProvider.cs b/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/Token/WeChatTokenProvider.cs index 3c6b2b7e6..4e1cb40e5 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/Token/WeChatTokenProvider.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/Token/WeChatTokenProvider.cs @@ -4,6 +4,7 @@ using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; using System; using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using Volo.Abp.Caching; using Volo.Abp.DependencyInjection; @@ -33,18 +34,18 @@ namespace LINGYUN.Abp.WeChat.Authorization Logger = NullLogger.Instance; } - public virtual async Task GetTokenAsync() + public virtual async Task GetTokenAsync(CancellationToken cancellationToken = default) { - return (await GetCacheItemAsync("WeChatToken", Options.AppId)).WeChatToken; + return (await GetCacheItemAsync("WeChatToken", Options.AppId, cancellationToken)).WeChatToken; } - protected virtual async Task GetCacheItemAsync(string provider, string appId) + protected virtual async Task GetCacheItemAsync(string provider, string appId, CancellationToken cancellationToken = default) { var cacheKey = WeChatTokenCacheItem.CalculateCacheKey(provider, appId); Logger.LogDebug($"WeChatTokenProvider.GetCacheItemAsync: {cacheKey}"); - var cacheItem = await Cache.GetAsync(cacheKey); + var cacheItem = await Cache.GetAsync(cacheKey, token: cancellationToken); if (cacheItem != null) { @@ -64,7 +65,7 @@ namespace LINGYUN.Abp.WeChat.Authorization GrantType = "client_credential" }; - var response = await client.RequestWeChatCodeTokenAsync(request); + var response = await client.RequestWeChatCodeTokenAsync(request, cancellationToken); var responseContent = await response.Content.ReadAsStringAsync(); var weChatTokenResponse = JsonSerializer.Deserialize(responseContent); var weChatToken = weChatTokenResponse.ToWeChatToken(); @@ -78,7 +79,7 @@ namespace LINGYUN.Abp.WeChat.Authorization AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(weChatToken.ExpiresIn - 120) }; - await Cache.SetAsync(cacheKey, cacheItem, cacheOptions); + await Cache.SetAsync(cacheKey, cacheItem, cacheOptions, token: cancellationToken); Logger.LogDebug($"Finished setting the cache item: {cacheKey}"); diff --git a/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/WeChatAuthorizationConsts.cs b/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/WeChatAuthorizationConsts.cs new file mode 100644 index 000000000..d1ffc1a13 --- /dev/null +++ b/aspnet-core/modules/common/LINGYUN.Abp.WeChat.Authorization/LINGYUN/Abp/WeChat/Authorization/WeChatAuthorizationConsts.cs @@ -0,0 +1,22 @@ +namespace LINGYUN.Abp.WeChat.Authorization +{ + public class WeChatAuthorizationConsts + { + /// + /// 微信提供者标识 + /// + public static string ProviderKey { get; set; } = "WeChat"; + /// + /// 微信Code参数名称 + /// + public static string WeCahtCodeKey { get; set; } = "wx-code"; + /// + /// 微信OpenId参数名称 + /// + public static string WeCahtOpenIdKey { get; set; } = "wx-open-id"; + /// + /// 微信SessionKey参数名称 + /// + public static string WeCahtSessionKey { get; set; } = "wx-session-key"; + } +} 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 2a5b02b1b..df9159134 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 @@ -16,7 +16,6 @@ namespace LINGYUN.Abp.Identity Task RemoveOrganizationUnitsAsync(Guid id, Guid ouId); - #endregion #region ClaimType diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChatValidator/LINGYUN/Abp/IdentityServer/WeChatValidator/WeChatTokenGrantValidator.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChatValidator/LINGYUN/Abp/IdentityServer/WeChatValidator/WeChatTokenGrantValidator.cs index ed363e542..444a9fef7 100644 --- a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChatValidator/LINGYUN/Abp/IdentityServer/WeChatValidator/WeChatTokenGrantValidator.cs +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChatValidator/LINGYUN/Abp/IdentityServer/WeChatValidator/WeChatTokenGrantValidator.cs @@ -72,6 +72,7 @@ namespace LINGYUN.Abp.IdentityServer.WeChatValidator Localizer["InvalidGrant:GrantTypeInvalid"]); return; } + // TODO: 统一命名规范, 微信认证传递的 code 改为 WeChatOpenIdConsts.WeCahtCodeKey var wechatCode = raw.Get(WeChatValidatorConsts.WeChatValidatorTokenName); if (wechatCode.IsNullOrWhiteSpace() || wechatCode.IsNullOrWhiteSpace()) { @@ -81,7 +82,7 @@ namespace LINGYUN.Abp.IdentityServer.WeChatValidator return; } var wechatOpenId = await WeChatOpenIdFinder.FindAsync(wechatCode); - var currentUser = await UserManager.FindByLoginAsync("WeChat", wechatOpenId.OpenId); + var currentUser = await UserManager.FindByLoginAsync(WeChatAuthorizationConsts.ProviderKey, wechatOpenId.OpenId); if(currentUser == null) { Logger.LogWarning("Invalid grant type: wechat openid: {0} not register", wechatOpenId.OpenId); @@ -91,6 +92,11 @@ namespace LINGYUN.Abp.IdentityServer.WeChatValidator } var sub = await UserManager.GetUserIdAsync(currentUser); + // 微信登录的用户写入token + currentUser.SetToken(WeChatAuthorizationConsts.ProviderKey, WeChatAuthorizationConsts.WeCahtCodeKey, wechatCode); + currentUser.SetToken(WeChatAuthorizationConsts.ProviderKey, WeChatAuthorizationConsts.WeCahtOpenIdKey, wechatOpenId.OpenId); + currentUser.SetToken(WeChatAuthorizationConsts.ProviderKey, WeChatAuthorizationConsts.WeCahtSessionKey, wechatOpenId.SessionKey); + var additionalClaims = new List(); if (currentUser.TenantId.HasValue) { diff --git a/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChatValidator/LINGYUN/Abp/WeChat/Authorization/UserWeChatCodeFinder.cs b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChatValidator/LINGYUN/Abp/WeChat/Authorization/UserWeChatCodeFinder.cs new file mode 100644 index 000000000..e0a966910 --- /dev/null +++ b/aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.WeChatValidator/LINGYUN/Abp/WeChat/Authorization/UserWeChatCodeFinder.cs @@ -0,0 +1,40 @@ +using Microsoft.Extensions.DependencyInjection; +using System; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Identity; + +namespace LINGYUN.Abp.WeChat.Authorization +{ + // TODO: 真正的项目需要扩展Abp框架实体来关联微信 + [Dependency(ServiceLifetime.Transient, ReplaceServices = true)] + [ExposeServices(typeof(IUserWeChatCodeFinder))] + public class UserWeChatCodeFinder : IUserWeChatCodeFinder + { + protected IdentityUserManager UserManager { get; } + + public UserWeChatCodeFinder( + IdentityUserManager userManager) + { + UserManager = userManager; + } + + public virtual async Task FindByUserIdAsync(Guid userId) + { + var user = await UserManager.FindByIdAsync(userId.ToString()); + + var weChatCodeToken = user?.FindToken(WeChatAuthorizationConsts.ProviderKey, WeChatAuthorizationConsts.WeCahtCodeKey); + + return weChatCodeToken?.Value ?? userId.ToString(); + } + + public virtual async Task FindByUserNameAsync(string userName) + { + var user = await UserManager.FindByNameAsync(userName); + + var weChatCodeToken = user?.FindToken(WeChatAuthorizationConsts.ProviderKey, WeChatAuthorizationConsts.WeCahtCodeKey); + + return weChatCodeToken?.Value ?? userName; + } + } +} diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/MyFriendAddRequestDto.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/MyFriendAddRequestDto.cs new file mode 100644 index 000000000..d68bbd2f3 --- /dev/null +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/MyFriendAddRequestDto.cs @@ -0,0 +1,7 @@ +namespace LINGYUN.Abp.MessageService.Chat +{ + public class MyFriendAddRequestDto : MyFriendOperationDto + { + public string RemarkName { get; set; } + } +} diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/MyFriendCreateDto.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/MyFriendCreateDto.cs index 00192a0ae..9fcc3e309 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/MyFriendCreateDto.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/Dto/MyFriendCreateDto.cs @@ -2,6 +2,5 @@ { public class MyFriendCreateDto : MyFriendOperationDto { - public string RemarkName { get; set; } } } diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/IMyFriendAppService.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/IMyFriendAppService.cs index a220d5ee3..ada5421ad 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/IMyFriendAppService.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Chat/IMyFriendAppService.cs @@ -14,5 +14,7 @@ namespace LINGYUN.Abp.MessageService.Chat Task CreateAsync(MyFriendCreateDto input); Task DeleteAsync(MyFriendOperationDto input); + + Task AddRequestAsync(MyFriendAddRequestDto input); } } diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Localization/ApplicationContracts/en.json b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Localization/ApplicationContracts/en.json index d33bd06cb..330f1fee3 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Localization/ApplicationContracts/en.json +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Localization/ApplicationContracts/en.json @@ -3,6 +3,8 @@ "texts": { "Permission:MessageService": "Message service", "Permission:Notification": "Notification", - "Permission:Delete": "Delete" + "Permission:Delete": "Delete", + "Permission:Hangfire": "Hangfire dashboard", + "Permission:ManageQueue": "Manage queue" } } \ No newline at end of file diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Localization/ApplicationContracts/zh-Hans.json b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Localization/ApplicationContracts/zh-Hans.json index 61f89d68c..dd688422c 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Localization/ApplicationContracts/zh-Hans.json +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Localization/ApplicationContracts/zh-Hans.json @@ -3,6 +3,8 @@ "texts": { "Permission:MessageService": "消息服务", "Permission:Notification": "通知管理", - "Permission:Delete": "删除" + "Permission:Delete": "删除", + "Permission:Hangfire": "Hangfire仪表板", + "Permission:ManageQueue": "管理队列" } } \ No newline at end of file diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Notifications/Dto/NotificationDto.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Notifications/Dto/NotificationDto.cs new file mode 100644 index 000000000..7bff2a55c --- /dev/null +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Notifications/Dto/NotificationDto.cs @@ -0,0 +1,28 @@ +using LINGYUN.Abp.Notifications; + +namespace LINGYUN.Abp.MessageService.Notifications +{ + 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; } + } +} diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Notifications/Dto/NotificationGroupDto.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Notifications/Dto/NotificationGroupDto.cs new file mode 100644 index 000000000..32cf4587e --- /dev/null +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Notifications/Dto/NotificationGroupDto.cs @@ -0,0 +1,11 @@ +using System.Collections.Generic; + +namespace LINGYUN.Abp.MessageService.Notifications +{ + public class NotificationGroupDto + { + public string Name { get; set; } + public string DisplayName { get; set; } + public List Notifications { get; set; } = new List(); + } +} diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Notifications/Dto/NotificationSendDto.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Notifications/Dto/NotificationSendDto.cs new file mode 100644 index 000000000..d0baadb58 --- /dev/null +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Notifications/Dto/NotificationSendDto.cs @@ -0,0 +1,22 @@ +using LINGYUN.Abp.Notifications; +using System; +using System.ComponentModel.DataAnnotations; + +namespace LINGYUN.Abp.MessageService.Notifications +{ + public class NotificationSendDto + { + [Required] + [StringLength(NotificationConsts.MaxNameLength)] + public string Name { get; set; } + + public NotificationData Data { get; set; } = new NotificationData(); + + public Guid? ToUserId { get; set; } + + [StringLength(128)] + public string ToUserName { get; set; } + + public NotificationSeverity Severity { get; set; } = NotificationSeverity.Info; + } +} diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Notifications/Dto/UserNotificationGetByPagedDto.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Notifications/Dto/UserNotificationGetByPagedDto.cs index d8c102a69..b1e811463 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Notifications/Dto/UserNotificationGetByPagedDto.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Notifications/Dto/UserNotificationGetByPagedDto.cs @@ -7,6 +7,8 @@ namespace LINGYUN.Abp.MessageService.Notifications { public string Filter { get; set; } + public bool Reverse { get; set; } + public NotificationReadState ReadState { get; set; } = NotificationReadState.Read; } } diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Notifications/IMyNotificationAppService.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Notifications/IMyNotificationAppService.cs new file mode 100644 index 000000000..e5dce9110 --- /dev/null +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Notifications/IMyNotificationAppService.cs @@ -0,0 +1,21 @@ +using LINGYUN.Abp.Notifications; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; + +namespace LINGYUN.Abp.MessageService.Notifications +{ + public interface IMyNotificationAppService : + + IReadOnlyAppService< + NotificationInfo, + long, + UserNotificationGetByPagedDto + >, + IDeleteAppService + { + Task SendNofiterAsync(NotificationSendDto input); + + Task> GetAssignableNotifiersAsync(); + } +} diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Notifications/INotificationAppService.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Notifications/INotificationAppService.cs deleted file mode 100644 index ca446d394..000000000 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Notifications/INotificationAppService.cs +++ /dev/null @@ -1,41 +0,0 @@ -using LINGYUN.Abp.Notifications; -using System.Threading.Tasks; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; - -namespace LINGYUN.Abp.MessageService.Notifications -{ - public interface INotificationAppService : IApplicationService - { - /// - /// 查询通知明细 - /// - /// - /// - Task GetAsync(NotificationGetByIdDto notificationGetById); - /// - /// 删除通知 - /// - /// - /// - Task DeleteAsync(NotificationGetByIdDto notificationGetById); - /// - /// 删除用户通知 - /// - /// - /// - Task DeleteUserNotificationAsync(NotificationGetByIdDto notificationGetById); - /// - /// 变更通知阅读状态 - /// - /// - /// - Task ChangeUserNotificationReadStateAsync(UserNotificationChangeReadStateDto userNotificationChangeRead); - /// - /// 获取用户通知列表 - /// - /// - /// - Task> GetUserNotificationsAsync(UserNotificationGetByPagedDto userNotificationGetByPaged); - } -} diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Permissions/MessageServicePermissions.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Permissions/MessageServicePermissions.cs index ed5372ad5..a6aadc2c2 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Permissions/MessageServicePermissions.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Permissions/MessageServicePermissions.cs @@ -10,5 +10,12 @@ public const string Delete = Default + ".Delete"; } + + public class Hangfire + { + public const string Default = GroupName + ".Hangfire"; + + public const string ManageQueue = Default + ".ManageQueue"; + } } } diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Permissions/MessageServicePermissionsDefinitionProvider.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Permissions/MessageServicePermissionsDefinitionProvider.cs index d3417252d..b0f3e01dd 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Permissions/MessageServicePermissionsDefinitionProvider.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Permissions/MessageServicePermissionsDefinitionProvider.cs @@ -12,6 +12,9 @@ namespace LINGYUN.Abp.MessageService.Permissions 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.ManageQueue, L("Permission:ManageQueue")); } private static LocalizableString L(string name) diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Subscriptions/Dto/SubscriptionsGetByNameDto.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Subscriptions/Dto/SubscriptionsGetByNameDto.cs index f5bfcface..b4ceaad64 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Subscriptions/Dto/SubscriptionsGetByNameDto.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Subscriptions/Dto/SubscriptionsGetByNameDto.cs @@ -7,6 +7,6 @@ namespace LINGYUN.Abp.MessageService.Subscriptions { [Required] [StringLength(NotificationConsts.MaxNameLength)] - public string NotificationName { get; set; } + public string Name { get; set; } } } diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Subscriptions/Dto/UserSubscreNotificationDto.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Subscriptions/Dto/UserSubscreNotificationDto.cs new file mode 100644 index 000000000..6e47e7823 --- /dev/null +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Subscriptions/Dto/UserSubscreNotificationDto.cs @@ -0,0 +1,7 @@ +namespace LINGYUN.Abp.MessageService.Subscriptions +{ + public class UserSubscreNotificationDto + { + public string Name { get; set; } + } +} diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Subscriptions/Dto/UserSubscriptionsResult.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Subscriptions/Dto/UserSubscriptionsResult.cs new file mode 100644 index 000000000..495c2dd04 --- /dev/null +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Subscriptions/Dto/UserSubscriptionsResult.cs @@ -0,0 +1,22 @@ +namespace LINGYUN.Abp.MessageService.Subscriptions +{ + public class UserSubscriptionsResult + { + public bool IsSubscribed { get; } + + public UserSubscriptionsResult(bool isSubscribed) + { + IsSubscribed = isSubscribed; + } + + public static UserSubscriptionsResult Subscribed() + { + return new UserSubscriptionsResult(true); + } + + public static UserSubscriptionsResult UnSubscribed() + { + return new UserSubscriptionsResult(false); + } + } +} diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Subscriptions/IMySubscriptionAppService.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Subscriptions/IMySubscriptionAppService.cs new file mode 100644 index 000000000..c22d53b39 --- /dev/null +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Subscriptions/IMySubscriptionAppService.cs @@ -0,0 +1,39 @@ +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; + +namespace LINGYUN.Abp.MessageService.Subscriptions +{ + public interface IMySubscriptionAppService : IApplicationService + { + /// + /// 是否已订阅消息 + /// + /// + /// + Task IsSubscribedAsync(SubscriptionsGetByNameDto input); + /// + /// 订阅消息 + /// + /// + /// + Task SubscribeAsync(SubscriptionsGetByNameDto input); + /// + /// 退订消息 + /// + /// + /// + Task UnSubscribeAsync(SubscriptionsGetByNameDto input); + /// + /// 获取订阅列表 + /// + /// + /// + Task> GetListAsync(SubscriptionsGetByPagedDto input); + /// + /// 获取所有订阅列表 + /// + /// + Task> GetAllListAsync(); + } +} diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Subscriptions/ISubscriptionAppService.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Subscriptions/ISubscriptionAppService.cs deleted file mode 100644 index d1ec7eeab..000000000 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application.Contracts/LINGYUN/Abp/MessageService/Subscriptions/ISubscriptionAppService.cs +++ /dev/null @@ -1,35 +0,0 @@ -using LINGYUN.Abp.Notifications; -using System.Threading.Tasks; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; - -namespace LINGYUN.Abp.MessageService.Subscriptions -{ - public interface ISubscriptionAppService : IApplicationService - { - /// - /// 是否已订阅消息 - /// - /// - /// - Task IsSubscribedAsync(SubscriptionsGetByNameDto subscriptionsGetByName); - /// - /// 订阅消息 - /// - /// - /// - Task SubscribeAsync(SubscriptionsGetByNameDto subscriptionsGetByName); - /// - /// 退订消息 - /// - /// - /// - Task UnSubscribeAsync(SubscriptionsGetByNameDto subscriptionsGetByName); - /// - /// 获取订阅列表 - /// - /// - /// - Task> GetSubscribedsAsync(SubscriptionsGetByPagedDto subscriptionsGetByPaged); - } -} diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Chat/MyFriendAppService.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Chat/MyFriendAppService.cs index d8254233a..501ebd55b 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Chat/MyFriendAppService.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Chat/MyFriendAppService.cs @@ -1,4 +1,5 @@ using LINGYUN.Abp.IM.Contract; +using LINGYUN.Abp.MessageService.Localization; using Microsoft.AspNetCore.Authorization; using System.Threading.Tasks; using Volo.Abp.Application.Dtos; @@ -12,14 +13,28 @@ namespace LINGYUN.Abp.MessageService.Chat { protected IFriendStore FriendStore { get; } - public MyFriendAppService(IFriendStore friendStore) + protected IUserChatCardRepository UserChatCardRepository { get; } + + public MyFriendAppService( + IFriendStore friendStore, + IUserChatCardRepository userChatCardRepository) { FriendStore = friendStore; + UserChatCardRepository = userChatCardRepository; + + LocalizationResource = typeof(MessageServiceResource); } public virtual async Task CreateAsync(MyFriendCreateDto input) { - await FriendStore.AddMemberAsync(CurrentTenant.Id, CurrentUser.GetId(), input.FriendId, input.RemarkName); + var friendCard = await UserChatCardRepository.GetMemberAsync(input.FriendId); + + await FriendStore.AddMemberAsync(CurrentTenant.Id, CurrentUser.GetId(), input.FriendId, friendCard?.NickName ?? friendCard?.UserName ?? input.FriendId.ToString()); + } + + public virtual async Task AddRequestAsync(MyFriendAddRequestDto input) + { + await FriendStore.AddRequestAsync(CurrentTenant.Id, CurrentUser.GetId(), input.FriendId, input.RemarkName, L["AddNewFriendBySearchId"]); } public virtual async Task DeleteAsync(MyFriendOperationDto input) diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Notifications/MyNotificationAppService.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Notifications/MyNotificationAppService.cs new file mode 100644 index 000000000..d8c1c43ea --- /dev/null +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Notifications/MyNotificationAppService.cs @@ -0,0 +1,119 @@ +using LINGYUN.Abp.Notifications; +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; +using Volo.Abp.Users; + +namespace LINGYUN.Abp.MessageService.Notifications +{ + public class MyNotificationAppService : ApplicationService, IMyNotificationAppService + { + protected INotificationSender NotificationSender { get; } + + protected INotificationStore NotificationStore { get; } + + protected INotificationDefinitionManager NotificationDefinitionManager { get; } + + public MyNotificationAppService( + INotificationStore notificationStore, + INotificationSender notificationSender, + INotificationDefinitionManager notificationDefinitionManager) + { + NotificationStore = notificationStore; + NotificationSender = notificationSender; + NotificationDefinitionManager = notificationDefinitionManager; + } + + public virtual async Task SendNofiterAsync(NotificationSendDto input) + { + UserIdentifier user = null; + if (input.ToUserId.HasValue) + { + user = new UserIdentifier(input.ToUserId.Value, input.ToUserName); + } + await NotificationSender + .SendNofiterAsync( + input.Name, + input.Data, + user, + CurrentTenant.Id, + input.Severity); + } + + public virtual async Task DeleteAsync(long id) + { + await NotificationStore + .DeleteUserNotificationAsync( + CurrentTenant.Id, + CurrentUser.GetId(), + id); + } + + public virtual Task> GetAssignableNotifiersAsync() + { + var groups = new List(); + + foreach (var group in NotificationDefinitionManager.GetGroups()) + { + if (!group.AllowSubscriptionToClients) + { + continue; + + } + var notificationGroup = new NotificationGroupDto + { + Name = group.Name, + DisplayName = group.DisplayName.Localize(StringLocalizerFactory) + }; + + foreach (var notification in group.Notifications) + { + if (!notification.AllowSubscriptionToClients) + { + continue; + } + + var notificationChildren = new NotificationDto + { + Name = notification.Name, + DisplayName = notification.DisplayName.Localize(StringLocalizerFactory), + Description = notification.Description.Localize(StringLocalizerFactory), + Lifetime = notification.NotificationLifetime, + Type = notification.NotificationType + }; + + notificationGroup.Notifications.Add(notificationChildren); + } + + groups.Add(notificationGroup); + } + + return Task.FromResult(new ListResultDto(groups)); + } + + public virtual async Task GetAsync(long id) + { + return await NotificationStore + .GetNotificationOrNullAsync(CurrentTenant.Id, id); + } + + public virtual async Task> GetListAsync(UserNotificationGetByPagedDto input) + { + var notificationCount = await NotificationStore + .GetUserNotificationsCountAsync( + CurrentTenant.Id, + CurrentUser.GetId(), + input.Filter, + input.ReadState); + + var notifications = await NotificationStore + .GetUserNotificationsAsync( + CurrentTenant.Id, CurrentUser.GetId(), + input.Filter, input.Sorting, input.Reverse, + input.ReadState, input.SkipCount, input.MaxResultCount); + + return new PagedResultDto(notificationCount, notifications); + } + } +} diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Notifications/NotificationAppService.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Notifications/NotificationAppService.cs deleted file mode 100644 index f7be4921e..000000000 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Notifications/NotificationAppService.cs +++ /dev/null @@ -1,68 +0,0 @@ -using LINGYUN.Abp.MessageService.Permissions; -using LINGYUN.Abp.Notifications; -using Microsoft.AspNetCore.Authorization; -using System.Collections.Generic; -using System.Threading.Tasks; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; -using Volo.Abp.Users; - -namespace LINGYUN.Abp.MessageService.Notifications -{ - [Authorize] - public class NotificationAppService : ApplicationService, INotificationAppService - { - private readonly INotificationRepository _notificationRepository; - private readonly IUserNotificationRepository _userNotificationRepository; - public NotificationAppService( - INotificationRepository notificationRepository, - IUserNotificationRepository userNotificationRepository) - { - _notificationRepository = notificationRepository; - _userNotificationRepository = userNotificationRepository; - } - - public virtual async Task ChangeUserNotificationReadStateAsync(UserNotificationChangeReadStateDto userNotificationChangeRead) - { - await _userNotificationRepository.ChangeUserNotificationReadStateAsync( - CurrentUser.GetId(), userNotificationChangeRead.NotificationId, userNotificationChangeRead.ReadState); - - } - - [Authorize(MessageServicePermissions.Notification.Delete)] - public virtual async Task DeleteAsync(NotificationGetByIdDto notificationGetById) - { - await _notificationRepository.DeleteAsync(notificationGetById.NotificationId); - } - - public virtual async Task DeleteUserNotificationAsync(NotificationGetByIdDto notificationGetById) - { - var notify = await _userNotificationRepository - .GetByIdAsync(CurrentUser.GetId(), notificationGetById.NotificationId); - await _userNotificationRepository.DeleteAsync(notify.Id); - } - - public virtual async Task GetAsync(NotificationGetByIdDto notificationGetById) - { - var notification = await _notificationRepository.GetByIdAsync(notificationGetById.NotificationId); - - return ObjectMapper.Map(notification); - } - - public virtual async Task> GetUserNotificationsAsync(UserNotificationGetByPagedDto userNotificationGetByPaged) - { - var notificationCount = await _userNotificationRepository - .GetCountAsync(CurrentUser.GetId(), userNotificationGetByPaged.Filter, - userNotificationGetByPaged.ReadState); - - var notifications = await _userNotificationRepository - .GetNotificationsAsync(CurrentUser.GetId(), userNotificationGetByPaged.Filter, - userNotificationGetByPaged.Sorting, userNotificationGetByPaged.ReadState, - userNotificationGetByPaged.SkipCount, userNotificationGetByPaged.MaxResultCount - ); - - return new PagedResultDto(notificationCount, - ObjectMapper.Map, List>(notifications)); - } - } -} diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Subscriptions/MySubscriptionAppService.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Subscriptions/MySubscriptionAppService.cs new file mode 100644 index 000000000..77f3db9fc --- /dev/null +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Subscriptions/MySubscriptionAppService.cs @@ -0,0 +1,76 @@ +using LINGYUN.Abp.Notifications; +using Microsoft.AspNetCore.Authorization; +using System.Linq; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; +using Volo.Abp.Users; + +namespace LINGYUN.Abp.MessageService.Subscriptions +{ + [Authorize] + public class MySubscriptionAppService : ApplicationService, IMySubscriptionAppService + { + protected IUserSubscribeRepository UserSubscribeRepository { get; } + protected INotificationSubscriptionManager NotificationSubscriptionManager { get; } + + public MySubscriptionAppService( + IUserSubscribeRepository userSubscribeRepository, + INotificationSubscriptionManager notificationSubscriptionManager) + { + UserSubscribeRepository = userSubscribeRepository; + NotificationSubscriptionManager = notificationSubscriptionManager; + } + + public virtual async Task> GetListAsync(SubscriptionsGetByPagedDto input) + { + var userSubscribedCount = await UserSubscribeRepository.GetCountAsync(CurrentUser.GetId()); + + var userSubscribes = await UserSubscribeRepository + .GetUserSubscribesAsync(CurrentUser.GetId(), input.Sorting, + input.SkipCount, input.MaxResultCount); + + return new PagedResultDto(userSubscribedCount, + userSubscribes.Select(us => new UserSubscreNotificationDto { Name = us.NotificationName }).ToList()); + } + + public virtual async Task> GetAllListAsync() + { + var userSubscribes = await NotificationSubscriptionManager + .GetUserSubscriptionsAsync( + CurrentTenant.Id, + CurrentUser.GetId()); + + return new ListResultDto( + userSubscribes.Select(msn => new UserSubscreNotificationDto { Name = msn.NotificationName }).ToList()); + } + + public virtual async Task IsSubscribedAsync(SubscriptionsGetByNameDto input) + { + var isSubscribed = await NotificationSubscriptionManager + .IsSubscribedAsync(CurrentTenant.Id, CurrentUser.GetId(), input.Name); + + return isSubscribed + ? UserSubscriptionsResult.Subscribed() + : UserSubscriptionsResult.UnSubscribed(); + } + + public virtual async Task SubscribeAsync(SubscriptionsGetByNameDto input) + { + await NotificationSubscriptionManager + .SubscribeAsync( + CurrentTenant.Id, + new UserIdentifier(CurrentUser.GetId(), CurrentUser.UserName), + input.Name); + } + + public virtual async Task UnSubscribeAsync(SubscriptionsGetByNameDto input) + { + await NotificationSubscriptionManager + .UnsubscribeAsync( + CurrentTenant.Id, + new UserIdentifier(CurrentUser.GetId(), CurrentUser.UserName), + input.Name); + } + } +} diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Subscriptions/SubscriptionAppService.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Subscriptions/SubscriptionAppService.cs deleted file mode 100644 index bc198af4d..000000000 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Subscriptions/SubscriptionAppService.cs +++ /dev/null @@ -1,65 +0,0 @@ -using LINGYUN.Abp.Notifications; -using Microsoft.AspNetCore.Authorization; -using System.Collections.Generic; -using System.Threading.Tasks; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; -using Volo.Abp.Users; - -namespace LINGYUN.Abp.MessageService.Subscriptions -{ - [Authorize] - public class SubscriptionAppService : ApplicationService, ISubscriptionAppService - { - private readonly IUserSubscribeRepository _userSubscribeRepository; - - public SubscriptionAppService( - IUserSubscribeRepository userSubscribeRepository) - { - _userSubscribeRepository = userSubscribeRepository; - } - - public virtual async Task> GetSubscribedsAsync(SubscriptionsGetByPagedDto subscriptionsGetByPaged) - { - var userSubscribedCount = await _userSubscribeRepository.GetCountAsync(CurrentUser.GetId()); - - var userSubscribes = await _userSubscribeRepository - .GetUserSubscribesAsync(CurrentUser.GetId(), subscriptionsGetByPaged.Sorting, - subscriptionsGetByPaged.SkipCount, subscriptionsGetByPaged.MaxResultCount); - - return new PagedResultDto(userSubscribedCount, - ObjectMapper.Map, List>(userSubscribes)); - } - - public virtual async Task IsSubscribedAsync(SubscriptionsGetByNameDto subscriptionsGetByName) - { - var isSubscribed = await _userSubscribeRepository - .UserSubscribeExistsAysnc(subscriptionsGetByName.NotificationName, CurrentUser.GetId()); - - return isSubscribed; - } - - public virtual async Task SubscribeAsync(SubscriptionsGetByNameDto subscriptionsGetByName) - { - var isSubscribed = await _userSubscribeRepository - .UserSubscribeExistsAysnc(subscriptionsGetByName.NotificationName, CurrentUser.GetId()); - if (!isSubscribed) - { - UserSubscribe userSubscribe = new UserSubscribe( - subscriptionsGetByName.NotificationName, - CurrentUser.GetId(), CurrentUser.UserName, CurrentTenant.Id); - - await _userSubscribeRepository.InsertAsync(userSubscribe, true); - } - } - - public virtual async Task UnSubscribeAsync(SubscriptionsGetByNameDto subscriptionsGetByName) - { - var userSubscribe = await _userSubscribeRepository.GetUserSubscribeAsync(subscriptionsGetByName.NotificationName, CurrentUser.GetId()); - if (userSubscribe != null) - { - await _userSubscribeRepository.DeleteAsync(userSubscribe.Id, true); - } - } - } -} diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN.Abp.MessageService.Domain.Shared.csproj b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN.Abp.MessageService.Domain.Shared.csproj index 5c97ed0c0..bad5d57b0 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN.Abp.MessageService.Domain.Shared.csproj +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN.Abp.MessageService.Domain.Shared.csproj @@ -12,4 +12,8 @@ + + + + diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Chat/UserChatFriendConsts.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Chat/UserChatFriendConsts.cs new file mode 100644 index 000000000..6960f4e7b --- /dev/null +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/Chat/UserChatFriendConsts.cs @@ -0,0 +1,8 @@ +namespace LINGYUN.Abp.MessageService.Chat +{ + public static class UserChatFriendConsts + { + public static int MaxRemarkNameLength { get; set; } = UserChatCardConsts.MaxUserNameLength; + public static int MaxDescriptionLength { get; set; } = UserChatCardConsts.MaxDescriptionLength; + } +} diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/ObjectExtending/MessageServiceModuleExtensionConfiguration.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/ObjectExtending/MessageServiceModuleExtensionConfiguration.cs new file mode 100644 index 000000000..79b16fe9d --- /dev/null +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/ObjectExtending/MessageServiceModuleExtensionConfiguration.cs @@ -0,0 +1,17 @@ +using System; +using Volo.Abp.ObjectExtending.Modularity; + +namespace LINGYUN.Abp.MessageService.ObjectExtending +{ + public class MessageServiceModuleExtensionConfiguration : ModuleExtensionConfiguration + { + public MessageServiceModuleExtensionConfiguration ConfigureMessage( + Action configureAction) + { + return this.ConfigureEntity( + MessageServiceModuleExtensionConsts.EntityNames.Message, + configureAction + ); + } + } +} diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/ObjectExtending/MessageServiceModuleExtensionConfigurationDictionaryExtensions.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/ObjectExtending/MessageServiceModuleExtensionConfigurationDictionaryExtensions.cs new file mode 100644 index 000000000..61ed02e29 --- /dev/null +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/ObjectExtending/MessageServiceModuleExtensionConfigurationDictionaryExtensions.cs @@ -0,0 +1,18 @@ +using System; +using Volo.Abp.ObjectExtending.Modularity; + +namespace LINGYUN.Abp.MessageService.ObjectExtending +{ + public static class MessageServiceModuleExtensionConfigurationDictionaryExtensions + { + public static ModuleExtensionConfigurationDictionary ConfigureMessage( + this ModuleExtensionConfigurationDictionary modules, + Action configureAction) + { + return modules.ConfigureModule( + MessageServiceModuleExtensionConsts.ModuleName, + configureAction + ); + } + } +} diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/ObjectExtending/MessageServiceModuleExtensionConsts.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/ObjectExtending/MessageServiceModuleExtensionConsts.cs new file mode 100644 index 000000000..c38cffe54 --- /dev/null +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain.Shared/LINGYUN/Abp/MessageService/ObjectExtending/MessageServiceModuleExtensionConsts.cs @@ -0,0 +1,12 @@ +namespace LINGYUN.Abp.MessageService.ObjectExtending +{ + public static class MessageServiceModuleExtensionConsts + { + public const string ModuleName = "MessageService"; + + public static class EntityNames + { + public const string Message = "Message"; + } + } +} diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/AbpMessageServiceDomainModule.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/AbpMessageServiceDomainModule.cs index bf0a3429c..2f19e44ef 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/AbpMessageServiceDomainModule.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/AbpMessageServiceDomainModule.cs @@ -1,10 +1,13 @@ -using LINGYUN.Abp.MessageService.Localization; +using LINGYUN.Abp.MessageService.Chat; +using LINGYUN.Abp.MessageService.Localization; using LINGYUN.Abp.MessageService.Mapper; +using LINGYUN.Abp.MessageService.ObjectExtending; using Volo.Abp.AutoMapper; using Volo.Abp.Caching; using Volo.Abp.Localization; using Volo.Abp.Localization.ExceptionHandling; using Volo.Abp.Modularity; +using Volo.Abp.ObjectExtending.Modularity; using Volo.Abp.VirtualFileSystem; namespace LINGYUN.Abp.MessageService @@ -36,10 +39,17 @@ namespace LINGYUN.Abp.MessageService Configure(options => { - options.MapCodeNamespace("Messages.Group", typeof(MessageServiceResource)); - options.MapCodeNamespace("Messages.User", typeof(MessageServiceResource)); - options.MapCodeNamespace("Messages.UserFriend", typeof(MessageServiceResource)); + options.MapCodeNamespace(MessageServiceErrorCodes.Namespace, typeof(MessageServiceResource)); }); } + + public override void PostConfigureServices(ServiceConfigurationContext context) + { + ModuleExtensionConfigurationHelper.ApplyEntityConfigurationToEntity( + MessageServiceModuleExtensionConsts.ModuleName, + MessageServiceModuleExtensionConsts.EntityNames.Message, + typeof(Message) + ); + } } } diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/FriendStore.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/FriendStore.cs index 8690a36b1..04e744451 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/FriendStore.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/FriendStore.cs @@ -2,54 +2,101 @@ using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; +using System.Threading; using System.Threading.Tasks; using Volo.Abp; using Volo.Abp.Caching; -using Volo.Abp.Domain.Services; +using Volo.Abp.DependencyInjection; +using Volo.Abp.MultiTenancy; +using Volo.Abp.Timing; using Volo.Abp.Uow; namespace LINGYUN.Abp.MessageService.Chat { - public class FriendStore : DomainService, IFriendStore + public class FriendStore : IFriendStore, ITransientDependency { - protected IDistributedCache Cache { get; } - protected IUserChatFriendRepository UserChatFriendRepository { get; } - protected IUserChatSettingRepository UserChatSettingRepository { get; } + 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) + IUserChatSettingRepository userChatSettingRepository + ) { - Cache = cache; - UserChatFriendRepository = userChatFriendRepository; - UserChatSettingRepository = userChatSettingRepository; + _clock = clock; + _cache = cache; + _logger = logger; + _currentTenant = currentTenant; + _userChatFriendRepository = userChatFriendRepository; + _userChatSettingRepository = userChatSettingRepository; } public virtual async Task IsFriendAsync( Guid? tenantId, Guid userId, - Guid friendId + Guid friendId, + CancellationToken cancellationToken = default ) { - using (CurrentTenant.Change(tenantId)) + using (_currentTenant.Change(tenantId)) { - return await UserChatFriendRepository.IsAddedAsync(userId, friendId); + return await _userChatFriendRepository.IsFriendAsync(userId, friendId, cancellationToken); } } [UnitOfWork] - public virtual async Task AddMemberAsync(Guid? tenantId, Guid userId, Guid friendId, string remarkName = "") + public virtual async Task AddMemberAsync( + Guid? tenantId, + Guid userId, + Guid friendId, + string remarkName = "", + 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); + + await _userChatFriendRepository.InsertAsync(userFriend); + } + + var userChatFriend = await _userChatFriendRepository + .FindByUserFriendIdAsync(friendId, userId); + + userChatFriend.SetStatus(UserFriendStatus.Added); + + await _userChatFriendRepository.UpdateAsync(userChatFriend, cancellationToken: cancellationToken); + } + } + + [UnitOfWork] + public virtual async Task AddRequestAsync( + Guid? tenantId, + Guid userId, + Guid friendId, + string remarkName = "", + string description = "", + CancellationToken cancellationToken = default) + { + using (_currentTenant.Change(tenantId)) + { + if (await _userChatFriendRepository.IsAddedAsync(userId, friendId)) { throw new BusinessException(MessageServiceErrorCodes.UseHasBeenAddedTheFriendOrSendAuthorization); } var status = UserFriendStatus.NeedValidation; - var userChatSetting = await UserChatSettingRepository.FindByUserIdAsync(friendId); + var userChatSetting = await _userChatSettingRepository.FindByUserIdAsync(friendId, cancellationToken); if (userChatSetting != null) { if (!userChatSetting.AllowAddFriend) @@ -62,50 +109,71 @@ namespace LINGYUN.Abp.MessageService.Chat : UserFriendStatus.Added; } - var userChatFriend = new UserChatFriend(userId, friendId, remarkName, status, tenantId) + var userChatFriend = new UserChatFriend(userId, friendId, remarkName, description, tenantId) { - CreationTime = Clock.Now, - CreatorId = userId + CreationTime = _clock.Now, + CreatorId = userId, }; + userChatFriend.SetStatus(status); - await UserChatFriendRepository.InsertAsync(userChatFriend); + await _userChatFriendRepository.InsertAsync(userChatFriend, cancellationToken: cancellationToken); return new UserAddFriendResult(status); } } [UnitOfWork] - public virtual async Task AddShieldMemberAsync(Guid? tenantId, Guid userId, Guid friendId) + public virtual async Task AddShieldMemberAsync( + Guid? tenantId, + Guid userId, + Guid friendId, + CancellationToken cancellationToken = default) { - await ChangeFriendShieldAsync(tenantId, userId, friendId, true); + await ChangeFriendShieldAsync(tenantId, userId, friendId, true, cancellationToken); } public virtual async Task> GetListAsync( Guid? tenantId, Guid userId, string sorting = nameof(UserFriend.UserId), - bool reverse = false + bool reverse = false, + CancellationToken cancellationToken = default ) { - return await GetAllFriendByCacheItemAsync(tenantId, userId, sorting, reverse); + using (_currentTenant.Change(tenantId)) + { + return await GetAllFriendByCacheItemAsync(userId, sorting, reverse, cancellationToken); + } } - public virtual async Task GetCountAsync(Guid? tenantId, Guid userId, string filter = "") + public virtual async 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); + return await _userChatFriendRepository + .GetMembersCountAsync(userId, filter, cancellationToken); } } - public virtual async Task> GetPagedListAsync(Guid? tenantId, Guid userId, string filter = "", string sorting = nameof(UserFriend.UserId), bool reverse = false, int skipCount = 0, int maxResultCount = 10) + public virtual async Task> GetPagedListAsync( + Guid? tenantId, + Guid userId, + string filter = "", + string sorting = nameof(UserFriend.UserId), + bool reverse = false, + int skipCount = 0, + int maxResultCount = 10, + CancellationToken cancellationToken = default) { - using (CurrentTenant.Change(tenantId)) + using (_currentTenant.Change(tenantId)) { - return await UserChatFriendRepository + return await _userChatFriendRepository .GetMembersAsync(userId, filter, sorting, reverse, - skipCount, maxResultCount); + skipCount, maxResultCount, cancellationToken); } } @@ -113,85 +181,100 @@ namespace LINGYUN.Abp.MessageService.Chat Guid? tenantId, Guid userId, int skipCount = 0, - int maxResultCount = 10) + int maxResultCount = 10, + CancellationToken cancellationToken = default) { - using (CurrentTenant.Change(tenantId)) + using (_currentTenant.Change(tenantId)) { - return await UserChatFriendRepository + return await _userChatFriendRepository .GetLastContactMembersAsync(userId, - skipCount, maxResultCount); + skipCount, maxResultCount, cancellationToken); } } - public virtual async Task GetMemberAsync(Guid? tenantId, Guid userId, Guid friendId) + public virtual async 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); + return await _userChatFriendRepository + .GetMemberAsync(userId, friendId, cancellationToken); } } [UnitOfWork] - public virtual async Task RemoveMemberAsync(Guid? tenantId, Guid userId, Guid friendId) + public virtual async 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); + var userChatFriend = await _userChatFriendRepository.FindByUserFriendIdAsync(userId, friendId, cancellationToken); if (userChatFriend != null) { - await UserChatFriendRepository.DeleteAsync(userChatFriend); + await _userChatFriendRepository.DeleteAsync(userChatFriend, cancellationToken: cancellationToken); } } } [UnitOfWork] - public virtual async Task RemoveShieldMemberAsync(Guid? tenantId, Guid userId, Guid friendId) + public virtual async Task RemoveShieldMemberAsync( + Guid? tenantId, + Guid userId, + Guid friendId, + CancellationToken cancellationToken = default) { - await ChangeFriendShieldAsync(tenantId, userId, friendId, false); + await ChangeFriendShieldAsync(tenantId, userId, friendId, false, cancellationToken); } - protected virtual async Task ChangeFriendShieldAsync(Guid? tenantId, Guid userId, Guid friendId, bool isBlack = false) + protected virtual async 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); + var userChatFriend = await _userChatFriendRepository.FindByUserFriendIdAsync(userId, friendId, cancellationToken); if (userChatFriend != null) { userChatFriend.Black = isBlack; - await UserChatFriendRepository.UpdateAsync(userChatFriend); + await _userChatFriendRepository.UpdateAsync(userChatFriend, cancellationToken: cancellationToken); } } } protected virtual async Task> GetAllFriendByCacheItemAsync( - Guid? tenantId, Guid userId, string sorting = nameof(UserFriend.UserId), - bool reverse = false + bool reverse = false, + CancellationToken cancellationToken = default ) { var cacheKey = UserFriendCacheItem.CalculateCacheKey(userId.ToString()); - Logger.LogDebug($"FriendStore.GetCacheItemAsync: {cacheKey}"); + _logger.LogDebug($"FriendStore.GetCacheItemAsync: {cacheKey}"); - var cacheItem = await Cache.GetAsync(cacheKey); + var cacheItem = await _cache.GetAsync(cacheKey, token: cancellationToken); if (cacheItem != null) { - Logger.LogDebug($"Found in the cache: {cacheKey}"); + _logger.LogDebug($"Found in the cache: {cacheKey}"); return cacheItem.Friends; } - Logger.LogDebug($"Not found in the cache: {cacheKey}"); - using (CurrentTenant.Change(tenantId)) - { - var friends = await UserChatFriendRepository - .GetAllMembersAsync(userId, sorting, reverse); - cacheItem = new UserFriendCacheItem(friends); - Logger.LogDebug($"Set item in the cache: {cacheKey}"); - await Cache.SetAsync(cacheKey, cacheItem); - return friends; - } + _logger.LogDebug($"Not found in the cache: {cacheKey}"); + var friends = await _userChatFriendRepository + .GetAllMembersAsync(userId, sorting, reverse, 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/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatFriendRepository.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatFriendRepository.cs index af38f03b5..debc5aa57 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatFriendRepository.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatFriendRepository.cs @@ -9,11 +9,16 @@ namespace LINGYUN.Abp.MessageService.Chat { public interface IUserChatFriendRepository : IBasicRepository { - Task IsAddedAsync( + Task IsFriendAsync( Guid userId, Guid frientId, CancellationToken cancellationToken = default); + Task IsAddedAsync( + Guid userId, + Guid frientId, + CancellationToken cancellationToken = default); + Task FindByUserFriendIdAsync( Guid userId, Guid friendId, diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatSettingRepository.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatSettingRepository.cs index 6ad18ae70..4941ec873 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatSettingRepository.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/IUserChatSettingRepository.cs @@ -1,4 +1,5 @@ using System; +using System.Threading; using System.Threading.Tasks; using Volo.Abp.Domain.Repositories; @@ -6,7 +7,7 @@ namespace LINGYUN.Abp.MessageService.Chat { public interface IUserChatSettingRepository : IBasicRepository { - Task UserHasOpendImAsync(Guid userId); - Task FindByUserIdAsync(Guid userId); + Task UserHasOpendImAsync(Guid userId, CancellationToken cancellationToken = default); + Task FindByUserIdAsync(Guid userId, CancellationToken cancellationToken = default); } } diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/Message.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/Message.cs index 07bf27d25..bee4de691 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/Message.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/Message.cs @@ -1,11 +1,12 @@ using LINGYUN.Abp.IM.Messages; using System; +using Volo.Abp.Data; using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.MultiTenancy; namespace LINGYUN.Abp.MessageService.Chat { - public abstract class Message : CreationAuditedEntity, IMultiTenant + public abstract class Message : CreationAuditedAggregateRoot, IMultiTenant { /// /// 租户 diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/MessageStore.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/MessageStore.cs index 42a64f200..d632e16b3 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/MessageStore.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/MessageStore.cs @@ -4,57 +4,72 @@ using LINGYUN.Abp.MessageService.Group; using LINGYUN.Abp.MessageService.Utils; using System; using System.Collections.Generic; +using System.Threading; using System.Threading.Tasks; using Volo.Abp; -using Volo.Abp.Domain.Services; +using Volo.Abp.DependencyInjection; +using Volo.Abp.MultiTenancy; +using Volo.Abp.ObjectExtending; using Volo.Abp.ObjectMapping; using Volo.Abp.Uow; namespace LINGYUN.Abp.MessageService.Chat { - public class MessageStore : DomainService, IMessageStore + public class MessageStore : IMessageStore, ITransientDependency { - private IFriendStore _friendStore; - protected IFriendStore FriendStore => LazyGetRequiredService(ref _friendStore); - - private IObjectMapper _objectMapper; - protected IObjectMapper ObjectMapper => LazyGetRequiredService(ref _objectMapper); - - private IUnitOfWorkManager _unitOfWorkManager; - protected IUnitOfWorkManager UnitOfWorkManager => LazyGetRequiredService(ref _unitOfWorkManager); - protected IUserChatSettingRepository UserChatSettingRepository { get; } - protected IMessageRepository MessageRepository { get; } - protected IGroupRepository GroupRepository { get; } - protected ISnowflakeIdGenerator SnowflakeIdGenerator { get; } + private readonly IFriendStore _friendStore; + + private readonly IObjectMapper _objectMapper; + + private readonly ICurrentTenant _currentTenant; + + private readonly IUnitOfWorkManager _unitOfWorkManager; + + private readonly IGroupRepository _groupRepository; + + private readonly IMessageRepository _messageRepository; + + private readonly ISnowflakeIdGenerator _snowflakeIdGenerator; + + private readonly IUserChatSettingRepository _userChatSettingRepository; public MessageStore( + IFriendStore friendStore, + IObjectMapper objectMapper, + ICurrentTenant currentTenant, + IUnitOfWorkManager unitOfWorkManager, IGroupRepository groupRepository, IMessageRepository messageRepository, ISnowflakeIdGenerator snowflakeIdGenerator, IUserChatSettingRepository userChatSettingRepository) { - GroupRepository = groupRepository; - MessageRepository = messageRepository; - SnowflakeIdGenerator = snowflakeIdGenerator; - UserChatSettingRepository = userChatSettingRepository; + _friendStore = friendStore; + _objectMapper = objectMapper; + _currentTenant = currentTenant; + _unitOfWorkManager = unitOfWorkManager; + _groupRepository = groupRepository; + _messageRepository = messageRepository; + _snowflakeIdGenerator = snowflakeIdGenerator; + _userChatSettingRepository = userChatSettingRepository; } - [UnitOfWork] - public virtual async Task StoreMessageAsync(ChatMessage chatMessage) + public virtual async 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); + await StoreGroupMessageAsync(chatMessage, groupId, cancellationToken); } else { - await StoreUserMessageAsync(chatMessage); + await StoreUserMessageAsync(chatMessage, cancellationToken); } - await unitOfWork.SaveChangesAsync(); + await unitOfWork.SaveChangesAsync(cancellationToken); } } } @@ -67,13 +82,15 @@ namespace LINGYUN.Abp.MessageService.Chat bool reverse = true, MessageType? type = null, int skipCount = 0, - int maxResultCount = 10) + int maxResultCount = 10, + CancellationToken cancellationToken = default) { - using (CurrentTenant.Change(tenantId)) + using (_currentTenant.Change(tenantId)) { - var groupMessages = await MessageRepository - .GetGroupMessagesAsync(groupId, filter, sorting, reverse, type, skipCount, maxResultCount); - var chatMessages = ObjectMapper.Map, List>(groupMessages); + var groupMessages = await _messageRepository + .GetGroupMessagesAsync(groupId, filter, sorting, reverse, type, skipCount, maxResultCount, cancellationToken); + + var chatMessages = _objectMapper.Map, List>(groupMessages); return chatMessages; } @@ -88,13 +105,15 @@ namespace LINGYUN.Abp.MessageService.Chat bool reverse = true, MessageType? type = null, int skipCount = 0, - int maxResultCount = 10) + int maxResultCount = 10, + CancellationToken cancellationToken = default) { - using (CurrentTenant.Change(tenantId)) + using (_currentTenant.Change(tenantId)) { - var userMessages = await MessageRepository - .GetUserMessagesAsync(sendUserId, receiveUserId, filter, sorting, reverse, type, skipCount, maxResultCount); - var chatMessages = ObjectMapper.Map, List>(userMessages); + var userMessages = await _messageRepository + .GetUserMessagesAsync(sendUserId, receiveUserId, filter, sorting, reverse, type, skipCount, maxResultCount, cancellationToken); + + var chatMessages = _objectMapper.Map, List>(userMessages); return chatMessages; } @@ -105,13 +124,14 @@ namespace LINGYUN.Abp.MessageService.Chat Guid userId, string sorting = nameof(LastChatMessage.SendTime), bool reverse = true, - int maxResultCount = 10 + int maxResultCount = 10, + CancellationToken cancellationToken = default ) { - using (CurrentTenant.Change(tenantId)) + using (_currentTenant.Change(tenantId)) { - return await MessageRepository - .GetLastMessagesByOneFriendAsync(userId, sorting, reverse, maxResultCount); + return await _messageRepository + .GetLastMessagesByOneFriendAsync(userId, sorting, reverse, maxResultCount, cancellationToken); } } @@ -119,11 +139,12 @@ namespace LINGYUN.Abp.MessageService.Chat Guid? tenantId, long groupId, string filter = "", - MessageType? type = null) + MessageType? type = null, + CancellationToken cancellationToken = default) { - using (CurrentTenant.Change(tenantId)) + using (_currentTenant.Change(tenantId)) { - return await MessageRepository.GetCountAsync(groupId, filter, type); + return await _messageRepository.GetCountAsync(groupId, filter, type, cancellationToken); } } @@ -132,15 +153,18 @@ namespace LINGYUN.Abp.MessageService.Chat Guid sendUserId, Guid receiveUserId, string filter = "", - MessageType? type = null) + MessageType? type = null, + CancellationToken cancellationToken = default) { - using (CurrentTenant.Change(tenantId)) + using (_currentTenant.Change(tenantId)) { - return await MessageRepository.GetCountAsync(sendUserId, receiveUserId, filter, type); + return await _messageRepository.GetCountAsync(sendUserId, receiveUserId, filter, type, cancellationToken); } } - protected virtual async Task StoreUserMessageAsync(ChatMessage chatMessage) + protected virtual async Task StoreUserMessageAsync( + ChatMessage chatMessage, + CancellationToken cancellationToken = default) { // 检查接收用户 if (!chatMessage.ToUserId.HasValue) @@ -148,9 +172,12 @@ namespace LINGYUN.Abp.MessageService.Chat throw new BusinessException(MessageServiceErrorCodes.UseNotFount); } - var myFriend = await FriendStore.GetMemberAsync(chatMessage.TenantId, chatMessage.ToUserId.Value, chatMessage.FormUserId); + 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); if (userChatSetting != null) { if (!userChatSetting.AllowReceiveMessage) @@ -181,24 +208,30 @@ namespace LINGYUN.Abp.MessageService.Chat { throw new BusinessException(MessageServiceErrorCodes.UserHasBlack); } - var messageId = SnowflakeIdGenerator.Create(); + var messageId = _snowflakeIdGenerator.Create(); var message = new UserMessage(messageId, chatMessage.FormUserId, chatMessage.FormUserName, chatMessage.Content, chatMessage.MessageType); + message.SendToUser(chatMessage.ToUserId.Value); - await MessageRepository.InsertUserMessageAsync(message); + chatMessage.MapExtraPropertiesTo(message); + + await _messageRepository.InsertUserMessageAsync(message, cancellationToken); chatMessage.MessageId = messageId.ToString(); } - protected virtual async Task StoreGroupMessageAsync(ChatMessage chatMessage, long groupId) + protected virtual async Task StoreGroupMessageAsync( + ChatMessage chatMessage, + long groupId, + CancellationToken cancellationToken = default) { - var userHasBlacked = await GroupRepository - .UserHasBlackedAsync(groupId, chatMessage.FormUserId); + var userHasBlacked = await _groupRepository + .UserHasBlackedAsync(groupId, chatMessage.FormUserId, cancellationToken); if (userHasBlacked) { // 当前发送的用户已被拉黑 throw new BusinessException(MessageServiceErrorCodes.GroupUserHasBlack); } - var group = await GroupRepository.GetByIdAsync(groupId); + var group = await _groupRepository.GetByIdAsync(groupId, cancellationToken); if (!group.AllowSendMessage) { // 当前群组不允许发言 @@ -209,11 +242,13 @@ namespace LINGYUN.Abp.MessageService.Chat // 当前群组不允许匿名发言 throw new BusinessException(MessageServiceErrorCodes.GroupNotAllowedToSpeakAnonymously); } - var messageId = SnowflakeIdGenerator.Create(); + var messageId = _snowflakeIdGenerator.Create(); var message = new GroupMessage(messageId, chatMessage.FormUserId, chatMessage.FormUserName, chatMessage.Content, chatMessage.MessageType); message.SendToGroup(groupId); - await MessageRepository.InsertGroupMessageAsync(message); + chatMessage.MapExtraPropertiesTo(message); + + await _messageRepository.InsertGroupMessageAsync(message, cancellationToken); chatMessage.MessageId = messageId.ToString(); } diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserCardFinder.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserCardFinder.cs index 661e0b9bb..8f8a50711 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserCardFinder.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserCardFinder.cs @@ -2,34 +2,38 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; -using Volo.Abp.Domain.Services; +using Volo.Abp.DependencyInjection; +using Volo.Abp.MultiTenancy; namespace LINGYUN.Abp.MessageService.Chat { - public class UserCardFinder : DomainService, IUserCardFinder + public class UserCardFinder : IUserCardFinder, ITransientDependency { - protected IUserChatCardRepository UserChatCardRepository { get; } + private readonly ICurrentTenant _currentTenant; + private readonly IUserChatCardRepository _userChatCardRepository; public UserCardFinder( + ICurrentTenant currentTenant, IUserChatCardRepository userChatCardRepository) { - UserChatCardRepository = userChatCardRepository; + _currentTenant = currentTenant; + _userChatCardRepository = userChatCardRepository; } public virtual async 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 + return await _userChatCardRepository .GetMemberCountAsync(findUserName, startAge, endAge, sex); } } public virtual async Task> GetListAsync(Guid? tenantId, string findUserName = "", int? startAge = null, int? endAge = null, Sex? sex = null, string sorting = nameof(UserCard.UserId), bool reverse = false, int skipCount = 0, int maxResultCount = 10) { - using (CurrentTenant.Change(tenantId)) + using (_currentTenant.Change(tenantId)) { - return await UserChatCardRepository + return await _userChatCardRepository .GetMembersAsync(findUserName, startAge, endAge, sex, sorting, reverse, skipCount, maxResultCount); } @@ -37,9 +41,9 @@ namespace LINGYUN.Abp.MessageService.Chat public virtual async Task GetMemberAsync(Guid? tenantId, Guid findUserId) { - using (CurrentTenant.Change(tenantId)) + using (_currentTenant.Change(tenantId)) { - return await UserChatCardRepository + return await _userChatCardRepository .GetMemberAsync(findUserId); } } diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserChatFriend.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserChatFriend.cs index d964aa0cc..a7e434c08 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserChatFriend.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/UserChatFriend.cs @@ -35,6 +35,10 @@ namespace LINGYUN.Abp.MessageService.Chat /// 备注名称 /// public virtual string RemarkName { get; set; } + /// + /// 附加说明 + /// + public virtual string Description { get; set; } public virtual UserFriendStatus Status { get; protected set; } @@ -46,19 +50,20 @@ namespace LINGYUN.Abp.MessageService.Chat Guid userId, Guid friendId, string remarkName = "", - UserFriendStatus status = UserFriendStatus.NeedValidation, + string description = "", Guid? tenantId = null) { UserId = userId; FrientId = friendId; RemarkName = remarkName; - Status = status; TenantId = tenantId; + Description = description; + Status = UserFriendStatus.NeedValidation; } public void SetStatus(UserFriendStatus status = UserFriendStatus.NeedValidation) { - if (Status == UserFriendStatus.NeedValidation && status == UserFriendStatus.NeedValidation) + if (Status == UserFriendStatus.NeedValidation && status == UserFriendStatus.Added) { // 如果是后续验证通过的需要单独的事件 AddLocalEvent(new UserChatFriendEto diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/EventBus/Local/UserChatFriendEventHandler.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/EventBus/Local/UserChatFriendEventHandler.cs index 5af42b75a..3f1bf0bc7 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/EventBus/Local/UserChatFriendEventHandler.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/EventBus/Local/UserChatFriendEventHandler.cs @@ -1,13 +1,18 @@ using LINGYUN.Abp.IM.Messages; using LINGYUN.Abp.MessageService.Chat; +using LINGYUN.Abp.MessageService.Localization; +using LINGYUN.Abp.MessageService.Notifications; using LINGYUN.Abp.Notifications; -using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Localization; using System; +using System.Collections.Generic; 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.Localization; +using Volo.Abp.Users; namespace LINGYUN.Abp.MessageService.EventBus.Local { @@ -18,30 +23,32 @@ namespace LINGYUN.Abp.MessageService.EventBus.Local ILocalEventHandler, ITransientDependency { - private ILogger _logger; + private IStringLocalizer _stringLocalizer; private IMessageSender _messageSender; - private INotificationDispatcher _dispatcher; + private INotificationSender _notificationSender; private IDistributedCache _cache; + private ICurrentUser _currentUser; public UserChatFriendEventHandler( + ICurrentUser currentUser, IMessageSender messageSender, - INotificationDispatcher dispatcher, - ILogger logger) + INotificationSender notificationSender, + IDistributedCache cache, + IStringLocalizer stringLocalizer) { - _logger = logger; - _dispatcher = dispatcher; + _cache = cache; + _currentUser = currentUser; _messageSender = messageSender; + _stringLocalizer = stringLocalizer; + _notificationSender = notificationSender; } public virtual async Task HandleEventAsync(EntityCreatedEventData eventData) { switch (eventData.Entity.Status) { - case IM.Contract.UserFriendStatus.Added: - await SendFriendAddedMessageAsync(eventData.Entity.UserId, eventData.Entity.FrientId, eventData.Entity.TenantId); - break; case IM.Contract.UserFriendStatus.NeedValidation: - await SendFriendValidationNotiferAsync(eventData.Entity.UserId, eventData.Entity.FrientId, eventData.Entity.TenantId); + await SendFriendValidationNotifierAsync(eventData.Entity); break; } await RemoveUserFriendCacheItemAsync(eventData.Entity.UserId); @@ -68,11 +75,51 @@ namespace LINGYUN.Abp.MessageService.EventBus.Local protected virtual async 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"] + }; + + await _messageSender.SendMessageAsync(addNewFirendMessage); } - protected virtual async Task SendFriendValidationNotiferAsync(Guid userId, Guid friendId, Guid? tenantId = null) + protected virtual async 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); + + await _notificationSender + .SendNofiterAsync( + MessageServiceNotificationNames.IM.FriendValidation, + friendValidationNotifictionData, + userIdentifer, + userChatFriend.TenantId); } protected virtual async Task RemoveUserFriendCacheItemAsync(Guid userId) diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/EventBus/Local/UserCreateJoinIMEventHandler.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/EventBus/Local/UserCreateJoinIMEventHandler.cs index 7ca3728c6..d04b5aa68 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/EventBus/Local/UserCreateJoinIMEventHandler.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/EventBus/Local/UserCreateJoinIMEventHandler.cs @@ -1,8 +1,11 @@ using LINGYUN.Abp.MessageService.Chat; +using LINGYUN.Abp.MessageService.Notifications; +using LINGYUN.Abp.Notifications; using System.Threading.Tasks; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Entities.Events; using Volo.Abp.EventBus; +using Volo.Abp.Uow; using Volo.Abp.Users; namespace LINGYUN.Abp.MessageService.EventBus.Distributed @@ -10,19 +13,45 @@ namespace LINGYUN.Abp.MessageService.EventBus.Distributed public class UserCreateJoinIMEventHandler : ILocalEventHandler>, ITransientDependency { private readonly IChatDataSeeder _chatDataSeeder; + private readonly INotificationSubscriptionManager _notificationSubscriptionManager; public UserCreateJoinIMEventHandler( - IChatDataSeeder chatDataSeeder) + IChatDataSeeder chatDataSeeder, + INotificationSubscriptionManager notificationSubscriptionManager) { _chatDataSeeder = chatDataSeeder; + _notificationSubscriptionManager = notificationSubscriptionManager; } /// /// 接收添加用户事件,初始化IM用户种子 /// /// /// - public async Task HandleEventAsync(EntityCreatedEventData eventData) + [UnitOfWork] + public virtual async Task HandleEventAsync(EntityCreatedEventData eventData) { - await _chatDataSeeder.SeedAsync(eventData.Entity); + await SeedChatDataAsync(eventData.Entity); + } + + protected virtual async Task SeedChatDataAsync(IUserData user) + { + await _chatDataSeeder.SeedAsync(user); + } + + protected virtual async Task SeedUserSubscriptionNotifiersAsync(IUserData user) + { + var userIdentifier = new UserIdentifier(user.Id, user.UserName); + + await _notificationSubscriptionManager + .SubscribeAsync( + user.TenantId, + userIdentifier, + MessageServiceNotificationNames.IM.FriendValidation); + + await _notificationSubscriptionManager + .SubscribeAsync( + user.TenantId, + userIdentifier, + MessageServiceNotificationNames.IM.NewFriend); } } } diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/EventBus/Local/UserCreateSendWelcomeEventHandler.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/EventBus/Local/UserCreateSendWelcomeEventHandler.cs index d2b53d23a..f396b3c1a 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/EventBus/Local/UserCreateSendWelcomeEventHandler.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/EventBus/Local/UserCreateSendWelcomeEventHandler.cs @@ -1,126 +1,63 @@ using LINGYUN.Abp.MessageService.Localization; using LINGYUN.Abp.Notifications; -using Microsoft.Extensions.Localization; using System; -using System.Globalization; using System.Threading.Tasks; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Entities.Events; using Volo.Abp.EventBus; using Volo.Abp.Localization; -using Volo.Abp.Settings; using Volo.Abp.Users; namespace LINGYUN.Abp.MessageService.EventBus { public class UserCreateSendWelcomeEventHandler : ILocalEventHandler>, ITransientDependency { - private readonly ISettingProvider _settingProvider; - private readonly IStringLocalizer _stringLocalizer; - - private readonly INotificationDispatcher _notificationDispatcher; + private readonly INotificationSender _notificationSender; private readonly INotificationSubscriptionManager _notificationSubscriptionManager; - - // 需要模拟用户令牌 - // 是否有必要 - // private readonly ICurrentPrincipalAccessor _currentPrincipalAccessor; public UserCreateSendWelcomeEventHandler( - ISettingProvider settingProvider, - INotificationDispatcher notificationDispatcher, - IStringLocalizer stringLocalizer, + INotificationSender notificationSender, INotificationSubscriptionManager notificationSubscriptionManager - //ICurrentPrincipalAccessor currentPrincipalAccessor ) { - _settingProvider = settingProvider; - _stringLocalizer = stringLocalizer; - - _notificationDispatcher = notificationDispatcher; + _notificationSender = notificationSender; _notificationSubscriptionManager = notificationSubscriptionManager; - - //_currentPrincipalAccessor = currentPrincipalAccessor; } public async Task HandleEventAsync(EntityCreatedEventData eventData) { - // 获取默认语言 - var userDefaultCultureName = await _settingProvider.GetOrNullAsync(LocalizationSettingNames.DefaultLanguage); - if (userDefaultCultureName.IsNullOrWhiteSpace()) - { - userDefaultCultureName = CultureInfo.CurrentUICulture.Name; - // CultureInfo.CurrentCulture = CultureInfo.GetCultureInfo(userDefaultCultureName); - } - using (CultureHelper.Use(userDefaultCultureName, userDefaultCultureName)) - { - var userIdentifer = new UserIdentifier(eventData.Entity.Id, eventData.Entity.UserName); - // 订阅用户欢迎消息 - await _notificationSubscriptionManager.SubscribeAsync(eventData.Entity.TenantId, - userIdentifer, UserNotificationNames.WelcomeToApplication); - - // Store未检查已订阅 - //await _notificationStore.InsertUserSubscriptionAsync(eventData.Entity.TenantId, - // userIdentifer, UserNotificationNames.WelcomeToApplication); - - var userWelcomeNotifictionData = NotificationData.CreateUserNotificationData(eventData.Entity.Id, eventData.Entity.UserName); - - userWelcomeNotifictionData.WriteStandardData( - L("WelcomeToApplicationFormUser", eventData.Entity.Name ?? eventData.Entity.UserName), - L("WelcomeToApplicationFormUser", eventData.Entity.Name ?? eventData.Entity.UserName), + var userIdentifer = new UserIdentifier(eventData.Entity.Id, eventData.Entity.UserName); + // 订阅用户欢迎消息 + await _notificationSubscriptionManager + .SubscribeAsync( + eventData.Entity.TenantId, + userIdentifer, + UserNotificationNames.WelcomeToApplication); + + var userWelcomeNotifictionData = new NotificationData(); + + //userWelcomeNotifictionData.WriteStandardData( + // L("WelcomeToApplicationFormUser", eventData.Entity.Name ?? eventData.Entity.UserName), + // L("WelcomeToApplicationFormUser", eventData.Entity.Name ?? eventData.Entity.UserName), + // DateTime.Now, eventData.Entity.UserName); + + userWelcomeNotifictionData + .WriteLocalizedData( + new LocalizableStringInfo( + LocalizationResourceNameAttribute.GetName(typeof(MessageServiceResource)), + "WelcomeToApplicationFormUser"), + new LocalizableStringInfo( + LocalizationResourceNameAttribute.GetName(typeof(MessageServiceResource)), + "WelcomeToApplicationFormUser"), DateTime.Now, eventData.Entity.UserName); - // 换成用户名称,而不是用户名 - // userWelcomeNotifictionData.Properties["message"] = L("WelcomeToApplicationFormUser", eventData.Entity.Name); - - var noticeNormalizerName = NotificationNameNormalizer.NormalizerName(UserNotificationNames.WelcomeToApplication); - await _notificationDispatcher.DispatchAsync(noticeNormalizerName, userWelcomeNotifictionData, eventData.Entity.TenantId); - } - } - - //public async Task HandleEventAsync(EntityCreatedEventData eventData) - //{ - // // 模拟用户令牌 - // var mockUserPrincipal = new ClaimsPrincipal(); - // var mockUserIdentity = new ClaimsIdentity(); - // mockUserIdentity.AddClaim(new Claim(AbpClaimTypes.UserId, eventData.Entity.Id.ToString())); - // mockUserIdentity.AddClaim(new Claim(AbpClaimTypes.UserName, eventData.Entity.UserName)); - // mockUserIdentity.AddClaim(new Claim(AbpClaimTypes.Email, eventData.Entity.Email)); - // mockUserIdentity.AddClaim(new Claim(AbpClaimTypes.PhoneNumber, eventData.Entity.PhoneNumber)); - // if (eventData.Entity.TenantId.HasValue) - // { - // mockUserIdentity.AddClaim(new Claim(AbpClaimTypes.TenantId, eventData.Entity.TenantId.ToString())); - // } - - // mockUserPrincipal.AddIdentity(mockUserIdentity); - // using (_currentPrincipalAccessor.Change(mockUserPrincipal)) - // { - // // 获取默认语言 - // // TODO: 是否采用系统默认语言而不是用户默认语言? - // var userDefaultCultureName = await _settingProvider.GetOrNullAsync(LocalizationSettingNames.DefaultLanguage); - // if (!userDefaultCultureName.IsNullOrWhiteSpace()) - // { - // CultureInfo.CurrentUICulture = CultureInfo.GetCultureInfo(userDefaultCultureName); - // } - // // 订阅用户欢迎消息 - // await _notificationStore.InsertUserSubscriptionAsync(eventData.Entity.TenantId, - // eventData.Entity.Id, UserNotificationNames.WelcomeToApplication); - - // var userWelcomeNotifiction = new NotificationInfo - // { - // CreationTime = DateTime.Now, - // Name = UserNotificationNames.WelcomeToApplication, - // NotificationSeverity = NotificationSeverity.Info, - // NotificationType = NotificationType.System, - // TenantId = eventData.Entity.TenantId - // }; - // userWelcomeNotifiction.Data.Properties["message"] = L("WelcomeToApplicationFormUser", eventData.Entity.UserName); - - // await _notificationDispatcher.DispatcheAsync(userWelcomeNotifiction); - // } - //} - - protected string L(string name, params object[] args) - { - return _stringLocalizer[name, args]?.Value; + await _notificationSender + .SendNofiterAsync( + UserNotificationNames.WelcomeToApplication, + userWelcomeNotifictionData, + userIdentifer, + eventData.Entity.TenantId, + NotificationSeverity.Info + ); } } } diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Group/UserGroupStore.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Group/UserGroupStore.cs index af94512e6..1bb3a9191 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Group/UserGroupStore.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Group/UserGroupStore.cs @@ -1,102 +1,131 @@ using LINGYUN.Abp.IM.Group; using System; using System.Collections.Generic; +using System.Threading; using System.Threading.Tasks; -using Volo.Abp.Domain.Services; +using Volo.Abp.DependencyInjection; +using Volo.Abp.MultiTenancy; using Volo.Abp.ObjectMapping; using Volo.Abp.Uow; namespace LINGYUN.Abp.MessageService.Group { - public class UserGroupStore : DomainService, IUserGroupStore + public class UserGroupStore : IUserGroupStore, ITransientDependency { - private IObjectMapper _objectMapper; - protected IObjectMapper ObjectMapper => LazyGetRequiredService(ref _objectMapper); - - private IUnitOfWorkManager _unitOfWorkManager; - protected IUnitOfWorkManager UnitOfWorkManager => LazyGetRequiredService(ref _unitOfWorkManager); - - protected IUserChatGroupRepository UserChatGroupRepository { get; } + private readonly IObjectMapper _objectMapper; + private readonly ICurrentTenant _currentTenant; + private readonly IUnitOfWorkManager _unitOfWorkManager; + private readonly IUserChatGroupRepository _userChatGroupRepository; public UserGroupStore( + IObjectMapper objectMapper, + ICurrentTenant currentTenant, + IUnitOfWorkManager unitOfWorkManager, IUserChatGroupRepository userChatGroupRepository) { - UserChatGroupRepository = userChatGroupRepository; + _objectMapper = objectMapper; + _currentTenant = currentTenant; + _unitOfWorkManager = unitOfWorkManager; + _userChatGroupRepository = userChatGroupRepository; } - public virtual async Task MemberHasInGroupAsync(Guid? tenantId, long groupId, Guid userId) + public virtual async Task MemberHasInGroupAsync( + Guid? tenantId, + long groupId, + Guid userId, + CancellationToken cancellationToken = default) { - using (CurrentTenant.Change(tenantId)) + using (_currentTenant.Change(tenantId)) { - return await UserChatGroupRepository.MemberHasInGroupAsync(groupId, userId); + return await _userChatGroupRepository.MemberHasInGroupAsync(groupId, userId, cancellationToken); } } - [UnitOfWork] - public virtual async Task AddUserToGroupAsync(Guid? tenantId, Guid userId, long groupId, Guid acceptUserId) + public virtual async Task AddUserToGroupAsync( + Guid? tenantId, + Guid userId, + long groupId, + Guid acceptUserId, + CancellationToken cancellationToken = default) { - using (var unitOfWork = UnitOfWorkManager.Begin()) + using (var unitOfWork = _unitOfWorkManager.Begin()) { - using (CurrentTenant.Change(tenantId)) + using (_currentTenant.Change(tenantId)) { - var userHasInGroup = await UserChatGroupRepository.MemberHasInGroupAsync(groupId, userId); + var userHasInGroup = await _userChatGroupRepository.MemberHasInGroupAsync(groupId, userId, cancellationToken); if (!userHasInGroup) { var userGroup = new UserChatGroup(groupId, userId, acceptUserId, tenantId); - await UserChatGroupRepository.InsertAsync(userGroup); + await _userChatGroupRepository.InsertAsync(userGroup, cancellationToken: cancellationToken); - await unitOfWork.SaveChangesAsync(); + await unitOfWork.SaveChangesAsync(cancellationToken); } } } } - public async Task GetUserGroupCardAsync(Guid? tenantId, long groupId, Guid userId) + 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); + var groupUserCard = await _userChatGroupRepository.GetMemberAsync(groupId, userId, cancellationToken); return groupUserCard; } } - public async Task> GetMembersAsync(Guid? tenantId, long groupId) + public async Task> GetMembersAsync( + Guid? tenantId, + long groupId, + CancellationToken cancellationToken = default) { - using (CurrentTenant.Change(tenantId)) + using (_currentTenant.Change(tenantId)) { - return await UserChatGroupRepository.GetMembersAsync(groupId); + return await _userChatGroupRepository.GetMembersAsync(groupId, cancellationToken: cancellationToken); } } - public async Task> GetUserGroupsAsync(Guid? tenantId, Guid userId) + public async Task> GetUserGroupsAsync( + Guid? tenantId, + Guid userId, + CancellationToken cancellationToken = default) { - using (CurrentTenant.Change(tenantId)) + using (_currentTenant.Change(tenantId)) { - return await UserChatGroupRepository.GetMemberGroupsAsync(userId); + return await _userChatGroupRepository.GetMemberGroupsAsync(userId, cancellationToken); } } - [UnitOfWork] - public async Task RemoveUserFormGroupAsync(Guid? tenantId, Guid userId, long groupId) + 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); + await _userChatGroupRepository.RemoveMemberFormGroupAsync(groupId, userId, cancellationToken); - await unitOfWork.SaveChangesAsync(); + await unitOfWork.SaveChangesAsync(cancellationToken); } } } - public async Task GetMembersCountAsync(Guid? tenantId, long groupId) + public async Task GetMembersCountAsync( + Guid? tenantId, + long groupId, + CancellationToken cancellationToken = default) { - using (CurrentTenant.Change(tenantId)) + using (_currentTenant.Change(tenantId)) { - return await UserChatGroupRepository.GetMembersCountAsync(groupId); + return await _userChatGroupRepository.GetMembersCountAsync(groupId, cancellationToken); } } @@ -106,11 +135,12 @@ namespace LINGYUN.Abp.MessageService.Group string sorting = nameof(GroupUserCard.UserId), bool reverse = false, int skipCount = 0, - int maxResultCount = 10) + int maxResultCount = 10, + CancellationToken cancellationToken = default) { - using (CurrentTenant.Change(tenantId)) + using (_currentTenant.Change(tenantId)) { - return await UserChatGroupRepository.GetMembersAsync(groupId, sorting, reverse, skipCount, maxResultCount); + return await _userChatGroupRepository.GetMembersAsync(groupId, sorting, reverse, skipCount, maxResultCount, cancellationToken); } } } diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Localization/Resources/en.json b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Localization/Resources/en.json index 3bb80c584..bc5f0a3ef 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Localization/Resources/en.json +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Localization/Resources/en.json @@ -18,8 +18,20 @@ "LINGYUN.Abp.Message:03404": "Sending the message failed: the user does not exist or is deactivated!", "LINGYUN.Abp.Message:03410": "Users refuse to add friends", "LINGYUN.Abp.Message:03411": "The other party is already your friend or has sent an authentication request. The operation cannot be repeated!", - "WelcomeToApplicationNotification": "User Welcome Notice", - "NewTenantRegisterdNotification": "Tenants create notification", - "WelcomeToApplicationFormUser": "User :{0} welcome to join us!" + "Notifications:MultiTenancy": "Multi Tenancy", + "Notifications:Users": "Users", + "Notifications:NewTenantRegisterd": "Tenant creation notification", + "Notifications:WelcomeToApplication": "User Welcome Notice", + "Notifications:IM": "Instant Messaging", + "Notifications:FriendValidation": "Friend verification notification", + "Notifications:NewFriend": "New friend notification", + "Notifications:RequestAddNewFriend": "User {name} has requested that you be added as a friend", + "Notifications:RequestAddNewFriendDetail": "Description: {description}", + "Notifications:JoinGroup": "Join group notification", + "Notifications:ExitGroup": "Exit group notification", + "Notifications:DissolveGroup": "Dissolve group notification", + "AddNewFriendBySearchId": "Add by account search", + "WelcomeToApplicationFormUser": "User :{0} welcome to join us!", + "Messages:NewFriend": "I have added you as a friend, let's chat together!" } } \ No newline at end of file diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Localization/Resources/zh-Hans.json b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Localization/Resources/zh-Hans.json index b6f29bbcb..1f6a464e4 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Localization/Resources/zh-Hans.json +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Localization/Resources/zh-Hans.json @@ -18,8 +18,20 @@ "LINGYUN.Abp.Message:03404": "发送消息失败: 用户不存在或已注销账号!", "LINGYUN.Abp.Message:03410": "用户拒绝添加好友", "LINGYUN.Abp.Message:03411": "对方已是您的好友或已发送验证请求,不能重复操作!", - "WelcomeToApplicationNotification": "用户欢迎通知", - "NewTenantRegisterdNotification": "租户创建通知", - "WelcomeToApplicationFormUser": "用户:{0} 欢迎您的加入!" + "Notifications:MultiTenancy": "租户通知", + "Notifications:Users": "用户通知", + "Notifications:NewTenantRegisterd": "租户创建通知", + "Notifications:WelcomeToApplication": "用户欢迎通知", + "Notifications:IM": "即时通讯", + "Notifications:FriendValidation": "好友验证通知", + "Notifications:NewFriend": "新好友通知", + "Notifications:RequestAddNewFriend": "用户 {name} 请求添加您为好友", + "Notifications:RequestAddNewFriendDetail": "附加说明: {description}", + "Notifications:JoinGroup": "加入群组通知", + "Notifications:ExitGroup": "退出群组通知", + "Notifications:DissolveGroup": "群组解散通知", + "AddNewFriendBySearchId": "通过账号搜索添加", + "WelcomeToApplicationFormUser": "用户:{0} 欢迎您的加入!", + "Messages:NewFriend": "我已经添加您为好友,让我们一起聊天吧!" } } \ No newline at end of file diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Mapper/MessageServiceDomainAutoMapperProfile.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Mapper/MessageServiceDomainAutoMapperProfile.cs index 8afedf49d..3e2068b0b 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Mapper/MessageServiceDomainAutoMapperProfile.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Mapper/MessageServiceDomainAutoMapperProfile.cs @@ -1,11 +1,14 @@ using AutoMapper; using LINGYUN.Abp.IM.Messages; using LINGYUN.Abp.MessageService.Chat; +using LINGYUN.Abp.MessageService.Group; using LINGYUN.Abp.MessageService.Notifications; using LINGYUN.Abp.MessageService.Subscriptions; using LINGYUN.Abp.Notifications; using Newtonsoft.Json; using System; +using Volo.Abp.AutoMapper; +using Volo.Abp.Data; namespace LINGYUN.Abp.MessageService.Mapper { @@ -13,58 +16,62 @@ namespace LINGYUN.Abp.MessageService.Mapper { public MessageServiceDomainAutoMapperProfile() { + //CreateMap() + // .ForMember(dto => dto.Id, map => map.MapFrom(src => src.NotificationId)) + // .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.Severity, map => map.MapFrom(src => src.Severity)) + // .ForMember(dto => dto.Data, map => map.MapFrom((src, nfi) => + // { + // var dataType = Type.GetType(src.NotificationTypeName); + // var data = JsonConvert.DeserializeObject(src.NotificationData, dataType); + // if(data != null && data is NotificationData notificationData) + // { + // if (notificationData.NeedLocalizer()) + // { + // var title = JsonConvert.DeserializeObject(notificationData.TryGetData("title").ToString()); + // var message = JsonConvert.DeserializeObject(notificationData.TryGetData("message").ToString()); + // notificationData.TrySetData("title", title); + // notificationData.TrySetData("message", message); + // } + // return notificationData; + // } + // return new NotificationData(); + // })); + CreateMap() - .ForMember(dto => dto.Id, map => map.MapFrom(src => src.NotificationId)) - .ForMember(dto => dto.Name, map => map.MapFrom(src => src.NotificationName)) - .ForMember(dto => dto.CateGory, map => map.MapFrom(src => src.NotificationCateGory)) - .ForMember(dto => dto.Lifetime, map => map.Ignore()) - .ForMember(dto => dto.NotificationType, map => map.MapFrom(src => src.Type)) - .ForMember(dto => dto.NotificationSeverity, map => map.MapFrom(src => src.Severity)) - .ForMember(dto => dto.Data, map => map.MapFrom((src, nfi) => - { - var notificationDataType = Type.GetType(src.NotificationTypeName); - var notificationData = JsonConvert.DeserializeObject(src.NotificationData, notificationDataType); - if(notificationData != null) - { - return notificationData as NotificationData; - } - return new NotificationData(); - })); + .ConvertUsing(); CreateMap(); - CreateMap() + CreateMessageMap() .ForMember(dto => dto.Content, map => map.MapFrom(src => src.Content)) .ForMember(dto => dto.GroupId, map => map.MapFrom(src => src.GroupId.ToString())) - .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.IsAnonymous, map => map.Ignore()) - .ForMember(dto => dto.ToUserId, map => map.Ignore()); + .Ignore(dto => dto.ToUserId); - CreateMap() - .ForMember(dto => dto.Content, map => map.MapFrom(src => src.Content)) - .ForMember(dto => dto.ToUserId, map => map.MapFrom(src => src.ReceiveUserId)) - .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.IsAnonymous, map => map.Ignore()) - .ForMember(dto => dto.GroupId, map => map.Ignore()); + CreateMessageMap() + .ForMember(dto => dto.ToUserId, map => map.MapFrom(src => src.ReceiveUserId)) + .Ignore(dto => dto.GroupId); - CreateMap() + CreateMessageMap() + .ForMember(dto => dto.ToUserId, map => map.MapFrom(src => src.ReceiveUserId)) + .Ignore(dto => dto.GroupId); + } + + protected IMappingExpression CreateMessageMap() + where TSource : Message + where TDestination : ChatMessage + { + return CreateMap() .ForMember(dto => dto.Content, map => map.MapFrom(src => src.Content)) - .ForMember(dto => dto.ToUserId, map => map.MapFrom(src => src.ReceiveUserId)) .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.IsAnonymous, map => map.Ignore()) - .ForMember(dto => dto.GroupId, map => map.Ignore()); + .ForMember(dto => dto.IsAnonymous, map => map.MapFrom(src => src.GetProperty(nameof(ChatMessage.IsAnonymous), false))) + .MapExtraProperties(); } } } diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Mapper/NotificationTypeConverter.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Mapper/NotificationTypeConverter.cs new file mode 100644 index 000000000..5c7936b31 --- /dev/null +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Mapper/NotificationTypeConverter.cs @@ -0,0 +1,39 @@ +using AutoMapper; +using LINGYUN.Abp.MessageService.Notifications; +using LINGYUN.Abp.Notifications; +using Newtonsoft.Json; +using System; +using Volo.Abp; +using Volo.Abp.DependencyInjection; + +namespace LINGYUN.Abp.MessageService.Mapper +{ + public class NotificationTypeConverter : ITypeConverter, ISingletonDependency + { + public NotificationInfo Convert(Notification source, NotificationInfo destination, ResolutionContext context) + { + destination = new NotificationInfo + { + Name = source.NotificationName, + Type = source.Type, + Severity = source.Severity + }; + destination.SetId(source.NotificationId); + + var dataType = Type.GetType(source.NotificationTypeName); + Check.NotNull(dataType, source.NotificationTypeName); + + var data = JsonConvert.DeserializeObject(source.NotificationData, dataType); + if (data != null && data is NotificationData notificationData) + { + destination.Data = NotificationDataConverter.Convert(notificationData); + } + else + { + destination.Data = new NotificationData(); + destination.Data.TrySetData("data", source.NotificationData); + } + return destination; + } + } +} diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/AbpMessageServiceNotificationDefinitionProvider.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/AbpMessageServiceNotificationDefinitionProvider.cs index 493cf83d0..5964af111 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/AbpMessageServiceNotificationDefinitionProvider.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/AbpMessageServiceNotificationDefinitionProvider.cs @@ -10,20 +10,71 @@ namespace LINGYUN.Abp.MessageService.Notifications { public override void Define(INotificationDefinitionContext context) { - context.Add(new NotificationDefinition( - UserNotificationNames.WelcomeToApplication, - L("WelcomeToApplicationNotification"), - L("WelcomeToApplicationNotification"), + var tenantsGroup = context.AddGroup( + TenantNotificationNames.GroupName, + L("Notifications:MultiTenancy"), + false); + + tenantsGroup.AddNotification( + TenantNotificationNames.NewTenantRegistered, + L("Notifications:NewTenantRegisterd"), + L("Notifications:NewTenantRegisterd"), notificationType: NotificationType.System, lifetime: NotificationLifetime.OnlyOne, - allowSubscriptionToClients: true)); - context.Add(new NotificationDefinition( - TenantNotificationNames.NewTenantRegistered, - L("NewTenantRegisterdNotification"), - L("NewTenantRegisterdNotification"), + allowSubscriptionToClients: false + ) + .WithProviders(); + + var usersGroup = context.AddGroup( + UserNotificationNames.GroupName, + L("Notifications:Users")); + + usersGroup.AddNotification( + UserNotificationNames.WelcomeToApplication, + L("Notifications:WelcomeToApplication"), + L("Notifications:WelcomeToApplication"), notificationType: NotificationType.System, lifetime: NotificationLifetime.OnlyOne, - allowSubscriptionToClients: true)); + allowSubscriptionToClients: true); + + var imGroup = context.AddGroup( + MessageServiceNotificationNames.IM.GroupName, + L("Notifications:IM")); + imGroup.AddNotification( + MessageServiceNotificationNames.IM.FriendValidation, + L("Notifications:FriendValidation"), + L("Notifications:FriendValidation"), + notificationType: NotificationType.System, + lifetime: NotificationLifetime.Persistent, + allowSubscriptionToClients: true); + imGroup.AddNotification( + MessageServiceNotificationNames.IM.NewFriend, + L("Notifications:NewFriend"), + L("Notifications:NewFriend"), + notificationType: NotificationType.System, + lifetime: NotificationLifetime.Persistent, + allowSubscriptionToClients: true); + imGroup.AddNotification( + MessageServiceNotificationNames.IM.JoinGroup, + L("Notifications:JoinGroup"), + L("Notifications:JoinGroup"), + notificationType: NotificationType.System, + lifetime: NotificationLifetime.Persistent, + allowSubscriptionToClients: true); + imGroup.AddNotification( + MessageServiceNotificationNames.IM.ExitGroup, + L("Notifications:ExitGroup"), + L("Notifications:ExitGroup"), + notificationType: NotificationType.System, + lifetime: NotificationLifetime.Persistent, + allowSubscriptionToClients: true); + imGroup.AddNotification( + MessageServiceNotificationNames.IM.DissolveGroup, + L("Notifications:DissolveGroup"), + L("Notifications:DissolveGroup"), + notificationType: NotificationType.System, + lifetime: NotificationLifetime.Persistent, + allowSubscriptionToClients: true); } protected LocalizableString L(string name) diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/INotificationRepository.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/INotificationRepository.cs index dc91fff44..074456b6a 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/INotificationRepository.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/INotificationRepository.cs @@ -1,12 +1,17 @@ -using System.Threading.Tasks; +using System.Threading; +using System.Threading.Tasks; using Volo.Abp.Domain.Repositories; namespace LINGYUN.Abp.MessageService.Notifications { public interface INotificationRepository : IBasicRepository { - Task GetByIdAsync(long notificationId); + Task GetByIdAsync( + long notificationId, + CancellationToken cancellationToken = default); - Task DeleteExpritionAsync(int batchCount); + Task DeleteExpritionAsync( + int batchCount, + CancellationToken cancellationToken = default); } } diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/IUserNotificationRepository.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/IUserNotificationRepository.cs index 29ca36a9f..6942ac069 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/IUserNotificationRepository.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/IUserNotificationRepository.cs @@ -1,6 +1,7 @@ using LINGYUN.Abp.Notifications; using System; using System.Collections.Generic; +using System.Threading; using System.Threading.Tasks; using Volo.Abp.Domain.Repositories; @@ -8,18 +9,46 @@ namespace LINGYUN.Abp.MessageService.Notifications { public interface IUserNotificationRepository : IBasicRepository { - Task AnyAsync(Guid userId, long notificationId); + Task AnyAsync( + Guid userId, + long notificationId, + CancellationToken cancellationToken = default); - Task InsertUserNotificationsAsync(IEnumerable userNotifications); + Task InsertUserNotificationsAsync( + IEnumerable userNotifications, + CancellationToken cancellationToken = default); - Task GetByIdAsync(Guid userId, long notificationId); + Task GetByIdAsync( + Guid userId, + long notificationId, + CancellationToken cancellationToken = default); - Task> GetNotificationsAsync(Guid userId, NotificationReadState readState = NotificationReadState.UnRead, int maxResultCount = 10); + Task> GetNotificationsAsync( + Guid userId, + NotificationReadState readState = NotificationReadState.UnRead, + int maxResultCount = 10, + CancellationToken cancellationToken = default); - Task GetCountAsync(Guid userId, string filter = "", NotificationReadState readState = NotificationReadState.UnRead); + Task GetCountAsync( + Guid userId, + string filter = "", + NotificationReadState readState = NotificationReadState.UnRead, + CancellationToken cancellationToken = default); - Task> GetNotificationsAsync(Guid userId, string filter = "", string sorting = nameof(Notification.NotificationId), NotificationReadState readState = NotificationReadState.UnRead, int skipCount = 1, int maxResultCount = 10); + Task> GetListAsync( + Guid userId, + string filter = "", + string sorting = nameof(Notification.CreationTime), + bool reverse = true, + NotificationReadState readState = NotificationReadState.UnRead, + int skipCount = 1, + int maxResultCount = 10, + CancellationToken cancellationToken = default); - Task ChangeUserNotificationReadStateAsync(Guid userId, long notificationId, NotificationReadState readState); + Task ChangeUserNotificationReadStateAsync( + Guid userId, + long notificationId, + NotificationReadState readState, + CancellationToken cancellationToken = default); } } diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/MessageServiceNotificationNames.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/MessageServiceNotificationNames.cs new file mode 100644 index 000000000..7457b5021 --- /dev/null +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/MessageServiceNotificationNames.cs @@ -0,0 +1,33 @@ +namespace LINGYUN.Abp.MessageService.Notifications +{ + 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/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/Notification.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/Notification.cs index 947cc3d65..2b259f551 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/Notification.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/Notification.cs @@ -12,7 +12,6 @@ namespace LINGYUN.Abp.MessageService.Notifications public virtual NotificationSeverity Severity { get; protected set; } public virtual NotificationType Type { get; set; } public virtual long NotificationId { get; protected set; } - public virtual string NotificationCateGory { get; protected set; } public virtual string NotificationName { get; protected set; } public virtual string NotificationData { get; protected set; } public virtual string NotificationTypeName { get; protected set; } @@ -25,19 +24,16 @@ namespace LINGYUN.Abp.MessageService.Notifications Id = id; } - public Notification(long id, string category, string name, string dataType, string data, NotificationSeverity severity = NotificationSeverity.Info) + public Notification(long id, string name, string dataType, string data, + NotificationSeverity severity = NotificationSeverity.Info, + Guid? tenantId = null) { NotificationId = id; Severity = severity; - NotificationCateGory = category; NotificationName = name; NotificationData = data; NotificationTypeName = dataType; Type = NotificationType.Application; - } - - public void SetTenantId(Guid? tenantId) - { TenantId = tenantId; } } diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/NotificationStore.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/NotificationStore.cs index ae4002684..b3a77f5b0 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/NotificationStore.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/NotificationStore.cs @@ -4,168 +4,271 @@ using LINGYUN.Abp.Notifications; using System; using System.Collections.Generic; using System.Linq; +using System.Threading; using System.Threading.Tasks; -using Volo.Abp.Domain.Services; +using Volo.Abp.DependencyInjection; using Volo.Abp.Json; +using Volo.Abp.MultiTenancy; using Volo.Abp.ObjectMapping; +using Volo.Abp.Timing; using Volo.Abp.Uow; namespace LINGYUN.Abp.MessageService.Notifications { - public class NotificationStore : DomainService, INotificationStore + public class NotificationStore : INotificationStore, ITransientDependency { + private readonly IClock _clock; + private readonly IObjectMapper _objectMapper; - private readonly IUnitOfWorkManager _unitOfWorkManager; - private IJsonSerializer _jsonSerializer; - protected IJsonSerializer JsonSerializer => LazyGetRequiredService(ref _jsonSerializer); + private readonly ICurrentTenant _currentTenant; + + private readonly IJsonSerializer _jsonSerializer; + + private readonly IUnitOfWorkManager _unitOfWorkManager; - private ISnowflakeIdGenerator _snowflakeIdGenerator; - protected ISnowflakeIdGenerator SnowflakeIdGenerator => LazyGetRequiredService(ref _snowflakeIdGenerator); + private readonly ISnowflakeIdGenerator _snowflakeIdGenerator; - private INotificationRepository _notificationRepository; - protected INotificationRepository NotificationRepository => LazyGetRequiredService(ref _notificationRepository); + private readonly INotificationRepository _notificationRepository; - private IUserNotificationRepository _userNotificationRepository; - protected IUserNotificationRepository UserNotificationRepository => LazyGetRequiredService(ref _userNotificationRepository); + private readonly IUserNotificationRepository _userNotificationRepository; - private IUserSubscribeRepository _userSubscribeRepository; - protected IUserSubscribeRepository UserSubscribeRepository => LazyGetRequiredService(ref _userSubscribeRepository); + private readonly IUserSubscribeRepository _userSubscribeRepository; public NotificationStore( + IClock clock, IObjectMapper objectMapper, - IUnitOfWorkManager unitOfWorkManager) + ICurrentTenant currentTenant, + IJsonSerializer jsonSerializer, + IUnitOfWorkManager unitOfWorkManager, + ISnowflakeIdGenerator snowflakeIdGenerator, + INotificationRepository notificationRepository, + IUserSubscribeRepository userSubscribeRepository, + IUserNotificationRepository userNotificationRepository + ) { + _clock = clock; _objectMapper = objectMapper; + _currentTenant = currentTenant; + _jsonSerializer = jsonSerializer; _unitOfWorkManager = unitOfWorkManager; + _snowflakeIdGenerator = snowflakeIdGenerator; + _notificationRepository = notificationRepository; + _userSubscribeRepository = userSubscribeRepository; + _userNotificationRepository = userNotificationRepository; } - [UnitOfWork] - public async Task ChangeUserNotificationReadStateAsync(Guid? tenantId, Guid userId, long notificationId, NotificationReadState readState) + public virtual async Task ChangeUserNotificationReadStateAsync( + Guid? tenantId, + Guid userId, + long notificationId, + NotificationReadState readState, + CancellationToken cancellationToken = default) { using (var unitOfWork = _unitOfWorkManager.Begin()) - using (CurrentTenant.Change(tenantId)) + using (_currentTenant.Change(tenantId)) { - await UserNotificationRepository.ChangeUserNotificationReadStateAsync(userId, notificationId, readState); + await _userNotificationRepository + .ChangeUserNotificationReadStateAsync(userId, notificationId, readState, cancellationToken); await unitOfWork.SaveChangesAsync(); } } - [UnitOfWork] - public async Task DeleteNotificationAsync(NotificationInfo notification) + public virtual async Task DeleteNotificationAsync( + NotificationInfo notification, + CancellationToken cancellationToken = default) { using (var unitOfWork = _unitOfWorkManager.Begin()) - using (CurrentTenant.Change(notification.TenantId)) + using (_currentTenant.Change(notification.TenantId)) { - var notify = await NotificationRepository.GetByIdAsync(notification.GetId()); - await NotificationRepository.DeleteAsync(notify.Id); + var notify = await _notificationRepository.GetByIdAsync(notification.GetId(), cancellationToken); + await _notificationRepository.DeleteAsync(notify.Id, cancellationToken: cancellationToken); - await unitOfWork.SaveChangesAsync(); + await unitOfWork.SaveChangesAsync(cancellationToken); } } - [UnitOfWork] - public async Task DeleteNotificationAsync(int batchCount) + public virtual async Task DeleteNotificationAsync( + int batchCount, + CancellationToken cancellationToken = default) { using (var unitOfWork = _unitOfWorkManager.Begin()) { - await NotificationRepository.DeleteExpritionAsync(batchCount); + await _notificationRepository.DeleteExpritionAsync(batchCount, cancellationToken); - await unitOfWork.SaveChangesAsync(); + await unitOfWork.SaveChangesAsync(cancellationToken); } } - [UnitOfWork] - public async Task DeleteUserNotificationAsync(Guid? tenantId, Guid userId, long notificationId) + public virtual async Task DeleteUserNotificationAsync( + Guid? tenantId, + Guid userId, + long notificationId, + CancellationToken cancellationToken = default) { using (var unitOfWork = _unitOfWorkManager.Begin()) - using (CurrentTenant.Change(tenantId)) + using (_currentTenant.Change(tenantId)) { - var notify = await UserNotificationRepository.GetByIdAsync(userId, notificationId); - await UserNotificationRepository.DeleteAsync(notify.Id); + var notify = await _userNotificationRepository + .GetByIdAsync(userId, notificationId, cancellationToken); + await _userNotificationRepository + .DeleteAsync(notify.Id, cancellationToken: cancellationToken); - await unitOfWork.SaveChangesAsync(); + await unitOfWork.SaveChangesAsync(cancellationToken); } } - [UnitOfWork] - public async Task DeleteAllUserSubscriptionAsync(Guid? tenantId, string notificationName) + public virtual async Task DeleteAllUserSubscriptionAsync( + Guid? tenantId, + string notificationName, + CancellationToken cancellationToken = default) { using (var unitOfWork = _unitOfWorkManager.Begin()) - using (CurrentTenant.Change(tenantId)) + using (_currentTenant.Change(tenantId)) { - await UserSubscribeRepository.DeleteUserSubscriptionAsync(notificationName); + await _userSubscribeRepository + .DeleteUserSubscriptionAsync(notificationName, cancellationToken); - await unitOfWork.SaveChangesAsync(); + await unitOfWork.SaveChangesAsync(cancellationToken); } } - [UnitOfWork] - public async Task DeleteUserSubscriptionAsync(Guid? tenantId, Guid userId, string notificationName) + public virtual async Task DeleteUserSubscriptionAsync( + Guid? tenantId, + Guid userId, + string notificationName, + CancellationToken cancellationToken = default) { using (var unitOfWork = _unitOfWorkManager.Begin()) - using (CurrentTenant.Change(tenantId)) + using (_currentTenant.Change(tenantId)) { - var userSubscribe = await UserSubscribeRepository.GetUserSubscribeAsync(notificationName, userId); - await UserSubscribeRepository.DeleteAsync(userSubscribe.Id); + var userSubscribe = await _userSubscribeRepository + .GetUserSubscribeAsync(notificationName, userId, cancellationToken); + await _userSubscribeRepository + .DeleteAsync(userSubscribe.Id, cancellationToken: cancellationToken); - await unitOfWork.SaveChangesAsync(); + await unitOfWork.SaveChangesAsync(cancellationToken); } } - [UnitOfWork] - public async Task DeleteUserSubscriptionAsync(Guid? tenantId, IEnumerable identifiers, string notificationName) + public virtual async Task DeleteUserSubscriptionAsync( + Guid? tenantId, + IEnumerable identifiers, + string notificationName, + CancellationToken cancellationToken = default) { using (var unitOfWork = _unitOfWorkManager.Begin()) - using (CurrentTenant.Change(tenantId)) + using (_currentTenant.Change(tenantId)) { - // TODO:不追踪用户订阅实体? - var userSubscribes = await UserSubscribeRepository.GetSubscribesAsync(notificationName); - - var removeUserSubscribes = userSubscribes.Where(us => identifiers.Any(id => id.UserId.Equals(us.UserId))); - - await UserSubscribeRepository.DeleteUserSubscriptionAsync(removeUserSubscribes); + await _userSubscribeRepository + .DeleteUserSubscriptionAsync(notificationName, identifiers.Select(ids => ids.UserId), cancellationToken); - await unitOfWork.SaveChangesAsync(); + await unitOfWork.SaveChangesAsync(cancellationToken); } } - public async Task GetNotificationOrNullAsync(Guid? tenantId, long notificationId) + public virtual async Task GetNotificationOrNullAsync( + Guid? tenantId, + long notificationId, + CancellationToken cancellationToken = default) { - using (CurrentTenant.Change(tenantId)) + using (_currentTenant.Change(tenantId)) { - var notification = await NotificationRepository.GetByIdAsync(notificationId); + var notification = await _notificationRepository + .GetByIdAsync(notificationId, cancellationToken); return _objectMapper.Map(notification); } } - public async Task> GetSubscriptionsAsync(Guid? tenantId, string notificationName) + public virtual async Task> GetUserSubscriptionsAsync( + Guid? tenantId, + string notificationName, + IEnumerable identifiers = null, + CancellationToken cancellationToken = default) { - using (CurrentTenant.Change(tenantId)) + using (_currentTenant.Change(tenantId)) { - var userSubscriptions = await UserSubscribeRepository.GetSubscribesAsync(notificationName); + var userSubscriptions = new List(); + + if (identifiers == null) + { + userSubscriptions = await _userSubscribeRepository + .GetUserSubscribesAsync(notificationName, null, cancellationToken); + } + else + { + userSubscriptions = await _userSubscribeRepository + .GetUserSubscribesAsync( + notificationName, + identifiers.Select(ids => ids.UserId), + cancellationToken); + } return _objectMapper.Map, List>(userSubscriptions); } } - public async Task> GetUserNotificationsAsync(Guid? tenantId, Guid userId, NotificationReadState readState = NotificationReadState.UnRead, int maxResultCount = 10) + public virtual async Task> GetUserNotificationsAsync( + Guid? tenantId, + Guid userId, + NotificationReadState readState = NotificationReadState.UnRead, + int maxResultCount = 10, + CancellationToken cancellationToken = default) { - using (CurrentTenant.Change(tenantId)) + using (_currentTenant.Change(tenantId)) { - var notifications = await UserNotificationRepository.GetNotificationsAsync(userId, readState, maxResultCount); + var notifications = await _userNotificationRepository + .GetNotificationsAsync(userId, readState, maxResultCount, cancellationToken); return _objectMapper.Map, List>(notifications); } } - public async Task> GetUserSubscriptionsAsync(Guid? tenantId, Guid userId) + public virtual async Task GetUserNotificationsCountAsync( + Guid? tenantId, + Guid userId, + string filter = "", + NotificationReadState readState = NotificationReadState.UnRead, + CancellationToken cancellationToken = default) { - using (CurrentTenant.Change(tenantId)) + using (_currentTenant.Change(tenantId)) { - var userSubscriptionNames = await UserSubscribeRepository.GetUserSubscribesAsync(userId); + return await _userNotificationRepository + .GetCountAsync(userId, filter, readState, cancellationToken); + } + } + + public virtual async Task> GetUserNotificationsAsync( + Guid? tenantId, + Guid userId, + string filter = "", + string sorting = nameof(NotificationInfo.CreationTime), + bool reverse = true, + NotificationReadState readState = NotificationReadState.UnRead, + int skipCount = 1, + int maxResultCount = 10, + CancellationToken cancellationToken = default) + { + using (_currentTenant.Change(tenantId)) + { + var notifications = await _userNotificationRepository + .GetListAsync(userId, filter, sorting, reverse, readState, skipCount, maxResultCount, cancellationToken); + + return _objectMapper.Map, List>(notifications); + } + } + + public virtual async Task> GetUserSubscriptionsAsync( + Guid? tenantId, + Guid userId, + CancellationToken cancellationToken = default) + { + using (_currentTenant.Change(tenantId)) + { + var userSubscriptionNames = await _userSubscribeRepository + .GetUserSubscribesAsync(userId, cancellationToken); var userSubscriptions = new List(); @@ -181,11 +284,15 @@ namespace LINGYUN.Abp.MessageService.Notifications } } - public virtual async Task> GetUserSubscriptionsAsync(Guid? tenantId, string userName) + public virtual async Task> GetUserSubscriptionsAsync( + Guid? tenantId, + string userName, + CancellationToken cancellationToken = default) { - using (CurrentTenant.Change(tenantId)) + using (_currentTenant.Change(tenantId)) { - var userSubscriptions = await UserSubscribeRepository.GetUserSubscribesByNameAsync(userName); + var userSubscriptions = await _userSubscribeRepository + .GetUserSubscribesByNameAsync(userName, cancellationToken); var userSubscriptionInfos = new List(); @@ -201,71 +308,83 @@ namespace LINGYUN.Abp.MessageService.Notifications } } - [UnitOfWork] - public async Task InsertNotificationAsync(NotificationInfo notification) + public virtual async Task InsertNotificationAsync( + NotificationInfo notification, + CancellationToken cancellationToken = default) { using (var unitOfWork = _unitOfWorkManager.Begin()) - using (CurrentTenant.Change(notification.TenantId)) + using (_currentTenant.Change(notification.TenantId)) { // var notifyId = notification.GetId(); - var notifyId = SnowflakeIdGenerator.Create(); + var notifyId = _snowflakeIdGenerator.Create(); // 保存主键,防止前端js long类型溢出 // notification.Data["id"] = notifyId.ToString(); - var notify = new Notification(notifyId, notification.CateGory, notification.Name, + var notify = new Notification(notifyId, notification.Name, notification.Data.GetType().AssemblyQualifiedName, - JsonSerializer.Serialize(notification.Data), notification.NotificationSeverity) + _jsonSerializer.Serialize(notification.Data), + notification.Severity, notification.TenantId) { - CreationTime = Clock.Now, - Type = notification.NotificationType, - ExpirationTime = Clock.Now.AddDays(60) + CreationTime = _clock.Now, + Type = notification.Type, + // TODO: 通知过期时间应该可以配置 + ExpirationTime = _clock.Now.AddDays(60) }; - notify.SetTenantId(notification.TenantId); - await NotificationRepository.InsertAsync(notify); + await _notificationRepository.InsertAsync(notify, cancellationToken: cancellationToken); notification.Id = notify.NotificationId.ToString(); - await unitOfWork.SaveChangesAsync(); + await unitOfWork.SaveChangesAsync(cancellationToken); } } - [UnitOfWork] - public async Task InsertUserNotificationAsync(NotificationInfo notification, Guid userId) + public virtual async Task InsertUserNotificationAsync( + NotificationInfo notification, + Guid userId, + CancellationToken cancellationToken = default) { using (var unitOfWork = _unitOfWorkManager.Begin()) - using (CurrentTenant.Change(notification.TenantId)) + using (_currentTenant.Change(notification.TenantId)) { var userNotification = new UserNotification(notification.GetId(), userId, notification.TenantId); - await UserNotificationRepository.InsertAsync(userNotification); + await _userNotificationRepository + .InsertAsync(userNotification, cancellationToken: cancellationToken); - await unitOfWork.SaveChangesAsync(); + await unitOfWork.SaveChangesAsync(cancellationToken); } } - [UnitOfWork] - public async Task InsertUserSubscriptionAsync(Guid? tenantId, UserIdentifier identifier, string notificationName) + public virtual async Task InsertUserSubscriptionAsync( + Guid? tenantId, + UserIdentifier identifier, + string notificationName, + CancellationToken cancellationToken = default) { using (var unitOfWork = _unitOfWorkManager.Begin()) - using (CurrentTenant.Change(tenantId)) + using (_currentTenant.Change(tenantId)) { var userSubscription = new UserSubscribe(notificationName, identifier.UserId, identifier.UserName, tenantId) { - CreationTime = Clock.Now + CreationTime = _clock.Now }; - await UserSubscribeRepository.InsertAsync(userSubscription); + await _userSubscribeRepository + .InsertAsync(userSubscription, cancellationToken: cancellationToken); - await unitOfWork.SaveChangesAsync(); + await unitOfWork.SaveChangesAsync(cancellationToken); } } - [UnitOfWork] - public async Task InsertUserSubscriptionAsync(Guid? tenantId, IEnumerable identifiers, string notificationName) + public virtual async Task InsertUserSubscriptionAsync( + Guid? tenantId, + IEnumerable identifiers, + string notificationName, + CancellationToken cancellationToken = default) { using (var unitOfWork = _unitOfWorkManager.Begin()) - using (CurrentTenant.Change(tenantId)) + using (_currentTenant.Change(tenantId)) { var userSubscribes = new List(); @@ -274,39 +393,47 @@ namespace LINGYUN.Abp.MessageService.Notifications userSubscribes.Add(new UserSubscribe(notificationName, identifier.UserId, identifier.UserName, tenantId)); } - await UserSubscribeRepository.InsertUserSubscriptionAsync(userSubscribes); + await _userSubscribeRepository + .InsertUserSubscriptionAsync(userSubscribes, cancellationToken); - await unitOfWork.SaveChangesAsync(); + await unitOfWork.SaveChangesAsync(cancellationToken); } } - public async Task IsSubscribedAsync(Guid? tenantId, Guid userId, string notificationName) + public virtual async Task IsSubscribedAsync( + Guid? tenantId, + Guid userId, + string notificationName, + CancellationToken cancellationToken = default) { - using (CurrentTenant.Change(tenantId)) - return await UserSubscribeRepository.UserSubscribeExistsAysnc(notificationName, userId); + using (_currentTenant.Change(tenantId)) + return await _userSubscribeRepository + .UserSubscribeExistsAysnc(notificationName, userId, cancellationToken); } - [UnitOfWork] - public async Task InsertUserNotificationsAsync(NotificationInfo notification, IEnumerable userIds) + public virtual async Task InsertUserNotificationsAsync( + NotificationInfo notification, + IEnumerable userIds, + CancellationToken cancellationToken = default) { - // 添加工作单元 using (var unitOfWork = _unitOfWorkManager.Begin()) - using (CurrentTenant.Change(notification.TenantId)) + using (_currentTenant.Change(notification.TenantId)) { var userNofitications = new List(); foreach (var userId in userIds) { // 重复检查 // TODO:如果存在很多个订阅用户,这是个隐患 - if (!await UserNotificationRepository.AnyAsync(userId, notification.GetId())) + if (!await _userNotificationRepository.AnyAsync(userId, notification.GetId(), cancellationToken)) { var userNofitication = new UserNotification(notification.GetId(), userId, notification.TenantId); userNofitications.Add(userNofitication); } } - await UserNotificationRepository.InsertUserNotificationsAsync(userNofitications); + await _userNotificationRepository + .InsertUserNotificationsAsync(userNofitications, cancellationToken); - await unitOfWork.SaveChangesAsync(); + await unitOfWork.SaveChangesAsync(cancellationToken); } } } diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Packages/Emoji.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Packages/Emoji.cs new file mode 100644 index 000000000..99f8d0929 --- /dev/null +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Packages/Emoji.cs @@ -0,0 +1,29 @@ +using System; +using Volo.Abp.Domain.Entities; + +namespace LINGYUN.Abp.MessageService.Packages +{ + public class Emoji : Entity + { + public virtual string Name { get; protected set; } + public virtual string Title { get; protected set; } + public virtual string LinkUrl { get; protected set; } + protected Emoji() { } + public Emoji( + Guid id, + string name, + string title, + string linkUrl) + :base(id) + { + Name = name; + Title = title; + LinkUrl = linkUrl; + } + + public void SetUrl(string linkUrl) + { + LinkUrl = linkUrl; + } + } +} diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Subscriptions/IUserSubscribeRepository.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Subscriptions/IUserSubscribeRepository.cs index 1b030facb..c30014730 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Subscriptions/IUserSubscribeRepository.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Subscriptions/IUserSubscribeRepository.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Threading; using System.Threading.Tasks; using Volo.Abp.Domain.Repositories; @@ -7,26 +8,59 @@ namespace LINGYUN.Abp.MessageService.Subscriptions { public interface IUserSubscribeRepository : IBasicRepository { - Task UserSubscribeExistsAysnc(string notificationName, Guid userId); + Task UserSubscribeExistsAysnc( + string notificationName, + Guid userId, + CancellationToken cancellationToken = default); - Task GetUserSubscribeAsync(string notificationName, Guid userId); + Task GetUserSubscribeAsync( + string notificationName, + Guid userId, + CancellationToken cancellationToken = default); - Task> GetSubscribesAsync(string notificationName); + Task> GetUserSubscribesAsync( + string notificationName, + IEnumerable userIds = null, + CancellationToken cancellationToken = default); - Task> GetUserSubscribesAsync(Guid userId); + Task> GetUserSubscribesAsync( + Guid userId, + CancellationToken cancellationToken = default); - Task> GetUserSubscribesByNameAsync(string userName); + Task> GetUserSubscribesByNameAsync( + string userName, + CancellationToken cancellationToken = default); - Task> GetUserSubscribesAsync(string notificationName); + Task> GetUserSubscribesAsync( + string notificationName, + CancellationToken cancellationToken = default); - Task InsertUserSubscriptionAsync(IEnumerable userSubscribes); + Task InsertUserSubscriptionAsync( + IEnumerable userSubscribes, + CancellationToken cancellationToken = default); - Task DeleteUserSubscriptionAsync(IEnumerable userSubscribes); + Task DeleteUserSubscriptionAsync( + IEnumerable userSubscribes, + CancellationToken cancellationToken = default); - Task DeleteUserSubscriptionAsync(string notificationName); + Task DeleteUserSubscriptionAsync( + string notificationName, + IEnumerable userIds, + CancellationToken cancellationToken = default); - Task> GetUserSubscribesAsync(Guid userId, string sorting = nameof(UserSubscribe.Id), int skipCount = 1, int maxResultCount = 10); + Task DeleteUserSubscriptionAsync( + string notificationName, + CancellationToken cancellationToken = default); - Task GetCountAsync(Guid userId); + 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); } } diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatFriendRepository.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatFriendRepository.cs index 4a7dabe34..d03fe28c3 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatFriendRepository.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatFriendRepository.cs @@ -23,7 +23,7 @@ namespace LINGYUN.Abp.MessageService.Chat public virtual async Task FindByUserFriendIdAsync(Guid userId, Guid friendId, CancellationToken cancellationToken = default) { return await DbSet - .Where(ucf => ucf.UserId == userId && ucf.FrientId == friendId && ucf.Status == UserFriendStatus.Added) + .Where(ucf => ucf.UserId == userId && ucf.FrientId == friendId) .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); } @@ -194,6 +194,16 @@ namespace LINGYUN.Abp.MessageService.Chat .CountAsync(GetCancellationToken(cancellationToken)); } + public virtual async Task IsFriendAsync( + Guid userId, + Guid frientId, + CancellationToken cancellationToken = default) + { + return await DbSet + .AnyAsync(ucf => ucf.UserId == userId && ucf.FrientId == frientId && ucf.Status == UserFriendStatus.Added, + GetCancellationToken(cancellationToken)); + } + public virtual async Task IsAddedAsync(Guid userId, Guid frientId, CancellationToken cancellationToken = default) { return await DbSet diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatSettingRepository.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatSettingRepository.cs index 69b23a8fd..bfc4563c7 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatSettingRepository.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Chat/EfCoreUserChatSettingRepository.cs @@ -2,6 +2,7 @@ using Microsoft.EntityFrameworkCore; using System; using System.Linq; +using System.Threading; using System.Threading.Tasks; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; @@ -18,16 +19,16 @@ namespace LINGYUN.Abp.MessageService.Chat { } - public async Task FindByUserIdAsync(Guid userId) + public async Task FindByUserIdAsync(Guid userId, CancellationToken cancellationToken = default) { return await DbSet.Where(x => x.UserId.Equals(userId)) .AsNoTracking() - .FirstOrDefaultAsync(); + .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); } - public async Task UserHasOpendImAsync(Guid userId) + public async Task UserHasOpendImAsync(Guid userId, CancellationToken cancellationToken = default) { - return await DbSet.AnyAsync(x => x.UserId.Equals(userId)); + return await DbSet.AnyAsync(x => x.UserId.Equals(userId), GetCancellationToken(cancellationToken)); } } } diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/AbpMessageServiceEntityFrameworkCoreModule.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/AbpMessageServiceEntityFrameworkCoreModule.cs index 2939391a7..eb9271862 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/AbpMessageServiceEntityFrameworkCoreModule.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/AbpMessageServiceEntityFrameworkCoreModule.cs @@ -1,4 +1,5 @@ using LINGYUN.Abp.MessageService.Chat; +using LINGYUN.Abp.MessageService.Group; using LINGYUN.Abp.MessageService.Notifications; using LINGYUN.Abp.MessageService.Subscriptions; using Microsoft.Extensions.DependencyInjection; diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/IMessageServiceDbContext.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/IMessageServiceDbContext.cs index bbfc5d399..070434a73 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/IMessageServiceDbContext.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/IMessageServiceDbContext.cs @@ -1,4 +1,5 @@ using LINGYUN.Abp.MessageService.Chat; +using LINGYUN.Abp.MessageService.Group; using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/MessageServiceDbContext.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/MessageServiceDbContext.cs index 893d3ba01..bd333d642 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/MessageServiceDbContext.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/MessageServiceDbContext.cs @@ -1,4 +1,5 @@ using LINGYUN.Abp.MessageService.Chat; +using LINGYUN.Abp.MessageService.Group; using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/MessageServiceDbContextModelCreatingExtensions.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/MessageServiceDbContextModelCreatingExtensions.cs index 8fa22cf9b..9c589e5b2 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/MessageServiceDbContextModelCreatingExtensions.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/EntityFrameworkCore/MessageServiceDbContextModelCreatingExtensions.cs @@ -26,12 +26,10 @@ namespace LINGYUN.Abp.MessageService.EntityFrameworkCore b.ToTable(options.TablePrefix + "Notifications", options.Schema); b.Property(p => p.NotificationName).HasMaxLength(NotificationConsts.MaxNameLength).IsRequired(); - b.Property(p => p.NotificationCateGory).HasMaxLength(NotificationConsts.MaxCateGoryLength).IsRequired(); b.Property(p => p.NotificationTypeName).HasMaxLength(NotificationConsts.MaxTypeNameLength).IsRequired(); b.Property(p => p.NotificationData).HasMaxLength(NotificationConsts.MaxDataLength).IsRequired(); - b.ConfigureMultiTenant(); - b.ConfigureCreationTime(); + b.ConfigureByConvention(); b.HasIndex(p => new { p.TenantId, p.NotificationName }); }); @@ -40,7 +38,7 @@ namespace LINGYUN.Abp.MessageService.EntityFrameworkCore { b.ToTable(options.TablePrefix + "UserNotifications", options.Schema); - b.ConfigureMultiTenant(); + b.ConfigureByConvention(); b.HasIndex(p => new { p.TenantId, p.UserId, p.NotificationId }) .HasName("IX_Tenant_User_Notification_Id"); @@ -56,8 +54,7 @@ namespace LINGYUN.Abp.MessageService.EntityFrameworkCore .HasDefaultValue("/")// 不是必须的 .IsRequired(); - b.ConfigureCreationTime(); - b.ConfigureMultiTenant(); + b.ConfigureByConvention(); b.HasIndex(p => new { p.TenantId, p.UserId, p.NotificationName }) .HasName("IX_Tenant_User_Notification_Name") @@ -71,8 +68,7 @@ namespace LINGYUN.Abp.MessageService.EntityFrameworkCore b.Property(p => p.SendUserName).HasMaxLength(MessageConsts.MaxSendUserNameLength).IsRequired(); b.Property(p => p.Content).HasMaxLength(MessageConsts.MaxContentLength).IsRequired(); - b.ConfigureCreationTime(); - b.ConfigureMultiTenant(); + b.ConfigureByConvention(); b.HasIndex(p => new { p.TenantId, p.ReceiveUserId }); }); @@ -84,8 +80,7 @@ namespace LINGYUN.Abp.MessageService.EntityFrameworkCore b.Property(p => p.SendUserName).HasMaxLength(MessageConsts.MaxSendUserNameLength).IsRequired(); b.Property(p => p.Content).HasMaxLength(MessageConsts.MaxContentLength).IsRequired(); - b.ConfigureCreationTime(); - b.ConfigureMultiTenant(); + b.ConfigureByConvention(); b.HasIndex(p => new { p.TenantId, p.GroupId }); }); @@ -94,7 +89,8 @@ namespace LINGYUN.Abp.MessageService.EntityFrameworkCore { b.ToTable(options.TablePrefix + "UserChatFriends", options.Schema); - b.Property(p => p.RemarkName).HasMaxLength(UserChatCardConsts.MaxUserNameLength); + b.Property(p => p.RemarkName).HasMaxLength(UserChatFriendConsts.MaxRemarkNameLength); + b.Property(p => p.Description).HasMaxLength(UserChatFriendConsts.MaxDescriptionLength); b.ConfigureByConvention(); @@ -133,7 +129,7 @@ namespace LINGYUN.Abp.MessageService.EntityFrameworkCore { b.ToTable(options.TablePrefix + "UserChatSettings", options.Schema); - b.ConfigureMultiTenant(); + b.ConfigureByConvention(); b.HasIndex(p => new { p.TenantId, p.UserId }); }); @@ -160,7 +156,7 @@ namespace LINGYUN.Abp.MessageService.EntityFrameworkCore { b.ToTable(options.TablePrefix + "GroupChatBlacks", options.Schema); - b.ConfigureMultiTenant(); + b.ConfigureByConvention(); b.HasIndex(p => new { p.TenantId, p.GroupId }); }); @@ -176,8 +172,7 @@ namespace LINGYUN.Abp.MessageService.EntityFrameworkCore b.Property(p => p.Address).HasMaxLength(ChatGroupConsts.MaxAddressLength); b.Property(p => p.Description).HasMaxLength(ChatGroupConsts.MaxDescriptionLength); - b.ConfigureAudited(); - b.ConfigureMultiTenant(); + b.ConfigureByConvention(); b.HasIndex(p => new { p.TenantId, p.Name }); }); @@ -186,8 +181,7 @@ namespace LINGYUN.Abp.MessageService.EntityFrameworkCore { b.ToTable(options.TablePrefix + "UserChatGroups", options.Schema); - b.ConfigureCreationAudited(); - b.ConfigureMultiTenant(); + b.ConfigureByConvention(); b.HasIndex(p => new { p.TenantId, p.GroupId, p.UserId }); }); diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Group/EfCoreUserChatGroupRepository.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Group/EfCoreUserChatGroupRepository.cs index 6b274be28..46cb100ad 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Group/EfCoreUserChatGroupRepository.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Group/EfCoreUserChatGroupRepository.cs @@ -160,7 +160,7 @@ namespace LINGYUN.Abp.MessageService.Group Guid userId, CancellationToken cancellationToken = default) { - await DeleteAsync(ucg => ucg.GroupId == groupId && ucg.UserId == userId); + await DeleteAsync(ucg => ucg.GroupId == groupId && ucg.UserId == userId, cancellationToken: GetCancellationToken(cancellationToken)); } } } diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Notifications/EfCoreNotificationRepository.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Notifications/EfCoreNotificationRepository.cs index 97b094126..310956eae 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Notifications/EfCoreNotificationRepository.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Notifications/EfCoreNotificationRepository.cs @@ -2,6 +2,7 @@ using Microsoft.EntityFrameworkCore; using System; using System.Linq; +using System.Threading; using System.Threading.Tasks; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; @@ -18,22 +19,27 @@ namespace LINGYUN.Abp.MessageService.Notifications { } - public async Task DeleteExpritionAsync(int batchCount) + public async Task DeleteExpritionAsync( + int batchCount, + CancellationToken cancellationToken = default) { var batchDeleteNoticeWithIds = await DbSet .Where(x => x.ExpirationTime <= DateTime.Now) .Take(batchCount) .Select(x => new Notification(x.Id)) .AsNoTracking() - .ToArrayAsync(); + .ToArrayAsync(GetCancellationToken(cancellationToken)); DbSet.AttachRange(batchDeleteNoticeWithIds); DbSet.RemoveRange(batchDeleteNoticeWithIds); } - public async Task GetByIdAsync(long notificationId) + public async Task GetByIdAsync( + long notificationId, + CancellationToken cancellationToken = default) { - return await DbSet.Where(x => x.NotificationId.Equals(notificationId)).FirstOrDefaultAsync(); + return await DbSet.Where(x => x.NotificationId.Equals(notificationId)) + .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); } } } diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Notifications/EfCoreUserNotificationRepository.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Notifications/EfCoreUserNotificationRepository.cs index 1ae397e76..ee89175f9 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Notifications/EfCoreUserNotificationRepository.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Notifications/EfCoreUserNotificationRepository.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Linq.Dynamic.Core; +using System.Threading; using System.Threading.Tasks; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; @@ -21,78 +22,112 @@ namespace LINGYUN.Abp.MessageService.Notifications { } - public async Task AnyAsync(Guid userId, long notificationId) + public virtual async Task AnyAsync( + Guid userId, + long notificationId, + CancellationToken cancellationToken = default) { return await DbSet - .AnyAsync(x => x.NotificationId.Equals(notificationId) && x.UserId.Equals(userId)); + .AnyAsync(x => x.NotificationId.Equals(notificationId) && x.UserId.Equals(userId), + GetCancellationToken(cancellationToken)); } - public async Task InsertUserNotificationsAsync(IEnumerable userNotifications) + public virtual async Task InsertUserNotificationsAsync( + IEnumerable userNotifications, + CancellationToken cancellationToken = default) { - await DbSet.AddRangeAsync(userNotifications); + await DbSet.AddRangeAsync(userNotifications, GetCancellationToken(cancellationToken)); } - public async Task ChangeUserNotificationReadStateAsync(Guid userId, long notificationId, NotificationReadState readState) + public virtual async Task ChangeUserNotificationReadStateAsync( + Guid userId, + long notificationId, + NotificationReadState readState, + CancellationToken cancellationToken = default) { - var userNofitication = await GetByIdAsync(userId, notificationId); + var userNofitication = await GetByIdAsync(userId, notificationId, cancellationToken); userNofitication.ChangeReadState(readState); DbSet.Update(userNofitication); } - public async Task GetByIdAsync(Guid userId, long notificationId) + public virtual async Task GetByIdAsync( + Guid userId, + long notificationId, + CancellationToken cancellationToken = default) { var userNofitication = await DbSet .Where(x => x.NotificationId.Equals(notificationId) && x.UserId.Equals(userId)) - .FirstOrDefaultAsync(); + .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); return userNofitication; } - public async Task> GetNotificationsAsync(Guid userId, NotificationReadState readState = NotificationReadState.UnRead, int maxResultCount = 10) + public virtual async Task> GetNotificationsAsync( + Guid userId, + NotificationReadState readState = NotificationReadState.UnRead, + int maxResultCount = 10, + CancellationToken cancellationToken = default) { - - var userNofitications = await (from un in DbContext.Set() + var userNotifilerQuery = from un in DbContext.Set() join n in DbContext.Set() on un.NotificationId equals n.NotificationId where un.UserId.Equals(userId) && un.ReadStatus.Equals(readState) - orderby n.NotificationId descending - select n) - .Distinct() - .Take(maxResultCount) - .ToListAsync(); - return userNofitications; + select n; + + return await userNotifilerQuery + .OrderBy(nameof(Notification.CreationTime) + " DESC") + .Take(maxResultCount) + .AsNoTracking() + .ToListAsync(GetCancellationToken(cancellationToken)); } - public virtual async Task GetCountAsync(Guid userId, string filter = "", NotificationReadState readState = NotificationReadState.UnRead) + public virtual async Task GetCountAsync( + Guid userId, + string filter = "", + NotificationReadState readState = NotificationReadState.UnRead, + CancellationToken cancellationToken = default) { - var userNofiticationCount = await (from un in DbContext.Set() - join n in DbContext.Set() - on un.NotificationId equals n.NotificationId - where un.UserId.Equals(userId) && un.ReadStatus.Equals(readState) - && (n.NotificationName.Contains(filter) || n.NotificationTypeName.Contains(filter) - || n.NotificationCateGory.Contains(filter)) - select n) - .Distinct() - .LongCountAsync(); - return userNofiticationCount; + var userNotifilerQuery = from un in DbContext.Set() + join n in DbContext.Set() + on un.NotificationId equals n.NotificationId + where un.UserId.Equals(userId) && un.ReadStatus.Equals(readState) + select n; + + return await userNotifilerQuery + .WhereIf(!filter.IsNullOrWhiteSpace(), nf => + nf.NotificationName.Contains(filter) || + nf.NotificationTypeName.Contains(filter)) + .CountAsync(GetCancellationToken(cancellationToken)); } - public virtual async Task> GetNotificationsAsync(Guid userId, string filter = "", string sorting = "NotificationId", NotificationReadState readState = NotificationReadState.UnRead, int skipCount = 1, int maxResultCount = 10) + public virtual async Task> GetListAsync( + Guid userId, + string filter = "", + string sorting = nameof(Notification.CreationTime), + bool reverse = true, + NotificationReadState readState = NotificationReadState.UnRead, + int skipCount = 1, + int maxResultCount = 10, + CancellationToken cancellationToken = default) { - var userNofitications = await (from un in DbContext.Set() - join n in DbContext.Set() - on un.NotificationId equals n.NotificationId - where un.UserId.Equals(userId) && un.ReadStatus.Equals(readState) - && (n.NotificationName.Contains(filter) || n.NotificationTypeName.Contains(filter) - || n.NotificationCateGory.Contains(filter)) - orderby sorting ?? nameof(Notification.NotificationId) descending - select n) - .Distinct() - .Page(skipCount, maxResultCount) - .AsNoTracking() - .ToListAsync(); - return userNofitications; + sorting ??= nameof(Notification.CreationTime); + sorting = reverse ? sorting + " DESC" : sorting; + + var userNotifilerQuery = from un in DbContext.Set() + join n in DbContext.Set() + on un.NotificationId equals n.NotificationId + where un.UserId.Equals(userId) && un.ReadStatus.Equals(readState) + select n; + + return await userNotifilerQuery + .WhereIf(!filter.IsNullOrWhiteSpace(), nf => + nf.NotificationName.Contains(filter) || + nf.NotificationTypeName.Contains(filter)) + .OrderBy(sorting) + .PageBy(skipCount, maxResultCount) + .AsNoTracking() + .ToListAsync(GetCancellationToken(cancellationToken)); } } } diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Subscriptions/EfCoreUserSubscribeRepository.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Subscriptions/EfCoreUserSubscribeRepository.cs index 622a053ec..7a613198b 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Subscriptions/EfCoreUserSubscribeRepository.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Subscriptions/EfCoreUserSubscribeRepository.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Linq.Dynamic.Core; +using System.Threading; using System.Threading.Tasks; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; @@ -20,83 +21,123 @@ namespace LINGYUN.Abp.MessageService.Subscriptions { } - public async Task> GetSubscribesAsync(string notificationName) + public async Task> GetUserSubscribesAsync( + string notificationName, + IEnumerable userIds = null, + CancellationToken cancellationToken = default) { var userSubscribes = await DbSet .Distinct() .Where(x => x.NotificationName.Equals(notificationName)) + .WhereIf(userIds != null, x => userIds.Contains(x.UserId)) .AsNoTracking() - .ToListAsync(); + .ToListAsync(GetCancellationToken(cancellationToken)); return userSubscribes; } - public async Task GetUserSubscribeAsync(string notificationName, Guid userId) + public async Task GetUserSubscribeAsync( + string notificationName, + Guid userId, + CancellationToken cancellationToken = default) { var userSubscribe = await DbSet .Where(x => x.UserId.Equals(userId) && x.NotificationName.Equals(notificationName)) .AsNoTracking() - .FirstOrDefaultAsync(); + .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); return userSubscribe; } - public async Task> GetUserSubscribesAsync(Guid userId) + public async Task> GetUserSubscribesAsync( + Guid userId, + CancellationToken cancellationToken = default) { var userSubscribeNames = await DbSet .Distinct() .Where(x => x.UserId.Equals(userId)) .Select(x => x.NotificationName) - .ToListAsync(); + .ToListAsync(GetCancellationToken(cancellationToken)); return userSubscribeNames; } - public async Task> GetUserSubscribesByNameAsync(string userName) + public async Task> GetUserSubscribesByNameAsync( + string userName, + CancellationToken cancellationToken = default) { var userSubscribeNames = await DbSet .Distinct() .Where(x => x.UserName.Equals(userName)) .AsNoTracking() - .ToListAsync(); + .ToListAsync(GetCancellationToken(cancellationToken)); return userSubscribeNames; } - public async Task> GetUserSubscribesAsync(string notificationName) + public async Task> GetUserSubscribesAsync( + string notificationName, + CancellationToken cancellationToken = default) { var subscribeUsers = await DbSet .Distinct() .Where(x => x.NotificationName.Equals(notificationName)) .Select(x => x.UserId) - .ToListAsync(); + .ToListAsync(GetCancellationToken(cancellationToken)); return subscribeUsers; } - public async Task InsertUserSubscriptionAsync(IEnumerable userSubscribes) + public async Task InsertUserSubscriptionAsync( + IEnumerable userSubscribes, + CancellationToken cancellationToken = default) { - await DbSet.AddRangeAsync(userSubscribes); + await DbSet.AddRangeAsync(userSubscribes, GetCancellationToken(cancellationToken)); } - public async Task DeleteUserSubscriptionAsync(string notificationName) + public async Task DeleteUserSubscriptionAsync( + string notificationName, + CancellationToken cancellationToken = default) { - var userSubscribes = await DbSet.Where(x => x.NotificationName.Equals(notificationName)).ToListAsync(); + var userSubscribes = await DbSet.Where(x => x.NotificationName.Equals(notificationName)) + .ToListAsync(GetCancellationToken(cancellationToken)); DbSet.RemoveRange(userSubscribes); } - public Task DeleteUserSubscriptionAsync(IEnumerable userSubscribes) + public Task DeleteUserSubscriptionAsync( + IEnumerable userSubscribes, + CancellationToken cancellationToken = default) { DbSet.RemoveRange(userSubscribes); return Task.CompletedTask; } - public async Task UserSubscribeExistsAysnc(string notificationName, Guid userId) + public virtual async Task DeleteUserSubscriptionAsync( + string notificationName, + IEnumerable userIds, + CancellationToken cancellationToken = default) { - return await DbSet.AnyAsync(x => x.UserId.Equals(userId) && x.NotificationName.Equals(notificationName)); + await DeleteAsync(usr => usr.NotificationName == notificationName && userIds.Contains(usr.UserId), + false, + GetCancellationToken(cancellationToken)); } - public virtual async Task> GetUserSubscribesAsync(Guid userId, string sorting = "Id", int skipCount = 1, int maxResultCount = 10) + public async Task UserSubscribeExistsAysnc( + string notificationName, + Guid userId, + CancellationToken cancellationToken = default) + { + return await DbSet + .AnyAsync(x => x.UserId.Equals(userId) && x.NotificationName.Equals(notificationName), + GetCancellationToken(cancellationToken)); + } + + public virtual async Task> GetUserSubscribesAsync( + Guid userId, + string sorting = "Id", + int skipCount = 1, + int maxResultCount = 10, + CancellationToken cancellationToken = default) { var userSubscribes = await DbSet .Distinct() @@ -104,17 +145,19 @@ namespace LINGYUN.Abp.MessageService.Subscriptions .OrderBy(sorting ?? nameof(UserSubscribe.Id)) .Page(skipCount, maxResultCount) .AsNoTracking() - .ToListAsync(); + .ToListAsync(GetCancellationToken(cancellationToken)); return userSubscribes; } - public virtual async Task GetCountAsync(Guid userId) + public virtual async Task GetCountAsync( + Guid userId, + CancellationToken cancellationToken = default) { var userSubscribedCount = await DbSet .Distinct() .Where(x => x.UserId.Equals(userId)) - .LongCountAsync(); + .LongCountAsync(GetCancellationToken(cancellationToken)); return userSubscribedCount; } diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Chat/MyFriendController.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Chat/MyFriendController.cs index bbb24a1e5..f7b5ce34c 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Chat/MyFriendController.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Chat/MyFriendController.cs @@ -24,6 +24,13 @@ namespace LINGYUN.Abp.MessageService.Chat await MyFriendAppService.CreateAsync(input); } + [HttpPost] + [Route("add-request")] + public virtual async Task AddRequestAsync(MyFriendAddRequestDto input) + { + await MyFriendAppService.AddRequestAsync(input); + } + [HttpDelete] public virtual async Task DeleteAsync(MyFriendOperationDto input) { diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Notifications/MyNotificationController.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Notifications/MyNotificationController.cs new file mode 100644 index 000000000..b1761ee5d --- /dev/null +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Notifications/MyNotificationController.cs @@ -0,0 +1,55 @@ +using LINGYUN.Abp.Notifications; +using Microsoft.AspNetCore.Mvc; +using System.Threading.Tasks; +using Volo.Abp; +using Volo.Abp.Application.Dtos; +using Volo.Abp.AspNetCore.Mvc; + +namespace LINGYUN.Abp.MessageService.Notifications +{ + [RemoteService(Name = AbpMessageServiceConsts.RemoteServiceName)] + [Route("api/my-notifilers")] + public class MyNotificationController : AbpController, IMyNotificationAppService + { + protected IMyNotificationAppService MyNotificationAppService { get; } + + public MyNotificationController( + IMyNotificationAppService myNotificationAppService) + { + MyNotificationAppService = myNotificationAppService; + } + + [HttpPost] + public virtual async Task SendNofiterAsync(NotificationSendDto input) + { + await MyNotificationAppService.SendNofiterAsync(input); + } + + [HttpDelete] + [Route("{id}")] + public virtual async Task DeleteAsync(long id) + { + await MyNotificationAppService.DeleteAsync(id); + } + + [HttpGet] + [Route("assignables")] + public virtual async Task> GetAssignableNotifiersAsync() + { + return await MyNotificationAppService.GetAssignableNotifiersAsync(); + } + + [HttpGet] + [Route("{id}")] + public virtual async Task GetAsync(long id) + { + return await MyNotificationAppService.GetAsync(id); + } + + [HttpGet] + public virtual async Task> GetListAsync(UserNotificationGetByPagedDto input) + { + return await MyNotificationAppService.GetListAsync(input); + } + } +} diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Notifications/NotificationController.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Notifications/NotificationController.cs deleted file mode 100644 index b96047ec6..000000000 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Notifications/NotificationController.cs +++ /dev/null @@ -1,56 +0,0 @@ -using LINGYUN.Abp.Notifications; -using Microsoft.AspNetCore.Mvc; -using System.Threading.Tasks; -using Volo.Abp; -using Volo.Abp.Application.Dtos; -using Volo.Abp.AspNetCore.Mvc; - -namespace LINGYUN.Abp.MessageService.Notifications -{ - [RemoteService(Name = AbpMessageServiceConsts.RemoteServiceName)] - [Route("api/notifications")] - public class NotificationController : AbpController, INotificationAppService - { - private readonly INotificationAppService _notificationAppService; - public NotificationController( - INotificationAppService notificationAppService) - { - _notificationAppService = notificationAppService; - } - - [HttpPut] - [Route("ChangeReadState")] - public virtual async Task ChangeUserNotificationReadStateAsync(UserNotificationChangeReadStateDto userNotificationChangeRead) - { - await _notificationAppService.ChangeUserNotificationReadStateAsync(userNotificationChangeRead); - } - - [HttpDelete] - [Route("{NotificationId}")] - public virtual async Task DeleteAsync(NotificationGetByIdDto notificationGetById) - { - await _notificationAppService.DeleteAsync(notificationGetById); - } - - [HttpDelete] - [Route("User/{NotificationId}")] - public virtual async Task DeleteUserNotificationAsync(NotificationGetByIdDto notificationGetById) - { - await _notificationAppService.DeleteUserNotificationAsync(notificationGetById); - } - - [HttpGet] - [Route("{NotificationId}")] - public virtual async Task GetAsync(NotificationGetByIdDto notificationGetById) - { - return await _notificationAppService.GetAsync(notificationGetById); - } - - [HttpGet] - [Route("User/{NotificationId}")] - public virtual async Task> GetUserNotificationsAsync(UserNotificationGetByPagedDto userNotificationGetByPaged) - { - return await _notificationAppService.GetUserNotificationsAsync(userNotificationGetByPaged); - } - } -} diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Subscriptions/MySubscriptionController.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Subscriptions/MySubscriptionController.cs new file mode 100644 index 000000000..26e767b5d --- /dev/null +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Subscriptions/MySubscriptionController.cs @@ -0,0 +1,53 @@ +using Microsoft.AspNetCore.Mvc; +using System.Threading.Tasks; +using Volo.Abp; +using Volo.Abp.Application.Dtos; +using Volo.Abp.AspNetCore.Mvc; + +namespace LINGYUN.Abp.MessageService.Subscriptions +{ + [RemoteService(Name = AbpMessageServiceConsts.RemoteServiceName)] + [Route("api/my-subscribes")] + public class MySubscriptionController : AbpController, IMySubscriptionAppService + { + private readonly IMySubscriptionAppService _subscriptionAppService; + + public MySubscriptionController( + IMySubscriptionAppService subscriptionAppService) + { + _subscriptionAppService = subscriptionAppService; + } + + [HttpGet] + [Route("all")] + public virtual async Task> GetAllListAsync() + { + return await _subscriptionAppService.GetAllListAsync(); + } + + [HttpGet] + public virtual async Task> GetListAsync(SubscriptionsGetByPagedDto input) + { + return await _subscriptionAppService.GetListAsync(input); + } + + [HttpGet] + [Route("is-subscribed/{Name}")] + public virtual async Task IsSubscribedAsync(SubscriptionsGetByNameDto input) + { + return await _subscriptionAppService.IsSubscribedAsync(input); + } + + [HttpPost] + public virtual async Task SubscribeAsync(SubscriptionsGetByNameDto input) + { + await _subscriptionAppService.SubscribeAsync(input); + } + + [HttpDelete] + public virtual async Task UnSubscribeAsync(SubscriptionsGetByNameDto input) + { + await _subscriptionAppService.UnSubscribeAsync(input); + } + } +} diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Subscriptions/SubscriptionController.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Subscriptions/SubscriptionController.cs deleted file mode 100644 index 2c09799d2..000000000 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.HttpApi/LINGYUN/Abp/MessageService/Subscriptions/SubscriptionController.cs +++ /dev/null @@ -1,47 +0,0 @@ -using LINGYUN.Abp.Notifications; -using Microsoft.AspNetCore.Mvc; -using System.Threading.Tasks; -using Volo.Abp; -using Volo.Abp.Application.Dtos; -using Volo.Abp.AspNetCore.Mvc; - -namespace LINGYUN.Abp.MessageService.Subscriptions -{ - [RemoteService(Name = AbpMessageServiceConsts.RemoteServiceName)] - [Route("api/subscribes")] - public class SubscriptionController : AbpController, ISubscriptionAppService - { - private readonly ISubscriptionAppService _subscriptionAppService; - - public SubscriptionController( - ISubscriptionAppService subscriptionAppService) - { - _subscriptionAppService = subscriptionAppService; - } - - [HttpGet] - public virtual async Task> GetSubscribedsAsync(SubscriptionsGetByPagedDto subscriptionsGetByPaged) - { - return await _subscriptionAppService.GetSubscribedsAsync(subscriptionsGetByPaged); - } - - [HttpGet] - [Route("IsSubscribed/{NotificationName}")] - public virtual async Task IsSubscribedAsync(SubscriptionsGetByNameDto subscriptionsGetByName) - { - return await _subscriptionAppService.IsSubscribedAsync(subscriptionsGetByName); - } - - [HttpPost] - public virtual async Task SubscribeAsync(SubscriptionsGetByNameDto subscriptionsGetByName) - { - await _subscriptionAppService.SubscribeAsync(subscriptionsGetByName); - } - - [HttpDelete] - public virtual async Task UnSubscribeAsync(SubscriptionsGetByNameDto subscriptionsGetByName) - { - await _subscriptionAppService.UnSubscribeAsync(subscriptionsGetByName); - } - } -} diff --git a/aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN.Abp.WeChat.csproj b/aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN.Abp.WeChat.csproj new file mode 100644 index 000000000..a31890133 --- /dev/null +++ b/aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN.Abp.WeChat.csproj @@ -0,0 +1,24 @@ + + + + + + netstandard2.0 + + + + + + + + + + + + + + + + + + diff --git a/aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/AbpWeChatModule.cs b/aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/AbpWeChatModule.cs new file mode 100644 index 000000000..74bb1c0f0 --- /dev/null +++ b/aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/AbpWeChatModule.cs @@ -0,0 +1,27 @@ +using LINGYUN.Abp.WeChat.Localization; +using Volo.Abp.Features; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Volo.Abp.VirtualFileSystem; + +namespace LINGYUN.Abp.WeChat +{ + [DependsOn(typeof(AbpFeaturesModule))] + public class AbpWeChatModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + + Configure(options => + { + options.Resources + .Add("zh-Hans") + .AddVirtualJson("/LINGYUN/Abp/WeChat/Localization/Resources"); + }); + } + } +} diff --git a/aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Features/WeChatFeatureDefinitionProvider.cs b/aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Features/WeChatFeatureDefinitionProvider.cs new file mode 100644 index 000000000..3a255e923 --- /dev/null +++ b/aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Features/WeChatFeatureDefinitionProvider.cs @@ -0,0 +1,19 @@ +using LINGYUN.Abp.WeChat.Localization; +using Volo.Abp.Features; +using Volo.Abp.Localization; + +namespace LINGYUN.Abp.WeChat.Features +{ + public class WeChatFeatureDefinitionProvider : FeatureDefinitionProvider + { + public override void Define(IFeatureDefinitionContext context) + { + context.AddGroup(WeChatFeatures.GroupName, L("Features:WeChat")); + } + + protected LocalizableString L(string name) + { + return LocalizableString.Create(name); + } + } +} diff --git a/aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Features/WeChatFeatures.cs b/aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Features/WeChatFeatures.cs new file mode 100644 index 000000000..497ddad1c --- /dev/null +++ b/aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Features/WeChatFeatures.cs @@ -0,0 +1,7 @@ +namespace LINGYUN.Abp.WeChat.Features +{ + public static class WeChatFeatures + { + public const string GroupName = "Abp.WeChat"; + } +} diff --git a/aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Localization/Resources/en.json b/aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Localization/Resources/en.json new file mode 100644 index 000000000..1d424e365 --- /dev/null +++ b/aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Localization/Resources/en.json @@ -0,0 +1,6 @@ +{ + "culture": "en", + "texts": { + "Features:WeChat": "WeChat" + } +} \ No newline at end of file diff --git a/aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Localization/Resources/zh-Hans.json b/aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Localization/Resources/zh-Hans.json new file mode 100644 index 000000000..c7811659b --- /dev/null +++ b/aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Localization/Resources/zh-Hans.json @@ -0,0 +1,6 @@ +{ + "culture": "zh-Hans", + "texts": { + "Features:WeChat": "微信开发" + } +} \ No newline at end of file diff --git a/aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Localization/WeChatResource.cs b/aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Localization/WeChatResource.cs new file mode 100644 index 000000000..764c804bc --- /dev/null +++ b/aspnet-core/modules/wechat/LINGYUN.Abp.WeChat/LINGYUN/Abp/WeChat/Localization/WeChatResource.cs @@ -0,0 +1,9 @@ +using Volo.Abp.Localization; + +namespace LINGYUN.Abp.WeChat.Localization +{ + [LocalizationResourceName("WeChat")] + public class WeChatResource + { + } +} diff --git a/aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/event-bus-cap.db b/aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/event-bus-cap.db index e31aebbf53c0f08566e37e0a15f9dd035601480f..f25a991e6b2790e162ce85629a45615e4fc30df6 100644 GIT binary patch literal 40960 zcmeHQTWlQF8J@MBjg#0cESJzqZH845i5d^*Hdm=4i(?YY&c-+nB2ER~*n_j+*v4K5 zQk1q7gLnYm5UTosRMCo;st<)qeSxTbXjQ4IO8Zn*l`2(5YE`LHE7Yoa=yzsjXJ_s8 z?i#$>DV&9k_un%+^UpWm{O303`_DZ*S*iN^6Dw<1%2l0fw`!S;c0$)RO}mNrLA(#( z-50$F@VEBL)IPNMds8!nKAiivHZWAwZrPW6f2cV8%NE?*vYhC zU90%(b2@xFN@?R!gDr{+3qIUlC|CVz<%%C4BPbkucD1tRuNSe~c!Q+h!A9q* zP8-a9FW8y=hwr^N^Ae4(;j};RSFVPau=crc`xUGeb^ihi(i)PvQ)??5t6MI366^F| zbhGstHoNF{U-t0Cy{#^K?Fxn0yk_+yqzuZivJdaR+(+``VD7)Uj|N`u`-(KSyaxZ1 zz3usa`qIV0(a|IM={JA)^^^b5uF}cz(y0sQOGa_Eatb%VGv#Z>*j3y`4{of>?-s-F zaBDqLSscAwUS9Nr;*;fSx&D)p(<|#$<0^fwaM~{~;8rhq&lNz>k@@n{(xvkJQzOf` zl?&eT#?sR9py0~-;z(to;1wumgt?qi%XT^CoS0UjzDfAA!Y6Ptv9s#6RrpXid+AAk zz8ZbMj#HI4J-&w@;BW&U+rh|R2L<) z@!fXF3fGSp9w{$vz=P)sK-HhAdox1G2s3AD-WY-~&RsWls<^s3E-{=LJ2x{@oSK54 zXZ-5r75Uwnm4(U^*YHhrx?W-0pI+Ih`i1M)<(ZC9O&k72cJp+0DCEV3fETk9uMWPo znhsttVKS4r7UhIkj&P#OAo1)4FF4gf3S11rTJT~Ar}vx}oX*s|FiF~&qX!V)5r*@jC^obDc%sA&+FyO!Bmbv3%?qwZ@}T_w1LeN!rgyNyXG zur14>R-H(v`(q-F21F{lX(AGJ1mT35PHO5m(-ZB8)Wqp-5lMQ3pu`Da>ZpR-1(Cvi zQ-^YAYfwUwWe`W8`m0lEysu6rG@)lFj=lJ$6vZUsP)1R~5z}Sqh)Jf$NSm0{#Odx) zi4ntgY~tGX-cyNDg9r=Ng1sdw0R(0^Hsxq9CAgGn;L?S!{`Q^6PNbySOygOqqn@i^M6}L36!Z2 zPzWdl6aoqXg@8gpA)pXY2q**;0t$iMA&_}0KXvHM2W}9pplO-MV7zkqn?$<@#>4q3 z?e+IGqUkVB!npoEN{+y=^QD{L{rm}{-Hn6&0mkZwFb>1`HH;H4<2QG~_-VfM_wT(5 z<4zdw=1YIO^Dj4ub_a~N^QFJO|1JFHb{OA*@#NjuEDz%~7>|yk+RB8$`Qhs6U&@&wfq(7~{pmp>gd`cflBnjGw*s=T+@cXiVPm zxwlregP}2TQ~u^aWc-n1v%$!C`wf)rkBnfdH5(bhWZAyR2xdD5A|n{F?vIRM%(3rK zfA&B=8Z;V)*TH$nzv`tBPzWdl6aoqXg@8gpA)pXY2q**;0tx|zz^4)cIsdQv|DVcB zt4>NGpb$_9Cy)5Kssx1QY@>0&@O8izWZV?;N^(;0xK`?Xdno-d=rB z2*e1e_5X__9qK|Pmc_SO)Ye3_VDA?qsrCQ6kQkAw3{95O_gG3ot^dcWb+!IKsi~7# zxVyWsq}KmSITW@2Uuri=ai)(=B(?ru@<^@!uj_n$0xGHX|Dcju|Nn`&R9_X}s@eTn zTmN6z-3t5vo;LjMp$hu{9}K+I=f(Xy^+6%9BLbV_Lk%hXrDP3xPC`wGxHg!RfAa{v&S;i$T#wbf#$2UKBD^*^2iK;XlC|6m7yH#~`)| zp{;rp+8jT$g-gNmsMK%?3Zon{TQ;;)Qo<$2Guv^giPPQUlJv&l4&xSQ9Vy!Ef=j`^ z1=JTonxr}sxP&4Hx~9b8EWxGI2V*W3rP5Zox-K1D5~kGAvl+CJ@S*4GNTDDn;u3Au zI%@88SGa`Ulk~=594bZT9;zeN&(vV130cx4mBOPkXtps|G>Enxh^ZuXk7vWRnQ5UC zlQK`lrj~^un}RA1Ft!Uz7)fp7bhoG!gbwCHfwn_|+g<4Y1^Wj2kUZTgB^eai0s0WB`-0)VIYM_j7uZU-yFQ^O^TIRx6a5Z<&?!X?|o1YF!Q3B=`-dhBwBr-{?u z;*#{nfcmwdoz-xiww4fp!(Cez&~IpY*NPw|Y1($ZwIuuhnc*L3_+Pyg0tx|zfI>ha zpb$_9C$|^x96xhfWhGz=ugqpf5CX}3yjYNG@Ln!$u4MBz|Jb09n z7==`{?FiMx>2489dSe7F5KD9^Mg@nkkrNoXI=4^?MGjJu3b3s{m4-w}TA0H2nV?A> zNkgZEQg~W~BP|#c$QSAKx=Af#6!92G&9`%t8ZoM=(_Nudy)5ct1DU~{|> zHIgm{J-R55P&yh(rezDu#WD$s2k}_1pZ~|;9Ud4&ThnZjw4J)mo!N9Pd zr}T(R7Y60Jq$rD7O1Na29Nt={i+MxZ^TA8RCCg*N6Rg!p6BYg&<%^$+0n&>cm|7A2=Q+(f|Me delta 3220 zcmeHKO=w(I6ux;GCYj97o0*_A#@azft3odK|L1Ki7Kte&ZJE^4refM8QgovWLD1Gj zhCri2<)L)p&bTRLk;bhxf{QL(#DEJIF50DTT3je}k>scfHkJ@A_o*E<$Jw?h@R?pFE?7?rtw``eQ@>L-+!X`VYg};>6C;dc!+Jrn)ng zO0lsvOxG7ij~_qMJky@&Y_`Hvm)7f)5UQmz!boX|A>j}8)iK?oDxfT&DtvQk@?g!y zjdKk>pVnYWrLr`<-*}0TDV86`l4;JYWrUF_3MrF47aOItW+uF{JW)K;Zk}rQz+s9D zEw$yA^}!)FhtpdFaGEI`Vlfj$YNo>njp>s;cp$@t)I`Yxcpzn{FpTid+e=F;E6Xd( z-I=jI$~u3%`(F3Hqs%8tGtPu%LTJuKNLNz!FG%1sezL%VDPvSG$WlMZ{okfzkaeOsCD2hS6fiAgA_1ffxDBX` zh&)i^hy;{L4JJ$p77-bt#13Vau6F(1?E(`QQ8B__zEo{Tu#={?+)Zed?~ACtJ#YABxX6=We%u-X*9C!7KzG zTP3Ih!LjDt*T3FA2ElM~2;TWGKHqGidJ=qmv)w{|61;j3GPNXlp|jjV)g*8_fhtMh z-cnSKg7|fKHj<#Dz@VGENQ)kWz_lEW0)lG7EgHE+hFasLC(y7LpyGaE-3#Jtd+lj2 z3@+6{1OAt!UWxp#N)k-(z1~$5k4Cg=4#SZpgB2Gy7V2ppgFY%nqosZtmU?~?TTQ{i@Jv*B z`cTkY$slL5ws&XBAdH1~Vu0r&FEsbd>xaT`*Eedyf&-wIz=wh{al^@4j0D66j5>Uk z-inakSg5o4G>;V+2oj!t?L-5x<=+B0u~YhB-WxvqNM)yR?PbqHXy-zAvrv!8+e6i_ z%9l%z7x%W;c8ia8XX^QGikzBL?bN9;E{WDK=dgidgt6HYu%6uOQwBGe)`a--E8{G- zMJ|siSOF6;n0Su-ET)`-w-6bJu~CbT3CO_8?%~iMKGqsW++>`Snj4+3_!J~nm?~mzpL?qffOIP^qmf8!j0Uj% zhL;D>_r&nBzM34RtHD}HNudLoeT%7#bK1g~4|+^USxl6&jQ3Jm9YE=JZ;Fyy@XnkY zW)$gdHVb5ivcD!r>1wdB8oZ1%OHsp5X3iXP5*i@@&7d=fl+kV&bk=Zq$K40!7LCB| S{^@W(N4D1<48dsse)vz5%oJb% diff --git a/aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/ApiGatewayHttpApiHostModule.cs b/aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/ApiGatewayHttpApiHostModule.cs index c276632cb..dc2992118 100644 --- a/aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/ApiGatewayHttpApiHostModule.cs +++ b/aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/ApiGatewayHttpApiHostModule.cs @@ -200,6 +200,7 @@ namespace LINGYUN.ApiGateway public override void OnApplicationInitialization(ApplicationInitializationContext context) { var app = context.GetApplicationBuilder(); + var configuration = context.GetConfiguration(); // http调用链 app.UseCorrelationId(); // 虚拟文件系统 @@ -225,7 +226,7 @@ namespace LINGYUN.ApiGateway // 路由 app.UseConfiguredEndpoints(); - if (context.GetEnvironment().IsDevelopment()) + if (configuration.GetSection("ApiGateway:SeedInitScript").Get()) { SeedData(context); } diff --git a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/AbpMessageServiceHttpApiHostModule.cs b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/AbpMessageServiceHttpApiHostModule.cs index a9d571ad5..3d760bd27 100644 --- a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/AbpMessageServiceHttpApiHostModule.cs +++ b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/AbpMessageServiceHttpApiHostModule.cs @@ -1,5 +1,6 @@ using DotNetCore.CAP; using Hangfire; +using LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json; using LINGYUN.Abp.BackgroundJobs.Hangfire; using LINGYUN.Abp.EventBus.CAP; using LINGYUN.Abp.ExceptionHandling; @@ -60,6 +61,7 @@ namespace LINGYUN.Abp.MessageService typeof(AbpNotificationsSignalRModule), typeof(AbpNotificationsWeChatWeAppModule), typeof(AbpNotificationsExceptionHandlingModule), + typeof(AbpAspNetCoreSignalRProtocolJsonModule), typeof(AbpCAPEventBusModule), typeof(AbpBackgroundJobsHangfireModule), typeof(AbpHangfireMySqlStorageModule), diff --git a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/ChatMessageEventHandler.cs b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/ChatMessageEventHandler.cs new file mode 100644 index 000000000..eeafa90a0 --- /dev/null +++ b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/ChatMessageEventHandler.cs @@ -0,0 +1,52 @@ +using LINGYUN.Abp.IM; +using LINGYUN.Abp.IM.Messages; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; +using Microsoft.Extensions.Options; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; +using Volo.Abp.EventBus.Distributed; + +namespace LINGYUN.Abp.MessageService.EventBus.Distributed +{ + public class ChatMessageEventHandler : IDistributedEventHandler, ITransientDependency + { + /// + /// Reference to . + /// + public ILogger Logger { get; set; } + /// + /// Reference to . + /// + protected AbpIMOptions Options { get; } + + protected IMessageStore MessageStore { get; } + protected IMessageSenderProviderManager MessageSenderProviderManager { get; } + + public ChatMessageEventHandler( + IOptions options, + IMessageStore messageStore, + IMessageSenderProviderManager messageSenderProviderManager) + { + Options = options.Value; + MessageStore = messageStore; + MessageSenderProviderManager = messageSenderProviderManager; + + Logger = NullLogger.Instance; + } + + public virtual async Task HandleEventAsync(ChatMessage eventData) + { + Logger.LogDebug($"Persistent chat message."); + + await MessageStore.StoreMessageAsync(eventData); + + // 发送消息 + foreach (var provider in MessageSenderProviderManager.Providers) + { + Logger.LogDebug($"Sending message with provider {provider.Name}"); + await provider.SendMessageAsync(eventData); + } + } + } +} diff --git a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/NotificationEventHandler.cs b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/NotificationEventHandler.cs index ec9408620..7e367046e 100644 --- a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/NotificationEventHandler.cs +++ b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/NotificationEventHandler.cs @@ -1,4 +1,5 @@ -using LINGYUN.Abp.Notifications; +using LINGYUN.Abp.MessageService.Utils; +using LINGYUN.Abp.Notifications; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; @@ -9,6 +10,7 @@ using System.Threading.Tasks; using Volo.Abp.BackgroundJobs; using Volo.Abp.DependencyInjection; using Volo.Abp.EventBus.Distributed; +using Volo.Abp.Json; using Volo.Abp.Uow; namespace LINGYUN.Abp.MessageService.EventBus.Distributed @@ -31,6 +33,14 @@ namespace LINGYUN.Abp.MessageService.EventBus.Distributed /// protected AbpNotificationOptions Options { get; } /// + /// Reference to . + /// + protected IJsonSerializer JsonSerializer { get; } + /// + /// Reference to . + /// + protected ISnowflakeIdGenerator SnowflakeIdGenerator { get; } + /// /// Reference to . /// protected IBackgroundJobManager BackgroundJobManager { get; } @@ -39,6 +49,10 @@ namespace LINGYUN.Abp.MessageService.EventBus.Distributed /// protected INotificationStore NotificationStore { get; } /// + /// Reference to . + /// + protected INotificationDefinitionManager NotificationDefinitionManager { get; } + /// /// Reference to . /// protected INotificationSubscriptionManager NotificationSubscriptionManager { get; } @@ -51,15 +65,21 @@ namespace LINGYUN.Abp.MessageService.EventBus.Distributed /// Initializes a new instance of the class. /// public NotificationEventHandler( + IJsonSerializer jsonSerializer, IBackgroundJobManager backgroundJobManager, IOptions options, INotificationStore notificationStore, + ISnowflakeIdGenerator snowflakeIdGenerator, + INotificationDefinitionManager notificationDefinitionManager, INotificationSubscriptionManager notificationSubscriptionManager, INotificationPublishProviderManager notificationPublishProviderManager) { - BackgroundJobManager = backgroundJobManager; Options = options.Value; + JsonSerializer = jsonSerializer; + BackgroundJobManager = backgroundJobManager; NotificationStore = notificationStore; + SnowflakeIdGenerator = snowflakeIdGenerator; + NotificationDefinitionManager = notificationDefinitionManager; NotificationSubscriptionManager = notificationSubscriptionManager; NotificationPublishProviderManager = notificationPublishProviderManager; @@ -69,12 +89,31 @@ namespace LINGYUN.Abp.MessageService.EventBus.Distributed [UnitOfWork] public virtual async Task HandleEventAsync(NotificationEventData eventData) { - var notificationInfo = eventData.ToNotificationInfo(); + var notification = NotificationDefinitionManager.Get(eventData.Name); + + var notificationInfo = new NotificationInfo + { + Name = notification.Name, + CreationTime = eventData.CreationTime, + Data = eventData.Data, + Severity = eventData.Severity, + Lifetime = notification.NotificationLifetime, + TenantId = eventData.TenantId, + Type = notification.NotificationType + }; + notificationInfo.SetId(SnowflakeIdGenerator.Create()); + + notificationInfo.Data = NotificationDataConverter.Convert(notificationInfo.Data); + + Logger.LogDebug($"Persistent notification {notificationInfo.Name}"); + + // 持久化通知 + await NotificationStore.InsertNotificationAsync(notificationInfo); var providers = Enumerable .Reverse(NotificationPublishProviderManager.Providers); - await PublishFromProvidersAsync(providers, notificationInfo); + await PublishFromProvidersAsync(providers, eventData.Users, notificationInfo); } /// @@ -83,43 +122,54 @@ namespace LINGYUN.Abp.MessageService.EventBus.Distributed /// 提供者列表 /// 通知信息 /// - protected async Task PublishFromProvidersAsync(IEnumerable providers, + protected async Task PublishFromProvidersAsync( + IEnumerable providers, + IEnumerable users, NotificationInfo notificationInfo) { - Logger.LogDebug($"Persistent notification {notificationInfo.Name}"); - - // 持久化通知 - await NotificationStore.InsertNotificationAsync(notificationInfo); - - // TODO: 某些情况下,不能直接在服务内订阅消息,目前只能通过将订阅内容放进消息内部,需要重构通知系统设计了 - if (notificationInfo.Data.HasUserNotification(out Guid userId, out string userName)) + // 检查是够已订阅消息 + Logger.LogDebug($"Gets a list of user subscriptions {notificationInfo.Name}"); + List userSubscriptions; + if (users == null) { - await NotificationSubscriptionManager.SubscribeAsync(notificationInfo.TenantId, - new UserIdentifier(userId, userName), notificationInfo.Name); + // 获取用户订阅列表 + userSubscriptions = await NotificationSubscriptionManager + .GetUserSubscriptionsAsync(notificationInfo.TenantId, notificationInfo.Name); } - - Logger.LogDebug($"Gets a list of user subscriptions {notificationInfo.Name}"); - // 获取用户订阅列表 - var userSubscriptions = await NotificationSubscriptionManager.GetSubscriptionsAsync(notificationInfo.TenantId, notificationInfo.Name); - - Logger.LogDebug($"Persistent user notifications {notificationInfo.Name}"); - // 持久化用户通知 - var subscriptionUserIdentifiers = userSubscriptions.Select(us => new UserIdentifier(us.UserId, us.UserName)); - - await NotificationStore.InsertUserNotificationsAsync(notificationInfo, - subscriptionUserIdentifiers.Select(u => u.UserId)); - - // 发布通知 - foreach (var provider in providers) + else { - await PublishAsync(provider, notificationInfo, subscriptionUserIdentifiers); + // 过滤未订阅的用户 + userSubscriptions = await NotificationSubscriptionManager + .GetUsersSubscriptionsAsync(notificationInfo.TenantId, notificationInfo.Name, users); } - if (notificationInfo.Lifetime == NotificationLifetime.OnlyOne) + users = userSubscriptions.Select(us => new UserIdentifier(us.UserId, us.UserName)); + + if (users.Count() > 0) { - // 一次性通知在发送完成后就取消用户订阅 - await NotificationStore.DeleteAllUserSubscriptionAsync(notificationInfo.TenantId, - notificationInfo.Name); + // 持久化用户通知 + Logger.LogDebug($"Persistent user notifications {notificationInfo.Name}"); + await NotificationStore + .InsertUserNotificationsAsync( + notificationInfo, + users.Select(u => u.UserId)); + + // 发布通知 + foreach (var provider in providers) + { + await PublishAsync(provider, notificationInfo, users, async () => + { + if (notificationInfo.Lifetime == NotificationLifetime.OnlyOne) + { + // 一次性通知在发送完成后就取消用户订阅 + await NotificationStore + .DeleteUserSubscriptionAsync( + notificationInfo.TenantId, + users, + notificationInfo.Name); + } + }); + } } } /// @@ -129,14 +179,17 @@ namespace LINGYUN.Abp.MessageService.EventBus.Distributed /// 通知信息 /// 订阅用户列表 /// - protected async Task PublishAsync(INotificationPublishProvider provider, NotificationInfo notificationInfo, - IEnumerable subscriptionUserIdentifiers) + protected async Task PublishAsync( + INotificationPublishProvider provider, + NotificationInfo notificationInfo, + IEnumerable subscriptionUserIdentifiers, + Action callback = null) { try { Logger.LogDebug($"Sending notification with provider {provider.Name}"); var notifacationDataMapping = Options.NotificationDataMappings - .GetMapItemOrNull(provider.Name, notificationInfo.CateGory); + .GetMapItemOrNull(notificationInfo.Name, provider.Name); if (notifacationDataMapping != null) { notificationInfo.Data = notifacationDataMapping.MappingFunc(notificationInfo.Data); @@ -161,6 +214,10 @@ namespace LINGYUN.Abp.MessageService.EventBus.Distributed subscriptionUserIdentifiers.ToList(), notificationInfo.TenantId)); } + finally + { + callback?.Invoke(); + } } } } diff --git a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/TenantCreateEventHandler.cs b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/TenantCreateEventHandler.cs index f7aeb94ec..ec1fa8927 100644 --- a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/TenantCreateEventHandler.cs +++ b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/TenantCreateEventHandler.cs @@ -20,14 +20,12 @@ namespace LINGYUN.Abp.MessageService.EventBus.Distributed protected ICurrentTenant CurrentTenant { get; } protected ISettingProvider SettingProvider { get; } protected IStringLocalizer StringLocalizer { get; } - protected INotificationDispatcher NotificationDispatcher { get; } - protected INotificationSubscriptionManager NotificationSubscriptionManager { get; } + protected INotificationSender NotificationSender { get; } public TenantCreateEventHandler( ICurrentTenant currentTenant, ISettingProvider settingProvider, - INotificationDispatcher notificationDispatcher, - INotificationSubscriptionManager notificationSubscriptionManager, + INotificationSender notificationSender, IStringLocalizer stringLocalizer, ILogger logger) { @@ -35,8 +33,7 @@ namespace LINGYUN.Abp.MessageService.EventBus.Distributed CurrentTenant = currentTenant; SettingProvider = settingProvider; StringLocalizer = stringLocalizer; - NotificationDispatcher = notificationDispatcher; - NotificationSubscriptionManager = notificationSubscriptionManager; + NotificationSender = notificationSender; } public async Task HandleEventAsync(CreateEventData eventData) @@ -49,21 +46,22 @@ namespace LINGYUN.Abp.MessageService.EventBus.Distributed // 使用系统区域语言发布通知 using (CultureHelper.Use(userDefaultCultureName, userDefaultCultureName)) { - var noticeNormalizerName = NotificationNameNormalizer.NormalizerName(TenantNotificationNames.NewTenantRegistered); var tenantAdminUserIdentifier = new UserIdentifier(eventData.AdminUserId, eventData.AdminEmailAddress); - // 管理用户订阅租户创建通知 - await NotificationSubscriptionManager.SubscribeAsync(eventData.Id, tenantAdminUserIdentifier, noticeNormalizerName.Name); - - var notificationData = NotificationData.CreateTenantNotificationData(eventData.Id); + var notificationData = new NotificationData(); notificationData.WriteStandardData( L("NewTenantRegisteredNotificationTitle"), L("NewTenantRegisteredNotificationMessage", eventData.Name), DateTime.Now, eventData.AdminEmailAddress); // 发布租户创建通知 - await NotificationDispatcher.DispatchAsync(noticeNormalizerName, notificationData, - eventData.Id, NotificationSeverity.Success); + await NotificationSender + .SendNofiterAsync( + TenantNotificationNames.NewTenantRegistered, + notificationData, + tenantAdminUserIdentifier, + eventData.Id, + NotificationSeverity.Success); } } diff --git a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Hangfire/HangfireDashboardRouteOptions.cs b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Hangfire/HangfireDashboardRouteOptions.cs index 3aa788757..596fbd634 100644 --- a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Hangfire/HangfireDashboardRouteOptions.cs +++ b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Hangfire/HangfireDashboardRouteOptions.cs @@ -56,19 +56,19 @@ namespace Hangfire private void InitDefaultRoutes() { - WithPermission("/hangfire", AbpMessageServicePermissions.Hangfire.Default); - WithPermission("/stats", AbpMessageServicePermissions.Hangfire.Default); - WithPermission("/servers", AbpMessageServicePermissions.Hangfire.Default); - WithPermission("/retries", AbpMessageServicePermissions.Hangfire.Default); - WithPermission("/recurring", AbpMessageServicePermissions.Hangfire.Default); - WithPermission("/jobs/enqueued", AbpMessageServicePermissions.Hangfire.ManageQueue); - WithPermission("/jobs/processing", AbpMessageServicePermissions.Hangfire.ManageQueue); - WithPermission("/jobs/scheduled", AbpMessageServicePermissions.Hangfire.ManageQueue); - WithPermission("/jobs/failed", AbpMessageServicePermissions.Hangfire.ManageQueue); - WithPermission("/jobs/deleted", AbpMessageServicePermissions.Hangfire.ManageQueue); - WithPermission("/jobs/awaiting", AbpMessageServicePermissions.Hangfire.ManageQueue); - WithPermission("/jobs/actions", AbpMessageServicePermissions.Hangfire.ManageQueue); - WithPermission("/jobs/details", AbpMessageServicePermissions.Hangfire.ManageQueue); + WithPermission("/hangfire", MessageServicePermissions.Hangfire.Default); + WithPermission("/stats", MessageServicePermissions.Hangfire.Default); + WithPermission("/servers", MessageServicePermissions.Hangfire.Default); + WithPermission("/retries", MessageServicePermissions.Hangfire.Default); + WithPermission("/recurring", MessageServicePermissions.Hangfire.Default); + WithPermission("/jobs/enqueued", MessageServicePermissions.Hangfire.ManageQueue); + WithPermission("/jobs/processing", MessageServicePermissions.Hangfire.ManageQueue); + WithPermission("/jobs/scheduled", MessageServicePermissions.Hangfire.ManageQueue); + WithPermission("/jobs/failed", MessageServicePermissions.Hangfire.ManageQueue); + WithPermission("/jobs/deleted", MessageServicePermissions.Hangfire.ManageQueue); + WithPermission("/jobs/awaiting", MessageServicePermissions.Hangfire.ManageQueue); + WithPermission("/jobs/actions", MessageServicePermissions.Hangfire.ManageQueue); + WithPermission("/jobs/details", MessageServicePermissions.Hangfire.ManageQueue); } } } diff --git a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/LINGYUN.Abp.MessageService.HttpApi.Host.csproj b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/LINGYUN.Abp.MessageService.HttpApi.Host.csproj index d6a28c954..d69092ad6 100644 --- a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/LINGYUN.Abp.MessageService.HttpApi.Host.csproj +++ b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/LINGYUN.Abp.MessageService.HttpApi.Host.csproj @@ -42,6 +42,7 @@ + diff --git a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Localization/HttpApiHost/en.json b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Localization/HttpApiHost/en.json index 4c657e174..26ddf61ad 100644 --- a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Localization/HttpApiHost/en.json +++ b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Localization/HttpApiHost/en.json @@ -2,8 +2,6 @@ "culture": "en", "texts": { "NewTenantRegisteredNotificationTitle": "Tenants create notification", - "NewTenantRegisteredNotificationMessage": "New tenants to create success, the tenant name: {0}!", - "Permission:Hangfire": "Hangfire dashboard", - "Permission:ManageQueue": "Manage queue" + "NewTenantRegisteredNotificationMessage": "New tenants to create success, the tenant name: {0}!" } -} \ No newline at end of file +} diff --git a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Localization/HttpApiHost/zh-Hans.json b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Localization/HttpApiHost/zh-Hans.json index 746d37822..d7b22055b 100644 --- a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Localization/HttpApiHost/zh-Hans.json +++ b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Localization/HttpApiHost/zh-Hans.json @@ -2,8 +2,6 @@ "culture": "zh-Hans", "texts": { "NewTenantRegisteredNotificationTitle": "租户创建通知", - "NewTenantRegisteredNotificationMessage": "新租户创建成功,租户名称:{0}!", - "Permission:Hangfire": "Hangfire仪表板", - "Permission:ManageQueue": "管理队列" + "NewTenantRegisteredNotificationMessage": "新租户创建成功,租户名称:{0}!" } -} \ No newline at end of file +} diff --git a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20201029102936_Add-UserChatFriend-Column-Description.Designer.cs b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20201029102936_Add-UserChatFriend-Column-Description.Designer.cs new file mode 100644 index 000000000..0ee715669 --- /dev/null +++ b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20201029102936_Add-UserChatFriend-Column-Description.Designer.cs @@ -0,0 +1,588 @@ +// +using System; +using LINGYUN.Abp.MessageService.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +namespace LINGYUN.Abp.MessageService.Migrations +{ + [DbContext(typeof(MessageServiceHostMigrationsDbContext))] + [Migration("20201029102936_Add-UserChatFriend-Column-Description")] + partial class AddUserChatFriendColumnDescription + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) + .HasAnnotation("ProductVersion", "3.1.7") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatCard", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("Age") + .HasColumnType("int"); + + b.Property("AvatarUrl") + .HasColumnType("varchar(512) CHARACTER SET utf8mb4") + .HasMaxLength(512); + + b.Property("Birthday") + .HasColumnType("datetime(6)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("varchar(40) CHARACTER SET utf8mb4") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("char(36)"); + + b.Property("Description") + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("char(36)"); + + b.Property("NickName") + .HasColumnType("varchar(256) CHARACTER SET utf8mb4") + .HasMaxLength(256); + + b.Property("Sex") + .HasColumnType("int"); + + b.Property("Sign") + .HasColumnType("varchar(30) CHARACTER SET utf8mb4") + .HasMaxLength(30); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("varchar(256) CHARACTER SET utf8mb4") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AppUserChatCards"); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatFriend", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("Black") + .HasColumnType("tinyint(1)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("varchar(40) CHARACTER SET utf8mb4") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("char(36)"); + + b.Property("Description") + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("DontDisturb") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("FrientId") + .HasColumnType("char(36)"); + + b.Property("RemarkName") + .HasColumnType("varchar(256) CHARACTER SET utf8mb4") + .HasMaxLength(256); + + b.Property("SpecialFocus") + .HasColumnType("tinyint(1)"); + + b.Property("Status") + .HasColumnType("tinyint unsigned"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId", "FrientId"); + + b.ToTable("AppUserChatFriends"); + }); + + 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") + .HasColumnName("TenantId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AppUserChatSettings"); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("Content") + .IsRequired() + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasMaxLength(1048576); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorId") + .HasColumnType("char(36)"); + + b.Property("MessageId") + .HasColumnType("bigint"); + + b.Property("ReceiveUserId") + .HasColumnType("char(36)"); + + b.Property("SendState") + .HasColumnType("tinyint"); + + b.Property("SendUserName") + .IsRequired() + .HasColumnType("varchar(64) CHARACTER SET utf8mb4") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ReceiveUserId"); + + b.ToTable("AppUserMessages"); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Group.ChatGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("Address") + .HasColumnType("varchar(256) CHARACTER SET utf8mb4") + .HasMaxLength(256); + + b.Property("AdminUserId") + .HasColumnType("char(36)"); + + b.Property("AllowAnonymous") + .HasColumnType("tinyint(1)"); + + b.Property("AllowSendMessage") + .HasColumnType("tinyint(1)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("char(36)"); + + b.Property("Description") + .HasColumnType("varchar(128) CHARACTER SET utf8mb4") + .HasMaxLength(128); + + b.Property("GroupId") + .HasColumnType("bigint"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("char(36)"); + + b.Property("MaxUserCount") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(20) CHARACTER SET utf8mb4") + .HasMaxLength(20); + + b.Property("Notice") + .HasColumnType("varchar(64) CHARACTER SET utf8mb4") + .HasMaxLength(64); + + b.Property("Tag") + .HasColumnType("varchar(512) CHARACTER SET utf8mb4") + .HasMaxLength(512); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name"); + + b.ToTable("AppChatGroups"); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Group.GroupChatBlack", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorId") + .HasColumnType("char(36)"); + + b.Property("GroupId") + .HasColumnType("bigint"); + + b.Property("ShieldUserId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "GroupId"); + + b.ToTable("AppGroupChatBlacks"); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Group.GroupMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("Content") + .IsRequired() + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasMaxLength(1048576); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorId") + .HasColumnType("char(36)"); + + b.Property("GroupId") + .HasColumnType("bigint"); + + b.Property("MessageId") + .HasColumnType("bigint"); + + b.Property("SendState") + .HasColumnType("tinyint"); + + b.Property("SendUserName") + .IsRequired() + .HasColumnType("varchar(64) CHARACTER SET utf8mb4") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "GroupId"); + + b.ToTable("AppGroupMessages"); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Group.UserChatGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("char(36)"); + + b.Property("GroupId") + .HasColumnType("bigint"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "GroupId", "UserId"); + + b.ToTable("AppUserChatGroups"); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Group.UserGroupCard", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("varchar(40) CHARACTER SET utf8mb4") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("char(36)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("IsAdmin") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("char(36)"); + + b.Property("NickName") + .HasColumnType("varchar(256) CHARACTER SET utf8mb4") + .HasMaxLength(256); + + b.Property("SilenceEnd") + .HasColumnType("datetime(6)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AppUserGroupCards"); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Notifications.Notification", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("ExpirationTime") + .HasColumnType("datetime(6)"); + + b.Property("NotificationData") + .IsRequired() + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasMaxLength(1048576); + + b.Property("NotificationId") + .HasColumnType("bigint"); + + b.Property("NotificationName") + .IsRequired() + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("NotificationTypeName") + .IsRequired() + .HasColumnType("varchar(512) CHARACTER SET utf8mb4") + .HasMaxLength(512); + + b.Property("Severity") + .HasColumnType("tinyint"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "NotificationName"); + + b.ToTable("AppNotifications"); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Notifications.UserNotification", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("NotificationId") + .HasColumnType("bigint"); + + b.Property("ReadStatus") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId", "NotificationId") + .HasName("IX_Tenant_User_Notification_Id"); + + b.ToTable("AppUserNotifications"); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Subscriptions.UserSubscribe", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("NotificationName") + .IsRequired() + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("varchar(128) CHARACTER SET utf8mb4") + .HasMaxLength(128) + .HasDefaultValue("/"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId", "NotificationName") + .IsUnique() + .HasName("IX_Tenant_User_Notification_Name"); + + b.ToTable("AppUserSubscribes"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20201029102936_Add-UserChatFriend-Column-Description.cs b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20201029102936_Add-UserChatFriend-Column-Description.cs new file mode 100644 index 000000000..9a155f6df --- /dev/null +++ b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20201029102936_Add-UserChatFriend-Column-Description.cs @@ -0,0 +1,116 @@ +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace LINGYUN.Abp.MessageService.Migrations +{ + public partial class AddUserChatFriendColumnDescription : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "AppUserChatBlacks"); + + migrationBuilder.DropTable( + name: "AppUserSpecialFocuss"); + + migrationBuilder.DropColumn( + name: "NotificationCateGory", + table: "AppNotifications"); + + migrationBuilder.AddColumn( + name: "ConcurrencyStamp", + table: "AppUserChatFriends", + maxLength: 40, + nullable: true); + + migrationBuilder.AddColumn( + name: "Description", + table: "AppUserChatFriends", + maxLength: 50, + nullable: true); + + migrationBuilder.AddColumn( + name: "ExtraProperties", + table: "AppUserChatFriends", + nullable: true); + + migrationBuilder.AddColumn( + name: "Status", + table: "AppUserChatFriends", + nullable: false, + defaultValue: (byte)0); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "ConcurrencyStamp", + table: "AppUserChatFriends"); + + migrationBuilder.DropColumn( + name: "Description", + table: "AppUserChatFriends"); + + migrationBuilder.DropColumn( + name: "ExtraProperties", + table: "AppUserChatFriends"); + + migrationBuilder.DropColumn( + name: "Status", + table: "AppUserChatFriends"); + + migrationBuilder.AddColumn( + name: "NotificationCateGory", + table: "AppNotifications", + type: "varchar(50) CHARACTER SET utf8mb4", + maxLength: 50, + nullable: false, + defaultValue: ""); + + migrationBuilder.CreateTable( + name: "AppUserChatBlacks", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + CreatorId = table.Column(type: "char(36)", nullable: true), + ShieldUserId = table.Column(type: "char(36)", nullable: false), + TenantId = table.Column(type: "char(36)", nullable: true), + UserId = table.Column(type: "char(36)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AppUserChatBlacks", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AppUserSpecialFocuss", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + CreatorId = table.Column(type: "char(36)", nullable: true), + FocusUserId = table.Column(type: "char(36)", nullable: false), + TenantId = table.Column(type: "char(36)", nullable: true), + UserId = table.Column(type: "char(36)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AppUserSpecialFocuss", x => x.Id); + }); + + migrationBuilder.CreateIndex( + name: "IX_AppUserChatBlacks_TenantId_UserId", + table: "AppUserChatBlacks", + columns: new[] { "TenantId", "UserId" }); + + migrationBuilder.CreateIndex( + name: "IX_AppUserSpecialFocuss_TenantId_UserId", + table: "AppUserSpecialFocuss", + columns: new[] { "TenantId", "UserId" }); + } + } +} diff --git a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20201030032219_Based-Message-Entity-To-AggregateRoot.Designer.cs b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20201030032219_Based-Message-Entity-To-AggregateRoot.Designer.cs new file mode 100644 index 000000000..73806e490 --- /dev/null +++ b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20201030032219_Based-Message-Entity-To-AggregateRoot.Designer.cs @@ -0,0 +1,612 @@ +// +using System; +using LINGYUN.Abp.MessageService.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +namespace LINGYUN.Abp.MessageService.Migrations +{ + [DbContext(typeof(MessageServiceHostMigrationsDbContext))] + [Migration("20201030032219_Based-Message-Entity-To-AggregateRoot")] + partial class BasedMessageEntityToAggregateRoot + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) + .HasAnnotation("ProductVersion", "3.1.7") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatCard", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("Age") + .HasColumnType("int"); + + b.Property("AvatarUrl") + .HasColumnType("varchar(512) CHARACTER SET utf8mb4") + .HasMaxLength(512); + + b.Property("Birthday") + .HasColumnType("datetime(6)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("varchar(40) CHARACTER SET utf8mb4") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("char(36)"); + + b.Property("Description") + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("char(36)"); + + b.Property("NickName") + .HasColumnType("varchar(256) CHARACTER SET utf8mb4") + .HasMaxLength(256); + + b.Property("Sex") + .HasColumnType("int"); + + b.Property("Sign") + .HasColumnType("varchar(30) CHARACTER SET utf8mb4") + .HasMaxLength(30); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("varchar(256) CHARACTER SET utf8mb4") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AppUserChatCards"); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatFriend", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("Black") + .HasColumnType("tinyint(1)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("varchar(40) CHARACTER SET utf8mb4") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("char(36)"); + + b.Property("Description") + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.Property("DontDisturb") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("FrientId") + .HasColumnType("char(36)"); + + b.Property("RemarkName") + .HasColumnType("varchar(256) CHARACTER SET utf8mb4") + .HasMaxLength(256); + + b.Property("SpecialFocus") + .HasColumnType("tinyint(1)"); + + b.Property("Status") + .HasColumnType("tinyint unsigned"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId", "FrientId"); + + b.ToTable("AppUserChatFriends"); + }); + + 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") + .HasColumnName("TenantId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AppUserChatSettings"); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("varchar(40) CHARACTER SET utf8mb4") + .HasMaxLength(40); + + b.Property("Content") + .IsRequired() + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasMaxLength(1048576); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("char(36)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("MessageId") + .HasColumnType("bigint"); + + b.Property("ReceiveUserId") + .HasColumnType("char(36)"); + + b.Property("SendState") + .HasColumnType("tinyint"); + + b.Property("SendUserName") + .IsRequired() + .HasColumnType("varchar(64) CHARACTER SET utf8mb4") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ReceiveUserId"); + + b.ToTable("AppUserMessages"); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Group.ChatGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("Address") + .HasColumnType("varchar(256) CHARACTER SET utf8mb4") + .HasMaxLength(256); + + b.Property("AdminUserId") + .HasColumnType("char(36)"); + + b.Property("AllowAnonymous") + .HasColumnType("tinyint(1)"); + + b.Property("AllowSendMessage") + .HasColumnType("tinyint(1)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("char(36)"); + + b.Property("Description") + .HasColumnType("varchar(128) CHARACTER SET utf8mb4") + .HasMaxLength(128); + + b.Property("GroupId") + .HasColumnType("bigint"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("char(36)"); + + b.Property("MaxUserCount") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(20) CHARACTER SET utf8mb4") + .HasMaxLength(20); + + b.Property("Notice") + .HasColumnType("varchar(64) CHARACTER SET utf8mb4") + .HasMaxLength(64); + + b.Property("Tag") + .HasColumnType("varchar(512) CHARACTER SET utf8mb4") + .HasMaxLength(512); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name"); + + b.ToTable("AppChatGroups"); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Group.GroupChatBlack", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("char(36)"); + + b.Property("GroupId") + .HasColumnType("bigint"); + + b.Property("ShieldUserId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "GroupId"); + + b.ToTable("AppGroupChatBlacks"); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Group.GroupMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("varchar(40) CHARACTER SET utf8mb4") + .HasMaxLength(40); + + b.Property("Content") + .IsRequired() + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasMaxLength(1048576); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("char(36)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("GroupId") + .HasColumnType("bigint"); + + b.Property("MessageId") + .HasColumnType("bigint"); + + b.Property("SendState") + .HasColumnType("tinyint"); + + b.Property("SendUserName") + .IsRequired() + .HasColumnType("varchar(64) CHARACTER SET utf8mb4") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "GroupId"); + + b.ToTable("AppGroupMessages"); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Group.UserChatGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("char(36)"); + + b.Property("GroupId") + .HasColumnType("bigint"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "GroupId", "UserId"); + + b.ToTable("AppUserChatGroups"); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Group.UserGroupCard", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("varchar(40) CHARACTER SET utf8mb4") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("char(36)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("IsAdmin") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("char(36)"); + + b.Property("NickName") + .HasColumnType("varchar(256) CHARACTER SET utf8mb4") + .HasMaxLength(256); + + b.Property("SilenceEnd") + .HasColumnType("datetime(6)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AppUserGroupCards"); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Notifications.Notification", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("ExpirationTime") + .HasColumnType("datetime(6)"); + + b.Property("NotificationData") + .IsRequired() + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasMaxLength(1048576); + + b.Property("NotificationId") + .HasColumnType("bigint"); + + b.Property("NotificationName") + .IsRequired() + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("NotificationTypeName") + .IsRequired() + .HasColumnType("varchar(512) CHARACTER SET utf8mb4") + .HasMaxLength(512); + + b.Property("Severity") + .HasColumnType("tinyint"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "NotificationName"); + + b.ToTable("AppNotifications"); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Notifications.UserNotification", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("NotificationId") + .HasColumnType("bigint"); + + b.Property("ReadStatus") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId", "NotificationId") + .HasName("IX_Tenant_User_Notification_Id"); + + b.ToTable("AppUserNotifications"); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Subscriptions.UserSubscribe", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("NotificationName") + .IsRequired() + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("varchar(128) CHARACTER SET utf8mb4") + .HasMaxLength(128) + .HasDefaultValue("/"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId", "NotificationName") + .IsUnique() + .HasName("IX_Tenant_User_Notification_Name"); + + b.ToTable("AppUserSubscribes"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20201030032219_Based-Message-Entity-To-AggregateRoot.cs b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20201030032219_Based-Message-Entity-To-AggregateRoot.cs new file mode 100644 index 000000000..0b853d840 --- /dev/null +++ b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/20201030032219_Based-Message-Entity-To-AggregateRoot.cs @@ -0,0 +1,51 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace LINGYUN.Abp.MessageService.Migrations +{ + public partial class BasedMessageEntityToAggregateRoot : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "ConcurrencyStamp", + table: "AppUserMessages", + maxLength: 40, + nullable: true); + + migrationBuilder.AddColumn( + name: "ExtraProperties", + table: "AppUserMessages", + nullable: true); + + migrationBuilder.AddColumn( + name: "ConcurrencyStamp", + table: "AppGroupMessages", + maxLength: 40, + nullable: true); + + migrationBuilder.AddColumn( + name: "ExtraProperties", + table: "AppGroupMessages", + nullable: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "ConcurrencyStamp", + table: "AppUserMessages"); + + migrationBuilder.DropColumn( + name: "ExtraProperties", + table: "AppUserMessages"); + + migrationBuilder.DropColumn( + name: "ConcurrencyStamp", + table: "AppGroupMessages"); + + migrationBuilder.DropColumn( + name: "ExtraProperties", + table: "AppGroupMessages"); + } + } +} diff --git a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/MessageServiceHostMigrationsDbContextModelSnapshot.cs b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/MessageServiceHostMigrationsDbContextModelSnapshot.cs index 8082abdb1..8fcd36cd5 100644 --- a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/MessageServiceHostMigrationsDbContextModelSnapshot.cs +++ b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Migrations/MessageServiceHostMigrationsDbContextModelSnapshot.cs @@ -19,24 +19,27 @@ namespace LINGYUN.Abp.MessageService.Migrations .HasAnnotation("ProductVersion", "3.1.7") .HasAnnotation("Relational:MaxIdentifierLength", 64); - modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.ChatGroup", b => + modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatCard", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint"); - b.Property("Address") - .HasColumnType("varchar(256) CHARACTER SET utf8mb4") - .HasMaxLength(256); + b.Property("Age") + .HasColumnType("int"); - b.Property("AdminUserId") - .HasColumnType("char(36)"); + b.Property("AvatarUrl") + .HasColumnType("varchar(512) CHARACTER SET utf8mb4") + .HasMaxLength(512); - b.Property("AllowAnonymous") - .HasColumnType("tinyint(1)"); + b.Property("Birthday") + .HasColumnType("datetime(6)"); - b.Property("AllowSendMessage") - .HasColumnType("tinyint(1)"); + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("varchar(40) CHARACTER SET utf8mb4") + .HasMaxLength(40); b.Property("CreationTime") .HasColumnName("CreationTime") @@ -47,11 +50,12 @@ namespace LINGYUN.Abp.MessageService.Migrations .HasColumnType("char(36)"); b.Property("Description") - .HasColumnType("varchar(128) CHARACTER SET utf8mb4") - .HasMaxLength(128); + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); - b.Property("GroupId") - .HasColumnType("bigint"); + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("longtext CHARACTER SET utf8mb4"); b.Property("LastModificationTime") .HasColumnName("LastModificationTime") @@ -61,122 +65,117 @@ namespace LINGYUN.Abp.MessageService.Migrations .HasColumnName("LastModifierId") .HasColumnType("char(36)"); - b.Property("MaxUserCount") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasColumnType("varchar(20) CHARACTER SET utf8mb4") - .HasMaxLength(20); + b.Property("NickName") + .HasColumnType("varchar(256) CHARACTER SET utf8mb4") + .HasMaxLength(256); - b.Property("Notice") - .HasColumnType("varchar(64) CHARACTER SET utf8mb4") - .HasMaxLength(64); + b.Property("Sex") + .HasColumnType("int"); - b.Property("Tag") - .HasColumnType("varchar(512) CHARACTER SET utf8mb4") - .HasMaxLength(512); + b.Property("Sign") + .HasColumnType("varchar(30) CHARACTER SET utf8mb4") + .HasMaxLength(30); b.Property("TenantId") .HasColumnName("TenantId") .HasColumnType("char(36)"); - b.HasKey("Id"); - - b.HasIndex("TenantId", "Name"); - - b.ToTable("AppChatGroups"); - }); - - modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.GroupChatBlack", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - b.Property("CreationTime") - .HasColumnType("datetime(6)"); - - b.Property("CreatorId") - .HasColumnType("char(36)"); - - b.Property("GroupId") - .HasColumnType("bigint"); - - b.Property("ShieldUserId") + b.Property("UserId") .HasColumnType("char(36)"); - b.Property("TenantId") - .HasColumnName("TenantId") - .HasColumnType("char(36)"); + b.Property("UserName") + .IsRequired() + .HasColumnType("varchar(256) CHARACTER SET utf8mb4") + .HasMaxLength(256); b.HasKey("Id"); - b.HasIndex("TenantId", "GroupId"); + b.HasIndex("TenantId", "UserId"); - b.ToTable("AppGroupChatBlacks"); + b.ToTable("AppUserChatCards"); }); - modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.GroupMessage", b => + modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatFriend", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint"); - b.Property("Content") - .IsRequired() - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(1048576); + b.Property("Black") + .HasColumnType("tinyint(1)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("varchar(40) CHARACTER SET utf8mb4") + .HasMaxLength(40); b.Property("CreationTime") .HasColumnName("CreationTime") .HasColumnType("datetime(6)"); b.Property("CreatorId") + .HasColumnName("CreatorId") .HasColumnType("char(36)"); - b.Property("GroupId") - .HasColumnType("bigint"); + b.Property("Description") + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); - b.Property("MessageId") - .HasColumnType("bigint"); + b.Property("DontDisturb") + .HasColumnType("tinyint(1)"); - b.Property("SendState") - .HasColumnType("tinyint"); + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("longtext CHARACTER SET utf8mb4"); - b.Property("SendUserName") - .IsRequired() - .HasColumnType("varchar(64) CHARACTER SET utf8mb4") - .HasMaxLength(64); + b.Property("FrientId") + .HasColumnType("char(36)"); + + b.Property("RemarkName") + .HasColumnType("varchar(256) CHARACTER SET utf8mb4") + .HasMaxLength(256); + + b.Property("SpecialFocus") + .HasColumnType("tinyint(1)"); + + b.Property("Status") + .HasColumnType("tinyint unsigned"); b.Property("TenantId") .HasColumnName("TenantId") .HasColumnType("char(36)"); - b.Property("Type") - .HasColumnType("int"); + b.Property("UserId") + .HasColumnType("char(36)"); b.HasKey("Id"); - b.HasIndex("TenantId", "GroupId"); + b.HasIndex("TenantId", "UserId", "FrientId"); - b.ToTable("AppGroupMessages"); + b.ToTable("AppUserChatFriends"); }); - modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatBlack", b => + modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatSetting", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint"); - b.Property("CreationTime") - .HasColumnType("datetime(6)"); + b.Property("AllowAddFriend") + .HasColumnType("tinyint(1)"); - b.Property("CreatorId") - .HasColumnType("char(36)"); + b.Property("AllowAnonymous") + .HasColumnType("tinyint(1)"); - b.Property("ShieldUserId") - .HasColumnType("char(36)"); + b.Property("AllowReceiveMessage") + .HasColumnType("tinyint(1)"); + + b.Property("AllowSendMessage") + .HasColumnType("tinyint(1)"); + + b.Property("RequireAddFriendValition") + .HasColumnType("tinyint(1)"); b.Property("TenantId") .HasColumnName("TenantId") @@ -189,31 +188,26 @@ namespace LINGYUN.Abp.MessageService.Migrations b.HasIndex("TenantId", "UserId"); - b.ToTable("AppUserChatBlacks"); + b.ToTable("AppUserChatSettings"); }); - modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatCard", b => + modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserMessage", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint"); - b.Property("Age") - .HasColumnType("int"); - - b.Property("AvatarUrl") - .HasColumnType("varchar(512) CHARACTER SET utf8mb4") - .HasMaxLength(512); - - b.Property("Birthday") - .HasColumnType("datetime(6)"); - b.Property("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnName("ConcurrencyStamp") .HasColumnType("varchar(40) CHARACTER SET utf8mb4") .HasMaxLength(40); + b.Property("Content") + .IsRequired() + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasMaxLength(1048576); + b.Property("CreationTime") .HasColumnName("CreationTime") .HasColumnType("datetime(6)"); @@ -222,59 +216,55 @@ namespace LINGYUN.Abp.MessageService.Migrations .HasColumnName("CreatorId") .HasColumnType("char(36)"); - b.Property("Description") - .HasColumnType("varchar(50) CHARACTER SET utf8mb4") - .HasMaxLength(50); - b.Property("ExtraProperties") .HasColumnName("ExtraProperties") .HasColumnType("longtext CHARACTER SET utf8mb4"); - b.Property("LastModificationTime") - .HasColumnName("LastModificationTime") - .HasColumnType("datetime(6)"); + b.Property("MessageId") + .HasColumnType("bigint"); - b.Property("LastModifierId") - .HasColumnName("LastModifierId") + b.Property("ReceiveUserId") .HasColumnType("char(36)"); - b.Property("NickName") - .HasColumnType("varchar(256) CHARACTER SET utf8mb4") - .HasMaxLength(256); - - b.Property("Sex") - .HasColumnType("int"); + b.Property("SendState") + .HasColumnType("tinyint"); - b.Property("Sign") - .HasColumnType("varchar(30) CHARACTER SET utf8mb4") - .HasMaxLength(30); + b.Property("SendUserName") + .IsRequired() + .HasColumnType("varchar(64) CHARACTER SET utf8mb4") + .HasMaxLength(64); b.Property("TenantId") .HasColumnName("TenantId") .HasColumnType("char(36)"); - b.Property("UserId") - .HasColumnType("char(36)"); - - b.Property("UserName") - .IsRequired() - .HasColumnType("varchar(256) CHARACTER SET utf8mb4") - .HasMaxLength(256); + b.Property("Type") + .HasColumnType("int"); b.HasKey("Id"); - b.HasIndex("TenantId", "UserId"); + b.HasIndex("TenantId", "ReceiveUserId"); - b.ToTable("AppUserChatCards"); + b.ToTable("AppUserMessages"); }); - modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatFriend", b => + modelBuilder.Entity("LINGYUN.Abp.MessageService.Group.ChatGroup", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint"); - b.Property("Black") + b.Property("Address") + .HasColumnType("varchar(256) CHARACTER SET utf8mb4") + .HasMaxLength(256); + + b.Property("AdminUserId") + .HasColumnType("char(36)"); + + b.Property("AllowAnonymous") + .HasColumnType("tinyint(1)"); + + b.Property("AllowSendMessage") .HasColumnType("tinyint(1)"); b.Property("CreationTime") @@ -285,34 +275,49 @@ namespace LINGYUN.Abp.MessageService.Migrations .HasColumnName("CreatorId") .HasColumnType("char(36)"); - b.Property("DontDisturb") - .HasColumnType("tinyint(1)"); + b.Property("Description") + .HasColumnType("varchar(128) CHARACTER SET utf8mb4") + .HasMaxLength(128); - b.Property("FrientId") + b.Property("GroupId") + .HasColumnType("bigint"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") .HasColumnType("char(36)"); - b.Property("RemarkName") - .HasColumnType("varchar(256) CHARACTER SET utf8mb4") - .HasMaxLength(256); + b.Property("MaxUserCount") + .HasColumnType("int"); - b.Property("SpecialFocus") - .HasColumnType("tinyint(1)"); + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(20) CHARACTER SET utf8mb4") + .HasMaxLength(20); + + b.Property("Notice") + .HasColumnType("varchar(64) CHARACTER SET utf8mb4") + .HasMaxLength(64); + + b.Property("Tag") + .HasColumnType("varchar(512) CHARACTER SET utf8mb4") + .HasMaxLength(512); b.Property("TenantId") .HasColumnName("TenantId") .HasColumnType("char(36)"); - b.Property("UserId") - .HasColumnType("char(36)"); - b.HasKey("Id"); - b.HasIndex("TenantId", "UserId", "FrientId"); + b.HasIndex("TenantId", "Name"); - b.ToTable("AppUserChatFriends"); + b.ToTable("AppChatGroups"); }); - modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatGroup", b => + modelBuilder.Entity("LINGYUN.Abp.MessageService.Group.GroupChatBlack", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -329,56 +334,21 @@ namespace LINGYUN.Abp.MessageService.Migrations b.Property("GroupId") .HasColumnType("bigint"); - b.Property("TenantId") - .HasColumnName("TenantId") - .HasColumnType("char(36)"); - - b.Property("UserId") + b.Property("ShieldUserId") .HasColumnType("char(36)"); - b.HasKey("Id"); - - b.HasIndex("TenantId", "GroupId", "UserId"); - - b.ToTable("AppUserChatGroups"); - }); - - 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") .HasColumnName("TenantId") .HasColumnType("char(36)"); - b.Property("UserId") - .HasColumnType("char(36)"); - b.HasKey("Id"); - b.HasIndex("TenantId", "UserId"); + b.HasIndex("TenantId", "GroupId"); - b.ToTable("AppUserChatSettings"); + b.ToTable("AppGroupChatBlacks"); }); - modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserGroupCard", b => + modelBuilder.Entity("LINGYUN.Abp.MessageService.Group.GroupMessage", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -390,6 +360,11 @@ namespace LINGYUN.Abp.MessageService.Migrations .HasColumnType("varchar(40) CHARACTER SET utf8mb4") .HasMaxLength(40); + b.Property("Content") + .IsRequired() + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasMaxLength(1048576); + b.Property("CreationTime") .HasColumnName("CreationTime") .HasColumnType("datetime(6)"); @@ -402,99 +377,107 @@ namespace LINGYUN.Abp.MessageService.Migrations .HasColumnName("ExtraProperties") .HasColumnType("longtext CHARACTER SET utf8mb4"); - b.Property("IsAdmin") - .HasColumnType("tinyint(1)"); - - b.Property("LastModificationTime") - .HasColumnName("LastModificationTime") - .HasColumnType("datetime(6)"); + b.Property("GroupId") + .HasColumnType("bigint"); - b.Property("LastModifierId") - .HasColumnName("LastModifierId") - .HasColumnType("char(36)"); + b.Property("MessageId") + .HasColumnType("bigint"); - b.Property("NickName") - .HasColumnType("varchar(256) CHARACTER SET utf8mb4") - .HasMaxLength(256); + b.Property("SendState") + .HasColumnType("tinyint"); - b.Property("SilenceEnd") - .HasColumnType("datetime(6)"); + b.Property("SendUserName") + .IsRequired() + .HasColumnType("varchar(64) CHARACTER SET utf8mb4") + .HasMaxLength(64); b.Property("TenantId") .HasColumnName("TenantId") .HasColumnType("char(36)"); - b.Property("UserId") - .HasColumnType("char(36)"); + b.Property("Type") + .HasColumnType("int"); b.HasKey("Id"); - b.HasIndex("TenantId", "UserId"); + b.HasIndex("TenantId", "GroupId"); - b.ToTable("AppUserGroupCards"); + b.ToTable("AppGroupMessages"); }); - modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserMessage", b => + modelBuilder.Entity("LINGYUN.Abp.MessageService.Group.UserChatGroup", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint"); - b.Property("Content") - .IsRequired() - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(1048576); - b.Property("CreationTime") .HasColumnName("CreationTime") .HasColumnType("datetime(6)"); b.Property("CreatorId") + .HasColumnName("CreatorId") .HasColumnType("char(36)"); - b.Property("MessageId") + b.Property("GroupId") .HasColumnType("bigint"); - b.Property("ReceiveUserId") - .HasColumnType("char(36)"); - - b.Property("SendState") - .HasColumnType("tinyint"); - - b.Property("SendUserName") - .IsRequired() - .HasColumnType("varchar(64) CHARACTER SET utf8mb4") - .HasMaxLength(64); - b.Property("TenantId") .HasColumnName("TenantId") .HasColumnType("char(36)"); - b.Property("Type") - .HasColumnType("int"); + b.Property("UserId") + .HasColumnType("char(36)"); b.HasKey("Id"); - b.HasIndex("TenantId", "ReceiveUserId"); + b.HasIndex("TenantId", "GroupId", "UserId"); - b.ToTable("AppUserMessages"); + b.ToTable("AppUserChatGroups"); }); - modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserSpecialFocus", b => + modelBuilder.Entity("LINGYUN.Abp.MessageService.Group.UserGroupCard", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint"); + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("varchar(40) CHARACTER SET utf8mb4") + .HasMaxLength(40); + b.Property("CreationTime") + .HasColumnName("CreationTime") .HasColumnType("datetime(6)"); b.Property("CreatorId") + .HasColumnName("CreatorId") .HasColumnType("char(36)"); - b.Property("FocusUserId") + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("IsAdmin") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime(6)"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") .HasColumnType("char(36)"); + b.Property("NickName") + .HasColumnType("varchar(256) CHARACTER SET utf8mb4") + .HasMaxLength(256); + + b.Property("SilenceEnd") + .HasColumnType("datetime(6)"); + b.Property("TenantId") .HasColumnName("TenantId") .HasColumnType("char(36)"); @@ -506,7 +489,7 @@ namespace LINGYUN.Abp.MessageService.Migrations b.HasIndex("TenantId", "UserId"); - b.ToTable("AppUserSpecialFocuss"); + b.ToTable("AppUserGroupCards"); }); modelBuilder.Entity("LINGYUN.Abp.MessageService.Notifications.Notification", b => @@ -522,11 +505,6 @@ namespace LINGYUN.Abp.MessageService.Migrations b.Property("ExpirationTime") .HasColumnType("datetime(6)"); - b.Property("NotificationCateGory") - .IsRequired() - .HasColumnType("varchar(50) CHARACTER SET utf8mb4") - .HasMaxLength(50); - b.Property("NotificationData") .IsRequired() .HasColumnType("longtext CHARACTER SET utf8mb4") diff --git a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Notifications/MessageServiceDefinitionProvider.cs b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Notifications/MessageServiceDefinitionProvider.cs deleted file mode 100644 index 144ee3b3a..000000000 --- a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Notifications/MessageServiceDefinitionProvider.cs +++ /dev/null @@ -1,25 +0,0 @@ -using LINGYUN.Abp.MessageService.Localization; -using LINGYUN.Abp.Notifications; -using Volo.Abp.Localization; - -namespace LINGYUN.Abp.MessageService.Notifications -{ - public class MessageServiceDefinitionProvider : NotificationDefinitionProvider - { - public override void Define(INotificationDefinitionContext context) - { - context.Add(new NotificationDefinition( - "TestApplicationNotofication", - L("TestApplicationNotofication"), - L("TestApplicationNotofication"), - notificationType: NotificationType.Application, - lifetime: NotificationLifetime.OnlyOne, - allowSubscriptionToClients: true)); - } - - protected LocalizableString L(string name) - { - return LocalizableString.Create(name); - } - } -} diff --git a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Permissions/AbpMessageServicePermissionDefinitionProvider.cs b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Permissions/AbpMessageServicePermissionDefinitionProvider.cs deleted file mode 100644 index c5ba7020a..000000000 --- a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Permissions/AbpMessageServicePermissionDefinitionProvider.cs +++ /dev/null @@ -1,22 +0,0 @@ -using LINGYUN.Abp.MessageService.Localization; -using Volo.Abp.Authorization.Permissions; -using Volo.Abp.Localization; - -namespace LINGYUN.Abp.MessageService.Permissions -{ - public class AbpMessageServicePermissionDefinitionProvider : PermissionDefinitionProvider - { - public override void Define(IPermissionDefinitionContext context) - { - var group = context.GetGroup(MessageServicePermissions.GroupName); - - var hangfirePermission = group.AddPermission(AbpMessageServicePermissions.Hangfire.Default, L("Permission:Hangfire")); - hangfirePermission.AddChild(AbpMessageServicePermissions.Hangfire.ManageQueue, L("Permission:ManageQueue")); - } - - private static LocalizableString L(string name) - { - return LocalizableString.Create(name); - } - } -} diff --git a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Permissions/AbpMessageServicePermissions.cs b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Permissions/AbpMessageServicePermissions.cs deleted file mode 100644 index ff2aeb98f..000000000 --- a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Permissions/AbpMessageServicePermissions.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace LINGYUN.Abp.MessageService.Permissions -{ - public class AbpMessageServicePermissions - { - public class Hangfire - { - public const string Default = MessageServicePermissions.GroupName + ".Hangfire"; - - public const string ManageQueue = Default + ".ManageQueue"; - } - } -} diff --git a/vueJs/package-lock.json b/vueJs/package-lock.json index 03671975a..a6c66486a 100644 --- a/vueJs/package-lock.json +++ b/vueJs/package-lock.json @@ -2019,37 +2019,12 @@ "glob-to-regexp": "^0.3.0" } }, - "@nodelib/fs.scandir": { - "version": "2.1.3", - "resolved": "https://registry.npm.taobao.org/@nodelib/fs.scandir/download/@nodelib/fs.scandir-2.1.3.tgz", - "integrity": "sha1-Olgr21OATGum0UZXnEblITDPSjs=", - "requires": { - "@nodelib/fs.stat": "2.0.3", - "run-parallel": "^1.1.9" - }, - "dependencies": { - "@nodelib/fs.stat": { - "version": "2.0.3", - "resolved": "https://registry.npm.taobao.org/@nodelib/fs.stat/download/@nodelib/fs.stat-2.0.3.tgz", - "integrity": "sha1-NNxfTKu8cg9OYPdadH5+zWwXW9M=" - } - } - }, "@nodelib/fs.stat": { "version": "1.1.3", "resolved": "https://registry.npm.taobao.org/@nodelib/fs.stat/download/@nodelib/fs.stat-1.1.3.tgz", "integrity": "sha1-K1o6s/kYzKSKjHVMCBaOPwPrphs=", "dev": true }, - "@nodelib/fs.walk": { - "version": "1.2.4", - "resolved": "https://registry.npm.taobao.org/@nodelib/fs.walk/download/@nodelib/fs.walk-1.2.4.tgz", - "integrity": "sha1-ARuSAqcKY2bkNspcBlhEUoqwSXY=", - "requires": { - "@nodelib/fs.scandir": "2.1.3", - "fastq": "^1.6.0" - } - }, "@samverschueren/stream-to-observable": { "version": "0.3.0", "resolved": "https://registry.npm.taobao.org/@samverschueren/stream-to-observable/download/@samverschueren/stream-to-observable-0.3.0.tgz", @@ -4688,7 +4663,8 @@ "big.js": { "version": "5.2.2", "resolved": "https://registry.npm.taobao.org/big.js/download/big.js-5.2.2.tgz", - "integrity": "sha1-ZfCvOC9Xi83HQr2cKB6cstd2gyg=" + "integrity": "sha1-ZfCvOC9Xi83HQr2cKB6cstd2gyg=", + "dev": true }, "binary-extensions": { "version": "1.13.1", @@ -7587,7 +7563,8 @@ "emojis-list": { "version": "3.0.0", "resolved": "https://registry.npm.taobao.org/emojis-list/download/emojis-list-3.0.0.tgz", - "integrity": "sha1-VXBmIEatKeLpFucariYKvf9Pang=" + "integrity": "sha1-VXBmIEatKeLpFucariYKvf9Pang=", + "dev": true }, "encodeurl": { "version": "1.0.2", @@ -8823,14 +8800,6 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, - "fastq": { - "version": "1.8.0", - "resolved": "https://registry.npm.taobao.org/fastq/download/fastq-1.8.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffastq%2Fdownload%2Ffastq-1.8.0.tgz", - "integrity": "sha1-VQ4fn1m7xl/hhctqm02VNXEH9IE=", - "requires": { - "reusify": "^1.0.4" - } - }, "faye-websocket": { "version": "0.10.0", "resolved": "https://registry.npm.taobao.org/faye-websocket/download/faye-websocket-0.10.0.tgz", @@ -11002,7 +10971,8 @@ "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npm.taobao.org/is-extglob/download/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true }, "is-finite": { "version": "1.1.0", @@ -11025,6 +10995,7 @@ "version": "4.0.1", "resolved": "https://registry.npm.taobao.org/is-glob/download/is-glob-4.0.1.tgz", "integrity": "sha1-dWfb6fL14kZ7x3q4PEopSCQHpdw=", + "dev": true, "requires": { "is-extglob": "^2.1.1" } @@ -14494,6 +14465,7 @@ "version": "2.1.3", "resolved": "https://registry.npm.taobao.org/json5/download/json5-2.1.3.tgz", "integrity": "sha1-ybD3+pIzv+WAf+ZvzzpWF+1ZfUM=", + "dev": true, "requires": { "minimist": "^1.2.5" } @@ -14562,11 +14534,6 @@ "integrity": "sha1-p5yezIbuHOP6YgbRIWxQHxR/wH4=", "dev": true }, - "klona": { - "version": "2.0.4", - "resolved": "https://registry.npm.taobao.org/klona/download/klona-2.0.4.tgz?cache=0&sync_timestamp=1600226641291&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fklona%2Fdownload%2Fklona-2.0.4.tgz", - "integrity": "sha1-e7Hjr/sMuGJFR+9+j2cI6i4538A=" - }, "launch-editor": { "version": "2.2.1", "resolved": "https://registry.npm.taobao.org/launch-editor/download/launch-editor-2.2.1.tgz", @@ -16182,7 +16149,8 @@ "merge2": { "version": "1.3.0", "resolved": "https://registry.npm.taobao.org/merge2/download/merge2-1.3.0.tgz", - "integrity": "sha1-WzZu6DsvFYLEj4fkfPGpNSEDyoE=" + "integrity": "sha1-WzZu6DsvFYLEj4fkfPGpNSEDyoE=", + "dev": true }, "methods": { "version": "1.1.2", @@ -16681,7 +16649,8 @@ "normalize-path": { "version": "3.0.0", "resolved": "https://registry.npm.taobao.org/normalize-path/download/normalize-path-3.0.0.tgz", - "integrity": "sha1-Dc1p/yOhybEf0JeDFmRKA4ghamU=" + "integrity": "sha1-Dc1p/yOhybEf0JeDFmRKA4ghamU=", + "dev": true }, "normalize-range": { "version": "0.1.2", @@ -17287,7 +17256,8 @@ "picomatch": { "version": "2.2.2", "resolved": "https://registry.npm.taobao.org/picomatch/download/picomatch-2.2.2.tgz", - "integrity": "sha1-IfMz6ba46v8CRo9RRupAbTRfTa0=" + "integrity": "sha1-IfMz6ba46v8CRo9RRupAbTRfTa0=", + "dev": true }, "pify": { "version": "4.0.1", @@ -18802,11 +18772,6 @@ "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=", "dev": true }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npm.taobao.org/reusify/download/reusify-1.0.4.tgz", - "integrity": "sha1-kNo4Kx4SbvwCFG6QhFqI2xKSXXY=" - }, "rgb-regex": { "version": "1.0.1", "resolved": "https://registry.npm.taobao.org/rgb-regex/download/rgb-regex-1.0.1.tgz", @@ -18849,11 +18814,6 @@ "integrity": "sha1-hEDsz5nqPnC9QJ1JqriOEMGJpFU=", "dev": true }, - "run-parallel": { - "version": "1.1.9", - "resolved": "https://registry.npm.taobao.org/run-parallel/download/run-parallel-1.1.9.tgz", - "integrity": "sha1-yd06fPn0ssS2JE4XOm7YZuYd1nk=" - }, "run-queue": { "version": "1.0.3", "resolved": "https://registry.npm.taobao.org/run-queue/download/run-queue-1.0.3.tgz", @@ -19979,125 +19939,6 @@ } } }, - "stylus-loader": { - "version": "4.1.1", - "resolved": "https://registry.npm.taobao.org/stylus-loader/download/stylus-loader-4.1.1.tgz", - "integrity": "sha1-DpT11idJMqLa0FTRpzazIUasepk=", - "requires": { - "fast-glob": "^3.2.4", - "klona": "^2.0.4", - "loader-utils": "^2.0.0", - "normalize-path": "^3.0.0", - "schema-utils": "^3.0.0" - }, - "dependencies": { - "@nodelib/fs.stat": { - "version": "2.0.3", - "resolved": "https://registry.npm.taobao.org/@nodelib/fs.stat/download/@nodelib/fs.stat-2.0.3.tgz", - "integrity": "sha1-NNxfTKu8cg9OYPdadH5+zWwXW9M=" - }, - "@types/json-schema": { - "version": "7.0.6", - "resolved": "https://registry.npm.taobao.org/@types/json-schema/download/@types/json-schema-7.0.6.tgz", - "integrity": "sha1-9MfsQ+gbMZqYFRFQMXCfJph4kfA=" - }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npm.taobao.org/ajv/download/ajv-6.12.6.tgz?cache=0&sync_timestamp=1603561543180&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv%2Fdownload%2Fajv-6.12.6.tgz", - "integrity": "sha1-uvWmLoArB9l3A0WG+MO69a3ybfQ=", - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ajv-keywords": { - "version": "3.5.2", - "resolved": "https://registry.npm.taobao.org/ajv-keywords/download/ajv-keywords-3.5.2.tgz?cache=0&sync_timestamp=1603565974467&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv-keywords%2Fdownload%2Fajv-keywords-3.5.2.tgz", - "integrity": "sha1-MfKdpatuANHC0yms97WSlhTVAU0=" - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npm.taobao.org/braces/download/braces-3.0.2.tgz", - "integrity": "sha1-NFThpGLujVmeI23zNs2epPiv4Qc=", - "requires": { - "fill-range": "^7.0.1" - } - }, - "fast-glob": { - "version": "3.2.4", - "resolved": "https://registry.npm.taobao.org/fast-glob/download/fast-glob-3.2.4.tgz?cache=0&sync_timestamp=1592290276588&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffast-glob%2Fdownload%2Ffast-glob-3.2.4.tgz", - "integrity": "sha1-0grvv5lXk4Pn88xmUpFYybmFVNM=", - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.0", - "merge2": "^1.3.0", - "micromatch": "^4.0.2", - "picomatch": "^2.2.1" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npm.taobao.org/fill-range/download/fill-range-7.0.1.tgz", - "integrity": "sha1-GRmmp8df44ssfHflGYU12prN2kA=", - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "glob-parent": { - "version": "5.1.1", - "resolved": "https://registry.npm.taobao.org/glob-parent/download/glob-parent-5.1.1.tgz", - "integrity": "sha1-tsHvQXxOVmPqSY8cRa+saRa7wik=", - "requires": { - "is-glob": "^4.0.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npm.taobao.org/is-number/download/is-number-7.0.0.tgz", - "integrity": "sha1-dTU0W4lnNNX4DE0GxQlVUnoU8Ss=" - }, - "loader-utils": { - "version": "2.0.0", - "resolved": "https://registry.npm.taobao.org/loader-utils/download/loader-utils-2.0.0.tgz?cache=0&sync_timestamp=1584445172927&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Floader-utils%2Fdownload%2Floader-utils-2.0.0.tgz", - "integrity": "sha1-5MrOW4FtQloWa18JfhDNErNgZLA=", - "requires": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^2.1.2" - } - }, - "micromatch": { - "version": "4.0.2", - "resolved": "https://registry.npm.taobao.org/micromatch/download/micromatch-4.0.2.tgz", - "integrity": "sha1-T8sJmb+fvC/L3SEvbWKbmlbDklk=", - "requires": { - "braces": "^3.0.1", - "picomatch": "^2.0.5" - } - }, - "schema-utils": { - "version": "3.0.0", - "resolved": "https://registry.npm.taobao.org/schema-utils/download/schema-utils-3.0.0.tgz", - "integrity": "sha1-Z1AvaqK2ai1AMrQnmilEl4oJE+8=", - "requires": { - "@types/json-schema": "^7.0.6", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" - } - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npm.taobao.org/to-regex-range/download/to-regex-range-5.0.1.tgz", - "integrity": "sha1-FkjESq58jZiKMmAY7XL1tN0DkuQ=", - "requires": { - "is-number": "^7.0.0" - } - } - } - }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-5.5.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-5.5.0.tgz", diff --git a/vueJs/package.json b/vueJs/package.json index 6eb1f57b7..2970d1cf1 100644 --- a/vueJs/package.json +++ b/vueJs/package.json @@ -42,7 +42,6 @@ "script-loader": "^0.7.2", "simple-progress-webpack-plugin": "^1.1.2", "sortablejs": "^1.10.2", - "stylus-loader": "^4.1.1", "tinymce": "^5.2.1", "tui-editor": "^1.4.10", "view-design": "^4.2.0", diff --git a/vueJs/src/api/instant-message.ts b/vueJs/src/api/instant-message.ts index f95129b1e..5c6585b85 100644 --- a/vueJs/src/api/instant-message.ts +++ b/vueJs/src/api/instant-message.ts @@ -9,6 +9,11 @@ export default class ImApiService { return ApiService.Post(_url, payload, serviceUrl) } + public static addRequest(payload: RequestUserFriend) { + const _url = '/api/im/my-friends/add-request' + return ApiService.Post(_url, payload, serviceUrl) + } + public static getMyFriends(payload: MyFriendGetByPaged) { let _url = '/api/im/my-friends' _url += '?filter=' + payload.filter @@ -49,6 +54,16 @@ export default class ImApiService { export class AddUserFriend { friendId!: string + + constructor( + friendId: string + ) { + this.friendId = friendId + } +} + +export class RequestUserFriend { + friendId!: string remarkName!: string constructor( diff --git a/vueJs/src/api/notification.ts b/vueJs/src/api/notification.ts new file mode 100644 index 000000000..9e53f0279 --- /dev/null +++ b/vueJs/src/api/notification.ts @@ -0,0 +1,116 @@ +import VueI18n from 'vue-i18n' +import { urlStringify } from '@/utils' + +import ApiService from './serviceBase' +import { ListResultDto, PagedAndSortedResultRequestDto, PagedResultDto } from './types' + +const serviceUrl = process.env.VUE_APP_BASE_API + +export default class NotificationApiService { + public static getNotifications(payload: UserNotificationGetByPaged) { + let _url = '/api/my-notifilers?' + _url += urlStringify(payload) + return ApiService.Get>(_url, serviceUrl) + } + + public static getAssignableNotifiers() { + const _url = '/api/my-notifilers/assignables' + return ApiService.Get>(_url, serviceUrl) + } + + public static getMySubscribedNotifiers() { + const _url = '/api/my-subscribes/all' + return ApiService.Get>(_url, serviceUrl) + } + + public static subscribeNotifier(name: string) { + const _url = '/api/my-subscribes' + const payload = new UserSubscreNotification() + payload.name = name + return ApiService.Post(_url, payload, serviceUrl) + } + + public static unSubscribeNotifier(name: string) { + const _url = '/api/my-subscribes?name=' + name + return ApiService.Delete(_url, serviceUrl) + } +} + +export enum NotificationReadState { + Read = 0, + UnRead = 1 +} + +export enum NotificationLifetime { + Persistent = 0, + OnlyOne = 1 +} + +export enum NotificationType { + Application = 0, + System = 10, + User = 20 +} + +export enum NotificationSeverity { + Success = 0, + Info = 10, + Warn = 20, + Error = 30, + Fatal = 40 +} + +export class NotificationData { + properties: {[key: string]: any} = {} +} + +export class NotificationInfo { + tenantId? = '' + name = '' + id = '' + data!: NotificationData + creationTime!: Date + lifetime!: NotificationLifetime + type!: NotificationType + severity!: NotificationSeverity + + public static tryParseNotifier(notifier: NotificationInfo, l: VueI18n) { + const data = new NotificationData() + data.properties = notifier.data.properties + if (notifier.data.properties.localizer) { + data.properties.title = l.t(data.properties.title.resourceName + '.' + data.properties.title.name, data.properties.title.values) + data.properties.message = l.t(data.properties.message.resourceName + '.' + data.properties.message.name, data.properties.message.values) + if (data.properties.description) { + data.properties.description = l.t(data.properties.description.resourceName + '.' + data.properties.description.name, data.properties.description.values) + } + notifier.data = data + } + return notifier + } +} + +export class UserNotificationGetByPaged extends PagedAndSortedResultRequestDto { + skipCount = 0 + maxResultCount = 10 + filter = '' + reverse = true + readState = NotificationReadState.UnRead +} + +export class Notification { + name = '' + displayName = '' + description = '' + lifetime = NotificationLifetime.Persistent + type = NotificationType.User +} + +export class NotificationGroup { + name = '' + displayName = '' + notifications = new Array() +} + +export class UserSubscreNotification { + name = '' +} diff --git a/vueJs/src/assets/im-images/top-buttom.png b/vueJs/src/assets/im-images/top-buttom.png new file mode 100644 index 0000000000000000000000000000000000000000..bc1d8fe1bf03f0bf053a9f66e339ad55a577744c GIT binary patch literal 5520 zcmV;B6>sW^P)niB8{K$~>%CLp&7)Z_hByw4^lJh}pHmmdL!pZ$6Nrm7tynK1(3kpPVV zuul<<|0;o(gQeGflC)-Zyx)gKY^&(3yCeXDkxxf}=yZTiCD3pHzM@;ov;kVjtiQtG z=hr1_{?c)BxNEt~0HCGQ3BEA^8-IDHD-2Enc%F%$Ul*@g+35r=)v?L-|MBOnHl+*yq$CKqcA#3fKXsmRO3 z>a-tKrvgAQnjTGrtHBg$KNGZLOGJwa^guG+|Ih8%s%2B10sz67cDSVDY9?G>B*QcT zv=QJ&G5*va;KKoQ6Qg%V#f%1tr2CUf|Gzn_={&H}%-(i(WSn`K|(UUvJc- z4Pbr^5+%X(4rQC(NiN>+|J?8nkN@OAuIhFeh!11tAQ6Ux5pu(;P#p#yX4Y?Am#BH) zE1pjIbQl1Fv2+wn*AsAzQ=wba6KJK5+{?sR*`r6*%2oCKKW_^^ySj&-{%-fZdiOsT z$Qj$u6T$cafL?a>EWUqCgjANWLuyLFH+3wx01K0q9P+?$ZN|AphMC^dba{vURTSpUee-)HrBNI0|HM>DuK9@Hmqnp1HjM;n+NGq^;-aX+6zawsfz!4d%E(W2t_mVM5hD- zPV(wz(Gvh1ewMa(&u&=GK+vwsnCOaB-2WRpx^ny;j%n91<2Di9CC0I96Y`rPv_&5Q zLeX>rpb2)u5aG;ZT>hgST{(XbMj9hTx?*PoB6>?lc5GXx&^C_%!RVHm1nFj5fju0y z?Aq$;--nF-ps&=k*H!^N7O09mRe;Wvq)h+_#WH7ud6As}#P~@vAwO(KSNZ;p1)8s- ztLzuZjLX|{cibPQTUCIS0;mFoAm~wVgrp7+s$*G0?*1NHb zYXF3z=|upYUFm!`W*4s$j%e30*(?kRi`BSn*%xLlx&naELWSuuHQ~QNT-6GtnFT_T z%%dPa-*Ppt^99L8fybO$(G>tfG3^yFPBLwb@kUnqdd!CS0U`?-r!tov{ZX-x`c>&Y zUIbY>n{4ROT^i-oLB=rvf|2xjL}Z1uFF`y;jR%&OT~8HJ;ZQ7n0+@^=^SvyZxkXjv zUpf)PF#tjl?R9G;@=dA|nB_!>3ayw0LecaLfNrs%-VWyD)kHw(INspn2mqmI;{||j zbzS?e-tDUq>ly}a6H}=|<-`I*CV$XZYU;HLz<*fOyF*pvpNsN!2msBvv|fp8>!B@^9e z@iQ(}6Y|L-Vh90XXsq!_o%IbC48NpocCgzQI3j{pXuh$)uyNcg+at3UjKj>Q(aL#0|9ED)ZMKA$Ce)RYC$f2nc5`C?Jz zAjo*n2ZE^!mkvH-of7y{8}z7Db!mZN!``gU9yDmX`5Q!jR8;~OTCuks0YcIABLEe? z)gx?Ci;PV1ZCnGk(4?g;+6oWl9NHKFPBOKrFKk%!3OxKtz8@#{EC^K#x6G z%zvEs%1Ss=CmdxgbaWkSeciEP`b27Tz@?e@bMLBs5Cp*p`k)hILz9G!GbdA=hzLO+;U6Hpz2kFioOvmIRSY|YqM6?SZ1U)qwyBE0pX(7|*tpHTvfZn{v|ws)Rt=OCed?pj_1aN2p-gnp48ZU0$m7?-);AzZxxxZBi_!z+5(`)H=cT$_z3PsX4 zfM~86MXtK%fb~!I-eS5?v=YdO*2RFuBTeZ-Rq1cO2yvn9?0QZBu=FryAU&g&YMin! zD(?mSE~p@2|1BmFUYtJJ2yp3L2}ZSZ2zb(>gDu|>SWW?1^f(v>B6Ooe0^5O`~B0d14O>h zZs6O&FxqocQgyXt8@8>eyzAL`o;A#g&|o}JH-)ZrRL6oi6xIG0z`=z`jP*fMkte$v z0qkD=sETa6jTBXKP6IDxb{-G7u9j?NC?@aO^~|C=w$Kq_+4RX|?o{iLVJNB@3w5(t z%F9$mHf_t&c;RT{G={#%wx&fs)};edi~1W|oHmzP3wSP(-~#ZQ)>hZml5L#9V)C9{ z&qfTNGz1J-~$~7o=qw8cvmBUoe!W+`Y5l$qR(EylR>C= zXq1QQYRNYEQjvMz55g4=<-VY<*3z@u5xY<{{WU<{3r_*`cvA73#$>cv17s!u`F(l8 z;$^UcnU8Xx>T0Y3;UH1%nQ`2VDfF5heKC2@ZQwCFL;Nm;uxjVtICJ-2~R))~g57-L(QKhPpzGYD@o zn~&0bwADiq+bvWms=W%}ghCAvkV-1D?LOS8QmyIdKFJ5_S@iRNg>{!+N;})aYxlah zJkH+(LBDCLkxRh4GV^KfR+Y<#%h@vHT>8j6&U<{rbv zwm=#44@DYJ1L>wQ775l{z+F?6wFQSnwj3;xWE?e`6ken%fzr(J)5*aVj%p7xaIxv| zE)bf>b_6h(hoYJF02`h;h06A?n^3cHiEJ#SDy1DQ5Q=CYf^dLYlRh6Exn`l?h}~#f zga8nXY7Y@`i8&X2f*P+8+rPJ?fl9e4J6{cv`Cn)X$d3TA^dvAnWjYCfA4n+y&u+I$ zx#PUjEfmSz3*w)e&&>F>nviX8SA|A^e4?bi`WUZJ3SKz^Nb9U0*OA$;yfSQ8;1itC z_#Kk;HvpJ>WRq{S8t-Qtr9}t;`B5OE-2sAy11R02Dt^yyxVl0|bd-$YXnGEVZZvP7 zm#a#^G>${-dg1_xZ9M^;GY*9;78LsN#ZGb3QAY19?H(Qb=b<@nGX8$^JVb<_sd3pj zNwqD)0LYI5(e$4HD)Yl@`T)|z90L{}t zdLqcqqg9WnN{wy!*dp1dq}dLMeL6&9-|GN+m?>&pNG0RqfjS(G0C^C^wB_LZB~8IX zguf=^vT@N;DIQzE?pPi~>#M$Q8nODhfx@ql90MR2)h;I3xIr`Ds3ropdaQq0v)h$k z#@g}3Mc`=10BBwdWL^f?@=YKE=cW|d^z5Lld()xvyCR1h8Q2OvmCJJzc?eplSyuoE z$F}^CS$f%8589gBxg)&(+5L-p9qQ1QU6MQ$OTP%F)2xIi=u?tPjZ>dWXMrMH3t)Q^ z)l9rrRb;DhW?iyF+EeIIG;<%oHm9uovZ@3u0b;slbF0kYa~cnjcIK9vxg)pYTiF`A zG;%1ST?5K{Mp+hSoRvz*=5IJHYP*^OTKL)dqy4*Grm1SeZ|CP{r)ODx4@R_cM6k`2 z&fw`OC1CnI+|Foi0ziI27|YxMW?KQ6@T1P2`rXc0?e#qv&HR|aw)uhy^oOM4x6C78 zCv%$tkOx6jGZI8kv29GiLBWnksecbf(|0zfoVO`NuhCB5>B+@?g<=AGz6NN`Fds>z zNA;^<%lNe|Req@|vQ@})JJn0}yIt6~R*I*koPO%sXKE~>w~3j_lM%pZsyTCL)kd=? zO0C5q;CDMIedUJuQB7iEmNwOKv5$Iw#oZSJbgGc1f>*sFygUPd(b$lfHcVm&X0xO} z6YEzd6M=U{1T9sXA(6}x60wniWrT>1UazG*1%RPIaMISnl*@@l4Pkr)qWP-gzgI;0 zQlkmy18~rEfCq`_MxeT+;x~;CEW%@V8qWb>G%zf-b>A%K)>wED?Is7kqC>yETmnuG zjcCW{l<#=qRBuGMG#Qs4a?{CHb&3LjmIfUxYMQGs9`Z@u=C6tG`<~Z|b_#woSqiP! zrUORji)2}Ek-B(S>_r7YeoBaCW)X9pgAPbD>$j&8H6@jNA{zAu#v{# zNJ2Y}I{=#l2PrDJ0qQO~-s-m54iZ84PFy7~04&|`Lq9}DnL`f@aR z%`?`1{ch!Isn;$5$b+EyiP=4tzHEiH*#_o%<~$H=gF&>_AYRlru5aP1iZKwgN%m;g z-1Ak{-7i@EM#I!H5wE&FtZ9suR_Yb?$fK)HHm(%!m=7C zn?7I|>lg;&;Q)ngJ5-z?XLS6I9XziiAJ%p_06ZTJ3Uq*xT`Q^hooq#6|N2I}r+23` zV)rrW^SlbN=Ux(rxr5u%kVxI&gvODO^hpF5k4sFFREcoflcq|?z}1W7Pef`DJxd#? zce4z@EW&1Ynok&52whs(nRYXsVg%UTQb(NqasO_<>PZqwlk)SeCxsqS75_ydtb)<> zV+1k{t|-Ezg~oU%p|ifQDYtWBvDPL|nrm-fdA9Y#lMn z;5|69`4}Hn8*lI0QobPIDUxX6+Nb^IaTeRsf=6{bJpfwt96Dj!Ag1hT3^F2?jRx_7 zPHn)17gBL~tW~{GEb}6m-FVo(N1zp8UO`;-^4djxt>P;>6}@QmT?PQVTOd4P>+wwb zXofzTC=ZH#M65*2W0Q$M!7Qhuj+ndJ`4q$}pwkMfqUFhj{vLgERcn<>|LYA<%043Ls4z5abRg`W#X5>v;sPoXMO1vrQp$25&-zt znjzL0)me{Q{wmBDsfoZNt!bK_Gt9H27__;aP2VlGmrf-I0HdP>=JCy{BJbZC03pl# z$cC!|?n)`L>AQT-$L4loSegKcq=$mY@JO;4&3Q&L5ty9^OjI+XY5%tc`Ip?&Uz2)* zta2!}QG&{v;e(o$Icq`?v3ou9Y(lS$s8@XS&hq90P(h0+L2qy0$|t# zZNIF9_pPF7fayMvPJmScC*Gtg0rN#=J9btvnkrcUG>-z>wIG=0%o8&xU!^L6lJ#0H zX#gPagxQz`c!*eM??JUnRpho``MPYpJ*t&90PR}sYD*z~SG*kdk0YI5s zpv={;i~tn?l(_}UT>Z)jPys-hTcFI -
-
- -
-
- - - - - diff --git a/vueJs/src/components/InstantMessage/components/AddFriend.vue b/vueJs/src/components/Lemon-IMUI/components/AddFriend.vue similarity index 95% rename from vueJs/src/components/InstantMessage/components/AddFriend.vue rename to vueJs/src/components/Lemon-IMUI/components/AddFriend.vue index fe02efacd..6dedffc4a 100644 --- a/vueJs/src/components/InstantMessage/components/AddFriend.vue +++ b/vueJs/src/components/Lemon-IMUI/components/AddFriend.vue @@ -80,7 +80,7 @@ import EventBusMiXin from '@/mixins/EventBusMiXin' import Component, { mixins } from 'vue-class-component' import { User } from '@/api/users' -import ImApiService, { AddUserFriend } from '@/api/instant-message' +import ImApiService, { RequestUserFriend } from '@/api/instant-message' import UserLookupApiService from '@/api/user-lookup' import { abpPagerFormat } from '@/utils' @@ -153,12 +153,11 @@ export default class extends mixins(EventBusMiXin) { } private onAddFriendClick(user: User) { - const addFriend = new AddUserFriend(user.id, user.userName) + const requestFriend = new RequestUserFriend(user.id, user.userName) ImApiService - .addFriend(addFriend) + .addRequest(requestFriend) .then(() => { this.$message.success('已发送用户好友申请') - this.trigger('onUserFriendAdded', user) }) } } diff --git a/vueJs/src/components/Lemon-IMUI/components/Avatar.vue b/vueJs/src/components/Lemon-IMUI/components/Avatar.vue deleted file mode 100644 index a9a1efd7e..000000000 --- a/vueJs/src/components/Lemon-IMUI/components/Avatar.vue +++ /dev/null @@ -1,54 +0,0 @@ - - - diff --git a/vueJs/src/components/Lemon-IMUI/index.vue b/vueJs/src/components/Lemon-IMUI/index.vue index e69de29bb..8f54a773c 100644 --- a/vueJs/src/components/Lemon-IMUI/index.vue +++ b/vueJs/src/components/Lemon-IMUI/index.vue @@ -0,0 +1,773 @@ + + + + + diff --git a/vueJs/src/components/Notification/components/UserNofitications.vue b/vueJs/src/components/Notification/components/UserNofitications.vue index a40ca1b74..4d5cc440b 100644 --- a/vueJs/src/components/Notification/components/UserNofitications.vue +++ b/vueJs/src/components/Notification/components/UserNofitications.vue @@ -1,7 +1,12 @@