This commit is contained in:
2025-06-20 17:13:51 +08:00
parent 1b55403cd6
commit fd0345a034
472 changed files with 52560 additions and 77 deletions

View File

@@ -0,0 +1,33 @@
package funcs
import (
"github.com/cool-team-official/cool-admin-go/cool"
"github.com/cool-team-official/cool-admin-go/modules/task/model"
"github.com/cool-team-official/cool-admin-go/modules/task/service"
"github.com/gogf/gf/v2/frame/g"
)
type TaskStopFunc struct {
}
func (t *TaskStopFunc) Func(ctx g.Ctx, id string) error {
taskInfo := model.NewTaskInfo()
_, err := cool.DBM(taskInfo).Where("id = ?", id).Update(g.Map{"status": 0})
if err != nil {
return err
}
return service.DisableTask(ctx, id)
}
func (t *TaskStopFunc) IsSingleton() bool {
return false
}
func (t *TaskStopFunc) IsAllWorker() bool {
return true
}
func init() {
cool.RegisterFunc("TaskStopFunc", &TaskStopFunc{})
}