```
refactor(cool): 修复Logger变量名拼写错误 将全局Logger变量从Loger修正为Logger,统一日志实例命名规范, 确保所有模块中日志记录的一致性。 BREAKING CHANGE: 全局日志实例变量名从Loger改为Logger ```
This commit is contained in:
@@ -66,30 +66,30 @@ func FillInitData(ctx g.Ctx, moduleName string, model IModel, ismod *bool) (bool
|
||||
mInit := g.DB("default").Model("base_sys_init")
|
||||
n, err := mInit.Clone().Where("group", model.GroupName()).Where("table", model.TableName()).Count()
|
||||
if err != nil {
|
||||
Loger.Error(ctx, "读取表 base_sys_init 失败 ", err.Error())
|
||||
Logger.Error(ctx, "读取表 base_sys_init 失败 ", err.Error())
|
||||
return false, err
|
||||
}
|
||||
if n > 0 {
|
||||
Loger.Debug(ctx, "分组", model.GroupName(), "中的表", model.TableName(), "已经初始化过,跳过本次初始化.")
|
||||
Logger.Debug(ctx, "分组", model.GroupName(), "中的表", model.TableName(), "已经初始化过,跳过本次初始化.")
|
||||
return false, err
|
||||
}
|
||||
m := g.DB(model.GroupName()).Model(model.TableName())
|
||||
jsonData, _ := gjson.LoadContent(gres.GetContent("modules/" + moduleName + "/resource/initjson/" + model.TableName() + ".json"))
|
||||
if jsonData.Var().Clone().IsEmpty() {
|
||||
Loger.Debug(ctx, "分组", model.GroupName(), "中的表", model.TableName(), "无可用的初始化数据,跳过本次初始化.")
|
||||
Logger.Debug(ctx, "分组", model.GroupName(), "中的表", model.TableName(), "无可用的初始化数据,跳过本次初始化.")
|
||||
return false, err
|
||||
}
|
||||
_, err = m.Data(jsonData).Insert()
|
||||
if err != nil {
|
||||
Loger.Error(ctx, err.Error())
|
||||
Logger.Error(ctx, err.Error())
|
||||
return false, err
|
||||
}
|
||||
_, err = mInit.Insert(g.Map{"group": model.GroupName(), "table": model.TableName()})
|
||||
if err != nil {
|
||||
Loger.Error(ctx, err.Error())
|
||||
Logger.Error(ctx, err.Error())
|
||||
return false, err
|
||||
}
|
||||
Loger.Info(ctx, "分组", model.GroupName(), "中的表", model.TableName(), "初始化完成.")
|
||||
Logger.Info(ctx, "分组", model.GroupName(), "中的表", model.TableName(), "初始化完成.")
|
||||
if ismod != nil {
|
||||
*ismod = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user