Browse Source

feat(other): Some commits.

pull/1066/head
colin 1 year ago
parent
commit
5e9e749969
  1. 2
      Directory.Packages.props
  2. 7
      aspnet-core/LINGYUN.MicroService.All.sln
  3. 17
      aspnet-core/LINGYUN.MicroService.SingleProject.sln
  4. 11
      aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/AbpAuditingMapperProfile.cs
  5. 2
      aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/LINGYUN/Abp/DataProtectionManagement/EntityFrameworkCore/AbpDataProtectionManagementDbContext.cs
  6. 6
      aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/LINGYUN/Abp/PermissionManagement/Definitions/PermissionDefinitionAppService.cs
  7. 11
      aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/LINGYUN/Abp/PermissionManagement/Definitions/PermissionGroupDefinitionAppService.cs
  8. 60
      aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/ClientProxies/LINGYUN/Abp/Notifications/Definitions/Groups/NotificationGroupDefinitionClientProxy.Generated.cs
  9. 7
      aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/ClientProxies/LINGYUN/Abp/Notifications/Definitions/Groups/NotificationGroupDefinitionClientProxy.cs
  10. 60
      aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/ClientProxies/LINGYUN/Abp/Notifications/Definitions/Notifications/NotificationDefinitionClientProxy.Generated.cs
  11. 7
      aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/ClientProxies/LINGYUN/Abp/Notifications/Definitions/Notifications/NotificationDefinitionClientProxy.cs
  12. 51
      aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/ClientProxies/LINGYUN/Abp/Notifications/MyNotificationClientProxy.Generated.cs
  13. 7
      aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/ClientProxies/LINGYUN/Abp/Notifications/MyNotificationClientProxy.cs
  14. 56
      aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/ClientProxies/LINGYUN/Abp/Notifications/MySubscriptionClientProxy.Generated.cs
  15. 7
      aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/ClientProxies/LINGYUN/Abp/Notifications/MySubscriptionClientProxy.cs
  16. 39
      aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/ClientProxies/LINGYUN/Abp/Notifications/NotificationClientProxy.Generated.cs
  17. 7
      aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/ClientProxies/LINGYUN/Abp/Notifications/NotificationClientProxy.cs
  18. 1413
      aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/ClientProxies/notifications-generate-proxy.json
  19. 3
      aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/FodyWeavers.xml
  20. 30
      aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/FodyWeavers.xsd
  21. 23
      aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/LINGYUN.Abp.Notifications.HttpApi.Client.csproj
  22. 19
      aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/LINGYUN/Abp/Notifications/AbpNotificationsHttpApiClientModule.cs
  23. 112
      aspnet-core/services/LY.MicroService.Applications.Single/AbpDynamicFeatureDefinitionStoreInMemoryCache.cs
  24. 8
      aspnet-core/services/LY.MicroService.Applications.Single/LY.MicroService.Applications.Single.csproj
  25. 33
      aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.Configure.cs
  26. 11
      aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs
  27. 23
      aspnet-core/services/LY.MicroService.Applications.Single/appsettings.Development.json
  28. 3
      aspnet-core/services/LY.MicroService.Applications.Single/appsettings.json
  29. 13
      aspnet-core/tests/LINGYUN.Abp.IP2Region.Tests/LINGYUN/Abp/IP2Region/SearcherTest.cs

2
Directory.Packages.props

@ -181,6 +181,8 @@
<PackageVersion Include="DotNetCore.CAP.MySql" Version="$(DotNetCoreCAPPackageVersion)" />
<PackageVersion Include="DotNetCore.CAP.OpenTelemetry" Version="$(DotNetCoreCAPPackageVersion)" />
<PackageVersion Include="DotNetCore.CAP.RabbitMQ" Version="$(DotNetCoreCAPPackageVersion)" />
<PackageVersion Include="DotNetCore.CAP.InMemoryStorage" Version="$(DotNetCoreCAPPackageVersion)" />
<PackageVersion Include="Savorboard.CAP.InMemoryMessageQueue" Version="$(DotNetCoreCAPPackageVersion)" />
</ItemGroup>
<!-- Serilog -->
<ItemGroup>

7
aspnet-core/LINGYUN.MicroService.All.sln

