diff options
| author | leshe4ka46 <alex9102naid1@ya.ru> | 2025-10-27 20:36:28 +0300 |
|---|---|---|
| committer | leshe4ka46 <alex9102naid1@ya.ru> | 2025-10-28 13:42:21 +0300 |
| commit | bb833561aa74f02970aee13cdc75973b29716491 (patch) | |
| tree | 0914668e11dbf825979f7419ce1bc78294cd3f7f /cmd/xml | |
| parent | e17a425dfb3382310fb5863f516dacdca9f44956 (diff) | |
# This is a combination of 2 commits.
# This is the 1st commit message:
unmarshal all formats, merge them in the single table, users are truly unique
# This is the commit message #2:
i
Diffstat (limited to 'cmd/xml')
| -rw-r--r-- | cmd/xml/xml.go | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/cmd/xml/xml.go b/cmd/xml/xml.go new file mode 100644 index 0000000..2679114 --- /dev/null +++ b/cmd/xml/xml.go @@ -0,0 +1,32 @@ +package main + +import ( + "airlines/pkg/adapters/xml" + "airlines/pkg/localstore" + "fmt" +) + +func main() { + pointzUsers, err := xml.UnmarshalXml("/home/alex/ds-data/PointzAggregator-AirlinesData.xml") + if err != nil { + panic(err) + } + + fmt.Println("unmarshall ok") + + // for _, user := range pointzUsers.Users { + // fmt.Printf("User UID: %s, Name: %s %s\n", user.UID, user.Name.First, user.Name.Last) + // for _, card := range user.Cards.Card { + // fmt.Printf(" Card Number: %s, Program: %s\n", card.Number, card.Program) + // for _, activity := range card.Activities.Activitys { + // fmt.Printf(" Activity Type: %s, Code: %s, Date: %s, Departure: %s, Arrival: %s, Fare: %s\n", + // activity.Type, activity.Code, activity.Date, activity.Departure, activity.Arrival, activity.Fare) + // } + // } + // } + store := localstore.NewLocalStore() + + pointzUsers.DumpToDb(store) + + store.ExportAllCSVs("/tmp/ds") +} |
