[feat] 定时任务支持

This commit is contained in:
what 2023-10-30 16:38:43 +08:00
parent 00f65c347a
commit 78beb12fd5

View File

@ -1,7 +1,5 @@
package contracts package contracts
import "time"
type CronService interface { type CronService interface {
Start() error Start() error
Stop() error Stop() error
@ -11,13 +9,13 @@ type CronService interface {
type Cron interface { type Cron interface {
Controller Controller
// 任务处理 // 任务处理
Run(time.Time) error Run(User) error
} }
type CronBase struct { type CronBase struct {
Controller Controller
} }
func (CronBase) Run(t time.Time) error { func (CronBase) Run(User) error {
return nil return nil
} }