code refactor

This commit is contained in:
MaysWind
2024-10-10 23:53:11 +08:00
parent dc6420ccb0
commit 7bc9a0357e
10 changed files with 564 additions and 366 deletions
@@ -7,7 +7,9 @@ import (
"github.com/shakinm/xlsReader/xls"
"github.com/mayswind/ezbookkeeping/pkg/converters/datatable"
"github.com/mayswind/ezbookkeeping/pkg/core"
"github.com/mayswind/ezbookkeeping/pkg/errs"
"github.com/mayswind/ezbookkeeping/pkg/models"
"github.com/mayswind/ezbookkeeping/pkg/utils"
)
@@ -62,6 +64,11 @@ func (t *feideeMymoneyTransactionExcelFileDataTable) DataRowIterator() datatable
}
}
// IsValid returns whether this row contains valid data for importing
func (r *feideeMymoneyTransactionExcelFileDataRow) IsValid() bool {
return true
}
// ColumnCount returns the total count of column in this data row
func (r *feideeMymoneyTransactionExcelFileDataRow) ColumnCount() int {
row, err := r.sheet.GetRow(r.rowIndex)
@@ -142,7 +149,7 @@ func (t *feideeMymoneyTransactionExcelFileDataRowIterator) HasNext() bool {
}
// Next returns the next imported data row
func (t *feideeMymoneyTransactionExcelFileDataRowIterator) Next() datatable.ImportedDataRow {
func (t *feideeMymoneyTransactionExcelFileDataRowIterator) Next(ctx core.Context, user *models.User) datatable.ImportedDataRow {
allSheets := t.dataTable.workbook.GetSheets()
currentRowIndexInTable := t.currentRowIndexInTable