From 741da79d6047fce88c19bf50785bb4bde5e66b0b Mon Sep 17 00:00:00 2001 From: kercylan98 Date: Wed, 5 Jul 2023 13:28:25 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E5=AF=BC=E5=87=BA=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B7=B2=E5=AF=BC=E5=87=BA=E7=9A=84=E8=A1=A8?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- planner/configexport/configexport.go | 6 ++++ planner/configexport/example/EasyConfig.json | 4 +-- planner/configexport/example/IndexConfig.json | 32 ++++++++++++------- planner/configexport/example/config.go | 10 +++--- 4 files changed, 34 insertions(+), 18 deletions(-) diff --git a/planner/configexport/configexport.go b/planner/configexport/configexport.go index 9eda1e6..006c283 100644 --- a/planner/configexport/configexport.go +++ b/planner/configexport/configexport.go @@ -51,6 +51,12 @@ func New(xlsxPath string) *ConfigExport { } ce.configs = append(ce.configs, config) ce.exist[config.Name] = true + + log.Info("ConfigExport", + zap.String("File", xlsxPath), + zap.String("Sheet", sheet.Name), + zap.String("Info", "Export successfully"), + ) } } return ce diff --git a/planner/configexport/example/EasyConfig.json b/planner/configexport/example/EasyConfig.json index e12622a..79f1fe2 100644 --- a/planner/configexport/example/EasyConfig.json +++ b/planner/configexport/example/EasyConfig.json @@ -6,8 +6,8 @@ }, "Other": { "0": { - "name": "张飞", - "id": 1 + "id": 1, + "name": "张飞" }, "1": { "id": 2, diff --git a/planner/configexport/example/IndexConfig.json b/planner/configexport/example/IndexConfig.json index 0ac28e5..1118e0e 100644 --- a/planner/configexport/example/IndexConfig.json +++ b/planner/configexport/example/IndexConfig.json @@ -1,4 +1,12 @@ { + "0": { + "": { + "Award": null, + "Other": null, + "Id": 0, + "Count": "" + } + }, "1": { "b": { "Id": 1, @@ -21,21 +29,21 @@ }, "2": { "c": { + "Id": 2, + "Count": "c", + "Award": { + "0": "asd", + "1": "12" + }, "Other": { "0": { "id": 1, "name": "张飞" }, "1": { - "name": "刘备", - "id": 2 + "id": 2, + "name": "刘备" } - }, - "Id": 2, - "Count": "c", - "Award": { - "0": "asd", - "1": "12" } }, "d": { @@ -46,13 +54,13 @@ "1": "12" }, "Other": { - "1": { - "id": 2, - "name": "刘备" - }, "0": { "id": 1, "name": "张飞" + }, + "1": { + "id": 2, + "name": "刘备" } } } diff --git a/planner/configexport/example/config.go b/planner/configexport/example/config.go index fae0ca4..7fedfdc 100644 --- a/planner/configexport/example/config.go +++ b/planner/configexport/example/config.go @@ -12,11 +12,13 @@ var json = jsonIter.ConfigCompatibleWithStandardLibrary var full map[string]any var ( // IndexConfig 有索引 - IndexConfig map[int]map[string]*IndexConfigDefine - _IndexConfig map[int]map[string]*IndexConfigDefine + IndexConfigSign = "IndexConfig" + IndexConfig map[int]map[string]*IndexConfigDefine + _IndexConfig map[int]map[string]*IndexConfigDefine // EasyConfig 无索引 - EasyConfig *EasyConfigDefine - _EasyConfig *EasyConfigDefine + EasyConfigSign = "EasyConfig" + EasyConfig *EasyConfigDefine + _EasyConfig *EasyConfigDefine ) func LoadConfig(handle func(filename string, config any) error) {