@ -766,6 +766,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.OssManagement.I
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.OssManagement.Imaging", "modules\oss-management\LINGYUN.Abp.OssManagement.Imaging\LINGYUN.Abp.OssManagement.Imaging.csproj", "{267933BD-BFB8-4906-BA39-DF193B2FD558}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Notifications.HttpApi.Client", "modules\realtime-notifications\LINGYUN.Abp.Notifications.HttpApi.Client\LINGYUN.Abp.Notifications.HttpApi.Client.csproj", "{3CBD1342-C021-49FB-933F-FAC1DAFC7B48}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -1964,6 +1966,10 @@ Global
{267933BD-BFB8-4906-BA39-DF193B2FD558}.Debug|Any CPU.Build.0 = Debug|Any CPU
{267933BD-BFB8-4906-BA39-DF193B2FD558}.Release|Any CPU.ActiveCfg = Release|Any CPU
{267933BD-BFB8-4906-BA39-DF193B2FD558}.Release|Any CPU.Build.0 = Release|Any CPU
{3CBD1342-C021-49FB-933F-FAC1DAFC7B48}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3CBD1342-C021-49FB-933F-FAC1DAFC7B48}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3CBD1342-C021-49FB-933F-FAC1DAFC7B48}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3CBD1342-C021-49FB-933F-FAC1DAFC7B48}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -2334,6 +2340,7 @@ Global
{F2AD691B-71B9-4B86-95BC-E020DA6B1E4A} = {370D7CD5-1E17-4F3D-BBFA-03429F6D4F2F}
{76DDE71D-00BD-4BC8-AEA2-31209E2B7E05} = {B05CB08F-C088-4D6D-97EE-A94A5D1AE4A6}
{267933BD-BFB8-4906-BA39-DF193B2FD558} = {B05CB08F-C088-4D6D-97EE-A94A5D1AE4A6}
{3CBD1342-C021-49FB-933F-FAC1DAFC7B48} = {1A23BB7F-1839-4204-88C5-7E9A6C9FBF1E}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C95FDF91-16F2-4A8B-A4BE-0E62D1B66718}

17
aspnet-core/LINGYUN.MicroService.SingleProject.sln

@ -602,6 +602,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.OssManagement.M
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.OssManagement.Imaging", "modules\oss-management\LINGYUN.Abp.OssManagement.Imaging\LINGYUN.Abp.OssManagement.Imaging.csproj", "{BC7A8662-4313-4F1D-B267-9B1B69444CD3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "cap", "cap", "{7C35101B-EA29-4B3D-B424-FAD625977E4D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.EventBus.CAP", "framework\common\LINGYUN.Abp.EventBus.CAP\LINGYUN.Abp.EventBus.CAP.csproj", "{4539FCDB-7192-442C-BD9B-0AC71E882F4F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.AuditLogging.IP2Region", "framework\auditing\LINGYUN.Abp.AuditLogging.IP2Region\LINGYUN.Abp.AuditLogging.IP2Region.csproj", "{DFDF367D-EDE1-4365-90F9-32F529117B60}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -1584,6 +1590,14 @@ Global
{BC7A8662-4313-4F1D-B267-9B1B69444CD3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BC7A8662-4313-4F1D-B267-9B1B69444CD3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BC7A8662-4313-4F1D-B267-9B1B69444CD3}.Release|Any CPU.Build.0 = Release|Any CPU
{4539FCDB-7192-442C-BD9B-0AC71E882F4F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4539FCDB-7192-442C-BD9B-0AC71E882F4F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4539FCDB-7192-442C-BD9B-0AC71E882F4F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4539FCDB-7192-442C-BD9B-0AC71E882F4F}.Release|Any CPU.Build.0 = Release|Any CPU
{DFDF367D-EDE1-4365-90F9-32F529117B60}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DFDF367D-EDE1-4365-90F9-32F529117B60}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DFDF367D-EDE1-4365-90F9-32F529117B60}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DFDF367D-EDE1-4365-90F9-32F529117B60}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -1876,6 +1890,9 @@ Global
{319428B9-CE7F-4027-92FA-6311C4CE95FB} = {4A2CF141-F32D-45A0-8665-B3705667A6D2}
{9AE3E97E-8846-4315-9546-FF97E97FD49F} = {3AD66E47-B667-40D1-AE61-F5EC186241F7}
{BC7A8662-4313-4F1D-B267-9B1B69444CD3} = {3AD66E47-B667-40D1-AE61-F5EC186241F7}
{7C35101B-EA29-4B3D-B424-FAD625977E4D} = {99B7CBDE-A251-4738-97F0-DB1DB484BEE1}
{4539FCDB-7192-442C-BD9B-0AC71E882F4F} = {7C35101B-EA29-4B3D-B424-FAD625977E4D}
{DFDF367D-EDE1-4365-90F9-32F529117B60} = {C22741F9-FC56-4AE3-B543-9F15C779D345}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {711A43C0-A2F8-4E5C-9B9F-F2551E4B3FF1}

11
aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application/LINGYUN/Abp/Auditing/AbpAuditingMapperProfile.cs

