2023-10-30 15:00:33 +08:00
|
|
|
package contracts
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
|
|
|
type CronService interface {
|
|
|
|
Start() error
|
|
|
|
Stop() error
|
|
|
|
Restart() error
|
|
|
|
}
|
|
|
|
|
|
|
|
type Cron interface {
|
|
|
|
Controller
|
|
|
|
// 任务处理
|
2023-10-30 16:23:45 +08:00
|
|
|
Run(time.Time) error
|
2023-10-30 15:00:33 +08:00
|
|
|
}
|
2023-10-30 15:44:12 +08:00
|
|
|
|
|
|
|
type CronBase struct {
|
|
|
|
Controller
|
|
|
|
}
|
|
|
|
|
2023-10-30 16:23:45 +08:00
|
|
|
func (CronBase) Run(t time.Time) error {
|
2023-10-30 15:44:12 +08:00
|
|
|
return nil
|
|
|
|
}
|