代码生成模板适配gf 1.14.4

This commit is contained in:
yxh
2020-11-20 10:15:24 +08:00
parent d15c2537fc
commit cdbf16fbcd
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ func ForceLogout(ids []int) error {
if entity == nil {
continue
}
user_online.Delete("id", entity.Id)
user_online.Model.Where("id", entity.Id).Delete()
_, userKey := GetUuidUserKeyByToken(entity.Token)
if userKey == "" {
continue
+2 -2
View File
@@ -61,7 +61,7 @@ func AddSave(req *AddReq) error {
{{range $index, $column := .table.Columns}} {{if eq $column.IsInsert "1"}}
entity.{{$column.GoField}} = req.{{$column.GoField}}{{end}} {{end}}
result, err := entity.Insert()
result, err := Model.Save(entity)
if err != nil {
return err
}
@@ -93,7 +93,7 @@ func EditSave(req *EditReq) error {
// 修改实体
{{range $index, $column := .table.Columns}} {{if eq $column.IsEdit "1"}}
entity.{{$column.GoField}} = req.{{$column.GoField}}{{end}} {{end}}
_, err = entity.Update()
_, err = Model.Save(entity)
if err != nil {
g.Log().Error(err)
return gerror.New("修改失败")