增加继电器驱采表状态;修改Repo构建时基础检查逻辑

This commit is contained in:
thesai 2024-01-29 14:42:09 +08:00
parent 7372a5fa72
commit 2cc7564772
3 changed files with 27 additions and 668 deletions

View File

@ -1,657 +0,0 @@

1"
3
3
1"
5
4
2"
6
5
3"
11
6
4"
12
15
14"
17
16
8"
18
17
15"
20
18
16"
19
21
20"
22
22
21"
23
23
22"
25
24
19"
26
25
23"
29
26
24"
30
29
25"
32
30
26"
31
31
30"
34
32
29"
33
33
32"
36
34
31"
38
36
33"
42
38
34"
39
44
42"
45
45
44"
46
46
45"
47
47
46"
48
48
47
50
43"
51
51
50"
52
52
51"
53
53
52"
54
54
53
379
43
1519
8"
8
1521
19"
19
1522
20"
19
1523
41"
41
1524
42"
41
39
38"
40
40
39"
41
2"
4
1525812
8"
8!
15261114
11"
8
152719
19"
19
152820
20"
19"
15294143
41"
41
153042
42"
41"+
532¤¯ã MAIN_LINE"
1"
3"-
533ÿ›ã MAIN_LINE"
2"
4"-
535ÿ’æ MAIN_LINE"
4"
6"+
534¤¦æ MAIN_LINE"
3"
5",
536çüï MAIN_LINE"
5"
11".
537çüï MAIN_LINE"
6"
12".
578¹Ëñ MAIN_LINE"
8"
11"-
579Ùçò MAIN_LINE"
12"
14"-
538ª¶ô MAIN_LINE"
15"
14".
540ª¶ô MAIN_LINE"
16"
8"-
539Ü­÷ MAIN_LINE"
15"
17"/
541Ü­÷ MAIN_LINE"
16"
18"/
543ú…<C3BA> MAIN_LINE"
18"
19"-
542¬Ÿ<C2AC> MAIN_LINE"
17"
20"-
580 <>ƒ MAIN_LINE"
19"
20"/
548ꨅ MAIN_LINE"
24"
19"-
544œÂ… MAIN_LINE"
21"
20"-
545䀓 MAIN_LINE"
21"
22"-
546ð©Æ MAIN_LINE"
22"
23"/
549àÌÊ MAIN_LINE"
24"
26"-
547àÌÊ MAIN_LINE"
23"
25"-
550€ÎÔ MAIN_LINE"
25"
29"/
551€ÎÔ MAIN_LINE"
26"
30"-
552‘šú MAIN_LINE"
29"
32"-
555<08>½þ MAIN_LINE"
32"
33"/
554<08>½þ MAIN_LINE"
31"
34"-
556¡¾ˆ MAIN_LINE"
33"
36"/
557¡¾ˆ MAIN_LINE"
34"
38"/
560Ùá’ MAIN_LINE"
39"
40"-
558迤 MAIN_LINE"
36"
42"/
561»¨  MAIN_LINE"
40"
41"/
582迤 MAIN_LINE"
41"
42"0
572Ýð¥ MAIN_LINE"
379"
43"/
567êè MAIN_LINE"
50"
43"/
568ŠÅ² MAIN_LINE"
50"
51"-
563ŠÅ² MAIN_LINE"
44"
45"-
562Ø⨠MAIN_LINE"
44"
42"/
569úç¶ MAIN_LINE"
51"
52"-
564úç¶ MAIN_LINE"
45"
46"-
565ìüà MAIN_LINE"
46"
47"/
570´âÄ MAIN_LINE"
52"
53"-
566ÜŸÈ MAIN_LINE"
47"
48"/
571¦ƒÉ MAIN_LINE"
53"
54"!
575ÖÏÔ MAIN_LINE"
48"#
576ÖÏÔ MAIN_LINE"
54"
573þâ× MAIN_LINE"
1""
574þâ× MAIN_LINE"
2"/
559‘ጠMAIN_LINE"
38"
39"/
553ððØ MAIN_LINE"
30"
31*7
8Š—ô MAIN_LINE
16"
12*
1519*5
11‡œð MAIN_LINE
5"
14*
1519*6
14Š—ô MAIN_LINE
15"
11*
1519*8
19š¥<C5A1> MAIN_LINE
18"
24*
1521*6
20ž … MAIN_LINE
21"
17*
1521*:
41ÛÇ  MAIN_LINE
1523"
43*
1523*6
42¸Ã¨ MAIN_LINE
44"
36*
1523*7
43×Ó¢ MAIN_LINE
41"
50*
379*6
12‡œð MAIN_LINE
6"
8*
15192
212¶ú× MAIN_LINE12
217¶ú× MAIN_LINE22
484ì—ã MAIN_LINE32
485Ç„ã MAIN_LINE22
491Ỿ MAIN_LINE42
492¯åï MAIN_LINE15262
493¯åï MAIN_LINE15192#
494<08>´ñ MAIN_LINE"
112
490ܽæ MAIN_LINE32
495‘ÿò MAIN_LINE15262
496”Å÷ MAIN_LINE152
497”Å÷ MAIN_LINE162
498ô‡<C3B4> MAIN_LINE15222
499¯åï MAIN_LINE182
500Ø´ƒ MAIN_LINE15222
501ÔÙ… MAIN_LINE212
502¢À… MAIN_LINE15212
504¬é’ MAIN_LINE222
505˜äÊ MAIN_LINE252
506˜äÊ MAIN_LINE262
507ȶÔ MAIN_LINE252
508ȶÔ MAIN_LINE302
509¹Ôþ MAIN_LINE332
510¹Ôþ MAIN_LINE342
511馈 MAIN_LINE332
512馈 MAIN_LINE342
514‘ù’ MAIN_LINE402
515°¨¤ MAIN_LINE15242
516ƒ‘  MAIN_LINE15232#
518¢Û¨ MAIN_LINE"
432!
519¨ò¨ MAIN_LINE"
422
520•ˆ¦ MAIN_LINE15232
521°¨¤ MAIN_LINE15232
522Ò­² MAIN_LINE442
523Ò­² MAIN_LINE502
524²ÿ¶ MAIN_LINE452
525²ÿ¶ MAIN_LINE512
526´åà MAIN_LINE462
527üÊÄ MAIN_LINE522
528”·È MAIN_LINE472
529ÞšÉ MAIN_LINE532
530ž¸Ô MAIN_LINE482
531ž¸Ô MAIN_LINE54:
1170„«Ú MAIN_LINE1:
1171ÄéÚ MAIN_LINE1:
1172œ Û MAIN_LINE1:
1173ÿ³Û MAIN_LINE2:
1174ŸÖÚ MAIN_LINE2:
1175÷ŒÛ MAIN_LINE2:
1176„¬Ý MAIN_LINE1:
1177ÄêÝ MAIN_LINE1:
1178œ¡Þ MAIN_LINE1:
1179ߘÝ MAIN_LINE2:
1180Ÿ×Ý MAIN_LINE2:
1181÷<>Þ MAIN_LINE2:
1182ÜÉâ MAIN_LINE1:
1183´€ã MAIN_LINE1:
1184ᦉ MAIN_LINE2:
1185<08>íâ MAIN_LINE2:
1186”Õæ MAIN_LINE5:
1187ì‹ç MAIN_LINE5:
1188¬Êç MAIN_LINE5:
1189<>è MAIN_LINE5:
1190ïÁæ MAIN_LINE6:
1191”Öé MAIN_LINE5:
1192ìŒê MAIN_LINE5:
1193¬Ëê MAIN_LINE5:
1194„‚ë MAIN_LINE5:
1195¬µî MAIN_LINE5:
1196„ìî MAIN_LINE5:
1197Īï MAIN_LINE5:
1198÷Íï MAIN_LINE5:
1199Çøæ MAIN_LINE6:
1200‡·ç MAIN_LINE6:
1201ßíç MAIN_LINE6:
1202ïÂé MAIN_LINE6:
1203Çùé MAIN_LINE6:
1204ßñé MAIN_LINE6:
1205ßîê MAIN_LINE6:
1206࢔ MAIN_LINE6:
1207ßØî MAIN_LINE6:
1208Ÿ—ï MAIN_LINE6:
1209÷Íï MAIN_LINE6:
1210üÕô MAIN_LINE15:
1211üÕô MAIN_LINE16:
1212ÌÜ÷ MAIN_LINE17:
1213ìû÷ MAIN_LINE17:
1214¬ºø MAIN_LINE17:
1215„ñø MAIN_LINE17:
1216”èü MAIN_LINE17:
1217ìžý MAIN_LINE17:
1218¬Ýý MAIN_LINE17:
1219„”þ MAIN_LINE17:
1220´Ìÿ MAIN_LINE17:
1221Œƒ€ MAIN_LINE17:
1224ÌÜ÷ MAIN_LINE18:
1225ìû÷ MAIN_LINE18:
1226¬ºø MAIN_LINE18:
1227„ñø MAIN_LINE18:
1228´©ú MAIN_LINE18:
1229Œàú MAIN_LINE18:
1230Ìžû MAIN_LINE18:
1231¤Õû MAIN_LINE18:
1232´Ìÿ MAIN_LINE18:
1233Œƒ€ MAIN_LINE18:
1234Ò¿€ MAIN_LINE18:
1235òÞ€ MAIN_LINE18:
1236Œñ… MAIN_LINE21:
1237”˜† MAIN_LINE21:
1238þîŠ MAIN_LINE21:
1239æì” MAIN_LINE24:
1240牴 MAIN_LINE24:
1241Å<> MAIN_LINE22:
1242Öù© MAIN_LINE22:
1243ç㸠MAIN_LINE22:
1244<08>ض MAIN_LINE24:
1245øÍÇ MAIN_LINE24:
1246ÐûÊ MAIN_LINE25:
1247Ø¢Ë MAIN_LINE25:
1248€éË MAIN_LINE25:
1249ØŸÌ MAIN_LINE25:
1250°ÍÏ MAIN_LINE25:
1251€ŒÑ MAIN_LINE25:
1252ØÂÑ MAIN_LINE25:
1253ˆøÓ MAIN_LINE25:
1254<08>ŸÔ MAIN_LINE25:
1255ˆûÒ MAIN_LINE25:
1256ÐûÊ MAIN_LINE26:
1257Ø¢Ë MAIN_LINE26:
1258€éË MAIN_LINE26:
1259ØŸÌ MAIN_LINE26:
1260ˆØÍ MAIN_LINE26:
1261àŽÎ MAIN_LINE26:
1262 ÍÎ MAIN_LINE26:
1263øƒÏ MAIN_LINE26:
1264ˆûÒ MAIN_LINE26:
1265à±Ó MAIN_LINE26:
1266ˆøÓ MAIN_LINE26:
1267<08>ŸÔ MAIN_LINE26:
1268èÌ× MAIN_LINE30:
1269ÁÅé MAIN_LINE31:
1270èÌ× MAIN_LINE29:
1271ÁÅé MAIN_LINE29:
1272™¾û MAIN_LINE31:
1273™¾û MAIN_LINE32:
1274ñëþ MAIN_LINE33:
1275ù’ÿ MAIN_LINE33:
1276¡Ùÿ MAIN_LINE33:
1277ù<> MAIN_LINE33:
1278‰‡„ MAIN_LINE33:
1279ὄ MAIN_LINE33:
1280¡ü„ MAIN_LINE33:
1281ù²… MAIN_LINE33:
1282<08>¢‡ MAIN_LINE33:
1283©ë† MAIN_LINE33:
1284©è‡ MAIN_LINE33:
1285±<>ˆ MAIN_LINE33:
1286ñëþ MAIN_LINE34:
1287ù’ÿ MAIN_LINE34:
1288¡Ùÿ MAIN_LINE34:
1289ù<> MAIN_LINE34:
1290©È<C2A9> MAIN_LINE34:
1291<08>ÿ<EFBFBD> MAIN_LINE34:
1292Á½‚ MAIN_LINE34:
1293†þ… MAIN_LINE34:
1294©ë† MAIN_LINE34:
1295<08>¢‡ MAIN_LINE34:
1296©è‡ MAIN_LINE34:
1297±<>ˆ MAIN_LINE34:
1298‰½‹ MAIN_LINE36:
1299‰½‹ MAIN_LINE38:
1300ÊÔ˜ MAIN_LINE36:
1301ÐÄ¥ MAIN_LINE1524:
1302ûøš MAIN_LINE40:
1303ÃÒŸ MAIN_LINE40:
1304ËùŸ MAIN_LINE40:"
1305ˆÜ¥ MAIN_LINE"
42:
1306‚Å¥ MAIN_LINE1523:
1307à‰© MAIN_LINE44:
1308€©© MAIN_LINE44:
1309Šà© MAIN_LINE44:
1310â–ª MAIN_LINE44:
1311ò<>® MAIN_LINE44:
1312ÊÄ® MAIN_LINE44:
1313Šƒ¯ MAIN_LINE44:
1314⹯ MAIN_LINE44:
1315’ò° MAIN_LINE44:
1316ꨱ MAIN_LINE44:
1317’ï± MAIN_LINE44:
1318š–² MAIN_LINE44:
1319Úò¨ MAIN_LINE50:
1320♩ MAIN_LINE50:
1321Šà© MAIN_LINE50:
1322â–ª MAIN_LINE50:
1323’Ï« MAIN_LINE50:
1324ê…¬ MAIN_LINE50:
1325ªÄ¬ MAIN_LINE50:
1326‚û¬ MAIN_LINE50:
1327’ò° MAIN_LINE50:
1328ꨱ MAIN_LINE50:
1329’ï± MAIN_LINE50:
1330š–² MAIN_LINE50:
1331òõ MAIN_LINE45:
1332òõ MAIN_LINE51:
1333ê–· MAIN_LINE46:
1334ò½· MAIN_LINE46:
1335Ú³½ MAIN_LINE46:
1336ê–· MAIN_LINE52:
1337ò½· MAIN_LINE52:
1338Êâ½ MAIN_LINE52:
1339úºÅ MAIN_LINE47:
1340š×Æ MAIN_LINE47:
1341ºóÇ MAIN_LINE47:
1342úºÅ MAIN_LINE53:
1343š×Æ MAIN_LINE53:
1344ºóÇ MAIN_LINE53:
1345´É€ MAIN_LINE17:
1346¼ð€ MAIN_LINE17:"
1347ÉŒ„ MAIN_LINE"
20B1
1356½ôÕ MAIN_LINE€ñõ MAIN_LINEÐB-
1378ÎøÕ MAIN_LINE€ñõ MAIN_LINEÐB5
1379€ñõ MAIN_LINE¸Ïˆ MAIN_LINE°ðÿÿÿÿÿÿÿB5
1382¨¹Ÿ MAIN_LINEúôÆ MAIN_LINEß±ÿÿÿÿÿÿÿB.
1385¨…Ú MAIN_LINEñ<>ø MAIN_LINEÝ‹B*
1386ñ<>ø MAIN_LINE°–‹ MAIN_LINEB5
1387°–‹ MAIN_LINE𡜠MAIN_LINEèŠÿÿÿÿÿÿÿB*
1388𡜠MAIN_LINE Á¶ MAIN_LINEB-
1389 Á¶ MAIN_LINEÐ<>Æ MAIN_LINEð.B*
1390Ð<>Æ MAIN_LINEúŒÙ MAIN_LINEB9
1391€ñõ MAIN_LINE¸Ïˆ MAIN_LINE°ðÿÿÿÿÿÿÿB2
1393œ‰Ú MAIN_LINEñ<>ø MAIN_LINEãŒB.
1394ñ<>ø MAIN_LINE°–‹ MAIN_LINEB9
1395°–‹ MAIN_LINE𡜠MAIN_LINEèŠÿÿÿÿÿÿÿB.
1396𡜠MAIN_LINE Á¶ MAIN_LINEB1
1397 Á¶ MAIN_LINEÐ<>Æ MAIN_LINEð.B.
1398Ð<>Æ MAIN_LINE°©Ø MAIN_LINEB5
1399¸Ïˆ MAIN_LINE¨¹Ÿ MAIN_LINE¬¡þÿÿÿÿÿÿB-
1400úôÆ MAIN_LINE¨…Ú MAIN_LINEÐB9
1401¸Ïˆ MAIN_LINE¨¹Ÿ MAIN_LINE¬¡þÿÿÿÿÿÿB9
1402¨¹Ÿ MAIN_LINEˆŸÇ MAIN_LINEð±ÿÿÿÿÿÿÿB1
1403ˆŸÇ MAIN_LINEœ‰Ú MAIN_LINEÐJ2
1406á½Í MAIN_LINEà¥ï MAIN_LINEðý9J.
1433â½Í MAIN_LINE…¹ï MAIN_LINEø¤:J*
1434…¹ï MAIN_LINE<08>ß“ MAIN_LINEJ*
1437š<>» MAIN_LINEÙî¾ MAIN_LINEJ5
1438Ùî¾ MAIN_LINE¡ÿÊ MAIN_LINEÀ°ÛÿÿÿÿÿÿJ*
1439¡ÿÊ MAIN_LINEȧÔ MAIN_LINEJ5
1440ȧÔ MAIN_LINEÈ<>å MAIN_LINE°¾æÿÿÿÿÿÿJ*
1441È<>å MAIN_LINEîçç MAIN_LINEJ.
1442îçç MAIN_LINEðýý MAIN_LINE¸ÉJ*
1443ðýý MAIN_LINE¾Ÿ² MAIN_LINEJ5
1444¾Ÿ² MAIN_LINEô¯É MAIN_LINEÀƒêÿÿÿÿÿÿJ.
1445à¥ï MAIN_LINEÛª„ MAIN_LINEJ2
1446Ûª„ MAIN_LINEâÞŒ MAIN_LINE€‰zJ.
1447âÞŒ MAIN_LINE¾–— MAIN_LINEJ9
1449Æ¿À MAIN_LINEÿ<>Ì MAIN_LINEÀ°ÛÿÿÿÿÿÿJ.
1450ÿ<>Ì MAIN_LINE€‚Ô MAIN_LINEJ9
1451€‚Ô MAIN_LINE<08>ëä MAIN_LINE°¾æÿÿÿÿÿÿJ.
1452<08>ëä MAIN_LINEƒòç MAIN_LINEJ2
1453ƒòç MAIN_LINE¬îý MAIN_LINE ÑJ.
1454¬îý MAIN_LINE ¸± MAIN_LINEJ9
1455 ¸± MAIN_LINE˜ÙÊ MAIN_LINE€ËçÿÿÿÿÿÿJ.
1456<08>ß“ MAIN_LINEš<>» MAIN_LINE<18>©6J2
1457¾–— MAIN_LINE—̺ MAIN_LINEÐð3J.
1458—̺ MAIN_LINEÆ¿À MAIN_LINER#
Š—ô MAIN_LINE  MAIN_LINER
‡œð MAIN_LINER
Š—ô MAIN_LINER#
š¥<C5A1> MAIN_LINE  MAIN_LINER
ž … MAIN_LINER#
ÛÇ  MAIN_LINE  MAIN_LINER
¸Ã¨ MAIN_LINER#
×Ó¢ MAIN_LINE  MAIN_LINER#
‡œð MAIN_LINE  MAIN_LINER
½ôÕ MAIN_LINER
€ñõ MAIN_LINER
¸Ïˆ MAIN_LINER
¨¹Ÿ MAIN_LINER
ˆŸÇ MAIN_LINER
œ‰Ú MAIN_LINER
ñ<>ø MAIN_LINER
°–‹ MAIN_LINER
𡜠MAIN_LINER
 Á¶ MAIN_LINER
