feat: 增加 GetThemes 接口定义

This commit is contained in:
Argo-Tianyi 2021-12-25 15:46:48 +08:00
parent 0cdcb0eec9
commit 1e95e722f9
4 changed files with 20 additions and 3 deletions

View File

@ -46,7 +46,7 @@ namespace Microsoft.Extensions.DependencyInjection
services.AddSingleton(typeof(IDataService<>), typeof(DefaultDataService<>));
services.AddSingleton<INavigation, NavigationsService>();
services.AddSingleton<IDict, DictsService>();
services.AddSingleton<IDict, DictService>();
return services;
}
}

View File

@ -3,13 +3,18 @@ using BootstrapBlazor.Components;
namespace BootstrapAdmin.DataAccess.EFCore.Services
{
class DictsService : IDict
class DictService : IDict
{
public Dictionary<string, string> GetApps()
{
throw new NotImplementedException();
}
public Dictionary<string, string> GetThemes()
{
throw new NotImplementedException();
}
public string GetWebFooter()
{
throw new NotImplementedException();

View File

@ -26,7 +26,13 @@ class DictService : BaseDatabase, IDict
public Dictionary<string, string> GetApps()
{
var dicts = GetAll();
return dicts.Where(d => d.Category == "应用程序").Select(d => new SelectedItem(d.Code, d.Name)).ToDictionary(i => i.Value, i => i.Text);
return dicts.Where(d => d.Category == "应用程序").Select(d => new KeyValuePair<string, string>(d.Code, d.Name)).ToDictionary(i => i.Key, i => i.Value);
}
public Dictionary<string, string> GetThemes()
{
var dicts = GetAll();
return dicts.Where(d => d.Category == "网站样式").Select(d => new KeyValuePair<string, string>(d.Code, d.Name)).ToDictionary(i => i.Key, i => i.Value);
}
/// <summary>

View File

@ -11,6 +11,12 @@
/// <returns></returns>
Dictionary<string, string> GetApps();
/// <summary>
/// 获得 配置所有的主题集合
/// </summary>
/// <returns></returns>
Dictionary<string, string> GetThemes();
/// <summary>
/// 获取当前系统配置是否为演示模式
/// </summary>