From 50d59f645231293c7223c4efcc524df2db6635b7 Mon Sep 17 00:00:00 2001 From: dilap54 Date: Wed, 27 Dec 2023 18:22:26 +0300 Subject: [PATCH] print page number --- cmd/cli/sumpay.go | 2 +- plati/goodscategory.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/cli/sumpay.go b/cmd/cli/sumpay.go index 84a942f..3b97502 100644 --- a/cmd/cli/sumpay.go +++ b/cmd/cli/sumpay.go @@ -47,7 +47,7 @@ var sumpayCommand = &cli.Command{ if err != nil { return fmt.Errorf("GetGoods: %w", err) } - log.Printf("inserting %d goods to DB", len(goods.Rows.Row)) + log.Printf("got page %d/%d, inserting %d goods to DB", goods.Page, goods.Pages, len(goods.Rows.Row)) gormGoods := convertDigiGoodsToGorm(goods) if err := db.Create(gormGoods).Error; err != nil { diff --git a/plati/goodscategory.go b/plati/goodscategory.go index 8559c6e..bd7c46b 100644 --- a/plati/goodscategory.go +++ b/plati/goodscategory.go @@ -34,10 +34,10 @@ type GoodsResponse struct { Retdesc string `xml:"retdesc"` IDSection int `xml:"id_section"` NameSection string `xml:"name_section"` - Page string `xml:"page"` + Page int `xml:"page"` Order string `xml:"order"` CntGoods string `xml:"cnt_goods"` - Pages string `xml:"pages"` + Pages int `xml:"pages"` Rows struct { Cnt int `xml:"cnt,attr"` Row []struct {