feat: site count

This commit is contained in:
ferdiansyah783
2024-07-27 15:26:00 +07:00
parent dfed117d90
commit 4013b12ac9
8 changed files with 94 additions and 6 deletions
+10
View File
@@ -87,3 +87,13 @@ func (s *SiteService) Delete(ctx mycontext.Context, id int64) error {
return nil
}
func (s *SiteService) Count(ctx mycontext.Context, req entity.SiteSearch) (*entity.SiteCount, error) {
count, err := s.repo.Count(ctx, req)
if err != nil {
logger.ContextLogger(ctx).Error("error when getting all sites", zap.Error(err))
return nil, err
}
return count.ToSiteCount(), nil
}