代码生成的字段Comment换成Remark

This commit is contained in:
yubaolee 2025-02-19 16:55:47 +08:00
parent 2a2d83d026
commit 355168b43d
12 changed files with 22 additions and 26 deletions

View File

@ -35,8 +35,7 @@ namespace OpenAuth.App
public T Get(string id) public T Get(string id)
{ {
if (SugarClient.CurrentConnectionConfig.DbType == DbType.PostgreSQL if (SugarClient.CurrentConnectionConfig.DbType == DbType.PostgreSQL)
|| SugarClient.CurrentConnectionConfig.DbType == DbType.Oracle)
{ {
return SugarClient.Queryable<T>().Where("\"Id\"=@id", new {id = id}).First(); return SugarClient.Queryable<T>().Where("\"Id\"=@id", new {id = id}).First();
} }

View File

@ -148,7 +148,7 @@ namespace OpenAuth.App
var builderColumn = new BuilderTableColumn var builderColumn = new BuilderTableColumn
{ {
ColumnName = column.ColumnName, ColumnName = column.ColumnName,
Comment = column.Comment, Remark = column.Comment,
ColumnType = column.ColumnType, ColumnType = column.ColumnType,
EntityType = column.EntityType, EntityType = column.EntityType,
EntityName = column.ColumnName, EntityName = column.ColumnName,
@ -178,7 +178,7 @@ namespace OpenAuth.App
UnitWork.Update<BuilderTable>(u => u.Id == obj.Id, u => new BuilderTable UnitWork.Update<BuilderTable>(u => u.Id == obj.Id, u => new BuilderTable
{ {
TableName = obj.TableName, TableName = obj.TableName,
Comment = obj.Comment, Remark = obj.Remark,
ClassName = obj.ClassName, ClassName = obj.ClassName,
Namespace = obj.Namespace, Namespace = obj.Namespace,
ModuleCode = obj.ModuleCode, ModuleCode = obj.ModuleCode,
@ -365,7 +365,7 @@ namespace OpenAuth.App
{ {
attributeBuilder.Append("/// <summary>"); attributeBuilder.Append("/// <summary>");
attributeBuilder.Append("\r\n"); attributeBuilder.Append("\r\n");
attributeBuilder.Append(" ///" + column.Comment + ""); attributeBuilder.Append(" ///" + column.Remark + "");
attributeBuilder.Append("\r\n"); attributeBuilder.Append("\r\n");
attributeBuilder.Append(" /// </summary>"); attributeBuilder.Append(" /// </summary>");
attributeBuilder.Append("\r\n"); attributeBuilder.Append("\r\n");
@ -386,7 +386,7 @@ namespace OpenAuth.App
var tableAttr = new StringBuilder(); var tableAttr = new StringBuilder();
tableAttr.Append("/// <summary>"); tableAttr.Append("/// <summary>");
tableAttr.Append("\r\n"); tableAttr.Append("\r\n");
tableAttr.Append(" ///" + sysTableInfo.Comment + ""); tableAttr.Append(" ///" + sysTableInfo.Remark + "");
tableAttr.Append("\r\n"); tableAttr.Append("\r\n");
tableAttr.Append(" /// </summary>"); tableAttr.Append(" /// </summary>");
tableAttr.Append("\r\n"); tableAttr.Append("\r\n");
@ -463,12 +463,12 @@ namespace OpenAuth.App
attributeBuilder.Append("/// <summary>"); attributeBuilder.Append("/// <summary>");
attributeBuilder.Append("\r\n"); attributeBuilder.Append("\r\n");
attributeBuilder.Append(" ///" + column.Comment + ""); attributeBuilder.Append(" ///" + column.Remark + "");
attributeBuilder.Append("\r\n"); attributeBuilder.Append("\r\n");
attributeBuilder.Append(" /// </summary>"); attributeBuilder.Append(" /// </summary>");
attributeBuilder.Append("\r\n"); attributeBuilder.Append("\r\n");
attributeBuilder.Append(" [Description(\""+ column.Comment +"\")]"); attributeBuilder.Append(" [Description(\""+ column.Remark +"\")]");
attributeBuilder.Append("\r\n"); attributeBuilder.Append("\r\n");
string entityType = column.EntityType; string entityType = column.EntityType;
@ -523,7 +523,7 @@ namespace OpenAuth.App
tableAttr.Append("/// <summary>"); tableAttr.Append("/// <summary>");
tableAttr.Append("\r\n"); tableAttr.Append("\r\n");
tableAttr.Append(" ///" + tableInfo.Comment + ""); tableAttr.Append(" ///" + tableInfo.Remark + "");
tableAttr.Append("\r\n"); tableAttr.Append("\r\n");
tableAttr.Append(" /// </summary>"); tableAttr.Append(" /// </summary>");
tableAttr.Append("\r\n"); tableAttr.Append("\r\n");
@ -735,7 +735,7 @@ namespace OpenAuth.App
foreach (BuilderTableColumn column in syscolums) foreach (BuilderTableColumn column in syscolums)
{ {
headerListBuilder.Append( headerListBuilder.Append(
$" new ColumnDefine('{column.ColumnName.ToCamelCase()}', '{column.Comment}', {column.IsEdit.ToString().ToLower()}, {column.IsList.ToString().ToLower()}, '{column.EditType}', '{column.DataSource}', '{column.EntityType}', '{column.ColumnType}', '{column.EntityName}'),"); $" new ColumnDefine('{column.ColumnName.ToCamelCase()}', '{column.Remark}', {column.IsEdit.ToString().ToLower()}, {column.IsList.ToString().ToLower()}, '{column.EditType}', '{column.DataSource}', '{column.EntityType}', '{column.ColumnType}', '{column.EntityName}'),");
headerListBuilder.Append("\r\n "); headerListBuilder.Append("\r\n ");
} }

View File

@ -57,7 +57,7 @@ namespace OpenAuth.App
TableId = obj.TableId, TableId = obj.TableId,
TableName = obj.TableName, TableName = obj.TableName,
ColumnName = obj.ColumnName, ColumnName = obj.ColumnName,
Comment = obj.Comment, Remark = obj.Remark,
ColumnType = obj.ColumnType, ColumnType = obj.ColumnType,
EntityType = obj.EntityType, EntityType = obj.EntityType,
EntityName = obj.EntityName, EntityName = obj.EntityName,
@ -107,7 +107,7 @@ namespace OpenAuth.App
var builderColumn = new BuilderTableColumn var builderColumn = new BuilderTableColumn
{ {
ColumnName = column.ColumnName, ColumnName = column.ColumnName,
Comment = column.Comment, Remark = column.Comment,
ColumnType = column.ColumnType, ColumnType = column.ColumnType,
EntityType = column.EntityType, EntityType = column.EntityType,
EntityName = column.ColumnName, EntityName = column.ColumnName,

View File

@ -42,7 +42,7 @@ namespace OpenAuth.App.Request
/// <summary> /// <summary>
/// 列描述 /// 列描述
/// </summary> /// </summary>
public string Comment { get; set; } public string Remark { get; set; }
/// <summary> /// <summary>
/// 列类型 /// 列类型
/// </summary> /// </summary>

View File

@ -33,7 +33,7 @@ namespace OpenAuth.App.Request
/// <summary> /// <summary>
/// 表描述、中文名称 /// 表描述、中文名称
/// </summary> /// </summary>
public string Comment { get; set; } public string Remark { get; set; }
/// <summary> /// <summary>
/// 父表ID /// 父表ID

View File

@ -72,7 +72,7 @@ namespace OpenAuth.App
{ {
ColumnName = property.Name, ColumnName = property.Name,
TableName = moduleName, TableName = moduleName,
Comment = description, Remark = description,
IsList = browsable, IsList = browsable,
ColumnType = typeName ColumnType = typeName
}); });

View File

@ -85,8 +85,7 @@ namespace OpenAuth.App
} }
var columnnames = columnFields.Select(u => u.ColumnName); var columnnames = columnFields.Select(u => u.ColumnName);
if (SugarClient.CurrentConnectionConfig.DbType == DbType.PostgreSQL if (SugarClient.CurrentConnectionConfig.DbType == DbType.PostgreSQL)
|| SugarClient.CurrentConnectionConfig.DbType == DbType.Oracle)
{ {
columnnames = columnFields.Select(u => "\"" + u.ColumnName +"\""); columnnames = columnFields.Select(u => "\"" + u.ColumnName +"\"");
} }

View File

@ -41,8 +41,7 @@ namespace OpenAuth.App
} }
var columnnames = columnFields.Select(u => u.ColumnName); var columnnames = columnFields.Select(u => u.ColumnName);
if (SugarClient.CurrentConnectionConfig.DbType == DbType.PostgreSQL if (SugarClient.CurrentConnectionConfig.DbType == DbType.PostgreSQL)
|| SugarClient.CurrentConnectionConfig.DbType == DbType.Oracle)
{ {
columnnames = columnFields.Select(u => "\"" + u.ColumnName +"\""); columnnames = columnFields.Select(u => "\"" + u.ColumnName +"\"");
} }

View File

@ -57,7 +57,7 @@ namespace OpenAuth.App.Test
app.Add(new AddOrUpdateBuilderTableReq() app.Add(new AddOrUpdateBuilderTableReq()
{ {
TableName = "Stock", TableName = "Stock",
Comment = "这是一个普通的应用管理生成模版", Remark = "这是一个普通的应用管理生成模版",
ClassName = "Stock", ClassName = "Stock",
Namespace = "OpenAuth.Repository.Domain", Namespace = "OpenAuth.Repository.Domain",
ModuleCode = "StockApp", ModuleCode = "StockApp",

View File

@ -25,7 +25,7 @@ namespace OpenAuth.Repository.Domain
public BuilderTable() public BuilderTable()
{ {
this.TableName= string.Empty; this.TableName= string.Empty;
this.Comment= string.Empty; this.Remark= string.Empty;
this.DetailTableName= string.Empty; this.DetailTableName= string.Empty;
this.DetailComment= string.Empty; this.DetailComment= string.Empty;
this.ClassName= string.Empty; this.ClassName= string.Empty;
@ -54,7 +54,7 @@ namespace OpenAuth.Repository.Domain
/// 表描述、中文名称 /// 表描述、中文名称
/// </summary> /// </summary>
[Description("表描述、中文名称")] [Description("表描述、中文名称")]
public string Comment { get; set; } public string Remark { get; set; }
/// <summary> /// <summary>
/// 子表英文全称 /// 子表英文全称
/// </summary> /// </summary>

View File

@ -27,7 +27,7 @@ namespace OpenAuth.Repository.Domain
this.TableId= string.Empty; this.TableId= string.Empty;
this.TableName= string.Empty; this.TableName= string.Empty;
this.ColumnName= string.Empty; this.ColumnName= string.Empty;
this.Comment= string.Empty; this.Remark= string.Empty;
this.ColumnType= string.Empty; this.ColumnType= string.Empty;
this.EntityType= string.Empty; this.EntityType= string.Empty;
this.EntityName= string.Empty; this.EntityName= string.Empty;
@ -64,7 +64,7 @@ namespace OpenAuth.Repository.Domain
/// 列描述 /// 列描述
/// </summary> /// </summary>
[Description("列描述")] [Description("列描述")]
public string Comment { get; set; } public string Remark { get; set; }
/// <summary> /// <summary>
/// 列类型 /// 列类型
/// </summary> /// </summary>

View File

@ -187,8 +187,7 @@ namespace OpenAuth.WebApi
IsAutoCloseConnection = true, IsAutoCloseConnection = true,
MoreSettings=new ConnMoreSettings() { MoreSettings=new ConnMoreSettings() {
PgSqlIsAutoToLower = false,//增删查改支持驼峰表 PgSqlIsAutoToLower = false,//增删查改支持驼峰表
PgSqlIsAutoToLowerCodeFirst = false, // 建表建驼峰表。5.1.3.30 PgSqlIsAutoToLowerCodeFirst = false// 建表建驼峰表。5.1.3.30
IsAutoToUpper=false //禁用自动转成大写表
} }
}, db => { db.Aop.OnLogExecuting = (sql, pars) => { logger.LogInformation(sql); }; }); }, db => { db.Aop.OnLogExecuting = (sql, pars) => { logger.LogInformation(sql); }; });
return sqlSugar; return sqlSugar;