升级代码生成器
This commit is contained in:
parent
8f66edaa22
commit
4b7fa28f08
|
@ -7,42 +7,14 @@
|
|||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
[Cc]onfig/
|
||||
[Ll]og/
|
||||
x64/
|
||||
x86/
|
||||
build/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
/packages
|
||||
/Data
|
||||
/Log
|
||||
/Backup
|
||||
/Avatars
|
||||
/BinTest
|
||||
*.user
|
||||
/NewLife.Cube/Config
|
||||
/NewLife.Cube/Plugins
|
||||
/NewLife.CubeNC/Properties/launchSettings.json
|
||||
/CubeDemo/Entity
|
||||
/NewLife.Cube/Entity
|
||||
/CubeDemoNC/wwwroot/Content
|
||||
/NewLife.CubeBlazor
|
||||
/NewLife.CubeBlazor1
|
||||
/NewLife.Cube.VueUI/node_modules
|
||||
/NewLife.Cube.VueUI
|
||||
*.pubxml
|
||||
/.vscode
|
||||
/CubeDemo/Config
|
||||
/XTemp
|
||||
/CubeDemoNC/Areas/School/Models/Config
|
||||
/CubeDemoNC/Areas/School/Models/Log
|
||||
/CubeDemoNC/publish
|
||||
/NewLife.CubeUI/node_modules
|
||||
/WebApplication1
|
||||
/WebApplication2
|
||||
/WebApplication3
|
||||
/WebApplication4
|
||||
/WebApplication5
|
||||
/BinSSO
|
||||
/workspace.code-workspace
|
||||
/Bin3
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<EntityModel xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:schemaLocation="https://newlifex.com https://newlifex.com/Model202309.xsd" Document="https://newlifex.com/xcode/model" xmlns="https://newlifex.com/Model202309.xsd">
|
||||
<EntityModel xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:schemaLocation="https://newlifex.com https://newlifex.com/Model202407.xsd" Document="https://newlifex.com/xcode/model" xmlns="https://newlifex.com/Model202407.xsd">
|
||||
<Option>
|
||||
<!--类名模板。其中{name}替换为Table.Name,如{name}Model/I{name}Dto等-->
|
||||
<ClassNameTemplate />
|
||||
|
@ -72,7 +72,7 @@
|
|||
</Table>
|
||||
<Table Name="OAuthLog" Description="OAuth日志。用于记录OAuth客户端请求,同时Id作为state,避免向OAuthServer泄漏本机Url">
|
||||
<Columns>
|
||||
<Column Name="Id" DataType="Int64" PrimaryKey="True" Description="编号" />
|
||||
<Column Name="Id" DataType="Int64" PrimaryKey="True" DataScale="time" Description="编号" />
|
||||
<Column Name="Provider" DataType="String" Description="提供商" />
|
||||
<Column Name="ConnectId" DataType="Int32" Description="链接" />
|
||||
<Column Name="UserId" DataType="Int32" Description="用户" />
|
||||
|
@ -248,7 +248,7 @@
|
|||
</Table>
|
||||
<Table Name="AppLog" Description="应用日志。用于OAuthServer的子系统">
|
||||
<Columns>
|
||||
<Column Name="Id" DataType="Int64" PrimaryKey="True" Description="编号" />
|
||||
<Column Name="Id" DataType="Int64" PrimaryKey="True" DataScale="time" Description="编号" />
|
||||
<Column Name="AppId" DataType="Int32" Description="应用" />
|
||||
<Column Name="Action" DataType="String" Description="操作" />
|
||||
<Column Name="Success" DataType="Boolean" Description="成功" />
|
||||
|
@ -273,7 +273,7 @@
|
|||
</Table>
|
||||
<Table Name="Attachment" Description="附件。用于记录各系统模块使用的文件,可以是Local/NAS/OSS等">
|
||||
<Columns>
|
||||
<Column Name="Id" DataType="Int64" PrimaryKey="True" Description="编号" />
|
||||
<Column Name="Id" DataType="Int64" PrimaryKey="True" DataScale="time" Description="编号" />
|
||||
<Column Name="Category" DataType="String" Description="业务分类" />
|
||||
<Column Name="Key" DataType="String" Description="业务主键" />
|
||||
<Column Name="Title" DataType="String" Length="200" Description="标题。业务内容作为附件标题,便于查看管理" />
|
||||
|
|
|
@ -29,7 +29,7 @@ public partial class OAuthLog
|
|||
[DisplayName("编号")]
|
||||
[Description("编号")]
|
||||
[DataObjectField(true, false, false, 0)]
|
||||
[BindColumn("Id", "编号", "")]
|
||||
[BindColumn("Id", "编号", "", DataScale = "time")]
|
||||
public Int64 Id { get => _Id; set { if (OnPropertyChanging("Id", value)) { _Id = value; OnPropertyChanged("Id"); } } }
|
||||
|
||||
private String _Provider;
|
||||
|
@ -232,6 +232,20 @@ public partial class OAuthLog
|
|||
#region 关联映射
|
||||
#endregion
|
||||
|
||||
#region 扩展查询
|
||||
#endregion
|
||||
|
||||
#region 数据清理
|
||||
/// <summary>清理指定时间段内的数据</summary>
|
||||
/// <param name="start">开始时间。未指定时清理小于指定时间的所有数据</param>
|
||||
/// <param name="end">结束时间</param>
|
||||
/// <returns>清理行数</returns>
|
||||
public static Int32 DeleteWith(DateTime start, DateTime end)
|
||||
{
|
||||
return Delete(_.Id.Between(start, end, Meta.Factory.Snow));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 字段名
|
||||
/// <summary>取得OAuth日志字段信息的快捷方式</summary>
|
||||
public partial class _
|
||||
|
|
|
@ -353,6 +353,9 @@ public partial class OAuthConfig
|
|||
#region 关联映射
|
||||
#endregion
|
||||
|
||||
#region 扩展查询
|
||||
#endregion
|
||||
|
||||
#region 字段名
|
||||
/// <summary>取得OAuth配置字段信息的快捷方式</summary>
|
||||
public partial class _
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
xcode
|
||||
IF ERRORLEVEL 1 (
|
||||
echo xcode 命令执行失败,正在安装 .NET 工具...
|
||||
dotnet tool install xcodetool -g --prerelease
|
||||
)
|
|
@ -184,6 +184,9 @@ public partial class PrincipalAgent
|
|||
#region 关联映射
|
||||
#endregion
|
||||
|
||||
#region 扩展查询
|
||||
#endregion
|
||||
|
||||
#region 字段名
|
||||
/// <summary>取得委托代理字段信息的快捷方式</summary>
|
||||
public partial class _
|
||||
|
|
|
@ -233,6 +233,9 @@ public partial class CronJob
|
|||
#region 关联映射
|
||||
#endregion
|
||||
|
||||
#region 扩展查询
|
||||
#endregion
|
||||
|
||||
#region 字段名
|
||||
/// <summary>取得定时作业字段信息的快捷方式</summary>
|
||||
public partial class _
|
||||
|
|
|
@ -214,6 +214,9 @@ public partial class AppModule
|
|||
#region 关联映射
|
||||
#endregion
|
||||
|
||||
#region 扩展查询
|
||||
#endregion
|
||||
|
||||
#region 字段名
|
||||
/// <summary>取得应用插件字段信息的快捷方式</summary>
|
||||
public partial class _
|
||||
|
|
|
@ -27,7 +27,7 @@ public partial class AppLog
|
|||
[DisplayName("编号")]
|
||||
[Description("编号")]
|
||||
[DataObjectField(true, false, false, 0)]
|
||||
[BindColumn("Id", "编号", "")]
|
||||
[BindColumn("Id", "编号", "", DataScale = "time")]
|
||||
public Int64 Id { get => _Id; set { if (OnPropertyChanging("Id", value)) { _Id = value; OnPropertyChanged("Id"); } } }
|
||||
|
||||
private Int32 _AppId;
|
||||
|
@ -232,6 +232,20 @@ public partial class AppLog
|
|||
#region 关联映射
|
||||
#endregion
|
||||
|
||||
#region 扩展查询
|
||||
#endregion
|
||||
|
||||
#region 数据清理
|
||||
/// <summary>清理指定时间段内的数据</summary>
|
||||
/// <param name="start">开始时间。未指定时清理小于指定时间的所有数据</param>
|
||||
/// <param name="end">结束时间</param>
|
||||
/// <returns>清理行数</returns>
|
||||
public static Int32 DeleteWith(DateTime start, DateTime end)
|
||||
{
|
||||
return Delete(_.Id.Between(start, end, Meta.Factory.Snow));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 字段名
|
||||
/// <summary>取得应用日志字段信息的快捷方式</summary>
|
||||
public partial class _
|
||||
|
|
|
@ -305,6 +305,9 @@ public partial class App
|
|||
#region 关联映射
|
||||
#endregion
|
||||
|
||||
#region 扩展查询
|
||||
#endregion
|
||||
|
||||
#region 字段名
|
||||
/// <summary>取得应用系统字段信息的快捷方式</summary>
|
||||
public partial class _
|
||||
|
|
|
@ -233,6 +233,9 @@ public partial class OrderManager
|
|||
#region 关联映射
|
||||
#endregion
|
||||
|
||||
#region 扩展查询
|
||||
#endregion
|
||||
|
||||
#region 字段名
|
||||
/// <summary>取得指令管理字段信息的快捷方式</summary>
|
||||
public partial class _
|
||||
|
|
|
@ -392,6 +392,9 @@ public partial class ModelColumn
|
|||
#region 关联映射
|
||||
#endregion
|
||||
|
||||
#region 扩展查询
|
||||
#endregion
|
||||
|
||||
#region 字段名
|
||||
/// <summary>取得模型列字段信息的快捷方式</summary>
|
||||
public partial class _
|
||||
|
|
|
@ -222,6 +222,21 @@ public partial class ModelTable
|
|||
#region 关联映射
|
||||
#endregion
|
||||
|
||||
#region 扩展查询
|
||||
/// <summary>根据分类查找</summary>
|
||||
/// <param name="category">分类</param>
|
||||
/// <returns>实体列表</returns>
|
||||
public static IList<ModelTable> FindAllByCategory(String category)
|
||||
{
|
||||
if (category.IsNullOrEmpty()) return [];
|
||||
|
||||
// 实体缓存
|
||||
if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.Category.EqualIgnoreCase(category));
|
||||
|
||||
return FindAll(_.Category == category);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 字段名
|
||||
/// <summary>取得模型表字段信息的快捷方式</summary>
|
||||
public partial class _
|
||||
|
|
|
@ -234,6 +234,9 @@ public partial class UserToken
|
|||
#region 关联映射
|
||||
#endregion
|
||||
|
||||
#region 扩展查询
|
||||
#endregion
|
||||
|
||||
#region 字段名
|
||||
/// <summary>取得用户令牌字段信息的快捷方式</summary>
|
||||
public partial class _
|
||||
|
|
|
@ -273,6 +273,9 @@ public partial class UserOnline
|
|||
#region 关联映射
|
||||
#endregion
|
||||
|
||||
#region 扩展查询
|
||||
#endregion
|
||||
|
||||
#region 字段名
|
||||
/// <summary>取得用户在线字段信息的快捷方式</summary>
|
||||
public partial class _
|
||||
|
|
|
@ -209,6 +209,9 @@ public partial class UserStat
|
|||
#region 关联映射
|
||||
#endregion
|
||||
|
||||
#region 扩展查询
|
||||
#endregion
|
||||
|
||||
#region 字段名
|
||||
/// <summary>取得用户统计字段信息的快捷方式</summary>
|
||||
public partial class _
|
||||
|
|
|
@ -257,6 +257,34 @@ public partial class UserConnect
|
|||
#region 关联映射
|
||||
#endregion
|
||||
|
||||
#region 扩展查询
|
||||
/// <summary>根据提供商查找</summary>
|
||||
/// <param name="provider">提供商</param>
|
||||
/// <returns>实体列表</returns>
|
||||
public static IList<UserConnect> FindAllByProvider(String provider)
|
||||
{
|
||||
if (provider.IsNullOrEmpty()) return [];
|
||||
|
||||
// 实体缓存
|
||||
if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.Provider.EqualIgnoreCase(provider));
|
||||
|
||||
return FindAll(_.Provider == provider);
|
||||
}
|
||||
|
||||
/// <summary>根据全局标识查找</summary>
|
||||
/// <param name="unionId">全局标识</param>
|
||||
/// <returns>实体列表</returns>
|
||||
public static IList<UserConnect> FindAllByUnionID(String unionId)
|
||||
{
|
||||
if (unionId.IsNullOrEmpty()) return [];
|
||||
|
||||
// 实体缓存
|
||||
if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.UnionID.EqualIgnoreCase(unionId));
|
||||
|
||||
return FindAll(_.UnionID == unionId);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 字段名
|
||||
/// <summary>取得用户链接字段信息的快捷方式</summary>
|
||||
public partial class _
|
||||
|
|
|
@ -263,6 +263,9 @@ public partial class AccessRule
|
|||
#region 关联映射
|
||||
#endregion
|
||||
|
||||
#region 扩展查询
|
||||
#endregion
|
||||
|
||||
#region 字段名
|
||||
/// <summary>取得访问规则字段信息的快捷方式</summary>
|
||||
public partial class _
|
||||
|
|
|
@ -29,7 +29,7 @@ public partial class Attachment
|
|||
[DisplayName("编号")]
|
||||
[Description("编号")]
|
||||
[DataObjectField(true, false, false, 0)]
|
||||
[BindColumn("Id", "编号", "")]
|
||||
[BindColumn("Id", "编号", "", DataScale = "time")]
|
||||
public Int64 Id { get => _Id; set { if (OnPropertyChanging("Id", value)) { _Id = value; OnPropertyChanged("Id"); } } }
|
||||
|
||||
private String _Category;
|
||||
|
@ -298,6 +298,20 @@ public partial class Attachment
|
|||
#region 关联映射
|
||||
#endregion
|
||||
|
||||
#region 扩展查询
|
||||
#endregion
|
||||
|
||||
#region 数据清理
|
||||
/// <summary>清理指定时间段内的数据</summary>
|
||||
/// <param name="start">开始时间。未指定时清理小于指定时间的所有数据</param>
|
||||
/// <param name="end">结束时间</param>
|
||||
/// <returns>清理行数</returns>
|
||||
public static Int32 DeleteWith(DateTime start, DateTime end)
|
||||
{
|
||||
return Delete(_.Id.Between(start, end, Meta.Factory.Snow));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 字段名
|
||||
/// <summary>取得附件字段信息的快捷方式</summary>
|
||||
public partial class _
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
using System.Reflection;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.ApplicationParts;
|
||||
using Microsoft.AspNetCore.Mvc.Razor;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using NewLife.Cube.Entity;
|
||||
using NewLife.Log;
|
||||
using NewLife.Reflection;
|
||||
|
@ -45,13 +42,12 @@ public class ModuleManager
|
|||
|
||||
var assembly = Assembly.LoadFrom(filePath);
|
||||
type = assembly.GetType(item.ClassName);
|
||||
if (services != null) {
|
||||
services.AddMvc()
|
||||
.ConfigureApplicationPartManager(_ => {
|
||||
services?.AddMvc()
|
||||
.ConfigureApplicationPartManager(_ =>
|
||||
{
|
||||
_.ApplicationParts.Add(new CompiledRazorAssemblyPart(assembly));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (type != null)
|
||||
{
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"profiles": {
|
||||
"NewLife.CubeNC": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"applicationUrl": "https://localhost:58433;http://localhost:58434"
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue