Browse Source

feature: add push setting-management

pull/663/head
cKey 3 years ago
parent
commit
fa9be364da
  1. 22
      aspnet-core/LINGYUN.MicroService.Common.sln
  2. 3
      aspnet-core/modules/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/FodyWeavers.xml
  3. 30
      aspnet-core/modules/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/FodyWeavers.xsd
  4. 29
      aspnet-core/modules/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/LINGYUN.Abp.PushPlus.SettingManagement.csproj
  5. 48
      aspnet-core/modules/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/LINGYUN/Abp/PushPlus/SettingManagement/AbpPushPlusSettingManagementModule.cs
  6. 8
      aspnet-core/modules/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/LINGYUN/Abp/PushPlus/SettingManagement/IPushPlusSettingAppService.cs
  7. 7
      aspnet-core/modules/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/LINGYUN/Abp/PushPlus/SettingManagement/Localization/Resources/en.json
  8. 7
      aspnet-core/modules/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/LINGYUN/Abp/PushPlus/SettingManagement/Localization/Resources/zh-Hans.json
  9. 67
      aspnet-core/modules/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/LINGYUN/Abp/PushPlus/SettingManagement/PushPlusSettingAppService.cs
  10. 36
      aspnet-core/modules/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/LINGYUN/Abp/PushPlus/SettingManagement/PushPlusSettingController.cs
  11. 24
      aspnet-core/modules/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/LINGYUN/Abp/PushPlus/SettingManagement/PushPlusSettingPermissionDefinitionProvider.cs
  12. 9
      aspnet-core/modules/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/LINGYUN/Abp/PushPlus/SettingManagement/PushPlusSettingPermissionNames.cs
  13. 1
      aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/AbpSettingManagementRemoteServiceConsts.cs
  14. 3
      aspnet-core/modules/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/FodyWeavers.xml
  15. 30
      aspnet-core/modules/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/FodyWeavers.xsd
  16. 29
      aspnet-core/modules/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN.Abp.WxPusher.SettingManagement.csproj
  17. 48
      aspnet-core/modules/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/AbpWxPusherSettingManagementModule.cs
  18. 8
      aspnet-core/modules/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/IWxPusherSettingAppService.cs
  19. 7
      aspnet-core/modules/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/Localization/Resources/en.json
  20. 7
      aspnet-core/modules/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/Localization/Resources/zh-Hans.json
  21. 61
      aspnet-core/modules/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/WxPusherSettingAppService.cs
  22. 36
      aspnet-core/modules/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/WxPusherSettingController.cs
  23. 24
      aspnet-core/modules/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/WxPusherSettingPermissionDefinitionProvider.cs
  24. 9
      aspnet-core/modules/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/WxPusherSettingPermissionNames.cs
  25. 6
      aspnet-core/modules/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN.Abp.WxPusher.csproj
  26. 5
      aspnet-core/modules/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/Localization/Resources/en.json
  27. 5
      aspnet-core/modules/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/Localization/Resources/zh-Hans.json

22
aspnet-core/LINGYUN.MicroService.Common.sln

