完成剩余模块 Context 超时控制改造

This commit is contained in:
yml2213
2026-06-10 12:58:59 +08:00
parent d2858c529d
commit 6ae8f0e830
24 changed files with 370 additions and 323 deletions
@@ -1,6 +1,9 @@
package admindashboard
import "errors"
import (
"context"
"errors"
)
var ErrDependencyUnavailable = errors.New("dependency unavailable")
@@ -12,9 +15,9 @@ func NewService(repo *Repository) *Service {
return &Service{repo: repo}
}
func (s *Service) Summary() (*DashboardDTO, error) {
func (s *Service) Summary(ctx context.Context) (*DashboardDTO, error) {
if s.repo == nil {
return nil, ErrDependencyUnavailable
}
return s.repo.Summary()
return s.repo.Summary(ctx)
}