refactor services to use Interface and change name to app

This commit is contained in:
Robin Olsen
2026-02-22 16:16:09 +01:00
parent dbf619a054
commit 118e67dbf4
36 changed files with 247 additions and 219 deletions

View 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)
}