From 4ac79fdbdb684843542837d6bd6af00a9fe71cb9 Mon Sep 17 00:00:00 2001 From: trunglt251292 Date: Fri, 28 Oct 2022 11:17:29 +0700 Subject: [PATCH] add action --- action.go | 5 +++++ user/handle.go | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/action.go b/action.go index c31feb7..f46c212 100644 --- a/action.go +++ b/action.go @@ -69,6 +69,11 @@ func (s Service) GetUsersByPermission(query model.UserByPermissionQuery) model.U return user.GetUsersByPermission(query) } +// CountByCondition ... +func (s Service) CountByCondition(filter interface{}) int64 { + return user.CountByCondition(filter) +} + // CountAllUsers ... func (s Service) CountAllUsers(query model.UserCountQuery) int64 { return user.Count(query) diff --git a/user/handle.go b/user/handle.go index a53958b..3bbd34d 100644 --- a/user/handle.go +++ b/user/handle.go @@ -278,6 +278,11 @@ func GetUsersByPermission(queryParams model.UserByPermissionQuery) (r model.User return } +// CountByCondition ... +func CountByCondition(filter interface{}) int64 { + return countByCondition(context.Background(), filter) +} + // Count ... func Count(queryParams model.UserCountQuery) int64 { var (