diff --git a/src/Luban.Client/Source/Program.cs b/src/Luban.Client/Source/Program.cs index b61bc57..f9964d5 100644 --- a/src/Luban.Client/Source/Program.cs +++ b/src/Luban.Client/Source/Program.cs @@ -269,7 +269,7 @@ Options: } else { - s_logger.Error("GenJob fail. err:{err} msg:{msg}", res.ErrCode, res.ErrMsg); + s_logger.Error("GenJob fail. msg:{msg}", res.ErrMsg); if (!string.IsNullOrEmpty(res.StackTrace)) { s_logger.Debug("StackTrace: {}", res.StackTrace); diff --git a/src/Luban.Job.Common/Source/Defs/DefAssemblyBase.cs b/src/Luban.Job.Common/Source/Defs/DefAssemblyBase.cs index 82886b5..b8fd41a 100644 --- a/src/Luban.Job.Common/Source/Defs/DefAssemblyBase.cs +++ b/src/Luban.Job.Common/Source/Defs/DefAssemblyBase.cs @@ -269,7 +269,7 @@ namespace Luban.Job.Common.Defs { string containerTypeAndTags = DefUtil.TrimBracePairs(type.Substring(0, sepIndex)); var elementTypeAndTags = type.Substring(sepIndex + 1); - var (containerType, containerTags) = DefUtil.ParseType(containerTypeAndTags); + var (containerType, containerTags) = DefUtil.ParseTypeAndVaildAttrs(containerTypeAndTags); return CreateContainerType(module, containerType, containerTags, elementTypeAndTags.Trim()); } else @@ -283,7 +283,7 @@ namespace Luban.Job.Common.Defs bool nullable; // 去掉 rawType 两侧的匹配的 () rawType = DefUtil.TrimBracePairs(rawType); - var (type, tags) = DefUtil.ParseType(rawType); + var (type, tags) = DefUtil.ParseTypeAndVaildAttrs(rawType); if (type.EndsWith('?')) { diff --git a/src/Luban.Job.Common/Source/Utils/DefUtil.cs b/src/Luban.Job.Common/Source/Utils/DefUtil.cs index f0e2094..b117865 100644 --- a/src/Luban.Job.Common/Source/Utils/DefUtil.cs +++ b/src/Luban.Job.Common/Source/Utils/DefUtil.cs @@ -183,7 +183,24 @@ namespace Luban.Job.Common.Utils } } - public static bool ParseOrientation(string value) + public static (string, Dictionary) ParseTypeAndVaildAttrs(string s) + { + var (typeStr, attrs) = ParseType(s); + + if (attrs.ContainsKey("group")) + { + throw new Exception("group为保留属性,只能用于table或var定义,是否用错? 如在excel中请使用&group=xxx"); + } + + if (attrs.ContainsKey("seq")) + { + throw new Exception("字段切割应该用'sep',而不是'seq',请检查是否拼写错误"); + } + + return (typeStr, attrs); + } + + public static bool ParseOrientation(string value) { switch (value.Trim()) {