2021-11-03 18:26:13 +08:00
|
|
|
|
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)
|
|
|
|
|
|
{
|
2021-11-03 21:14:58 +08:00
|
|
|
|
var setDto = Common.Helper.JsonHelper.ObjToStr(new SettingDto()
|
2021-11-03 20:46:49 +08:00
|
|
|
|
{
|
2021-11-06 17:10:44 +08:00
|
|
|
|
ImageList =new List<string> { "默认图片", "默认图片" },
|
|
|
|
|
|
InitRole = "普通用户",
|
|
|
|
|
|
Title = "YiFramework",
|
|
|
|
|
|
InitIcon = "默认头像"
|
2021-11-03 20:46:49 +08:00
|
|
|
|
});
|
2021-11-03 18:26:13 +08:00
|
|
|
|
if (_cacheClientDB.Get<SettingDto>(RedisConst.key)==null)
|
|
|
|
|
|
{
|
2021-11-03 20:46:49 +08:00
|
|
|
|
_cacheClientDB.Add(RedisConst.key,setDto) ;
|
2021-11-03 18:26:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Console.WriteLine(nameof(RedisInit) + ":Redis初始成功!");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|