diff --git a/cmd/survey/tasks/tasks.go b/cmd/survey/tasks/tasks.go index cc65a0b..d8876b2 100644 --- a/cmd/survey/tasks/tasks.go +++ b/cmd/survey/tasks/tasks.go @@ -2,7 +2,10 @@ package tasks import ( "github.com/LazyBachelor/LazyPM/internal/service" + "github.com/LazyBachelor/LazyPM/pkg/cli/repl" "github.com/LazyBachelor/LazyPM/pkg/task" + "github.com/LazyBachelor/LazyPM/pkg/tui" + "github.com/LazyBachelor/LazyPM/pkg/web" ) func init() { @@ -14,3 +17,16 @@ func init() { return NewCodingTask(svc) }) } + +func InterfaceToType(it task.Interface) task.InterfaceType { + switch it.(type) { + case *repl.REPL: + return task.InterfaceCLI + case *tui.Tui: + return task.InterfaceTUI + case *web.Web: + return task.InterfaceWeb + default: + return task.InterfaceType("unknown") + } +} diff --git a/cmd/survey/tasks/types.go b/cmd/survey/tasks/types.go deleted file mode 100644 index c8c805b..0000000 --- a/cmd/survey/tasks/types.go +++ /dev/null @@ -1,27 +0,0 @@ -package tasks - -import ( - "github.com/LazyBachelor/LazyPM/pkg/cli/repl" - "github.com/LazyBachelor/LazyPM/pkg/task" - "github.com/LazyBachelor/LazyPM/pkg/tui" - "github.com/LazyBachelor/LazyPM/pkg/web" -) - -const ( - InterfaceTUI task.InterfaceType = "tui" - InterfaceCLI task.InterfaceType = "repl" - InterfaceWeb task.InterfaceType = "web" -) - -func InterfaceToType(it task.Interface) task.InterfaceType { - switch it.(type) { - case *repl.REPL: - return InterfaceCLI - case *tui.Tui: - return InterfaceTUI - case *web.Web: - return InterfaceWeb - default: - return "unknown" - } -}