feat: site count
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user