@ -4,6 +4,7 @@ using LINGYUN.Abp.Auditing.Logging;
using LINGYUN.Abp.Auditing.SecurityLogs;
using LINGYUN.Abp.AuditLogging;
using LINGYUN.Abp.Logging;
using Volo.Abp.ObjectExtending;
namespace LINGYUN.Abp.Auditing;
@ -12,16 +13,16 @@ public class AbpAuditingMapperProfile : Profile
public AbpAuditingMapperProfile()
{
CreateMap<AuditLogAction, AuditLogActionDto>()
.MapExtraProperties();
.MapExtraProperties(MappingPropertyDefinitionChecks.None);
CreateMap<EntityPropertyChange, EntityPropertyChangeDto>();
CreateMap<EntityChangeWithUsername, EntityChangeWithUsernameDto>();
CreateMap<EntityChange, EntityChangeDto>()
.MapExtraProperties();
.MapExtraProperties(MappingPropertyDefinitionChecks.None);
CreateMap<AuditLog, AuditLogDto>()
.MapExtraProperties();
.MapExtraProperties(MappingPropertyDefinitionChecks.None);
CreateMap<SecurityLog, SecurityLogDto>()
.MapExtraProperties();
CreateMap<SecurityLog, SecurityLogDto>(MemberList.Destination)
.MapExtraProperties(MappingPropertyDefinitionChecks.None);
CreateMap<LogField, LogFieldDto>();
CreateMap<LogException, LogExceptionDto>();

2
aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore/LINGYUN/Abp/DataProtectionManagement/EntityFrameworkCore/AbpDataProtectionManagementDbContext.cs

@ -15,6 +15,6 @@ public class AbpDataProtectionManagementDbContext : AbpDbContext<AbpDataProtecti
{
base.OnModelCreating(modelBuilder);
modelBuilder.ConfigureDataProtectionManagement(); ;
modelBuilder.ConfigureDataProtectionManagement();
}
}

6
aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/LINGYUN/Abp/PermissionManagement/Definitions/PermissionDefinitionAppService.cs

@ -91,6 +91,12 @@ public class PermissionDefinitionAppService : PermissionManagementAppServiceBase
[Authorize(PermissionManagementPermissionNames.Definition.Delete)]
public async virtual Task DeleteAsync(string name)
{
if (await _staticPermissionDefinitionStore.GetOrNullAsync(name) != null)
{
throw new BusinessException(PermissionManagementErrorCodes.GroupDefinition.StaticGroupNotAllowedChanged)
.WithData("Name", name);
}
var definitionRecord = await FindByNameAsync(name);
if (definitionRecord != null)

11
aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Application/LINGYUN/Abp/PermissionManagement/Definitions/PermissionGroupDefinitionAppService.cs

@ -78,6 +78,13 @@ public class PermissionGroupDefinitionAppService : PermissionManagementAppServic
[Authorize(PermissionManagementPermissionNames.GroupDefinition.Delete)]
public async virtual Task DeleteAsync(string name)
{
var staticGroups = await _staticPermissionDefinitionStore.GetGroupsAsync();
if (staticGroups.Any(g => g.Name == name))
{
throw new BusinessException(PermissionManagementErrorCodes.GroupDefinition.StaticGroupNotAllowedChanged)
.WithData("Name", name);
}
var groupDefinitionRecord = await FindByNameAsync(name);
if (groupDefinitionRecord != null)
@ -133,8 +140,8 @@ public class PermissionGroupDefinitionAppService : PermissionManagementAppServic
[Authorize(PermissionManagementPermissionNames.GroupDefinition.Update)]
public async virtual Task<PermissionGroupDefinitionDto> UpdateAsync(string name, PermissionGroupDefinitionUpdateDto input)
{
var groupDefinition = await _permissionDefinitionManager.GetGroupOrNullAsync(name);
if (groupDefinition != null)
var staticGroups = await _staticPermissionDefinitionStore.GetGroupsAsync();
if (staticGroups.Any(g => g.Name == name))
{
throw new BusinessException(PermissionManagementErrorCodes.GroupDefinition.StaticGroupNotAllowedChanged)
.WithData("Name", name);

60
aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/ClientProxies/LINGYUN/Abp/Notifications/Definitions/Groups/NotificationGroupDefinitionClientProxy.Generated.cs

@ -0,0 +1,60 @@
// This file is automatically generated by ABP framework to use MVC Controllers from CSharp
using LINGYUN.Abp.Notifications.Definitions.Groups;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Http.Client;
using Volo.Abp.Http.Client.ClientProxying;
using Volo.Abp.Http.Modeling;
// ReSharper disable once CheckNamespace
namespace LINGYUN.Abp.Notifications.Definitions.Groups;
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(INotificationGroupDefinitionAppService), typeof(NotificationGroupDefinitionClientProxy))]
public partial class NotificationGroupDefinitionClientProxy : ClientProxyBase<INotificationGroupDefinitionAppService>, INotificationGroupDefinitionAppService
{
public virtual async Task<NotificationGroupDefinitionDto> CreateAsync(NotificationGroupDefinitionCreateDto input)
{
return await RequestAsync<NotificationGroupDefinitionDto>(nameof(CreateAsync), new ClientProxyRequestTypeValue
{
{ typeof(NotificationGroupDefinitionCreateDto), input }
});
}
public virtual async Task DeleteAsync(string name)
{
await RequestAsync(nameof(DeleteAsync), new ClientProxyRequestTypeValue
{
{ typeof(string), name }
});
}
public virtual async Task<NotificationGroupDefinitionDto> GetAsync(string name)
{
return await RequestAsync<NotificationGroupDefinitionDto>(nameof(GetAsync), new ClientProxyRequestTypeValue
{
{ typeof(string), name }
});
}
public virtual async Task<ListResultDto<NotificationGroupDefinitionDto>> GetListAsync(NotificationGroupDefinitionGetListInput input)
{
return await RequestAsync<ListResultDto<NotificationGroupDefinitionDto>>(nameof(GetListAsync), new ClientProxyRequestTypeValue
{
{ typeof(NotificationGroupDefinitionGetListInput), input }
});
}
public virtual async Task<NotificationGroupDefinitionDto> UpdateAsync(string name, NotificationGroupDefinitionUpdateDto input)
{
return await RequestAsync<NotificationGroupDefinitionDto>(nameof(UpdateAsync), new ClientProxyRequestTypeValue
{
{ typeof(string), name },
{ typeof(NotificationGroupDefinitionUpdateDto), input }
});
}
}

7
aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/ClientProxies/LINGYUN/Abp/Notifications/Definitions/Groups/NotificationGroupDefinitionClientProxy.cs

@ -0,0 +1,7 @@
// This file is part of NotificationGroupDefinitionClientProxy, you can customize it here
// ReSharper disable once CheckNamespace
namespace LINGYUN.Abp.Notifications.Definitions.Groups;
public partial class NotificationGroupDefinitionClientProxy
{
}

60
aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/ClientProxies/LINGYUN/Abp/Notifications/Definitions/Notifications/NotificationDefinitionClientProxy.Generated.cs

@ -0,0 +1,60 @@
// This file is automatically generated by ABP framework to use MVC Controllers from CSharp
using LINGYUN.Abp.Notifications.Definitions.Notifications;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Http.Client;
using Volo.Abp.Http.Client.ClientProxying;
using Volo.Abp.Http.Modeling;
// ReSharper disable once CheckNamespace
namespace LINGYUN.Abp.Notifications.Definitions.Notifications;
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(INotificationDefinitionAppService), typeof(NotificationDefinitionClientProxy))]
public partial class NotificationDefinitionClientProxy : ClientProxyBase<INotificationDefinitionAppService>, INotificationDefinitionAppService
{
public virtual async Task<NotificationDefinitionDto> CreateAsync(NotificationDefinitionCreateDto input)
{
return await RequestAsync<NotificationDefinitionDto>(nameof(CreateAsync), new ClientProxyRequestTypeValue
{
{ typeof(NotificationDefinitionCreateDto), input }
});
}
public virtual async Task DeleteAsync(string name)
{
await RequestAsync(nameof(DeleteAsync), new ClientProxyRequestTypeValue
{
{ typeof(string), name }
});
}
public virtual async Task<NotificationDefinitionDto> GetAsync(string name)
{
return await RequestAsync<NotificationDefinitionDto>(nameof(GetAsync), new ClientProxyRequestTypeValue
{
{ typeof(string), name }
});
}
public virtual async Task<ListResultDto<NotificationDefinitionDto>> GetListAsync(NotificationDefinitionGetListInput input)
{
return await RequestAsync<ListResultDto<NotificationDefinitionDto>>(nameof(GetListAsync), new ClientProxyRequestTypeValue
{
{ typeof(NotificationDefinitionGetListInput), input }
});
}
public virtual async Task<NotificationDefinitionDto> UpdateAsync(string name, NotificationDefinitionUpdateDto input)
{
return await RequestAsync<NotificationDefinitionDto>(nameof(UpdateAsync), new ClientProxyRequestTypeValue
{
{ typeof(string), name },
{ typeof(NotificationDefinitionUpdateDto), input }
});
}
}

