feat: 升级 samber/do v1 → v2

This commit is contained in:
2026-05-15 09:04:12 +08:00
parent 7741f7584d
commit 9ad5d25836
47 changed files with 1456 additions and 684 deletions
+27
View File
@@ -0,0 +1,27 @@
package contracts
import (
"git.fsdpf.net/go/req"
"github.com/samber/do/v2"
)
type Executor interface {
Controller
Res() req.Resource
}
type BaseExecutor struct {
Controller
res string
}
func (be BaseExecutor) Res() req.Resource {
return do.MustInvoke[MustResource](be.Container())(be.res)
}
func NewBaseExecutor(container do.Injector, res string) *BaseExecutor {
return &BaseExecutor{
Controller: &BaseController{container},
res: res,
}
}