✨ codeFirst实体建表
This commit is contained in:
parent
628df80df7
commit
b96edfdac7
375
Infrastructure/Helper/XmlCommentHelper.cs
Normal file
375
Infrastructure/Helper/XmlCommentHelper.cs
Normal file
@ -0,0 +1,375 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Xml.XPath;
|
||||||
|
|
||||||
|
namespace Infrastructure.Helper
|
||||||
|
{
|
||||||
|
public class XmlCommentHelper
|
||||||
|
{
|
||||||
|
private static Regex RefTagPattern = new Regex(@"<(see|paramref) (name|cref)=""([TPF]{1}:)?(?<display>.+?)"" ?/>");
|
||||||
|
private static Regex CodeTagPattern = new Regex(@"<c>(?<display>.+?)</c>");
|
||||||
|
private static Regex ParaTagPattern = new Regex(@"<para>(?<display>.+?)</para>", RegexOptions.Singleline);
|
||||||
|
|
||||||
|
List<XPathNavigator> navigators = new List<XPathNavigator>();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 从当前dll文件中加载所有的xml文件
|
||||||
|
/// </summary>
|
||||||
|
public void LoadAll()
|
||||||
|
{
|
||||||
|
var files = Directory.GetFiles(Directory.GetCurrentDirectory());
|
||||||
|
foreach (var file in files)
|
||||||
|
{
|
||||||
|
if (string.Equals(Path.GetExtension(file), ".xml", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
Load(file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 从xml中加载
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="xmls"></param>
|
||||||
|
public void LoadXml(params string[] xmls)
|
||||||
|
{
|
||||||
|
foreach (var xml in xmls)
|
||||||
|
{
|
||||||
|
Load(new MemoryStream(Encoding.UTF8.GetBytes(xml)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 从文件中加载
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="xmlFiles"></param>
|
||||||
|
public void Load(params string[] xmlFiles)
|
||||||
|
{
|
||||||
|
foreach (var xmlFile in xmlFiles)
|
||||||
|
{
|
||||||
|
var doc = new XPathDocument(xmlFile);
|
||||||
|
navigators.Add(doc.CreateNavigator());
|
||||||
|
|
||||||
|
//Console.WriteLine("加载xml文件=" + xmlFile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 从流中加载
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="streams"></param>
|
||||||
|
public void Load(params Stream[] streams)
|
||||||
|
{
|
||||||
|
foreach (var stream in streams)
|
||||||
|
{
|
||||||
|
var doc = new XPathDocument(stream);
|
||||||
|
navigators.Add(doc.CreateNavigator());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 读取类型中的注释
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="type">类型</param>
|
||||||
|
/// <param name="xPath">注释路径</param>
|
||||||
|
/// <param name="humanize">可读性优化(比如:去掉xml标记)</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string GetTypeComment(Type type, string xPath = "summary", bool humanize = true)
|
||||||
|
{
|
||||||
|
var typeMemberName = GetMemberNameForType(type);
|
||||||
|
return GetComment(typeMemberName, xPath, humanize);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 读取字段或者属性的注释
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="fieldOrPropertyInfo">字段或者属性</param>
|
||||||
|
/// <param name="xPath">注释路径</param>
|
||||||
|
/// <param name="humanize">可读性优化(比如:去掉xml标记)</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string GetFieldOrPropertyComment(MemberInfo fieldOrPropertyInfo, string xPath = "summary", bool humanize = true)
|
||||||
|
{
|
||||||
|
var fieldOrPropertyMemberName = GetMemberNameForFieldOrProperty(fieldOrPropertyInfo);
|
||||||
|
return GetComment(fieldOrPropertyMemberName, xPath, humanize);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 读取方法中的注释
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="methodInfo">方法</param>
|
||||||
|
/// <param name="xPath">注释路径</param>
|
||||||
|
/// <param name="humanize">可读性优化(比如:去掉xml标记)</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string GetMethodComment(MethodInfo methodInfo, string xPath = "summary", bool humanize = true)
|
||||||
|
{
|
||||||
|
var methodMemberName = GetMemberNameForMethod(methodInfo);
|
||||||
|
return GetComment(methodMemberName, xPath, humanize);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 读取方法中的返回值注释
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="methodInfo">方法</param>
|
||||||
|
/// <param name="humanize">可读性优化(比如:去掉xml标记)</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string GetMethodReturnComment(MethodInfo methodInfo, bool humanize = true)
|
||||||
|
{
|
||||||
|
return GetMethodComment(methodInfo, "returns", humanize);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 读取参数的注释
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="parameterInfo">参数</param>
|
||||||
|
/// <param name="humanize">可读性优化(比如:去掉xml标记)</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string GetParameterComment(ParameterInfo parameterInfo, bool humanize = true)
|
||||||
|
{
|
||||||
|
if (!(parameterInfo.Member is MethodInfo methodInfo)) return string.Empty;
|
||||||
|
|
||||||
|
var methodMemberName = GetMemberNameForMethod(methodInfo);
|
||||||
|
return GetComment(methodMemberName, $"param[@name='{parameterInfo.Name}']", humanize);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 读取方法的所有参数的注释
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="methodInfo">方法</param>
|
||||||
|
/// <param name="humanize">可读性优化(比如:去掉xml标记)</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Dictionary<string, string> GetParameterComments(MethodInfo methodInfo, bool humanize = true)
|
||||||
|
{
|
||||||
|
var parameterInfos = methodInfo.GetParameters();
|
||||||
|
Dictionary<string, string> dict = new Dictionary<string, string>();
|
||||||
|
foreach (var parameterInfo in parameterInfos)
|
||||||
|
{
|
||||||
|
dict[parameterInfo.Name] = GetParameterComment(parameterInfo, humanize);
|
||||||
|
}
|
||||||
|
return dict;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 读取指定名称节点的注释
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="name">节点名称</param>
|
||||||
|
/// <param name="xPath">注释路径</param>
|
||||||
|
/// <param name="humanize">可读性优化(比如:去掉xml标记)</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string GetComment(string name, string xPath, bool humanize = true)
|
||||||
|
{
|
||||||
|
foreach (var _xmlNavigator in navigators)
|
||||||
|
{
|
||||||
|
var typeSummaryNode = _xmlNavigator.SelectSingleNode($"/doc/members/member[@name='{name}']/{xPath.Trim('/', '\\')}");
|
||||||
|
|
||||||
|
if (typeSummaryNode != null)
|
||||||
|
{
|
||||||
|
return humanize ? Humanize(typeSummaryNode.InnerXml) : typeSummaryNode.InnerXml;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 读取指定节点的summary注释
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="name">节点名称</param>
|
||||||
|
/// <param name="humanize">可读性优化(比如:去掉xml标记)</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string GetSummary(string name, bool humanize = true)
|
||||||
|
{
|
||||||
|
return GetComment(name, "summary", humanize);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 读取指定节点的example注释
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="name">节点名称</param>
|
||||||
|
/// <param name="humanize">可读性优化(比如:去掉xml标记)</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string GetExample(string name, bool humanize = true)
|
||||||
|
{
|
||||||
|
return GetComment(name, "example", humanize);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 获取方法的节点名称
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="method"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string GetMemberNameForMethod(MethodInfo method)
|
||||||
|
{
|
||||||
|
var builder = new StringBuilder("M:");
|
||||||
|
|
||||||
|
builder.Append(QualifiedNameFor(method.DeclaringType));
|
||||||
|
builder.Append($".{method.Name}");
|
||||||
|
|
||||||
|
var parameters = method.GetParameters();
|
||||||
|
if (parameters.Any())
|
||||||
|
{
|
||||||
|
var parametersNames = parameters.Select(p =>
|
||||||
|
{
|
||||||
|
return p.ParameterType.IsGenericParameter
|
||||||
|
? $"`{p.ParameterType.GenericParameterPosition}"
|
||||||
|
: QualifiedNameFor(p.ParameterType, expandGenericArgs: true);
|
||||||
|
});
|
||||||
|
builder.Append($"({string.Join(",", parametersNames)})");
|
||||||
|
}
|
||||||
|
|
||||||
|
return builder.ToString();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 获取类型的节点名称
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="type"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string GetMemberNameForType(Type type)
|
||||||
|
{
|
||||||
|
var builder = new StringBuilder("T:");
|
||||||
|
builder.Append(QualifiedNameFor(type));
|
||||||
|
|
||||||
|
return builder.ToString();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 获取字段或者属性的节点名称
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="fieldOrPropertyInfo"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string GetMemberNameForFieldOrProperty(MemberInfo fieldOrPropertyInfo)
|
||||||
|
{
|
||||||
|
var builder = new StringBuilder(((fieldOrPropertyInfo.MemberType & MemberTypes.Field) != 0) ? "F:" : "P:");
|
||||||
|
builder.Append(QualifiedNameFor(fieldOrPropertyInfo.DeclaringType));
|
||||||
|
builder.Append($".{fieldOrPropertyInfo.Name}");
|
||||||
|
|
||||||
|
return builder.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private string QualifiedNameFor(Type type, bool expandGenericArgs = false)
|
||||||
|
{
|
||||||
|
if (type.IsArray)
|
||||||
|
return $"{QualifiedNameFor(type.GetElementType(), expandGenericArgs)}[]";
|
||||||
|
|
||||||
|
var builder = new StringBuilder();
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(type.Namespace))
|
||||||
|
builder.Append($"{type.Namespace}.");
|
||||||
|
|
||||||
|
if (type.IsNested)
|
||||||
|
{
|
||||||
|
builder.Append($"{string.Join(".", GetNestedTypeNames(type))}.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type.IsConstructedGenericType && expandGenericArgs)
|
||||||
|
{
|
||||||
|
var nameSansGenericArgs = type.Name.Split('`').First();
|
||||||
|
builder.Append(nameSansGenericArgs);
|
||||||
|
|
||||||
|
var genericArgsNames = type.GetGenericArguments().Select(t =>
|
||||||
|
{
|
||||||
|
return t.IsGenericParameter
|
||||||
|
? $"`{t.GenericParameterPosition}"
|
||||||
|
: QualifiedNameFor(t, true);
|
||||||
|
});
|
||||||
|
|
||||||
|
builder.Append($"{{{string.Join(",", genericArgsNames)}}}");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
builder.Append(type.Name);
|
||||||
|
}
|
||||||
|
|
||||||
|
return builder.ToString();
|
||||||
|
}
|
||||||
|
private IEnumerable<string> GetNestedTypeNames(Type type)
|
||||||
|
{
|
||||||
|
if (!type.IsNested || type.DeclaringType == null) yield break;
|
||||||
|
|
||||||
|
foreach (var nestedTypeName in GetNestedTypeNames(type.DeclaringType))
|
||||||
|
{
|
||||||
|
yield return nestedTypeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
yield return type.DeclaringType.Name;
|
||||||
|
}
|
||||||
|
private string Humanize(string text)
|
||||||
|
{
|
||||||
|
if (text == null)
|
||||||
|
throw new ArgumentNullException("text");
|
||||||
|
|
||||||
|
//Call DecodeXml at last to avoid entities like < and > to break valid xml
|
||||||
|
text = NormalizeIndentation(text);
|
||||||
|
text = HumanizeRefTags(text);
|
||||||
|
text = HumanizeCodeTags(text);
|
||||||
|
text = HumanizeParaTags(text);
|
||||||
|
text = DecodeXml(text);
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
private string NormalizeIndentation(string text)
|
||||||
|
{
|
||||||
|
string[] lines = text.Split('\n');
|
||||||
|
string padding = GetCommonLeadingWhitespace(lines);
|
||||||
|
|
||||||
|
int padLen = padding == null ? 0 : padding.Length;
|
||||||
|
|
||||||
|
// remove leading padding from each line
|
||||||
|
for (int i = 0, l = lines.Length; i < l; ++i)
|
||||||
|
{
|
||||||
|
string line = lines[i].TrimEnd('\r'); // remove trailing '\r'
|
||||||
|
|
||||||
|
if (padLen != 0 && line.Length >= padLen && line.Substring(0, padLen) == padding)
|
||||||
|
line = line.Substring(padLen);
|
||||||
|
|
||||||
|
lines[i] = line;
|
||||||
|
}
|
||||||
|
|
||||||
|
// remove leading empty lines, but not all leading padding
|
||||||
|
// remove all trailing whitespace, regardless
|
||||||
|
return string.Join("\r\n", lines.SkipWhile(x => string.IsNullOrWhiteSpace(x))).TrimEnd();
|
||||||
|
}
|
||||||
|
private string GetCommonLeadingWhitespace(string[] lines)
|
||||||
|
{
|
||||||
|
if (null == lines)
|
||||||
|
throw new ArgumentException("lines");
|
||||||
|
|
||||||
|
if (lines.Length == 0)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
string[] nonEmptyLines = lines
|
||||||
|
.Where(x => !string.IsNullOrWhiteSpace(x))
|
||||||
|
.ToArray();
|
||||||
|
|
||||||
|
if (nonEmptyLines.Length < 1)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
int padLen = 0;
|
||||||
|
|
||||||
|
// use the first line as a seed, and see what is shared over all nonEmptyLines
|
||||||
|
string seed = nonEmptyLines[0];
|
||||||
|
for (int i = 0, l = seed.Length; i < l; ++i)
|
||||||
|
{
|
||||||
|
if (!char.IsWhiteSpace(seed, i))
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (nonEmptyLines.Any(line => line[i] != seed[i]))
|
||||||
|
break;
|
||||||
|
|
||||||
|
++padLen;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (padLen > 0)
|
||||||
|
return seed.Substring(0, padLen);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
private string HumanizeRefTags(string text)
|
||||||
|
{
|
||||||
|
return RefTagPattern.Replace(text, (match) => match.Groups["display"].Value);
|
||||||
|
}
|
||||||
|
private string HumanizeCodeTags(string text)
|
||||||
|
{
|
||||||
|
return CodeTagPattern.Replace(text, (match) => "{" + match.Groups["display"].Value + "}");
|
||||||
|
}
|
||||||
|
private string HumanizeParaTags(string text)
|
||||||
|
{
|
||||||
|
return ParaTagPattern.Replace(text, (match) => "<br>" + match.Groups["display"].Value);
|
||||||
|
}
|
||||||
|
private string DecodeXml(string text)
|
||||||
|
{
|
||||||
|
return System.Net.WebUtility.HtmlDecode(text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -58,16 +58,16 @@ namespace ZR.Admin.WebApi.Controllers.System
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 添加角色
|
/// 添加角色
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sysRoleDto"></param>
|
/// <param name="dto"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[ActionPermissionFilter(Permission = "system:role:add")]
|
[ActionPermissionFilter(Permission = "system:role:add")]
|
||||||
[Log(Title = "角色管理", BusinessType = BusinessType.INSERT)]
|
[Log(Title = "角色管理", BusinessType = BusinessType.INSERT)]
|
||||||
[Route("edit")]
|
[Route("edit")]
|
||||||
public IActionResult RoleAdd([FromBody] SysRole sysRoleDto)
|
public IActionResult RoleAdd([FromBody] SysRoleDto dto)
|
||||||
{
|
{
|
||||||
if (sysRoleDto == null) return ToResponse(ApiResult.Error(101, "请求参数错误"));
|
if (dto == null) return ToResponse(ApiResult.Error(101, "请求参数错误"));
|
||||||
|
SysRole sysRoleDto = dto.Adapt<SysRole>();
|
||||||
if (UserConstants.NOT_UNIQUE.Equals(sysRoleService.CheckRoleKeyUnique(sysRoleDto)))
|
if (UserConstants.NOT_UNIQUE.Equals(sysRoleService.CheckRoleKeyUnique(sysRoleDto)))
|
||||||
{
|
{
|
||||||
return ToResponse(ApiResult.Error((int)ResultCode.CUSTOM_ERROR, $"新增角色'{sysRoleDto.RoleName}'失败,角色权限已存在"));
|
return ToResponse(ApiResult.Error((int)ResultCode.CUSTOM_ERROR, $"新增角色'{sysRoleDto.RoleName}'失败,角色权限已存在"));
|
||||||
@ -82,18 +82,19 @@ namespace ZR.Admin.WebApi.Controllers.System
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 修改角色
|
/// 修改角色
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sysRoleDto"></param>
|
/// <param name="dto"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPut]
|
[HttpPut]
|
||||||
[ActionPermissionFilter(Permission = "system:role:edit")]
|
[ActionPermissionFilter(Permission = "system:role:edit")]
|
||||||
[Log(Title = "角色管理", BusinessType = BusinessType.UPDATE)]
|
[Log(Title = "角色管理", BusinessType = BusinessType.UPDATE)]
|
||||||
[Route("edit")]
|
[Route("edit")]
|
||||||
public IActionResult RoleEdit([FromBody] SysRole sysRoleDto)
|
public IActionResult RoleEdit([FromBody] SysRoleDto dto)
|
||||||
{
|
{
|
||||||
if (sysRoleDto == null || sysRoleDto.RoleId <= 0 || string.IsNullOrEmpty(sysRoleDto.RoleKey))
|
if (dto == null || dto.RoleId <= 0 || string.IsNullOrEmpty(dto.RoleKey))
|
||||||
{
|
{
|
||||||
return ToResponse(ApiResult.Error(101, "请求参数错误"));
|
return ToResponse(ApiResult.Error(101, "请求参数错误"));
|
||||||
}
|
}
|
||||||
|
SysRole sysRoleDto = dto.Adapt<SysRole>();
|
||||||
sysRoleService.CheckRoleAllowed(sysRoleDto);
|
sysRoleService.CheckRoleAllowed(sysRoleDto);
|
||||||
var info = sysRoleService.SelectRoleById(sysRoleDto.RoleId);
|
var info = sysRoleService.SelectRoleById(sysRoleDto.RoleId);
|
||||||
if (info != null && info.RoleKey != sysRoleDto.RoleKey)
|
if (info != null && info.RoleKey != sysRoleDto.RoleKey)
|
||||||
|
|||||||
@ -9,6 +9,7 @@ using ZR.Admin.WebApi.Extensions;
|
|||||||
using ZR.Admin.WebApi.Filters;
|
using ZR.Admin.WebApi.Filters;
|
||||||
using ZR.Model;
|
using ZR.Model;
|
||||||
using ZR.Model.System;
|
using ZR.Model.System;
|
||||||
|
using ZR.Model.System.Dto;
|
||||||
using ZR.Service.System.IService;
|
using ZR.Service.System.IService;
|
||||||
|
|
||||||
namespace ZR.Admin.WebApi.Controllers.System
|
namespace ZR.Admin.WebApi.Controllers.System
|
||||||
@ -44,7 +45,7 @@ namespace ZR.Admin.WebApi.Controllers.System
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[ActionPermissionFilter(Permission = "system:user:list")]
|
[ActionPermissionFilter(Permission = "system:user:list")]
|
||||||
[HttpGet("list")]
|
[HttpGet("list")]
|
||||||
public IActionResult List([FromQuery] SysUser user, PagerInfo pager)
|
public IActionResult List([FromQuery] SysUserQueryDto user, PagerInfo pager)
|
||||||
{
|
{
|
||||||
var list = UserService.SelectUserList(user, pager);
|
var list = UserService.SelectUserList(user, pager);
|
||||||
|
|
||||||
@ -208,7 +209,7 @@ namespace ZR.Admin.WebApi.Controllers.System
|
|||||||
[HttpGet("export")]
|
[HttpGet("export")]
|
||||||
[Log(Title = "用户导出", BusinessType = BusinessType.EXPORT)]
|
[Log(Title = "用户导出", BusinessType = BusinessType.EXPORT)]
|
||||||
[ActionPermissionFilter(Permission = "system:user:export")]
|
[ActionPermissionFilter(Permission = "system:user:export")]
|
||||||
public IActionResult UserExport([FromQuery] SysUser user)
|
public IActionResult UserExport([FromQuery] SysUserQueryDto user)
|
||||||
{
|
{
|
||||||
var list = UserService.SelectUserList(user, new PagerInfo(1, 10000));
|
var list = UserService.SelectUserList(user, new PagerInfo(1, 10000));
|
||||||
|
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
using Infrastructure;
|
using Infrastructure;
|
||||||
|
using Infrastructure.Extensions;
|
||||||
using Infrastructure.Helper;
|
using Infrastructure.Helper;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using SqlSugar.IOC;
|
using SqlSugar.IOC;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using ZR.Admin.WebApi.Framework;
|
using ZR.Admin.WebApi.Framework;
|
||||||
|
using ZR.Model;
|
||||||
using ZR.Model.System;
|
using ZR.Model.System;
|
||||||
|
|
||||||
namespace ZR.Admin.WebApi.Extensions
|
namespace ZR.Admin.WebApi.Extensions
|
||||||
@ -22,12 +24,16 @@ namespace ZR.Admin.WebApi.Extensions
|
|||||||
//仅本人数据权限
|
//仅本人数据权限
|
||||||
public static long DATA_SCOPE_SELF = 5;
|
public static long DATA_SCOPE_SELF = 5;
|
||||||
|
|
||||||
|
private static XmlCommentHelper commentHelper = new XmlCommentHelper();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 初始化db
|
/// 初始化db
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="services"></param>
|
||||||
/// <param name="Configuration"></param>
|
/// <param name="Configuration"></param>
|
||||||
public static void AddDb(this IServiceCollection services, IConfiguration Configuration)
|
public static void AddDb(this IServiceCollection services, IConfiguration Configuration)
|
||||||
{
|
{
|
||||||
|
commentHelper.LoadAll();
|
||||||
List<DbConfigs> dbConfigs = Configuration.GetSection("DbConfigs").Get<List<DbConfigs>>();
|
List<DbConfigs> dbConfigs = Configuration.GetSection("DbConfigs").Get<List<DbConfigs>>();
|
||||||
|
|
||||||
var iocList = new List<IocConfig>();
|
var iocList = new List<IocConfig>();
|
||||||
@ -110,11 +116,43 @@ namespace ZR.Admin.WebApi.Extensions
|
|||||||
DataInfoCacheService = cache,
|
DataInfoCacheService = cache,
|
||||||
EntityService = (c, p) =>
|
EntityService = (c, p) =>
|
||||||
{
|
{
|
||||||
if (db.GetConnectionScope(configId).CurrentConnectionConfig.DbType == DbType.PostgreSQL && p.DataType != null && p.DataType.Contains("nvarchar"))
|
p.DbTableName = p.DbTableName.FirstLowerCase();
|
||||||
|
p.DbColumnName = p.DbColumnName.FirstLowerCase();
|
||||||
|
var des = commentHelper.GetFieldOrPropertyComment(c);
|
||||||
|
if (des.IsNotEmpty())
|
||||||
|
{
|
||||||
|
p.ColumnDescription = des;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (db.GetConnectionScope(configId).CurrentConnectionConfig.DbType == DbType.PostgreSQL)
|
||||||
|
{
|
||||||
|
if (p.DataType != null && p.DataType.Contains("nvarchar"))
|
||||||
{
|
{
|
||||||
p.DataType = "text";
|
p.DataType = "text";
|
||||||
}
|
}
|
||||||
|
if (c.Name == nameof(SysMenu.IsCache) || c.Name == nameof(SysMenu.IsFrame))
|
||||||
|
{
|
||||||
|
p.DataType = "char(1)";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (p.IsPrimarykey == true)//主键不能为null
|
||||||
|
{
|
||||||
|
p.IsNullable = false;
|
||||||
|
}
|
||||||
|
else if (p.ExtendedAttribute?.ToString() == ProteryConstant.NOTNULL.ToString())
|
||||||
|
{
|
||||||
|
p.IsNullable = false;
|
||||||
|
}
|
||||||
|
else//则否默认为null
|
||||||
|
{
|
||||||
|
p.IsNullable = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
db.GetConnectionScope(configId).Aop.DataExecuting = (oldValue, entiyInfo) =>
|
||||||
|
{
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,7 +168,9 @@ namespace ZR.Admin.WebApi.Extensions
|
|||||||
|
|
||||||
var baseType = typeof(SysBase);
|
var baseType = typeof(SysBase);
|
||||||
var entityes = AssemblyUtils.GetAllTypes().Where(p => !p.IsAbstract && p != baseType && /*p.IsAssignableTo(baseType) && */p.GetCustomAttribute<SugarTable>() != null).ToArray();
|
var entityes = AssemblyUtils.GetAllTypes().Where(p => !p.IsAbstract && p != baseType && /*p.IsAssignableTo(baseType) && */p.GetCustomAttribute<SugarTable>() != null).ToArray();
|
||||||
db.CodeFirst.SetStringDefaultLength(200).InitTables(entityes);
|
|
||||||
|
//23个表
|
||||||
|
db.CodeFirst.InitTables(entityes);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static object GetParsValue(SugarParameter x)
|
private static object GetParsValue(SugarParameter x)
|
||||||
|
|||||||
@ -38,7 +38,7 @@ namespace ZR.Admin.WebApi.Extensions
|
|||||||
public static void AddSwaggerConfig(this IServiceCollection services)
|
public static void AddSwaggerConfig(this IServiceCollection services)
|
||||||
{
|
{
|
||||||
if (services == null) throw new ArgumentNullException(nameof(services));
|
if (services == null) throw new ArgumentNullException(nameof(services));
|
||||||
//IWebHostEnvironment hostEnvironment = App.GetRequiredService<IWebHostEnvironment>();
|
//IWebHostEnvironment hostEnvironment = services.BuildServiceProvider().GetRequiredService<IWebHostEnvironment>();
|
||||||
|
|
||||||
services.AddSwaggerGen(c =>
|
services.AddSwaggerGen(c =>
|
||||||
{
|
{
|
||||||
@ -50,10 +50,10 @@ namespace ZR.Admin.WebApi.Extensions
|
|||||||
});
|
});
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var tempPath = "";// hostEnvironment.ContentRootPath;
|
//var tempPath = hostEnvironment.ContentRootPath;
|
||||||
//添加文档注释
|
//添加文档注释
|
||||||
c.IncludeXmlComments(Path.Combine(tempPath, "ZRAdmin.xml"), true);
|
c.IncludeXmlComments(Path.Combine("ZRAdmin.xml"), true);
|
||||||
c.IncludeXmlComments(Path.Combine(tempPath, "ZRModel.xml"), true);
|
c.IncludeXmlComments(Path.Combine("ZRModel.xml"), true);
|
||||||
//c.IncludeXmlComments(Path.Combine(Directory.GetParent(tempPath).FullName, "ZR.Model", "ZRModel.xml"), true);
|
//c.IncludeXmlComments(Path.Combine(Directory.GetParent(tempPath).FullName, "ZR.Model", "ZRModel.xml"), true);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
using Infrastructure.Model;
|
using Infrastructure.Model;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc.Filters;
|
using Microsoft.AspNetCore.Mvc.Filters;
|
||||||
using ZR.Model.System;
|
using ZR.Model.System.Dto;
|
||||||
|
|
||||||
namespace ZR.Admin.WebApi.Filters
|
namespace ZR.Admin.WebApi.Filters
|
||||||
{
|
{
|
||||||
|
|||||||
@ -9,7 +9,7 @@ using System;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using ZR.Admin.WebApi.Extensions;
|
using ZR.Admin.WebApi.Extensions;
|
||||||
using ZR.Admin.WebApi.Framework;
|
using ZR.Admin.WebApi.Framework;
|
||||||
using ZR.Model.System;
|
using ZR.Model.System.Dto;
|
||||||
|
|
||||||
namespace ZR.Admin.WebApi.Filters
|
namespace ZR.Admin.WebApi.Filters
|
||||||
{
|
{
|
||||||
|
|||||||
@ -6,7 +6,7 @@ using System.IdentityModel.Tokens.Jwt;
|
|||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using ZR.Admin.WebApi.Extensions;
|
using ZR.Admin.WebApi.Extensions;
|
||||||
using ZR.Model.System;
|
using ZR.Model.System.Dto;
|
||||||
using ZR.Service.System;
|
using ZR.Service.System;
|
||||||
|
|
||||||
namespace ZR.Admin.WebApi.Framework
|
namespace ZR.Admin.WebApi.Framework
|
||||||
|
|||||||
@ -12,6 +12,6 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="JinianNet.JNTemplate" Version="2.3.3" />
|
<PackageReference Include="JinianNet.JNTemplate" Version="2.3.3" />
|
||||||
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.1.4.73" />
|
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.1.4.84-preview01" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
9
ZR.Model/ProteryConstant.cs
Normal file
9
ZR.Model/ProteryConstant.cs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace ZR.Model
|
||||||
|
{
|
||||||
|
public enum ProteryConstant
|
||||||
|
{
|
||||||
|
NOTNULL = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -6,7 +6,7 @@ namespace ZR.Model.System
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 文章表
|
/// 文章表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("article")]
|
[SugarTable("article", "文章管理")]
|
||||||
[Tenant("0")]
|
[Tenant("0")]
|
||||||
public class Article
|
public class Article
|
||||||
{
|
{
|
||||||
@ -18,54 +18,64 @@ namespace ZR.Model.System
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 文章标题
|
/// 文章标题
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnDescription = "文章标题", Length = 254, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public string Title { get; set; }
|
public string Title { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 发布时间
|
/// 发布时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnDescription = "发布时间")]
|
||||||
public DateTime? CreateTime { get; set; }
|
public DateTime? CreateTime { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 更新时间
|
/// 更新时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(IsOnlyIgnoreInsert = true)]
|
[SugarColumn(IsOnlyIgnoreInsert = true, ColumnDescription = "更新时间")]
|
||||||
public DateTime? UpdateTime { get; set; }
|
public DateTime? UpdateTime { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 文章内容
|
/// 文章内容
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnDescription = "文章内容", ColumnDataType = "text")]
|
||||||
public string Content { get; set; }
|
public string Content { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 作者名
|
/// 作者名
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnDescription = "作者名", Length = 20, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public string AuthorName { get; set; }
|
public string AuthorName { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 发布者用户id
|
/// 发布者用户id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnDescription = "发布者用户id", ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public long UserId { get; set; }
|
public long UserId { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 文章状态 1、发布 2、草稿
|
/// 文章状态 1、发布 2、草稿
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnDescription = "文章状态 1、发布 2、草稿", Length = 20)]
|
||||||
public string Status { get; set; }
|
public string Status { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 编辑器类型 markdown,html
|
/// 编辑器类型 markdown,html
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "fmt_type")]
|
[SugarColumn(ColumnDescription = "编辑器类型markdown,html", ColumnName = "fmt_type", Length = 20, IsNullable = true)]
|
||||||
public string FmtType { get; set; }
|
public string FmtType { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 文章标签eg:Net5,java
|
/// 文章标签eg:Net5,java
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnDescription = "文章标签", Length = 20)]
|
||||||
public string Tags { get; set; }
|
public string Tags { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 点击量
|
/// 点击量
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnDescription = "点击量", DefaultValue = "0")]
|
||||||
public int Hits { get; set; }
|
public int Hits { get; set; }
|
||||||
[SugarColumn(ColumnName = "category_Id")]
|
[SugarColumn(ColumnDescription = "目录id", ColumnName = "category_Id")]
|
||||||
public int CategoryId { get; set; }
|
public int CategoryId { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 封面地址
|
/// 封面地址
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnDescription = "封面地址", Length = 255)]
|
||||||
public string CoverUrl { get; set; }
|
public string CoverUrl { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否公开 1、公开 0、不公开
|
/// 是否公开 1、公开 0、不公开
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnDescription = "是否公开 1、公开 0、不公开", DefaultValue = "0")]
|
||||||
public int IsPublic { get; set; }
|
public int IsPublic { get; set; }
|
||||||
|
|
||||||
[Navigate(NavigateType.OneToOne, nameof(CategoryId), nameof(ArticleCategory.CategoryId))] //自定义关系映射
|
[Navigate(NavigateType.OneToOne, nameof(CategoryId), nameof(ArticleCategory.CategoryId))] //自定义关系映射
|
||||||
|
|||||||
@ -8,18 +8,20 @@ namespace ZR.Model.System
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 文章目录
|
/// 文章目录
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("articleCategory")]
|
[SugarTable("articleCategory", "文章目录")]
|
||||||
[Tenant("0")]
|
[Tenant("0")]
|
||||||
public class ArticleCategory
|
public class ArticleCategory
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 目录id
|
/// 目录id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(IsPrimaryKey = true, ColumnName = "Category_id")]
|
[SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnName = "category_id")]
|
||||||
public int CategoryId { get; set; }
|
public int CategoryId { get; set; }
|
||||||
|
|
||||||
|
[SugarColumn(ColumnDescription = "目录名", Length = 20, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public int ParentId { get; set; }
|
public int? ParentId { get; set; }
|
||||||
[SugarColumn(ColumnName = "create_time", IsNullable = true)]
|
[SugarColumn(ColumnDescription = "创建时间", ColumnName = "create_time")]
|
||||||
public DateTime? CreateTime { get; set; }
|
public DateTime? CreateTime { get; set; }
|
||||||
|
|
||||||
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
|
||||||
|
|||||||
@ -9,7 +9,7 @@ namespace ZR.Model.Models
|
|||||||
/// 多语言配置,数据实体对象
|
/// 多语言配置,数据实体对象
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Tenant("0")]
|
[Tenant("0")]
|
||||||
[SugarTable("sys_common_lang")]
|
[SugarTable("sys_common_lang", "多语言配置表")]
|
||||||
public class CommonLang
|
public class CommonLang
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -23,21 +23,21 @@ namespace ZR.Model.Models
|
|||||||
/// 语言code
|
/// 语言code
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DisplayName("语言code")]
|
[DisplayName("语言code")]
|
||||||
[SugarColumn(ColumnName = "lang_code", IsNullable = false)]
|
[SugarColumn(ColumnName = "lang_code", Length = 10, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public string LangCode { get; set; }
|
public string LangCode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 语言key
|
/// 语言key
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DisplayName("语言key")]
|
[DisplayName("语言key")]
|
||||||
[SugarColumn(ColumnName = "lang_key")]
|
[SugarColumn(ColumnName = "lang_key", Length = 100, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public string LangKey { get; set; }
|
public string LangKey { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 名称
|
/// 名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DisplayName("名称")]
|
[DisplayName("名称")]
|
||||||
[SugarColumn(ColumnName = "lang_name", IsNullable = false)]
|
[SugarColumn(ColumnName = "lang_name", Length = 2000, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public string LangName { get; set; }
|
public string LangName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace ZR.Model.System
|
namespace ZR.Model.System.Dto
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 登录用户信息存储
|
/// 登录用户信息存储
|
||||||
@ -33,11 +33,11 @@ namespace ZR.Model.System.Dto
|
|||||||
/// 是否缓存(1缓存 0不缓存)
|
/// 是否缓存(1缓存 0不缓存)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Required(ErrorMessage = "是否缓存不能为空")]
|
[Required(ErrorMessage = "是否缓存不能为空")]
|
||||||
public string IsCache { get; set; }
|
public int IsCache { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否外链 1、是 0、否
|
/// 是否外链 1、是 0、否
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string IsFrame { get; set; }
|
public int IsFrame { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 类型(M目录 C菜单 F按钮 L链接)
|
/// 类型(M目录 C菜单 F按钮 L链接)
|
||||||
|
|||||||
@ -12,10 +12,15 @@ namespace ZR.Model.System.Dto
|
|||||||
public string RoleName { get; set; }
|
public string RoleName { get; set; }
|
||||||
public string RoleKey { get; set; }
|
public string RoleKey { get; set; }
|
||||||
public int RoleSort { get; set; }
|
public int RoleSort { get; set; }
|
||||||
public string Status { get; set; }
|
public int Status { get; set; }
|
||||||
|
public int DataScope { get; set; }
|
||||||
|
public int[] DeptIds { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 减少菜单集合
|
/// 减少菜单集合
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<long> DelMenuIds { get; set; } = new List<long>();
|
public List<long> DelMenuIds { get; set; } = new List<long>();
|
||||||
|
public bool MenuCheckStrictly { get; set; }
|
||||||
|
public bool DeptCheckStrictly { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
namespace ZR.Model.System.Dto
|
using System;
|
||||||
|
|
||||||
|
namespace ZR.Model.System.Dto
|
||||||
{
|
{
|
||||||
public class SysUserDto
|
public class SysUserDto
|
||||||
{
|
{
|
||||||
@ -13,4 +15,22 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public int Sex { get; set; }
|
public int Sex { 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; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,38 +1,44 @@
|
|||||||
using System.Collections.Generic;
|
using SqlSugar;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace ZR.Model.System.Generate
|
namespace ZR.Model.System.Generate
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 代码生成表
|
/// 代码生成表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SqlSugar.SugarTable("gen_table")]
|
[SugarTable("gen_table", "代码生成表")]
|
||||||
[SqlSugar.Tenant("0")]
|
[Tenant("0")]
|
||||||
public class GenTable : SysBase
|
public class GenTable : SysBase
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 表id
|
/// 表id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SqlSugar.SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||||
public int TableId { get; set; }
|
public long TableId { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 数据库名
|
/// 数据库名
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50)]
|
||||||
public string DbName { get; set; }
|
public string DbName { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 表名
|
/// 表名
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 150)]
|
||||||
public string TableName { get; set; }
|
public string TableName { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 表描述
|
/// 表描述
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 150)]
|
||||||
public string TableComment { get; set; }
|
public string TableComment { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 关联父表的表名
|
/// 关联父表的表名
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 150)]
|
||||||
public string SubTableName { get; set; }
|
public string SubTableName { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 本表关联父表的外键名
|
/// 本表关联父表的外键名
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 150)]
|
||||||
public string SubTableFkName { get; set; }
|
public string SubTableFkName { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// csharp类名
|
/// csharp类名
|
||||||
@ -41,18 +47,22 @@ namespace ZR.Model.System.Generate
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 使用的模板(crud单表操作 tree树表操作 sub主子表操作)
|
/// 使用的模板(crud单表操作 tree树表操作 sub主子表操作)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50, DefaultValue = "crud")]
|
||||||
public string TplCategory { get; set; }
|
public string TplCategory { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 基本命名空间前缀
|
/// 基本命名空间前缀
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 100)]
|
||||||
public string BaseNameSpace { get; set; }
|
public string BaseNameSpace { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 生成模块名
|
/// 生成模块名
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50)]
|
||||||
public string ModuleName { get; set; }
|
public string ModuleName { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 生成业务名
|
/// 生成业务名
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50)]
|
||||||
public string BusinessName { get; set; }
|
public string BusinessName { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 生成功能名
|
/// 生成功能名
|
||||||
@ -65,23 +75,30 @@ namespace ZR.Model.System.Generate
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 生成代码方式(0zip压缩包 1自定义路径)
|
/// 生成代码方式(0zip压缩包 1自定义路径)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 1, DefaultValue = "0")]
|
||||||
public string GenType { get; set; }
|
public string GenType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 代码生成保存路径
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 200, DefaultValue = "/")]
|
||||||
public string GenPath { get; set; }
|
public string GenPath { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 其他生成选项
|
/// 其他生成选项
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SqlSugar.SugarColumn(IsJson = true, ColumnDataType = "nvarchar(4000)")]
|
[SugarColumn(IsJson = true)]
|
||||||
public Options Options { get; set; }
|
public Options Options { get; set; }
|
||||||
|
|
||||||
#region 表额外字段
|
#region 表额外字段
|
||||||
/** 表列信息 */
|
/// <summary>
|
||||||
[SqlSugar.SugarColumn(IsIgnore = true)]
|
/// 表列信息
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsIgnore = true)]
|
||||||
public List<GenTableColumn> Columns { get; set; }
|
public List<GenTableColumn> Columns { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 字表信息
|
/// 字表信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SqlSugar.SugarColumn(IsIgnore = true)]
|
[SugarColumn(IsIgnore = true)]
|
||||||
public GenTable SubTable { get; set; }
|
public GenTable SubTable { get; set; }
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,18 +7,21 @@ namespace ZR.Model.System.Generate
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 代码生成表字段
|
/// 代码生成表字段
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("gen_table_column")]
|
[SugarTable("gen_table_column", "代码生成表字段")]
|
||||||
[Tenant("0")]
|
[Tenant("0")]
|
||||||
public class GenTableColumn : SysBase
|
public class GenTableColumn : SysBase
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 列id
|
||||||
|
/// </summary>
|
||||||
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
|
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
|
||||||
public int ColumnId { get; set; }
|
public long ColumnId { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 导入代码生成表列名 首字母转了小写
|
/// 导入代码生成表列名 首字母转了小写
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ColumnName { get; set; }
|
public string ColumnName { get; set; }
|
||||||
[SugarColumn(IsOnlyIgnoreUpdate = true)]
|
[SugarColumn(IsOnlyIgnoreUpdate = true)]
|
||||||
public int TableId { get; set; }
|
public long TableId { get; set; }
|
||||||
|
|
||||||
[SugarColumn(IsOnlyIgnoreUpdate = true)]
|
[SugarColumn(IsOnlyIgnoreUpdate = true)]
|
||||||
public string TableName { get; set; }
|
public string TableName { get; set; }
|
||||||
@ -96,6 +99,7 @@ namespace ZR.Model.System.Generate
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查询类型(等于、不等于、大于、小于、范围)
|
/// 查询类型(等于、不等于、大于、小于、范围)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(DefaultValue = "EQ")]
|
||||||
public string QueryType { get; set; } = "EQ";
|
public string QueryType { get; set; } = "EQ";
|
||||||
public int Sort { get; set; }
|
public int Sort { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -8,6 +8,9 @@ namespace ZR.Model.System
|
|||||||
//[EpplusTable(PrintHeaders = true, AutofitColumns = true, AutoCalculate = true, ShowTotal = true)]
|
//[EpplusTable(PrintHeaders = true, AutofitColumns = true, AutoCalculate = true, ShowTotal = true)]
|
||||||
public class SysBase
|
public class SysBase
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 创建人
|
||||||
|
/// </summary>
|
||||||
[SugarColumn(IsOnlyIgnoreUpdate = true, Length = 64, IsNullable = true)]
|
[SugarColumn(IsOnlyIgnoreUpdate = true, Length = 64, IsNullable = true)]
|
||||||
[JsonProperty(propertyName: "CreateBy")]
|
[JsonProperty(propertyName: "CreateBy")]
|
||||||
[ExcelIgnore]
|
[ExcelIgnore]
|
||||||
@ -31,13 +34,5 @@ namespace ZR.Model.System
|
|||||||
public DateTime? Update_time { get; set; }
|
public DateTime? Update_time { get; set; }
|
||||||
[SugarColumn(Length = 500)]
|
[SugarColumn(Length = 500)]
|
||||||
public string Remark { get; set; }
|
public string Remark { get; set; }
|
||||||
[SugarColumn(IsIgnore = true, IsNullable = true)]
|
|
||||||
[JsonIgnore]
|
|
||||||
[ExcelIgnore]
|
|
||||||
public DateTime? BeginTime { get; set; }
|
|
||||||
[SugarColumn(IsIgnore = true, IsNullable = true)]
|
|
||||||
[JsonIgnore]
|
|
||||||
[ExcelIgnore]
|
|
||||||
public DateTime? EndTime { get; set; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,7 +8,7 @@ namespace ZR.Model.System
|
|||||||
/// @author mr.zhao
|
/// @author mr.zhao
|
||||||
/// @date 2021-09-29
|
/// @date 2021-09-29
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("sys_config")]
|
[SugarTable("sys_config", "配置表")]
|
||||||
[Tenant("0")]
|
[Tenant("0")]
|
||||||
public class SysConfig : SysBase
|
public class SysConfig : SysBase
|
||||||
{
|
{
|
||||||
@ -20,18 +20,22 @@ namespace ZR.Model.System
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 参数名称
|
/// 参数名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 100)]
|
||||||
public string ConfigName { get; set; }
|
public string ConfigName { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 参数键名
|
/// 参数键名
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 100)]
|
||||||
public string ConfigKey { get; set; }
|
public string ConfigKey { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 参数键值
|
/// 参数键值
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 500)]
|
||||||
public string ConfigValue { get; set; }
|
public string ConfigValue { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 系统内置(Y是 N否)
|
/// 系统内置(Y是 N否)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 1)]
|
||||||
public string ConfigType { get; set; }
|
public string ConfigType { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,9 +6,9 @@ namespace ZR.Model.System
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 部门表
|
/// 部门表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("sys_dept")]
|
[SugarTable("sys_dept", "部门配置表")]
|
||||||
[Tenant("0")]
|
[Tenant("0")]
|
||||||
public class SysDept: SysBase
|
public class SysDept : SysBase
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 部门ID
|
/// 部门ID
|
||||||
@ -29,6 +29,7 @@ namespace ZR.Model.System
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 部门名称
|
/// 部门名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 30, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public string DeptName { get; set; }
|
public string DeptName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -39,32 +40,36 @@ namespace ZR.Model.System
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 负责人
|
/// 负责人
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 30)]
|
||||||
public string Leader { get; set; }
|
public string Leader { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 联系电话
|
/// 联系电话
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 11)]
|
||||||
public string Phone { get; set; }
|
public string Phone { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 邮箱
|
/// 邮箱
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50)]
|
||||||
public string Email { get; set; }
|
public string Email { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 部门状态:0正常,1停用
|
/// 部门状态:0正常,1停用
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 1, DefaultValue = "0")]
|
||||||
public string Status { get; set; }
|
public string Status { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 删除标志(0代表存在 2代表删除)
|
/// 删除标志(0代表存在 2代表删除)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(IsOnlyIgnoreInsert = true)]
|
[SugarColumn(Length = 1, DefaultValue = "0")]
|
||||||
public string DelFlag { get; set; }
|
public string DelFlag { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 子菜单
|
/// 子菜单
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<SysDept> children = new List<SysDept>();
|
public List<SysDept> children = new();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,7 @@ namespace ZR.Model.System
|
|||||||
/// 字典数据表
|
/// 字典数据表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Tenant("0")]
|
[Tenant("0")]
|
||||||
[SugarTable("sys_dict_data")]
|
[SugarTable("sys_dict_data", "字典数据表")]
|
||||||
public class SysDictData : SysBase
|
public class SysDictData : SysBase
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -21,30 +21,37 @@ namespace ZR.Model.System
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 字典标签
|
/// 字典标签
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 100, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public string DictLabel { get; set; }
|
public string DictLabel { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 字典键值
|
/// 字典键值
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 100, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public string DictValue { get; set; }
|
public string DictValue { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 字典类型
|
/// 字典类型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 100, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public string DictType { get; set; }
|
public string DictType { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 样式属性(其他样式扩展)
|
/// 样式属性(其他样式扩展)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 100)]
|
||||||
public string CssClass { get; set; } = string.Empty;
|
public string CssClass { get; set; } = string.Empty;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 表格回显样式
|
/// 表格回显样式
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 100)]
|
||||||
public string ListClass { get; set; } = string.Empty;
|
public string ListClass { get; set; } = string.Empty;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否默认(Y是 N否)
|
/// 是否默认(Y是 N否)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 1, DefaultValue = "N")]
|
||||||
public string IsDefault { get; set; }
|
public string IsDefault { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 状态(0正常 1停用)
|
/// 状态(0正常 1停用)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 1)]
|
||||||
public string Status { get; set; }
|
public string Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,8 @@ namespace ZR.Model.System
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 字典类型表
|
/// 字典类型表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("sys_dict_type")]
|
[SugarTable("sys_dict_type", "字典类型表")]
|
||||||
|
[SugarIndex("index_dict_type", nameof(DictType), OrderByType.Asc, true)]
|
||||||
[Tenant("0")]
|
[Tenant("0")]
|
||||||
public class SysDictType : SysBase
|
public class SysDictType : SysBase
|
||||||
{
|
{
|
||||||
@ -17,18 +18,22 @@ namespace ZR.Model.System
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 字典名称
|
/// 字典名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 100, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public string DictName { get; set; }
|
public string DictName { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 字典类型
|
/// 字典类型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 100, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public string DictType { get; set; }
|
public string DictType { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 状态 0、正常 1、停用
|
/// 状态 0、正常 1、停用
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 1, DefaultValue = "0")]
|
||||||
public string Status { get; set; }
|
public string Status { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 系统内置 Y是 N否
|
/// 系统内置 Y是 N否
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 1, DefaultValue = "N")]
|
||||||
public string Type { get; set; }
|
public string Type { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 自定义sql
|
/// 自定义sql
|
||||||
|
|||||||
@ -5,7 +5,7 @@ using System;
|
|||||||
namespace ZR.Model.System
|
namespace ZR.Model.System
|
||||||
{
|
{
|
||||||
[Tenant("0")]
|
[Tenant("0")]
|
||||||
[SugarTable("sys_file")]
|
[SugarTable("sys_file", "文件存储表")]
|
||||||
public class SysFile
|
public class SysFile
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -6,7 +6,7 @@ namespace ZR.Model.System
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// sys_logininfor 表
|
/// sys_logininfor 表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("sys_logininfor")]
|
[SugarTable("sys_logininfor", "登录日志表")]
|
||||||
[Tenant("0")]
|
[Tenant("0")]
|
||||||
public class SysLogininfor
|
public class SysLogininfor
|
||||||
{
|
{
|
||||||
@ -21,32 +21,33 @@ namespace ZR.Model.System
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 登录状态 0成功 1失败
|
/// 登录状态 0成功 1失败
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 1, DefaultValue = "0")]
|
||||||
public string Status { get; set; }
|
public string Status { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 登录IP地址
|
/// 登录IP地址
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Ipaddr { get; set; }
|
public string Ipaddr { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 登录地点
|
/// 登录地点
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string LoginLocation { get; set; }
|
public string LoginLocation { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 浏览器类型
|
/// 浏览器类型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Browser { get; set; }
|
public string Browser { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 操作系统
|
/// 操作系统
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Os { get; set; }
|
public string Os { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 提示消息
|
/// 提示消息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Msg { get; set; }
|
public string Msg { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 访问时间
|
/// 访问时间
|
||||||
|
|||||||
@ -6,7 +6,7 @@ namespace ZR.Model.System
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sys_menu表
|
/// Sys_menu表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("sys_menu")]
|
[SugarTable("sys_menu", "系统菜单表")]
|
||||||
[Tenant("0")]
|
[Tenant("0")]
|
||||||
public class SysMenu : SysBase
|
public class SysMenu : SysBase
|
||||||
{
|
{
|
||||||
@ -18,22 +18,25 @@ namespace ZR.Model.System
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 菜单名称
|
/// 菜单名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 50, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public string MenuName { get; set; }
|
public string MenuName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 父菜单ID
|
/// 父菜单ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(DefaultValue = "0")]
|
||||||
public long ParentId { get; set; }
|
public long ParentId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 显示顺序
|
/// 显示顺序
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(DefaultValue = "0")]
|
||||||
public int OrderNum { get; set; }
|
public int OrderNum { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 路由地址
|
/// 路由地址
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Path { get; set; } = "#";
|
public string Path { get; set; } = "";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 组件路径
|
/// 组件路径
|
||||||
@ -43,35 +46,42 @@ namespace ZR.Model.System
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否缓存(1缓存 0不缓存)
|
/// 是否缓存(1缓存 0不缓存)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(DefaultValue = "0", ColumnDataType = "int")]
|
||||||
public string IsCache { get; set; }
|
public string IsCache { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否外链 1、是 0、否
|
/// 是否外链 1、是 0、否
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string IsFrame { get; set; }
|
[SugarColumn(DefaultValue = "0", ColumnDataType = "int")]
|
||||||
|
public string IsFrame { get; set; } = "0";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 类型(M目录 C菜单 F按钮 L链接)
|
/// 类型(M目录 C菜单 F按钮 L链接)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string MenuType { get; set; }
|
[SugarColumn(Length = 1)]
|
||||||
|
public string MenuType { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 显示状态(0显示 1隐藏)
|
/// 显示状态(0显示 1隐藏)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(DefaultValue = "0", Length = 1)]
|
||||||
public string Visible { get; set; }
|
public string Visible { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 菜单状态(0正常 1停用)
|
/// 菜单状态(0正常 1停用)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(DefaultValue = "0", Length = 1)]
|
||||||
public string Status { get; set; }
|
public string Status { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 权限字符串
|
/// 权限字符串
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 100)]
|
||||||
public string Perms { get; set; }
|
public string Perms { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 菜单图标
|
/// 菜单图标
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(DefaultValue = "#")]
|
||||||
public string Icon { get; set; } = string.Empty;
|
public string Icon { get; set; } = string.Empty;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 菜单名key
|
/// 菜单名key
|
||||||
|
|||||||
@ -3,12 +3,12 @@ using SqlSugar;
|
|||||||
namespace ZR.Model.System
|
namespace ZR.Model.System
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 通知公告表,数据实体对象
|
/// 通知公告表
|
||||||
///
|
///
|
||||||
/// @author zr
|
/// @author zr
|
||||||
/// @date 2021-12-15
|
/// @date 2021-12-15
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("sys_notice")]
|
[SugarTable("sys_notice", "通知公告表")]
|
||||||
[Tenant(0)]
|
[Tenant(0)]
|
||||||
public class SysNotice : SysBase
|
public class SysNotice : SysBase
|
||||||
{
|
{
|
||||||
@ -20,21 +20,22 @@ namespace ZR.Model.System
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 公告标题
|
/// 公告标题
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "notice_title")]
|
[SugarColumn(ColumnName = "notice_title", ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public string NoticeTitle { get; set; }
|
public string NoticeTitle { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 公告类型 (1通知 2公告)
|
/// 公告类型 (1通知 2公告)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "notice_type")]
|
[SugarColumn(ColumnName = "notice_type", ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public int NoticeType { get; set; }
|
public int NoticeType { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 公告内容
|
/// 公告内容
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "notice_content")]
|
[SugarColumn(ColumnName = "notice_content", ColumnDataType = "text")]
|
||||||
public string NoticeContent { get; set; }
|
public string NoticeContent { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 公告状态 (0正常 1关闭)
|
/// 公告状态 (0正常 1关闭)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(DefaultValue = "0", ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public int Status { get; set; }
|
public int Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5,22 +5,24 @@ using System.ComponentModel;
|
|||||||
|
|
||||||
namespace ZR.Model.System
|
namespace ZR.Model.System
|
||||||
{
|
{
|
||||||
[SugarTable("sys_oper_log")]
|
[SugarTable("sys_oper_log", "操作日志表")]
|
||||||
[Tenant("0")]
|
[Tenant("0")]
|
||||||
public class SysOperLog
|
public class SysOperLog
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 操作id
|
||||||
|
/// </summary>
|
||||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||||
public long OperId { get; set; }
|
public long OperId { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 操作模块
|
/// 操作模块
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DisplayName("操作模块")]
|
|
||||||
public string Title { get; set; }
|
public string Title { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 业务类型(0其它 1新增 2修改 3删除 4=授权,5=导出,6=导入,7=强退,8=生成代码,9=清空数据)
|
/// 业务类型(0其它 1新增 2修改 3删除 4=授权,5=导出,6=导入,7=强退,8=生成代码,9=清空数据)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DisplayName("业务类型")]
|
[SugarColumn(DefaultValue = "0")]
|
||||||
public int BusinessType { get; set; }
|
public int BusinessType { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -33,79 +35,71 @@ namespace ZR.Model.System
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 请求方法
|
/// 请求方法
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DisplayName("请求方法")]
|
|
||||||
public string Method { get; set; }
|
public string Method { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 请求方式
|
/// 请求方式
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DisplayName("请求方式")]
|
|
||||||
public string RequestMethod { get; set; }
|
public string RequestMethod { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 操作类别(0其它 1后台用户 2手机端用户)
|
/// 操作类别(0其它 1后台用户 2手机端用户)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
//@Excel(name = "操作类别", readConverterExp = "0=其它,1=后台用户,2=手机端用户")
|
//@Excel(name = "操作类别", readConverterExp = "0=其它,1=后台用户,2=手机端用户")
|
||||||
[DisplayName("操作类别")]
|
[SugarColumn(DefaultValue = "0")]
|
||||||
public int OperatorType { get; set; }
|
public int OperatorType { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 操作人员
|
/// 操作人员
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DisplayName("操作人员")]
|
|
||||||
public string OperName { get; set; }
|
public string OperName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 请求url
|
/// 请求url
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DisplayName("请求地址")]
|
|
||||||
public string OperUrl { get; set; }
|
public string OperUrl { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 操作地址
|
/// 操作地址
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DisplayName("操作地址")]
|
|
||||||
public string OperIp { get; set; }
|
public string OperIp { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 操作地点
|
/// 操作地点
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DisplayName("操作地点")]
|
|
||||||
public string OperLocation { get; set; }
|
public string OperLocation { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 请求参数
|
/// 请求参数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DisplayName("请求参数")]
|
[SugarColumn(Length = 2000)]
|
||||||
public string OperParam { get; set; }
|
public string OperParam { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 返回参数
|
/// 返回参数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DisplayName("返回结果")]
|
[SugarColumn(ColumnDataType = "text")]
|
||||||
public string JsonResult { get; set; }
|
public string JsonResult { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 操作状态(0正常 1异常)
|
/// 操作状态(0正常 1异常)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DisplayName("状态")]
|
[SugarColumn(DefaultValue = "0")]
|
||||||
public int Status { get; set; }
|
public int Status { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 错误消息
|
/// 错误消息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DisplayName("错误消息")]
|
|
||||||
public string ErrorMsg { get; set; }
|
public string ErrorMsg { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 操作时间
|
/// 操作时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DisplayName("操作时间")]
|
|
||||||
public DateTime? OperTime { get; set; }
|
public DateTime? OperTime { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 操作用时
|
/// 操作用时
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DisplayName("操作用时")]
|
|
||||||
public long Elapsed { get; set; }
|
public long Elapsed { get; set; }
|
||||||
|
public string DeptName { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace ZR.Model.System
|
namespace ZR.Model.System
|
||||||
{
|
{
|
||||||
[SugarTable("sys_post")]
|
[SugarTable("sys_post", "岗位表")]
|
||||||
[Tenant("0")]
|
[Tenant("0")]
|
||||||
public class SysPost : SysBase
|
public class SysPost : SysBase
|
||||||
{
|
{
|
||||||
@ -11,9 +11,13 @@ namespace ZR.Model.System
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||||
public long PostId { get; set; }
|
public long PostId { get; set; }
|
||||||
|
[SugarColumn(ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public string PostCode { get; set; }
|
public string PostCode { get; set; }
|
||||||
|
[SugarColumn(ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public string PostName { get; set; }
|
public string PostName { get; set; }
|
||||||
|
[SugarColumn(ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public int PostSort { get; set; }
|
public int PostSort { get; set; }
|
||||||
|
[SugarColumn(Length = 1)]
|
||||||
public string Status { get; set; }
|
public string Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,7 @@ namespace ZR.Model.System
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 角色表 sys_role
|
/// 角色表 sys_role
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("sys_role")]
|
[SugarTable("sys_role", "角色表")]
|
||||||
[Tenant("0")]
|
[Tenant("0")]
|
||||||
public class SysRole : SysBase
|
public class SysRole : SysBase
|
||||||
{
|
{
|
||||||
@ -18,41 +18,47 @@ namespace ZR.Model.System
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 角色名称
|
/// 角色名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 30, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public string RoleName { get; set; }
|
public string RoleName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 角色权限
|
/// 角色权限
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 100, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public string RoleKey { get; set; }
|
public string RoleKey { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 角色排序
|
/// 角色排序
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public int RoleSort { get; set; }
|
public int RoleSort { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 帐号状态(0正常 1停用)
|
/// 帐号状态(0正常 1停用)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(DefaultValue = "0")]
|
||||||
public int Status { get; set; }
|
public int Status { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 删除标志(0代表存在 2代表删除)
|
/// 删除标志(0代表存在 2代表删除)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(DefaultValue = "0")]
|
||||||
public int DelFlag { get; set; }
|
public int DelFlag { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限))
|
/// 数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限))
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(DefaultValue = "1")]
|
||||||
public int DataScope { get; set; }
|
public int DataScope { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 菜单树选择项是否关联显示
|
/// 菜单树选择项是否关联显示
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "menu_check_strictly")]
|
[SugarColumn(ColumnName = "menu_check_strictly")]
|
||||||
public bool MenuCheckStrictly { get; set; }
|
public bool MenuCheckStrictly { get; set; } = true;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 部门树选择项是否关联显示
|
/// 部门树选择项是否关联显示
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "dept_check_strictly")]
|
[SugarColumn(ColumnName = "dept_check_strictly")]
|
||||||
public bool DeptCheckStrictly { get; set; }
|
public bool DeptCheckStrictly { get; set; } = true;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 菜单组
|
/// 菜单组
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -1,10 +1,15 @@
|
|||||||
namespace ZR.Model.System
|
using SqlSugar;
|
||||||
|
|
||||||
|
namespace ZR.Model.System
|
||||||
{
|
{
|
||||||
[SqlSugar.SugarTable("sys_role_dept")]
|
[SugarTable("sys_role_dept", "角色部门")]
|
||||||
[SqlSugar.Tenant(0)]
|
[Tenant(0)]
|
||||||
public class SysRoleDept
|
public class SysRoleDept
|
||||||
{
|
{
|
||||||
|
[SugarColumn(ExtendedAttribute = ProteryConstant.NOTNULL, IsPrimaryKey = true)]
|
||||||
public long RoleId { get; set; }
|
public long RoleId { get; set; }
|
||||||
|
|
||||||
|
[SugarColumn(ExtendedAttribute = ProteryConstant.NOTNULL, IsPrimaryKey = true)]
|
||||||
public long DeptId { get; set; }
|
public long DeptId { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,17 +7,15 @@ namespace ZR.Model.System
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 角色菜单
|
/// 角色菜单
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("sys_role_menu")]
|
[SugarTable("sys_role_menu", "角色菜单")]
|
||||||
[Tenant("0")]
|
[Tenant("0")]
|
||||||
public class SysRoleMenu
|
public class SysRoleMenu : SysBase
|
||||||
{
|
{
|
||||||
[JsonProperty("roleId")]
|
[JsonProperty("roleId")]
|
||||||
[SugarColumn(IsPrimaryKey = true)]
|
[SugarColumn(IsPrimaryKey = true, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public long Role_id { get; set; }
|
public long Role_id { get; set; }
|
||||||
[JsonProperty("menuId")]
|
[JsonProperty("menuId")]
|
||||||
[SugarColumn(IsPrimaryKey = true)]
|
[SugarColumn(IsPrimaryKey = true, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public long Menu_id { get; set; }
|
public long Menu_id { get; set; }
|
||||||
public DateTime Create_time { get; set; }
|
|
||||||
public string Create_by { get; set; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,15 +0,0 @@
|
|||||||
using SqlSugar;
|
|
||||||
|
|
||||||
namespace ZR.Model.System
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 角色部门
|
|
||||||
/// </summary>
|
|
||||||
[SugarTable("sys_role_post")]
|
|
||||||
[Tenant("0")]
|
|
||||||
public class SysRolePost
|
|
||||||
{
|
|
||||||
public long RoleId { get; set; }
|
|
||||||
public long DeptId { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,5 +1,4 @@
|
|||||||
using Newtonsoft.Json;
|
using SqlSugar;
|
||||||
using SqlSugar;
|
|
||||||
using System;
|
using System;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
@ -8,9 +7,9 @@ namespace ZR.Model.System
|
|||||||
///<summary>
|
///<summary>
|
||||||
///计划任务
|
///计划任务
|
||||||
///</summary>
|
///</summary>
|
||||||
[SugarTable("sys_tasks")]
|
[SugarTable("sys_tasks", "计划任务表")]
|
||||||
[Tenant("0")]
|
[Tenant("0")]
|
||||||
public class SysTasks
|
public class SysTasks : SysBase
|
||||||
{
|
{
|
||||||
public SysTasks()
|
public SysTasks()
|
||||||
{
|
{
|
||||||
@ -28,42 +27,42 @@ namespace ZR.Model.System
|
|||||||
/// 任务名称
|
/// 任务名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Display(Name = "任务名称")]
|
[Display(Name = "任务名称")]
|
||||||
|
[SugarColumn(ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 任务分组
|
/// 任务分组
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Display(Name = "任务分组")]
|
[Display(Name = "任务分组")]
|
||||||
|
[SugarColumn(ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public string JobGroup { get; set; }
|
public string JobGroup { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 运行时间表达式
|
/// 运行时间表达式
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Display(Name = "运行时间表达式")]
|
[Display(Name = "运行时间表达式")]
|
||||||
|
[SugarColumn(ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public string Cron { get; set; }
|
public string Cron { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 程序集名称
|
/// 程序集名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Display(Name = "程序集名称")]
|
[Display(Name = "程序集名称")]
|
||||||
|
[SugarColumn(ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public string AssemblyName { get; set; }
|
public string AssemblyName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 任务所在类
|
/// 任务所在类
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Display(Name = "任务所在类")]
|
[Display(Name = "任务所在类")]
|
||||||
|
[SugarColumn(ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public string ClassName { get; set; }
|
public string ClassName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 任务描述
|
|
||||||
/// </summary>
|
|
||||||
[Display(Name = "任务描述")]
|
|
||||||
public string Remark { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 执行次数
|
/// 执行次数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Display(Name = "执行次数")]
|
[Display(Name = "执行次数")]
|
||||||
|
[SugarColumn(DefaultValue = "0", ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public int RunTimes { get; set; }
|
public int RunTimes { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -83,6 +82,7 @@ namespace ZR.Model.System
|
|||||||
/// 默认 : 1
|
/// 默认 : 1
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Display(Name = "触发器类型(0、simple 1、cron)")]
|
[Display(Name = "触发器类型(0、simple 1、cron)")]
|
||||||
|
[SugarColumn(ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public int TriggerType { get; set; }
|
public int TriggerType { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -90,42 +90,22 @@ namespace ZR.Model.System
|
|||||||
/// 默认 : 0
|
/// 默认 : 0
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Display(Name = "执行间隔时间(单位:秒)")]
|
[Display(Name = "执行间隔时间(单位:秒)")]
|
||||||
|
[SugarColumn(ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public int IntervalSecond { get; set; }
|
public int IntervalSecond { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否启动
|
/// 是否启动
|
||||||
/// 默认 : 0
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Display(Name = "是否启动")]
|
[Display(Name = "是否启动")]
|
||||||
|
[SugarColumn(DefaultValue = "0", ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public int IsStart { get; set; }
|
public int IsStart { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 传入参数
|
/// 传入参数
|
||||||
/// 默认 :
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Display(Name = "传入参数")]
|
[Display(Name = "传入参数")]
|
||||||
public string JobParams { get; set; }
|
public string JobParams { get; set; }
|
||||||
|
|
||||||
[SugarColumn(IsOnlyIgnoreUpdate = true)]//设置后修改不会有此字段
|
|
||||||
[JsonProperty(propertyName: "CreateBy")]
|
|
||||||
public string Create_by { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 创建时间
|
|
||||||
/// </summary>
|
|
||||||
//[Display(Name = "创建时间")]
|
|
||||||
[SugarColumn(IsOnlyIgnoreUpdate = true)]//设置后修改不会有此字段
|
|
||||||
[JsonProperty(propertyName: "CreateTime")]
|
|
||||||
public DateTime Create_time { get; set; } = DateTime.Now;
|
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
[JsonProperty(propertyName: "UpdateBy")]
|
|
||||||
[SugarColumn(IsOnlyIgnoreInsert = true)]
|
|
||||||
public string Update_by { get; set; }
|
|
||||||
|
|
||||||
[SugarColumn(IsOnlyIgnoreInsert = true)]//设置后插入数据不会有此字段
|
|
||||||
[JsonProperty(propertyName: "UpdateTime")]
|
|
||||||
public DateTime Update_time { get; set; } = DateTime.Now;
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 最后运行时间
|
/// 最后运行时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -137,6 +117,7 @@ namespace ZR.Model.System
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 任务类型 1、程序集 2、网络请求 3、SQL语句
|
/// 任务类型 1、程序集 2、网络请求 3、SQL语句
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(DefaultValue = "1")]
|
||||||
public int TaskType { get; set; }
|
public int TaskType { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -146,6 +127,7 @@ namespace ZR.Model.System
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 网络请求方式
|
/// 网络请求方式
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(Length = 20)]
|
||||||
public string RequestMethod { get; set; }
|
public string RequestMethod { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,7 @@ namespace ZR.Model.System
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 任务日志
|
/// 任务日志
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("sys_tasks_log")]
|
[SugarTable("sys_tasks_log", "任务日志表")]
|
||||||
[Tenant("0")]
|
[Tenant("0")]
|
||||||
public class SysTasksLog
|
public class SysTasksLog
|
||||||
{
|
{
|
||||||
@ -18,12 +18,22 @@ namespace ZR.Model.System
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 任务Id
|
/// 任务Id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public string JobId { get; set; }
|
public string JobId { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 任务名
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public string JobName { get; set; }
|
public string JobName { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 任务分组
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public string JobGroup { get; set; }
|
public string JobGroup { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 执行状态(0正常 1失败)
|
/// 执行状态(0正常 1失败)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SugarColumn(DefaultValue = "0")]
|
||||||
public string Status { get; set; }
|
public string Status { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 异常
|
/// 异常
|
||||||
|
|||||||
@ -9,7 +9,7 @@ namespace ZR.Model.System
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 用户表
|
/// 用户表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("sys_user")]
|
[SugarTable("sys_user", "用户表")]
|
||||||
[Tenant("0")]
|
[Tenant("0")]
|
||||||
public class SysUser : SysBase
|
public class SysUser : SysBase
|
||||||
{
|
{
|
||||||
@ -21,12 +21,12 @@ namespace ZR.Model.System
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 登录用户名
|
/// 登录用户名
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(Length = 30, ColumnDescription = "用户账号", IsNullable = false)]
|
[SugarColumn(Length = 30, ColumnDescription = "用户账号", ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public string UserName { get; set; }
|
public string UserName { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 用户昵称
|
/// 用户昵称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(Length = 30, ColumnDescription = "用户昵称", IsNullable = false)]
|
[SugarColumn(Length = 30, ColumnDescription = "用户昵称", ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public string NickName { get; set; }
|
public string NickName { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 用户类型(00系统用户)
|
/// 用户类型(00系统用户)
|
||||||
@ -40,7 +40,7 @@ namespace ZR.Model.System
|
|||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
[ExcelIgnore]
|
[ExcelIgnore]
|
||||||
[SugarColumn(Length = 100, ColumnDescription = "密码", IsNullable = false)]
|
[SugarColumn(Length = 100, ColumnDescription = "密码", ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public string Password { get; set; }
|
public string Password { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 手机号
|
/// 手机号
|
||||||
|
|||||||
@ -5,11 +5,13 @@ namespace ZR.Model.System
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 用户岗位
|
/// 用户岗位
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("sys_user_post")]
|
[SugarTable("sys_user_post", "用户与岗位关联表")]
|
||||||
[Tenant("0")]
|
[Tenant("0")]
|
||||||
public class SysUserPost
|
public class SysUserPost
|
||||||
{
|
{
|
||||||
|
[SugarColumn(IsPrimaryKey = true, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public long UserId { get; set; }
|
public long UserId { get; set; }
|
||||||
|
[SugarColumn(IsPrimaryKey = true, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
||||||
public long PostId { get; set; }
|
public long PostId { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,7 @@ namespace ZR.Model.System
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 用户角色关联表 用户N-1 角色
|
/// 用户角色关联表 用户N-1 角色
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("sys_user_role")]
|
[SugarTable("sys_user_role", "用户和角色关联表")]
|
||||||
[Tenant("0")]
|
[Tenant("0")]
|
||||||
public class SysUserRole
|
public class SysUserRole
|
||||||
{
|
{
|
||||||
|
|||||||
@ -10,8 +10,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="MiniExcel" Version="1.30.3" />
|
<PackageReference Include="MiniExcel" Version="1.30.3" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
|
||||||
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.1.4.73" />
|
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.1.4.84-preview01" />
|
||||||
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
|
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@ -15,6 +15,6 @@
|
|||||||
<PackageReference Include="MySqlConnector" Version="2.2.6" />
|
<PackageReference Include="MySqlConnector" Version="2.2.6" />
|
||||||
<PackageReference Include="NETCore.Encrypt" Version="2.1.1" />
|
<PackageReference Include="NETCore.Encrypt" Version="2.1.1" />
|
||||||
<PackageReference Include="SqlSugar.IOC" Version="2.0.0" />
|
<PackageReference Include="SqlSugar.IOC" Version="2.0.0" />
|
||||||
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.1.4.73" />
|
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.1.4.84-preview01" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@ -7,7 +7,7 @@ namespace ZR.Service.System.IService
|
|||||||
{
|
{
|
||||||
public interface ISysUserService : IBaseService<SysUser>
|
public interface ISysUserService : IBaseService<SysUser>
|
||||||
{
|
{
|
||||||
public PagedInfo<SysUser> SelectUserList(SysUser user, PagerInfo pager);
|
public PagedInfo<SysUser> SelectUserList(SysUserQueryDto user, PagerInfo pager);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 通过用户ID查询用户
|
/// 通过用户ID查询用户
|
||||||
|
|||||||
@ -577,7 +577,6 @@ namespace ZR.Service
|
|||||||
Path = genTableInfo.BusinessName,
|
Path = genTableInfo.BusinessName,
|
||||||
Component = $"{genTableInfo.ModuleName.FirstLowerCase()}/{genTableInfo.BusinessName}",
|
Component = $"{genTableInfo.ModuleName.FirstLowerCase()}/{genTableInfo.BusinessName}",
|
||||||
Perms = $"{permPrefix}:list",
|
Perms = $"{permPrefix}:list",
|
||||||
IsFrame = "0",
|
|
||||||
IsCache = "1",
|
IsCache = "1",
|
||||||
MenuType = "C",
|
MenuType = "C",
|
||||||
Visible = "0",
|
Visible = "0",
|
||||||
@ -596,7 +595,6 @@ namespace ZR.Service
|
|||||||
ParentId = menu.MenuId,
|
ParentId = menu.MenuId,
|
||||||
OrderNum = 1,
|
OrderNum = 1,
|
||||||
Perms = $"{permPrefix}:query",
|
Perms = $"{permPrefix}:query",
|
||||||
IsFrame = "0",
|
|
||||||
MenuType = "F",
|
MenuType = "F",
|
||||||
Visible = "0",
|
Visible = "0",
|
||||||
Status = "0",
|
Status = "0",
|
||||||
@ -608,7 +606,6 @@ namespace ZR.Service
|
|||||||
ParentId = menu.MenuId,
|
ParentId = menu.MenuId,
|
||||||
OrderNum = 2,
|
OrderNum = 2,
|
||||||
Perms = $"{permPrefix}:add",
|
Perms = $"{permPrefix}:add",
|
||||||
IsFrame = "0",
|
|
||||||
MenuType = "F",
|
MenuType = "F",
|
||||||
Visible = "0",
|
Visible = "0",
|
||||||
Status = "0",
|
Status = "0",
|
||||||
@ -620,7 +617,6 @@ namespace ZR.Service
|
|||||||
ParentId = menu.MenuId,
|
ParentId = menu.MenuId,
|
||||||
OrderNum = 3,
|
OrderNum = 3,
|
||||||
Perms = $"{permPrefix}:delete",
|
Perms = $"{permPrefix}:delete",
|
||||||
IsFrame = "0",
|
|
||||||
MenuType = "F",
|
MenuType = "F",
|
||||||
Visible = "0",
|
Visible = "0",
|
||||||
Status = "0",
|
Status = "0",
|
||||||
@ -633,7 +629,6 @@ namespace ZR.Service
|
|||||||
ParentId = menu.MenuId,
|
ParentId = menu.MenuId,
|
||||||
OrderNum = 4,
|
OrderNum = 4,
|
||||||
Perms = $"{permPrefix}:edit",
|
Perms = $"{permPrefix}:edit",
|
||||||
IsFrame = "0",
|
|
||||||
MenuType = "F",
|
MenuType = "F",
|
||||||
Visible = "0",
|
Visible = "0",
|
||||||
Status = "0",
|
Status = "0",
|
||||||
@ -646,7 +641,6 @@ namespace ZR.Service
|
|||||||
ParentId = menu.MenuId,
|
ParentId = menu.MenuId,
|
||||||
OrderNum = 5,
|
OrderNum = 5,
|
||||||
Perms = $"{permPrefix}:export",
|
Perms = $"{permPrefix}:export",
|
||||||
IsFrame = "0",
|
|
||||||
MenuType = "F",
|
MenuType = "F",
|
||||||
Visible = "0",
|
Visible = "0",
|
||||||
Status = "0",
|
Status = "0",
|
||||||
|
|||||||
@ -39,7 +39,7 @@ namespace ZR.Service
|
|||||||
/// 根据条件分页查询用户列表
|
/// 根据条件分页查询用户列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public PagedInfo<SysUser> SelectUserList(SysUser user, PagerInfo pager)
|
public PagedInfo<SysUser> SelectUserList(SysUserQueryDto user, PagerInfo pager)
|
||||||
{
|
{
|
||||||
var exp = Expressionable.Create<SysUser>();
|
var exp = Expressionable.Create<SysUser>();
|
||||||
exp.AndIF(!string.IsNullOrEmpty(user.UserName), u => u.UserName.Contains(user.UserName));
|
exp.AndIF(!string.IsNullOrEmpty(user.UserName), u => u.UserName.Contains(user.UserName));
|
||||||
@ -323,7 +323,7 @@ namespace ZR.Service
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public SysUser Login(LoginBodyDto user)
|
public SysUser Login(LoginBodyDto user)
|
||||||
{
|
{
|
||||||
return GetFirst(it => it.UserName == user.Username && it.Password == user.Password);
|
return GetFirst(it => it.UserName == user.Username && it.Password.ToLower() == user.Password.ToLower());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -96,8 +96,8 @@ CREATE TABLE `sys_dept` (
|
|||||||
`leader` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '负责人',
|
`leader` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '负责人',
|
||||||
`phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系电话',
|
`phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系电话',
|
||||||
`email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '邮箱',
|
`email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '邮箱',
|
||||||
`status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '部门状态(0正常 1停用)',
|
`status` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '部门状态(0正常 1停用)',
|
||||||
`delFlag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)',
|
`delFlag` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)',
|
||||||
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者',
|
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者',
|
||||||
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
|
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
|
||||||
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者',
|
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者',
|
||||||
@ -181,9 +181,9 @@ CREATE TABLE `sys_menu` (
|
|||||||
`component` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '组件路径',
|
`component` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '组件路径',
|
||||||
`isFrame` int(1) NULL DEFAULT 0 COMMENT '是否外链(0 否 1 是)',
|
`isFrame` int(1) NULL DEFAULT 0 COMMENT '是否外链(0 否 1 是)',
|
||||||
`isCache` int(1) NULL DEFAULT 0 COMMENT '是否缓存(0缓存 1不缓存)',
|
`isCache` int(1) NULL DEFAULT 0 COMMENT '是否缓存(0缓存 1不缓存)',
|
||||||
`menuType` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '菜单类型(M目录 C菜单 F按钮 L链接)',
|
`menuType` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '菜单类型(M目录 C菜单 F按钮 L链接)',
|
||||||
`visible` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '菜单状态(0显示 1隐藏)',
|
`visible` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '菜单状态(0显示 1隐藏)',
|
||||||
`status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '菜单状态(0正常 1停用)',
|
`status` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '菜单状态(0正常 1停用)',
|
||||||
`perms` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '权限标识',
|
`perms` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '权限标识',
|
||||||
`icon` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '#' COMMENT '菜单图标',
|
`icon` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '#' COMMENT '菜单图标',
|
||||||
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者',
|
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者',
|
||||||
@ -229,7 +229,7 @@ CREATE TABLE `sys_post` (
|
|||||||
`postCode` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '岗位编码',
|
`postCode` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '岗位编码',
|
||||||
`postName` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '岗位名称',
|
`postName` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '岗位名称',
|
||||||
`postSort` int(4) NOT NULL COMMENT '显示顺序',
|
`postSort` int(4) NOT NULL COMMENT '显示顺序',
|
||||||
`status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '状态(0正常 1停用)',
|
`status` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '状态(0正常 1停用)',
|
||||||
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者',
|
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者',
|
||||||
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
|
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
|
||||||
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者',
|
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者',
|
||||||
@ -374,7 +374,7 @@ create table sys_config (
|
|||||||
configName varchar(100) default '' comment '参数名称',
|
configName varchar(100) default '' comment '参数名称',
|
||||||
configKey varchar(100) default '' comment '参数键名',
|
configKey varchar(100) default '' comment '参数键名',
|
||||||
configValue varchar(500) default '' comment '参数键值',
|
configValue varchar(500) default '' comment '参数键值',
|
||||||
configType char(1) default 'N' comment '系统内置(Y是 N否)',
|
configType varchar(1) default 'N' comment '系统内置(Y是 N否)',
|
||||||
create_by varchar(64) default '' comment '创建者',
|
create_by varchar(64) default '' comment '创建者',
|
||||||
create_time datetime comment '创建时间',
|
create_time datetime comment '创建时间',
|
||||||
update_by varchar(64) default '' comment '更新者',
|
update_by varchar(64) default '' comment '更新者',
|
||||||
|
|||||||
@ -788,8 +788,8 @@ CREATE TABLE "public"."sys_role" (
|
|||||||
"rolekey" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
|
"rolekey" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
|
||||||
"rolesort" int4 NOT NULL,
|
"rolesort" int4 NOT NULL,
|
||||||
"datascope" int4 COLLATE "pg_catalog"."default",
|
"datascope" int4 COLLATE "pg_catalog"."default",
|
||||||
"menu_check_strictly" int2,
|
"menu_check_strictly" bool,
|
||||||
"dept_check_strictly" int2 NOT NULL,
|
"dept_check_strictly" bool NOT NULL,
|
||||||
"status" int4 COLLATE "pg_catalog"."default" NOT NULL,
|
"status" int4 COLLATE "pg_catalog"."default" NOT NULL,
|
||||||
"delflag" int4 COLLATE "pg_catalog"."default" NOT NULL,
|
"delflag" int4 COLLATE "pg_catalog"."default" NOT NULL,
|
||||||
"create_by" varchar(64) COLLATE "pg_catalog"."default",
|
"create_by" varchar(64) COLLATE "pg_catalog"."default",
|
||||||
|
|||||||
@ -104,8 +104,8 @@ CREATE TABLE sys_dict_type (
|
|||||||
customSql varchar(500) NULL DEFAULT NULL ,-- '自定义sql',
|
customSql varchar(500) NULL DEFAULT NULL ,-- '自定义sql',
|
||||||
)
|
)
|
||||||
GO
|
GO
|
||||||
CREATE UNIQUE INDEX dictType ON dbo.sys_dict_type(dictType)
|
--CREATE UNIQUE INDEX dictType ON dbo.sys_dict_type(dictType)
|
||||||
GO
|
--GO
|
||||||
|
|
||||||
if OBJECT_ID(N'sys_dict_data',N'U') is not NULL DROP TABLE sys_dict_data
|
if OBJECT_ID(N'sys_dict_data',N'U') is not NULL DROP TABLE sys_dict_data
|
||||||
GO
|
GO
|
||||||
@ -137,7 +137,7 @@ CREATE TABLE sys_logininfor (
|
|||||||
loginLocation varchar(255) NULL DEFAULT '' ,-- '登录地点',
|
loginLocation varchar(255) NULL DEFAULT '' ,-- '登录地点',
|
||||||
browser varchar(50) NULL DEFAULT '' ,-- '浏览器类型',
|
browser varchar(50) NULL DEFAULT '' ,-- '浏览器类型',
|
||||||
os varchar(50) NULL DEFAULT '' ,-- '操作系统',
|
os varchar(50) NULL DEFAULT '' ,-- '操作系统',
|
||||||
status char(1) NULL DEFAULT '0' ,-- '登录状态(0成功 1失败)',
|
status varchar(1) NULL DEFAULT '0' ,-- '登录状态(0成功 1失败)',
|
||||||
msg varchar(255) NULL DEFAULT '' ,-- '提示消息',
|
msg varchar(255) NULL DEFAULT '' ,-- '提示消息',
|
||||||
loginTime DATETIME NULL DEFAULT NULL ,-- '访问时间',
|
loginTime DATETIME NULL DEFAULT NULL ,-- '访问时间',
|
||||||
)
|
)
|
||||||
@ -153,9 +153,9 @@ CREATE TABLE sys_menu (
|
|||||||
component varchar(255) NULL DEFAULT NULL ,-- '组件路径',
|
component varchar(255) NULL DEFAULT NULL ,-- '组件路径',
|
||||||
isFrame int NULL DEFAULT 0 ,-- '是否外链(0 否 1 是)',
|
isFrame int NULL DEFAULT 0 ,-- '是否外链(0 否 1 是)',
|
||||||
isCache int NULL DEFAULT 0 ,-- '是否缓存(0缓存 1不缓存)',
|
isCache int NULL DEFAULT 0 ,-- '是否缓存(0缓存 1不缓存)',
|
||||||
menuType char(1) NULL DEFAULT '' ,-- '菜单类型(M目录 C菜单 F按钮 L链接)',
|
menuType varchar(1) NULL DEFAULT '' ,-- '菜单类型(M目录 C菜单 F按钮 L链接)',
|
||||||
visible char(1) NULL DEFAULT '0' ,-- '菜单状态(0显示 1隐藏)',
|
visible varchar(1) NULL DEFAULT '0' ,-- '菜单状态(0显示 1隐藏)',
|
||||||
status char(1) NULL DEFAULT '0' ,-- '菜单状态(0正常 1停用)',
|
status varchar(1) NULL DEFAULT '0' ,-- '菜单状态(0正常 1停用)',
|
||||||
perms varchar(100) NULL DEFAULT NULL ,-- '权限标识',
|
perms varchar(100) NULL DEFAULT NULL ,-- '权限标识',
|
||||||
icon varchar(100) NULL DEFAULT '#' ,-- '菜单图标',
|
icon varchar(100) NULL DEFAULT '#' ,-- '菜单图标',
|
||||||
create_by varchar(64) NULL DEFAULT '' ,-- '创建者',
|
create_by varchar(64) NULL DEFAULT '' ,-- '创建者',
|
||||||
@ -186,7 +186,7 @@ CREATE TABLE sys_oper_log (
|
|||||||
operIP varchar(50) DEFAULT '' , -- '主机地址',
|
operIP varchar(50) DEFAULT '' , -- '主机地址',
|
||||||
operLocation varchar(255) DEFAULT '' , -- '操作地点',
|
operLocation varchar(255) DEFAULT '' , -- '操作地点',
|
||||||
operParam varchar(2000) DEFAULT '' , -- '请求参数',
|
operParam varchar(2000) DEFAULT '' , -- '请求参数',
|
||||||
jsonResult varchar(max) DEFAULT '' , -- '返回参数',
|
jsonResult TEXT DEFAULT '' , -- '返回参数',
|
||||||
status int NULL DEFAULT 0 , -- '操作状态(0正常 1异常)',
|
status int NULL DEFAULT 0 , -- '操作状态(0正常 1异常)',
|
||||||
errorMsg varchar(2000) DEFAULT '' , -- '错误消息',
|
errorMsg varchar(2000) DEFAULT '' , -- '错误消息',
|
||||||
operTime datetime NULL DEFAULT NULL , -- '操作时间',
|
operTime datetime NULL DEFAULT NULL , -- '操作时间',
|
||||||
@ -265,8 +265,8 @@ CREATE TABLE sys_role (
|
|||||||
roleKey varchar(100) NOT NULL , -- '角色权限字符串',
|
roleKey varchar(100) NOT NULL , -- '角色权限字符串',
|
||||||
roleSort int NOT NULL , -- '显示顺序',
|
roleSort int NOT NULL , -- '显示顺序',
|
||||||
dataScope int NULL DEFAULT 1 , -- '数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 )',
|
dataScope int NULL DEFAULT 1 , -- '数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 )',
|
||||||
menu_check_strictly int NULL DEFAULT 1 , -- '菜单树选择项是否关联显示',
|
menu_check_strictly BIT NOT NULL DEFAULT 1 , -- '菜单树选择项是否关联显示',
|
||||||
dept_check_strictly int NOT NULL DEFAULT 1 , -- '部门树选择项是否关联显示',
|
dept_check_strictly BIT NOT NULL DEFAULT 1 , -- '部门树选择项是否关联显示',
|
||||||
status int NOT NULL , -- '角色状态(0正常 1停用)',
|
status int NOT NULL , -- '角色状态(0正常 1停用)',
|
||||||
delFlag int NOT NULL DEFAULT 0 , -- '删除标志(0代表存在 2代表删除)',
|
delFlag int NOT NULL DEFAULT 0 , -- '删除标志(0代表存在 2代表删除)',
|
||||||
create_by varchar(64) NULL DEFAULT '' , -- '创建者',
|
create_by varchar(64) NULL DEFAULT '' , -- '创建者',
|
||||||
@ -310,7 +310,10 @@ CREATE TABLE sys_role_menu (
|
|||||||
role_id bigint NOT NULL , -- '角色ID',
|
role_id bigint NOT NULL , -- '角色ID',
|
||||||
menu_id bigint NOT NULL , -- '菜单ID',
|
menu_id bigint NOT NULL , -- '菜单ID',
|
||||||
create_by varchar(20) DEFAULT NULL,
|
create_by varchar(20) DEFAULT NULL,
|
||||||
create_time datetime NULL DEFAULT NULL
|
create_time datetime NULL DEFAULT NULL,
|
||||||
|
update_by VARCHAR(20) DEFAULT NULL,
|
||||||
|
update_time DATETIME NULL ,
|
||||||
|
remark VARCHAR(100)
|
||||||
)
|
)
|
||||||
GO
|
GO
|
||||||
alter table sys_role_menu add primary key(menu_id,role_id)
|
alter table sys_role_menu add primary key(menu_id,role_id)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user