mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-03-04 00:35:47 +08:00
提交.Net6版本
This commit is contained in:
31
Yi.Framework.Net5/Yi.Framework.WebCore/Init/RedisInit.cs
Normal file
31
Yi.Framework.Net5/Yi.Framework.WebCore/Init/RedisInit.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Common.Const;
|
||||
using Yi.Framework.Core;
|
||||
using Yi.Framework.DTOModel;
|
||||
|
||||
namespace Yi.Framework.WebCore.Init
|
||||
{
|
||||
public class RedisInit
|
||||
{
|
||||
public static void Seed(CacheClientDB _cacheClientDB)
|
||||
{
|
||||
var setDto = Common.Helper.JsonHelper.ObjToStr(new SettingDto()
|
||||
{
|
||||
ImageList =new List<string> { "默认图片", "默认图片" },
|
||||
InitRole = "普通用户",
|
||||
Title = "YiFramework",
|
||||
InitIcon = "默认头像"
|
||||
});
|
||||
if (_cacheClientDB.Get<SettingDto>(RedisConst.key)==null)
|
||||
{
|
||||
_cacheClientDB.Add(RedisConst.key,setDto) ;
|
||||
}
|
||||
|
||||
Console.WriteLine(nameof(RedisInit) + ":Redis初始成功!");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user