7
aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/ClientProxies/LINGYUN/Abp/Notifications/Definitions/Notifications/NotificationDefinitionClientProxy.cs

@ -0,0 +1,7 @@
// This file is part of NotificationDefinitionClientProxy, you can customize it here
// ReSharper disable once CheckNamespace
namespace LINGYUN.Abp.Notifications.Definitions.Notifications;
public partial class NotificationDefinitionClientProxy
{
}

51
aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/ClientProxies/LINGYUN/Abp/Notifications/MyNotificationClientProxy.Generated.cs

@ -0,0 +1,51 @@
// This file is automatically generated by ABP framework to use MVC Controllers from CSharp
using LINGYUN.Abp.Notifications;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Http.Client;
using Volo.Abp.Http.Client.ClientProxying;
using Volo.Abp.Http.Modeling;
// ReSharper disable once CheckNamespace
namespace LINGYUN.Abp.Notifications;
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(IMyNotificationAppService), typeof(MyNotificationClientProxy))]
public partial class MyNotificationClientProxy : ClientProxyBase<IMyNotificationAppService>, IMyNotificationAppService
{
public virtual async Task MarkReadStateAsync(NotificationMarkReadStateInput input)
{
await RequestAsync(nameof(MarkReadStateAsync), new ClientProxyRequestTypeValue
{
{ typeof(NotificationMarkReadStateInput), input }
});
}
public virtual async Task DeleteAsync(long id)
{
await RequestAsync(nameof(DeleteAsync), new ClientProxyRequestTypeValue
{
{ typeof(long), id }
});
}
public virtual async Task<UserNotificationDto> GetAsync(long id)
{
return await RequestAsync<UserNotificationDto>(nameof(GetAsync), new ClientProxyRequestTypeValue
{
{ typeof(long), id }
});
}
public virtual async Task<PagedResultDto<UserNotificationDto>> GetListAsync(UserNotificationGetByPagedDto input)
{
return await RequestAsync<PagedResultDto<UserNotificationDto>>(nameof(GetListAsync), new ClientProxyRequestTypeValue
{
{ typeof(UserNotificationGetByPagedDto), input }
});
}
}

