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

@@ -23,14 +23,14 @@ Please write your code below this line!
`
type CodingTask struct {
svc *service.Services
app *service.App
}
func NewCodingTask(svc *service.Services) *CodingTask {
return &CodingTask{svc: svc}
func NewCodingTask(app *service.App) *CodingTask {
return &CodingTask{app: app}
}
func (t *CodingTask) Config() task.TaskConfig {
func (t *CodingTask) Config() task.Config {
return BaseConfig().WithStatisticsStoragePath("./.pm/coding-task-stats.json")
}
@@ -59,7 +59,7 @@ func (t *CodingTask) Questions(interfaceType task.InterfaceType) (questions task
}
func (t *CodingTask) Setup(ctx context.Context) error {
if err := ClearIssues(t.svc); err != nil {
if err := ClearIssues(t.app); err != nil {
return err
}
@@ -71,7 +71,6 @@ func (t *CodingTask) Setup(ctx context.Context) error {
}
func (t *CodingTask) Validate(ctx context.Context) (bool, error) {
file, err := os.ReadFile("./code.txt")
if err != nil {
return false, err