vengine初步实现增删改查

This commit is contained in:
2023-09-06 18:50:20 +08:00
parent b52e48ce9a
commit 64e1a60780
41 changed files with 2820 additions and 2752 deletions

View File

@@ -0,0 +1,34 @@
/////////////////////////////////////////////////////////////////////////////////
// 宁波拓通e智造平台 ToTong Next Builder //
// https://git.tuotong-tech.com/tnb/tnb-server //
/////////////////////////////////////////////////////////////////////////////////
@using Tnb.Core;
@using Tnb.Vengine;
@using Tnb.Vengine.Domain;
@{
AcmenVmodelContext context = Model;
Vmodel vm = context.Vm;
}
using Microsoft.AspNetCore.Mvc;
using Tnb.Core;
using Tnb.Vengine.AppService;
using Tnb.Vengine.DataAccess;
using Tnb.Vengine.Domain;
using @(context.NsPrefix + "." + vm.areaCode + ".Domain");
namespace @(context.NsPrefix + "." + vm.areaCode + ".AppService");
/// <summary>
/// 模型 @vm.vmName 应用服务类
/// </summary>
[ApiExplorerSettings(GroupName = Consts.ApiGroupCode)]
public class @(vm.vmCode)AppService : VengineAppService<@(vm.vmCode)>
{
/// <summary>
/// 构造函数
/// </summary>
public @(vm.vmCode)AppService(IDataAccess da) : base(da)
{
}
}

View File

@@ -0,0 +1,26 @@
/////////////////////////////////////////////////////////////////////////////////
// 宁波拓通e智造平台 ToTong Next Builder //
// https://git.tuotong-tech.com/tnb/tnb-server //
/////////////////////////////////////////////////////////////////////////////////
@using Tnb.Core;
@using Tnb.Vengine;
@using Tnb.Vengine.Domain;
@{
AcmenVmodelContext context = Model;
Vmodel vm = context.Vm;
}
using Tnb.Core;
namespace @(context.NsPrefix + "." + vm.areaCode + ".AppService");
/// <summary>
/// @(vm.vmCode)Dto对象
/// </summary>
public partial class @(vm.vmCode)Dto
{
@foreach (var col in vm.dbProps.OrderBy(a => a.ordinal)){
@://public @(col.required ? col.csType : (col.csType + "?")) @col.code { get; set; }@(col.GetDefaultValueString())
}
}

View File

@@ -0,0 +1,31 @@
////////////////////////////////////////////////////
// 本文件由拓通低代码开发平台自动生成,请不要修改 //
// ________ ___ ________ //
// /__ __/ / \ /__ __/ //
// / / / / / / //
// / / / / / / //
// /__/ \___/ /__/ //
// //
////////////////////////////////////////////////////
@using Tnb.Core;
@using Tnb.Vengine;
@using Tnb.Vengine.Domain;
@{
AcmenVmodelContext context = Model;
Vmodel vm = context.Vm;
}
using Tnb.Core;
namespace @(context.NsPrefix + "." + vm.areaCode + ".AppService");
/// <summary>
/// @(vm.vmCode)Dto对象
/// </summary>
public partial class @(vm.vmCode)Dto
{
@foreach (var col in vm.dbProps.OrderBy(a => a.ordinal)){
@://public @(col.required ? col.csType : (col.csType + "?")) @col.code { get; set; }@(col.GetDefaultValueString())
}
}

View File

@@ -0,0 +1,22 @@
/////////////////////////////////////////////////////////////////////////////////
// 宁波拓通e智造平台 ToTong Next Builder //
// https://git.tuotong-tech.com/tnb/tnb-server //
/////////////////////////////////////////////////////////////////////////////////
@using Tnb.Core;
@using Tnb.Vengine;
@using Tnb.Vengine.Domain;
@{
AcmenVmodelContext context = Model;
Vmodel vm = context.Vm;
}
using Tnb.Core;
namespace @(context.NsPrefix + "." + vm.areaCode + ".Domain");
/// <summary>
/// @vm.vmName
/// </summary>
public partial class @vm.vmCode
{
}

View File

@@ -0,0 +1,54 @@
////////////////////////////////////////////////////
// 本文件由拓通低代码开发平台自动生成,请不要修改 //
// ________ ___ ________ //
// /__ __/ / \ /__ __/ //
// / / / / / / //
// / / / / / / //
// /__/ \___/ /__/ //
// //
////////////////////////////////////////////////////
@using JNPF.Common.Extension;
@using Tnb.Core;
@using Tnb.Vengine;
@using Tnb.Vengine.Domain;
@{
AcmenVmodelContext context = Model;
Vmodel vm = context.Vm;
}
using Newtonsoft.Json.Linq;
using SqlSugar;
using Tnb.Core;
using Yitter.IdGenerator;
namespace @(context.NsPrefix + "." + vm.areaCode + ".Domain");
/// <summary>
/// @vm.vmName
/// </summary>
[SugarTable("@vm.tableName")]
public partial class @vm.vmCode : Entity
{
#region Properties
@foreach (var col in vm.dbProps.OrderBy(a=>a.ordinal)) {
@:/// <summary>
@:/// @col.name
@:/// </summary>
@col.GetAttributeString()
@:public @(col.required ? col.csType : (col.csType + "?")) @col.code { get; set; }@(col.GetDefaultValueString())
@:
}
#endregion
/// <summary>
/// 主键
/// </summary>
public override object[] GetKeys()
{
return new object[] { @(vm.dbProps.Where(a=>a.pkey).Select(a=>a.code).JoinAsString(", ")) };
}
@foreach (var col in vm.dbProps.OrderBy(a => a.ordinal)){
@://public @(col.required ? col.csType : (col.csType + "?")) @col.code { get; set; }@(col.GetDefaultValueString())
}
}