package contracts import ( "github.com/samber/do" ) type JobService interface { Start() error Stop() error Restart() error Dispatch(job string, payload any, u User) error } type Job interface { Controller // 任务处理 Handle(any) error } type JobBase struct { Controller } func (JobBase) Handle(any) error { return nil } func NewJobBase(container *do.Injector) Job { return &JobBase{ Controller: &BaseController{container}, } }