[feat] Job Handle 参数调整

This commit is contained in:
what 2023-06-06 10:52:07 +08:00
parent 5e9b841292
commit e17e0e2892
2 changed files with 2 additions and 19 deletions

View File

@ -1,7 +1,6 @@
package contracts package contracts
import ( import (
"github.com/samber/do"
"google.golang.org/grpc" "google.golang.org/grpc"
) )
@ -24,9 +23,3 @@ type GRpcBase struct {
func (GRpcBase) GetGRpcServiceDesc() *grpc.ServiceDesc { func (GRpcBase) GetGRpcServiceDesc() *grpc.ServiceDesc {
return nil return nil
} }
func NewJGRpcBase(container *do.Injector) GRpc {
return &GRpcBase{
Controller: &BaseController{container},
}
}

14
job.go
View File

@ -1,9 +1,5 @@
package contracts package contracts
import (
"github.com/samber/do"
)
type JobService interface { type JobService interface {
Start() error Start() error
Stop() error Stop() error
@ -14,19 +10,13 @@ type JobService interface {
type Job interface { type Job interface {
Controller Controller
// 任务处理 // 任务处理
Handle(any) error Handle(any, User) error
} }
type JobBase struct { type JobBase struct {
Controller Controller
} }
func (JobBase) Handle(any) error { func (JobBase) Handle(any, User) error {
return nil return nil
} }
func NewJobBase(container *do.Injector) Job {
return &JobBase{
Controller: &BaseController{container},
}
}