Ð<>Æ MAIN_LINER
°©Ø MAIN_LINER
úŒÙ MAIN_LINER
Ð<>Æ MAIN_LINER
ÎøÕ MAIN_LINER
€ñõ MAIN_LINER
¸Ïˆ MAIN_LINER
¨¹Ÿ MAIN_LINER
úôÆ MAIN_LINER
¨…Ú MAIN_LINER
ñ<>ø MAIN_LINER
°–‹ MAIN_LINER
𡜠MAIN_LINER
 Á¶ MAIN_LINER
á½Í MAIN_LINER
à¥ï MAIN_LINER
Ûª„ MAIN_LINER
âÞŒ MAIN_LINER
¾–— MAIN_LINER
—̺ MAIN_LINER
Æ¿À MAIN_LINER
ÿ<>Ì MAIN_LINER
€‚Ô MAIN_LINER
<08>ëä MAIN_LINER
ƒòç MAIN_LINER
¬îý MAIN_LINER
 ¸± MAIN_LINER
˜ÙÊ MAIN_LINER
â½Í MAIN_LINER
…¹ï MAIN_LINER
<08>ß“ MAIN_LINER
š<>» MAIN_LINER
Ùî¾ MAIN_LINER
¡ÿÊ MAIN_LINER
ȧÔ MAIN_LINER
È<>å MAIN_LINER
îçç MAIN_LINER
ðýý MAIN_LINER
¾Ÿ² MAIN_LINER
ô¯É MAIN_LINE