@ -252,13 +252,17 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.PushPlus.Tests"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "wx-pusher", "wx-pusher", "{7862CE70-76EF-4228-A703-C2E2A9704D14}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.WxPusher", "modules\wx-pusher\LINGYUN.Abp.WxPusher\LINGYUN.Abp.WxPusher.csproj", "{1A072FF5-1A7E-4F78-B145-1AB873AEB8FF}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.WxPusher", "modules\wx-pusher\LINGYUN.Abp.WxPusher\LINGYUN.Abp.WxPusher.csproj", "{1A072FF5-1A7E-4F78-B145-1AB873AEB8FF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.WxPusher.Tests", "tests\LINGYUN.Abp.WxPusher.Tests\LINGYUN.Abp.WxPusher.Tests.csproj", "{88412E3D-21C8-4FF1-8EB3-84CB74094336}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.WxPusher.Tests", "tests\LINGYUN.Abp.WxPusher.Tests\LINGYUN.Abp.WxPusher.Tests.csproj", "{88412E3D-21C8-4FF1-8EB3-84CB74094336}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Notifications.WxPusher", "modules\wx-pusher\LINGYUN.Abp.Notifications.WxPusher\LINGYUN.Abp.Notifications.WxPusher.csproj", "{F65A8835-C50F-43B0-B54C-196A92E9539F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Notifications.WxPusher", "modules\wx-pusher\LINGYUN.Abp.Notifications.WxPusher\LINGYUN.Abp.Notifications.WxPusher.csproj", "{F65A8835-C50F-43B0-B54C-196A92E9539F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Identity.WxPusher", "modules\wx-pusher\LINGYUN.Abp.Identity.WxPusher\LINGYUN.Abp.Identity.WxPusher.csproj", "{30FA01ED-921A-4E7D-9E83-6719538FB866}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Identity.WxPusher", "modules\wx-pusher\LINGYUN.Abp.Identity.WxPusher\LINGYUN.Abp.Identity.WxPusher.csproj", "{30FA01ED-921A-4E7D-9E83-6719538FB866}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.WxPusher.SettingManagement", "modules\wx-pusher\LINGYUN.Abp.WxPusher.SettingManagement\LINGYUN.Abp.WxPusher.SettingManagement.csproj", "{E6FDAD7B-4A7F-4CEB-9891-F8FC4E556C36}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.PushPlus.SettingManagement", "modules\pushplus\LINGYUN.Abp.PushPlus.SettingManagement\LINGYUN.Abp.PushPlus.SettingManagement.csproj", "{4CBB4A0C-6D23-44DD-BAF4-49D69ED35839}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -666,6 +670,14 @@ Global
{30FA01ED-921A-4E7D-9E83-6719538FB866}.Debug|Any CPU.Build.0 = Debug|Any CPU
{30FA01ED-921A-4E7D-9E83-6719538FB866}.Release|Any CPU.ActiveCfg = Release|Any CPU
{30FA01ED-921A-4E7D-9E83-6719538FB866}.Release|Any CPU.Build.0 = Release|Any CPU
{E6FDAD7B-4A7F-4CEB-9891-F8FC4E556C36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E6FDAD7B-4A7F-4CEB-9891-F8FC4E556C36}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E6FDAD7B-4A7F-4CEB-9891-F8FC4E556C36}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E6FDAD7B-4A7F-4CEB-9891-F8FC4E556C36}.Release|Any CPU.Build.0 = Release|Any CPU
{4CBB4A0C-6D23-44DD-BAF4-49D69ED35839}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4CBB4A0C-6D23-44DD-BAF4-49D69ED35839}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4CBB4A0C-6D23-44DD-BAF4-49D69ED35839}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4CBB4A0C-6D23-44DD-BAF4-49D69ED35839}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -795,6 +807,8 @@ Global
{88412E3D-21C8-4FF1-8EB3-84CB74094336} = {B86C21A4-73B7-471E-B73A-B4B905EC9435}
{F65A8835-C50F-43B0-B54C-196A92E9539F} = {7862CE70-76EF-4228-A703-C2E2A9704D14}
{30FA01ED-921A-4E7D-9E83-6719538FB866} = {7862CE70-76EF-4228-A703-C2E2A9704D14}
{E6FDAD7B-4A7F-4CEB-9891-F8FC4E556C36} = {7862CE70-76EF-4228-A703-C2E2A9704D14}
{4CBB4A0C-6D23-44DD-BAF4-49D69ED35839} = {0F5A2591-CE08-4184-A5F3-89F6FB3B2B10}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {06C707C6-02C0-411A-AD3B-2D0E13787CB8}

3
aspnet-core/modules/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/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/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/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>

