refactor services to use Interface and change name to app
This commit is contained in:
28
internal/service/interfaces.go
Normal file
28
internal/service/interfaces.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log/slog"
|
||||
|
||||
"github.com/LazyBachelor/LazyPM/internal/models"
|
||||
"github.com/steveyegge/beads"
|
||||
)
|
||||
|
||||
type App struct {
|
||||
Config Config
|
||||
Issues IssueService
|
||||
Stats StatsService
|
||||
Logger *slog.Logger
|
||||
}
|
||||
|
||||
type IssueService interface {
|
||||
beads.Storage
|
||||
AllIssues(ctx context.Context) ([]models.Issue, error)
|
||||
DeleteIssues() error
|
||||
}
|
||||
|
||||
type StatsService interface {
|
||||
Load(ctx context.Context) error
|
||||
Save(ctx context.Context) error
|
||||
GetStatistics() (models.Statistics, error)
|
||||
}
|
||||
Reference in New Issue
Block a user