package contracts type CronService interface { Start() error Stop() error Restart() error } type Cron interface { Controller // 任务处理 Run(User) error } type CronBase struct { Controller } func (CronBase) Run(User) error { return nil }