basic conf for loader

This commit is contained in:
Andreas Schröpfer
2021-02-27 20:09:29 +01:00
parent ac9b441283
commit cc6e58acd9
7 changed files with 375 additions and 0 deletions

43
cmd/test2/conf.json Normal file
View File

@@ -0,0 +1,43 @@
{
"title": "",
"version": "",
"values": [
{
"sheet": 0,
"cell": "",
"type": "",
"struct": "",
"field": "",
"default": ""
}
],
"areas": [
{
"sheet": 0,
"start_row": 0,
"end_row": 0,
"struct": "",
"cols": [
{
"col": "",
"field": "",
"type": "",
"default": ""
}
]
}
],
"rating": {
"sheet": 0,
"start_row": 0,
"end_row": 0,
"points_col": "",
"max_points_col": "",
"id_col": "",
"short_name_col": "",
"name_col": "",
"estimations_col": "",
"weight_col": "",
"selected_by_user_col": ""
}
}

View File

@@ -2,7 +2,9 @@ package main
import (
"fmt"
"os"
"git.ecogood.org/andreas.schroepfer/excelConverter/pkg/loader"
excelize "github.com/360EntSecGroup-Skylar/excelize/v2"
)
@@ -12,4 +14,15 @@ func main() {
sheets := xFile.GetSheetMap()
rows, _ := xFile.GetRows(sheets[4])
fmt.Printf("%#v", rows)
c := loader.Conf{}
c.Values = append(c.Values, loader.Value{})
c.Areas = append(c.Areas, loader.Area{
Cols: []loader.AreaCol{
loader.AreaCol{},
},
})
fd, err := os.OpenFile("conf.json", os.O_CREATE, 0777)
fmt.Println(err)
defer fd.Close()
c.EncodeJSON(fd)
}