[feat] 命名优化

This commit is contained in:
2023-06-05 16:52:03 +08:00
parent 73c755524a
commit b2a2d70f66
5 changed files with 100 additions and 84 deletions
+30 -1
View File
@@ -1,8 +1,37 @@
package contracts
type Job interface {
import (
"fmt"
"github.com/samber/do"
)
type JobServer interface {
Start() error
Stop() error
Restart() error
}
type JobService interface {
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 fmt.Errorf("")
}
func NewJobBase(container *do.Injector) Job {
return &JobBase{
Controller: &BaseController{container},
}
}