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

33
modules/task/task.go Normal file
View File

@@ -0,0 +1,33 @@
package demo
import (
_ "github.com/cool-team-official/cool-admin-go/modules/task/packed"
"github.com/cool-team-official/cool-admin-go/cool"
_ "github.com/cool-team-official/cool-admin-go/modules/task/controller"
_ "github.com/cool-team-official/cool-admin-go/modules/task/funcs"
_ "github.com/cool-team-official/cool-admin-go/modules/task/middleware"
"github.com/cool-team-official/cool-admin-go/modules/task/model"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gctx"
)
func init() {
var (
taskInfo = model.NewTaskInfo()
ctx = gctx.GetInitCtx()
)
g.Log().Debug(ctx, "module task init start ...")
cool.FillInitData(ctx, "task", taskInfo)
result, err := cool.DBM(taskInfo).Where("status = ?", 1).All()
if err != nil {
panic(err)
}
for _, v := range result {
id := v["id"].String()
cool.RunFunc(ctx, "TaskAddTask("+id+")")
}
g.Log().Debug(ctx, "module task init finished ...")
}