add comments and format code

This commit is contained in:
MaysWind
2021-03-23 00:08:44 +08:00
parent 44f2a651f7
commit 92fb38c7ee
3 changed files with 11 additions and 10 deletions
+1
View File
@@ -16,6 +16,7 @@ type CSVFileExporter struct {
const csvHeaderLine = "Time,Type,Category,Sub Category,Account,Amount,Account2,Account2 Amount,Tags,Comment\n" const csvHeaderLine = "Time,Type,Category,Sub Category,Account,Amount,Account2,Account2 Amount,Tags,Comment\n"
const csvDataLineFormat = "%s,%s,%s,%s,%s,%s,%s,%s,%s,%s\n" const csvDataLineFormat = "%s,%s,%s,%s,%s,%s,%s,%s,%s,%s\n"
// GetOutputContent returns the exported csv data
func (e *CSVFileExporter) GetOutputContent(uid int64, transactions []*models.Transaction, accountMap map[int64]*models.Account, categoryMap map[int64]*models.TransactionCategory, tagMap map[int64]*models.TransactionTag, allTagIndexs map[int64][]int64) ([]byte, error) { func (e *CSVFileExporter) GetOutputContent(uid int64, transactions []*models.Transaction, accountMap map[int64]*models.Account, categoryMap map[int64]*models.TransactionCategory, tagMap map[int64]*models.TransactionTag, allTagIndexs map[int64][]int64) ([]byte, error) {
var ret strings.Builder var ret strings.Builder
+1 -1
View File
@@ -7,7 +7,7 @@ import (
// ParentAccountCurrencyPlaceholder represents the currency field of parent account stored in database // ParentAccountCurrencyPlaceholder represents the currency field of parent account stored in database
const ParentAccountCurrencyPlaceholder = "---" const ParentAccountCurrencyPlaceholder = "---"
// ISO 4217 // AllCurrencyNames represents all currency name in ISO 4217
var AllCurrencyNames = map[string]bool{ var AllCurrencyNames = map[string]bool{
"AED": true, //UAE Dirham "AED": true, //UAE Dirham
"AFN": true, //Afghani "AFN": true, //Afghani