25 lines
358 B
Go
25 lines
358 B
Go
package contracts
|
|
|
|
import "git.fsdpf.net/go/req"
|
|
|
|
type JobService interface {
|
|
Start() error
|
|
Stop() error
|
|
Restart() error
|
|
Dispatch(job string, payload any, u req.User) error
|
|
}
|
|
|
|
type Job interface {
|
|
Controller
|
|
// 任务处理
|
|
Handle(any, req.User) error
|
|
}
|
|
|
|
type JobBase struct {
|
|
Controller
|
|
}
|
|
|
|
func (JobBase) Handle(any, req.User) error {
|
|
return nil
|
|
}
|