support data export

This commit is contained in:
MaysWind
2021-01-02 02:04:38 +08:00
parent 102c945aa0
commit 7d3e05c548
24 changed files with 515 additions and 42 deletions
+11
View File
@@ -315,3 +315,14 @@ func (s *TransactionCategoryService) DeleteCategory(uid int64, categoryId int64)
return err
})
}
// GetCategoryMapByList returns a transaction category map by a list
func (s *TransactionCategoryService) GetCategoryMapByList(categories []*models.TransactionCategory) map[int64]*models.TransactionCategory {
categoryMap := make(map[int64]*models.TransactionCategory)
for i := 0; i < len(categories); i++ {
category := categories[i]
categoryMap[category.CategoryId] = category
}
return categoryMap
}