7
aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/ClientProxies/LINGYUN/Abp/Notifications/MyNotificationClientProxy.cs

@ -0,0 +1,7 @@
// This file is part of MyNotificationClientProxy, you can customize it here
// ReSharper disable once CheckNamespace
namespace LINGYUN.Abp.Notifications;
public partial class MyNotificationClientProxy
{
}

56
aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/ClientProxies/LINGYUN/Abp/Notifications/MySubscriptionClientProxy.Generated.cs

@ -0,0 +1,56 @@
// This file is automatically generated by ABP framework to use MVC Controllers from CSharp
using LINGYUN.Abp.Notifications;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Http.Client;
using Volo.Abp.Http.Client.ClientProxying;
using Volo.Abp.Http.Modeling;
// ReSharper disable once CheckNamespace
namespace LINGYUN.Abp.Notifications;
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(IMySubscriptionAppService), typeof(MySubscriptionClientProxy))]
public partial class MySubscriptionClientProxy : ClientProxyBase<IMySubscriptionAppService>, IMySubscriptionAppService
{
public virtual async Task<ListResultDto<UserSubscreNotificationDto>> GetAllListAsync()
{
return await RequestAsync<ListResultDto<UserSubscreNotificationDto>>(nameof(GetAllListAsync));
}
public virtual async Task<PagedResultDto<UserSubscreNotificationDto>> GetListAsync(SubscriptionsGetByPagedDto input)
{
return await RequestAsync<PagedResultDto<UserSubscreNotificationDto>>(nameof(GetListAsync), new ClientProxyRequestTypeValue
{
{ typeof(SubscriptionsGetByPagedDto), input }
});
}
public virtual async Task<UserSubscriptionsResult> IsSubscribedAsync(SubscriptionsGetByNameDto input)
{
return await RequestAsync<UserSubscriptionsResult>(nameof(IsSubscribedAsync), new ClientProxyRequestTypeValue
{
{ typeof(SubscriptionsGetByNameDto), input }
});
}
public virtual async Task SubscribeAsync(SubscriptionsGetByNameDto input)
{
await RequestAsync(nameof(SubscribeAsync), new ClientProxyRequestTypeValue
{
{ typeof(SubscriptionsGetByNameDto), input }
});
}
public virtual async Task UnSubscribeAsync(SubscriptionsGetByNameDto input)
{
await RequestAsync(nameof(UnSubscribeAsync), new ClientProxyRequestTypeValue
{
{ typeof(SubscriptionsGetByNameDto), input }
});
}
}

7
aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/ClientProxies/LINGYUN/Abp/Notifications/MySubscriptionClientProxy.cs

@ -0,0 +1,7 @@
// This file is part of MySubscriptionClientProxy, you can customize it here
// ReSharper disable once CheckNamespace
namespace LINGYUN.Abp.Notifications;
public partial class MySubscriptionClientProxy
{
}

39
aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/ClientProxies/LINGYUN/Abp/Notifications/NotificationClientProxy.Generated.cs

@ -0,0 +1,39 @@
// This file is automatically generated by ABP framework to use MVC Controllers from CSharp
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Http.Client.ClientProxying;
// ReSharper disable once CheckNamespace
namespace LINGYUN.Abp.Notifications;
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(INotificationAppService), typeof(NotificationClientProxy))]
public partial class NotificationClientProxy : ClientProxyBase<INotificationAppService>, INotificationAppService
{
public virtual async Task SendAsync(NotificationSendDto input)
{
await RequestAsync(nameof(SendAsync), new ClientProxyRequestTypeValue
{
{ typeof(NotificationSendDto), input }
});
}
public virtual async Task<ListResultDto<NotificationGroupDto>> GetAssignableNotifiersAsync()
{
return await RequestAsync<ListResultDto<NotificationGroupDto>>(nameof(GetAssignableNotifiersAsync));
}
public virtual async Task<ListResultDto<NotificationTemplateDto>> GetAssignableTemplatesAsync()
{
return await RequestAsync<ListResultDto<NotificationTemplateDto>>(nameof(GetAssignableTemplatesAsync));
}
public virtual async Task SendAsync(NotificationTemplateSendDto input)
{
await RequestAsync(nameof(SendAsync), new ClientProxyRequestTypeValue
{
{ typeof(NotificationTemplateSendDto), input }
});
}
}

7
aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/ClientProxies/LINGYUN/Abp/Notifications/NotificationClientProxy.cs

