增加应用历史表和应用配置表,内置轻量级配置中心
This commit is contained in:
parent
cd926a11a8
commit
a1a489aefa
|
@ -27,6 +27,11 @@
|
|||
<DebugType>full</DebugType>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Remove="DLL\**" />
|
||||
<EmbeddedResource Remove="DLL\**" />
|
||||
<None Remove="DLL\**" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Remove="Build.tt" />
|
||||
</ItemGroup>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<#@ template language="C#" hostSpecific="true" debug="true" #>
|
||||
<#@ assembly name="$(ProjectDir)\$(OutputPath)\NewLife.Core.dll" #>
|
||||
<#@ assembly name="$(ProjectDir)\$(OutputPath)\XCode.dll" #>
|
||||
<#@ assembly name="$(ProjectDir)\DLL\NewLife.Core.dll" #>
|
||||
<#@ assembly name="$(ProjectDir)\DLL\XCode.dll" #>
|
||||
<#@ import namespace="System.Diagnostics" #>
|
||||
<#@ import namespace="System.IO" #>
|
||||
<#@ import namespace="XCode.Code" #>
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,145 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using System.Xml.Serialization;
|
||||
using NewLife;
|
||||
using NewLife.Data;
|
||||
using NewLife.Log;
|
||||
using NewLife.Model;
|
||||
using NewLife.Reflection;
|
||||
using NewLife.Threading;
|
||||
using NewLife.Web;
|
||||
using XCode;
|
||||
using XCode.Cache;
|
||||
using XCode.Configuration;
|
||||
using XCode.DataAccessLayer;
|
||||
using XCode.Membership;
|
||||
|
||||
namespace AntJob.Data.Entity
|
||||
{
|
||||
/// <summary>应用历史</summary>
|
||||
public partial class AppHistory : EntityBase<AppHistory>
|
||||
{
|
||||
#region 对象操作
|
||||
static AppHistory()
|
||||
{
|
||||
// 累加字段
|
||||
//var df = Meta.Factory.AdditionalFields;
|
||||
//df.Add(__.AppID);
|
||||
|
||||
// 过滤器 UserModule、TimeModule、IPModule
|
||||
Meta.Modules.Add<TimeModule>();
|
||||
Meta.Modules.Add<IPModule>();
|
||||
}
|
||||
|
||||
/// <summary>验证数据,通过抛出异常的方式提示验证失败。</summary>
|
||||
/// <param name="isNew">是否插入</param>
|
||||
public override void Valid(Boolean isNew)
|
||||
{
|
||||
// 如果没有脏数据,则不需要进行任何处理
|
||||
if (!HasDirty) return;
|
||||
|
||||
// 在新插入数据或者修改了指定字段时进行修正
|
||||
//if (isNew && !Dirtys[nameof(CreateTime)]) CreateTime = DateTime.Now;
|
||||
//if (isNew && !Dirtys[nameof(CreateIP)]) CreateIP = ManageProvider.UserHost;
|
||||
}
|
||||
|
||||
///// <summary>首次连接数据库时初始化数据,仅用于实体类重载,用户不应该调用该方法</summary>
|
||||
//[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
//protected override void InitData()
|
||||
//{
|
||||
// // InitData一般用于当数据表没有数据时添加一些默认数据,该实体类的任何第一次数据库操作都会触发该方法,默认异步调用
|
||||
// if (Meta.Session.Count > 0) return;
|
||||
|
||||
// if (XTrace.Debug) XTrace.WriteLine("开始初始化AppHistory[应用历史]数据……");
|
||||
|
||||
// var entity = new AppHistory();
|
||||
// entity.ID = 0;
|
||||
// entity.AppID = 0;
|
||||
// entity.Name = "abc";
|
||||
// entity.Action = "abc";
|
||||
// entity.Success = true;
|
||||
// entity.Version = "abc";
|
||||
// entity.CompileTime = DateTime.Now;
|
||||
// entity.Creator = "abc";
|
||||
// entity.CreateTime = DateTime.Now;
|
||||
// entity.CreateIP = "abc";
|
||||
// entity.Remark = "abc";
|
||||
// entity.Insert();
|
||||
|
||||
// if (XTrace.Debug) XTrace.WriteLine("完成初始化AppHistory[应用历史]数据!");
|
||||
//}
|
||||
|
||||
///// <summary>已重载。基类先调用Valid(true)验证数据,然后在事务保护内调用OnInsert</summary>
|
||||
///// <returns></returns>
|
||||
//public override Int32 Insert()
|
||||
//{
|
||||
// return base.Insert();
|
||||
//}
|
||||
|
||||
///// <summary>已重载。在事务保护范围内处理业务,位于Valid之后</summary>
|
||||
///// <returns></returns>
|
||||
//protected override Int32 OnDelete()
|
||||
//{
|
||||
// return base.OnDelete();
|
||||
//}
|
||||
#endregion
|
||||
|
||||
#region 扩展属性
|
||||
/// <summary>应用</summary>
|
||||
[XmlIgnore, IgnoreDataMember]
|
||||
//[ScriptIgnore]
|
||||
public App App { get { return Extends.Get(nameof(App), k => App.FindByID(AppID)); } }
|
||||
|
||||
/// <summary>应用</summary>
|
||||
[XmlIgnore, IgnoreDataMember]
|
||||
//[ScriptIgnore]
|
||||
[DisplayName("应用")]
|
||||
[Map(__.AppID, typeof(App), "ID")]
|
||||
public String AppName { get { return App?.Name; } }
|
||||
#endregion
|
||||
|
||||
#region 扩展查询
|
||||
/// <summary>根据编号查找</summary>
|
||||
/// <param name="id">编号</param>
|
||||
/// <returns>实体对象</returns>
|
||||
public static AppHistory FindByID(Int32 id)
|
||||
{
|
||||
if (id <= 0) return null;
|
||||
|
||||
// 实体缓存
|
||||
if (Meta.Session.Count < 1000) return Meta.Cache.Find(e => e.ID == id);
|
||||
|
||||
// 单对象缓存
|
||||
return Meta.SingleCache[id];
|
||||
|
||||
//return Find(_.ID == id);
|
||||
}
|
||||
|
||||
/// <summary>根据应用、操作查找</summary>
|
||||
/// <param name="appid">应用</param>
|
||||
/// <param name="action">操作</param>
|
||||
/// <returns>实体列表</returns>
|
||||
public static IList<AppHistory> FindAllByAppIDAndAction(Int32 appid, String action)
|
||||
{
|
||||
// 实体缓存
|
||||
if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.AppID == appid && e.Action == action);
|
||||
|
||||
return FindAll(_.AppID == appid & _.Action == action);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 高级查询
|
||||
#endregion
|
||||
|
||||
#region 业务操作
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,278 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using XCode;
|
||||
using XCode.Configuration;
|
||||
using XCode.DataAccessLayer;
|
||||
|
||||
namespace AntJob.Data.Entity
|
||||
{
|
||||
/// <summary>应用历史。应用的操作历史</summary>
|
||||
[Serializable]
|
||||
[DataObject]
|
||||
[Description("应用历史。应用的操作历史")]
|
||||
[BindIndex("IX_devicehistory_AppID_Action", false, "AppID,Action")]
|
||||
[BindIndex("IX_devicehistory_CreateTime", false, "CreateTime")]
|
||||
[BindTable("devicehistory", Description = "应用历史。应用的操作历史", ConnName = "Ant", DbType = DatabaseType.None)]
|
||||
public partial class AppHistory : IAppHistory
|
||||
{
|
||||
#region 属性
|
||||
private Int32 _ID;
|
||||
/// <summary>编号</summary>
|
||||
[DisplayName("编号")]
|
||||
[Description("编号")]
|
||||
[DataObjectField(true, true, false, 0)]
|
||||
[BindColumn("ID", "编号", "")]
|
||||
public Int32 ID { get { return _ID; } set { if (OnPropertyChanging(__.ID, value)) { _ID = value; OnPropertyChanged(__.ID); } } }
|
||||
|
||||
private Int32 _AppID;
|
||||
/// <summary>应用</summary>
|
||||
[DisplayName("应用")]
|
||||
[Description("应用")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("AppID", "应用", "")]
|
||||
public Int32 AppID { get { return _AppID; } set { if (OnPropertyChanging(__.AppID, value)) { _AppID = value; OnPropertyChanged(__.AppID); } } }
|
||||
|
||||
private String _Name;
|
||||
/// <summary>名称</summary>
|
||||
[DisplayName("名称")]
|
||||
[Description("名称")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("Name", "名称", "", Master = true)]
|
||||
public String Name { get { return _Name; } set { if (OnPropertyChanging(__.Name, value)) { _Name = value; OnPropertyChanged(__.Name); } } }
|
||||
|
||||
private String _Action;
|
||||
/// <summary>操作</summary>
|
||||
[DisplayName("操作")]
|
||||
[Description("操作")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("Action", "操作", "")]
|
||||
public String Action { get { return _Action; } set { if (OnPropertyChanging(__.Action, value)) { _Action = value; OnPropertyChanged(__.Action); } } }
|
||||
|
||||
private Boolean _Success;
|
||||
/// <summary>成功</summary>
|
||||
[DisplayName("成功")]
|
||||
[Description("成功")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("Success", "成功", "")]
|
||||
public Boolean Success { get { return _Success; } set { if (OnPropertyChanging(__.Success, value)) { _Success = value; OnPropertyChanged(__.Success); } } }
|
||||
|
||||
private String _Version;
|
||||
/// <summary>版本</summary>
|
||||
[DisplayName("版本")]
|
||||
[Description("版本")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("Version", "版本", "")]
|
||||
public String Version { get { return _Version; } set { if (OnPropertyChanging(__.Version, value)) { _Version = value; OnPropertyChanged(__.Version); } } }
|
||||
|
||||
private DateTime _CompileTime;
|
||||
/// <summary>编译时间</summary>
|
||||
[DisplayName("编译时间")]
|
||||
[Description("编译时间")]
|
||||
[DataObjectField(false, false, true, 0)]
|
||||
[BindColumn("CompileTime", "编译时间", "")]
|
||||
public DateTime CompileTime { get { return _CompileTime; } set { if (OnPropertyChanging(__.CompileTime, value)) { _CompileTime = value; OnPropertyChanged(__.CompileTime); } } }
|
||||
|
||||
private String _Creator;
|
||||
/// <summary>创建者。服务端节点</summary>
|
||||
[DisplayName("创建者")]
|
||||
[Description("创建者。服务端节点")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("Creator", "创建者。服务端节点", "")]
|
||||
public String Creator { get { return _Creator; } set { if (OnPropertyChanging(__.Creator, value)) { _Creator = value; OnPropertyChanged(__.Creator); } } }
|
||||
|
||||
private DateTime _CreateTime;
|
||||
/// <summary>创建时间</summary>
|
||||
[DisplayName("创建时间")]
|
||||
[Description("创建时间")]
|
||||
[DataObjectField(false, false, true, 0)]
|
||||
[BindColumn("CreateTime", "创建时间", "")]
|
||||
public DateTime CreateTime { get { return _CreateTime; } set { if (OnPropertyChanging(__.CreateTime, value)) { _CreateTime = value; OnPropertyChanged(__.CreateTime); } } }
|
||||
|
||||
private String _CreateIP;
|
||||
/// <summary>创建地址</summary>
|
||||
[DisplayName("创建地址")]
|
||||
[Description("创建地址")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("CreateIP", "创建地址", "")]
|
||||
public String CreateIP { get { return _CreateIP; } set { if (OnPropertyChanging(__.CreateIP, value)) { _CreateIP = value; OnPropertyChanged(__.CreateIP); } } }
|
||||
|
||||
private String _Remark;
|
||||
/// <summary>内容</summary>
|
||||
[DisplayName("内容")]
|
||||
[Description("内容")]
|
||||
[DataObjectField(false, false, true, 2000)]
|
||||
[BindColumn("Content", "内容", "")]
|
||||
public String Remark { get { return _Remark; } set { if (OnPropertyChanging(__.Remark, value)) { _Remark = value; OnPropertyChanged(__.Remark); } } }
|
||||
#endregion
|
||||
|
||||
#region 获取/设置 字段值
|
||||
/// <summary>获取/设置 字段值</summary>
|
||||
/// <param name="name">字段名</param>
|
||||
/// <returns></returns>
|
||||
public override Object this[String name]
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (name)
|
||||
{
|
||||
case __.ID : return _ID;
|
||||
case __.AppID : return _AppID;
|
||||
case __.Name : return _Name;
|
||||
case __.Action : return _Action;
|
||||
case __.Success : return _Success;
|
||||
case __.Version : return _Version;
|
||||
case __.CompileTime : return _CompileTime;
|
||||
case __.Creator : return _Creator;
|
||||
case __.CreateTime : return _CreateTime;
|
||||
case __.CreateIP : return _CreateIP;
|
||||
case __.Remark : return _Remark;
|
||||
default: return base[name];
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
switch (name)
|
||||
{
|
||||
case __.ID : _ID = value.ToInt(); break;
|
||||
case __.AppID : _AppID = value.ToInt(); break;
|
||||
case __.Name : _Name = Convert.ToString(value); break;
|
||||
case __.Action : _Action = Convert.ToString(value); break;
|
||||
case __.Success : _Success = value.ToBoolean(); break;
|
||||
case __.Version : _Version = Convert.ToString(value); break;
|
||||
case __.CompileTime : _CompileTime = value.ToDateTime(); break;
|
||||
case __.Creator : _Creator = Convert.ToString(value); break;
|
||||
case __.CreateTime : _CreateTime = value.ToDateTime(); break;
|
||||
case __.CreateIP : _CreateIP = Convert.ToString(value); break;
|
||||
case __.Remark : _Remark = Convert.ToString(value); break;
|
||||
default: base[name] = value; break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 字段名
|
||||
/// <summary>取得应用历史字段信息的快捷方式</summary>
|
||||
public partial class _
|
||||
{
|
||||
/// <summary>编号</summary>
|
||||
public static readonly Field ID = FindByName(__.ID);
|
||||
|
||||
/// <summary>应用</summary>
|
||||
public static readonly Field AppID = FindByName(__.AppID);
|
||||
|
||||
/// <summary>名称</summary>
|
||||
public static readonly Field Name = FindByName(__.Name);
|
||||
|
||||
/// <summary>操作</summary>
|
||||
public static readonly Field Action = FindByName(__.Action);
|
||||
|
||||
/// <summary>成功</summary>
|
||||
public static readonly Field Success = FindByName(__.Success);
|
||||
|
||||
/// <summary>版本</summary>
|
||||
public static readonly Field Version = FindByName(__.Version);
|
||||
|
||||
/// <summary>编译时间</summary>
|
||||
public static readonly Field CompileTime = FindByName(__.CompileTime);
|
||||
|
||||
/// <summary>创建者。服务端节点</summary>
|
||||
public static readonly Field Creator = FindByName(__.Creator);
|
||||
|
||||
/// <summary>创建时间</summary>
|
||||
public static readonly Field CreateTime = FindByName(__.CreateTime);
|
||||
|
||||
/// <summary>创建地址</summary>
|
||||
public static readonly Field CreateIP = FindByName(__.CreateIP);
|
||||
|
||||
/// <summary>内容</summary>
|
||||
public static readonly Field Remark = FindByName(__.Remark);
|
||||
|
||||
static Field FindByName(String name) { return Meta.Table.FindByName(name); }
|
||||
}
|
||||
|
||||
/// <summary>取得应用历史字段名称的快捷方式</summary>
|
||||
public partial class __
|
||||
{
|
||||
/// <summary>编号</summary>
|
||||
public const String ID = "ID";
|
||||
|
||||
/// <summary>应用</summary>
|
||||
public const String AppID = "AppID";
|
||||
|
||||
/// <summary>名称</summary>
|
||||
public const String Name = "Name";
|
||||
|
||||
/// <summary>操作</summary>
|
||||
public const String Action = "Action";
|
||||
|
||||
/// <summary>成功</summary>
|
||||
public const String Success = "Success";
|
||||
|
||||
/// <summary>版本</summary>
|
||||
public const String Version = "Version";
|
||||
|
||||
/// <summary>编译时间</summary>
|
||||
public const String CompileTime = "CompileTime";
|
||||
|
||||
/// <summary>创建者。服务端节点</summary>
|
||||
public const String Creator = "Creator";
|
||||
|
||||
/// <summary>创建时间</summary>
|
||||
public const String CreateTime = "CreateTime";
|
||||
|
||||
/// <summary>创建地址</summary>
|
||||
public const String CreateIP = "CreateIP";
|
||||
|
||||
/// <summary>内容</summary>
|
||||
public const String Remark = "Remark";
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <summary>应用历史。应用的操作历史接口</summary>
|
||||
public partial interface IAppHistory
|
||||
{
|
||||
#region 属性
|
||||
/// <summary>编号</summary>
|
||||
Int32 ID { get; set; }
|
||||
|
||||
/// <summary>应用</summary>
|
||||
Int32 AppID { get; set; }
|
||||
|
||||
/// <summary>名称</summary>
|
||||
String Name { get; set; }
|
||||
|
||||
/// <summary>操作</summary>
|
||||
String Action { get; set; }
|
||||
|
||||
/// <summary>成功</summary>
|
||||
Boolean Success { get; set; }
|
||||
|
||||
/// <summary>版本</summary>
|
||||
String Version { get; set; }
|
||||
|
||||
/// <summary>编译时间</summary>
|
||||
DateTime CompileTime { get; set; }
|
||||
|
||||
/// <summary>创建者。服务端节点</summary>
|
||||
String Creator { get; set; }
|
||||
|
||||
/// <summary>创建时间</summary>
|
||||
DateTime CreateTime { get; set; }
|
||||
|
||||
/// <summary>创建地址</summary>
|
||||
String CreateIP { get; set; }
|
||||
|
||||
/// <summary>内容</summary>
|
||||
String Remark { get; set; }
|
||||
#endregion
|
||||
|
||||
#region 获取/设置 字段值
|
||||
/// <summary>获取/设置 字段值</summary>
|
||||
/// <param name="name">字段名</param>
|
||||
/// <returns></returns>
|
||||
Object this[String name] { get; set; }
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -66,6 +66,14 @@ namespace AntJob.Data.Entity
|
|||
[BindColumn("Version", "版本。客户端", "")]
|
||||
public String Version { get { return _Version; } set { if (OnPropertyChanging(__.Version, value)) { _Version = value; OnPropertyChanged(__.Version); } } }
|
||||
|
||||
private DateTime _CompileTime;
|
||||
/// <summary>编译时间</summary>
|
||||
[DisplayName("编译时间")]
|
||||
[Description("编译时间")]
|
||||
[DataObjectField(false, false, true, 0)]
|
||||
[BindColumn("CompileTime", "编译时间", "")]
|
||||
public DateTime CompileTime { get { return _CompileTime; } set { if (OnPropertyChanging(__.CompileTime, value)) { _CompileTime = value; OnPropertyChanged(__.CompileTime); } } }
|
||||
|
||||
private String _Server;
|
||||
/// <summary>服务端。客户端登录到哪个服务端,IP加端口</summary>
|
||||
[DisplayName("服务端")]
|
||||
|
@ -179,6 +187,7 @@ namespace AntJob.Data.Entity
|
|||
case __.Client : return _Client;
|
||||
case __.Name : return _Name;
|
||||
case __.Version : return _Version;
|
||||
case __.CompileTime : return _CompileTime;
|
||||
case __.Server : return _Server;
|
||||
case __.Tasks : return _Tasks;
|
||||
case __.Total : return _Total;
|
||||
|
@ -204,6 +213,7 @@ namespace AntJob.Data.Entity
|
|||
case __.Client : _Client = Convert.ToString(value); break;
|
||||
case __.Name : _Name = Convert.ToString(value); break;
|
||||
case __.Version : _Version = Convert.ToString(value); break;
|
||||
case __.CompileTime : _CompileTime = value.ToDateTime(); break;
|
||||
case __.Server : _Server = Convert.ToString(value); break;
|
||||
case __.Tasks : _Tasks = value.ToInt(); break;
|
||||
case __.Total : _Total = value.ToLong(); break;
|
||||
|
@ -244,6 +254,9 @@ namespace AntJob.Data.Entity
|
|||
/// <summary>版本。客户端</summary>
|
||||
public static readonly Field Version = FindByName(__.Version);
|
||||
|
||||
/// <summary>编译时间</summary>
|
||||
public static readonly Field CompileTime = FindByName(__.CompileTime);
|
||||
|
||||
/// <summary>服务端。客户端登录到哪个服务端,IP加端口</summary>
|
||||
public static readonly Field Server = FindByName(__.Server);
|
||||
|
||||
|
@ -304,6 +317,9 @@ namespace AntJob.Data.Entity
|
|||
/// <summary>版本。客户端</summary>
|
||||
public const String Version = "Version";
|
||||
|
||||
/// <summary>编译时间</summary>
|
||||
public const String CompileTime = "CompileTime";
|
||||
|
||||
/// <summary>服务端。客户端登录到哪个服务端,IP加端口</summary>
|
||||
public const String Server = "Server";
|
||||
|
||||
|
@ -365,6 +381,9 @@ namespace AntJob.Data.Entity
|
|||
/// <summary>版本。客户端</summary>
|
||||
String Version { get; set; }
|
||||
|
||||
/// <summary>编译时间</summary>
|
||||
DateTime CompileTime { get; set; }
|
||||
|
||||
/// <summary>服务端。客户端登录到哪个服务端,IP加端口</summary>
|
||||
String Server { get; set; }
|
||||
|
||||
|
|
|
@ -64,6 +64,14 @@ namespace AntJob.Data.Entity
|
|||
[BindColumn("Version", "版本", "")]
|
||||
public String Version { get { return _Version; } set { if (OnPropertyChanging(__.Version, value)) { _Version = value; OnPropertyChanged(__.Version); } } }
|
||||
|
||||
private DateTime _CompileTime;
|
||||
/// <summary>编译时间</summary>
|
||||
[DisplayName("编译时间")]
|
||||
[Description("编译时间")]
|
||||
[DataObjectField(false, false, true, 0)]
|
||||
[BindColumn("CompileTime", "编译时间", "")]
|
||||
public DateTime CompileTime { get { return _CompileTime; } set { if (OnPropertyChanging(__.CompileTime, value)) { _CompileTime = value; OnPropertyChanged(__.CompileTime); } } }
|
||||
|
||||
private Boolean _Enable;
|
||||
/// <summary>启用</summary>
|
||||
[DisplayName("启用")]
|
||||
|
@ -177,6 +185,7 @@ namespace AntJob.Data.Entity
|
|||
case __.Secret : return _Secret;
|
||||
case __.Category : return _Category;
|
||||
case __.Version : return _Version;
|
||||
case __.CompileTime : return _CompileTime;
|
||||
case __.Enable : return _Enable;
|
||||
case __.JobCount : return _JobCount;
|
||||
case __.MessageCount : return _MessageCount;
|
||||
|
@ -202,6 +211,7 @@ namespace AntJob.Data.Entity
|
|||
case __.Secret : _Secret = Convert.ToString(value); break;
|
||||
case __.Category : _Category = Convert.ToString(value); break;
|
||||
case __.Version : _Version = Convert.ToString(value); break;
|
||||
case __.CompileTime : _CompileTime = value.ToDateTime(); break;
|
||||
case __.Enable : _Enable = value.ToBoolean(); break;
|
||||
case __.JobCount : _JobCount = value.ToInt(); break;
|
||||
case __.MessageCount : _MessageCount = value.ToInt(); break;
|
||||
|
@ -242,6 +252,9 @@ namespace AntJob.Data.Entity
|
|||
/// <summary>版本</summary>
|
||||
public static readonly Field Version = FindByName(__.Version);
|
||||
|
||||
/// <summary>编译时间</summary>
|
||||
public static readonly Field CompileTime = FindByName(__.CompileTime);
|
||||
|
||||
/// <summary>启用</summary>
|
||||
public static readonly Field Enable = FindByName(__.Enable);
|
||||
|
||||
|
@ -302,6 +315,9 @@ namespace AntJob.Data.Entity
|
|||
/// <summary>版本</summary>
|
||||
public const String Version = "Version";
|
||||
|
||||
/// <summary>编译时间</summary>
|
||||
public const String CompileTime = "CompileTime";
|
||||
|
||||
/// <summary>启用</summary>
|
||||
public const String Enable = "Enable";
|
||||
|
||||
|
@ -363,6 +379,9 @@ namespace AntJob.Data.Entity
|
|||
/// <summary>版本</summary>
|
||||
String Version { get; set; }
|
||||
|
||||
/// <summary>编译时间</summary>
|
||||
DateTime CompileTime { get; set; }
|
||||
|
||||
/// <summary>启用</summary>
|
||||
Boolean Enable { get; set; }
|
||||
|
||||
|
|
|
@ -0,0 +1,157 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using System.Xml.Serialization;
|
||||
using NewLife;
|
||||
using NewLife.Data;
|
||||
using NewLife.Log;
|
||||
using NewLife.Model;
|
||||
using NewLife.Reflection;
|
||||
using NewLife.Threading;
|
||||
using NewLife.Web;
|
||||
using XCode;
|
||||
using XCode.Cache;
|
||||
using XCode.Configuration;
|
||||
using XCode.DataAccessLayer;
|
||||
using XCode.Membership;
|
||||
|
||||
namespace AntJob.Data.Entity
|
||||
{
|
||||
/// <summary>应用配置。各应用的配置数据</summary>
|
||||
public partial class AppConfig : EntityBase<AppConfig>
|
||||
{
|
||||
#region 对象操作
|
||||
static AppConfig()
|
||||
{
|
||||
// 累加字段
|
||||
//var df = Meta.Factory.AdditionalFields;
|
||||
//df.Add(__.AppID);
|
||||
|
||||
// 过滤器 UserModule、TimeModule、IPModule
|
||||
Meta.Modules.Add<UserModule>();
|
||||
Meta.Modules.Add<TimeModule>();
|
||||
Meta.Modules.Add<IPModule>();
|
||||
}
|
||||
|
||||
/// <summary>验证数据,通过抛出异常的方式提示验证失败。</summary>
|
||||
/// <param name="isNew">是否插入</param>
|
||||
public override void Valid(Boolean isNew)
|
||||
{
|
||||
// 如果没有脏数据,则不需要进行任何处理
|
||||
if (!HasDirty) return;
|
||||
|
||||
// 在新插入数据或者修改了指定字段时进行修正
|
||||
// 处理当前已登录用户信息,可以由UserModule过滤器代劳
|
||||
/*var user = ManageProvider.User;
|
||||
if (user != null)
|
||||
{
|
||||
if (isNew && !Dirtys[nameof(CreateUserID)]) CreateUserID = user.ID;
|
||||
if (!Dirtys[nameof(UpdateUserID)]) UpdateUserID = user.ID;
|
||||
}*/
|
||||
//if (isNew && !Dirtys[nameof(CreateTime)]) CreateTime = DateTime.Now;
|
||||
//if (!Dirtys[nameof(UpdateTime)]) UpdateTime = DateTime.Now;
|
||||
//if (isNew && !Dirtys[nameof(CreateIP)]) CreateIP = ManageProvider.UserHost;
|
||||
//if (!Dirtys[nameof(UpdateIP)]) UpdateIP = ManageProvider.UserHost;
|
||||
|
||||
// 检查唯一索引
|
||||
// CheckExist(isNew, __.AppID, __.Name);
|
||||
}
|
||||
|
||||
///// <summary>首次连接数据库时初始化数据,仅用于实体类重载,用户不应该调用该方法</summary>
|
||||
//[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
//protected override void InitData()
|
||||
//{
|
||||
// // InitData一般用于当数据表没有数据时添加一些默认数据,该实体类的任何第一次数据库操作都会触发该方法,默认异步调用
|
||||
// if (Meta.Session.Count > 0) return;
|
||||
|
||||
// if (XTrace.Debug) XTrace.WriteLine("开始初始化AppConfig[应用配置]数据……");
|
||||
|
||||
// var entity = new AppConfig();
|
||||
// entity.ID = 0;
|
||||
// entity.AppID = 0;
|
||||
// entity.Name = "abc";
|
||||
// entity.Content = "abc";
|
||||
// entity.CreateUserID = 0;
|
||||
// entity.CreateTime = DateTime.Now;
|
||||
// entity.CreateIP = "abc";
|
||||
// entity.UpdateUserID = 0;
|
||||
// entity.UpdateTime = DateTime.Now;
|
||||
// entity.UpdateIP = "abc";
|
||||
// entity.Insert();
|
||||
|
||||
// if (XTrace.Debug) XTrace.WriteLine("完成初始化AppConfig[应用配置]数据!");
|
||||
//}
|
||||
|
||||
///// <summary>已重载。基类先调用Valid(true)验证数据,然后在事务保护内调用OnInsert</summary>
|
||||
///// <returns></returns>
|
||||
//public override Int32 Insert()
|
||||
//{
|
||||
// return base.Insert();
|
||||
//}
|
||||
|
||||
///// <summary>已重载。在事务保护范围内处理业务,位于Valid之后</summary>
|
||||
///// <returns></returns>
|
||||
//protected override Int32 OnDelete()
|
||||
//{
|
||||
// return base.OnDelete();
|
||||
//}
|
||||
#endregion
|
||||
|
||||
#region 扩展属性
|
||||
/// <summary>设备编号</summary>
|
||||
[XmlIgnore, IgnoreDataMember]
|
||||
//[ScriptIgnore]
|
||||
public App App { get { return Extends.Get(nameof(App), k => App.FindByID(AppID)); } }
|
||||
|
||||
/// <summary>设备编号</summary>
|
||||
[XmlIgnore, IgnoreDataMember]
|
||||
//[ScriptIgnore]
|
||||
[DisplayName("设备编号")]
|
||||
[Map(__.AppID, typeof(App), "ID")]
|
||||
public String AppName { get { return App?.Name; } }
|
||||
#endregion
|
||||
|
||||
#region 扩展查询
|
||||
/// <summary>根据编号查找</summary>
|
||||
/// <param name="id">编号</param>
|
||||
/// <returns>实体对象</returns>
|
||||
public static AppConfig FindByID(Int32 id)
|
||||
{
|
||||
if (id <= 0) return null;
|
||||
|
||||
// 实体缓存
|
||||
if (Meta.Session.Count < 1000) return Meta.Cache.Find(e => e.ID == id);
|
||||
|
||||
// 单对象缓存
|
||||
return Meta.SingleCache[id];
|
||||
|
||||
//return Find(_.ID == id);
|
||||
}
|
||||
|
||||
/// <summary>根据设备编号、名称查找</summary>
|
||||
/// <param name="appid">设备编号</param>
|
||||
/// <param name="name">名称</param>
|
||||
/// <returns>实体对象</returns>
|
||||
public static AppConfig FindByAppIDAndName(Int32 appid, String name)
|
||||
{
|
||||
// 实体缓存
|
||||
if (Meta.Session.Count < 1000) return Meta.Cache.Find(e => e.AppID == appid && e.Name == name);
|
||||
|
||||
return Find(_.AppID == appid & _.Name == name);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 高级查询
|
||||
#endregion
|
||||
|
||||
#region 业务操作
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,259 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using XCode;
|
||||
using XCode.Configuration;
|
||||
using XCode.DataAccessLayer;
|
||||
|
||||
namespace AntJob.Data.Entity
|
||||
{
|
||||
/// <summary>应用配置。各应用的配置数据</summary>
|
||||
[Serializable]
|
||||
[DataObject]
|
||||
[Description("应用配置。各应用的配置数据")]
|
||||
[BindIndex("IU_AppConfig_AppID_Name", true, "AppID,Name")]
|
||||
[BindIndex("IX_AppConfig_UpdateTime", false, "UpdateTime")]
|
||||
[BindTable("AppConfig", Description = "应用配置。各应用的配置数据", ConnName = "Ant", DbType = DatabaseType.None)]
|
||||
public partial class AppConfig : IAppConfig
|
||||
{
|
||||
#region 属性
|
||||
private Int32 _ID;
|
||||
/// <summary>编号</summary>
|
||||
[DisplayName("编号")]
|
||||
[Description("编号")]
|
||||
[DataObjectField(true, true, false, 0)]
|
||||
[BindColumn("ID", "编号", "")]
|
||||
public Int32 ID { get { return _ID; } set { if (OnPropertyChanging(__.ID, value)) { _ID = value; OnPropertyChanged(__.ID); } } }
|
||||
|
||||
private Int32 _AppID;
|
||||
/// <summary>设备编号</summary>
|
||||
[DisplayName("设备编号")]
|
||||
[Description("设备编号")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("AppID", "设备编号", "")]
|
||||
public Int32 AppID { get { return _AppID; } set { if (OnPropertyChanging(__.AppID, value)) { _AppID = value; OnPropertyChanged(__.AppID); } } }
|
||||
|
||||
private String _Name;
|
||||
/// <summary>名称</summary>
|
||||
[DisplayName("名称")]
|
||||
[Description("名称")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("Name", "名称", "", Master = true)]
|
||||
public String Name { get { return _Name; } set { if (OnPropertyChanging(__.Name, value)) { _Name = value; OnPropertyChanged(__.Name); } } }
|
||||
|
||||
private String _Content;
|
||||
/// <summary>内容。一般是json格式</summary>
|
||||
[DisplayName("内容")]
|
||||
[Description("内容。一般是json格式")]
|
||||
[DataObjectField(false, false, true, 5000)]
|
||||
[BindColumn("Content", "内容。一般是json格式", "")]
|
||||
public String Content { get { return _Content; } set { if (OnPropertyChanging(__.Content, value)) { _Content = value; OnPropertyChanged(__.Content); } } }
|
||||
|
||||
private Int32 _CreateUserID;
|
||||
/// <summary>创建者</summary>
|
||||
[DisplayName("创建者")]
|
||||
[Description("创建者")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("CreateUserID", "创建者", "")]
|
||||
public Int32 CreateUserID { get { return _CreateUserID; } set { if (OnPropertyChanging(__.CreateUserID, value)) { _CreateUserID = value; OnPropertyChanged(__.CreateUserID); } } }
|
||||
|
||||
private DateTime _CreateTime;
|
||||
/// <summary>创建时间</summary>
|
||||
[DisplayName("创建时间")]
|
||||
[Description("创建时间")]
|
||||
[DataObjectField(false, false, true, 0)]
|
||||
[BindColumn("CreateTime", "创建时间", "")]
|
||||
public DateTime CreateTime { get { return _CreateTime; } set { if (OnPropertyChanging(__.CreateTime, value)) { _CreateTime = value; OnPropertyChanged(__.CreateTime); } } }
|
||||
|
||||
private String _CreateIP;
|
||||
/// <summary>创建地址</summary>
|
||||
[DisplayName("创建地址")]
|
||||
[Description("创建地址")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("CreateIP", "创建地址", "")]
|
||||
public String CreateIP { get { return _CreateIP; } set { if (OnPropertyChanging(__.CreateIP, value)) { _CreateIP = value; OnPropertyChanged(__.CreateIP); } } }
|
||||
|
||||
private Int32 _UpdateUserID;
|
||||
/// <summary>更新者</summary>
|
||||
[DisplayName("更新者")]
|
||||
[Description("更新者")]
|
||||
[DataObjectField(false, false, false, 0)]
|
||||
[BindColumn("UpdateUserID", "更新者", "")]
|
||||
public Int32 UpdateUserID { get { return _UpdateUserID; } set { if (OnPropertyChanging(__.UpdateUserID, value)) { _UpdateUserID = value; OnPropertyChanged(__.UpdateUserID); } } }
|
||||
|
||||
private DateTime _UpdateTime;
|
||||
/// <summary>更新时间</summary>
|
||||
[DisplayName("更新时间")]
|
||||
[Description("更新时间")]
|
||||
[DataObjectField(false, false, true, 0)]
|
||||
[BindColumn("UpdateTime", "更新时间", "")]
|
||||
public DateTime UpdateTime { get { return _UpdateTime; } set { if (OnPropertyChanging(__.UpdateTime, value)) { _UpdateTime = value; OnPropertyChanged(__.UpdateTime); } } }
|
||||
|
||||
private String _UpdateIP;
|
||||
/// <summary>更新地址</summary>
|
||||
[DisplayName("更新地址")]
|
||||
[Description("更新地址")]
|
||||
[DataObjectField(false, false, true, 50)]
|
||||
[BindColumn("UpdateIP", "更新地址", "")]
|
||||
public String UpdateIP { get { return _UpdateIP; } set { if (OnPropertyChanging(__.UpdateIP, value)) { _UpdateIP = value; OnPropertyChanged(__.UpdateIP); } } }
|
||||
#endregion
|
||||
|
||||
#region 获取/设置 字段值
|
||||
/// <summary>获取/设置 字段值</summary>
|
||||
/// <param name="name">字段名</param>
|
||||
/// <returns></returns>
|
||||
public override Object this[String name]
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (name)
|
||||
{
|
||||
case __.ID : return _ID;
|
||||
case __.AppID : return _AppID;
|
||||
case __.Name : return _Name;
|
||||
case __.Content : return _Content;
|
||||
case __.CreateUserID : return _CreateUserID;
|
||||
case __.CreateTime : return _CreateTime;
|
||||
case __.CreateIP : return _CreateIP;
|
||||
case __.UpdateUserID : return _UpdateUserID;
|
||||
case __.UpdateTime : return _UpdateTime;
|
||||
case __.UpdateIP : return _UpdateIP;
|
||||
default: return base[name];
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
switch (name)
|
||||
{
|
||||
case __.ID : _ID = value.ToInt(); break;
|
||||
case __.AppID : _AppID = value.ToInt(); break;
|
||||
case __.Name : _Name = Convert.ToString(value); break;
|
||||
case __.Content : _Content = Convert.ToString(value); break;
|
||||
case __.CreateUserID : _CreateUserID = value.ToInt(); break;
|
||||
case __.CreateTime : _CreateTime = value.ToDateTime(); break;
|
||||
case __.CreateIP : _CreateIP = Convert.ToString(value); break;
|
||||
case __.UpdateUserID : _UpdateUserID = value.ToInt(); break;
|
||||
case __.UpdateTime : _UpdateTime = value.ToDateTime(); break;
|
||||
case __.UpdateIP : _UpdateIP = Convert.ToString(value); break;
|
||||
default: base[name] = value; break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 字段名
|
||||
/// <summary>取得应用配置字段信息的快捷方式</summary>
|
||||
public partial class _
|
||||
{
|
||||
/// <summary>编号</summary>
|
||||
public static readonly Field ID = FindByName(__.ID);
|
||||
|
||||
/// <summary>设备编号</summary>
|
||||
public static readonly Field AppID = FindByName(__.AppID);
|
||||
|
||||
/// <summary>名称</summary>
|
||||
public static readonly Field Name = FindByName(__.Name);
|
||||
|
||||
/// <summary>内容。一般是json格式</summary>
|
||||
public static readonly Field Content = FindByName(__.Content);
|
||||
|
||||
/// <summary>创建者</summary>
|
||||
public static readonly Field CreateUserID = FindByName(__.CreateUserID);
|
||||
|
||||
/// <summary>创建时间</summary>
|
||||
public static readonly Field CreateTime = FindByName(__.CreateTime);
|
||||
|
||||
/// <summary>创建地址</summary>
|
||||
public static readonly Field CreateIP = FindByName(__.CreateIP);
|
||||
|
||||
/// <summary>更新者</summary>
|
||||
public static readonly Field UpdateUserID = FindByName(__.UpdateUserID);
|
||||
|
||||
/// <summary>更新时间</summary>
|
||||
public static readonly Field UpdateTime = FindByName(__.UpdateTime);
|
||||
|
||||
/// <summary>更新地址</summary>
|
||||
public static readonly Field UpdateIP = FindByName(__.UpdateIP);
|
||||
|
||||
static Field FindByName(String name) { return Meta.Table.FindByName(name); }
|
||||
}
|
||||
|
||||
/// <summary>取得应用配置字段名称的快捷方式</summary>
|
||||
public partial class __
|
||||
{
|
||||
/// <summary>编号</summary>
|
||||
public const String ID = "ID";
|
||||
|
||||
/// <summary>设备编号</summary>
|
||||
public const String AppID = "AppID";
|
||||
|
||||
/// <summary>名称</summary>
|
||||
public const String Name = "Name";
|
||||
|
||||
/// <summary>内容。一般是json格式</summary>
|
||||
public const String Content = "Content";
|
||||
|
||||
/// <summary>创建者</summary>
|
||||
public const String CreateUserID = "CreateUserID";
|
||||
|
||||
/// <summary>创建时间</summary>
|
||||
public const String CreateTime = "CreateTime";
|
||||
|
||||
/// <summary>创建地址</summary>
|
||||
public const String CreateIP = "CreateIP";
|
||||
|
||||
/// <summary>更新者</summary>
|
||||
public const String UpdateUserID = "UpdateUserID";
|
||||
|
||||
/// <summary>更新时间</summary>
|
||||
public const String UpdateTime = "UpdateTime";
|
||||
|
||||
/// <summary>更新地址</summary>
|
||||
public const String UpdateIP = "UpdateIP";
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <summary>应用配置。各应用的配置数据接口</summary>
|
||||
public partial interface IAppConfig
|
||||
{
|
||||
#region 属性
|
||||
/// <summary>编号</summary>
|
||||
Int32 ID { get; set; }
|
||||
|
||||
/// <summary>设备编号</summary>
|
||||
Int32 AppID { get; set; }
|
||||
|
||||
/// <summary>名称</summary>
|
||||
String Name { get; set; }
|
||||
|
||||
/// <summary>内容。一般是json格式</summary>
|
||||
String Content { get; set; }
|
||||
|
||||
/// <summary>创建者</summary>
|
||||
Int32 CreateUserID { get; set; }
|
||||
|
||||
/// <summary>创建时间</summary>
|
||||
DateTime CreateTime { get; set; }
|
||||
|
||||
/// <summary>创建地址</summary>
|
||||
String CreateIP { get; set; }
|
||||
|
||||
/// <summary>更新者</summary>
|
||||
Int32 UpdateUserID { get; set; }
|
||||
|
||||
/// <summary>更新时间</summary>
|
||||
DateTime UpdateTime { get; set; }
|
||||
|
||||
/// <summary>更新地址</summary>
|
||||
String UpdateIP { get; set; }
|
||||
#endregion
|
||||
|
||||
#region 获取/设置 字段值
|
||||
/// <summary>获取/设置 字段值</summary>
|
||||
/// <param name="name">字段名</param>
|
||||
/// <returns></returns>
|
||||
Object this[String name] { get; set; }
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Tables Version="9.14.7183.41843" Output="Entity" NameSpace="AntJob.Data.Entity" ConnName="Ant" BaseClass="EntityBase">
|
||||
<Tables Version="9.14.7315.27316" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:schemaLocation="http://www.newlifex.com http://www.newlifex.com/Model2020.xsd" Output="Entity" NameSpace="AntJob.Data.Entity" ConnName="Ant" BaseClass="EntityBase" ChineseFileName="True" IgnoreNameCase="True" xmlns="http://www.newlifex.com/Model2020.xsd">
|
||||
<Table Name="App" Description="应用系统。数据作业隶属于某个应用">
|
||||
<Columns>
|
||||
<Column Name="ID" DataType="Int32" Identity="True" PrimaryKey="True" Description="编号" />
|
||||
|
@ -8,6 +8,7 @@
|
|||
<Column Name="Secret" DataType="String" Description="密钥" />
|
||||
<Column Name="Category" DataType="String" Description="类别" />
|
||||
<Column Name="Version" DataType="String" Description="版本" />
|
||||
<Column Name="CompileTime" DataType="DateTime" Description="编译时间" />
|
||||
<Column Name="Enable" DataType="Boolean" Description="启用" />
|
||||
<Column Name="JobCount" DataType="Int32" Description="作业数" />
|
||||
<Column Name="MessageCount" DataType="Int32" Description="消息数" />
|
||||
|
@ -33,6 +34,7 @@
|
|||
<Column Name="Client" DataType="String" Description="客户端。IP加进程" />
|
||||
<Column Name="Name" DataType="String" Master="True" Description="名称。机器名称" />
|
||||
<Column Name="Version" DataType="String" Description="版本。客户端" />
|
||||
<Column Name="CompileTime" DataType="DateTime" Description="编译时间" />
|
||||
<Column Name="Server" DataType="String" Description="服务端。客户端登录到哪个服务端,IP加端口" />
|
||||
<Column Name="Tasks" DataType="Int32" Description="任务数" />
|
||||
<Column Name="Total" DataType="Int64" Description="总数" />
|
||||
|
@ -52,6 +54,43 @@
|
|||
<Index Columns="AppID" />
|
||||
</Indexes>
|
||||
</Table>
|
||||
<Table Name="AppHistory" TableName="devicehistory" Description="应用历史。应用的操作历史">
|
||||
<Columns>
|
||||
<Column Name="ID" DataType="Int32" Identity="True" PrimaryKey="True" Description="编号" />
|
||||
<Column Name="AppID" DataType="Int32" Description="应用" />
|
||||
<Column Name="Name" DataType="String" Master="True" Description="名称" />
|
||||
<Column Name="Action" DataType="String" Description="操作" />
|
||||
<Column Name="Success" DataType="Boolean" Description="成功" />
|
||||
<Column Name="Version" DataType="String" Description="版本" />
|
||||
<Column Name="CompileTime" DataType="DateTime" Description="编译时间" />
|
||||
<Column Name="Creator" DataType="String" Description="创建者。服务端节点" />
|
||||
<Column Name="CreateTime" DataType="DateTime" Description="创建时间" />
|
||||
<Column Name="CreateIP" DataType="String" Description="创建地址" />
|
||||
<Column Name="Remark" ColumnName="Content" DataType="String" Length="2000" Description="内容" />
|
||||
</Columns>
|
||||
<Indexes>
|
||||
<Index Columns="AppID,Action" />
|
||||
<Index Columns="CreateTime" />
|
||||
</Indexes>
|
||||
</Table>
|
||||
<Table Name="AppConfig" Description="应用配置。各应用的配置数据">
|
||||
<Columns>
|
||||
<Column Name="ID" DataType="Int32" Identity="True" PrimaryKey="True" Description="编号" />
|
||||
<Column Name="AppID" DataType="Int32" Description="设备编号" />
|
||||
<Column Name="Name" DataType="String" Master="True" Description="名称" />
|
||||
<Column Name="Content" DataType="String" Length="5000" Description="内容。一般是json格式" />
|
||||
<Column Name="CreateUserID" DataType="Int32" Description="创建者" />
|
||||
<Column Name="CreateTime" DataType="DateTime" Description="创建时间" />
|
||||
<Column Name="CreateIP" DataType="String" Description="创建地址" />
|
||||
<Column Name="UpdateUserID" DataType="Int32" Description="更新者" />
|
||||
<Column Name="UpdateTime" DataType="DateTime" Description="更新时间" />
|
||||
<Column Name="UpdateIP" DataType="String" Description="更新地址" />
|
||||
</Columns>
|
||||
<Indexes>
|
||||
<Index Columns="AppID,Name" Unique="True" />
|
||||
<Index Columns="UpdateTime" />
|
||||
</Indexes>
|
||||
</Table>
|
||||
<Table Name="Job" Description="作业">
|
||||
<Columns>
|
||||
<Column Name="ID" DataType="Int32" Identity="True" PrimaryKey="True" Description="编号" />
|
||||
|
|
Loading…
Reference in New Issue