[feat] Job Handle 参数调整
This commit is contained in:
parent
5e9b841292
commit
e17e0e2892
7
grpc.go
7
grpc.go
@ -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
14
job.go
@ -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},
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user