Files
bl/modules/task/task.go
昔念 164e70519f ```
refactor(cool): 修复Logger变量名拼写错误

将全局Logger变量从Loger修正为Logger,统一日志实例命名规范,
确保所有模块中日志记录的一致性。

BREAKING CHANGE: 全局日志实例变量名从Loger改为Logger
```
2025-12-25 12:14:04 +08:00

35 lines
689 B
Go

package demo
import (
_ "blazing/modules/task/packed"
"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()
)
cool.Logger.Debug(ctx, "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+")")
}
cool.Logger.Debug(ctx, "module task init finished ...")
}