29
aspnet-core/modules/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/LINGYUN.Abp.PushPlus.SettingManagement.csproj

@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\configureawait.props" />
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<None Remove="LINGYUN\Abp\PushPlus\SettingManagement\Localization\Resources\*.json" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="LINGYUN\Abp\PushPlus\SettingManagement\Localization\Resources\*.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="$(VoloAbpPackageVersion)" />
<PackageReference Include="Volo.Abp.SettingManagement.Domain" Version="$(VoloAbpPackageVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\settings\LINGYUN.Abp.SettingManagement.Application.Contracts\LINGYUN.Abp.SettingManagement.Application.Contracts.csproj" />
<ProjectReference Include="..\LINGYUN.Abp.PushPlus\LINGYUN.Abp.PushPlus.csproj" />
</ItemGroup>
</Project>

48
aspnet-core/modules/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/LINGYUN/Abp/PushPlus/SettingManagement/AbpPushPlusSettingManagementModule.cs

@ -0,0 +1,48 @@
using LINGYUN.Abp.PushPlus.Localization;
using Localization.Resources.AbpUi;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.VirtualFileSystem;
namespace LINGYUN.Abp.PushPlus.SettingManagement
{
[DependsOn(
typeof(AbpPushPlusModule),
typeof(AbpAspNetCoreMvcModule))]
public class AbpPushPlusSettingManagementModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
PreConfigure<IMvcBuilder>(mvcBuilder =>
{
mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpPushPlusSettingManagementModule).Assembly);
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpPushPlusSettingManagementModule>();
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<PushPlusResource>()
.AddVirtualJson("/LINGYUN/Abp/PushPlus/SettingManagement/Localization/Resources");
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<PushPlusResource>()
.AddBaseTypes(
typeof(AbpUiResource)
);
});
}
}
}

8
aspnet-core/modules/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/LINGYUN/Abp/PushPlus/SettingManagement/IPushPlusSettingAppService.cs

@ -0,0 +1,8 @@
using LINGYUN.Abp.SettingManagement;
namespace LINGYUN.Abp.PushPlus.SettingManagement
{
public interface IPushPlusSettingAppService : IReadonlySettingAppService
{
}
}

7
aspnet-core/modules/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/LINGYUN/Abp/PushPlus/SettingManagement/Localization/Resources/en.json

@ -0,0 +1,7 @@
{
"culture": "en",
"texts": {
"Permission:PushPlus": "PushPlus",
"Permission:ManageSetting": "Manage Setting"
}
}

7
aspnet-core/modules/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/LINGYUN/Abp/PushPlus/SettingManagement/Localization/Resources/zh-Hans.json

@ -0,0 +1,7 @@
{
"culture": "zh-Hans",
"texts": {
"Permission:PushPlus": "PushPlus",
"Permission:ManageSetting": "管理设置"
}
}

67
aspnet-core/modules/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/LINGYUN/Abp/PushPlus/SettingManagement/PushPlusSettingAppService.cs

