refactor(initdb): 重构数据库初始化逻辑

- 修改 FillInitData 函数签名,增加 ismod 参数用于指示是否成功插入数据
- 在 base 模块初始化中使用 If 函数处理数据库初始化结果
- 优化 login 模块中的日志输出
- 修复 websocket 中的错误处理
- 更新 dict 和 task 模块的初始化逻辑
This commit is contained in:
2025-07-11 18:04:15 +08:00
parent 67605778dd
commit c1065062fb
6 changed files with 41 additions and 24 deletions

View File

@@ -17,7 +17,7 @@ func init() {
ctx = gctx.GetInitCtx()
)
g.Log().Debug(ctx, "module dict init start ...")
cool.FillInitData(ctx, "dict", &model.DictInfo{})
cool.FillInitData(ctx, "dict", &model.DictType{})
cool.FillInitData(ctx, "dict", &model.DictInfo{}, nil)
cool.FillInitData(ctx, "dict", &model.DictType{}, nil)
g.Log().Debug(ctx, "module dict init finished ...")
}