From 9bc74b3c73eb3a74e8e13450312ac3093ac16679 Mon Sep 17 00:00:00 2001 From: walon Date: Sat, 6 May 2023 13:04:44 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E4=BF=AE=E5=A4=8Dref=E6=8C=87=E5=90=91?= =?UTF-8?q?singleton=E8=A1=A8=E6=97=B6=EF=BC=8C=E6=A0=A1=E9=AA=8C=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E5=9C=B0=E4=BD=BF=E7=94=A8=E4=BA=86ref=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E6=89=80=E5=9C=A8=E7=9A=84=E5=AD=97=E6=AE=B5=E8=80=8C?= =?UTF-8?q?=E4=B8=8D=E6=98=AFref=E6=8C=87=E5=90=91=E7=9A=84=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=E5=AD=97=E6=AE=B5=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Luban.Job.Cfg/Source/Validators/RefValidator.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Luban.Job.Cfg/Source/Validators/RefValidator.cs b/src/Luban.Job.Cfg/Source/Validators/RefValidator.cs index 4a0b33b..e5774f7 100644 --- a/src/Luban.Job.Cfg/Source/Validators/RefValidator.cs +++ b/src/Luban.Job.Cfg/Source/Validators/RefValidator.cs @@ -194,23 +194,23 @@ namespace Luban.Job.Cfg.Validators //} if (ct.IsOneValueTable) { - if (string.IsNullOrEmpty(fieldName)) + if (string.IsNullOrEmpty(indexName)) { throw new Exception($"结构:{hostTypeName} 字段:{fieldName} ref:{actualTable} 是singleton表,索引字段不能为空"); } else { - if (!ct.ValueTType.Bean.TryGetField(fieldName, out var indexField, out _)) + if (!ct.ValueTType.Bean.TryGetField(indexName, out var indexField, out _)) { - throw new Exception($"结构:{hostTypeName} 字段:{fieldName} ref:{actualTable} value_type:{ct.ValueTType.Bean.FullName} 未包含索引字段:{fieldName}"); + throw new Exception($"结构:{hostTypeName} 字段:{fieldName} ref:{actualTable} value_type:{ct.ValueTType.Bean.FullName} 未包含索引字段:{indexName}"); } if (!(indexField.CType is TMap tmap)) { - throw new Exception($"结构:{hostTypeName} 字段:{fieldName} ref:{actualTable} value_type:{ct.ValueTType.Bean.FullName} 索引字段:{fieldName} type:{indexField.CType.TypeName} 不是map类型"); + throw new Exception($"结构:{hostTypeName} 字段:{fieldName} ref:{actualTable} value_type:{ct.ValueTType.Bean.FullName} 索引字段:{indexName} type:{indexField.CType.TypeName} 不是map类型"); } if (tmap.KeyType.TypeName != Type.TypeName) { - throw new Exception($"结构:{hostTypeName} 字段:{fieldName} 类型:'{Type.TypeName}' 与被引用的表:{actualTable} value_type:{ct.ValueTType.Bean.FullName} 索引字段:{fieldName} key_type:{tmap.KeyType.TypeName} 不一致"); + throw new Exception($"结构:{hostTypeName} 字段:{fieldName} 类型:'{Type.TypeName}' 与被引用的表:{actualTable} value_type:{ct.ValueTType.Bean.FullName} 索引字段:{indexName} key_type:{tmap.KeyType.TypeName} 不一致"); } } }