:recycle:代码重构
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
namespace ZR.Model.System
|
||||
{
|
||||
/// <summary>
|
||||
/// 文章表
|
||||
/// </summary>
|
||||
[SugarTable("article", "文章管理")]
|
||||
[Tenant("0")]
|
||||
public class Article
|
||||
{
|
||||
/// <summary>
|
||||
/// 文章id
|
||||
/// </summary>
|
||||
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
|
||||
public int Cid { get; set; }
|
||||
/// <summary>
|
||||
/// 文章标题
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "文章标题", Length = 254, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public string Title { get; set; }
|
||||
/// <summary>
|
||||
/// 发布时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "发布时间")]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
[SugarColumn(IsOnlyIgnoreInsert = true, ColumnDescription = "更新时间")]
|
||||
public DateTime? UpdateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 文章内容
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "文章内容", ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
public string Content { get; set; }
|
||||
/// <summary>
|
||||
/// 作者名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "作者名", Length = 20, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public string AuthorName { get; set; }
|
||||
/// <summary>
|
||||
/// 发布者用户id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "发布者用户id", ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public long UserId { get; set; }
|
||||
/// <summary>
|
||||
/// 文章状态 1、发布 2、草稿
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "文章状态 1、发布 2、草稿", Length = 20)]
|
||||
public string Status { get; set; }
|
||||
/// <summary>
|
||||
/// 编辑器类型 markdown,html
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "编辑器类型markdown,html", ColumnName = "fmt_type", Length = 20, IsNullable = true)]
|
||||
public string FmtType { get; set; }
|
||||
/// <summary>
|
||||
/// 文章标签eg:Net5,java
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "文章标签", Length = 20)]
|
||||
public string Tags { get; set; }
|
||||
/// <summary>
|
||||
/// 点击量
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "点击量", DefaultValue = "0")]
|
||||
public int Hits { get; set; }
|
||||
[SugarColumn(ColumnDescription = "目录id", ColumnName = "category_Id")]
|
||||
public int CategoryId { get; set; }
|
||||
/// <summary>
|
||||
/// 封面地址
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "封面地址", Length = 255)]
|
||||
public string CoverUrl { get; set; }
|
||||
/// <summary>
|
||||
/// 是否公开 1、公开 0、不公开
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "是否公开 1、公开 0、不公开", DefaultValue = "0")]
|
||||
public int IsPublic { get; set; }
|
||||
|
||||
[Navigate(NavigateType.OneToOne, nameof(CategoryId), nameof(ArticleCategory.CategoryId))] //自定义关系映射
|
||||
public ArticleCategory ArticleCategoryNav { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using Newtonsoft.Json;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ZR.Model.System
|
||||
{
|
||||
/// <summary>
|
||||
/// 文章目录
|
||||
/// </summary>
|
||||
[SugarTable("articleCategory", "文章目录")]
|
||||
[Tenant("0")]
|
||||
public class ArticleCategory
|
||||
{
|
||||
/// <summary>
|
||||
/// 目录id
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnName = "category_id")]
|
||||
public int CategoryId { get; set; }
|
||||
|
||||
[SugarColumn(ColumnDescription = "目录名", Length = 20, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public string Name { get; set; }
|
||||
public int? ParentId { get; set; }
|
||||
[SugarColumn(ColumnDescription = "创建时间", ColumnName = "create_time")]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
|
||||
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public List<ArticleCategory> Children { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
using Newtonsoft.Json;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace ZR.Model.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// 多语言配置,数据实体对象
|
||||
/// </summary>
|
||||
[Tenant("0")]
|
||||
[SugarTable("sys_common_lang", "多语言配置表")]
|
||||
public class CommonLang
|
||||
{
|
||||
/// <summary>
|
||||
/// id
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 语言code
|
||||
/// </summary>
|
||||
[DisplayName("语言code")]
|
||||
[SugarColumn(ColumnName = "lang_code", Length = 10, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public string LangCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 语言key
|
||||
/// </summary>
|
||||
[DisplayName("语言key")]
|
||||
[SugarColumn(ColumnName = "lang_key", Length = 100, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public string LangKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
[DisplayName("名称")]
|
||||
[SugarColumn(ColumnName = "lang_name", Length = 2000, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public string LangName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 添加时间
|
||||
/// </summary>
|
||||
[DisplayName("添加时间")]
|
||||
public DateTime? Addtime { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace ZR.Model.Dto
|
||||
{
|
||||
/// <summary>
|
||||
/// 文章目录输入对象
|
||||
/// </summary>
|
||||
public class ArticleCategoryDto
|
||||
{
|
||||
[Required(ErrorMessage = "目录id不能为空")]
|
||||
public int CategoryId { get; set; }
|
||||
[Required(ErrorMessage = "目录名不能为空")]
|
||||
public string Name { get; set; }
|
||||
public DateTime? CreateTime { get; set; }
|
||||
public int? ParentId { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 文章目录查询对象
|
||||
/// </summary>
|
||||
public class ArticleCategoryQueryDto : PagerInfo
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace ZR.Model.System.Dto
|
||||
{
|
||||
public class ArticleQueryDto : PagerInfo
|
||||
{
|
||||
public long? UserId { get; set; }
|
||||
public string Status { get; set; }
|
||||
public string Title { get; set; }
|
||||
public DateTime? BeginTime { get; set; }
|
||||
public DateTime? EndTime { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 输入输出对象
|
||||
/// </summary>
|
||||
public class ArticleDto
|
||||
{
|
||||
[Required(ErrorMessage = "Cid不能为空")]
|
||||
public int Cid { get; set; }
|
||||
[Required(ErrorMessage = "文章标题不能为空")]
|
||||
public string Title { get; set; }
|
||||
[Required(ErrorMessage = "文章内容不能为空")]
|
||||
public string Content { get; set; }
|
||||
|
||||
public long? UserId { get; set; }
|
||||
|
||||
public string Status { get; set; }
|
||||
|
||||
public string FmtType { get; set; }
|
||||
|
||||
public string Tags { get; set; }
|
||||
|
||||
public int? Hits { get; set; }
|
||||
|
||||
public int? CategoryId { get; set; }
|
||||
|
||||
public DateTime? CreateTime { get; set; }
|
||||
|
||||
public DateTime? UpdateTime { get; set; }
|
||||
|
||||
public string AuthorName { get; set; }
|
||||
|
||||
public string CoverUrl { get; set; }
|
||||
|
||||
public ArticleCategory ArticleCategoryNav { get; set; }
|
||||
public string[] TagList { get; set; }
|
||||
public int IsPublic { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ZR.Model.Dto
|
||||
{
|
||||
/// <summary>
|
||||
/// 多语言配置输入对象
|
||||
/// </summary>
|
||||
public class CommonLangDto
|
||||
{
|
||||
//[Required(ErrorMessage = "id不能为空")]
|
||||
public long Id { get; set; }
|
||||
//[Required(ErrorMessage = "语言code不能为空")]
|
||||
public string LangCode { get; set; }
|
||||
public string LangKey { get; set; }
|
||||
//[Required(ErrorMessage = "名称不能为空")]
|
||||
public string LangName { get; set; }
|
||||
public List<CommonLangDto> LangList { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 多语言配置查询对象
|
||||
/// </summary>
|
||||
public class CommonLangQueryDto : PagerInfo
|
||||
{
|
||||
public string LangCode { get; set; }
|
||||
public string LangKey { get; set; }
|
||||
public DateTime? BeginAddtime { get; set; }
|
||||
public DateTime? EndAddtime { get; set; }
|
||||
public int ShowMode { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
using System.Collections.Generic;
|
||||
using ZR.Model.System.Generate;
|
||||
|
||||
namespace ZR.Model.System.Dto
|
||||
{
|
||||
public class GenTableDto
|
||||
{
|
||||
public int TableId { get; set; }
|
||||
public string TableName { get; set; }
|
||||
public string TableComment { get; set; }
|
||||
public string SubTableName { get; set; }
|
||||
public string SubTableFkName { get; set; }
|
||||
public string ClassName { get; set; }
|
||||
public string TplCategory { get; set; }
|
||||
public string BaseNameSpace { get; set; }
|
||||
public string ModuleName { get; set; }
|
||||
public string BusinessName { get; set; }
|
||||
public string FunctionName { get; set; }
|
||||
public string FunctionAuthor { get; set; }
|
||||
public string GenType { get; set; }
|
||||
public string GenPath { get; set; }
|
||||
//public string PermissionPrefix { get; set; }
|
||||
public string Remark { get; set; }
|
||||
/// <summary>
|
||||
/// 额外参数
|
||||
/// </summary>
|
||||
public Options Params { get; set; }
|
||||
public List<GenTableColumnDto> Columns { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 额外参数
|
||||
/// ****注意里面参数统一首字母小写*****
|
||||
/// </summary>
|
||||
public class Params
|
||||
{
|
||||
public string TreeCode { get; set; }
|
||||
public string TreeName { get; set; }
|
||||
public string TreeParentCode { get; set; }
|
||||
public int? ParentMenuId { get; set; }
|
||||
public string SortField { get; set; }
|
||||
public string SortType { get; set; }
|
||||
/// <summary>
|
||||
/// 额外参数字符串
|
||||
/// </summary>
|
||||
public string CheckedBtn { get; set; }
|
||||
public string PermissionPrefix { get; set; }
|
||||
}
|
||||
public class GenTableColumnDto
|
||||
{
|
||||
public int ColumnId { get; set; }
|
||||
public int TableId { get; set; }
|
||||
public string ColumnComment { get; set; }
|
||||
public string CsharpType { get; set; }
|
||||
public string CsharpField { get; set; }
|
||||
public bool IsInsert { get; set; }
|
||||
public bool IsEdit { get; set; }
|
||||
public bool IsList { get; set; }
|
||||
public bool IsQuery { get; set; }
|
||||
public bool IsSort { get; set; }
|
||||
public bool IsRequired { get; set; }
|
||||
public bool IsExport { get; set; }
|
||||
/// <summary>
|
||||
/// 显示类型(文本框、文本域、下拉框、复选框、单选框、日期控件)
|
||||
/// </summary>
|
||||
public string HtmlType { get; set; }
|
||||
/// <summary>
|
||||
/// 查询类型(等于、不等于、大于、小于、范围)
|
||||
/// </summary>
|
||||
public string QueryType { get; set; } = "EQ";
|
||||
public int Sort { get; set; }
|
||||
/// <summary>
|
||||
/// 字典类型
|
||||
/// </summary>
|
||||
public string DictType { get; set; }
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string Remark { get; set; }
|
||||
/// <summary>
|
||||
/// 自动填充类型
|
||||
/// </summary>
|
||||
public int? AutoFillType { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace ZR.Model.System.Dto
|
||||
{
|
||||
public class LockUserDto
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string ClientId { get; set; }
|
||||
public string ConnnectionId { get; set; }
|
||||
public string Reason { get; set; }
|
||||
public int Time { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace ZR.Model.System.Dto
|
||||
{
|
||||
public class LoginBodyDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户名
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "用户名不能为空")]
|
||||
public string Username { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户密码
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "密码不能为空")]
|
||||
public string Password { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 验证码
|
||||
/// </summary>
|
||||
public string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 唯一标识
|
||||
/// </summary>
|
||||
public string Uuid { get; set; } = "";
|
||||
public string LoginIP { get; set; }
|
||||
public string ClientId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
using MiniExcelLibs.Attributes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace ZR.Model.System.Dto
|
||||
{
|
||||
public class MenuDto
|
||||
{
|
||||
//{"parentId":0,"menuName":"aaa","icon":"documentation","menuType":"M","orderNum":999,"visible":0,"status":0,"path":"aaa"}
|
||||
[Required(ErrorMessage = "菜单id不能为空")]
|
||||
[ExcelColumn(Name = "菜单id")]
|
||||
public int MenuId { get; set; }
|
||||
[ExcelColumn(Name = "菜单名")]
|
||||
public string MenuName { get; set; }
|
||||
/// <summary>
|
||||
/// 父菜单ID
|
||||
/// </summary>
|
||||
public long? ParentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 显示顺序
|
||||
/// </summary>
|
||||
public int OrderNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 路由地址
|
||||
/// </summary>
|
||||
[ExcelColumn(Name = "路由地址")]
|
||||
public string Path { get; set; } = "#";
|
||||
|
||||
/// <summary>
|
||||
/// 组件路径
|
||||
/// </summary>
|
||||
[ExcelColumn(Name = "组件地址")]
|
||||
public string Component { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否缓存(1缓存 0不缓存)
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "是否缓存不能为空")]
|
||||
[ExcelColumn(Name = "是否缓存")]
|
||||
public int IsCache { get; set; }
|
||||
/// <summary>
|
||||
/// 是否外链 1、是 0、否
|
||||
/// </summary>
|
||||
public int IsFrame { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 类型(M目录 C菜单 F按钮 L链接)
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "菜单类型不能为空")]
|
||||
public string MenuType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 显示状态(0显示 1隐藏)
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "显示状态不能为空")]
|
||||
public string Visible { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 菜单状态(0正常 1停用)
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "菜单状态不能为空")]
|
||||
public string Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 权限字符串
|
||||
/// </summary>
|
||||
[ExcelColumn(Name = "权限字符串")]
|
||||
public string Perms { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 菜单图标
|
||||
/// </summary>
|
||||
public string Icon { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// 翻译key
|
||||
/// </summary>
|
||||
public string MenuNameKey { get; set; }
|
||||
public List<MenuDto> Children { get; set; } = new List<MenuDto>();
|
||||
}
|
||||
|
||||
public class MenuQueryDto
|
||||
{
|
||||
public string MenuName { get; set; }
|
||||
public string Visible { get; set; }
|
||||
public string Status { get; set; }
|
||||
public string MenuTypeIds { get; set; } = string.Empty;
|
||||
public int? ParentId { get; set; }
|
||||
public string[] MenuTypeIdArr
|
||||
{
|
||||
get
|
||||
{
|
||||
return MenuTypeIds?.Split(',', StringSplitOptions.RemoveEmptyEntries);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace ZR.Model.System.Dto
|
||||
{
|
||||
public class RegisterDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户名
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "用户名不能为空")]
|
||||
public string Username { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户密码
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "密码不能为空")]
|
||||
public string Password { get; set; }
|
||||
[Required(ErrorMessage = "确认密码不能为空")]
|
||||
public string ConfirmPassword { get; set; }
|
||||
/// <summary>
|
||||
/// 验证码
|
||||
/// </summary>
|
||||
public string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 唯一标识
|
||||
/// </summary>
|
||||
public string Uuid { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 头像
|
||||
/// </summary>
|
||||
public string Photo { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using MiniExcelLibs.Attributes;
|
||||
using SqlSugar.DbConvert;
|
||||
using ZR.Model.System.Enums;
|
||||
|
||||
namespace ZR.Model.System.Dto
|
||||
{
|
||||
public class RoleMenuExportDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 一级目录名
|
||||
/// </summary>
|
||||
[ExcelColumn(Name = "菜单", Width = 50)]
|
||||
public string MenuName { get; set; }
|
||||
//[ExcelColumn(Name = "菜单名", Width = 20)]
|
||||
//public string MenuName1 { get; set; }
|
||||
//[ExcelColumn(Name = "权限按钮", Width = 20)]
|
||||
//public string MenuName2 { get; set; }
|
||||
[ExcelColumn(Name = "路径", Width = 20)]
|
||||
public string Path { get; set; }
|
||||
[ExcelColumn(Name = "组件名", Width = 20)]
|
||||
public string Component { get; set; }
|
||||
[ExcelColumn(Name = "权限字符", Width = 20)]
|
||||
public string Perms { get; set; }
|
||||
[ExcelColumn(Name = "菜单类型")]
|
||||
public MenuType MenuType { get; set; }
|
||||
[ExcelColumn(Name = "菜单状态")]
|
||||
public MenuStatus Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace ZR.Model.System.Dto
|
||||
{
|
||||
public class RoleUserQueryDto : PagerInfo
|
||||
{
|
||||
public long RoleId { get; set; }
|
||||
|
||||
public string UserName { get; set; }
|
||||
}
|
||||
|
||||
public class RoleUsersCreateDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 角色id
|
||||
/// </summary>
|
||||
[Display(Name = "角色id")]
|
||||
[Required(ErrorMessage = "roleId 不能为空")]
|
||||
public long RoleId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户编码 [1,2,3,4]
|
||||
/// </summary>
|
||||
[Display(Name = "用户编码 [1,2,3,4]")]
|
||||
public List<long> UserIds { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace ZR.Model.System.Dto
|
||||
{
|
||||
public class ScanDto
|
||||
{
|
||||
public string Uuid { get; set; }
|
||||
public string State { get; set; }
|
||||
public string DeviceId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using MiniExcelLibs.Attributes;
|
||||
|
||||
namespace ZR.Model.System.Dto
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据差异日志查询对象
|
||||
/// </summary>
|
||||
public class SqlDiffLogQueryDto : PagerInfo
|
||||
{
|
||||
public string TableName { get; set; }
|
||||
public string DiffType { get; set; }
|
||||
public string UserName { get; set; }
|
||||
public DateTime? BeginAddTime { get; set; }
|
||||
public DateTime? EndAddTime { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 数据差异日志输入输出对象
|
||||
/// </summary>
|
||||
public class SqlDiffLogDto
|
||||
{
|
||||
[Required(ErrorMessage = "主键不能为空")]
|
||||
[ExcelColumn(Name = "主键")]
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
public long PId { get; set; }
|
||||
|
||||
[ExcelColumn(Name = "表名")]
|
||||
public string TableName { get; set; }
|
||||
|
||||
[ExcelColumn(Name = "业务数据内容")]
|
||||
public string BusinessData { get; set; }
|
||||
|
||||
[ExcelColumn(Name = "差异类型")]
|
||||
public string DiffType { get; set; }
|
||||
|
||||
[ExcelColumn(Name = "执行sql语句")]
|
||||
public string Sql { get; set; }
|
||||
|
||||
[ExcelColumn(Name = "变更前数据")]
|
||||
public string BeforeData { get; set; }
|
||||
|
||||
[ExcelColumn(Name = "变更后数据")]
|
||||
public string AfterData { get; set; }
|
||||
|
||||
[ExcelColumn(Name = "操作用户名")]
|
||||
public string UserName { get; set; }
|
||||
|
||||
[ExcelColumn(Name = "AddTime", Format = "yyyy-MM-dd HH:mm:ss")]
|
||||
public DateTime? AddTime { get; set; }
|
||||
|
||||
[ExcelColumn(Name = "数据库配置id")]
|
||||
public string ConfigId { get; set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
|
||||
namespace ZR.Model.System.Dto
|
||||
{
|
||||
/// <summary>
|
||||
/// 参数配置输入对象模型
|
||||
/// </summary>
|
||||
public class SysConfigDto
|
||||
{
|
||||
public int ConfigId { get; set; }
|
||||
public string ConfigName { get; set; }
|
||||
public string ConfigKey { get; set; }
|
||||
public string ConfigValue { get; set; }
|
||||
public string ConfigType { get; set; }
|
||||
public string Remark { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 参数配置查询对象模型
|
||||
/// </summary>
|
||||
public class SysConfigQueryDto : PagerInfo
|
||||
{
|
||||
public string ConfigName { get; set; }
|
||||
public string ConfigKey { get; set; }
|
||||
public string ConfigValue { get; set; }
|
||||
public string ConfigType { get; set; }
|
||||
public DateTime? BeginTime { get; set; }
|
||||
public DateTime? EndTime { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
namespace ZR.Model.System.Dto
|
||||
{
|
||||
public class SysDeptQueryDto : PagerInfo
|
||||
{
|
||||
public int? Status { get; set; }
|
||||
public int? DelFlag { get; set; }
|
||||
public string DeptName { get; set; }
|
||||
}
|
||||
public class SysDeptDto : SysBase
|
||||
{
|
||||
public long DeptId { get; set; }
|
||||
|
||||
public long ParentId { get; set; }
|
||||
|
||||
public string Ancestors { get; set; }
|
||||
|
||||
public string DeptName { get; set; }
|
||||
|
||||
public int OrderNum { get; set; }
|
||||
|
||||
public string Leader { get; set; }
|
||||
|
||||
public string Phone { get; set; }
|
||||
|
||||
public string Email { get; set; }
|
||||
|
||||
public int Status { get; set; }
|
||||
|
||||
public int DelFlag { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace ZR.Model.System.Dto
|
||||
{
|
||||
public class SysDictTypeDto
|
||||
{
|
||||
public long DictId { get; set; }
|
||||
/// <summary>
|
||||
/// 字典名称
|
||||
/// </summary>
|
||||
public string DictName { get; set; }
|
||||
/// <summary>
|
||||
/// 字典类型
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "字典类型不能为空")]
|
||||
[RegularExpression(pattern: "^[a-z][a-z0-9_]*$", ErrorMessage = "字典类型必须以字母开头,且字典类型只能由小写字母或加下划线还有数字组成")]
|
||||
public string DictType { get; set; }
|
||||
public string Status { get; set; }
|
||||
/// <summary>
|
||||
/// 系统内置 Y是 N否
|
||||
/// </summary>
|
||||
public string Type { get; set; }
|
||||
/// <summary>
|
||||
/// 自定义sql
|
||||
/// </summary>
|
||||
public string CustomSql { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
using System;
|
||||
|
||||
namespace ZR.Model.System.Dto
|
||||
{
|
||||
/// <summary>
|
||||
/// 文件存储输入对象
|
||||
/// </summary>
|
||||
public class SysFileDto
|
||||
{
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
/// 文件原名
|
||||
/// </summary>
|
||||
public string RealName { get; set; }
|
||||
/// <summary>
|
||||
/// 文件类型
|
||||
/// </summary>
|
||||
public string FileType { get; set; }
|
||||
/// <summary>
|
||||
/// 存储文件名
|
||||
/// </summary>
|
||||
public string FileName { get; set; }
|
||||
/// <summary>
|
||||
/// 文件存储地址 eg:/uploads/20220202
|
||||
/// </summary>
|
||||
public string FileUrl { get; set; }
|
||||
/// <summary>
|
||||
/// 仓库位置 eg:/uploads
|
||||
/// </summary>
|
||||
public string StorePath { get; set; }
|
||||
/// <summary>
|
||||
/// 文件大小
|
||||
/// </summary>
|
||||
public string FileSize { get; set; }
|
||||
/// <summary>
|
||||
/// 文件扩展名
|
||||
/// </summary>
|
||||
public string FileExt { get; set; }
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
/// </summary>
|
||||
public string Create_by { get; set; }
|
||||
/// <summary>
|
||||
/// 上传时间
|
||||
/// </summary>
|
||||
public DateTime? Create_time { get; set; }
|
||||
/// <summary>
|
||||
/// 存储类型
|
||||
/// </summary>
|
||||
public int? StoreType { get; set; }
|
||||
/// <summary>
|
||||
/// 访问路径
|
||||
/// </summary>
|
||||
public string AccessUrl { get; set; }
|
||||
|
||||
public SysFileDto() { }
|
||||
public SysFileDto(string originFileName, string fileName, string ext, string fileSize, string storePath, string accessUrl, string create_by)
|
||||
{
|
||||
StorePath = storePath;
|
||||
RealName = originFileName;
|
||||
FileName = fileName;
|
||||
FileExt = ext;
|
||||
FileSize = fileSize;
|
||||
AccessUrl = accessUrl;
|
||||
Create_by = create_by;
|
||||
Create_time = DateTime.Now;
|
||||
}
|
||||
}
|
||||
public class SysFileQueryDto : PagerInfo
|
||||
{
|
||||
public DateTime? BeginCreate_time { get; set; }
|
||||
public DateTime? EndCreate_time { get; set; }
|
||||
public int? StoreType { get; set; }
|
||||
public long? FileId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
namespace ZR.Model.System.Dto
|
||||
{
|
||||
public class SysLogininfoDto : SysBase
|
||||
{
|
||||
public int PageNum { get; set; }
|
||||
/// <summary>
|
||||
/// IP 地址
|
||||
/// </summary>
|
||||
public string Ipaddr { get; set; }
|
||||
/// <summary>
|
||||
/// 登录状态 0成功 1失败
|
||||
/// </summary>
|
||||
public string Status { get; set; }
|
||||
/// <summary>
|
||||
/// 用户名
|
||||
/// </summary>
|
||||
public string UserName { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace ZR.Model.System.Dto
|
||||
{
|
||||
/// <summary>
|
||||
/// 通知公告表输入对象
|
||||
/// </summary>
|
||||
public class SysNoticeDto
|
||||
{
|
||||
public int NoticeId { get; set; }
|
||||
[Required]
|
||||
public string NoticeTitle { get; set; }
|
||||
public int NoticeType { get; set; }
|
||||
public string NoticeContent { get; set; }
|
||||
public int Status { get; set; }
|
||||
public string Remark { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 通知公告表查询对象
|
||||
/// </summary>
|
||||
public class SysNoticeQueryDto : PagerInfo
|
||||
{
|
||||
public string NoticeTitle { get; set; }
|
||||
public int? NoticeType { get; set; }
|
||||
public string CreateBy { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
|
||||
namespace ZR.Model.System.Dto
|
||||
{
|
||||
public class SysOperLogQueryDto : PagerInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 操作人员
|
||||
/// </summary>
|
||||
public string OperName { get; set; }
|
||||
/// <summary>
|
||||
/// 业务类型 0=其它,1=新增,2=修改,3=删除,4=授权,5=导出,6=导入,7=强退,8=生成代码,9=清空数据
|
||||
/// </summary>
|
||||
public int BusinessType { get; set; } = -1;
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// </summary>
|
||||
public int Status { get; set; } = -1;
|
||||
/// <summary>
|
||||
/// 操作模块
|
||||
/// </summary>
|
||||
public string Title { get; set; }
|
||||
/// <summary>
|
||||
/// 请求参数
|
||||
/// </summary>
|
||||
public string OperParam { get; set; }
|
||||
public DateTime? BeginTime { get; set; }
|
||||
public DateTime? EndTime { get; set; }
|
||||
}
|
||||
|
||||
public class SysOperLogDto : SysBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 页码
|
||||
/// </summary>
|
||||
public int PageNum { get; set; }
|
||||
public int PageSize { get; set; }
|
||||
/// <summary>
|
||||
/// 操作人员
|
||||
/// </summary>
|
||||
public string OperName { get; set; }
|
||||
/// <summary>
|
||||
/// 业务类型 0=其它,1=新增,2=修改,3=删除,4=授权,5=导出,6=导入,7=强退,8=生成代码,9=清空数据
|
||||
/// </summary>
|
||||
public int BusinessType { get; set; } = -1;
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// </summary>
|
||||
public int Status { get; set; } = -1;
|
||||
/// <summary>
|
||||
/// 操作模块
|
||||
/// </summary>
|
||||
public string Title { get; set; }
|
||||
/// <summary>
|
||||
/// 请求参数
|
||||
/// </summary>
|
||||
public string OperParam { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ZR.Model.System.Dto
|
||||
{
|
||||
public class SysRoleDto : SysBase
|
||||
{
|
||||
public long RoleId { get; set; }
|
||||
/// <summary>
|
||||
/// 要添加的菜单集合
|
||||
/// </summary>
|
||||
public List<long> MenuIds { get; set; } = new List<long>();
|
||||
public string RoleName { get; set; }
|
||||
public string RoleKey { get; set; }
|
||||
public int RoleSort { get; set; }
|
||||
public int Status { get; set; }
|
||||
public int DataScope { get; set; }
|
||||
public int[] DeptIds { get; set; }
|
||||
/// <summary>
|
||||
/// 减少菜单集合
|
||||
/// </summary>
|
||||
public List<long> DelMenuIds { get; set; } = new List<long>();
|
||||
public bool MenuCheckStrictly { get; set; }
|
||||
public bool DeptCheckStrictly { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ZR.Model.System.Dto
|
||||
{
|
||||
public class SysRoleMenuDto
|
||||
{
|
||||
public long RoleId { get; set; }
|
||||
/// <summary>
|
||||
/// 角色分配菜单
|
||||
/// </summary>
|
||||
public List<long> MenuIds { get; set; } = new List<long>();
|
||||
public string RoleName { get; set; }
|
||||
public string RoleKey { get; set; }
|
||||
public string Create_by { get; set; }
|
||||
public DateTime Create_time{ get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
|
||||
namespace ZR.Model.System.Dto
|
||||
{
|
||||
public class SysUserDto
|
||||
{
|
||||
public long UserId { get; set; }
|
||||
public string UserName { get; set; }
|
||||
public string NickName { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string Remark { get; set; }
|
||||
public string Phonenumber { get; set; }
|
||||
/// <summary>
|
||||
/// 用户性别(0男 1女 2未知)
|
||||
/// </summary>
|
||||
public int Sex { get; set; }
|
||||
public string Password { get; set; }
|
||||
}
|
||||
|
||||
public class SysUserQueryDto
|
||||
{
|
||||
public long? UserId { get; set; }
|
||||
public string UserName { get; set; }
|
||||
public string NickName { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string Remark { get; set; }
|
||||
public string Phonenumber { get; set; }
|
||||
/// <summary>
|
||||
/// 用户性别(0男 1女 2未知)
|
||||
/// </summary>
|
||||
public int Sex { get; set; }
|
||||
public DateTime? BeginTime { get; set; }
|
||||
public DateTime? EndTime { get; set; }
|
||||
public int Status { get; set; }
|
||||
public long DeptId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ZR.Model.System.Dto
|
||||
{
|
||||
public class SysdictDataDto
|
||||
{
|
||||
public string DictType { get; set; }
|
||||
public string ColumnName { get; set; }
|
||||
public List<SysDictData> List { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace ZR.Model.System.Dto
|
||||
{
|
||||
public class TasksQueryDto : PagerInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询字符串
|
||||
/// </summary>
|
||||
[Display(Name = "查询字符串")]
|
||||
public string QueryText { get; set; }
|
||||
public int? TaskType { get; set; }
|
||||
public int? TriggerType { get; set; }
|
||||
public int? IsStart { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加任务
|
||||
/// </summary>
|
||||
public class TasksCreateDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 任务id
|
||||
/// </summary>
|
||||
[Display(Name = "任务id")]
|
||||
//[Required(ErrorMessage = "任务不能为空")]
|
||||
public string ID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 任务名称
|
||||
/// </summary>
|
||||
[Display(Name = "任务名称")]
|
||||
[Required(ErrorMessage = "任务名称不能为空")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 任务分组
|
||||
/// </summary>
|
||||
[Display(Name = "任务分组")]
|
||||
[Required(ErrorMessage = "任务分组不能为空")]
|
||||
public string JobGroup { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 运行时间表达式
|
||||
/// </summary>
|
||||
[Display(Name = "运行时间表达式")]
|
||||
public string Cron { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 程序集名称
|
||||
/// </summary>
|
||||
[Display(Name = "程序集名称")]
|
||||
public string AssemblyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 任务所在类
|
||||
/// </summary>
|
||||
[Display(Name = "任务所在类")]
|
||||
public string ClassName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 任务描述
|
||||
/// </summary>
|
||||
[Display(Name = "任务描述")]
|
||||
public string Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 开始时间
|
||||
/// </summary>
|
||||
[Display(Name = "开始时间")]
|
||||
public DateTime? BeginTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 结束时间
|
||||
/// </summary>
|
||||
[Display(Name = "结束时间")]
|
||||
public DateTime? EndTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 触发器类型(0、simple 1、cron)
|
||||
/// </summary>
|
||||
[Display(Name = "触发器类型(0、simple 1、cron)")]
|
||||
public int TriggerType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 执行间隔时间(单位:秒)
|
||||
/// </summary>
|
||||
[Display(Name = "执行间隔时间(单位:秒)")]
|
||||
public int IntervalSecond { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 传入参数
|
||||
/// </summary>
|
||||
[Display(Name = "传入参数")]
|
||||
public string JobParams { get; set; }
|
||||
public string ApiUrl { get; set; }
|
||||
/// <summary>
|
||||
/// 1、程序集任务 2、apiUrl任务 3、SQL语句
|
||||
/// </summary>
|
||||
public int TaskType { get; set; }
|
||||
/// <summary>
|
||||
/// SQL文本
|
||||
/// </summary>
|
||||
public string SqlText { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 网络请求方式
|
||||
/// </summary>
|
||||
public string RequestMethod { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
|
||||
namespace ZR.Model.System.Dto
|
||||
{
|
||||
public class TasksLogQueryDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询字符串
|
||||
/// </summary>
|
||||
public string Name{ get; set; }
|
||||
public string JobName { get; set; }
|
||||
public string JobId { get; set; }
|
||||
public string JobGroup { get; set; }
|
||||
public string Status { get; set; }
|
||||
public DateTime? BeginTime { get; set; }
|
||||
public DateTime? EndTime { get; set; }
|
||||
}
|
||||
|
||||
public class TasksLogDto
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace ZR.Model.System.Enums
|
||||
{
|
||||
/// <summary>
|
||||
/// 菜单状态(0正常 1停用)
|
||||
/// </summary>
|
||||
public enum MenuStatus
|
||||
{
|
||||
[Description("正常")]
|
||||
正常 = 0,
|
||||
[Description("停用")]
|
||||
停用 = 1,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace ZR.Model.System.Enums
|
||||
{
|
||||
/// <summary>
|
||||
/// M目录 C菜单 F按钮 L链接
|
||||
/// </summary>
|
||||
public enum MenuType
|
||||
{
|
||||
[Description("目录")]
|
||||
M,
|
||||
[Description("菜单")]
|
||||
C,
|
||||
[Description("按钮")]
|
||||
F,
|
||||
[Description("链接")]
|
||||
L
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
using SqlSugar;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ZR.Model.System.Generate
|
||||
{
|
||||
/// <summary>
|
||||
/// 代码生成表
|
||||
/// </summary>
|
||||
[SugarTable("gen_table", "代码生成表")]
|
||||
[Tenant("0")]
|
||||
public class GenTable : SysBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 表id
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
public long TableId { get; set; }
|
||||
/// <summary>
|
||||
/// 数据库名
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 50)]
|
||||
public string DbName { get; set; }
|
||||
/// <summary>
|
||||
/// 表名
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 150)]
|
||||
public string TableName { get; set; }
|
||||
/// <summary>
|
||||
/// 表描述
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 150)]
|
||||
public string TableComment { get; set; }
|
||||
/// <summary>
|
||||
/// 关联父表的表名
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 150)]
|
||||
public string SubTableName { get; set; }
|
||||
/// <summary>
|
||||
/// 本表关联父表的外键名
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 150)]
|
||||
public string SubTableFkName { get; set; }
|
||||
/// <summary>
|
||||
/// csharp类名
|
||||
/// </summary>
|
||||
public string ClassName { get; set; }
|
||||
/// <summary>
|
||||
/// 使用的模板(crud单表操作 tree树表操作 sub主子表操作)
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 50, DefaultValue = "crud")]
|
||||
public string TplCategory { get; set; }
|
||||
/// <summary>
|
||||
/// 基本命名空间前缀
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 100)]
|
||||
public string BaseNameSpace { get; set; }
|
||||
/// <summary>
|
||||
/// 生成模块名
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 50)]
|
||||
public string ModuleName { get; set; }
|
||||
/// <summary>
|
||||
/// 生成业务名
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 50)]
|
||||
public string BusinessName { get; set; }
|
||||
/// <summary>
|
||||
/// 生成功能名
|
||||
/// </summary>
|
||||
public string FunctionName { get; set; }
|
||||
/// <summary>
|
||||
/// 生成作者名
|
||||
/// </summary>
|
||||
public string FunctionAuthor { get; set; }
|
||||
/// <summary>
|
||||
/// 生成代码方式(0zip压缩包 1自定义路径)
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 1, DefaultValue = "0")]
|
||||
public string GenType { get; set; }
|
||||
/// <summary>
|
||||
/// 代码生成保存路径
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 200, DefaultValue = "/")]
|
||||
public string GenPath { get; set; }
|
||||
/// <summary>
|
||||
/// 其他生成选项
|
||||
/// </summary>
|
||||
[SugarColumn(IsJson = true)]
|
||||
public Options Options { get; set; }
|
||||
|
||||
#region 表额外字段
|
||||
/// <summary>
|
||||
/// 表列信息
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public List<GenTableColumn> Columns { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 字表信息
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public GenTable SubTable { get; set; }
|
||||
#endregion
|
||||
}
|
||||
|
||||
public class Options
|
||||
{
|
||||
public long ParentMenuId { get; set; }
|
||||
public string SortType { get; set; } = "asc";
|
||||
public string SortField { get; set; } = string.Empty;
|
||||
public string TreeCode { get; set; } = string.Empty;
|
||||
public string TreeName { get; set; } = string.Empty;
|
||||
public string TreeParentCode { get; set; } = string.Empty;
|
||||
public string PermissionPrefix { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// 额外参数字符串
|
||||
/// </summary>
|
||||
public int[] CheckedBtn { get; set; } = new int[] { 1, 2, 3 };
|
||||
/// <summary>
|
||||
/// 列大小 12,24
|
||||
/// </summary>
|
||||
public int ColNum { get; set; } = 12;
|
||||
/// <summary>
|
||||
/// 是否生成仓储层
|
||||
/// </summary>
|
||||
public int GenerateRepo { get; set; }
|
||||
/// <summary>
|
||||
/// 自动生成菜单
|
||||
/// </summary>
|
||||
public bool GenerateMenu { get; set; }
|
||||
/// <summary>
|
||||
/// 操作按钮样式
|
||||
/// </summary>
|
||||
public int OperBtnStyle { get; set; } = 1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
namespace ZR.Model.System.Generate
|
||||
{
|
||||
/// <summary>
|
||||
/// 代码生成表字段
|
||||
/// </summary>
|
||||
[SugarTable("gen_table_column", "代码生成表字段")]
|
||||
[Tenant("0")]
|
||||
public class GenTableColumn : SysBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 列id
|
||||
/// </summary>
|
||||
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
|
||||
public long ColumnId { get; set; }
|
||||
/// <summary>
|
||||
/// 导入代码生成表列名 首字母转了小写
|
||||
/// </summary>
|
||||
public string ColumnName { get; set; }
|
||||
[SugarColumn(IsOnlyIgnoreUpdate = true)]
|
||||
public long TableId { get; set; }
|
||||
|
||||
[SugarColumn(IsOnlyIgnoreUpdate = true)]
|
||||
public string TableName { get; set; }
|
||||
/// <summary>
|
||||
/// 列说明
|
||||
/// </summary>
|
||||
private string columnComment;
|
||||
public string ColumnComment
|
||||
{
|
||||
get
|
||||
{
|
||||
return string.IsNullOrEmpty(columnComment) ? CsharpField : columnComment;
|
||||
}
|
||||
set
|
||||
{
|
||||
columnComment = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 数据库列类型
|
||||
/// </summary>
|
||||
|
||||
[SugarColumn(IsOnlyIgnoreUpdate = true)]
|
||||
public string ColumnType { get; set; }
|
||||
/// <summary>
|
||||
/// C#类型
|
||||
/// </summary>
|
||||
public string CsharpType { get; set; }
|
||||
/// <summary>
|
||||
/// C# 字段名 首字母大写
|
||||
/// </summary>
|
||||
public string CsharpField { get; set; }
|
||||
/// <summary>
|
||||
/// 是否主键(1是)
|
||||
/// </summary>
|
||||
[SugarColumn(IsOnlyIgnoreUpdate = true)]
|
||||
public bool IsPk { get; set; }
|
||||
/// <summary>
|
||||
/// 是否必填(1是)
|
||||
/// </summary>
|
||||
public bool IsRequired { get; set; }
|
||||
/// <summary>
|
||||
/// 是否自增(1是)
|
||||
/// </summary>
|
||||
[SugarColumn(IsOnlyIgnoreUpdate = true)]
|
||||
public bool IsIncrement { get; set; }
|
||||
/// <summary>
|
||||
/// 是否插入(1是)
|
||||
/// </summary>
|
||||
public bool IsInsert { get; set; }
|
||||
/// <summary>
|
||||
/// 是否需要编辑(1是)
|
||||
/// </summary>
|
||||
public bool IsEdit { get; set; }
|
||||
/// <summary>
|
||||
/// 是否显示列表(1是)
|
||||
/// </summary>
|
||||
public bool IsList { get; set; }
|
||||
/// <summary>
|
||||
/// 是否查询(1是)
|
||||
/// </summary>
|
||||
public bool IsQuery { get; set; }
|
||||
/// <summary>
|
||||
/// 是否排序(1是)
|
||||
/// </summary>
|
||||
public bool IsSort { get; set; }
|
||||
/// <summary>
|
||||
/// 是否导出(1是)
|
||||
/// </summary>
|
||||
public bool IsExport { get; set; }
|
||||
/// <summary>
|
||||
/// 显示类型(文本框、文本域、下拉框、复选框、单选框、日期控件)
|
||||
/// </summary>
|
||||
public string HtmlType { get; set; }
|
||||
/// <summary>
|
||||
/// 查询类型(等于、不等于、大于、小于、范围)
|
||||
/// </summary>
|
||||
[SugarColumn(DefaultValue = "EQ")]
|
||||
public string QueryType { get; set; } = "EQ";
|
||||
public int Sort { get; set; }
|
||||
/// <summary>
|
||||
/// 字典类型
|
||||
/// </summary>
|
||||
public string DictType { get; set; } = "";
|
||||
/// <summary>
|
||||
/// 自动填充类型 1、添加 2、编辑 3、添加编辑
|
||||
/// </summary>
|
||||
public int AutoFillType { get; set; }
|
||||
|
||||
#region 额外字段
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public string RequiredStr
|
||||
{
|
||||
get
|
||||
{
|
||||
string[] arr = new string[] { "int", "long" };
|
||||
return (!IsRequired && HtmlType != "selectMulti" && (arr.Any(f => f.Contains(CsharpType))) || typeof(DateTime).Name == CsharpType) ? "?" : "";
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 前端排序字符串
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public string SortStr
|
||||
{
|
||||
get
|
||||
{
|
||||
return IsSort ? " sortable" : "";
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// C# 字段名 首字母小写,用于前端
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public string CsharpFieldFl
|
||||
{
|
||||
get
|
||||
{
|
||||
return CsharpField[..1].ToLower() + CsharpField[1..];
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 前端 只读字段
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public string DisabledStr
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((IsPk) && !IsRequired) ? " :disabled=\"true\"" : "";
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
namespace ZR.Model.System
|
||||
{
|
||||
[SugarTable("SqlDiffLog", "数据差异日志")]
|
||||
[Tenant("0")]
|
||||
public class SqlDiffLog
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
public long PId { get; set; }
|
||||
/// <summary>
|
||||
/// 表名
|
||||
/// </summary>
|
||||
public string TableName { get; set; }
|
||||
/// <summary>
|
||||
/// 业务数据内容
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 4000)]
|
||||
public string BusinessData { get; set; }
|
||||
/// <summary>
|
||||
/// 差异类型insert,update,delete
|
||||
/// </summary>
|
||||
public string DiffType { get; set; }
|
||||
/// <summary>
|
||||
/// 执行sql语句
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
public string Sql { get; set; }
|
||||
/// <summary>
|
||||
/// 变更前数据
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
public string BeforeData { get; set; }
|
||||
/// <summary>
|
||||
/// 变更后数据
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
public string AfterData { get; set; }
|
||||
/// <summary>
|
||||
/// 操作用户名
|
||||
/// </summary>
|
||||
public string UserName { get; set; }
|
||||
public DateTime AddTime { get; set; }
|
||||
/// <summary>
|
||||
/// 数据库配置id
|
||||
/// </summary>
|
||||
public string ConfigId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using MiniExcelLibs.Attributes;
|
||||
using Newtonsoft.Json;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
|
||||
namespace ZR.Model.System
|
||||
{
|
||||
//[EpplusTable(PrintHeaders = true, AutofitColumns = true, AutoCalculate = true, ShowTotal = true)]
|
||||
public class SysBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
/// </summary>
|
||||
[SugarColumn(IsOnlyIgnoreUpdate = true, Length = 64, IsNullable = true)]
|
||||
[JsonProperty(propertyName: "CreateBy")]
|
||||
[ExcelIgnore]
|
||||
public string Create_by { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
[SugarColumn(IsOnlyIgnoreUpdate = true, IsNullable = true)]
|
||||
[JsonProperty(propertyName: "CreateTime")]
|
||||
[ExcelColumn(Format = "yyyy-MM-dd HH:mm:ss")]
|
||||
public DateTime Create_time { get; set; } = DateTime.Now;
|
||||
|
||||
/// <summary>
|
||||
/// 更新人
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
[JsonProperty(propertyName: "UpdateBy")]
|
||||
[SugarColumn(IsOnlyIgnoreInsert = true, Length = 64, IsNullable = true)]
|
||||
[ExcelIgnore]
|
||||
public string Update_by { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
//[JsonIgnore]
|
||||
[SugarColumn(IsOnlyIgnoreInsert = true, IsNullable = true)]
|
||||
[JsonProperty(propertyName: "UpdateTime")]
|
||||
[ExcelIgnore]
|
||||
public DateTime? Update_time { get; set; }
|
||||
[SugarColumn(Length = 500)]
|
||||
public string Remark { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
using SqlSugar;
|
||||
|
||||
namespace ZR.Model.System
|
||||
{
|
||||
/// <summary>
|
||||
/// 参数配置,数据实体对象
|
||||
///
|
||||
/// @author mr.zhao
|
||||
/// @date 2021-09-29
|
||||
/// </summary>
|
||||
[SugarTable("sys_config", "配置表")]
|
||||
[Tenant("0")]
|
||||
public class SysConfig : SysBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 配置id
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
public int ConfigId { get; set; }
|
||||
/// <summary>
|
||||
/// 参数名称
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 100)]
|
||||
public string ConfigName { get; set; }
|
||||
/// <summary>
|
||||
/// 参数键名
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 100)]
|
||||
public string ConfigKey { get; set; }
|
||||
/// <summary>
|
||||
/// 参数键值
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 500)]
|
||||
public string ConfigValue { get; set; }
|
||||
/// <summary>
|
||||
/// 系统内置(Y是 N否)
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 1)]
|
||||
public string ConfigType { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
namespace ZR.Model.System
|
||||
{
|
||||
/// <summary>
|
||||
/// 部门表
|
||||
/// </summary>
|
||||
[SugarTable("sys_dept", "部门配置表")]
|
||||
[Tenant("0")]
|
||||
public class SysDept : SysBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 部门ID
|
||||
/// </summary>
|
||||
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
public long DeptId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 父部门ID
|
||||
/// </summary>
|
||||
public long ParentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 祖级列表
|
||||
/// </summary>
|
||||
public string Ancestors { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 部门名称
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 30, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public string DeptName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 显示顺序
|
||||
/// </summary>
|
||||
public int OrderNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 负责人
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 30)]
|
||||
public string Leader { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 联系电话
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 11)]
|
||||
public string Phone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 邮箱
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 50)]
|
||||
public string Email { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 部门状态:0正常,1停用
|
||||
/// </summary>
|
||||
[SugarColumn(DefaultValue = "0")]
|
||||
public int Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 删除标志(0代表存在 2代表删除)
|
||||
/// </summary>
|
||||
[SugarColumn(DefaultValue = "0")]
|
||||
public int DelFlag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 子菜单
|
||||
/// </summary>
|
||||
public List<SysDept> children = new();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
using SqlSugar;
|
||||
|
||||
namespace ZR.Model.System
|
||||
{
|
||||
/// <summary>
|
||||
/// 字典数据表
|
||||
/// </summary>
|
||||
[Tenant("0")]
|
||||
[SugarTable("sys_dict_data", "字典数据表")]
|
||||
public class SysDictData : SysBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 字典编码
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
public long DictCode { get; set; }
|
||||
/// <summary>
|
||||
/// 字典排序
|
||||
/// </summary>
|
||||
public int DictSort { get; set; }
|
||||
/// <summary>
|
||||
/// 字典标签
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 100, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public string DictLabel { get; set; }
|
||||
/// <summary>
|
||||
/// 字典键值
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 100, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public string DictValue { get; set; }
|
||||
/// <summary>
|
||||
/// 字典类型
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 100, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public string DictType { get; set; }
|
||||
/// <summary>
|
||||
/// 样式属性(其他样式扩展)
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 100)]
|
||||
public string CssClass { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// 表格回显样式
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 100)]
|
||||
public string ListClass { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// 是否默认(Y是 N否)
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 1, DefaultValue = "N")]
|
||||
public string IsDefault { get; set; }
|
||||
/// <summary>
|
||||
/// 状态(0正常 1停用)
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 1)]
|
||||
public string Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using SqlSugar;
|
||||
|
||||
namespace ZR.Model.System
|
||||
{
|
||||
/// <summary>
|
||||
/// 字典类型表
|
||||
/// </summary>
|
||||
[SugarTable("sys_dict_type", "字典类型表")]
|
||||
[SugarIndex("index_dict_type", nameof(DictType), OrderByType.Asc, true)]
|
||||
[Tenant("0")]
|
||||
public class SysDictType : SysBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 字典主键
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
public long DictId { get; set; }
|
||||
/// <summary>
|
||||
/// 字典名称
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 100, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public string DictName { get; set; }
|
||||
/// <summary>
|
||||
/// 字典类型
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 100, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public string DictType { get; set; }
|
||||
/// <summary>
|
||||
/// 状态 0、正常 1、停用
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 1, DefaultValue = "0")]
|
||||
public string Status { get; set; }
|
||||
/// <summary>
|
||||
/// 系统内置 Y是 N否
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 1, DefaultValue = "N")]
|
||||
public string Type { get; set; }
|
||||
/// <summary>
|
||||
/// 自定义sql
|
||||
/// </summary>
|
||||
public string CustomSql { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
using Newtonsoft.Json;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
|
||||
namespace ZR.Model.System
|
||||
{
|
||||
[Tenant("0")]
|
||||
[SugarTable("sys_file", "文件存储表")]
|
||||
public class SysFile
|
||||
{
|
||||
/// <summary>
|
||||
/// 自增id
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
/// 文件原名
|
||||
/// </summary>
|
||||
public string RealName { get; set; }
|
||||
/// <summary>
|
||||
/// 文件类型
|
||||
/// </summary>
|
||||
public string FileType { get; set; }
|
||||
/// <summary>
|
||||
/// 存储文件名
|
||||
/// </summary>
|
||||
public string FileName { get; set; }
|
||||
/// <summary>
|
||||
/// 文件存储地址 eg:/uploads/20220202
|
||||
/// </summary>
|
||||
public string FileUrl { get; set; }
|
||||
/// <summary>
|
||||
/// 仓库位置 eg:/uploads
|
||||
/// </summary>
|
||||
public string StorePath { get; set; }
|
||||
/// <summary>
|
||||
/// 文件大小
|
||||
/// </summary>
|
||||
public string FileSize { get; set; }
|
||||
/// <summary>
|
||||
/// 文件扩展名
|
||||
/// </summary>
|
||||
public string FileExt { get; set; }
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
/// </summary>
|
||||
public string Create_by { get; set; }
|
||||
/// <summary>
|
||||
/// 上传时间
|
||||
/// </summary>
|
||||
public DateTime? Create_time { get; set; }
|
||||
/// <summary>
|
||||
/// 存储类型
|
||||
/// </summary>
|
||||
public int? StoreType { get; set; }
|
||||
/// <summary>
|
||||
/// 访问路径
|
||||
/// </summary>
|
||||
public string AccessUrl { get; set; }
|
||||
|
||||
public SysFile() { }
|
||||
public SysFile(string originFileName, string fileName, string ext, string fileSize, string storePath, string create_by)
|
||||
{
|
||||
StorePath = storePath;
|
||||
RealName = originFileName;
|
||||
FileName = fileName;
|
||||
FileExt = ext;
|
||||
FileSize = fileSize;
|
||||
Create_by = create_by;
|
||||
Create_time = DateTime.Now;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
|
||||
namespace ZR.Model.System
|
||||
{
|
||||
/// <summary>
|
||||
/// sys_logininfor 表
|
||||
/// </summary>
|
||||
[SugarTable("sys_logininfor", "登录日志表")]
|
||||
[Tenant("0")]
|
||||
public class SysLogininfor
|
||||
{
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
public long InfoId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户账号
|
||||
/// </summary>
|
||||
public string UserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 登录状态 0成功 1失败
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 1, DefaultValue = "0")]
|
||||
public string Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 登录IP地址
|
||||
/// </summary>
|
||||
public string Ipaddr { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 登录地点
|
||||
/// </summary>
|
||||
public string LoginLocation { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 浏览器类型
|
||||
/// </summary>
|
||||
public string Browser { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 操作系统
|
||||
/// </summary>
|
||||
public string Os { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 提示消息
|
||||
/// </summary>
|
||||
public string Msg { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 访问时间
|
||||
/// </summary>
|
||||
public DateTime LoginTime { get; set; } = DateTime.Now;
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public DateTime? BeginTime { get; set; }
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public DateTime? EndTime { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
using SqlSugar;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ZR.Model.System
|
||||
{
|
||||
/// <summary>
|
||||
/// Sys_menu表
|
||||
/// </summary>
|
||||
[SugarTable("sys_menu", "系统菜单表")]
|
||||
[Tenant("0")]
|
||||
public class SysMenu : SysBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 菜单ID
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
public long MenuId { get; set; }
|
||||
/// <summary>
|
||||
/// 菜单名称
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 50, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public string MenuName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 父菜单ID
|
||||
/// </summary>
|
||||
[SugarColumn(DefaultValue = "0")]
|
||||
public long ParentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 显示顺序
|
||||
/// </summary>
|
||||
[SugarColumn(DefaultValue = "0")]
|
||||
public int OrderNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 路由地址
|
||||
/// </summary>
|
||||
public string Path { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// 组件路径
|
||||
/// </summary>
|
||||
public string Component { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否缓存(1缓存 0不缓存)
|
||||
/// </summary>
|
||||
[SugarColumn(DefaultValue = "0", ColumnDataType = "int")]
|
||||
public string IsCache { get; set; }
|
||||
/// <summary>
|
||||
/// 是否外链 1、是 0、否
|
||||
/// </summary>
|
||||
[SugarColumn(DefaultValue = "0", ColumnDataType = "int")]
|
||||
public string IsFrame { get; set; } = "0";
|
||||
|
||||
/// <summary>
|
||||
/// 类型(M目录 C菜单 F按钮 L链接)
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 1)]
|
||||
public string MenuType { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 显示状态(0显示 1隐藏)
|
||||
/// </summary>
|
||||
[SugarColumn(DefaultValue = "0")]
|
||||
public string Visible { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 菜单状态(0正常 1停用)
|
||||
/// </summary>
|
||||
[SugarColumn(DefaultValue = "0")]
|
||||
public string Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 权限字符串
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 100)]
|
||||
public string Perms { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 菜单图标
|
||||
/// </summary>
|
||||
[SugarColumn(DefaultValue = "#")]
|
||||
public string Icon { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// 菜单名key
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "menuName_key")]
|
||||
public string MenuNameKey { get; set; }
|
||||
/// <summary>
|
||||
/// 子菜单
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public List<SysMenu> Children { get; set; } = new List<SysMenu>();
|
||||
/// <summary>
|
||||
/// 子菜单个数
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public int SubNum { get; set; }
|
||||
/// <summary>
|
||||
/// 是否包含子节点,前端用
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public bool HasChildren
|
||||
{
|
||||
get
|
||||
{
|
||||
return SubNum > 0 || Children.Count > 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using SqlSugar;
|
||||
|
||||
namespace ZR.Model.System
|
||||
{
|
||||
/// <summary>
|
||||
/// 通知公告表
|
||||
///
|
||||
/// @author zr
|
||||
/// @date 2021-12-15
|
||||
/// </summary>
|
||||
[SugarTable("sys_notice", "通知公告表")]
|
||||
[Tenant(0)]
|
||||
public class SysNotice : SysBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 公告ID
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnName = "notice_id")]
|
||||
public int NoticeId { get; set; }
|
||||
/// <summary>
|
||||
/// 公告标题
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "notice_title", ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public string NoticeTitle { get; set; }
|
||||
/// <summary>
|
||||
/// 公告类型 (1通知 2公告)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "notice_type", ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public int NoticeType { get; set; }
|
||||
/// <summary>
|
||||
/// 公告内容
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "notice_content", ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
public string NoticeContent { get; set; }
|
||||
/// <summary>
|
||||
/// 公告状态 (0正常 1关闭)
|
||||
/// </summary>
|
||||
[SugarColumn(DefaultValue = "0", ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public int Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
using MiniExcelLibs.Attributes;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace ZR.Model.System
|
||||
{
|
||||
[SugarTable("sys_oper_log", "操作日志表")]
|
||||
[Tenant("0")]
|
||||
public class SysOperLog
|
||||
{
|
||||
/// <summary>
|
||||
/// 操作id
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
public long OperId { get; set; }
|
||||
/// <summary>
|
||||
/// 操作模块
|
||||
/// </summary>
|
||||
public string Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 业务类型(0其它 1新增 2修改 3删除 4=授权,5=导出,6=导入,7=强退,8=生成代码,9=清空数据)
|
||||
/// </summary>
|
||||
[SugarColumn(DefaultValue = "0")]
|
||||
public int BusinessType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 业务类型数组
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
[ExcelIgnore]
|
||||
public int[] BusinessTypes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 请求方法
|
||||
/// </summary>
|
||||
public string Method { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 请求方式
|
||||
/// </summary>
|
||||
public string RequestMethod { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作类别(0其它 1后台用户 2手机端用户)
|
||||
/// </summary>
|
||||
//@Excel(name = "操作类别", readConverterExp = "0=其它,1=后台用户,2=手机端用户")
|
||||
[SugarColumn(DefaultValue = "0")]
|
||||
public int OperatorType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作人员
|
||||
/// </summary>
|
||||
public string OperName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 请求url
|
||||
/// </summary>
|
||||
public string OperUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作地址
|
||||
/// </summary>
|
||||
public string OperIp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作地点
|
||||
/// </summary>
|
||||
public string OperLocation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 请求参数
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 4000)]
|
||||
public string OperParam { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 返回参数
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
||||
public string JsonResult { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作状态(0正常 1异常)
|
||||
/// </summary>
|
||||
[SugarColumn(DefaultValue = "0")]
|
||||
public int Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 错误消息
|
||||
/// </summary>
|
||||
public string ErrorMsg { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作时间
|
||||
/// </summary>
|
||||
public DateTime? OperTime { get; set; }
|
||||
/// <summary>
|
||||
/// 操作用时
|
||||
/// </summary>
|
||||
public long Elapsed { get; set; }
|
||||
public string DeptName { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using SqlSugar;
|
||||
|
||||
namespace ZR.Model.System
|
||||
{
|
||||
[SugarTable("sys_post", "岗位表")]
|
||||
[Tenant("0")]
|
||||
public class SysPost : SysBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 岗位Id
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
public long PostId { get; set; }
|
||||
[SugarColumn(ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public string PostCode { get; set; }
|
||||
[SugarColumn(ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public string PostName { get; set; }
|
||||
[SugarColumn(ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public int PostSort { get; set; }
|
||||
[SugarColumn(Length = 1)]
|
||||
public string Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
using SqlSugar;
|
||||
|
||||
namespace ZR.Model.System
|
||||
{
|
||||
/// <summary>
|
||||
/// 角色表 sys_role
|
||||
/// </summary>
|
||||
[SugarTable("sys_role", "角色表")]
|
||||
[Tenant("0")]
|
||||
public class SysRole : SysBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 角色ID
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
public long RoleId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 角色名称
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 30, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public string RoleName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 角色权限
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 100, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public string RoleKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 角色排序
|
||||
/// </summary>
|
||||
[SugarColumn(ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public int RoleSort { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 帐号状态(0正常 1停用)
|
||||
/// </summary>
|
||||
[SugarColumn(DefaultValue = "0")]
|
||||
public int Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 删除标志(0代表存在 2代表删除)
|
||||
/// </summary>
|
||||
[SugarColumn(DefaultValue = "0")]
|
||||
public int DelFlag { get; set; }
|
||||
/// <summary>
|
||||
/// 数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限))
|
||||
/// </summary>
|
||||
[SugarColumn(DefaultValue = "1")]
|
||||
public int DataScope { get; set; }
|
||||
/// <summary>
|
||||
/// 菜单树选择项是否关联显示
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "menu_check_strictly")]
|
||||
public bool MenuCheckStrictly { get; set; } = true;
|
||||
/// <summary>
|
||||
/// 部门树选择项是否关联显示
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "dept_check_strictly")]
|
||||
public bool DeptCheckStrictly { get; set; } = true;
|
||||
/// <summary>
|
||||
/// 菜单组
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public long[] MenuIds { get; set; }
|
||||
/// <summary>
|
||||
/// 部门组(数据权限)
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public long[] DeptIds { get; set; }
|
||||
/// <summary>
|
||||
/// 用户个数
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public int UserNum { get; set; }
|
||||
|
||||
public SysRole() { }
|
||||
|
||||
public SysRole(long roleId)
|
||||
{
|
||||
RoleId = roleId;
|
||||
}
|
||||
|
||||
public bool IsAdmin()
|
||||
{
|
||||
return IsAdmin(RoleId);
|
||||
}
|
||||
|
||||
public static bool IsAdmin(long roleId)
|
||||
{
|
||||
return 1 == roleId;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using SqlSugar;
|
||||
|
||||
namespace ZR.Model.System
|
||||
{
|
||||
[SugarTable("sys_role_dept", "角色部门")]
|
||||
[Tenant(0)]
|
||||
public class SysRoleDept
|
||||
{
|
||||
[SugarColumn(ExtendedAttribute = ProteryConstant.NOTNULL, IsPrimaryKey = true)]
|
||||
public long RoleId { get; set; }
|
||||
|
||||
[SugarColumn(ExtendedAttribute = ProteryConstant.NOTNULL, IsPrimaryKey = true)]
|
||||
public long DeptId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using Newtonsoft.Json;
|
||||
using SqlSugar;
|
||||
|
||||
namespace ZR.Model.System
|
||||
{
|
||||
/// <summary>
|
||||
/// 角色菜单
|
||||
/// </summary>
|
||||
[SugarTable("sys_role_menu", "角色菜单")]
|
||||
[Tenant("0")]
|
||||
public class SysRoleMenu : SysBase
|
||||
{
|
||||
[JsonProperty("roleId")]
|
||||
[SugarColumn(IsPrimaryKey = true, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public long Role_id { get; set; }
|
||||
[JsonProperty("menuId")]
|
||||
[SugarColumn(IsPrimaryKey = true, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public long Menu_id { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace ZR.Model.System
|
||||
{
|
||||
///<summary>
|
||||
///计划任务
|
||||
///</summary>
|
||||
[SugarTable("sys_tasks", "计划任务表")]
|
||||
[Tenant("0")]
|
||||
public class SysTasks : SysBase
|
||||
{
|
||||
public SysTasks()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 任务id
|
||||
/// </summary>
|
||||
[Display(Name = "任务id")]
|
||||
//[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[SugarColumn(IsPrimaryKey = true)]
|
||||
public string ID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 任务名称
|
||||
/// </summary>
|
||||
[Display(Name = "任务名称")]
|
||||
[SugarColumn(ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 任务分组
|
||||
/// </summary>
|
||||
[Display(Name = "任务分组")]
|
||||
[SugarColumn(ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public string JobGroup { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 运行时间表达式
|
||||
/// </summary>
|
||||
[Display(Name = "运行时间表达式")]
|
||||
[SugarColumn(ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public string Cron { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 程序集名称
|
||||
/// </summary>
|
||||
[Display(Name = "程序集名称")]
|
||||
[SugarColumn(ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public string AssemblyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 任务所在类
|
||||
/// </summary>
|
||||
[Display(Name = "任务所在类")]
|
||||
[SugarColumn(ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public string ClassName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 执行次数
|
||||
/// </summary>
|
||||
[Display(Name = "执行次数")]
|
||||
[SugarColumn(DefaultValue = "0", ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public int RunTimes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 开始时间
|
||||
/// </summary>
|
||||
[Display(Name = "开始时间")]
|
||||
public DateTime? BeginTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 结束时间
|
||||
/// </summary>
|
||||
[Display(Name = "结束时间")]
|
||||
public DateTime? EndTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 触发器类型(0、simple 1、cron)
|
||||
/// 默认 : 1
|
||||
/// </summary>
|
||||
[Display(Name = "触发器类型(0、simple 1、cron)")]
|
||||
[SugarColumn(ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public int TriggerType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 执行间隔时间(单位:秒)
|
||||
/// 默认 : 0
|
||||
/// </summary>
|
||||
[Display(Name = "执行间隔时间(单位:秒)")]
|
||||
[SugarColumn(ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public int IntervalSecond { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否启动
|
||||
/// </summary>
|
||||
[Display(Name = "是否启动")]
|
||||
[SugarColumn(DefaultValue = "0", ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public int IsStart { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 传入参数
|
||||
/// </summary>
|
||||
[Display(Name = "传入参数")]
|
||||
public string JobParams { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最后运行时间
|
||||
/// </summary>
|
||||
public DateTime? LastRunTime { get; set; }
|
||||
/// <summary>
|
||||
/// api执行地址
|
||||
/// </summary>
|
||||
public string ApiUrl { get; set; }
|
||||
/// <summary>
|
||||
/// 任务类型 1、程序集 2、网络请求 3、SQL语句
|
||||
/// </summary>
|
||||
[SugarColumn(DefaultValue = "1")]
|
||||
public int TaskType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SQL语句
|
||||
/// </summary>
|
||||
public string SqlText { get; set; }
|
||||
/// <summary>
|
||||
/// 网络请求方式
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 20)]
|
||||
public string RequestMethod { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
|
||||
namespace ZR.Model.System
|
||||
{
|
||||
/// <summary>
|
||||
/// 任务日志
|
||||
/// </summary>
|
||||
[SugarTable("sys_tasks_log", "任务日志表")]
|
||||
[Tenant("0")]
|
||||
public class SysTasksLog
|
||||
{
|
||||
/// <summary>
|
||||
/// 日志Id
|
||||
/// </summary>
|
||||
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
|
||||
public long JobLogId { get; set; }
|
||||
/// <summary>
|
||||
/// 任务Id
|
||||
/// </summary>
|
||||
[SugarColumn(ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public string JobId { get; set; }
|
||||
/// <summary>
|
||||
/// 任务名
|
||||
/// </summary>
|
||||
[SugarColumn(ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public string JobName { get; set; }
|
||||
/// <summary>
|
||||
/// 任务分组
|
||||
/// </summary>
|
||||
[SugarColumn(ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public string JobGroup { get; set; }
|
||||
/// <summary>
|
||||
/// 执行状态(0正常 1失败)
|
||||
/// </summary>
|
||||
[SugarColumn(DefaultValue = "0")]
|
||||
public string Status { get; set; }
|
||||
/// <summary>
|
||||
/// 异常
|
||||
/// </summary>
|
||||
public string Exception { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string JobMessage { get; set; }
|
||||
/// <summary>
|
||||
/// 调用目标字符串
|
||||
/// </summary>
|
||||
public string InvokeTarget { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public DateTime CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 执行用时,毫秒
|
||||
/// </summary>
|
||||
//[SqlSugar.SugarColumn(IsIgnore = true)]
|
||||
public double Elapsed { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
using MiniExcelLibs.Attributes;
|
||||
using Newtonsoft.Json;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ZR.Model.System
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户表
|
||||
/// </summary>
|
||||
[SugarTable("sys_user", "用户表")]
|
||||
[Tenant("0")]
|
||||
public class SysUser : SysBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户id
|
||||
/// </summary>
|
||||
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
|
||||
public long UserId { get; set; }
|
||||
/// <summary>
|
||||
/// 登录用户名
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 30, ColumnDescription = "用户账号", ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public string UserName { get; set; }
|
||||
/// <summary>
|
||||
/// 用户昵称
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 30, ColumnDescription = "用户昵称", ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public string NickName { get; set; }
|
||||
/// <summary>
|
||||
/// 用户类型(00系统用户)
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 2, ColumnDescription = "用户类型(00系统用户)", DefaultValue = "00")]
|
||||
public string UserType { get; set; } = "00";
|
||||
//[SugarColumn(IsOnlyIgnoreInsert = true)]
|
||||
public string Avatar { get; set; }
|
||||
[SugarColumn(Length = 50, ColumnDescription = "用户邮箱")]
|
||||
public string Email { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
[ExcelIgnore]
|
||||
[SugarColumn(Length = 100, ColumnDescription = "密码", ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public string Password { get; set; }
|
||||
/// <summary>
|
||||
/// 手机号
|
||||
/// </summary>
|
||||
public string Phonenumber { get; set; }
|
||||
/// <summary>
|
||||
/// 用户性别(0男 1女 2未知)
|
||||
/// </summary>
|
||||
public int Sex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 帐号状态(0正常 1停用)
|
||||
/// </summary>
|
||||
[ExcelIgnore]
|
||||
[SugarColumn(DefaultValue = "0")]
|
||||
public int Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 删除标志(0代表存在 2代表删除)
|
||||
/// </summary>
|
||||
[SugarColumn(DefaultValue = "0")]
|
||||
public int DelFlag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最后登录IP
|
||||
/// </summary>
|
||||
[SugarColumn(IsOnlyIgnoreInsert = true)]
|
||||
public string LoginIP { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最后登录时间
|
||||
/// </summary>
|
||||
[SugarColumn(IsOnlyIgnoreInsert = true)]
|
||||
[ExcelColumn(Name = "登录日期", Format = "yyyy-MM-dd HH:mm:ss")]
|
||||
public DateTime? LoginDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 部门Id
|
||||
/// </summary>
|
||||
[SugarColumn(DefaultValue = "0")]
|
||||
public long DeptId { get; set; }
|
||||
|
||||
#region 表额外字段
|
||||
public bool IsAdmin()
|
||||
{
|
||||
return IsAdmin(UserId);
|
||||
}
|
||||
public static bool IsAdmin(long userId)
|
||||
{
|
||||
return 1 == userId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 拥有角色个数
|
||||
/// </summary>
|
||||
//[SugarColumn(IsIgnore = true)]
|
||||
//public int RoleNum { get; set; }
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public string DeptName { get; set; }
|
||||
/// <summary>
|
||||
/// 角色id集合
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
[ExcelIgnore]
|
||||
public long[] RoleIds { get; set; }
|
||||
/// <summary>
|
||||
/// 岗位集合
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
[ExcelIgnore]
|
||||
public int[] PostIds { get; set; }
|
||||
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
[ExcelIgnore]
|
||||
public List<SysRole> Roles { get; set; }
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public string WelcomeMessage
|
||||
{
|
||||
get
|
||||
{
|
||||
int now = DateTime.Now.Hour;
|
||||
|
||||
if (now > 0 && now <= 6)
|
||||
{
|
||||
return "午夜好";
|
||||
}
|
||||
else if (now > 6 && now <= 11)
|
||||
{
|
||||
return "早上好";
|
||||
}
|
||||
else if (now > 11 && now <= 14)
|
||||
{
|
||||
return "中午好";
|
||||
}
|
||||
else if (now > 14 && now <= 18)
|
||||
{
|
||||
return "下午好";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "晚上好";
|
||||
}
|
||||
}
|
||||
}
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public string WelcomeContent { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using SqlSugar;
|
||||
|
||||
namespace ZR.Model.System
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户岗位
|
||||
/// </summary>
|
||||
[SugarTable("sys_user_post", "用户与岗位关联表")]
|
||||
[Tenant("0")]
|
||||
public class SysUserPost
|
||||
{
|
||||
[SugarColumn(IsPrimaryKey = true, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public long UserId { get; set; }
|
||||
[SugarColumn(IsPrimaryKey = true, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||
public long PostId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using SqlSugar;
|
||||
|
||||
namespace ZR.Model.System
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户角色关联表 用户N-1 角色
|
||||
/// </summary>
|
||||
[SugarTable("sys_user_role", "用户和角色关联表")]
|
||||
[Tenant("0")]
|
||||
public class SysUserRole
|
||||
{
|
||||
[SugarColumn(ColumnName = "user_id", IsPrimaryKey = true)]
|
||||
public long UserId { get; set; }
|
||||
|
||||
[SugarColumn(ColumnName = "role_id", IsPrimaryKey = true)]
|
||||
public long RoleId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
namespace ZR.Model.System
|
||||
{
|
||||
public class UserConstants
|
||||
{
|
||||
/// <summary>
|
||||
/// 平台内系统用户的唯一标志
|
||||
/// </summary>
|
||||
public static string SYS_USER = "SYS_USER";
|
||||
|
||||
/// <summary>
|
||||
/// 正常状态
|
||||
/// </summary>
|
||||
public static string NORMAL = "0";
|
||||
|
||||
/// <summary>
|
||||
/// 异常状态
|
||||
/// </summary>
|
||||
public static string EXCEPTION = "1";
|
||||
|
||||
/// <summary>
|
||||
/// 用户封禁状态
|
||||
/// </summary>
|
||||
public static string USER_DISABLE = "1";
|
||||
|
||||
/// <summary>
|
||||
/// 角色封禁状态
|
||||
/// </summary>
|
||||
public static string ROLE_DISABLE = "1";
|
||||
|
||||
/// <summary>
|
||||
/// 部门正常状态
|
||||
/// </summary>
|
||||
public static int DEPT_NORMAL = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 部门停用状态
|
||||
/// </summary>
|
||||
public static string DEPT_DISABLE = "1";
|
||||
|
||||
/// <summary>
|
||||
/// 字典正常状态
|
||||
/// </summary>
|
||||
public static string DICT_NORMAL = "0";
|
||||
|
||||
/// <summary>
|
||||
/// 是否为系统默认(是)
|
||||
/// </summary>
|
||||
public static string YES = "Y";
|
||||
|
||||
/// <summary>
|
||||
/// 是否菜单外链(是)
|
||||
/// </summary>
|
||||
public static string YES_FRAME = "1";
|
||||
|
||||
/// <summary>
|
||||
/// 是否菜单外链(否)
|
||||
/// </summary>
|
||||
public static string NO_FRAME = "0";
|
||||
|
||||
/// <summary>
|
||||
/// 菜单类型(目录)
|
||||
/// </summary>
|
||||
public static string TYPE_DIR = "M";
|
||||
|
||||
/// <summary>
|
||||
/// 菜单类型(菜单)
|
||||
/// </summary>
|
||||
public static string TYPE_MENU = "C";
|
||||
|
||||
/// <summary>
|
||||
/// 菜单类型(按钮)
|
||||
/// </summary>
|
||||
public static string TYPE_BUTTON = "F";
|
||||
|
||||
///// <summary>
|
||||
///// 菜单类型(链接)
|
||||
///// </summary>
|
||||
//public static string TYPE_LINK = "L";
|
||||
|
||||
/// <summary>
|
||||
/// Layout组件标识
|
||||
/// </summary>
|
||||
public static string LAYOUT = "Layout";
|
||||
|
||||
/// <summary>
|
||||
/// ParentView组件标识
|
||||
/// </summary>
|
||||
public static string PARENT_VIEW = "ParentView";
|
||||
|
||||
/// <summary>
|
||||
/// InnerLink组件标识
|
||||
/// </summary>
|
||||
public static string INNER_LINK = "InnerLink";
|
||||
|
||||
/// <summary>
|
||||
/// 校验返回结果码
|
||||
/// </summary>
|
||||
public static string UNIQUE = "0";
|
||||
public static string NOT_UNIQUE = "1";
|
||||
|
||||
/// <summary>
|
||||
/// http请求
|
||||
/// </summary>
|
||||
public static string HTTP = "http://";
|
||||
|
||||
/// <summary>
|
||||
/// https请求
|
||||
/// </summary>
|
||||
public static string HTTPS = "https://";
|
||||
/// <summary>
|
||||
/// www主域
|
||||
/// </summary>
|
||||
public static string WWW = "www.";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ZR.Model.System.Vo
|
||||
{
|
||||
/// <summary>
|
||||
/// 路由展示
|
||||
/// </summary>
|
||||
public class RouterVo
|
||||
{
|
||||
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
|
||||
public bool AlwaysShow { get; set; }
|
||||
private string component;
|
||||
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
|
||||
public bool Hidden { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Path { get; set; }
|
||||
public string Redirect { get; set; }
|
||||
public Meta Meta { get; set; }
|
||||
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
|
||||
public List<RouterVo> Children { get; set; }
|
||||
public string Component { get => component; set => component = value; }
|
||||
}
|
||||
|
||||
public class Meta
|
||||
{
|
||||
/// <summary>
|
||||
/// 设置该路由在侧边栏和面包屑中展示的名字
|
||||
/// </summary>
|
||||
public string Title { get; set; }
|
||||
/// <summary>
|
||||
/// 设置该路由的图标,对应路径src/assets/icons/svg
|
||||
/// </summary>
|
||||
public string Icon { get; set; }
|
||||
/// <summary>
|
||||
/// 设置为true,则不会被 <keep-alive>缓存
|
||||
/// </summary>
|
||||
public bool NoCache { get; set; }
|
||||
public string TitleKey { get; set; } = string.Empty;
|
||||
public string Link { get; set; } = string.Empty;
|
||||
public int IsNew { get; set; }
|
||||
|
||||
public Meta(string title, string icon)
|
||||
{
|
||||
Title = title;
|
||||
Icon = icon;
|
||||
}
|
||||
public Meta(string title, string icon, string path)
|
||||
{
|
||||
Title = title;
|
||||
Icon = icon;
|
||||
Link = path;
|
||||
}
|
||||
public Meta(string title, string icon, bool noCache, string titleKey, string path, DateTime addTime)
|
||||
{
|
||||
Title = title;
|
||||
Icon = icon;
|
||||
NoCache = noCache;
|
||||
TitleKey = titleKey;
|
||||
if (!string.IsNullOrEmpty(path) && (path.StartsWith(UserConstants.HTTP) || path.StartsWith(UserConstants.HTTPS)))
|
||||
{
|
||||
Link = path;
|
||||
}
|
||||
if (addTime != DateTime.MinValue)
|
||||
{
|
||||
TimeSpan ts = DateTime.Now - addTime;
|
||||
if (ts.Days < 7)
|
||||
{
|
||||
IsNew = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
namespace ZR.Model.System.Vo
|
||||
{
|
||||
/// <summary>
|
||||
/// Treeselect树结构实体类
|
||||
/// </summary>
|
||||
public class TreeSelectVo
|
||||
{
|
||||
/// <summary>
|
||||
/// 节点Id
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
/// 节点名称
|
||||
/// </summary>
|
||||
public string Label { get; set; }
|
||||
public string Status { get; set; }
|
||||
public string MenuType { get; set; }
|
||||
|
||||
public TreeSelectVo() { }
|
||||
|
||||
public TreeSelectVo(SysMenu menu)
|
||||
{
|
||||
Id = menu.MenuId;
|
||||
Label = menu.MenuName;
|
||||
Status = menu.Status;
|
||||
MenuType = menu.MenuType;
|
||||
|
||||
List<TreeSelectVo> child = new List<TreeSelectVo>();
|
||||
foreach (var item in menu.Children)
|
||||
{
|
||||
child.Add(new TreeSelectVo(item));
|
||||
}
|
||||
|
||||
Children = child;
|
||||
}
|
||||
|
||||
public TreeSelectVo(SysDept dept)
|
||||
{
|
||||
Id = dept.DeptId;
|
||||
Label = dept.DeptName;
|
||||
|
||||
//menu.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); java写法
|
||||
List<TreeSelectVo> child = new List<TreeSelectVo>();
|
||||
foreach (var item in dept.children)
|
||||
{
|
||||
child.Add(new TreeSelectVo(item));
|
||||
}
|
||||
|
||||
Children = child;
|
||||
}
|
||||
|
||||
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
|
||||
public List<TreeSelectVo> Children { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user