Files
bl/modules/task/task.go
xinian cdb7cec4ad
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
refactor: 移除冗余日志输出并优化日志处理
2026-02-02 18:32:41 +08:00

36 lines
674 B
Go

package demo
import (
_ "blazing/modules/task/packed"
"fmt"
"blazing/cool"
_ "blazing/modules/task/controller"
_ "blazing/modules/task/funcs"
_ "blazing/modules/task/middleware"
"blazing/modules/task/model"
"github.com/gogf/gf/v2/os/gctx"
)
func init() {
var (
taskInfo = model.NewTaskInfo()
ctx = gctx.GetInitCtx()
)
fmt.Println("module task init start ...")
cool.FillInitData(ctx, "task", taskInfo, nil)
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+")")
}
fmt.Println("module task init finished ...")
}