From 3eac9af40381bfd80cf917b8a2adacd02f0e5257 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Tue, 9 Jul 2024 00:06:18 +0800 Subject: [PATCH] code refactor --- pkg/api/data_managements.go | 2 +- pkg/cli/user_data.go | 2 +- pkg/services/transaction_tags.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/api/data_managements.go b/pkg/api/data_managements.go index 3312fadc..cf362ae2 100644 --- a/pkg/api/data_managements.go +++ b/pkg/api/data_managements.go @@ -190,7 +190,7 @@ func (a *DataManagementsApi) getExportedFileContent(c *core.Context, fileType st return nil, "", errs.ErrOperationFailed } - tagIndexs, err := a.tags.GetAllTagIdsOfAllTransactions(c, uid) + tagIndexs, err := a.tags.GetAllTagIdsMapOfAllTransactions(c, uid) if err != nil { log.ErrorfWithRequestId(c, "[data_managements.ExportDataHandler] failed to get tag index for user \"uid:%d\", because %s", uid, err.Error()) diff --git a/pkg/cli/user_data.go b/pkg/cli/user_data.go index 67b6a559..9a89d48e 100644 --- a/pkg/cli/user_data.go +++ b/pkg/cli/user_data.go @@ -628,7 +628,7 @@ func (l *UserDataCli) getUserEssentialData(uid int64, username string) (accountM tagMap = l.tags.GetTagMapByList(tags) - tagIndexs, err = l.tags.GetAllTagIdsOfAllTransactions(nil, uid) + tagIndexs, err = l.tags.GetAllTagIdsMapOfAllTransactions(nil, uid) if err != nil { log.BootErrorf("[user_data.getUserEssentialData] failed to get tag index for user \"%s\", because %s", username, err.Error()) diff --git a/pkg/services/transaction_tags.go b/pkg/services/transaction_tags.go index 64a65378..34abadd8 100644 --- a/pkg/services/transaction_tags.go +++ b/pkg/services/transaction_tags.go @@ -116,8 +116,8 @@ func (s *TransactionTagService) GetMaxDisplayOrder(c *core.Context, uid int64) ( } } -// GetAllTagIdsOfAllTransactions returns all transaction tag ids -func (s *TransactionTagService) GetAllTagIdsOfAllTransactions(c *core.Context, uid int64) (map[int64][]int64, error) { +// GetAllTagIdsMapOfAllTransactions returns all transaction tag ids map +func (s *TransactionTagService) GetAllTagIdsMapOfAllTransactions(c *core.Context, uid int64) (map[int64][]int64, error) { if uid <= 0 { return nil, errs.ErrUserIdInvalid }