6 changed files with 121 additions and 114 deletions
@ -1,29 +1,29 @@ |
|||
using Volo.Abp.Application; |
|||
using Volo.Abp.Localization; |
|||
using Volo.Abp.Modularity; |
|||
using Volo.Abp.SettingManagement; |
|||
using Volo.Abp.SettingManagement.Localization; |
|||
using Volo.Abp.VirtualFileSystem; |
|||
|
|||
namespace LINGYUN.Abp.SettingManagement |
|||
{ |
|||
[DependsOn(typeof(AbpDddApplicationModule))] |
|||
[DependsOn(typeof(AbpSettingManagementDomainSharedModule))] |
|||
public class AbpSettingManagementApplicationContractsModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
Configure<AbpVirtualFileSystemOptions>(options => |
|||
{ |
|||
options.FileSets.AddEmbedded<AbpSettingManagementApplicationContractsModule>(); |
|||
}); |
|||
|
|||
Configure<AbpLocalizationOptions>(options => |
|||
{ |
|||
options.Resources |
|||
.Get<AbpSettingManagementResource>() |
|||
.AddVirtualJson("/LINGYUN/Abp/SettingManagement/Localization/ApplicationContracts"); |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
using Volo.Abp.Application; |
|||
using Volo.Abp.Localization; |
|||
using Volo.Abp.Modularity; |
|||
using Volo.Abp.SettingManagement; |
|||
using Volo.Abp.SettingManagement.Localization; |
|||
using Volo.Abp.VirtualFileSystem; |
|||
|
|||
namespace LINGYUN.Abp.SettingManagement |
|||
{ |
|||
[DependsOn(typeof(AbpDddApplicationContractsModule))] |
|||
[DependsOn(typeof(AbpSettingManagementDomainSharedModule))] |
|||
public class AbpSettingManagementApplicationContractsModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
Configure<AbpVirtualFileSystemOptions>(options => |
|||
{ |
|||
options.FileSets.AddEmbedded<AbpSettingManagementApplicationContractsModule>(); |
|||
}); |
|||
|
|||
Configure<AbpLocalizationOptions>(options => |
|||
{ |
|||
options.Resources |
|||
.Get<AbpSettingManagementResource>() |
|||
.AddVirtualJson("/LINGYUN/Abp/SettingManagement/Localization/ApplicationContracts"); |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,25 +1,22 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
using Volo.Abp.Authorization.Permissions; |
|||
using Volo.Abp.Localization; |
|||
using Volo.Abp.SettingManagement.Localization; |
|||
|
|||
namespace LINGYUN.Abp.SettingManagement |
|||
{ |
|||
public class AbpSettingManagementPermissionProvider : PermissionDefinitionProvider |
|||
{ |
|||
public override void Define(IPermissionDefinitionContext context) |
|||
{ |
|||
var settingPermissionGroup = context.AddGroup(AbpSettingManagementPermissions.GroupName, L("Permission:SettingManagement")); |
|||
|
|||
var settingPermissions = settingPermissionGroup.AddPermission(AbpSettingManagementPermissions.Settings.Default, L("Permission:Settings")); |
|||
settingPermissions.AddChild(AbpSettingManagementPermissions.Settings.Manager, L("Permission:Manager")); |
|||
} |
|||
|
|||
private static LocalizableString L(string name) |
|||
{ |
|||
return LocalizableString.Create<AbpSettingManagementResource>(name); |
|||
} |
|||
} |
|||
} |
|||
using Volo.Abp.Authorization.Permissions; |
|||
using Volo.Abp.Localization; |
|||
using Volo.Abp.SettingManagement.Localization; |
|||
|
|||
namespace LINGYUN.Abp.SettingManagement |
|||
{ |
|||
public class AbpSettingManagementPermissionProvider : PermissionDefinitionProvider |
|||
{ |
|||
public override void Define(IPermissionDefinitionContext context) |
|||
{ |
|||
var settingPermissionGroup = context.AddGroup(AbpSettingManagementPermissions.GroupName, L("Permission:SettingManagement")); |
|||
|
|||
var settingPermissions = settingPermissionGroup.AddPermission(AbpSettingManagementPermissions.Settings.Default, L("Permission:Settings")); |
|||
settingPermissions.AddChild(AbpSettingManagementPermissions.Settings.Manager, L("Permission:Manager")); |
|||
} |
|||
|
|||
private static LocalizableString L(string name) |
|||
{ |
|||
return LocalizableString.Create<AbpSettingManagementResource>(name); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,42 +1,53 @@ |
|||
using System.Collections.Generic; |
|||
|
|||
namespace LINGYUN.Abp.SettingManagement |
|||
{ |
|||
public class SettingDetailsDto |
|||
{ |
|||
public string Name { get; set; } |
|||
|
|||
public string DisplayName { get; set; } |
|||
|
|||
public string Description { get; set; } |
|||
|
|||
public string Value { get; set; } |
|||
|
|||
public string DefaultValue { get; set; } |
|||
|
|||
public bool IsEncrypted { get; set; } |
|||
|
|||
public ValueType ValueType { get; set; } |
|||
/// <summary>
|
|||
/// 选项列表,仅当 ValueType 为 Option有效
|
|||
/// </summary>
|
|||
public List<OptionDto> Options { get; set; } = new List<OptionDto>(); |
|||
|
|||
public SettingDetailsDto AddOption(string name, string value) |
|||
{ |
|||
Options.Add(new OptionDto |
|||
{ |
|||
Name = name, |
|||
Value = value |
|||
}); |
|||
|
|||
return this; |
|||
} |
|||
|
|||
public SettingDetailsDto AddOptions(IEnumerable<OptionDto> options) |
|||
{ |
|||
Options.AddRange(options); |
|||
return this; |
|||
} |
|||
} |
|||
using System.Collections.Generic; |
|||
|
|||
namespace LINGYUN.Abp.SettingManagement |
|||
{ |
|||
public class SettingDetailsDto |
|||
{ |
|||
public string Name { get; set; } |
|||
|
|||
public string DisplayName { get; set; } |
|||
|
|||
public string Description { get; set; } |
|||
|
|||
public string Value { get; set; } |
|||
|
|||
public string DefaultValue { get; set; } |
|||
|
|||
public bool IsEncrypted { get; set; } |
|||
|
|||
public ValueType ValueType { get; set; } |
|||
/// <summary>
|
|||
/// 插槽,前端定义控件
|
|||
/// </summary>
|
|||
public string Slot { get; set; } |
|||
/// <summary>
|
|||
/// 选项列表,仅当 ValueType 为 Option有效
|
|||
/// </summary>
|
|||
public List<OptionDto> Options { get; set; } = new List<OptionDto>(); |
|||
|
|||
public SettingDetailsDto WithSlot(string slot) |
|||
{ |
|||
Slot = slot; |
|||
|
|||
return this; |
|||
} |
|||
|
|||
public SettingDetailsDto AddOption(string name, string value) |
|||
{ |
|||
Options.Add(new OptionDto |
|||
{ |
|||
Name = name, |
|||
Value = value |
|||
}); |
|||
|
|||
return this; |
|||
} |
|||
|
|||
public SettingDetailsDto AddOptions(IEnumerable<OptionDto> options) |
|||
{ |
|||
Options.AddRange(options); |
|||
return this; |
|||
} |
|||
} |
|||
} |
|||
@ -1,13 +1,15 @@ |
|||
using Volo.Abp.Modularity; |
|||
using Volo.Abp.SettingManagement; |
|||
|
|||
namespace LINGYUN.Abp.SettingManagement |
|||
{ |
|||
[DependsOn( |
|||
typeof(AbpSettingManagementDomainModule), |
|||
typeof(AbpSettingManagementApplicationContractsModule) |
|||
)] |
|||
public class AbpSettingManagementApplicationModule : AbpModule |
|||
{ |
|||
} |
|||
} |
|||
using Volo.Abp.Application; |
|||
using Volo.Abp.Modularity; |
|||
using Volo.Abp.SettingManagement; |
|||
|
|||
namespace LINGYUN.Abp.SettingManagement |
|||
{ |
|||
[DependsOn( |
|||
typeof(AbpSettingManagementDomainModule), |
|||
typeof(AbpSettingManagementApplicationContractsModule), |
|||
typeof(AbpDddApplicationModule) |
|||
)] |
|||
public class AbpSettingManagementApplicationModule : AbpModule |
|||
{ |
|||
} |
|||
} |
|||
|
|||
Loading…
Reference in new issue