refactor: clean code

This commit is contained in:
Fu Diwei
2025-02-06 23:11:16 +08:00
parent 3f9fda8a2d
commit 886f166e66
22 changed files with 311 additions and 194 deletions

View File

@@ -11,15 +11,15 @@ type statisticsRepository interface {
}
type StatisticsService struct {
repo statisticsRepository
statRepo statisticsRepository
}
func NewStatisticsService(repo statisticsRepository) *StatisticsService {
func NewStatisticsService(statRepo statisticsRepository) *StatisticsService {
return &StatisticsService{
repo: repo,
statRepo: statRepo,
}
}
func (s *StatisticsService) Get(ctx context.Context) (*domain.Statistics, error) {
return s.repo.Get(ctx)
return s.statRepo.Get(ctx)
}