diff --git a/examples/simple-server-config/config/json/SystemConfig.json b/examples/simple-server-config/config/json/SystemConfig.json new file mode 100644 index 0000000..71d4a0e --- /dev/null +++ b/examples/simple-server-config/config/json/SystemConfig.json @@ -0,0 +1,4 @@ +{ + "Finish": "StartFinish", + "Addr": ":9999" +} \ No newline at end of file diff --git a/examples/simple-server-config/config/json/WelcomeConfig.json b/examples/simple-server-config/config/json/WelcomeConfig.json new file mode 100644 index 0000000..af2fae5 --- /dev/null +++ b/examples/simple-server-config/config/json/WelcomeConfig.json @@ -0,0 +1,10 @@ +{ + "1": { + "Id": 1, + "Text": "Hello" + }, + "2": { + "Id": 2, + "Text": "World" + } +} \ No newline at end of file diff --git a/planner/configexport/configexport.go b/planner/configexport/configexport.go index b5e46a4..7b025ea 100644 --- a/planner/configexport/configexport.go +++ b/planner/configexport/configexport.go @@ -39,7 +39,7 @@ func (slf *ConfigExport) ExportClient(prefix, outputDir string) { if len(prefix) > 0 { config.Prefix = fmt.Sprintf("%s.", prefix) } - if err := file.WriterFile(filepath.Join(outputDir, fmt.Sprintf("%s%s.json", prefix, config.Name)), config.JsonClient()); err != nil { + if err := file.WriterFile(filepath.Join(outputDir, fmt.Sprintf("%s%s.json", config.Prefix, config.Name)), config.JsonClient()); err != nil { panic(err) } } @@ -51,7 +51,7 @@ func (slf *ConfigExport) ExportServer(prefix, outputDir string) { if len(prefix) > 0 { config.Prefix = fmt.Sprintf("%s.", prefix) } - if err := file.WriterFile(filepath.Join(outputDir, fmt.Sprintf("%s%s.json", prefix, config.Name)), config.JsonServer()); err != nil { + if err := file.WriterFile(filepath.Join(outputDir, fmt.Sprintf("%s%s.json", config.Prefix, config.Name)), config.JsonServer()); err != nil { panic(err) } } diff --git a/planner/configexport/example/client.EasyConfig.json b/planner/configexport/example/client.EasyConfig.json index 67c853c..ba698fa 100644 --- a/planner/configexport/example/client.EasyConfig.json +++ b/planner/configexport/example/client.EasyConfig.json @@ -1,18 +1,18 @@ { + "Other": { + "1": { + "id": 2, + "name": "刘备" + }, + "0": { + "id": 1, + "name": "张飞" + } + }, "Id": 1, "Count": "a", "Award": { "0": "asd", "1": "12" - }, - "Other": { - "0": { - "id": 1, - "name": "张飞" - }, - "1": { - "id": 2, - "name": "刘备" - } } } \ No newline at end of file diff --git a/planner/configexport/example/client.IndexConfig.json b/planner/configexport/example/client.IndexConfig.json index 6dbe107..22cb58e 100644 --- a/planner/configexport/example/client.IndexConfig.json +++ b/planner/configexport/example/client.IndexConfig.json @@ -1,38 +1,38 @@ { "1": { "b": { - "Other": { - "1": { - "id": 2, - "name": "刘备" - }, - "0": { - "name": "张飞", - "id": 1 - } - }, "Id": 1, "Count": "b", "Award": { "0": "asd", "1": "12" + }, + "Other": { + "0": { + "id": 1, + "name": "张飞" + }, + "1": { + "id": 2, + "name": "刘备" + } } } }, "2": { "c": { "Award": { - "1": "12", - "0": "asd" + "0": "asd", + "1": "12" }, "Other": { "0": { - "name": "张飞", - "id": 1 + "id": 1, + "name": "张飞" }, "1": { - "id": 2, - "name": "刘备" + "name": "刘备", + "id": 2 } }, "Id": 2, @@ -51,8 +51,8 @@ "name": "张飞" }, "1": { - "name": "刘备", - "id": 2 + "id": 2, + "name": "刘备" } } } diff --git a/planner/configexport/example/server.EasyConfig.json b/planner/configexport/example/server.EasyConfig.json index 7a84e12..ff225b7 100644 --- a/planner/configexport/example/server.EasyConfig.json +++ b/planner/configexport/example/server.EasyConfig.json @@ -1,4 +1,14 @@ { + "Other": { + "0": { + "id": 1, + "name": "张飞" + }, + "1": { + "id": 2, + "name": "刘备" + } + }, "Id": 1, "Count": "a", "Info": { @@ -11,15 +21,5 @@ "count": 100 } } - }, - "Other": { - "0": { - "id": 1, - "name": "张飞" - }, - "1": { - "id": 2, - "name": "刘备" - } } } \ No newline at end of file diff --git a/planner/configexport/example/server.IndexConfig.json b/planner/configexport/example/server.IndexConfig.json index 16d3cf1..fb1b361 100644 --- a/planner/configexport/example/server.IndexConfig.json +++ b/planner/configexport/example/server.IndexConfig.json @@ -1,35 +1,33 @@ { - "1": { - "b": { - "Count": "b", + "2": { + "c": { "Info": { + "id": 1, + "name": "小明", "info": { "lv": 1, "exp": { "mux": 10, "count": 100 } - }, - "id": 1, - "name": "小明" + } }, "Other": { "0": { - "name": "张飞", - "id": 1 + "id": 1, + "name": "张飞" }, "1": { "id": 2, "name": "刘备" } }, - "Id": 1 - } - }, - "2": { - "c": { "Id": 2, - "Count": "c", + "Count": "c" + }, + "d": { + "Id": 2, + "Count": "d", "Info": { "id": 1, "name": "小明", @@ -51,11 +49,14 @@ "name": "刘备" } } - }, - "d": { - "Id": 2, - "Count": "d", + } + }, + "1": { + "b": { + "Id": 1, + "Count": "b", "Info": { + "id": 1, "name": "小明", "info": { "lv": 1, @@ -63,8 +64,7 @@ "mux": 10, "count": 100 } - }, - "id": 1 + } }, "Other": { "0": {