@ -0,0 +1,7 @@
// This file is part of NotificationClientProxy, you can customize it here
// ReSharper disable once CheckNamespace
namespace LINGYUN.Abp.Notifications;
public partial class NotificationClientProxy
{
}

1413
aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/ClientProxies/notifications-generate-proxy.json

File diff suppressed because it is too large

3
aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

23
aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/LINGYUN.Abp.Notifications.HttpApi.Client.csproj

@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="ClientProxies\notifications-generate-proxy.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Http.Client" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.Notifications.Application.Contracts\LINGYUN.Abp.Notifications.Application.Contracts.csproj" />
</ItemGroup>
</Project>

19
aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi.Client/LINGYUN/Abp/Notifications/AbpNotificationsHttpApiClientModule.cs

@ -0,0 +1,19 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Http.Client;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.Notifications;
[DependsOn(
typeof(AbpHttpClientModule),
typeof(AbpNotificationsApplicationContractsModule))]
public class AbpNotificationsHttpApiClientModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddStaticHttpClientProxies(
typeof(AbpNotificationsApplicationContractsModule).Assembly,
AbpNotificationsRemoteServiceConsts.RemoteServiceName
);
}
}

112
aspnet-core/services/LY.MicroService.Applications.Single/AbpDynamicFeatureDefinitionStoreInMemoryCache.cs

@ -0,0 +1,112 @@

using Volo.Abp.DependencyInjection;
namespace LY.MicroService.Applications.Single;
[Dependency(ServiceLifetime.Singleton, ReplaceServices = true)]
public class AbpDynamicFeatureDefinitionStoreInMemoryCache : IDynamicFeatureDefinitionStoreInMemoryCache
{
public string CacheStamp { get; set; }
protected IDictionary<string, FeatureGroupDefinition> FeatureGroupDefinitions { get; }
protected IDictionary<string, FeatureDefinition> FeatureDefinitions { get; }
protected StringValueTypeSerializer StateCheckerSerializer { get; }
protected ILocalizableStringSerializer LocalizableStringSerializer { get; }
public SemaphoreSlim SyncSemaphore { get; } = new(1, 1);
public DateTime? LastCheckTime { get; set; }
public AbpDynamicFeatureDefinitionStoreInMemoryCache(
StringValueTypeSerializer stateCheckerSerializer,
ILocalizableStringSerializer localizableStringSerializer)
{
StateCheckerSerializer = stateCheckerSerializer;
LocalizableStringSerializer = localizableStringSerializer;
FeatureGroupDefinitions = new Dictionary<string, FeatureGroupDefinition>();
FeatureDefinitions = new Dictionary<string, FeatureDefinition>();
}
public Task FillAsync(
List<FeatureGroupDefinitionRecord> featureGroupRecords,
List<FeatureDefinitionRecord> featureRecords)
{
FeatureGroupDefinitions.Clear();
FeatureDefinitions.Clear();
var context = new FeatureDefinitionContext();
foreach (var featureGroupRecord in featureGroupRecords)
{
var featureGroup = context.AddGroup(
featureGroupRecord.Name,
featureGroupRecord.DisplayName != null ? LocalizableStringSerializer.Deserialize(featureGroupRecord.DisplayName) : null
);
FeatureGroupDefinitions[featureGroup.Name] = featureGroup;
foreach (var property in featureGroupRecord.ExtraProperties)
{
featureGroup[property.Key] = property.Value;
}
var featureRecordsInThisGroup = featureRecords
.Where(p => p.GroupName == featureGroup.Name);
foreach (var featureRecord in featureRecordsInThisGroup.Where(x => x.ParentName == null))
{
AddFeatureRecursively(featureGroup, featureRecord, featureRecords);
}
}
return Task.CompletedTask;
}
public FeatureDefinition GetFeatureOrNull(string name)
{
return FeatureDefinitions.GetOrDefault(name);
}
public IReadOnlyList<FeatureDefinition> GetFeatures()
{
return FeatureDefinitions.Values.ToList();
}
public IReadOnlyList<FeatureGroupDefinition> GetGroups()
{
return FeatureGroupDefinitions.Values.ToList();
}
private void AddFeatureRecursively(ICanCreateChildFeature featureContainer,
FeatureDefinitionRecord featureRecord,
List<FeatureDefinitionRecord> allFeatureRecords)
{
var feature = featureContainer.CreateChildFeature(
featureRecord.Name,
featureRecord.DefaultValue,
featureRecord.DisplayName != null ? LocalizableStringSerializer.Deserialize(featureRecord.DisplayName) : null,
featureRecord.Description != null ? LocalizableStringSerializer.Deserialize(featureRecord.Description) : null,
StateCheckerSerializer.Deserialize(featureRecord.ValueType),
featureRecord.IsVisibleToClients,
featureRecord.IsAvailableToHost
);
FeatureDefinitions[feature.Name] = feature;
if (!featureRecord.AllowedProviders.IsNullOrWhiteSpace())
{
feature.AllowedProviders.AddRange(featureRecord.AllowedProviders.Split(','));
}
foreach (var property in featureRecord.ExtraProperties)
{
feature[property.Key] = property.Value;
}
foreach (var subFeature in allFeatureRecords.Where(p => p.ParentName == featureRecord.Name))
{
AddFeatureRecursively(feature, subFeature, allFeatureRecords);
}
}
}

