[fix] 修复db生成代码的bug
parent
874f966a40
commit
ea30f8c202
|
|
@ -339,27 +339,5 @@ namespace Luban.Job.Cfg.Utils
|
|||
{
|
||||
return type.Apply(CsEditorInitValueVisitor.Ins);
|
||||
}
|
||||
public static string CsStartNameSpaceGrace(string np)
|
||||
{
|
||||
if (string.IsNullOrEmpty(np))
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
return $"namespace {np}\n{{";
|
||||
}
|
||||
}
|
||||
public static string CsEndNameSpaceGrace(string np)
|
||||
{
|
||||
if (string.IsNullOrEmpty(np))
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
return "}";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -318,5 +318,28 @@ namespace Luban.Job.Common.Defs
|
|||
{
|
||||
return type is TDateTime && !type.IsNullable && ExternalTypeUtil.GetExternalTypeMappfer("datetime") == null;
|
||||
}
|
||||
|
||||
public static string CsStartNameSpaceGrace(string np)
|
||||
{
|
||||
if (string.IsNullOrEmpty(np))
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
return $"namespace {np}\n{{";
|
||||
}
|
||||
}
|
||||
public static string CsEndNameSpaceGrace(string np)
|
||||
{
|
||||
if (string.IsNullOrEmpty(np))
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
return "}";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ namespace Luban.Job.Db.Generate
|
|||
public string Render(DefEnum e)
|
||||
{
|
||||
var template = StringTemplateManager.Ins.GetTemplate("common/cs/enum");
|
||||
var result = template.Render(e);
|
||||
var result = template.RenderCode(e);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ public {{x.cs_class_modifier}} class {{name}} : {{if parent_def_type}} {{x.paren
|
|||
public {{db_cs_define_type ctype}} {{field.convention_name}} => {{field.internal_name}};
|
||||
{{~end~}}
|
||||
|
||||
{{~if ctype.bean || ctype.element_type ~}}
|
||||
{{~if ctype.bean || (ctype.element_type && !ctype.is_map) ~}}
|
||||
{{~if field.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{field.escape_comment}}
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ public {{x.cs_class_modifier}} class {{name}} : {{if parent_def_type}} {{x.paren
|
|||
public {{db_cs_define_type ctype}} {{field.convention_name}} => {{field.internal_name}};
|
||||
{{~end~}}
|
||||
|
||||
{{~if ctype.bean || ctype.element_type ~}}
|
||||
{{~if ctype.bean || (ctype.element_type && !ctype.is_map) ~}}
|
||||
{{~if field.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{field.escape_comment}}
|
||||
|
|
|
|||
Loading…
Reference in New Issue