[feat] 重新梳理依赖

This commit is contained in:
2024-05-09 13:15:24 +08:00
parent 9172fb2f34
commit bddd754869
28 changed files with 341 additions and 1075 deletions
+3 -2
View File
@@ -1,6 +1,7 @@
package contracts
import (
"git.fsdpf.net/go/req"
"github.com/samber/do"
)
@@ -10,7 +11,7 @@ type Controller interface {
// 获取 Container
Container() *do.Injector
// 派遣一个任务
Dispatch(job string, payload any, u User) error
Dispatch(job string, payload any, u req.User) error
}
type BaseController struct {
@@ -25,7 +26,7 @@ func (BaseController) Init() error {
return nil
}
func (this BaseController) Dispatch(job string, payload any, u User) error {
func (this BaseController) Dispatch(job string, payload any, u req.User) error {
return do.MustInvoke[JobService](this.Container()).Dispatch(job, payload, u)
}