8
aspnet-core/services/LY.MicroService.Applications.Single/LY.MicroService.Applications.Single.csproj

@ -11,6 +11,12 @@
<ItemGroup>
<PackageReference Include="DistributedLock.Redis" />
<PackageReference Include="DotNetCore.CAP.Dashboard" />
<PackageReference Include="DotNetCore.CAP.MySql" />
<PackageReference Include="DotNetCore.CAP.RabbitMQ" />
<PackageReference Include="DotNetCore.CAP.OpenTelemetry" />
<PackageReference Include="DotNetCore.CAP.InMemoryStorage" />
<PackageReference Include="Savorboard.CAP.InMemoryMessageQueue" />
<PackageReference Include="Elsa.Activities.Email" />
<PackageReference Include="Elsa.Activities.Http" />
<PackageReference Include="Elsa.Activities.UserTask" />
@ -58,6 +64,7 @@
<ItemGroup>
<ProjectReference Include="..\..\framework\auditing\LINGYUN.Abp.AuditLogging.EntityFrameworkCore\LINGYUN.Abp.AuditLogging.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\framework\auditing\LINGYUN.Abp.AuditLogging.IP2Region\LINGYUN.Abp.AuditLogging.IP2Region.csproj" />
<ProjectReference Include="..\..\framework\auditing\LINGYUN.Abp.AuditLogging\LINGYUN.Abp.AuditLogging.csproj" />
<ProjectReference Include="..\..\framework\authentication\LINGYUN.Abp.Authentication.QQ\LINGYUN.Abp.Authentication.QQ.csproj" />
<ProjectReference Include="..\..\framework\authentication\LINGYUN.Abp.Authentication.WeChat\LINGYUN.Abp.Authentication.WeChat.csproj" />
@ -69,6 +76,7 @@
<ProjectReference Include="..\..\framework\cloud-tencent\LINGYUN.Abp.Tencent\LINGYUN.Abp.Tencent.csproj" />
<ProjectReference Include="..\..\framework\common\LINGYUN.Abp.AspNetCore.HttpOverrides\LINGYUN.Abp.AspNetCore.HttpOverrides.csproj" />
<ProjectReference Include="..\..\framework\common\LINGYUN.Abp.Data.DbMigrator\LINGYUN.Abp.Data.DbMigrator.csproj" />
<ProjectReference Include="..\..\framework\common\LINGYUN.Abp.EventBus.CAP\LINGYUN.Abp.EventBus.CAP.csproj" />
<ProjectReference Include="..\..\framework\common\LINGYUN.Abp.ExceptionHandling.Emailing\LINGYUN.Abp.ExceptionHandling.Emailing.csproj" />
<ProjectReference Include="..\..\framework\common\LINGYUN.Abp.ExceptionHandling\LINGYUN.Abp.ExceptionHandling.csproj" />
<ProjectReference Include="..\..\framework\common\LINGYUN.Abp.Features.LimitValidation.Redis.Client\LINGYUN.Abp.Features.LimitValidation.Redis.Client.csproj" />

33
aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.Configure.cs