@ -0,0 +1,67 @@
using LINGYUN.Abp.SettingManagement;
using LINGYUN.Abp.PushPlus.Localization;
using LINGYUN.Abp.PushPlus.Settings;
using System.Threading.Tasks;
using Volo.Abp.Application.Services;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.MultiTenancy;
using Volo.Abp.SettingManagement;
using Volo.Abp.Settings;
namespace LINGYUN.Abp.PushPlus.SettingManagement
{
public class WxPusherSettingAppService : ApplicationService, IPushPlusSettingAppService
{
protected ISettingManager SettingManager { get; }
protected IPermissionChecker PermissionChecker { get; }
protected ISettingDefinitionManager SettingDefinitionManager { get; }
public WxPusherSettingAppService(
ISettingManager settingManager,
IPermissionChecker permissionChecker,
ISettingDefinitionManager settingDefinitionManager)
{
SettingManager = settingManager;
PermissionChecker = permissionChecker;
SettingDefinitionManager = settingDefinitionManager;
LocalizationResource = typeof(PushPlusResource);
}
public async virtual Task<SettingGroupResult> GetAllForCurrentTenantAsync()
{
return await GetAllForProviderAsync(TenantSettingValueProvider.ProviderName, CurrentTenant.GetId().ToString());
}
public async virtual Task<SettingGroupResult> GetAllForGlobalAsync()
{
return await GetAllForProviderAsync(GlobalSettingValueProvider.ProviderName, null);
}
protected async virtual Task<SettingGroupResult> GetAllForProviderAsync(string providerName, string providerKey)
{
var settingGroups = new SettingGroupResult();
var pushPlusSettingGroup = new SettingGroupDto(L["DisplayName:PushPlus"], L["Description:PushPlus"]);
if (await PermissionChecker.IsGrantedAsync(PushPlusSettingPermissionNames.ManageSetting))
{
var securitySetting = pushPlusSettingGroup.AddSetting(L["Security"], L["Security"]);
securitySetting.AddDetail(
SettingDefinitionManager.Get(PushPlusSettingNames.Security.Token),
StringLocalizerFactory,
await SettingManager.GetOrNullAsync(PushPlusSettingNames.Security.Token, providerName, providerKey),
ValueType.String,
providerName);
securitySetting.AddDetail(
SettingDefinitionManager.Get(PushPlusSettingNames.Security.SecretKey),
StringLocalizerFactory,
await SettingManager.GetOrNullAsync(PushPlusSettingNames.Security.SecretKey, providerName, providerKey),
ValueType.String,
providerName);
}
settingGroups.AddGroup(pushPlusSettingGroup);
return settingGroups;
}
}
}

36
aspnet-core/modules/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/LINGYUN/Abp/PushPlus/SettingManagement/PushPlusSettingController.cs

@ -0,0 +1,36 @@
using LINGYUN.Abp.SettingManagement;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc;
namespace LINGYUN.Abp.PushPlus.SettingManagement
{
[RemoteService(Name = AbpSettingManagementRemoteServiceConsts.RemoteServiceName)]
[Area(AbpSettingManagementRemoteServiceConsts.ModuleName)]
[Route($"api/{AbpSettingManagementRemoteServiceConsts.ModuleName}/push-plus")]
public class WxPusherSettingController : AbpController, IPushPlusSettingAppService
{
protected IPushPlusSettingAppService Service { get; }
public WxPusherSettingController(
IPushPlusSettingAppService service)
{
Service = service;
}
[HttpGet]
[Route("by-current-tenant")]
public async virtual Task<SettingGroupResult> GetAllForCurrentTenantAsync()
{
return await Service.GetAllForCurrentTenantAsync();
}
[HttpGet]
[Route("by-global")]
public async virtual Task<SettingGroupResult> GetAllForGlobalAsync()
{
return await Service.GetAllForGlobalAsync();
}
}
}

24
aspnet-core/modules/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/LINGYUN/Abp/PushPlus/SettingManagement/PushPlusSettingPermissionDefinitionProvider.cs

@ -0,0 +1,24 @@
using LINGYUN.Abp.PushPlus.Localization;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Localization;
namespace LINGYUN.Abp.PushPlus.SettingManagement
{
public class PushPlusSettingPermissionDefinitionProvider : PermissionDefinitionProvider
{
public override void Define(IPermissionDefinitionContext context)
{
var pushPlusGroup = context.AddGroup(
PushPlusSettingPermissionNames.GroupName,
L("Permission:PushPlus"));
pushPlusGroup.AddPermission(
PushPlusSettingPermissionNames.ManageSetting, L("Permission:ManageSetting"));
}
private static LocalizableString L(string name)
{
return LocalizableString.Create<PushPlusResource>(name);
}
}
}