View File

@ -9,18 +9,25 @@ import (
// 对数据做基础检查 // 对数据做基础检查
func baseCheck(source *proto.Repository) []string { func baseCheck(source *proto.Repository) []string {
var errMsg []string var errMsg []string
uidMap := make(map[string]bool)
//区段 //区段
sectionMap := make(map[string]*proto.PhysicalSection)
for _, section := range source.PhysicalSections { for _, section := range source.PhysicalSections {
sectionMap[section.Id] = section if uidMap[section.Id] {
errMsg = append(errMsg, fmt.Sprintf("uid[%s]重复", section.Id))
continue
}
uidMap[section.Id] = true
if len(section.TurnoutIds) == 0 && section.ADevicePort == nil && section.BDevicePort == nil { if len(section.TurnoutIds) == 0 && section.ADevicePort == nil && section.BDevicePort == nil {
errMsg = append(errMsg, fmt.Sprintf("区段[%s]缺少关联的道岔或区段", section.Id)) errMsg = append(errMsg, fmt.Sprintf("区段[%s]缺少关联的道岔或区段", section.Id))
} }
} }
//道岔 //道岔
turnoutMap := make(map[string]*proto.Turnout)
for _, turnout := range source.Turnouts { for _, turnout := range source.Turnouts {
turnoutMap[turnout.Id] = turnout if uidMap[turnout.Id] {
errMsg = append(errMsg, fmt.Sprintf("uid[%s]重复", turnout.Id))
continue
}
uidMap[turnout.Id] = true
if turnout.Km == nil { if turnout.Km == nil {
errMsg = append(errMsg, fmt.Sprintf("道岔[%s]缺少公里标", turnout.Id)) errMsg = append(errMsg, fmt.Sprintf("道岔[%s]缺少公里标", turnout.Id))
} }
@ -30,15 +37,23 @@ func baseCheck(source *proto.Repository) []string {
} }
} }
//检测点 //检测点
checkPointMap := make(map[string]*proto.CheckPoint)
for _, point := range source.CheckPoints { for _, point := range source.CheckPoints {
checkPointMap[point.Id] = point if uidMap[point.Id] {
errMsg = append(errMsg, fmt.Sprintf("uid[%s]重复", point.Id))
continue
}
uidMap[point.Id] = true
if point.Km == nil { if point.Km == nil {
errMsg = append(errMsg, fmt.Sprintf("检测点[%s]缺少公里标", point.Id)) errMsg = append(errMsg, fmt.Sprintf("检测点[%s]缺少公里标", point.Id))
} }
} }
//信号机 //信号机
for _, signal := range source.Signals { for _, signal := range source.Signals {
if uidMap[signal.Id] {
errMsg = append(errMsg, fmt.Sprintf("uid[%s]重复", signal.Id))
continue
}
uidMap[signal.Id] = true
if signal.Km == nil || signal.Km.CoordinateSystem == "" { if signal.Km == nil || signal.Km.CoordinateSystem == "" {
errMsg = append(errMsg, fmt.Sprintf("信号机[%s]缺少公里标", signal.Id)) errMsg = append(errMsg, fmt.Sprintf("信号机[%s]缺少公里标", signal.Id))
} }
@ -48,6 +63,11 @@ func baseCheck(source *proto.Repository) []string {
} }
//应答器 //应答器
for _, transponder := range source.Transponders { for _, transponder := range source.Transponders {
if uidMap[transponder.Id] {
errMsg = append(errMsg, fmt.Sprintf("uid[%s]重复", transponder.Id))
continue
}
uidMap[transponder.Id] = true
if transponder.Km == nil || transponder.Km.CoordinateSystem == "" { if transponder.Km == nil || transponder.Km.CoordinateSystem == "" {
errMsg = append(errMsg, fmt.Sprintf("应答器[%s]缺少公里标", transponder.Id)) errMsg = append(errMsg, fmt.Sprintf("应答器[%s]缺少公里标", transponder.Id))
} }

View File

@ -17,11 +17,7 @@ var repositoryMap = make(map[string]*Repository)
func BuildRepository(source *proto.Repository) (*Repository, error) { func BuildRepository(source *proto.Repository) (*Repository, error) {
errMsg := baseCheck(source) errMsg := baseCheck(source)
if len(errMsg) != 0 { if len(errMsg) != 0 {
println("-------------------- 数据异常信息 --------------------") return nil, errors.New(strings.Join(errMsg, "\n"))
for _, s := range errMsg {
println(s)
}
return nil, errors.New("数据校验未通过")
} }
repository := newRepository(source.Id, source.Version) repository := newRepository(source.Id, source.Version)
err := buildModels(source, repository) err := buildModels(source, repository)