18 changed files with 165 additions and 4 deletions
@ -0,0 +1,34 @@ |
|||||
|
using LINGYUN.Abp.SettingManagement; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp; |
||||
|
using Volo.Abp.AspNetCore.Mvc; |
||||
|
|
||||
|
namespace LINGYUN.Abp.Tencent.SettingManagement; |
||||
|
|
||||
|
[RemoteService(Name = AbpSettingManagementRemoteServiceConsts.RemoteServiceName)] |
||||
|
[Area("settingManagement")] |
||||
|
[Route("api/setting-management/tencent-cloud")] |
||||
|
public class TenantCloudSettingController : AbpControllerBase, ITenantCloudSettingAppService |
||||
|
{ |
||||
|
protected ITenantCloudSettingAppService Service { get; } |
||||
|
|
||||
|
public TenantCloudSettingController(ITenantCloudSettingAppService service) |
||||
|
{ |
||||
|
Service = service; |
||||
|
} |
||||
|
|
||||
|
[HttpGet] |
||||
|
[Route("by-current-tenant")] |
||||
|
public Task<SettingGroupResult> GetAllForCurrentTenantAsync() |
||||
|
{ |
||||
|
return Service.GetAllForCurrentTenantAsync(); |
||||
|
} |
||||
|
|
||||
|
[HttpGet] |
||||
|
[Route("by-global")] |
||||
|
public Task<SettingGroupResult> GetAllForGlobalAsync() |
||||
|
{ |
||||
|
return Service.GetAllForGlobalAsync(); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,50 @@ |
|||||
|
using LINGYUN.Abp.Tencent.Localization; |
||||
|
using Volo.Abp.Features; |
||||
|
using Volo.Abp.Localization; |
||||
|
using Volo.Abp.Validation.StringValues; |
||||
|
|
||||
|
namespace LINGYUN.Abp.Tencent.Features |
||||
|
{ |
||||
|
public class TencentCloudFeatureDefinitionProvider : FeatureDefinitionProvider |
||||
|
{ |
||||
|
public override void Define(IFeatureDefinitionContext context) |
||||
|
{ |
||||
|
var group = context.AddGroup(TencentCloudFeatures.GroupName, L("Features:TencentCloud")); |
||||
|
|
||||
|
var sms = group.AddFeature( |
||||
|
name: TencentCloudFeatures.Sms.GroupName, |
||||
|
displayName: L("Features:TencentSms"), |
||||
|
description: L("Features:TencentSms")); |
||||
|
|
||||
|
sms.CreateChild( |
||||
|
name: TencentCloudFeatures.Sms.Enable, |
||||
|
defaultValue: true.ToString(), |
||||
|
displayName: L("Features:TencentSmsEnable"), |
||||
|
description: L("Features:TencentSmsEnable.Desc"), |
||||
|
valueType: new ToggleStringValueType(new BooleanValueValidator())); |
||||
|
|
||||
|
var blobStoring = group.AddFeature( |
||||
|
name: TencentCloudFeatures.BlobStoring.GroupName, |
||||
|
displayName: L("Features:TencentBlobStoring"), |
||||
|
description: L("Features:TencentBlobStoring")); |
||||
|
|
||||
|
blobStoring.CreateChild( |
||||
|
name: TencentCloudFeatures.BlobStoring.Enable, |
||||
|
defaultValue: true.ToString(), |
||||
|
displayName: L("Features:TencentBlobStoringEnable"), |
||||
|
description: L("Features:TencentBlobStoringEnable.Desc"), |
||||
|
valueType: new ToggleStringValueType(new BooleanValueValidator())); |
||||
|
blobStoring.CreateChild( |
||||
|
name: TencentCloudFeatures.BlobStoring.MaximumStreamSize, |
||||
|
defaultValue: "0", |
||||
|
displayName: L("Features:TencentBlobStoringMaximumStreamSize"), |
||||
|
description: L("Features:TencentBlobStoringMaximumStreamSize.Desc"), |
||||
|
valueType: new FreeTextStringValueType(new NumericValueValidator(0))); |
||||
|
} |
||||
|
|
||||
|
protected LocalizableString L(string name) |
||||
|
{ |
||||
|
return LocalizableString.Create<TencentCloudResource>(name); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,30 @@ |
|||||
|
namespace LINGYUN.Abp.Tencent.Features |
||||
|
{ |
||||
|
public static class TencentCloudFeatures |
||||
|
{ |
||||
|
public const string GroupName = "Abp.TencentCloud"; |
||||
|
|
||||
|
public static class Sms |
||||
|
{ |
||||
|
public const string GroupName = TencentCloudFeatures.GroupName + ".Sms"; |
||||
|
/// <summary>
|
||||
|
/// 启用短信
|
||||
|
/// </summary>
|
||||
|
public const string Enable = GroupName + ".Enable"; |
||||
|
} |
||||
|
|
||||
|
public static class BlobStoring |
||||
|
{ |
||||
|
public const string GroupName = TencentCloudFeatures.GroupName + ".BlobStoring"; |
||||
|
/// <summary>
|
||||
|
/// 启用对象存储
|
||||
|
/// </summary>
|
||||
|
public const string Enable = GroupName + ".Enable"; |
||||
|
/// <summary>
|
||||
|
/// 最大流大小限制, 小于等于0无效, 单位(MB)
|
||||
|
/// 默认: 0
|
||||
|
/// </summary>
|
||||
|
public const string MaximumStreamSize = GroupName + ".MaximumStreamSize"; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1,6 +1,17 @@ |
|||||
{ |
{ |
||||
"culture": "en", |
"culture": "en", |
||||
"texts": { |
"texts": { |
||||
|
"Permission:TencentCloud": "Tencent Cloud", |
||||
|
"Permission:TencentCloud.Settings": "Settings", |
||||
|
"Features:TencentCloud": "Tencent Cloud", |
||||
|
"Features:TencentSms": "Sms", |
||||
|
"Features:TencentSmsEnable": "Enable", |
||||
|
"Features:TencentSmsEnable.Desc": "Enabled to support Tencent cloud SMS capabilities.", |
||||
|
"Features:TencentBlobStoring": "Blob Storing", |
||||
|
"Features:TencentBlobStoringEnable": "Enable", |
||||
|
"Features:TencentBlobStoringEnable.Desc": "Enable to support Tencent cloud object storage capability.", |
||||
|
"Features:TencentBlobStoringMaximumStreamSize": "Maximum Stream Size", |
||||
|
"Features:TencentBlobStoringMaximumStreamSize.Desc": "Size(MB) limit for a single uploaded file stream,0 or less.", |
||||
"DisplayName:TenantCloud": "Tenant Cloud", |
"DisplayName:TenantCloud": "Tenant Cloud", |
||||
"DisplayName:TenantCloud.BasicSetting": "Basic Setting", |
"DisplayName:TenantCloud.BasicSetting": "Basic Setting", |
||||
"Description:TenantCloud.BasicSetting": "Tencent cloud basic information configuration", |
"Description:TenantCloud.BasicSetting": "Tencent cloud basic information configuration", |
||||
@ -1,6 +1,17 @@ |
|||||
{ |
{ |
||||
"culture": "zh-Hans", |
"culture": "zh-Hans", |
||||
"texts": { |
"texts": { |
||||
|
"Permission:TencentCloud": "腾讯云服务", |
||||
|
"Permission:TencentCloud.Settings": "配置腾讯云", |
||||
|
"Features:TencentCloud": "腾讯云服务", |
||||
|
"Features:TencentSms": "腾讯云短信", |
||||
|
"Features:TencentSmsEnable": "启用云短信", |
||||
|
"Features:TencentSmsEnable.Desc": "启用以支持腾讯云短信能力.", |
||||
|
"Features:TencentBlobStoring": "腾讯云存储", |
||||
|
"Features:TencentBlobStoringEnable": "启用云存储", |
||||
|
"Features:TencentBlobStoringEnable.Desc": "启用以支持腾讯云对象存储能力.", |
||||
|
"Features:TencentBlobStoringMaximumStreamSize": "最大存储流大小", |
||||
|
"Features:TencentBlobStoringMaximumStreamSize.Desc": "单次上传文件流大小限制,0或低于0不限制,单位(MB).", |
||||
"DisplayName:TenantCloud": "腾讯云服务", |
"DisplayName:TenantCloud": "腾讯云服务", |
||||
"DisplayName:TenantCloud.BasicSetting": "基础配置", |
"DisplayName:TenantCloud.BasicSetting": "基础配置", |
||||
"Description:TenantCloud.BasicSetting": "腾讯云基础信息配置", |
"Description:TenantCloud.BasicSetting": "腾讯云基础信息配置", |
||||
@ -1,9 +1,8 @@ |
|||||
using LINGYUN.Abp.Tencent.Localization; |
using LINGYUN.Abp.Tencent.Localization; |
||||
using LINGYUN.Abp.Tencent.Settings; |
|
||||
using Volo.Abp.Localization; |
using Volo.Abp.Localization; |
||||
using Volo.Abp.Settings; |
using Volo.Abp.Settings; |
||||
|
|
||||
namespace LINYUN.Abp.Tencent.Settings; |
namespace LINGYUN.Abp.Tencent.Settings; |
||||
|
|
||||
public class TencentCloudSettingDefinitionProvider : SettingDefinitionProvider |
public class TencentCloudSettingDefinitionProvider : SettingDefinitionProvider |
||||
{ |
{ |
||||
Loading…
Reference in new issue