[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
import (
"github.com/samber/do"
"google.golang.org/grpc"
)
@ -24,9 +23,3 @@ type GRpcBase struct {
func (GRpcBase) GetGRpcServiceDesc() *grpc.ServiceDesc {
return nil
}
func NewJGRpcBase(container *do.Injector) GRpc {
return &GRpcBase{
Controller: &BaseController{container},
}
}

14
job.go
View File

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