feat 调整 mysql 、pgsql 初始化数据; 完善pgsql 兼容性,适配代码生成逻辑

This commit is contained in:
孟帅
2025-11-08 12:40:03 +08:00
parent 3989996448
commit a7234bc330
49 changed files with 5360 additions and 5201 deletions

View File

@@ -1,9 +1,9 @@
// Package sys
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2024 HotGo CLI
// @Copyright Copyright (c) 2025 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
// @AutoGenerate Version 2.15.7
// @AutoGenerate Version 2.18.6
package sys
import (
@@ -79,6 +79,15 @@ func (s *sSysCurdDemo) List(ctx context.Context, in *sysin.CurdDemoListInp) (lis
mod = mod.WhereIn(dao.SysGenCurdDemo.Columns().CreatedBy, ids)
}
// 查询删除者
if in.DeletedBy != "" {
ids, err := service.AdminMember().GetIdsByKeyword(ctx, in.DeletedBy)
if err != nil {
return nil, 0, err
}
mod = mod.WhereIn(dao.SysGenCurdDemo.Columns().DeletedBy, ids)
}
// 查询创建时间
if len(in.CreatedAt) == 2 {
mod = mod.WhereBetween(dao.SysGenCurdDemo.Columns().CreatedAt, in.CreatedAt[0], in.CreatedAt[1])
@@ -165,7 +174,7 @@ func (s *sSysCurdDemo) Delete(ctx context.Context, in *sysin.CurdDemoDeleteInp)
if _, err = s.Model(ctx).WherePri(in.Id).Data(g.Map{
dao.SysGenCurdDemo.Columns().DeletedBy: contexts.GetUserId(ctx),
dao.SysGenCurdDemo.Columns().DeletedAt: gtime.Now(),
}).Update(); err != nil {
}).Unscoped().Update(); err != nil {
err = gerror.Wrap(err, "删除CURD列表失败请稍后重试")
return
}
@@ -228,4 +237,4 @@ func (s *sSysCurdDemo) Switch(ctx context.Context, in *sysin.CurdDemoSwitchInp)
return
}
return
}
}