添加字典初始化
This commit is contained in:
@@ -46,6 +46,7 @@ namespace Yi.Framework.Model.Models
|
||||
r.Redirect = "noRedirect";
|
||||
r.AlwaysShow = true;
|
||||
r.Component = m.Component;
|
||||
r.AlwaysShow = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace Yi.Framework.Model.Models
|
||||
{
|
||||
public MenuEntity()
|
||||
{
|
||||
this.IsCache = false;
|
||||
this.CreateTime = DateTime.Now;
|
||||
}
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
|
||||
@@ -12,6 +12,115 @@ namespace Yi.Framework.Model.SeedData
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ namespace Yi.Framework.Model.SeedData
|
||||
PermissionCode = "system:role:query",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = user.Id,
|
||||
ParentId = role.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(roleQuery);
|
||||
@@ -136,7 +136,7 @@ namespace Yi.Framework.Model.SeedData
|
||||
PermissionCode = "system:role:add",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = user.Id,
|
||||
ParentId = role.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(roleAdd);
|
||||
@@ -148,7 +148,7 @@ namespace Yi.Framework.Model.SeedData
|
||||
PermissionCode = "system:role:edit",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = user.Id,
|
||||
ParentId = role.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(roleEdit);
|
||||
@@ -160,7 +160,7 @@ namespace Yi.Framework.Model.SeedData
|
||||
PermissionCode = "system:role:remove",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = user.Id,
|
||||
ParentId = role.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(roleRemove);
|
||||
@@ -370,71 +370,71 @@ namespace Yi.Framework.Model.SeedData
|
||||
Entitys.Add(postRemove);
|
||||
|
||||
//字典管理
|
||||
MenuEntity dic = new MenuEntity()
|
||||
MenuEntity dict = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "字典管理",
|
||||
PermissionCode = "system:dic:list",
|
||||
PermissionCode = "system:dict:list",
|
||||
MenuType = MenuTypeEnum.Menu.GetHashCode(),
|
||||
Router = "dic",
|
||||
Router = "dict",
|
||||
IsShow = true,
|
||||
IsLink = false,
|
||||
IsCache = true,
|
||||
Component = "system/dic/index",
|
||||
Component = "system/dict/index",
|
||||
MenuIcon = "dict",
|
||||
OrderNum = 100,
|
||||
ParentId = system.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(dic);
|
||||
Entitys.Add(dict);
|
||||
|
||||
MenuEntity dicQuery = new MenuEntity()
|
||||
MenuEntity dictQuery = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "字典查询",
|
||||
PermissionCode = "system:dic:query",
|
||||
PermissionCode = "system:dict:query",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = dic.Id,
|
||||
ParentId = dict.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(dicQuery);
|
||||
Entitys.Add(dictQuery);
|
||||
|
||||
MenuEntity dicAdd = new MenuEntity()
|
||||
MenuEntity dictAdd = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "字典新增",
|
||||
PermissionCode = "system:dic:add",
|
||||
PermissionCode = "system:dict:add",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = dic.Id,
|
||||
ParentId = dict.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(dicAdd);
|
||||
Entitys.Add(dictAdd);
|
||||
|
||||
MenuEntity dicEdit = new MenuEntity()
|
||||
MenuEntity dictEdit = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "字典修改",
|
||||
PermissionCode = "system:dic:edit",
|
||||
PermissionCode = "system:dict:edit",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = dic.Id,
|
||||
ParentId = dict.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(dicEdit);
|
||||
Entitys.Add(dictEdit);
|
||||
|
||||
MenuEntity dicRemove = new MenuEntity()
|
||||
MenuEntity dictRemove = new MenuEntity()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId(),
|
||||
MenuName = "字典删除",
|
||||
PermissionCode = "system:dic:remove",
|
||||
PermissionCode = "system:dict:remove",
|
||||
MenuType = MenuTypeEnum.Component.GetHashCode(),
|
||||
OrderNum = 100,
|
||||
ParentId = dic.Id,
|
||||
ParentId = dict.Id,
|
||||
IsDeleted = false
|
||||
};
|
||||
Entitys.Add(dicRemove);
|
||||
Entitys.Add(dictRemove);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -22,6 +22,10 @@ namespace Yi.Framework.Model.SeedData
|
||||
{
|
||||
return new MenuSeed().GetSeed();
|
||||
}
|
||||
public static List<DictionaryEntity> GetDictionarySeed()
|
||||
{
|
||||
return new DictionarySeed().GetSeed();
|
||||
}
|
||||
public static List<UserRoleEntity> GetUserRoleSeed(List<UserEntity> users, List<RoleEntity> roles)
|
||||
{
|
||||
List<UserRoleEntity> userRoleEntities = new();
|
||||
|
||||
Reference in New Issue
Block a user