爆肝,重构框架,你懂得
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.Json.Serialization;
|
||||
using SqlSugar;
|
||||
using Yi.Framework.Model.Base;
|
||||
|
||||
namespace Yi.Framework.Model.RABC.Entitys
|
||||
{
|
||||
/// <summary>
|
||||
/// 配置表
|
||||
///</summary>
|
||||
[SugarTable("Config")]
|
||||
public partial class ConfigEntity : IBaseModelEntity
|
||||
{
|
||||
public ConfigEntity()
|
||||
{
|
||||
CreateTime = DateTime.Now;
|
||||
}
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
/// 配置名称
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ConfigName")]
|
||||
public string? ConfigName { get; set; }
|
||||
/// <summary>
|
||||
/// 配置键
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ConfigKey")]
|
||||
public string? ConfigKey { get; set; }
|
||||
/// <summary>
|
||||
/// 配置值
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ConfigValue")]
|
||||
public string? ConfigValue { get; set; }
|
||||
/// <summary>
|
||||
/// 配置类别
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ConfigType")]
|
||||
public string? ConfigType { get; set; }
|
||||
/// <summary>
|
||||
/// 创建者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateUser")]
|
||||
public long? CreateUser { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateTime")]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 修改者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyUser")]
|
||||
public long? ModifyUser { get; set; }
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyTime")]
|
||||
public DateTime? ModifyTime { get; set; }
|
||||
/// <summary>
|
||||
/// 是否删除
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "IsDeleted")]
|
||||
public bool? IsDeleted { get; set; }
|
||||
/// <summary>
|
||||
/// 租户Id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "TenantId")]
|
||||
public long? TenantId { get; set; }
|
||||
/// <summary>
|
||||
/// 排序字段
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "OrderNum")]
|
||||
public int? OrderNum { get; set; }
|
||||
/// <summary>
|
||||
/// 描述
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Remark")]
|
||||
public string? Remark { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.Json.Serialization;
|
||||
using SqlSugar;
|
||||
using Yi.Framework.Model.Base;
|
||||
|
||||
namespace Yi.Framework.Model.RABC.Entitys
|
||||
{
|
||||
/// <summary>
|
||||
/// 部门表
|
||||
///</summary>
|
||||
[SugarTable("Dept")]
|
||||
public partial class DeptEntity : IBaseModelEntity
|
||||
{
|
||||
public DeptEntity()
|
||||
{
|
||||
CreateTime = DateTime.Now;
|
||||
}
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
/// 部门名称
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "DeptName")]
|
||||
public string? DeptName { get; set; }
|
||||
/// <summary>
|
||||
/// 部门编码
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "DeptCode")]
|
||||
public string? DeptCode { get; set; }
|
||||
/// <summary>
|
||||
/// 负责人
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Leader")]
|
||||
public string? Leader { get; set; }
|
||||
/// <summary>
|
||||
/// 父级id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ParentId")]
|
||||
public long? ParentId { get; set; }
|
||||
/// <summary>
|
||||
/// 创建者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateUser")]
|
||||
public long? CreateUser { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateTime")]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 修改者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyUser")]
|
||||
public long? ModifyUser { get; set; }
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyTime")]
|
||||
public DateTime? ModifyTime { get; set; }
|
||||
/// <summary>
|
||||
/// 是否删除
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "IsDeleted")]
|
||||
public bool? IsDeleted { get; set; }
|
||||
/// <summary>
|
||||
/// 租户Id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "TenantId")]
|
||||
public long? TenantId { get; set; }
|
||||
/// <summary>
|
||||
/// 排序字段
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "OrderNum")]
|
||||
public int? OrderNum { get; set; }
|
||||
/// <summary>
|
||||
/// 描述
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Remark")]
|
||||
public string? Remark { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.Json.Serialization;
|
||||
using SqlSugar;
|
||||
using Yi.Framework.Model.Base;
|
||||
|
||||
namespace Yi.Framework.Model.RABC.Entitys
|
||||
{
|
||||
/// <summary>
|
||||
/// 字典表
|
||||
///</summary>
|
||||
[SugarTable("Dictionary")]
|
||||
public partial class DictionaryEntity : IBaseModelEntity
|
||||
{
|
||||
public DictionaryEntity()
|
||||
{
|
||||
CreateTime = DateTime.Now;
|
||||
}
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
/// 字典名称
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "DictName")]
|
||||
public string? DictName { get; set; }
|
||||
/// <summary>
|
||||
/// 字典类型
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "DictType")]
|
||||
public string? DictType { get; set; }
|
||||
/// <summary>
|
||||
/// 创建者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateUser")]
|
||||
public long? CreateUser { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateTime")]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 修改者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyUser")]
|
||||
public long? ModifyUser { get; set; }
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyTime")]
|
||||
public DateTime? ModifyTime { get; set; }
|
||||
/// <summary>
|
||||
/// 是否删除
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "IsDeleted")]
|
||||
public bool? IsDeleted { get; set; }
|
||||
/// <summary>
|
||||
/// 租户Id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "TenantId")]
|
||||
public long? TenantId { get; set; }
|
||||
/// <summary>
|
||||
/// 排序字段
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "OrderNum")]
|
||||
public int? OrderNum { get; set; }
|
||||
/// <summary>
|
||||
/// 描述
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Remark")]
|
||||
public string? Remark { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.Json.Serialization;
|
||||
using SqlSugar;
|
||||
using Yi.Framework.Model.Base;
|
||||
|
||||
namespace Yi.Framework.Model.RABC.Entitys
|
||||
{
|
||||
/// <summary>
|
||||
/// 字典信息表
|
||||
///</summary>
|
||||
[SugarTable("DictionaryInfo")]
|
||||
public partial class DictionaryInfoEntity : IBaseModelEntity
|
||||
{
|
||||
public DictionaryInfoEntity()
|
||||
{
|
||||
CreateTime = DateTime.Now;
|
||||
}
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
/// 字典类型
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "DictType")]
|
||||
public string? DictType { get; set; }
|
||||
/// <summary>
|
||||
/// 字典标签
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "DictLabel")]
|
||||
public string? DictLabel { get; set; }
|
||||
/// <summary>
|
||||
/// 字典值
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "DictValue")]
|
||||
public string? DictValue { get; set; }
|
||||
/// <summary>
|
||||
/// 是否为该类型的默认值
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "IsDefault")]
|
||||
public bool? IsDefault { get; set; }
|
||||
/// <summary>
|
||||
/// 创建者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateUser")]
|
||||
public long? CreateUser { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateTime")]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 修改者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyUser")]
|
||||
public long? ModifyUser { get; set; }
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyTime")]
|
||||
public DateTime? ModifyTime { get; set; }
|
||||
/// <summary>
|
||||
/// 是否删除
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "IsDeleted")]
|
||||
public bool? IsDeleted { get; set; }
|
||||
/// <summary>
|
||||
/// 租户Id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "TenantId")]
|
||||
public long? TenantId { get; set; }
|
||||
/// <summary>
|
||||
/// 排序字段
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "OrderNum")]
|
||||
public int? OrderNum { get; set; }
|
||||
/// <summary>
|
||||
/// 描述
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Remark")]
|
||||
public string? Remark { get; set; }
|
||||
/// <summary>
|
||||
/// tag类型
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ListClass")]
|
||||
public string? ListClass { get; set; }
|
||||
/// <summary>
|
||||
/// tagClass
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CssClass")]
|
||||
public string? CssClass { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.Json.Serialization;
|
||||
using SqlSugar;
|
||||
using Yi.Framework.Model.Base;
|
||||
|
||||
namespace Yi.Framework.Model.RABC.Entitys
|
||||
{
|
||||
/// <summary>
|
||||
/// 文件表
|
||||
///</summary>
|
||||
[SugarTable("File")]
|
||||
public partial class FileEntity : IBaseModelEntity
|
||||
{
|
||||
public FileEntity()
|
||||
{
|
||||
CreateTime = DateTime.Now;
|
||||
}
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
/// 文件类型
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "FileType")]
|
||||
public string? FileType { get; set; }
|
||||
/// <summary>
|
||||
/// 文件大小
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "FileSize")]
|
||||
public decimal? FileSize { get; set; }
|
||||
/// <summary>
|
||||
/// 文件名
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "FileName")]
|
||||
public string? FileName { get; set; }
|
||||
/// <summary>
|
||||
/// 文件路径
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "FilePath")]
|
||||
public string? FilePath { get; set; }
|
||||
/// <summary>
|
||||
/// 创建者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateUser")]
|
||||
public long? CreateUser { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateTime")]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 修改者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyUser")]
|
||||
public long? ModifyUser { get; set; }
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyTime")]
|
||||
public DateTime? ModifyTime { get; set; }
|
||||
/// <summary>
|
||||
/// 是否删除
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "IsDeleted")]
|
||||
public bool? IsDeleted { get; set; }
|
||||
/// <summary>
|
||||
/// 租户Id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "TenantId")]
|
||||
public long? TenantId { get; set; }
|
||||
/// <summary>
|
||||
/// 排序字段
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "OrderNum")]
|
||||
public int? OrderNum { get; set; }
|
||||
/// <summary>
|
||||
/// 描述
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Remark")]
|
||||
public string? Remark { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.Json.Serialization;
|
||||
using SqlSugar;
|
||||
using Yi.Framework.Model.Base;
|
||||
|
||||
namespace Yi.Framework.Model.RABC.Entitys
|
||||
{
|
||||
[SplitTable(SplitType.Year)]
|
||||
[SugarTable("SplitLog_{year}{month}{day}")]
|
||||
public partial class LogEntity : IBaseModelEntity
|
||||
{
|
||||
public LogEntity()
|
||||
{
|
||||
CreateTime = DateTime.Now;
|
||||
}
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
/// 创建者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateUser")]
|
||||
public long? CreateUser { get; set; }
|
||||
/// <summary>
|
||||
/// 修改者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyUser")]
|
||||
public long? ModifyUser { get; set; }
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyTime")]
|
||||
public DateTime? ModifyTime { get; set; }
|
||||
/// <summary>
|
||||
/// 是否删除
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "IsDeleted")]
|
||||
public bool? IsDeleted { get; set; }
|
||||
/// <summary>
|
||||
/// 租户Id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "TenantId")]
|
||||
public long? TenantId { get; set; }
|
||||
/// <summary>
|
||||
/// 消息
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Message")]
|
||||
public string? Message { get; set; }
|
||||
/// <summary>
|
||||
/// 排序字段
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "OrderNum")]
|
||||
public int? OrderNum { get; set; }
|
||||
/// <summary>
|
||||
/// 描述
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Remark")]
|
||||
public string? Remark { get; set; }
|
||||
|
||||
[SplitField] //分表字段 在插入的时候会根据这个字段插入哪个表,在更新删除的时候用这个字段找出相关表
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateTime")]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.Json.Serialization;
|
||||
using SqlSugar;
|
||||
using Yi.Framework.Model.Base;
|
||||
|
||||
namespace Yi.Framework.Model.RABC.Entitys
|
||||
{
|
||||
/// <summary>
|
||||
/// 登入日志
|
||||
///</summary>
|
||||
[SugarTable("LoginLog")]
|
||||
public partial class LoginLogEntity : IBaseModelEntity
|
||||
{
|
||||
public LoginLogEntity()
|
||||
{
|
||||
CreateTime = DateTime.Now;
|
||||
}
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
/// 登录用户
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "LoginUser")]
|
||||
public string? LoginUser { get; set; }
|
||||
/// <summary>
|
||||
/// 登录地点
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "LoginLocation")]
|
||||
public string? LoginLocation { get; set; }
|
||||
/// <summary>
|
||||
/// 登录Ip
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "LoginIp")]
|
||||
public string? LoginIp { get; set; }
|
||||
/// <summary>
|
||||
/// 浏览器
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Browser")]
|
||||
public string? Browser { get; set; }
|
||||
/// <summary>
|
||||
/// 操作系统
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Os")]
|
||||
public string? Os { get; set; }
|
||||
/// <summary>
|
||||
/// 登录信息
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "LogMsg")]
|
||||
public string? LogMsg { get; set; }
|
||||
/// <summary>
|
||||
/// 创建者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateUser")]
|
||||
public long? CreateUser { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateTime")]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 修改者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyUser")]
|
||||
public long? ModifyUser { get; set; }
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyTime")]
|
||||
public DateTime? ModifyTime { get; set; }
|
||||
/// <summary>
|
||||
/// 租户Id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "TenantId")]
|
||||
public long? TenantId { get; set; }
|
||||
/// <summary>
|
||||
/// 排序字段
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "OrderNum")]
|
||||
public int? OrderNum { get; set; }
|
||||
/// <summary>
|
||||
/// 描述
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Remark")]
|
||||
public string? Remark { get; set; }
|
||||
/// <summary>
|
||||
/// 是否删除
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "IsDeleted")]
|
||||
public bool? IsDeleted { get; set; }
|
||||
}
|
||||
}
|
||||
185
Yi.Framework.Net6/Yi.Framework.Model/RABC/Entitys/MenuEntity.cs
Normal file
185
Yi.Framework.Net6/Yi.Framework.Model/RABC/Entitys/MenuEntity.cs
Normal file
@@ -0,0 +1,185 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.Json.Serialization;
|
||||
using SqlSugar;
|
||||
using Yi.Framework.Common.Enum;
|
||||
using Yi.Framework.Common.Models;
|
||||
using Yi.Framework.Model.Base;
|
||||
|
||||
namespace Yi.Framework.Model.RABC.Entitys
|
||||
{
|
||||
/// <summary>
|
||||
/// 菜单表
|
||||
///</summary>
|
||||
[SugarTable("Menu")]
|
||||
public partial class MenuEntity : IBaseModelEntity
|
||||
{
|
||||
public MenuEntity()
|
||||
{
|
||||
IsCache = false;
|
||||
CreateTime = DateTime.Now;
|
||||
}
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "MenuName")]
|
||||
public string? MenuName { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "MenuType")]
|
||||
public int? MenuType { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "PermissionCode")]
|
||||
public string? PermissionCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ParentId")]
|
||||
public long? ParentId { get; set; }
|
||||
/// <summary>
|
||||
/// 创建者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateUser")]
|
||||
public long? CreateUser { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateTime")]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 修改者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyUser")]
|
||||
public long? ModifyUser { get; set; }
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyTime")]
|
||||
public DateTime? ModifyTime { get; set; }
|
||||
/// <summary>
|
||||
/// 是否删除
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "IsDeleted")]
|
||||
public bool? IsDeleted { get; set; }
|
||||
/// <summary>
|
||||
/// 租户Id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "TenantId")]
|
||||
public long? TenantId { get; set; }
|
||||
/// <summary>
|
||||
/// 菜单图标
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "MenuIcon")]
|
||||
public string? MenuIcon { get; set; }
|
||||
/// <summary>
|
||||
/// 菜单组件路由
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Router")]
|
||||
public string? Router { get; set; }
|
||||
/// <summary>
|
||||
/// 是否为外部链接
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "IsLink")]
|
||||
public bool? IsLink { get; set; }
|
||||
/// <summary>
|
||||
/// 是否缓存
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "IsCache")]
|
||||
public bool? IsCache { get; set; }
|
||||
/// <summary>
|
||||
/// 是否显示
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "IsShow")]
|
||||
public bool? IsShow { get; set; }
|
||||
/// <summary>
|
||||
/// 排序字段
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "OrderNum")]
|
||||
public int? OrderNum { get; set; }
|
||||
/// <summary>
|
||||
/// 描述
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Remark")]
|
||||
public string? Remark { get; set; }
|
||||
/// <summary>
|
||||
/// 组件路径
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Component")]
|
||||
public string? Component { get; set; }
|
||||
/// <summary>
|
||||
/// 路由参数
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Query")]
|
||||
public string? Query { get; set; }
|
||||
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public List<MenuEntity>? Children { get; set; }
|
||||
|
||||
|
||||
public static List<VueRouterModel> RouterBuild(List<MenuEntity> menus)
|
||||
{
|
||||
menus = menus.Where(m => m.MenuType != null && m.MenuType != MenuTypeEnum.Component.GetHashCode()).ToList();
|
||||
List<VueRouterModel> routers = new();
|
||||
foreach (var m in menus)
|
||||
{
|
||||
|
||||
var r = new VueRouterModel();
|
||||
r.OrderNum = m.OrderNum ?? 0;
|
||||
var routerName = m.Router?.Split("/").LastOrDefault();
|
||||
r.Id = m.Id;
|
||||
r.ParentId = m.ParentId ?? -1;
|
||||
|
||||
//开头大写
|
||||
r.Name = routerName?.First().ToString().ToUpper() + routerName?.Substring(1);
|
||||
r.Path = m.Router;
|
||||
r.Hidden = !m.IsShow ?? false;
|
||||
|
||||
|
||||
if (m.MenuType == MenuTypeEnum.Catalogue.GetHashCode())
|
||||
{
|
||||
r.Redirect = "noRedirect";
|
||||
r.AlwaysShow = true;
|
||||
|
||||
//判断是否为最顶层的路由
|
||||
if (0 == m.ParentId)
|
||||
{
|
||||
r.Component = "Layout";
|
||||
}
|
||||
else
|
||||
{
|
||||
r.Component = "ParentView";
|
||||
}
|
||||
}
|
||||
if (m.MenuType == MenuTypeEnum.Menu.GetHashCode())
|
||||
{
|
||||
|
||||
r.Redirect = "noRedirect";
|
||||
r.AlwaysShow = true;
|
||||
r.Component = m.Component;
|
||||
r.AlwaysShow = false;
|
||||
}
|
||||
r.Meta = new Meta
|
||||
{
|
||||
Title = m.MenuName,
|
||||
Icon = m.MenuIcon,
|
||||
NoCache = !m.IsCache ?? true
|
||||
};
|
||||
if (m.IsLink ?? false)
|
||||
{
|
||||
r.Meta.link = m.Router;
|
||||
r.AlwaysShow = false;
|
||||
}
|
||||
|
||||
routers.Add(r);
|
||||
}
|
||||
return Common.Helper.TreeHelper.SetTree(routers);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.Json.Serialization;
|
||||
using SqlSugar;
|
||||
using Yi.Framework.Model.Base;
|
||||
|
||||
namespace Yi.Framework.Model.RABC.Entitys
|
||||
{
|
||||
/// <summary>
|
||||
/// 操作日志表
|
||||
///</summary>
|
||||
[SugarTable("OperationLog")]
|
||||
public partial class OperationLogEntity : IBaseModelEntity
|
||||
{
|
||||
public OperationLogEntity()
|
||||
{
|
||||
CreateTime = DateTime.Now;
|
||||
}
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
/// 操作模块
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Title")]
|
||||
public string? Title { get; set; }
|
||||
/// <summary>
|
||||
/// 操作类型
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "OperType")]
|
||||
public int? OperType { get; set; }
|
||||
/// <summary>
|
||||
/// 请求方法
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "RequestMethod")]
|
||||
public string? RequestMethod { get; set; }
|
||||
/// <summary>
|
||||
/// 操作人员
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "OperUser")]
|
||||
public string? OperUser { get; set; }
|
||||
/// <summary>
|
||||
/// 操作Ip
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "OperIp")]
|
||||
public string? OperIp { get; set; }
|
||||
/// <summary>
|
||||
/// 操作地点
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "OperLocation")]
|
||||
public string? OperLocation { get; set; }
|
||||
/// <summary>
|
||||
/// 操作方法
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Method")]
|
||||
public string? Method { get; set; }
|
||||
/// <summary>
|
||||
/// 请求参数
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "RequestParam")]
|
||||
public string? RequestParam { get; set; }
|
||||
/// <summary>
|
||||
/// 请求结果
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "RequestResult")]
|
||||
public string? RequestResult { get; set; }
|
||||
/// <summary>
|
||||
/// 创建者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateUser")]
|
||||
public long? CreateUser { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateTime")]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 修改者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyUser")]
|
||||
public long? ModifyUser { get; set; }
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyTime")]
|
||||
public DateTime? ModifyTime { get; set; }
|
||||
/// <summary>
|
||||
/// 租户Id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "TenantId")]
|
||||
public long? TenantId { get; set; }
|
||||
/// <summary>
|
||||
/// 排序字段
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "OrderNum")]
|
||||
public int? OrderNum { get; set; }
|
||||
/// <summary>
|
||||
/// 描述
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Remark")]
|
||||
public string? Remark { get; set; }
|
||||
/// <summary>
|
||||
/// 是否删除
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "IsDeleted")]
|
||||
public bool? IsDeleted { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.Json.Serialization;
|
||||
using SqlSugar;
|
||||
using Yi.Framework.Model.Base;
|
||||
|
||||
namespace Yi.Framework.Model.RABC.Entitys
|
||||
{
|
||||
/// <summary>
|
||||
/// 岗位表
|
||||
///</summary>
|
||||
[SugarTable("Post")]
|
||||
public partial class PostEntity : IBaseModelEntity
|
||||
{
|
||||
public PostEntity()
|
||||
{
|
||||
CreateTime = DateTime.Now;
|
||||
}
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
/// 岗位编码
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "PostCode")]
|
||||
public string? PostCode { get; set; }
|
||||
/// <summary>
|
||||
/// 岗位名称
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "PostName")]
|
||||
public string? PostName { get; set; }
|
||||
/// <summary>
|
||||
/// 创建者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateUser")]
|
||||
public long? CreateUser { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateTime")]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 修改者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyUser")]
|
||||
public long? ModifyUser { get; set; }
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyTime")]
|
||||
public DateTime? ModifyTime { get; set; }
|
||||
/// <summary>
|
||||
/// 是否删除
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "IsDeleted")]
|
||||
public bool? IsDeleted { get; set; }
|
||||
/// <summary>
|
||||
/// 租户Id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "TenantId")]
|
||||
public long? TenantId { get; set; }
|
||||
/// <summary>
|
||||
/// 排序字段
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "OrderNum")]
|
||||
public int? OrderNum { get; set; }
|
||||
/// <summary>
|
||||
/// 描述
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Remark")]
|
||||
public string? Remark { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.Json.Serialization;
|
||||
using SqlSugar;
|
||||
using Yi.Framework.Model.Base;
|
||||
|
||||
namespace Yi.Framework.Model.RABC.Entitys
|
||||
{
|
||||
/// <summary>
|
||||
/// 角色部门关系表
|
||||
///</summary>
|
||||
[SugarTable("RoleDept")]
|
||||
public partial class RoleDeptEntity : IBaseModelEntity
|
||||
{
|
||||
public RoleDeptEntity()
|
||||
{
|
||||
CreateTime = DateTime.Now;
|
||||
}
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
/// 角色id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "RoleId")]
|
||||
public long? RoleId { get; set; }
|
||||
/// <summary>
|
||||
/// 部门id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "DeptId")]
|
||||
public long? DeptId { get; set; }
|
||||
/// <summary>
|
||||
/// 创建者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateUser")]
|
||||
public long? CreateUser { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateTime")]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 修改者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyUser")]
|
||||
public long? ModifyUser { get; set; }
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyTime")]
|
||||
public DateTime? ModifyTime { get; set; }
|
||||
/// <summary>
|
||||
/// 是否删除
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "IsDeleted")]
|
||||
public bool? IsDeleted { get; set; }
|
||||
/// <summary>
|
||||
/// 租户Id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "TenantId")]
|
||||
public long? TenantId { get; set; }
|
||||
/// <summary>
|
||||
/// 排序字段
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "OrderNum")]
|
||||
public int? OrderNum { get; set; }
|
||||
/// <summary>
|
||||
/// 描述
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Remark")]
|
||||
public string? Remark { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.Json.Serialization;
|
||||
using SqlSugar;
|
||||
using Yi.Framework.Model.Base;
|
||||
|
||||
namespace Yi.Framework.Model.RABC.Entitys
|
||||
{
|
||||
/// <summary>
|
||||
/// 角色表
|
||||
///</summary>
|
||||
[SugarTable("Role")]
|
||||
public partial class RoleEntity : IBaseModelEntity
|
||||
{
|
||||
public RoleEntity()
|
||||
{
|
||||
CreateTime = DateTime.Now;
|
||||
}
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "RoleName")]
|
||||
public string? RoleName { get; set; }
|
||||
/// <summary>
|
||||
/// 创建者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateUser")]
|
||||
public long? CreateUser { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateTime")]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyTime")]
|
||||
public DateTime? ModifyTime { get; set; }
|
||||
/// <summary>
|
||||
/// 是否删除
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "IsDeleted")]
|
||||
public bool? IsDeleted { get; set; }
|
||||
/// <summary>
|
||||
/// 租户Id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "TenantId")]
|
||||
public long? TenantId { get; set; }
|
||||
/// <summary>
|
||||
/// 修改者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyUser")]
|
||||
public long? ModifyUser { get; set; }
|
||||
/// <summary>
|
||||
/// 角色编码
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "RoleCode")]
|
||||
public string? RoleCode { get; set; }
|
||||
/// <summary>
|
||||
/// 排序字段
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "OrderNum")]
|
||||
public int? OrderNum { get; set; }
|
||||
/// <summary>
|
||||
/// 描述
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Remark")]
|
||||
public string? Remark { get; set; }
|
||||
/// <summary>
|
||||
/// 角色数据范围
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "DataScope")]
|
||||
public int? DataScope { get; set; }
|
||||
|
||||
|
||||
[Navigate(typeof(RoleMenuEntity), nameof(RoleMenuEntity.RoleId), nameof(RoleMenuEntity.MenuId))]
|
||||
public List<MenuEntity>? Menus { get; set; }
|
||||
|
||||
[Navigate(typeof(RoleDeptEntity), nameof(RoleDeptEntity.RoleId), nameof(RoleDeptEntity.DeptId))]
|
||||
public List<DeptEntity>? Depts { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.Json.Serialization;
|
||||
using SqlSugar;
|
||||
using Yi.Framework.Model.Base;
|
||||
|
||||
namespace Yi.Framework.Model.RABC.Entitys
|
||||
{
|
||||
/// <summary>
|
||||
/// 角色菜单关系表
|
||||
///</summary>
|
||||
[SugarTable("RoleMenu")]
|
||||
public partial class RoleMenuEntity : IBaseModelEntity
|
||||
{
|
||||
public RoleMenuEntity()
|
||||
{
|
||||
CreateTime = DateTime.Now;
|
||||
}
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "RoleId")]
|
||||
public long? RoleId { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "MenuId")]
|
||||
public long? MenuId { get; set; }
|
||||
/// <summary>
|
||||
/// 创建者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateUser")]
|
||||
public long? CreateUser { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateTime")]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 修改者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyUser")]
|
||||
public long? ModifyUser { get; set; }
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyTime")]
|
||||
public DateTime? ModifyTime { get; set; }
|
||||
/// <summary>
|
||||
/// 是否删除
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "IsDeleted")]
|
||||
public bool? IsDeleted { get; set; }
|
||||
/// <summary>
|
||||
/// 租户Id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "TenantId")]
|
||||
public long? TenantId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.Json.Serialization;
|
||||
using SqlSugar;
|
||||
using Yi.Framework.Model.Base;
|
||||
|
||||
namespace Yi.Framework.Model.RABC.Entitys
|
||||
{
|
||||
/// <summary>
|
||||
/// 租户表
|
||||
///</summary>
|
||||
[SugarTable("Tenant")]
|
||||
public partial class TenantEntity : IBaseModelEntity
|
||||
{
|
||||
public TenantEntity()
|
||||
{
|
||||
CreateTime = DateTime.Now;
|
||||
}
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "TenantName")]
|
||||
public string? TenantName { get; set; }
|
||||
/// <summary>
|
||||
/// 创建者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateUser")]
|
||||
public long? CreateUser { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateTime")]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 修改者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyUser")]
|
||||
public long? ModifyUser { get; set; }
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyTime")]
|
||||
public DateTime? ModifyTime { get; set; }
|
||||
/// <summary>
|
||||
/// 是否删除
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "IsDeleted")]
|
||||
public bool? IsDeleted { get; set; }
|
||||
/// <summary>
|
||||
/// 租户Id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "TenantId")]
|
||||
public long? TenantId { get; set; }
|
||||
/// <summary>
|
||||
/// 排序字段
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "OrderNum")]
|
||||
public int? OrderNum { get; set; }
|
||||
/// <summary>
|
||||
/// 描述
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Remark")]
|
||||
public string? Remark { get; set; }
|
||||
|
||||
// //需要在用户表中关联好该租户信息,一个用户关联一个租户
|
||||
// //不同租户下,用户可以相同
|
||||
// //用户登录后,token中可包含租户id,同时缓存一份用户信息(包含租户信息)
|
||||
// [Tenant("0")]
|
||||
// //当然,像用户、角色、菜单、租户为共享库了
|
||||
// [SugarTable("Tenant")]
|
||||
// public class TenantEntity
|
||||
// {
|
||||
// /// <summary>
|
||||
// /// 主键唯一标识
|
||||
// /// </summary>
|
||||
// [SugarColumn(IsPrimaryKey = true)]
|
||||
// public long Id { get; set; }
|
||||
|
||||
// /// <summary>
|
||||
// /// 租户id
|
||||
// /// </summary>
|
||||
// public string? TenantId { get; set; }
|
||||
|
||||
// /// <summary>
|
||||
// /// 业务库连接字符串
|
||||
// /// </summary>
|
||||
// public string? Connection { get; set; }
|
||||
|
||||
// /// <summary>
|
||||
// /// 业务库连接类型
|
||||
// /// </summary>
|
||||
// public string? DbType { get; set; }
|
||||
}
|
||||
}
|
||||
176
Yi.Framework.Net6/Yi.Framework.Model/RABC/Entitys/UserEntity.cs
Normal file
176
Yi.Framework.Net6/Yi.Framework.Model/RABC/Entitys/UserEntity.cs
Normal file
@@ -0,0 +1,176 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.Json.Serialization;
|
||||
using SqlSugar;
|
||||
using Yi.Framework.Common.Helper;
|
||||
using Yi.Framework.Model.Base;
|
||||
|
||||
namespace Yi.Framework.Model.RABC.Entitys
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户表
|
||||
///</summary>
|
||||
[SugarTable("User")]
|
||||
public partial class UserEntity : IBaseModelEntity
|
||||
{
|
||||
public UserEntity()
|
||||
{
|
||||
CreateTime = DateTime.Now;
|
||||
}
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Name")]
|
||||
public string? Name { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Age")]
|
||||
public int? Age { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateUser")]
|
||||
public long? CreateUser { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateTime")]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyUser")]
|
||||
public long? ModifyUser { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyTime")]
|
||||
public DateTime? ModifyTime { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "IsDeleted")]
|
||||
public bool? IsDeleted { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "TenantId")]
|
||||
public long? TenantId { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "UserName")]
|
||||
public string? UserName { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Password")]
|
||||
public string? Password { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Salt")]
|
||||
public string? Salt { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Icon")]
|
||||
public string? Icon { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Nick")]
|
||||
public string? Nick { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Email")]
|
||||
public string? Email { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Ip")]
|
||||
public string? Ip { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Address")]
|
||||
public string? Address { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Phone")]
|
||||
public string? Phone { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Introduction")]
|
||||
public string? Introduction { get; set; }
|
||||
/// <summary>
|
||||
/// 排序字段
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "OrderNum")]
|
||||
public int? OrderNum { get; set; }
|
||||
/// <summary>
|
||||
/// 描述
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Remark")]
|
||||
public string? Remark { get; set; }
|
||||
/// <summary>
|
||||
/// 部门id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "DeptId")]
|
||||
public long? DeptId { get; set; }
|
||||
/// <summary>
|
||||
/// 性别
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Sex")]
|
||||
public int? Sex { get; set; }
|
||||
/// <summary>
|
||||
/// 看好啦!ORM精髓,导航属性
|
||||
///</summary>
|
||||
[Navigate(typeof(UserRoleEntity), nameof(UserRoleEntity.UserId), nameof(UserRoleEntity.RoleId))]
|
||||
public List<RoleEntity>? Roles { get; set; }
|
||||
|
||||
[Navigate(typeof(UserPostEntity), nameof(UserPostEntity.UserId), nameof(UserPostEntity.PostId))]
|
||||
public List<PostEntity>? Posts { get; set; }
|
||||
|
||||
[Navigate(NavigateType.OneToOne, nameof(DeptId))]
|
||||
public DeptEntity? Dept { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 构建密码,MD5盐值加密
|
||||
/// </summary>
|
||||
public UserEntity BuildPassword(string password = null)
|
||||
{
|
||||
//如果不传值,那就把自己的password当作传进来的password
|
||||
if (password == null)
|
||||
{
|
||||
password = Password;
|
||||
}
|
||||
Salt = MD5Helper.GenerateSalt();
|
||||
Password = MD5Helper.SHA2Encode(password, Salt);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 判断密码和加密后的密码是否相同
|
||||
/// </summary>
|
||||
/// <param name="password"></param>
|
||||
/// <returns></returns>
|
||||
public bool JudgePassword(string password)
|
||||
{
|
||||
var p = MD5Helper.SHA2Encode(password, Salt);
|
||||
if (Password == MD5Helper.SHA2Encode(password, Salt))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.Json.Serialization;
|
||||
using SqlSugar;
|
||||
using Yi.Framework.Model.Base;
|
||||
|
||||
namespace Yi.Framework.Model.RABC.Entitys
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户岗位表
|
||||
///</summary>
|
||||
[SugarTable("UserPost")]
|
||||
public partial class UserPostEntity : IBaseModelEntity
|
||||
{
|
||||
public UserPostEntity()
|
||||
{
|
||||
CreateTime = DateTime.Now;
|
||||
}
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
/// 用户id s
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "UserId")]
|
||||
public long? UserId { get; set; }
|
||||
/// <summary>
|
||||
/// 岗位id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "PostId")]
|
||||
public long? PostId { get; set; }
|
||||
/// <summary>
|
||||
/// 创建者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateUser")]
|
||||
public long? CreateUser { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateTime")]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 修改者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyUser")]
|
||||
public long? ModifyUser { get; set; }
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyTime")]
|
||||
public DateTime? ModifyTime { get; set; }
|
||||
/// <summary>
|
||||
/// 是否删除
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "IsDeleted")]
|
||||
public bool? IsDeleted { get; set; }
|
||||
/// <summary>
|
||||
/// 租户Id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "TenantId")]
|
||||
public long? TenantId { get; set; }
|
||||
/// <summary>
|
||||
/// 排序字段
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "OrderNum")]
|
||||
public int? OrderNum { get; set; }
|
||||
/// <summary>
|
||||
/// 描述
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Remark")]
|
||||
public string? Remark { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.Json.Serialization;
|
||||
using SqlSugar;
|
||||
using Yi.Framework.Model.Base;
|
||||
|
||||
namespace Yi.Framework.Model.RABC.Entitys
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户角色关系表
|
||||
///</summary>
|
||||
[SugarTable("UserRole")]
|
||||
public partial class UserRoleEntity : IBaseModelEntity
|
||||
{
|
||||
public UserRoleEntity()
|
||||
{
|
||||
CreateTime = DateTime.Now;
|
||||
}
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "RoleId")]
|
||||
public long? RoleId { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "UserId")]
|
||||
public long? UserId { get; set; }
|
||||
/// <summary>
|
||||
/// 创建者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateUser")]
|
||||
public long? CreateUser { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateTime")]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 修改者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyUser")]
|
||||
public long? ModifyUser { get; set; }
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyTime")]
|
||||
public DateTime? ModifyTime { get; set; }
|
||||
/// <summary>
|
||||
/// 是否删除
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "IsDeleted")]
|
||||
public bool? IsDeleted { get; set; }
|
||||
/// <summary>
|
||||
/// 租户Id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "TenantId")]
|
||||
public long? TenantId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -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