make application with base logic

This commit is contained in:
Gitea
2023-11-26 15:39:34 +03:00
parent 0553ea71c3
commit 606b94e35b
32 changed files with 1070 additions and 27 deletions

View File

@ -0,0 +1,17 @@
package decorator
import (
"context"
"log/slog"
)
type QueryHandler[Q, U any] interface {
Handle(ctx context.Context, query Q) (entity U, err error)
}
func AddQueryDecorators[Q, U any](base QueryHandler[Q, U], log *slog.Logger) QueryHandler[Q, U] {
return queryLoggingDecorator[Q, U]{
base: base,
log: log,
}
}