9
aspnet-core/modules/pushplus/LINGYUN.Abp.PushPlus.SettingManagement/LINGYUN/Abp/PushPlus/SettingManagement/PushPlusSettingPermissionNames.cs

@ -0,0 +1,9 @@
namespace LINGYUN.Abp.PushPlus.SettingManagement
{
public class PushPlusSettingPermissionNames
{
public const string GroupName = "Abp.PushPlus";
public const string ManageSetting = GroupName + ".ManageSetting";
}
}

1
aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application.Contracts/LINGYUN/Abp/SettingManagement/AbpSettingManagementRemoteServiceConsts.cs

@ -2,6 +2,7 @@
{
public class AbpSettingManagementRemoteServiceConsts
{
public const string ModuleName = "setting-management";
public const string RemoteServiceName = "AbpSettingManagement";
}
}

3
aspnet-core/modules/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/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/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/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>

29
aspnet-core/modules/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN.Abp.WxPusher.SettingManagement.csproj

@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\configureawait.props" />
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<None Remove="LINGYUN\Abp\WxPusher\SettingManagement\Localization\Resources\*.json" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="LINGYUN\Abp\WxPusher\SettingManagement\Localization\Resources\*.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="$(VoloAbpPackageVersion)" />
<PackageReference Include="Volo.Abp.SettingManagement.Domain" Version="$(VoloAbpPackageVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\settings\LINGYUN.Abp.SettingManagement.Application.Contracts\LINGYUN.Abp.SettingManagement.Application.Contracts.csproj" />
<ProjectReference Include="..\LINGYUN.Abp.WxPusher\LINGYUN.Abp.WxPusher.csproj" />
</ItemGroup>
</Project>

48
aspnet-core/modules/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/AbpWxPusherSettingManagementModule.cs

@ -0,0 +1,48 @@
using LINGYUN.Abp.WxPusher.Localization;
using Localization.Resources.AbpUi;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.VirtualFileSystem;
namespace LINGYUN.Abp.WxPusher.SettingManagement
{
[DependsOn(
typeof(AbpWxPusherModule),
typeof(AbpAspNetCoreMvcModule))]
public class AbpWxPusherSettingManagementModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
PreConfigure<IMvcBuilder>(mvcBuilder =>
{
mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpWxPusherSettingManagementModule).Assembly);
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpWxPusherSettingManagementModule>();
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<WxPusherResource>()
.AddVirtualJson("/LINGYUN/Abp/WxPusher/SettingManagement/Localization/Resources");
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<WxPusherResource>()
.AddBaseTypes(
typeof(AbpUiResource)
);
});
}
}
}

8
aspnet-core/modules/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/IWxPusherSettingAppService.cs

@ -0,0 +1,8 @@
using LINGYUN.Abp.SettingManagement;
namespace LINGYUN.Abp.WxPusher.SettingManagement
{
public interface IWxPusherSettingAppService : IReadonlySettingAppService
{
}
}

7
aspnet-core/modules/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/Localization/Resources/en.json

@ -0,0 +1,7 @@
{
"culture": "en",
"texts": {
"Permission:WxPusher": "WxPusher",
"Permission:ManageSetting": "Manage Setting"
}
}

7
aspnet-core/modules/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/Localization/Resources/zh-Hans.json

@ -0,0 +1,7 @@
{
"culture": "zh-Hans",
"texts": {
"Permission:WxPusher": "WxPusher",
"Permission:ManageSetting": "管理设置"
}
}

61
aspnet-core/modules/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/WxPusherSettingAppService.cs

