feat: 强化代码生成器

This commit is contained in:
wintel
2025-05-10 16:46:09 +08:00
parent b23be0571f
commit 9c0fa9d16a
3 changed files with 10 additions and 1 deletions

View File

@@ -413,6 +413,15 @@ namespace OpenAuth.App
attributeBuilder.Append("\r\n\r\n ");
}
//查找是否存在子表的情况
var subTable = Repository.FirstOrDefault(u => u.ParentTableId == sysTableInfo.Id);
if (subTable != null) //如果子表存在,需要加子表的请求参数
{
attributeBuilder.Append($" public List<AddOrUpdate{subTable.ClassName}Req> {subTable.ClassName}Reqs {{ get; set; }}");
attributeBuilder.Append("\r\n\r\n ");
}
domainContent = domainContent.Replace("{ClassName}", sysTableInfo.ClassName)
.Replace("{AttributeList}", attributeBuilder.ToString());

View File

@@ -6,6 +6,7 @@
// Author:Yubao Li
//------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
using OpenAuth.Repository.Core;

View File

@@ -60,7 +60,6 @@ namespace OpenAuth.App
Repository.Update(u => new {ClassName}
{
//todo: 根据业务需要调整字段
{ClassName} = obj.{ClassName},
Updatetime = DateTime.Now,
Updateuserid = user.Id,
Updateusername = user.Name