爆肝,重构框架,你懂得
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.Model.RABC.SeedData
|
||||
{
|
||||
public abstract class AbstractSeed<T>
|
||||
{
|
||||
protected List<T> Entitys { get; set; } = new List<T>();
|
||||
public virtual List<T> GetSeed()
|
||||
{
|
||||
return Entitys;
|
||||
}
|
||||
}
|
||||
}
|
||||
130
Yi.Framework.Net6/Yi.Framework.Model/RABC/SeedData/DeptSeed.cs
Normal file
130
Yi.Framework.Net6/Yi.Framework.Model/RABC/SeedData/DeptSeed.cs
Normal file
@@ -0,0 +1,130 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Common.Enum;
|
||||
using Yi.Framework.Model.RABC.Entitys;
|
||||
|
||||
namespace Yi.Framework.Model.RABC.SeedData
|
||||
{
|
||||
public class DeptSeed : AbstractSeed<DeptEntity>
|
||||
{
|
||||
public override List<DeptEntity> GetSeed()
|
||||
{
|
||||
|
||||
DeptEntity chengziDept = new DeptEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DeptName = "橙子科技",
|
||||
DeptCode = "Yi",
|
||||
OrderNum = 100,
|
||||
IsDeleted = false,
|
||||
ParentId = 0,
|
||||
Leader = "橙子",
|
||||
Remark = "如名所指"
|
||||
};
|
||||
Entitys.Add(chengziDept);
|
||||
|
||||
|
||||
DeptEntity shenzhenDept = new DeptEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DeptName = "深圳总公司",
|
||||
OrderNum = 100,
|
||||
IsDeleted = false,
|
||||
ParentId = chengziDept.Id
|
||||
};
|
||||
Entitys.Add(shenzhenDept);
|
||||
|
||||
|
||||
DeptEntity jiangxiDept = new DeptEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DeptName = "江西总公司",
|
||||
OrderNum = 100,
|
||||
IsDeleted = false,
|
||||
ParentId = chengziDept.Id
|
||||
};
|
||||
Entitys.Add(jiangxiDept);
|
||||
|
||||
|
||||
|
||||
DeptEntity szDept1 = new DeptEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DeptName = "研发部门",
|
||||
OrderNum = 100,
|
||||
IsDeleted = false,
|
||||
ParentId = shenzhenDept.Id
|
||||
};
|
||||
Entitys.Add(szDept1);
|
||||
|
||||
DeptEntity szDept2 = new DeptEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DeptName = "市场部门",
|
||||
OrderNum = 100,
|
||||
IsDeleted = false,
|
||||
ParentId = shenzhenDept.Id
|
||||
};
|
||||
Entitys.Add(szDept2);
|
||||
|
||||
DeptEntity szDept3 = new DeptEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DeptName = "测试部门",
|
||||
OrderNum = 100,
|
||||
IsDeleted = false,
|
||||
ParentId = shenzhenDept.Id
|
||||
};
|
||||
Entitys.Add(szDept3);
|
||||
|
||||
DeptEntity szDept4 = new DeptEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DeptName = "财务部门",
|
||||
OrderNum = 100,
|
||||
IsDeleted = false,
|
||||
ParentId = shenzhenDept.Id
|
||||
};
|
||||
Entitys.Add(szDept4);
|
||||
|
||||
DeptEntity szDept5 = new DeptEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DeptName = "运维部门",
|
||||
OrderNum = 100,
|
||||
IsDeleted = false,
|
||||
ParentId = shenzhenDept.Id
|
||||
};
|
||||
Entitys.Add(szDept5);
|
||||
|
||||
|
||||
DeptEntity jxDept1 = new DeptEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DeptName = "市场部门",
|
||||
OrderNum = 100,
|
||||
IsDeleted = false,
|
||||
ParentId = jiangxiDept.Id
|
||||
};
|
||||
Entitys.Add(jxDept1);
|
||||
|
||||
|
||||
DeptEntity jxDept2 = new DeptEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DeptName = "财务部门",
|
||||
OrderNum = 100,
|
||||
IsDeleted = false,
|
||||
ParentId = jiangxiDept.Id
|
||||
};
|
||||
Entitys.Add(jxDept2);
|
||||
|
||||
|
||||
return Entitys;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,361 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Model.RABC.Entitys;
|
||||
|
||||
namespace Yi.Framework.Model.RABC.SeedData
|
||||
{
|
||||
public class DictionaryInfoSeed : AbstractSeed<DictionaryInfoEntity>
|
||||
{
|
||||
public override List<DictionaryInfoEntity> GetSeed()
|
||||
{
|
||||
DictionaryInfoEntity dictInfo1 = new DictionaryInfoEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictLabel = "男",
|
||||
DictValue = "0",
|
||||
DictType = "sys_user_sex",
|
||||
OrderNum = 100,
|
||||
Remark = "性别男",
|
||||
IsDeleted = false,
|
||||
};
|
||||
Entitys.Add(dictInfo1);
|
||||
|
||||
DictionaryInfoEntity dictInfo2 = new DictionaryInfoEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictLabel = "女",
|
||||
DictValue = "1",
|
||||
DictType = "sys_user_sex",
|
||||
OrderNum = 99,
|
||||
Remark = "性别女",
|
||||
IsDeleted = false,
|
||||
};
|
||||
Entitys.Add(dictInfo2);
|
||||
|
||||
DictionaryInfoEntity dictInfo3 = new DictionaryInfoEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictLabel = "未知",
|
||||
DictValue = "2",
|
||||
DictType = "sys_user_sex",
|
||||
OrderNum = 98,
|
||||
Remark = "性别未知",
|
||||
IsDeleted = false,
|
||||
};
|
||||
Entitys.Add(dictInfo3);
|
||||
|
||||
|
||||
|
||||
DictionaryInfoEntity dictInfo4 = new DictionaryInfoEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictLabel = "显示",
|
||||
DictValue = "0",
|
||||
DictType = "sys_show_hide",
|
||||
OrderNum = 100,
|
||||
Remark = "显示菜单",
|
||||
IsDeleted = false,
|
||||
};
|
||||
Entitys.Add(dictInfo4);
|
||||
|
||||
DictionaryInfoEntity dictInfo5 = new DictionaryInfoEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictLabel = "隐藏",
|
||||
DictValue = "1",
|
||||
DictType = "sys_show_hide",
|
||||
OrderNum = 99,
|
||||
Remark = "隐藏菜单",
|
||||
IsDeleted = false,
|
||||
};
|
||||
Entitys.Add(dictInfo5);
|
||||
|
||||
|
||||
|
||||
DictionaryInfoEntity dictInfo6 = new DictionaryInfoEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictLabel = "正常",
|
||||
DictValue = "false",
|
||||
DictType = "sys_normal_disable",
|
||||
OrderNum = 100,
|
||||
Remark = "正常状态",
|
||||
IsDeleted = false,
|
||||
};
|
||||
Entitys.Add(dictInfo6);
|
||||
DictionaryInfoEntity dictInfo7 = new DictionaryInfoEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictLabel = "停用",
|
||||
DictValue = "true",
|
||||
DictType = "sys_normal_disable",
|
||||
OrderNum = 99,
|
||||
Remark = "停用状态",
|
||||
IsDeleted = false,
|
||||
ListClass = "danger"
|
||||
};
|
||||
Entitys.Add(dictInfo7);
|
||||
|
||||
|
||||
|
||||
DictionaryInfoEntity dictInfo8 = new DictionaryInfoEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictLabel = "正常",
|
||||
DictValue = "0",
|
||||
DictType = "sys_job_status",
|
||||
OrderNum = 100,
|
||||
Remark = "正常状态",
|
||||
IsDeleted = false,
|
||||
};
|
||||
Entitys.Add(dictInfo8);
|
||||
DictionaryInfoEntity dictInfo9 = new DictionaryInfoEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictLabel = "暂停",
|
||||
DictValue = "1",
|
||||
DictType = "sys_job_status",
|
||||
OrderNum = 99,
|
||||
Remark = "停用状态",
|
||||
IsDeleted = false,
|
||||
ListClass = "danger"
|
||||
};
|
||||
Entitys.Add(dictInfo9);
|
||||
|
||||
|
||||
|
||||
|
||||
DictionaryInfoEntity dictInfo10 = new DictionaryInfoEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictLabel = "默认",
|
||||
DictValue = "DEFAULT",
|
||||
DictType = "sys_job_group",
|
||||
OrderNum = 100,
|
||||
Remark = "默认分组",
|
||||
IsDeleted = false,
|
||||
};
|
||||
Entitys.Add(dictInfo10);
|
||||
DictionaryInfoEntity dictInfo11 = new DictionaryInfoEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictLabel = "系统",
|
||||
DictValue = "SYSTEM",
|
||||
DictType = "sys_job_group",
|
||||
OrderNum = 99,
|
||||
Remark = "系统分组",
|
||||
IsDeleted = false,
|
||||
};
|
||||
Entitys.Add(dictInfo11);
|
||||
|
||||
|
||||
|
||||
DictionaryInfoEntity dictInfo12 = new DictionaryInfoEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictLabel = "是",
|
||||
DictValue = "Y",
|
||||
DictType = "sys_yes_no",
|
||||
OrderNum = 100,
|
||||
Remark = "系统默认是",
|
||||
IsDeleted = false,
|
||||
};
|
||||
Entitys.Add(dictInfo12);
|
||||
DictionaryInfoEntity dictInfo13 = new DictionaryInfoEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictLabel = "否",
|
||||
DictValue = "N",
|
||||
DictType = "sys_yes_no",
|
||||
OrderNum = 99,
|
||||
Remark = "系统默认否",
|
||||
IsDeleted = false,
|
||||
ListClass = "danger"
|
||||
};
|
||||
Entitys.Add(dictInfo13);
|
||||
|
||||
|
||||
|
||||
DictionaryInfoEntity dictInfo14 = new DictionaryInfoEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictLabel = "通知",
|
||||
DictValue = "1",
|
||||
DictType = "sys_notice_type",
|
||||
OrderNum = 100,
|
||||
Remark = "通知",
|
||||
IsDeleted = false,
|
||||
};
|
||||
Entitys.Add(dictInfo14);
|
||||
DictionaryInfoEntity dictInfo15 = new DictionaryInfoEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictLabel = "公告",
|
||||
DictValue = "2",
|
||||
DictType = "sys_notice_type",
|
||||
OrderNum = 99,
|
||||
Remark = "公告",
|
||||
IsDeleted = false,
|
||||
};
|
||||
Entitys.Add(dictInfo15);
|
||||
|
||||
DictionaryInfoEntity dictInfo16 = new DictionaryInfoEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictLabel = "正常",
|
||||
DictValue = "0",
|
||||
DictType = "sys_notice_status",
|
||||
OrderNum = 100,
|
||||
Remark = "正常状态",
|
||||
IsDeleted = false,
|
||||
};
|
||||
Entitys.Add(dictInfo16);
|
||||
DictionaryInfoEntity dictInfo17 = new DictionaryInfoEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictLabel = "关闭",
|
||||
DictValue = "1",
|
||||
DictType = "sys_notice_status",
|
||||
OrderNum = 99,
|
||||
Remark = "关闭状态",
|
||||
IsDeleted = false,
|
||||
ListClass = "danger"
|
||||
};
|
||||
Entitys.Add(dictInfo17);
|
||||
|
||||
DictionaryInfoEntity dictInfo18 = new DictionaryInfoEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictLabel = "新增",
|
||||
DictValue = "1",
|
||||
DictType = "sys_oper_type",
|
||||
OrderNum = 100,
|
||||
Remark = "新增操作",
|
||||
IsDeleted = false,
|
||||
};
|
||||
Entitys.Add(dictInfo18);
|
||||
DictionaryInfoEntity dictInfo19 = new DictionaryInfoEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictLabel = "修改",
|
||||
DictValue = "2",
|
||||
DictType = "sys_oper_type",
|
||||
OrderNum = 99,
|
||||
Remark = "修改操作",
|
||||
IsDeleted = false,
|
||||
};
|
||||
Entitys.Add(dictInfo19);
|
||||
DictionaryInfoEntity dictInfo22 = new DictionaryInfoEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictLabel = "删除",
|
||||
DictValue = "3",
|
||||
DictType = "sys_oper_type",
|
||||
OrderNum = 98,
|
||||
Remark = "删除操作",
|
||||
IsDeleted = false,
|
||||
ListClass = "danger"
|
||||
};
|
||||
Entitys.Add(dictInfo22);
|
||||
DictionaryInfoEntity dictInfo23 = new DictionaryInfoEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictLabel = "授权",
|
||||
DictValue = "4",
|
||||
DictType = "sys_oper_type",
|
||||
OrderNum = 97,
|
||||
Remark = "授权操作",
|
||||
IsDeleted = false,
|
||||
};
|
||||
Entitys.Add(dictInfo23);
|
||||
DictionaryInfoEntity dictInfo24 = new DictionaryInfoEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictLabel = "导出",
|
||||
DictValue = "5",
|
||||
DictType = "sys_oper_type",
|
||||
OrderNum = 96,
|
||||
Remark = "导出操作",
|
||||
IsDeleted = false,
|
||||
};
|
||||
Entitys.Add(dictInfo24);
|
||||
DictionaryInfoEntity dictInfo25 = new DictionaryInfoEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictLabel = "导入",
|
||||
DictValue = "6",
|
||||
DictType = "sys_oper_type",
|
||||
OrderNum = 95,
|
||||
Remark = "导入操作",
|
||||
IsDeleted = false,
|
||||
};
|
||||
Entitys.Add(dictInfo25);
|
||||
DictionaryInfoEntity dictInfo26 = new DictionaryInfoEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictLabel = "强退",
|
||||
DictValue = "7",
|
||||
DictType = "sys_oper_type",
|
||||
OrderNum = 94,
|
||||
Remark = "强退操作",
|
||||
IsDeleted = false,
|
||||
};
|
||||
Entitys.Add(dictInfo26);
|
||||
DictionaryInfoEntity dictInfo27 = new DictionaryInfoEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictLabel = "生成代码",
|
||||
DictValue = "8",
|
||||
DictType = "sys_oper_type",
|
||||
OrderNum = 93,
|
||||
Remark = "生成代码操作",
|
||||
IsDeleted = false,
|
||||
};
|
||||
Entitys.Add(dictInfo27);
|
||||
DictionaryInfoEntity dictInfo28 = new DictionaryInfoEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictLabel = "清空数据",
|
||||
DictValue = "9",
|
||||
DictType = "sys_oper_type",
|
||||
OrderNum = 92,
|
||||
Remark = "清空数据操作",
|
||||
IsDeleted = false,
|
||||
ListClass = "danger"
|
||||
};
|
||||
Entitys.Add(dictInfo28);
|
||||
|
||||
|
||||
|
||||
DictionaryInfoEntity dictInfo20 = new DictionaryInfoEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictLabel = "成功",
|
||||
DictValue = "false",
|
||||
DictType = "sys_common_status",
|
||||
OrderNum = 100,
|
||||
Remark = "正常状态",
|
||||
IsDeleted = false,
|
||||
};
|
||||
Entitys.Add(dictInfo20);
|
||||
DictionaryInfoEntity dictInfo21 = new DictionaryInfoEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictLabel = "失败",
|
||||
DictValue = "true",
|
||||
DictType = "sys_common_status",
|
||||
OrderNum = 99,
|
||||
Remark = "失败状态",
|
||||
IsDeleted = false,
|
||||
ListClass = "danger"
|
||||
};
|
||||
Entitys.Add(dictInfo21);
|
||||
|
||||
return Entitys;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Model.RABC.Entitys;
|
||||
|
||||
namespace Yi.Framework.Model.RABC.SeedData
|
||||
{
|
||||
public class DictionarySeed : AbstractSeed<DictionaryEntity>
|
||||
{
|
||||
public override List<DictionaryEntity> GetSeed()
|
||||
{
|
||||
DictionaryEntity dict1 = new DictionaryEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictName = "用户性别",
|
||||
DictType = "sys_user_sex",
|
||||
OrderNum = 100,
|
||||
Remark = "用户性别列表",
|
||||
IsDeleted = false,
|
||||
};
|
||||
Entitys.Add(dict1);
|
||||
|
||||
DictionaryEntity dict2 = new DictionaryEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictName = "菜单状态",
|
||||
DictType = "sys_show_hide",
|
||||
OrderNum = 100,
|
||||
Remark = "菜单状态列表",
|
||||
IsDeleted = false,
|
||||
};
|
||||
Entitys.Add(dict2);
|
||||
|
||||
DictionaryEntity dict3 = new DictionaryEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictName = "系统开关",
|
||||
DictType = "sys_normal_disable",
|
||||
OrderNum = 100,
|
||||
Remark = "系统开关列表",
|
||||
IsDeleted = false,
|
||||
};
|
||||
Entitys.Add(dict3);
|
||||
|
||||
DictionaryEntity dict4 = new DictionaryEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictName = "任务状态",
|
||||
DictType = "sys_job_status",
|
||||
OrderNum = 100,
|
||||
Remark = "任务状态列表",
|
||||
IsDeleted = false,
|
||||
};
|
||||
Entitys.Add(dict4);
|
||||
|
||||
DictionaryEntity dict5 = new DictionaryEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictName = "任务分组",
|
||||
DictType = "sys_job_group",
|
||||
OrderNum = 100,
|
||||
Remark = "任务分组列表",
|
||||
IsDeleted = false,
|
||||
};
|
||||
Entitys.Add(dict5);
|
||||
|
||||
DictionaryEntity dict6 = new DictionaryEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictName = "系统是否",
|
||||
DictType = "sys_yes_no",
|
||||
OrderNum = 100,
|
||||
Remark = "系统是否列表",
|
||||
IsDeleted = false,
|
||||
};
|
||||
Entitys.Add(dict6);
|
||||
|
||||
DictionaryEntity dict7 = new DictionaryEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictName = "通知类型",
|
||||
DictType = "sys_notice_type",
|
||||
OrderNum = 100,
|
||||
Remark = "通知类型列表",
|
||||
IsDeleted = false,
|
||||
};
|
||||
Entitys.Add(dict7);
|
||||
DictionaryEntity dict8 = new DictionaryEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictName = "通知状态",
|
||||
DictType = "sys_notice_status",
|
||||
OrderNum = 100,
|
||||
Remark = "通知状态列表",
|
||||
IsDeleted = false,
|
||||
};
|
||||
Entitys.Add(dict8);
|
||||
|
||||
DictionaryEntity dict9 = new DictionaryEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictName = "操作类型",
|
||||
DictType = "sys_oper_type",
|
||||
OrderNum = 100,
|
||||
Remark = "操作类型列表",
|
||||
IsDeleted = false,
|
||||
};
|
||||
Entitys.Add(dict9);
|
||||
|
||||
|
||||
DictionaryEntity dict10 = new DictionaryEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
DictName = "系统状态",
|
||||
DictType = "sys_common_status",
|
||||
OrderNum = 100,
|
||||
Remark = "登录状态列表",
|
||||
IsDeleted = false,
|
||||
};
|
||||
Entitys.Add(dict10);
|
||||
return Entitys;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Model.RABC.Entitys;
|
||||
|
||||
namespace Yi.Framework.Model.RABC.SeedData
|
||||
{
|
||||
public class FileSeed : AbstractSeed<FileEntity>
|
||||
{
|
||||
public override List<FileEntity> GetSeed()
|
||||
{
|
||||
FileEntity file1 = new FileEntity()
|
||||
{
|
||||
Id = 0,
|
||||
FilePath = "Image",
|
||||
FileType = "",
|
||||
IsDeleted = false,
|
||||
FileName = "0.jpg"
|
||||
};
|
||||
Entitys.Add(file1);
|
||||
return Entitys;
|
||||
}
|
||||
}
|
||||
}
|
||||
787
Yi.Framework.Net6/Yi.Framework.Model/RABC/SeedData/MenuSeed.cs
Normal file
787
Yi.Framework.Net6/Yi.Framework.Model/RABC/SeedData/MenuSeed.cs
Normal file
@@ -0,0 +1,787 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Common.Enum;
|
||||
using Yi.Framework.Model.RABC.Entitys;
|
||||
|
||||
namespace Yi.Framework.Model.RABC.SeedData
|
||||
{
|
||||
public class MenuSeed : AbstractSeed<MenuEntity>
|
||||
{
|
||||
public override List<MenuEntity> GetSeed()
|
||||
{
|
||||
//系统管理
|
||||
MenuEntity system = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "系统管理",
|
||||
MenuType = MenuTypeEnum.Catalogue.GetHashCode(),
|
||||
Router = "/system",
|
||||
IsShow = true,
|
||||
IsLink = false,
|
||||
MenuIcon = "system",
|
||||
OrderNum = 100,
|
||||
ParentId = 0,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(system);
|
||||
|
||||
//系统监控
|
||||
MenuEntity monitoring = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "系统监控",
|
||||
MenuType = MenuTypeEnum.Catalogue.GetHashCode(),
|
||||
Router = "/monitor",
|
||||
IsShow = true,
|
||||
IsLink = false,
|
||||
MenuIcon = "monitor",
|
||||
OrderNum = 99,
|
||||
ParentId = 0,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(monitoring);
|
||||
|
||||
|
||||
//在线用户
|
||||
MenuEntity online = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "在线用户",
|
||||
PermissionCode = "monitor:online:list",
|
||||
MenuType = MenuTypeEnum.Menu.GetHashCode(),
|
||||
Router = "online",
|
||||
IsShow = true,
|
||||
IsLink = false,
|
||||
IsCache = true,
|
||||
Component = "monitor/online/index",
|
||||
MenuIcon = "online",
|
||||
OrderNum = 100,
|
||||
ParentId = monitoring.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(online);
|
||||
|
||||
|
||||
|
||||
|
||||
//系统工具
|
||||
MenuEntity tool = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "系统工具",
|
||||
MenuType = MenuTypeEnum.Catalogue.GetHashCode(),
|
||||
Router = "/tool",
|
||||
IsShow = true,
|
||||
IsLink = false,
|
||||
MenuIcon = "tool",
|
||||
OrderNum = 98,
|
||||
ParentId = 0,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(tool);
|
||||
//swagger文档
|
||||
MenuEntity swagger = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "接口文档",
|
||||
MenuType = MenuTypeEnum.Menu.GetHashCode(),
|
||||
Router = "http://localhost:19001",
|
||||
IsShow = true,
|
||||
IsLink = true,
|
||||
MenuIcon = "list",
|
||||
OrderNum = 100,
|
||||
ParentId = tool.Id,
|
||||
IsDeleted = false,
|
||||
};
|
||||
Entitys.Add(swagger);
|
||||
|
||||
|
||||
//业务功能
|
||||
MenuEntity business = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "业务功能",
|
||||
MenuType = MenuTypeEnum.Catalogue.GetHashCode(),
|
||||
Router = "/business",
|
||||
IsShow = true,
|
||||
IsLink = false,
|
||||
MenuIcon = "international",
|
||||
OrderNum = 97,
|
||||
ParentId = 0,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(business);
|
||||
//文章管理
|
||||
MenuEntity article = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "文章管理",
|
||||
PermissionCode = "business:article:list",
|
||||
MenuType = MenuTypeEnum.Menu.GetHashCode(),
|
||||
Router = "article",
|
||||
IsShow = true,
|
||||
IsLink = false,
|
||||
IsCache = true,
|
||||
Component = "business/article/index",
|
||||
MenuIcon = "education",
|
||||
OrderNum = 100,
|
||||
ParentId = business.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(article);
|
||||
|
||||
MenuEntity articleQuery = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "文章查询",
|
||||
PermissionCode = "business:article:query",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = article.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(articleQuery);
|
||||
|
||||
MenuEntity articleAdd = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "文章新增",
|
||||
PermissionCode = "business:article:add",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = article.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(articleAdd);
|
||||
|
||||
MenuEntity articleEdit = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "文章修改",
|
||||
PermissionCode = "business:article:edit",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = article.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(articleEdit);
|
||||
|
||||
MenuEntity articleRemove = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "文章删除",
|
||||
PermissionCode = "business:article:remove",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = article.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(articleRemove);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//Yi框架
|
||||
MenuEntity guide = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "Yi框架",
|
||||
MenuType = MenuTypeEnum.Catalogue.GetHashCode(),
|
||||
Router = "https://gitee.com/ccnetcore/yi",
|
||||
IsShow = true,
|
||||
IsLink = true,
|
||||
MenuIcon = "guide",
|
||||
OrderNum = 90,
|
||||
ParentId = 0,
|
||||
IsDeleted = false,
|
||||
};
|
||||
Entitys.Add(guide);
|
||||
|
||||
//用户管理
|
||||
MenuEntity user = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "用户管理",
|
||||
PermissionCode = "system:user:list",
|
||||
MenuType = MenuTypeEnum.Menu.GetHashCode(),
|
||||
Router = "user",
|
||||
IsShow = true,
|
||||
IsLink = false,
|
||||
IsCache = true,
|
||||
Component = "system/user/index",
|
||||
MenuIcon = "user",
|
||||
OrderNum = 100,
|
||||
ParentId = system.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(user);
|
||||
|
||||
MenuEntity userQuery = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "用户查询",
|
||||
PermissionCode = "system:user:query",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = user.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(userQuery);
|
||||
|
||||
MenuEntity userAdd = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "用户新增",
|
||||
PermissionCode = "system:user:add",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = user.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(userAdd);
|
||||
|
||||
MenuEntity userEdit = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "用户修改",
|
||||
PermissionCode = "system:user:edit",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = user.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(userEdit);
|
||||
|
||||
MenuEntity userRemove = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "用户删除",
|
||||
PermissionCode = "system:user:remove",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = user.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(userRemove);
|
||||
|
||||
|
||||
//角色管理
|
||||
MenuEntity role = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "角色管理",
|
||||
PermissionCode = "system:role:list",
|
||||
MenuType = MenuTypeEnum.Menu.GetHashCode(),
|
||||
Router = "role",
|
||||
IsShow = true,
|
||||
IsLink = false,
|
||||
IsCache = true,
|
||||
Component = "system/role/index",
|
||||
MenuIcon = "peoples",
|
||||
OrderNum = 100,
|
||||
ParentId = system.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(role);
|
||||
|
||||
MenuEntity roleQuery = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "角色查询",
|
||||
PermissionCode = "system:role:query",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = role.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(roleQuery);
|
||||
|
||||
MenuEntity roleAdd = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "角色新增",
|
||||
PermissionCode = "system:role:add",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = role.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(roleAdd);
|
||||
|
||||
MenuEntity roleEdit = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "角色修改",
|
||||
PermissionCode = "system:role:edit",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = role.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(roleEdit);
|
||||
|
||||
MenuEntity roleRemove = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "角色删除",
|
||||
PermissionCode = "system:role:remove",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = role.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(roleRemove);
|
||||
|
||||
|
||||
//菜单管理
|
||||
MenuEntity menu = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "菜单管理",
|
||||
PermissionCode = "system:menu:list",
|
||||
MenuType = MenuTypeEnum.Menu.GetHashCode(),
|
||||
Router = "menu",
|
||||
IsShow = true,
|
||||
IsLink = false,
|
||||
IsCache = true,
|
||||
Component = "system/menu/index",
|
||||
MenuIcon = "tree-table",
|
||||
OrderNum = 100,
|
||||
ParentId = system.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(menu);
|
||||
|
||||
MenuEntity menuQuery = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "菜单查询",
|
||||
PermissionCode = "system:menu:query",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = menu.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(menuQuery);
|
||||
|
||||
MenuEntity menuAdd = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "菜单新增",
|
||||
PermissionCode = "system:menu:add",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = menu.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(menuAdd);
|
||||
|
||||
MenuEntity menuEdit = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "菜单修改",
|
||||
PermissionCode = "system:menu:edit",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = menu.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(menuEdit);
|
||||
|
||||
MenuEntity menuRemove = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "菜单删除",
|
||||
PermissionCode = "system:menu:remove",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = menu.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(menuRemove);
|
||||
|
||||
//部门管理
|
||||
MenuEntity dept = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "部门管理",
|
||||
PermissionCode = "system:dept:list",
|
||||
MenuType = MenuTypeEnum.Menu.GetHashCode(),
|
||||
Router = "dept",
|
||||
IsShow = true,
|
||||
IsLink = false,
|
||||
IsCache = true,
|
||||
Component = "system/dept/index",
|
||||
MenuIcon = "tree",
|
||||
OrderNum = 100,
|
||||
ParentId = system.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(dept);
|
||||
|
||||
MenuEntity deptQuery = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "部门查询",
|
||||
PermissionCode = "system:dept:query",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = dept.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(deptQuery);
|
||||
|
||||
MenuEntity deptAdd = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "部门新增",
|
||||
PermissionCode = "system:dept:add",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = dept.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(deptAdd);
|
||||
|
||||
MenuEntity deptEdit = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "部门修改",
|
||||
PermissionCode = "system:dept:edit",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = dept.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(deptEdit);
|
||||
|
||||
MenuEntity deptRemove = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "部门删除",
|
||||
PermissionCode = "system:dept:remove",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = dept.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(deptRemove);
|
||||
|
||||
|
||||
|
||||
//岗位管理
|
||||
MenuEntity post = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "岗位管理",
|
||||
PermissionCode = "system:post:list",
|
||||
MenuType = MenuTypeEnum.Menu.GetHashCode(),
|
||||
Router = "post",
|
||||
IsShow = true,
|
||||
IsLink = false,
|
||||
IsCache = true,
|
||||
Component = "system/post/index",
|
||||
MenuIcon = "post",
|
||||
OrderNum = 100,
|
||||
ParentId = system.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(post);
|
||||
|
||||
MenuEntity postQuery = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "岗位查询",
|
||||
PermissionCode = "system:post:query",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = post.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(postQuery);
|
||||
|
||||
MenuEntity postAdd = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "岗位新增",
|
||||
PermissionCode = "system:post:add",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = post.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(postAdd);
|
||||
|
||||
MenuEntity postEdit = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "岗位修改",
|
||||
PermissionCode = "system:post:edit",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = post.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(postEdit);
|
||||
|
||||
MenuEntity postRemove = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "岗位删除",
|
||||
PermissionCode = "system:post:remove",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = post.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(postRemove);
|
||||
|
||||
//字典管理
|
||||
MenuEntity dict = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "字典管理",
|
||||
PermissionCode = "system:dict:list",
|
||||
MenuType = MenuTypeEnum.Menu.GetHashCode(),
|
||||
Router = "dict",
|
||||
IsShow = true,
|
||||
IsLink = false,
|
||||
IsCache = true,
|
||||
Component = "system/dict/index",
|
||||
MenuIcon = "dict",
|
||||
OrderNum = 100,
|
||||
ParentId = system.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(dict);
|
||||
|
||||
MenuEntity dictQuery = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "字典查询",
|
||||
PermissionCode = "system:dict:query",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = dict.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(dictQuery);
|
||||
|
||||
MenuEntity dictAdd = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "字典新增",
|
||||
PermissionCode = "system:dict:add",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = dict.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(dictAdd);
|
||||
|
||||
MenuEntity dictEdit = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "字典修改",
|
||||
PermissionCode = "system:dict:edit",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = dict.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(dictEdit);
|
||||
|
||||
MenuEntity dictRemove = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "字典删除",
|
||||
PermissionCode = "system:dict:remove",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = dict.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(dictRemove);
|
||||
|
||||
|
||||
//参数设置
|
||||
MenuEntity config = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "参数设置",
|
||||
PermissionCode = "system:config:list",
|
||||
MenuType = MenuTypeEnum.Menu.GetHashCode(),
|
||||
Router = "config",
|
||||
IsShow = true,
|
||||
IsLink = false,
|
||||
IsCache = true,
|
||||
Component = "system/config/index",
|
||||
MenuIcon = "edit",
|
||||
OrderNum = 100,
|
||||
ParentId = system.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(config);
|
||||
|
||||
MenuEntity configQuery = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "参数查询",
|
||||
PermissionCode = "system:config:query",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = config.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(configQuery);
|
||||
|
||||
MenuEntity configAdd = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "参数新增",
|
||||
PermissionCode = "system:config:add",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = config.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(configAdd);
|
||||
|
||||
MenuEntity configEdit = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "参数修改",
|
||||
PermissionCode = "system:config:edit",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = config.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(configEdit);
|
||||
|
||||
MenuEntity configRemove = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "参数删除",
|
||||
PermissionCode = "system:config:remove",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = config.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(configRemove);
|
||||
|
||||
|
||||
|
||||
|
||||
//日志管理
|
||||
MenuEntity log = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "日志管理",
|
||||
MenuType = MenuTypeEnum.Catalogue.GetHashCode(),
|
||||
Router = "log",
|
||||
IsShow = true,
|
||||
IsLink = false,
|
||||
MenuIcon = "log",
|
||||
OrderNum = 100,
|
||||
ParentId = system.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(log);
|
||||
|
||||
//操作日志
|
||||
MenuEntity operationLog = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "操作日志",
|
||||
PermissionCode = "monitor:operlog:list",
|
||||
MenuType = MenuTypeEnum.Menu.GetHashCode(),
|
||||
Router = "operlog",
|
||||
IsShow = true,
|
||||
IsLink = false,
|
||||
IsCache = true,
|
||||
Component = "monitor/operlog/index",
|
||||
MenuIcon = "form",
|
||||
OrderNum = 100,
|
||||
ParentId = log.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(operationLog);
|
||||
|
||||
MenuEntity operationLogQuery = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "操作查询",
|
||||
PermissionCode = "monitor:operlog:query",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = operationLog.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(operationLogQuery);
|
||||
|
||||
MenuEntity operationLogRemove = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "操作删除",
|
||||
PermissionCode = "monitor:operlog:remove",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = operationLog.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(operationLogRemove);
|
||||
|
||||
|
||||
//登录日志
|
||||
MenuEntity loginLog = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "登录日志",
|
||||
PermissionCode = "monitor:logininfor:list",
|
||||
MenuType = MenuTypeEnum.Menu.GetHashCode(),
|
||||
Router = "logininfor",
|
||||
IsShow = true,
|
||||
IsLink = false,
|
||||
IsCache = true,
|
||||
Component = "monitor/logininfor/index",
|
||||
MenuIcon = "logininfor",
|
||||
OrderNum = 100,
|
||||
ParentId = log.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(loginLog);
|
||||
|
||||
MenuEntity loginLogQuery = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "登录查询",
|
||||
PermissionCode = "monitor:logininfor:query",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = loginLog.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(loginLogQuery);
|
||||
|
||||
MenuEntity loginLogRemove = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "登录删除",
|
||||
PermissionCode = "monitor:logininfor:remove",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = loginLog.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(loginLogRemove);
|
||||
return Entitys;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Common.Enum;
|
||||
using Yi.Framework.Model.RABC.Entitys;
|
||||
|
||||
namespace Yi.Framework.Model.RABC.SeedData
|
||||
{
|
||||
public class PostSeed : AbstractSeed<PostEntity>
|
||||
{
|
||||
public override List<PostEntity> GetSeed()
|
||||
{
|
||||
PostEntity Post1 = new PostEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
PostName = "董事长",
|
||||
PostCode = "ceo",
|
||||
OrderNum = 100,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(Post1);
|
||||
|
||||
PostEntity Post2 = new PostEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
PostName = "项目经理",
|
||||
PostCode = "se",
|
||||
OrderNum = 100,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(Post2);
|
||||
|
||||
PostEntity Post3 = new PostEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
PostName = "人力资源",
|
||||
PostCode = "hr",
|
||||
OrderNum = 100,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(Post3);
|
||||
|
||||
PostEntity Post4 = new PostEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
PostName = "普通员工",
|
||||
PostCode = "user",
|
||||
OrderNum = 100,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(Post4);
|
||||
return Entitys;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Common.Enum;
|
||||
using Yi.Framework.Model.RABC.Entitys;
|
||||
|
||||
namespace Yi.Framework.Model.RABC.SeedData
|
||||
{
|
||||
public class RoleSeed : AbstractSeed<RoleEntity>
|
||||
{
|
||||
public override List<RoleEntity> GetSeed()
|
||||
{
|
||||
RoleEntity role1 = new RoleEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
RoleName = "管理员",
|
||||
RoleCode = "admin",
|
||||
DataScope = DataScopeEnum.ALL.GetHashCode(),
|
||||
OrderNum = 999,
|
||||
Remark = "管理员",
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(role1);
|
||||
|
||||
RoleEntity role2 = new RoleEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
RoleName = "测试角色",
|
||||
RoleCode = "test",
|
||||
DataScope = DataScopeEnum.ALL.GetHashCode(),
|
||||
OrderNum = 1,
|
||||
Remark = "测试用的角色",
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(role2);
|
||||
|
||||
return Entitys;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Model.RABC.Entitys;
|
||||
|
||||
namespace Yi.Framework.Model.RABC.SeedData
|
||||
{
|
||||
public class SeedFactory
|
||||
{
|
||||
public static List<UserEntity> GetUserSeed()
|
||||
{
|
||||
return new UserSeed().GetSeed();
|
||||
}
|
||||
public static List<RoleEntity> GetRoleSeed()
|
||||
{
|
||||
return new RoleSeed().GetSeed();
|
||||
}
|
||||
public static List<MenuEntity> GetMenuSeed()
|
||||
{
|
||||
return new MenuSeed().GetSeed();
|
||||
}
|
||||
public static List<DictionaryEntity> GetDictionarySeed()
|
||||
{
|
||||
return new DictionarySeed().GetSeed();
|
||||
}
|
||||
public static List<PostEntity> GetPostSeed()
|
||||
{
|
||||
return new PostSeed().GetSeed();
|
||||
}
|
||||
|
||||
public static List<DictionaryInfoEntity> GetDictionaryInfoSeed()
|
||||
{
|
||||
return new DictionaryInfoSeed().GetSeed();
|
||||
}
|
||||
|
||||
public static List<DeptEntity> GetDeptSeed()
|
||||
{
|
||||
return new DeptSeed().GetSeed();
|
||||
}
|
||||
|
||||
public static List<FileEntity> GetFileSeed()
|
||||
{
|
||||
return new FileSeed().GetSeed();
|
||||
}
|
||||
public static List<UserRoleEntity> GetUserRoleSeed(List<UserEntity> users, List<RoleEntity> roles)
|
||||
{
|
||||
List<UserRoleEntity> userRoleEntities = new();
|
||||
foreach (var u in users)
|
||||
{
|
||||
foreach (var r in roles)
|
||||
{
|
||||
userRoleEntities.Add(new UserRoleEntity() { Id = SnowFlakeSingle.Instance.NextId(), UserId = u.Id, RoleId = r.Id, IsDeleted = false });
|
||||
}
|
||||
}
|
||||
return userRoleEntities;
|
||||
}
|
||||
|
||||
public static List<RoleMenuEntity> GetRoleMenuSeed(List<RoleEntity> roles, List<MenuEntity> menus)
|
||||
{
|
||||
List<RoleMenuEntity> roleMenuEntities = new();
|
||||
foreach (var r in roles)
|
||||
{
|
||||
foreach (var m in menus)
|
||||
{
|
||||
roleMenuEntities.Add(new RoleMenuEntity() { Id = SnowFlakeSingle.Instance.NextId(), RoleId = r.Id, MenuId = m.Id, IsDeleted = false });
|
||||
}
|
||||
}
|
||||
return roleMenuEntities;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Model.RABC.Entitys;
|
||||
|
||||
namespace Yi.Framework.Model.RABC.SeedData
|
||||
{
|
||||
public class UserSeed : AbstractSeed<UserEntity>
|
||||
{
|
||||
public override List<UserEntity> GetSeed()
|
||||
{
|
||||
UserEntity user1 = new UserEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
Name = "大橙子",
|
||||
UserName = "cc",
|
||||
Nick = "橙子",
|
||||
Password = "123456",
|
||||
Email = "454313500@qq.com",
|
||||
Phone = "13800000000",
|
||||
Sex = 0,
|
||||
Address = "深圳",
|
||||
Age = 20,
|
||||
Introduction = "还有谁?",
|
||||
OrderNum = 999,
|
||||
Remark = "描述是什么呢?",
|
||||
IsDeleted = false
|
||||
};
|
||||
user1.BuildPassword();
|
||||
Entitys.Add(user1);
|
||||
|
||||
UserEntity user2 = new UserEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
Name = "大测试",
|
||||
UserName = "test",
|
||||
Nick = "测试",
|
||||
Password = "123456",
|
||||
Email = "454313500@qq.com",
|
||||
Phone = "15900000000",
|
||||
Sex = 0,
|
||||
Address = "深圳",
|
||||
Age = 18,
|
||||
Introduction = "还有我!",
|
||||
OrderNum = 1,
|
||||
Remark = "我没有描述!",
|
||||
IsDeleted = false
|
||||
};
|
||||
user2.BuildPassword();
|
||||
Entitys.Add(user2);
|
||||
|
||||
return Entitys;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user