@ -0,0 +1,61 @@
using LINGYUN.Abp.SettingManagement;
using LINGYUN.Abp.WxPusher.Localization;
using LINGYUN.Abp.WxPusher.Settings;
using System.Threading.Tasks;
using Volo.Abp.Application.Services;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.MultiTenancy;
using Volo.Abp.SettingManagement;
using Volo.Abp.Settings;
namespace LINGYUN.Abp.WxPusher.SettingManagement
{
public class WxPusherSettingAppService : ApplicationService, IWxPusherSettingAppService
{
protected ISettingManager SettingManager { get; }
protected IPermissionChecker PermissionChecker { get; }
protected ISettingDefinitionManager SettingDefinitionManager { get; }
public WxPusherSettingAppService(
ISettingManager settingManager,
IPermissionChecker permissionChecker,
ISettingDefinitionManager settingDefinitionManager)
{
SettingManager = settingManager;
PermissionChecker = permissionChecker;
SettingDefinitionManager = settingDefinitionManager;
LocalizationResource = typeof(WxPusherResource);
}
public async virtual Task<SettingGroupResult> GetAllForCurrentTenantAsync()
{
return await GetAllForProviderAsync(TenantSettingValueProvider.ProviderName, CurrentTenant.GetId().ToString());
}
public async virtual Task<SettingGroupResult> GetAllForGlobalAsync()
{
return await GetAllForProviderAsync(GlobalSettingValueProvider.ProviderName, null);
}
protected async virtual Task<SettingGroupResult> GetAllForProviderAsync(string providerName, string providerKey)
{
var settingGroups = new SettingGroupResult();
var wxPusherSettingGroup = new SettingGroupDto(L["DisplayName:WxPusher"], L["Description:WxPusher"]);
if (await PermissionChecker.IsGrantedAsync(WxPusherSettingPermissionNames.ManageSetting))
{
var securitySetting = wxPusherSettingGroup.AddSetting(L["Security"], L["Security"]);
securitySetting.AddDetail(
SettingDefinitionManager.Get(WxPusherSettingNames.Security.AppToken),
StringLocalizerFactory,
await SettingManager.GetOrNullAsync(WxPusherSettingNames.Security.AppToken, providerName, providerKey),
ValueType.String,
providerName);
}
settingGroups.AddGroup(wxPusherSettingGroup);
return settingGroups;
}
}
}

36
aspnet-core/modules/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/WxPusherSettingController.cs

@ -0,0 +1,36 @@
using LINGYUN.Abp.SettingManagement;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc;
namespace LINGYUN.Abp.WxPusher.SettingManagement
{
[RemoteService(Name = AbpSettingManagementRemoteServiceConsts.RemoteServiceName)]
[Area(AbpSettingManagementRemoteServiceConsts.ModuleName)]
[Route($"api/{AbpSettingManagementRemoteServiceConsts.ModuleName}/wx-pusher")]
public class WxPusherSettingController : AbpController, IWxPusherSettingAppService
{
protected IWxPusherSettingAppService Service { get; }
public WxPusherSettingController(
IWxPusherSettingAppService service)
{
Service = service;
}
[HttpGet]
[Route("by-current-tenant")]
public async virtual Task<SettingGroupResult> GetAllForCurrentTenantAsync()
{
return await Service.GetAllForCurrentTenantAsync();
}
[HttpGet]
[Route("by-global")]
public async virtual Task<SettingGroupResult> GetAllForGlobalAsync()
{
return await Service.GetAllForGlobalAsync();
}
}
}

24
aspnet-core/modules/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/WxPusherSettingPermissionDefinitionProvider.cs

@ -0,0 +1,24 @@
using LINGYUN.Abp.WxPusher.Localization;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Localization;
namespace LINGYUN.Abp.WxPusher.SettingManagement
{
public class WxPusherSettingPermissionDefinitionProvider : PermissionDefinitionProvider
{
public override void Define(IPermissionDefinitionContext context)
{
var wxPusherGroup = context.AddGroup(
WxPusherSettingPermissionNames.GroupName,
L("Permission:WxPusher"));
wxPusherGroup.AddPermission(
WxPusherSettingPermissionNames.ManageSetting, L("Permission:ManageSetting"));
}
private static LocalizableString L(string name)
{
return LocalizableString.Create<WxPusherResource>(name);
}
}
}

