From b7fe70aba305913d5705781ca33dc2c5bba4b06a Mon Sep 17 00:00:00 2001 From: MaysWind Date: Mon, 7 Mar 2022 00:27:12 +0800 Subject: [PATCH] change method name --- pkg/api/transactions.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/api/transactions.go b/pkg/api/transactions.go index f09de747..56322e29 100644 --- a/pkg/api/transactions.go +++ b/pkg/api/transactions.go @@ -46,7 +46,7 @@ func (a *TransactionsApi) TransactionCountHandler(c *core.Context) (interface{}, uid := c.GetCurrentUid() - allCategoryIds, err := a.getCategoryAndSubCategoryIds(transactionCountReq.CategoryId, uid) + allCategoryIds, err := a.getCategoryOrSubCategoryIds(transactionCountReq.CategoryId, uid) if err != nil { log.WarnfWithRequestId(c, "[transactions.TransactionCountHandler] get transaction category error, because %s", err.Error()) @@ -90,7 +90,7 @@ func (a *TransactionsApi) TransactionListHandler(c *core.Context) (interface{}, return nil, errs.ErrUserNotFound } - allCategoryIds, err := a.getCategoryAndSubCategoryIds(transactionListReq.CategoryId, uid) + allCategoryIds, err := a.getCategoryOrSubCategoryIds(transactionListReq.CategoryId, uid) if err != nil { log.WarnfWithRequestId(c, "[transactions.TransactionListHandler] get transaction category error, because %s", err.Error()) @@ -159,7 +159,7 @@ func (a *TransactionsApi) TransactionMonthListHandler(c *core.Context) (interfac return nil, errs.ErrUserNotFound } - allCategoryIds, err := a.getCategoryAndSubCategoryIds(transactionListReq.CategoryId, uid) + allCategoryIds, err := a.getCategoryOrSubCategoryIds(transactionListReq.CategoryId, uid) if err != nil { log.WarnfWithRequestId(c, "[transactions.TransactionMonthListHandler] get transaction category error, because %s", err.Error()) @@ -826,7 +826,7 @@ func (a *TransactionsApi) filterTransactions(c *core.Context, uid int64, transac return finalTransactions } -func (a *TransactionsApi) getCategoryAndSubCategoryIds(categoryId int64, uid int64) ([]int64, error) { +func (a *TransactionsApi) getCategoryOrSubCategoryIds(categoryId int64, uid int64) ([]int64, error) { var allCategoryIds []int64 if categoryId > 0 {