mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-08-28 05:12:32 +08:00
发布v2.4.4版本,本次为优化版本。更新内容请查看:https://github.com/bufanyun/hotgo/blob/v2.0/docs/guide-zh-CN/start-update-log.md
This commit is contained in:
@@ -240,22 +240,31 @@ func (s *sSysGenCodes) TableSelect(ctx context.Context, in sysin.GenCodesTableSe
|
||||
continue
|
||||
}
|
||||
|
||||
newValue := v.Value
|
||||
if config.Prefix != "" {
|
||||
newValue = gstr.SubStrFromEx(v.Value, config.Prefix)
|
||||
}
|
||||
if newValue == "" {
|
||||
err = gerror.Newf("表名[%v]前缀必须和配置中的前缀设置[%v] 保持一致", v.Value, config.Prefix)
|
||||
return
|
||||
}
|
||||
|
||||
// 如果是插件模块,则移除掉插件表前缀
|
||||
defVarName := gstr.SubStrFromEx(v.Value, config.Prefix)
|
||||
bt, err := gregex.Replace(patternStr, []byte(repStr), []byte(defVarName))
|
||||
bt, err := gregex.Replace(patternStr, []byte(repStr), []byte(newValue))
|
||||
if err != nil {
|
||||
err = gerror.Newf("表名[%v] gregex.Replace err:%v", v.Value, err.Error())
|
||||
break
|
||||
}
|
||||
defVarName = gstr.CaseCamel(string(bt))
|
||||
|
||||
row := new(sysin.GenCodesTableSelectModel)
|
||||
row = v
|
||||
row.DefTableComment = v.Label
|
||||
row.DaoName = gstr.CaseCamel(gstr.SubStrFromEx(v.Value, config.Prefix))
|
||||
row.DefVarName = defVarName
|
||||
row.DefAlias = gstr.CaseCamelLower(gstr.SubStrFromEx(v.Value, config.Prefix))
|
||||
row.DaoName = gstr.CaseCamel(newValue)
|
||||
row.DefVarName = gstr.CaseCamel(string(bt))
|
||||
row.DefAlias = gstr.CaseCamelLower(newValue)
|
||||
row.Name = fmt.Sprintf("%s (%s)", v.Value, v.Label)
|
||||
row.Label = row.Name
|
||||
|
||||
res = append(res, row)
|
||||
}
|
||||
return res, nil
|
||||
|
@@ -198,7 +198,7 @@ func (s *sSysLog) AnalysisLog(ctx context.Context) entity.SysLog {
|
||||
|
||||
ipData, err := location.GetLocation(ctx, clientIp)
|
||||
if err != nil {
|
||||
g.Log().Errorf(ctx, "location.GetLocation err:%+v", err)
|
||||
g.Log().Infof(ctx, "location.GetLocation clientIp:%v, err:%+v", clientIp, err)
|
||||
}
|
||||
if ipData == nil {
|
||||
ipData = new(location.IpLocationData)
|
||||
|
Reference in New Issue
Block a user