9
aspnet-core/modules/wx-pusher/LINGYUN.Abp.WxPusher.SettingManagement/LINGYUN/Abp/WxPusher/SettingManagement/WxPusherSettingPermissionNames.cs

@ -0,0 +1,9 @@
namespace LINGYUN.Abp.WxPusher.SettingManagement
{
public class WxPusherSettingPermissionNames
{
public const string GroupName = "Abp.WxPusher";
public const string ManageSetting = GroupName + ".ManageSetting";
}
}

6
aspnet-core/modules/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN.Abp.WxPusher.csproj

@ -9,13 +9,11 @@
</PropertyGroup>
<ItemGroup>
<None Remove="LINGYUN\Abp\WxPusher\Localization\Resources\en.json" />
<None Remove="LINGYUN\Abp\WxPusher\Localization\Resources\zh-Hans.json" />
<None Remove="LINGYUN\Abp\WxPusher\Localization\Resources\*.json" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="LINGYUN\Abp\WxPusher\Localization\Resources\en.json" />
<EmbeddedResource Include="LINGYUN\Abp\WxPusher\Localization\Resources\zh-Hans.json" />
<EmbeddedResource Include="LINGYUN\Abp\WxPusher\Localization\Resources\*.json" />
</ItemGroup>
<ItemGroup>

5
aspnet-core/modules/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/Localization/Resources/en.json

@ -1,6 +1,8 @@
{
"culture": "en",
"texts": {
"DisplayName:WxPusher": "WxPusher",
"Description:WxPusher": "WxPusher",
"Settings:Security.AppToken": "App Token",
"Settings:Security.AppTokenDesc": "If you have APP_TOKEN, you can send messages to users of the corresponding application. Keep it confidential.",
"Features:WxPusher": "WxPusher Wechat push service",
@ -12,6 +14,7 @@
"Features:Message.SendLimit": "Amount of wechat message push",
"Features:Message.SendLimitDesc": "Set to limit the amount of wechat message push.",
"Features:Message.SendLimitInterval": "Wechat message limit interval",
"Features:Message.SendLimitIntervalDesc": "Set the wechat message limit period (time scale: days). A single wechat user (UID) can receive a maximum of 500 messages per day. Please arrange the sending frequency reasonably."
"Features:Message.SendLimitIntervalDesc": "Set the wechat message limit period (time scale: days). A single wechat user (UID) can receive a maximum of 500 messages per day. Please arrange the sending frequency reasonably.",
"Security": "Security"
}
}

5
aspnet-core/modules/wx-pusher/LINGYUN.Abp.WxPusher/LINGYUN/Abp/WxPusher/Localization/Resources/zh-Hans.json

@ -1,6 +1,8 @@
{
"culture": "zh-Hans",
"texts": {
"DisplayName:WxPusher": "WxPusher",
"Description:WxPusher": "WxPusher",
"Settings:Security.AppToken": "应用的身份标志",
"Settings:Security.AppTokenDesc": "拥有APP_TOKEN,就可以给对应的应用的用户发送消息, 请严格保密.",
"Features:WxPusher": "WxPusher微信推送服务",
@ -12,6 +14,7 @@
"Features:Message.SendLimit": "微信消息推送量",
"Features:Message.SendLimitDesc": "设置以限制微信消息推送量.",
"Features:Message.SendLimitInterval": "微信消息限制周期",
"Features:Message.SendLimitIntervalDesc": "设置微信消息限制周期(时间刻度: 天).单个微信用户(uid),每天最多接收500条消息,请合理安排发送频率."
"Features:Message.SendLimitIntervalDesc": "设置微信消息限制周期(时间刻度: 天).单个微信用户(uid),每天最多接收500条消息,请合理安排发送频率.",
"Security": "安全选项"
}
}
Loading…
Cancel
Save