mirror of
https://github.com/tiger1103/gfast.git
synced 2026-09-21 10:12:59 +00:00
代码生成模板适配gf 1.14.4
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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("修改失败")
|
||||
|
||||
Reference in New Issue
Block a user