模板优化

This commit is contained in:
kercylan98 2023-05-18 19:47:55 +08:00
parent 26b4b8a2eb
commit a2429d5b99
5 changed files with 43 additions and 43 deletions

View File

@ -3,7 +3,7 @@ package configexport
import "testing" import "testing"
func TestNew(t *testing.T) { func TestNew(t *testing.T) {
c := New(`D:\sources\minotaur\planner\configexport\template.xlsx`) c := New(`./template.xlsx`)
c.ExportGo("server", "./example") c.ExportGo("server", "./example")
c.ExportClient("client", "./example") c.ExportClient("client", "./example")

View File

@ -7,8 +7,8 @@
}, },
"Other": { "Other": {
"0": { "0": {
"id": 1, "name": "张飞",
"name": "张飞" "id": 1
}, },
"1": { "1": {
"id": 2, "id": 2,

View File

@ -8,13 +8,13 @@
"1": "12" "1": "12"
}, },
"Other": { "Other": {
"0": {
"name": "张飞",
"id": 1
},
"1": { "1": {
"id": 2, "id": 2,
"name": "刘备" "name": "刘备"
},
"0": {
"id": 1,
"name": "张飞"
} }
} }
} }
@ -33,8 +33,8 @@
"name": "张飞" "name": "张飞"
}, },
"1": { "1": {
"name": "刘备", "id": 2,
"id": 2 "name": "刘备"
} }
} }
}, },
@ -46,13 +46,13 @@
"1": "12" "1": "12"
}, },
"Other": { "Other": {
"1": {
"id": 2,
"name": "刘备"
},
"0": { "0": {
"id": 1, "id": 1,
"name": "张飞" "name": "张飞"
},
"1": {
"name": "刘备",
"id": 2
} }
} }
} }

View File

@ -2,15 +2,15 @@
"Id": 1, "Id": 1,
"Count": "a", "Count": "a",
"Info": { "Info": {
"id": 1,
"name": "小明", "name": "小明",
"info": { "info": {
"lv": 1,
"exp": { "exp": {
"mux": 10, "mux": 10,
"count": 100 "count": 100
}, }
"lv": 1 }
},
"id": 1
}, },
"Other": { "Other": {
"0": { "0": {

View File

@ -1,20 +1,9 @@
{ {
"1": { "1": {
"b": { "b": {
"Other": {
"0": {
"id": 1,
"name": "张飞"
},
"1": {
"id": 2,
"name": "刘备"
}
},
"Id": 1, "Id": 1,
"Count": "b", "Count": "b",
"Info": { "Info": {
"id": 1,
"name": "小明", "name": "小明",
"info": { "info": {
"lv": 1, "lv": 1,
@ -22,16 +11,26 @@
"mux": 10, "mux": 10,
"count": 100 "count": 100
} }
},
"id": 1
},
"Other": {
"0": {
"name": "张飞",
"id": 1
},
"1": {
"id": 2,
"name": "刘备"
} }
} }
} }
}, },
"2": { "2": {
"d": { "c": {
"Id": 2, "Id": 2,
"Count": "d", "Count": "c",
"Info": { "Info": {
"id": 1,
"name": "小明", "name": "小明",
"info": { "info": {
"lv": 1, "lv": 1,
@ -39,7 +38,8 @@
"mux": 10, "mux": 10,
"count": 100 "count": 100
} }
} },
"id": 1
}, },
"Other": { "Other": {
"0": { "0": {
@ -52,19 +52,19 @@
} }
} }
}, },
"c": { "d": {
"Id": 2, "Id": 2,
"Count": "c", "Count": "d",
"Info": { "Info": {
"id": 1,
"name": "小明",
"info": { "info": {
"lv": 1,
"exp": { "exp": {
"mux": 10, "mux": 10,
"count": 100 "count": 100
} },
} "lv": 1
},
"id": 1,
"name": "小明"
}, },
"Other": { "Other": {
"0": { "0": {