feat: 添加配置管理模块
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Volo.Abp.MultiTenancy;
|
||||
using Volo.Abp.Text.Formatting;
|
||||
|
||||
namespace Yi.Framework.SettingManagement.Domain;
|
||||
|
||||
[Serializable]
|
||||
[IgnoreMultiTenancy]
|
||||
public class SettingCacheItem
|
||||
{
|
||||
private const string CacheKeyFormat = "pn:{0},pk:{1},n:{2}";
|
||||
|
||||
public string Value { get; set; }
|
||||
|
||||
public SettingCacheItem()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public SettingCacheItem(string value)
|
||||
{
|
||||
Value = value;
|
||||
}
|
||||
|
||||
public static string CalculateCacheKey(string name, string providerName, string providerKey)
|
||||
{
|
||||
return string.Format(CacheKeyFormat, providerName, providerKey, name);
|
||||
}
|
||||
|
||||
public static string GetSettingNameFormCacheKeyOrNull(string cacheKey)
|
||||
{
|
||||
var result = FormattedStringValueExtracter.Extract(cacheKey, CacheKeyFormat, true);
|
||||
return result.IsMatch ? result.Matches.Last().Value : null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user