remove command support

This commit is contained in:
yanghao05
2023-05-12 12:59:53 +08:00
parent 7bbf6c1684
commit 630a78529e
5 changed files with 38 additions and 50 deletions

View File

@@ -1,27 +0,0 @@
package services
import (
"github.com/rogeecn/atom/container"
"go.uber.org/dig"
)
type CommandService interface {
Register()
Execute() error
}
type Command struct {
dig.In
Commands []CommandService `group:"command_services"`
}
func ServeCommand(f func() error) error {
return container.Container.Invoke(func(command Command) error {
for _, cmd := range command.Commands {
cmd.Register()
}
return f()
})
}