@ -1,4 +1,7 @@
using VoloAbpExceptionHandlingOptions = Volo.Abp.AspNetCore.ExceptionHandling.AbpExceptionHandlingOptions;
using DotNetCore.CAP;
using Microsoft.Extensions.Configuration;
using Savorboard.CAP.InMemoryMessageQueue;
using VoloAbpExceptionHandlingOptions = Volo.Abp.AspNetCore.ExceptionHandling.AbpExceptionHandlingOptions;
namespace LY.MicroService.Applications.Single;
@ -34,6 +37,28 @@ public partial class MicroServiceApplicationsSingleModule
}
}
private void PreConfigureCAP(IConfiguration configuration)
{
PreConfigure<CapOptions>(options =>
{
options.UseDashboard();
if (!configuration.GetValue<bool>("CAP:IsEnabled"))
{
options.UseInMemoryStorage().UseInMemoryMessageQueue();
return;
}
options
.UseMySql(sqlOptions =>
{
configuration.GetSection("CAP:MySql").Bind(sqlOptions);
})
.UseRabbitMQ(rabbitMQOptions =>
{
configuration.GetSection("CAP:RabbitMQ").Bind(rabbitMQOptions);
});
});
}
private void PreConfigureAuthServer(IConfiguration configuration)
{
PreConfigure<OpenIddictBuilder>(builder =>
@ -480,8 +505,12 @@ public partial class MicroServiceApplicationsSingleModule
});
}
private void ConfigureDbContext()
private void ConfigureDbContext(IConfiguration configuration)
{
Configure<AbpDbConnectionOptions>(options =>
{
configuration.GetSection("Databases").Bind(options.Databases);
});
Configure<AbpDbContextOptions>(options =>
{
options.UseMySQL();

11
aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs

@ -1,4 +1,6 @@
using Volo.Abp.MailKit;
using LINGYUN.Abp.AuditLogging.IP2Region;
using LINGYUN.Abp.EventBus.CAP;
using Volo.Abp.MailKit;
namespace LY.MicroService.Applications.Single;
@ -8,6 +10,7 @@ namespace LY.MicroService.Applications.Single;
typeof(AbpAccountWebOpenIddictModule),
typeof(AbpAuditingApplicationModule),
typeof(AbpAuditingHttpApiModule),
typeof(AbpAuditLoggingIP2RegionModule),
typeof(AbpAuditLoggingEntityFrameworkCoreModule),
typeof(AbpCachingManagementStackExchangeRedisModule),
typeof(AbpCachingManagementApplicationModule),
@ -184,6 +187,8 @@ namespace LY.MicroService.Applications.Single;
typeof(AbpElsaEntityFrameworkCoreModule),
typeof(AbpElsaEntityFrameworkCoreMySqlModule),
typeof(AbpCAPEventBusModule),
typeof(AbpExporterMiniExcelModule),
typeof(AbpAspNetCoreMvcUiMultiTenancyModule),
typeof(AbpAspNetCoreSerilogModule),
@ -193,7 +198,6 @@ namespace LY.MicroService.Applications.Single;
typeof(AbpAspNetCoreHttpOverridesModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
typeof(AbpMailKitModule),
typeof(AbpEventBusModule),
typeof(AbpAutofacModule)
)]
public partial class MicroServiceApplicationsSingleModule : AbpModule
@ -207,6 +211,7 @@ public partial class MicroServiceApplicationsSingleModule : AbpModule
PreConfigureFeature();
PreConfigureIdentity();
PreConfigureApp(configuration);
PreConfigureCAP(configuration);
PreConfigureQuartz(configuration);
PreConfigureAuthServer(configuration);
PreConfigureElsa(context.Services, configuration);
@ -222,7 +227,6 @@ public partial class MicroServiceApplicationsSingleModule : AbpModule
ConfigureWrapper();
ConfigureExporter();
ConfigureAuditing();
ConfigureDbContext();
ConfigureIdempotent();
ConfigureMvcUiTheme();
ConfigureDataSeeder();
@ -236,6 +240,7 @@ public partial class MicroServiceApplicationsSingleModule : AbpModule
ConfigureCaching(configuration);
ConfigureAuditing(configuration);
ConfigureIdentity(configuration);
ConfigureDbContext(configuration);
ConfigureAuthServer(configuration);
ConfigureSwagger(context.Services);
ConfigureEndpoints(context.Services);

23
aspnet-core/services/LY.MicroService.Applications.Single/appsettings.Development.json

@ -27,6 +27,29 @@
"Auditing": {
"AllEntitiesSelector": true
},
"CAP": {
"IsEnabled": false,
"EventBus": {
"DefaultGroupName": "Platform",
"GroupNamePrefix": "Dev",
"Version": "v1",
"FailedRetryInterval": 300,
"FailedRetryCount": 10
},
"MySql": {
"TableNamePrefix": "pt_event",
"ConnectionString": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None"
},
"RabbitMQ": {
"HostName": "127.0.0.1",
"Port": 5672,
"UserName": "admin",
"Password": "123456",
"ExchangeName": "LINGYUN.Abp.Application",
"VirtualHost": "/"
}
},
"DistributedCache": {
"HideErrors": true,
"KeyPrefix": "LINGYUN.Abp.Application",

3
aspnet-core/services/LY.MicroService.Applications.Single/appsettings.json

@ -1,4 +1,7 @@
{
"CAP": {
"IsEnabled": false
},
"Forwarded": {
"ForwardedHeaders": "XForwardedFor,XForwardedProto"
},

13
aspnet-core/tests/LINGYUN.Abp.IP2Region.Tests/LINGYUN/Abp/IP2Region/SearcherTest.cs

@ -1,4 +1,5 @@
using IP2Region.Net.XDB;
using Shouldly;
using System;
using System.IO;
using System.Linq;
@ -16,6 +17,18 @@ public class SearcherTest : AbpIP2RegionTestBase
_xdbStream = virtualFileProvider.GetFileInfo("/LINGYUN/Abp/IP2Region/Resources/ip2region.xdb").CreateReadStream();
}
[Theory]
[InlineData("8.8.8.8", "美国")]
[InlineData("36.133.108.1", "重庆市")]
[InlineData("111.26.31.1", "吉林省吉林市")]
[InlineData("220.246.0.1", "中国香港")]
public async void TestSearchLocation(string ip, string shouleBeRemarks)
{
var provider = GetRequiredService<IIpLocationInfoProvider>();
var locationInfo = await provider.GetLocationInfoAsync(ip);
locationInfo.Remarks.ShouldBe(shouleBeRemarks);
}
[Theory]
[InlineData("114.114.114.114")]
[InlineData("119.29.29.29")]

Loading…
Cancel
Save