make application with base logic
This commit is contained in:
17
internal/common/decorator/command.go
Normal file
17
internal/common/decorator/command.go
Normal file
@ -0,0 +1,17 @@
|
||||
package decorator
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log/slog"
|
||||
)
|
||||
|
||||
type CommandHandler[T any] interface {
|
||||
Handle(ctx context.Context, params T) error
|
||||
}
|
||||
|
||||
func ApplyCommandDecorators[T any](base CommandHandler[T], log *slog.Logger) CommandHandler[T] {
|
||||
return commandLoggingDecorator[T]{
|
||||
base: base,
|
||||
log: log,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user