【优化】优化从table中读取field的desc值的方式,先找##desc行,再找##comment行,最后找##行
【修复】修复 comment 未对换行或者 '<' 等字符escape,产生非法注释进而导致编译错误的bugmain
parent
5d8c3d454e
commit
4cff35fb84
|
|
@ -300,12 +300,7 @@ namespace Luban.Job.Cfg.DataSources.Excel
|
|||
|
||||
private static bool IsTypeRow(List<Cell> row)
|
||||
{
|
||||
if (row.Count == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var s = row[0].Value?.ToString()?.Trim();
|
||||
return s == "##type";
|
||||
return IsRowTagEqual(row, "##type");
|
||||
}
|
||||
|
||||
private static bool IsHeaderRow(List<Cell> row)
|
||||
|
|
@ -318,6 +313,16 @@ namespace Luban.Job.Cfg.DataSources.Excel
|
|||
return !string.IsNullOrEmpty(s) && s.StartsWith("##");
|
||||
}
|
||||
|
||||
private static bool IsRowTagEqual(List<Cell> row, string tag)
|
||||
{
|
||||
if (row.Count == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var s = row[0].Value?.ToString()?.Trim();
|
||||
return s == tag;
|
||||
}
|
||||
|
||||
private static List<List<Cell>> ParseRawSheetContent(IExcelDataReader reader, bool orientRow, bool headerOnly)
|
||||
{
|
||||
// TODO 优化性能
|
||||
|
|
@ -413,7 +418,17 @@ namespace Luban.Job.Cfg.DataSources.Excel
|
|||
throw new Exception($"缺失type行。请用'##type'标识type行");
|
||||
}
|
||||
List<Cell> typeRow = cells[typeRowIndex];
|
||||
List<Cell> descRow = cells.Count > typeRowIndex + 1 ? cells[typeRowIndex + 1] : null;
|
||||
|
||||
// 先找 ##desc 行,再找##comment行,最后找 ##type的下一行
|
||||
List<Cell> descRow = cells.Find(row => IsRowTagEqual(row, "##desc"));
|
||||
if (descRow == null)
|
||||
{
|
||||
descRow = cells.Find(row => IsRowTagEqual(row, "##comment"));
|
||||
}
|
||||
if (descRow == null)
|
||||
{
|
||||
descRow = cells.Count > 1 ? cells.Skip(1).FirstOrDefault(row => IsRowTagEqual(row, "##")) : null;
|
||||
}
|
||||
|
||||
var fields = new Dictionary<string, FieldInfo>();
|
||||
foreach (var subTitle in title.SubTitleList)
|
||||
|
|
|
|||
|
|
@ -292,7 +292,7 @@ namespace Luban.Job.Cfg.Defs
|
|||
var stream = new MemoryStream(await this.Agent.GetFromCacheOrReadAllBytesAsync(file.ActualFile, file.MD5));
|
||||
var tableDefInfo = source.LoadTableDefInfo(file.OriginFile, file.SheetName, stream);
|
||||
|
||||
var cb = new CfgBean() { Namespace = table.Namespace, Name = table.ValueType, };
|
||||
var cb = new CfgBean() { Namespace = table.Namespace, Name = table.ValueType, Comment = "" };
|
||||
#if !LUBAN_LITE
|
||||
foreach (var (name, f) in tableDefInfo.FieldInfos)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@ namespace Luban.Job.Common.Defs
|
|||
|
||||
public string Comment { get; set; }
|
||||
|
||||
public string EscapeComment => DefUtil.EscapeCommentByCurrentLanguage(Comment);
|
||||
|
||||
public Dictionary<string, string> Tags { get; set; }
|
||||
|
||||
public bool HasTag(string attrName)
|
||||
|
|
|
|||
|
|
@ -71,6 +71,8 @@ namespace Luban.Job.Common.Defs
|
|||
|
||||
public string Comment { get; }
|
||||
|
||||
public string EscapeComment => DefUtil.EscapeCommentByCurrentLanguage(Comment);
|
||||
|
||||
public Dictionary<string, string> Tags { get; }
|
||||
|
||||
public bool IgnoreNameValidation { get; set; }
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using Luban.Common.Utils;
|
||||
using Luban.Job.Common.Utils;
|
||||
using Luban.Server.Common;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
|
@ -48,6 +49,8 @@ namespace Luban.Job.Common.Defs
|
|||
|
||||
public string Comment { get; protected set; }
|
||||
|
||||
public string EscapeComment => DefUtil.EscapeCommentByCurrentLanguage(Comment);
|
||||
|
||||
public Dictionary<string, string> Tags { get; protected set; }
|
||||
|
||||
public bool HasTag(string attrName)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
using Bright.Collections;
|
||||
using Luban.Job.Common.Defs;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
|
||||
namespace Luban.Job.Common.Utils
|
||||
{
|
||||
|
|
@ -154,5 +156,25 @@ namespace Luban.Job.Common.Utils
|
|||
return tags1;
|
||||
}
|
||||
}
|
||||
|
||||
public static string EscapeCommentByCurrentLanguage(string comment)
|
||||
{
|
||||
//comment = comment.Replace('\n', ' ').Replace('\r', ' ');
|
||||
var curLan = DefAssemblyBase.LocalAssebmly.CurrentLanguage;
|
||||
switch (curLan)
|
||||
{
|
||||
case ELanguage.INVALID: throw new Exception($"not set current language. can't get recommend naming convention name");
|
||||
case ELanguage.CS:
|
||||
case ELanguage.JAVA:
|
||||
case ELanguage.GO:
|
||||
case ELanguage.CPP:
|
||||
case ELanguage.LUA:
|
||||
case ELanguage.JS:
|
||||
case ELanguage.TYPESCRIPT:
|
||||
case ELanguage.PYTHON:
|
||||
case ELanguage.RUST: return WebUtility.HtmlDecode(comment).Replace("\n", "<br/>");
|
||||
default: throw new Exception($"unknown language:{curLan}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{{cpp_namespace_begin}}
|
||||
{{~if comment != '' ~}}
|
||||
/**
|
||||
* {{comment}}
|
||||
* {{comment | html.escape}}
|
||||
*/
|
||||
{{~end~}}
|
||||
enum class {{name}}
|
||||
|
|
@ -9,7 +9,7 @@ enum class {{name}}
|
|||
{{~ for item in items ~}}
|
||||
{{~if item.comment != '' ~}}
|
||||
/**
|
||||
* {{item.comment}}
|
||||
* {{item.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
{{item.name}} = {{item.value}},
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ namespace {{namespace_with_top_module}}
|
|||
{
|
||||
{{~if comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{comment}}
|
||||
/// {{comment | html.escape}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
{{~if is_flags~}}
|
||||
|
|
@ -14,7 +14,7 @@ namespace {{namespace_with_top_module}}
|
|||
{{~ for item in items ~}}
|
||||
{{~if item.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{item.comment}}
|
||||
/// {{item.escape_comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
{{item.name}} = {{item.value}},
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
package {{namespace_with_top_module}};
|
||||
{{~if comment != '' ~}}
|
||||
/**
|
||||
* {{comment}}
|
||||
* {{comment | html.escape}}
|
||||
*/
|
||||
{{~end~}}
|
||||
public enum {{name}} {
|
||||
{{~ for item in items ~}}
|
||||
{{~if item.comment != '' ~}}
|
||||
/**
|
||||
* {{item.comment}}
|
||||
* {{item.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
{{item.name}}({{item.int_value}}),
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
{{~if comment != '' ~}}
|
||||
'''
|
||||
{{comment}}
|
||||
{{comment | html.escape}}
|
||||
'''
|
||||
{{~end~}}
|
||||
class {{py_full_name}}(Enum):
|
||||
{{~ for item in items ~}}
|
||||
{{~if item.comment != '' ~}}
|
||||
'''
|
||||
{{item.comment}}
|
||||
{{item.escape_comment}}
|
||||
'''
|
||||
{{~end~}}
|
||||
{{item.name}} = {{item.value}}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{{~if comment != '' ~}}
|
||||
/**
|
||||
* {{comment}}
|
||||
* {{comment | html.escape}}
|
||||
*/
|
||||
{{~end~}}
|
||||
#[allow(dead_code)]
|
||||
|
|
@ -9,7 +9,7 @@ pub enum {{rust_full_name}} {
|
|||
{{~for item in items ~}}
|
||||
{{~if item.comment != '' ~}}
|
||||
/**
|
||||
* {{item.comment}}
|
||||
* {{item.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
{{item.name}} = {{item.int_value}},
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
{{typescript_namespace_begin}}
|
||||
{{~if comment != '' ~}}
|
||||
/**
|
||||
* {{comment}}
|
||||
* {{comment | html.escape}}
|
||||
*/
|
||||
{{~end~}}
|
||||
export enum {{name}} {
|
||||
{{~for item in items ~}}
|
||||
{{~if item.comment != '' ~}}
|
||||
/**
|
||||
* {{item.comment}}
|
||||
* {{item.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
{{item.name}} = {{item.value}},
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
{{~if x.comment != '' ~}}
|
||||
/**
|
||||
* {{x.comment}}
|
||||
* {{x.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
class {{name}} : public {{if parent_def_type}} {{parent_def_type.cpp_full_name}} {{else}} bright::CfgBean {{end}}
|
||||
|
|
@ -42,7 +42,7 @@ class {{name}} : public {{if parent_def_type}} {{parent_def_type.cpp_full_name}}
|
|||
{{~ for field in export_fields ~}}
|
||||
{{~if field.comment != '' ~}}
|
||||
/**
|
||||
* {{field.comment}}
|
||||
* {{field.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
{{cpp_define_type field.ctype}} {{field.convention_name}};
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
{{~if x.comment != '' ~}}
|
||||
/**
|
||||
* {{x.comment}}
|
||||
* {{x.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
class {{name}}
|
||||
|
|
@ -82,7 +82,7 @@ class {{name}}
|
|||
{{~ for field in value_type.bean.hierarchy_export_fields ~}}
|
||||
{{~if field.comment != '' ~}}
|
||||
/**
|
||||
* {{field.comment}}
|
||||
* {{field.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
{{cpp_define_type field.ctype}}& {{field.convention_getter_name}}() const { return _data->{{field.convention_name}}; }
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ class {{name}}
|
|||
{{~for table in tables ~}}
|
||||
{{~if table.comment != '' ~}}
|
||||
/**
|
||||
* {{table.comment}}
|
||||
* {{table.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
{{table.cpp_full_name}} {{table.name}};
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ namespace {{x.namespace_with_top_module}}
|
|||
|
||||
{{~if x.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{x.comment}}
|
||||
/// {{x.escape_comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
public {{x.cs_class_modifier}} partial class {{name}} : {{if parent_def_type}} {{x.parent}} {{else}} Bright.Config.BeanBase {{end}}
|
||||
|
|
@ -49,7 +49,7 @@ public {{x.cs_class_modifier}} partial class {{name}} : {{if parent_def_type}} {
|
|||
{{~ for field in export_fields ~}}
|
||||
{{~if field.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{field.comment}}
|
||||
/// {{field.escape_comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
public {{cs_define_type field.ctype}} {{field.convention_name}} { get; private set; }
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ namespace {{x.namespace_with_top_module}}
|
|||
}}
|
||||
{{~if x.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{x.comment}}
|
||||
/// {{x.escape_comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
public sealed class {{name}}
|
||||
|
|
@ -77,7 +77,7 @@ public sealed class {{name}}
|
|||
{{~ for field in value_type.bean.hierarchy_export_fields ~}}
|
||||
{{~if field.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{field.comment}}
|
||||
/// {{field.escape_comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
public {{cs_define_type field.ctype}} {{field.convention_name}} => _data.{{field.convention_name}};
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ public sealed class {{name}}
|
|||
{{~for table in tables ~}}
|
||||
{{~if table.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{table.comment}}
|
||||
/// {{table.escape_comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
public {{table.full_name}} {{table.name}} {get; }
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace {{x.namespace_with_top_module}}
|
|||
|
||||
{{~if x.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{x.comment}}
|
||||
/// {{x.escape_comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
public {{x.cs_class_modifier}} class {{name}} : {{if parent_def_type}} {{parent}} {{else}} Bright.Config.BeanBase {{end}}
|
||||
|
|
@ -58,7 +58,7 @@ public {{x.cs_class_modifier}} class {{name}} : {{if parent_def_type}} {{parent}
|
|||
{{~ for field in export_fields ~}}
|
||||
{{~if field.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{field.comment}}
|
||||
/// {{field.escape_comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
public {{cs_define_type field.ctype}} {{field.convention_name}} { get; private set; }
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace {{x.namespace_with_top_module}}
|
|||
|
||||
{{~if x.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{x.comment}}
|
||||
/// {{x.escape_comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
public sealed class {{name}}
|
||||
|
|
@ -78,7 +78,7 @@ public sealed class {{name}}
|
|||
{{~ for field in value_type.bean.hierarchy_export_fields ~}}
|
||||
{{~if field.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{field.comment}}
|
||||
/// {{field.escape_comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
public {{cs_define_type field.ctype}} {{field.convention_name}} => _data.{{field.convention_name}};
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ public sealed partial class {{name}}
|
|||
{{~for table in tables ~}}
|
||||
{{~if table.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{table.comment}}
|
||||
/// {{table.escape_comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
public {{table.full_name}} {{table.name}} {get; }
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace {{x.namespace_with_top_module}}
|
|||
|
||||
{{~if x.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{x.comment}}
|
||||
/// {{x.escape_comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
public {{x.cs_class_modifier}} partial class {{name}} : {{if parent_def_type}} {{parent}} {{else}} Bright.Config.BeanBase {{end}}
|
||||
|
|
@ -59,7 +59,7 @@ public {{x.cs_class_modifier}} partial class {{name}} : {{if parent_def_type}} {
|
|||
{{~ for field in export_fields ~}}
|
||||
{{~if field.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{field.comment}}
|
||||
/// {{field.escape_comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
public {{cs_define_type field.ctype}} {{field.convention_name}} { get; private set; }
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace {{x.namespace_with_top_module}}
|
|||
|
||||
{{~if x.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{x.comment}}
|
||||
/// {{x.escape_comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
public sealed class {{name}}
|
||||
|
|
@ -81,7 +81,7 @@ public sealed class {{name}}
|
|||
{{~ for field in value_type.bean.hierarchy_export_fields ~}}
|
||||
{{~if field.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{field.comment}}
|
||||
/// {{field.escape_comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
public {{cs_define_type field.ctype}} {{field.convention_name}} => _data.{{field.convention_name}};
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ public sealed partial class {{name}}
|
|||
{{~for table in tables ~}}
|
||||
{{~if table.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{table.comment}}
|
||||
/// {{table.escape_comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
public {{table.full_name}} {{table.name}} {get; }
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import bright.serialization.*;
|
|||
|
||||
{{~if x.comment != '' ~}}
|
||||
/**
|
||||
* {{x.comment}}
|
||||
* {{x.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
public {{x.java_class_modifier}} class {{name}}{{if parent_def_type}} extends {{x.parent_def_type.full_name_with_top_module}}{{end}} {
|
||||
|
|
@ -57,7 +57,7 @@ public {{x.java_class_modifier}} class {{name}}{{if parent_def_type}} extends {{
|
|||
{{~ for field in export_fields ~}}
|
||||
{{~if field.comment != '' ~}}
|
||||
/**
|
||||
* {{field.comment}}
|
||||
* {{field.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
public final {{java_define_type field.ctype}} {{field.convention_name}};
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import bright.serialization.*;
|
|||
|
||||
{{~if x.comment != '' ~}}
|
||||
/**
|
||||
* {{x.comment}}
|
||||
* {{x.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
public final class {{name}} {
|
||||
|
|
@ -62,7 +62,7 @@ public final class {{name}} {
|
|||
{{~ for field in value_type.bean.hierarchy_export_fields ~}}
|
||||
{{~if field.comment != '' ~}}
|
||||
/**
|
||||
* {{field.comment}}
|
||||
* {{field.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
public {{java_define_type field.ctype}} {{field.convention_getter_name}}() { return _data.{{field.convention_name}}; }
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ public final class {{name}}
|
|||
{{~for table in tables ~}}
|
||||
{{~if table.comment != '' ~}}
|
||||
/**
|
||||
* {{table.comment}}
|
||||
* {{table.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
private final {{table.full_name_with_top_module}} {{table.inner_name}};
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import com.google.gson.JsonObject;
|
|||
|
||||
{{~if x.comment != '' ~}}
|
||||
/**
|
||||
* {{x.comment}}
|
||||
* {{x.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
public {{x.java_class_modifier}} class {{name}}{{if parent_def_type}} extends {{x.parent_def_type.full_name_with_top_module}}{{end}} {
|
||||
|
|
@ -60,7 +60,7 @@ public {{x.java_class_modifier}} class {{name}}{{if parent_def_type}} extends {{
|
|||
{{~ for field in export_fields ~}}
|
||||
{{~if field.comment != '' ~}}
|
||||
/**
|
||||
* {{field.comment}}
|
||||
* {{field.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
public final {{java_define_type field.ctype}} {{field.convention_name}};
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import com.google.gson.JsonElement;
|
|||
|
||||
{{~if x.comment != '' ~}}
|
||||
/**
|
||||
* {{x.comment}}
|
||||
* {{x.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
public final class {{name}} {
|
||||
|
|
@ -62,7 +62,7 @@ public final class {{name}} {
|
|||
{{~ for field in value_type.bean.hierarchy_export_fields ~}}
|
||||
{{~if field.comment != '' ~}}
|
||||
/**
|
||||
* {{field.comment}}
|
||||
* {{field.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
public {{java_define_type field.ctype}} {{field.convention_getter_name}}() { return _data.{{field.convention_name}}; }
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ public final class {{name}}
|
|||
{{~for table in tables ~}}
|
||||
{{~if table.comment != '' ~}}
|
||||
/**
|
||||
* {{table.comment}}
|
||||
* {{table.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
private final {{table.full_name_with_top_module}} {{table.inner_name}};
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class {{name}}:
|
|||
{{~ for field in value_type.bean.hierarchy_export_fields ~}}
|
||||
{{~if field.comment != '' ~}}
|
||||
'''
|
||||
{{field.comment}}
|
||||
{{field.escape_comment}}
|
||||
'''
|
||||
{{~end~}}
|
||||
def {{field.convention_name}}(self) : return self._data.{{field.convention_name}}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
{{~if x.comment != '' ~}}
|
||||
/**
|
||||
* {{x.comment}}
|
||||
* {{x.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
{{~if !x.is_abstract_type~}}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
}}
|
||||
{{~if x.comment != '' ~}}
|
||||
/**
|
||||
* {{x.comment}}
|
||||
* {{x.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
#[allow(non_camel_case_types)]
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ pub struct {{name}} {
|
|||
|
||||
{{~if table.comment != '' ~}}
|
||||
/**
|
||||
* {{table.comment}}
|
||||
* {{table.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
pub {{string.downcase table.name}}: {{table.rust_full_name}},
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
{{x.typescript_namespace_begin}}
|
||||
{{~if x.comment != '' ~}}
|
||||
/**
|
||||
* {{x.comment}}
|
||||
* {{x.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
export {{if x.is_abstract_type}} abstract {{end}} class {{name}} {{if parent_def_type}} extends {{x.parent}}{{end}} {
|
||||
|
|
@ -36,7 +36,7 @@ export {{if x.is_abstract_type}} abstract {{end}} class {{name}} {{if parent_def
|
|||
{{~ for field in export_fields ~}}
|
||||
{{~if field.comment != '' ~}}
|
||||
/**
|
||||
* {{field.comment}}
|
||||
* {{field.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
readonly {{field.convention_name}}: {{ts_define_type field.ctype}}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
{{x.typescript_namespace_begin}}
|
||||
{{~if x.comment != '' ~}}
|
||||
/**
|
||||
* {{x.comment}}
|
||||
* {{x.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
export class {{name}} {
|
||||
|
|
@ -53,7 +53,7 @@ export class {{name}} {
|
|||
{{~ for field in value_type.bean.hierarchy_export_fields ~}}
|
||||
{{~if field.comment != '' ~}}
|
||||
/**
|
||||
* {{field.comment}}
|
||||
* {{field.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
get {{field.convention_name}}(): {{ts_define_type field.ctype}} { return this._data.{{field.convention_name}} }
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ export class {{name}} {
|
|||
private _{{table.name}}: {{table.full_name}}
|
||||
{{~if table.comment != '' ~}}
|
||||
/**
|
||||
* {{table.comment}}
|
||||
* {{table.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
get {{table.name}}(): {{table.full_name}} { return this._{{table.name}}}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
{{x.typescript_namespace_begin}}
|
||||
{{~if x.comment != '' ~}}
|
||||
/**
|
||||
* {{x.comment}}
|
||||
* {{x.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
export {{if x.is_abstract_type}}abstract {{end}}class {{name}}{{if parent_def_type}} extends {{x.parent}}{{end}} {
|
||||
|
|
@ -39,7 +39,7 @@ export {{if x.is_abstract_type}}abstract {{end}}class {{name}}{{if parent_def_ty
|
|||
{{~ for field in export_fields ~}}
|
||||
{{~if field.comment != '' ~}}
|
||||
/**
|
||||
* {{field.comment}}
|
||||
* {{field.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
readonly {{field.convention_name}}: {{ts_define_type field.ctype}}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
{{x.typescript_namespace_begin}}
|
||||
{{~if x.comment != '' ~}}
|
||||
/**
|
||||
* {{x.comment}}
|
||||
* {{x.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
export class {{name}}{
|
||||
|
|
@ -50,7 +50,7 @@ export class {{name}}{
|
|||
{{~ for field in value_type.bean.hierarchy_export_fields ~}}
|
||||
{{~if field.comment != '' ~}}
|
||||
/**
|
||||
* {{field.comment}}
|
||||
* {{field.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
get {{field.convention_name}}(): {{ts_define_type field.ctype}} { return this._data.{{field.convention_name}}; }
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ export class {{name}} {
|
|||
private _{{table.name}}: {{table.full_name}}
|
||||
{{~if table.comment != '' ~}}
|
||||
/**
|
||||
* {{table.comment}}
|
||||
* {{table.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
get {{table.name}}(): {{table.full_name}} { return this._{{table.name}};}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace {{x.namespace_with_top_module}}
|
|||
|
||||
{{~if x.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{x.comment}}
|
||||
/// {{x.escape_comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
public interface {{readonly_name}} {{if parent_def_type}}: IReadOnly{{x.parent_def_type.name}} {{end}}
|
||||
|
|
@ -26,7 +26,7 @@ public interface {{readonly_name}} {{if parent_def_type}}: IReadOnly{{x.parent_d
|
|||
|
||||
{{~if x.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{x.comment}}
|
||||
/// {{x.escape_comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
public {{x.cs_class_modifier}} class {{name}} : {{if parent_def_type}} {{x.parent}} {{else}} Bright.Transaction.TxnBeanBase {{end}}, {{readonly_name}}
|
||||
|
|
@ -65,7 +65,7 @@ public {{x.cs_class_modifier}} class {{name}} : {{if parent_def_type}} {{x.paren
|
|||
|
||||
{{~if field.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{field.comment}}
|
||||
/// {{field.escape_comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
public {{db_cs_define_type ctype}} {{field.convention_name}}
|
||||
|
|
@ -106,7 +106,7 @@ public {{x.cs_class_modifier}} class {{name}} : {{if parent_def_type}} {{x.paren
|
|||
{{~else~}}
|
||||
{{~if field.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{field.comment}}
|
||||
/// {{field.escape_comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
public {{db_cs_define_type ctype}} {{field.convention_name}} => {{field.internal_name}};
|
||||
|
|
@ -115,14 +115,14 @@ public {{x.cs_class_modifier}} class {{name}} : {{if parent_def_type}} {{x.paren
|
|||
{{~if ctype.bean || ctype.element_type ~}}
|
||||
{{~if field.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{field.comment}}
|
||||
/// {{field.escape_comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
{{db_cs_readonly_define_type ctype}} {{readonly_name}}.{{field.convention_name}} => {{field.internal_name}};
|
||||
{{~else if ctype.is_map~}}
|
||||
{{~if field.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{field.comment}}
|
||||
/// {{field.escape_comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
{{db_cs_readonly_define_type ctype}} {{readonly_name}}.{{field.convention_name}} => new Bright.Transaction.Collections.PReadOnlyMap<{{db_cs_readonly_define_type ctype.key_type}}, {{db_cs_readonly_define_type ctype.value_type}}, {{db_cs_define_type ctype.value_type}}>({{field.internal_name}});
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ namespace {{x.namespace_with_top_module}}
|
|||
|
||||
{{~if x.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{x.comment}}
|
||||
/// {{x.escape_comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
public sealed class {{name}}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace {{x.namespace_with_top_module}}
|
|||
|
||||
{{~if x.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{x.comment}}
|
||||
/// {{x.escape_comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
public interface {{readonly_name}} {{if parent_def_type}}: IReadOnly{{x.parent_def_type.name}} {{end}}
|
||||
|
|
@ -26,7 +26,7 @@ public interface {{readonly_name}} {{if parent_def_type}}: IReadOnly{{x.parent_d
|
|||
|
||||
{{~if x.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{x.comment}}
|
||||
/// {{x.escape_comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
public {{x.cs_class_modifier}} class {{name}} : {{if parent_def_type}} {{x.parent}} {{else}} Bright.Transaction.TxnBeanBase {{end}}, {{readonly_name}}
|
||||
|
|
@ -65,7 +65,7 @@ public {{x.cs_class_modifier}} class {{name}} : {{if parent_def_type}} {{x.paren
|
|||
|
||||
{{~if field.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{field.comment}}
|
||||
/// {{field.escape_comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
public {{db_cs_define_type ctype}} {{field.convention_name}}
|
||||
|
|
@ -106,7 +106,7 @@ public {{x.cs_class_modifier}} class {{name}} : {{if parent_def_type}} {{x.paren
|
|||
{{~else~}}
|
||||
{{~if field.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{field.comment}}
|
||||
/// {{field.escape_comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
public {{db_cs_define_type ctype}} {{field.convention_name}} => {{field.internal_name}};
|
||||
|
|
@ -115,14 +115,14 @@ public {{x.cs_class_modifier}} class {{name}} : {{if parent_def_type}} {{x.paren
|
|||
{{~if ctype.bean || ctype.element_type ~}}
|
||||
{{~if field.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{field.comment}}
|
||||
/// {{field.escape_comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
{{db_cs_readonly_define_type ctype}} {{readonly_name}}.{{field.convention_name}} => {{field.internal_name}};
|
||||
{{~else if ctype.is_map~}}
|
||||
{{~if field.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{field.comment}}
|
||||
/// {{field.escape_comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
{{db_cs_readonly_define_type ctype}} {{readonly_name}}.{{field.convention_name}} => new Bright.Transaction.Collections.PReadOnlyMap<{{db_cs_readonly_define_type ctype.key_type}}, {{db_cs_readonly_define_type ctype.value_type}}, {{db_cs_define_type ctype.value_type}}>({{field.internal_name}});
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ namespace {{x.namespace_with_top_module}}
|
|||
|
||||
{{~if x.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{x.comment}}
|
||||
/// {{x.escape_comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
public sealed class {{name}}
|
||||
|
|
|
|||
|
|
@ -11,14 +11,14 @@
|
|||
{{x.typescript_namespace_begin}}
|
||||
{{~if x.comment != '' ~}}
|
||||
/**
|
||||
* {{x.comment}}
|
||||
* {{x.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
export {{x.ts_class_modifier}} class {{name}} extends {{if parent_def_type}} {{x.parent}} {{else}} TxnBeanBase {{end}}{
|
||||
{{~ for field in fields~}}
|
||||
{{~if field.comment != '' ~}}
|
||||
/**
|
||||
* {{field.comment}}
|
||||
* {{field.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
{{if is_abstract_type}}protected{{else}}private{{end}} {{field.internal_name}}: {{db_ts_define_type field.ctype}}
|
||||
|
|
@ -50,7 +50,7 @@ export {{x.ts_class_modifier}} class {{name}} extends {{if parent_def_type}} {{x
|
|||
|
||||
{{~if field.comment != '' ~}}
|
||||
/**
|
||||
* {{field.comment}}
|
||||
* {{field.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
get {{field.convention_name}}(): {{db_ts_define_type ctype}} {
|
||||
|
|
@ -66,7 +66,7 @@ export {{x.ts_class_modifier}} class {{name}} extends {{if parent_def_type}} {{x
|
|||
|
||||
{{~if field.comment != '' ~}}
|
||||
/**
|
||||
* {{field.comment}}
|
||||
* {{field.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
set {{field.convention_name}}(value: {{db_ts_define_type ctype}}) {
|
||||
|
|
@ -87,7 +87,7 @@ export {{x.ts_class_modifier}} class {{name}} extends {{if parent_def_type}} {{x
|
|||
{{~else~}}
|
||||
{{~if field.comment != '' ~}}
|
||||
/**
|
||||
* {{field.comment}}
|
||||
* {{field.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
get {{field.convention_name}}(): {{db_ts_define_type ctype}} { return {{field.internal_name_with_this}} }
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
{{~if x.comment != '' ~}}
|
||||
/**
|
||||
* {{x.comment}}
|
||||
* {{x.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
export class {{name}} {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace {{x.namespace_with_top_module}}
|
|||
|
||||
{{~if x.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{x.comment}}
|
||||
/// {{x.escape_comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
public {{if is_value_type}}struct{{else}}{{x.cs_class_modifier}} class{{end}} {{name}} : {{if parent_def_type}} {{parent}} {{else}} Bright.Serialization.BeanBase {{end}}
|
||||
|
|
@ -77,7 +77,7 @@ namespace {{x.namespace_with_top_module}}
|
|||
{{~ for field in fields ~}}
|
||||
{{~if field.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{field.comment}}
|
||||
/// {{field.escape_comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
public {{cs_define_type field.ctype}} {{field.convention_name}};
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ namespace {{x.namespace_with_top_module}}
|
|||
{
|
||||
{{~if x.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{x.comment}}
|
||||
/// {{x.escape_comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
public sealed class {{name}} : Bright.Net.Codecs.Protocol
|
||||
|
|
@ -18,7 +18,7 @@ namespace {{x.namespace_with_top_module}}
|
|||
{{~ for field in fields ~}}
|
||||
{{~if field.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{field.comment}}
|
||||
/// {{field.escape_comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
public {{cs_define_type field.ctype}} {{field.convention_name}};
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ namespace {{x.namespace_with_top_module}}
|
|||
|
||||
{{~if x.comment != '' ~}}
|
||||
/// <summary>
|
||||
/// {{x.comment}}
|
||||
/// {{x.escape_comment}}
|
||||
/// </summary>
|
||||
{{~end~}}
|
||||
public sealed class {{name}} : Bright.Net.Codecs.Rpc<{{cs_define_type targ_type}}, {{cs_define_type tres_type}}>
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
{{~if x.comment != '' ~}}
|
||||
/**
|
||||
* {{x.comment}}
|
||||
* {{x.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
export {{if x.is_abstract_type}} abstract {{end}} class {{name}} extends {{if parent_def_type}}{{x.parent}}{{else}}BeanBase{{end}} {
|
||||
|
|
@ -45,7 +45,7 @@ export {{if x.is_abstract_type}} abstract {{end}} class {{name}} extends {{if pa
|
|||
{{~ for field in fields ~}}
|
||||
{{~if field.comment != '' ~}}
|
||||
/**
|
||||
* {{field.comment}}
|
||||
* {{field.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
{{field.convention_name}}{{if field.is_nullable}}?{{end}} : {{ts_define_type field.ctype}}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
{{~if x.comment != '' ~}}
|
||||
/**
|
||||
* {{x.comment}}
|
||||
* {{x.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
export class {{name}} extends Protocol {
|
||||
|
|
@ -19,7 +19,7 @@ export class {{name}} extends Protocol {
|
|||
{{~ for field in fields ~}}
|
||||
{{~if field.comment != '' ~}}
|
||||
/**
|
||||
* {{field.comment}}
|
||||
* {{field.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
{{field.convention_name}}{{if field.is_nullable}}?{{end}} : {{ts_define_type field.ctype}}
|
||||
|
|
|
|||
Loading…
Reference in New Issue