更新项目配置,新增设备同步模块,优化WebSocket和Swagger配置,增强SCADA系统的免登录接口,支持数据字典项和登录日志的免登录查询与记录。调整Java编译设置,确保更好的开发体验。
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
using System.Windows.Controls;
|
||||
using System.Windows;
|
||||
|
||||
namespace YY.Admin.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// DataGrid绑定数据源描述
|
||||
/// </summary>
|
||||
public class BindDescriptionAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// 列名
|
||||
/// </summary>
|
||||
public string HeaderName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 显示为
|
||||
/// </summary>
|
||||
public ShowScheme ShowAs { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 显示顺序
|
||||
/// </summary>
|
||||
public int DisplayIndex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// DataGrid列绑定属性名称
|
||||
/// </summary>
|
||||
public string PropertyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 应用内的容模板Key
|
||||
/// </summary>
|
||||
public string ResourceKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 列宽
|
||||
/// </summary>
|
||||
public DataGridLength Width { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 列宽ByGrid
|
||||
/// </summary>
|
||||
public GridLength CloumnWidth { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// DataGrid绑定数据源描述
|
||||
/// </summary>
|
||||
/// <param name="headerName">列名</param>
|
||||
/// <param name="showAs">显示为</param>
|
||||
/// <param name="width">宽度</param>
|
||||
/// <param name="displayIndex">显示顺序</param>
|
||||
/// <param name="resourceKey">自定义列Key</param>
|
||||
public BindDescriptionAttribute(string headerName, ShowScheme showAs = ShowScheme.普通文本, string width = "Auto", int displayIndex = 0, string resourceKey = "")
|
||||
{
|
||||
this.HeaderName= headerName;
|
||||
DisplayIndex = displayIndex;
|
||||
ResourceKey = resourceKey;
|
||||
ShowAs = showAs;
|
||||
var convert = new DataGridLengthConverter();
|
||||
Width = (DataGridLength)convert.ConvertFrom(width);
|
||||
var gridCOnvert = new GridLengthConverter();
|
||||
CloumnWidth = (GridLength)gridCOnvert.ConvertFrom(width);
|
||||
|
||||
if (showAs == ShowScheme.自定义 && string.IsNullOrWhiteSpace(resourceKey))
|
||||
throw new ArgumentException($"自定义列时需要指定{nameof(resourceKey)}参数!");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 展示方式
|
||||
/// </summary>
|
||||
public enum ShowScheme
|
||||
{
|
||||
普通文本 = 1,
|
||||
自定义 = 4
|
||||
}
|
||||
}
|
||||
22
yy-admin-master/YY.Admin.Core/Attribute/ConstAttribute.cs
Normal file
22
yy-admin-master/YY.Admin.Core/Attribute/ConstAttribute.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace YY.Admin.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 常量特性
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)]
|
||||
public class ConstAttribute : Attribute
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
||||
public ConstAttribute(string name)
|
||||
{
|
||||
Name = name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace YY.Admin.Core
|
||||
{
|
||||
// 定义生命周期标记接口
|
||||
public interface ISingletonDependency { }
|
||||
public interface ITransientDependency { }
|
||||
public interface IScopedDependency { }
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace YY.Admin.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 忽略表结构初始化特性(标记在实体)
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
|
||||
public class IgnoreTableAttribute : Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace YY.Admin.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 忽略更新种子特性(标记在种子类)
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
|
||||
public class IgnoreUpdateSeedAttribute : Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
namespace YY.Admin.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 忽略更新种子列特性(标记在实体属性)
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Property, AllowMultiple = true, Inherited = true)]
|
||||
public class IgnoreUpdateSeedColumnAttribute : Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace YY.Admin.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 增量种子特性
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
|
||||
public class IncreSeedAttribute : Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace YY.Admin.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 增量表特性
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
|
||||
public class IncreTableAttribute : Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace YY.Admin.Core
|
||||
{
|
||||
public enum Lifecycle
|
||||
{
|
||||
Singleton,
|
||||
Transient,
|
||||
Scoped
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class LifecycleAttribute : Attribute
|
||||
{
|
||||
public Lifecycle Lifecycle { get; }
|
||||
|
||||
public LifecycleAttribute(Lifecycle lifecycle)
|
||||
{
|
||||
Lifecycle = lifecycle;
|
||||
}
|
||||
}
|
||||
}
|
||||
16
yy-admin-master/YY.Admin.Core/Attribute/LogTableAttribute.cs
Normal file
16
yy-admin-master/YY.Admin.Core/Attribute/LogTableAttribute.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace YY.Admin.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 日志表特性
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
|
||||
public class LogTableAttribute : Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace YY.Admin.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 表示查询操作的前台操作码
|
||||
/// </summary>
|
||||
public class OperateCodeAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// 初始化一个<see cref="OperateCodeAttribute"/>类型的新实例
|
||||
/// </summary>
|
||||
public OperateCodeAttribute(string code)
|
||||
{
|
||||
Code = code;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取 属性名称
|
||||
/// </summary>
|
||||
public string Code { get; private set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace YY.Admin.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 所属用户数据权限
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Property, AllowMultiple = true, Inherited = true)]
|
||||
public class OwnerUserAttribute : Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace YY.Admin.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询规则特性
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Property)]
|
||||
public class QueryRuleAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询字段名称
|
||||
/// </summary>
|
||||
public string FieldName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 分组名称
|
||||
/// </summary>
|
||||
public string Group { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 查询操作符
|
||||
/// </summary>
|
||||
public FilterOperateEnum Operate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 分组查询操作符(生成sql后面的where 带括号的查询,取值只能为or 或 and)
|
||||
/// </summary>
|
||||
public FilterOperateEnum GroupOperate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 查询规则构造函数
|
||||
/// </summary>
|
||||
/// <param name="operate">操作符</param>
|
||||
/// <param name="fieldName">数据库可接受的查询字段名称,未传直接取属性名称</param>
|
||||
/// <param name="group">隶属分组</param>
|
||||
/// <param name="groupOperate">分组查询操作符</param>
|
||||
public QueryRuleAttribute(FilterOperateEnum operate, string fieldName, string group = "", FilterOperateEnum groupOperate = FilterOperateEnum.And)
|
||||
{
|
||||
FieldName = fieldName;
|
||||
Group = group;
|
||||
Operate = operate;
|
||||
GroupOperate = groupOperate;
|
||||
}
|
||||
}
|
||||
}
|
||||
25
yy-admin-master/YY.Admin.Core/Attribute/SeedDataAttribute.cs
Normal file
25
yy-admin-master/YY.Admin.Core/Attribute/SeedDataAttribute.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace YY.Admin.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 种子数据特性
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
|
||||
public class SeedDataAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// 排序(越大越后执行)
|
||||
/// </summary>
|
||||
public int Order { get; set; } = 0;
|
||||
|
||||
public SeedDataAttribute(int orderNo)
|
||||
{
|
||||
Order = orderNo;
|
||||
}
|
||||
}
|
||||
}
|
||||
16
yy-admin-master/YY.Admin.Core/Attribute/SysTableAttribute.cs
Normal file
16
yy-admin-master/YY.Admin.Core/Attribute/SysTableAttribute.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace YY.Admin.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统表特性
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
|
||||
public class SysTableAttribute : Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
22
yy-admin-master/YY.Admin.Core/Attribute/ThemeAttribute.cs
Normal file
22
yy-admin-master/YY.Admin.Core/Attribute/ThemeAttribute.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace YY.Admin.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 枚举拓展主题样式
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Enum | AttributeTargets.Field)]
|
||||
public class ThemeAttribute : Attribute
|
||||
{
|
||||
public string Theme { get; private set; }
|
||||
|
||||
public ThemeAttribute(string theme)
|
||||
{
|
||||
this.Theme = theme;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user