feat(platform-ops): 增加平台只读统计接口与超管入口
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package platformops
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrDependencyUnavailable = errors.New("platform ops dependency unavailable")
|
||||
|
||||
type Service struct {
|
||||
repo *Repository
|
||||
}
|
||||
|
||||
func NewService(repo *Repository) *Service {
|
||||
return &Service{repo: repo}
|
||||
}
|
||||
|
||||
func (s *Service) Overview(ctx context.Context) (*OverviewDTO, error) {
|
||||
if s.repo == nil {
|
||||
return nil, ErrDependencyUnavailable
|
||||
}
|
||||
return s.repo.Overview(ctx)
|
||||
}
|
||||
Reference in New Issue
Block a user