升级IDatabase接口约束, 增加ListAndTotal

This commit is contained in:
白茶清欢 2025-04-20 20:09:25 +08:00
parent a0dd3ed742
commit 632c9ee5d1

View File

@ -26,6 +26,8 @@ type IDatabase interface {
UpdateOne(dbInstance *gorm.DB, updateData any, optionFuncList ...define.SetOption) (int64, error) UpdateOne(dbInstance *gorm.DB, updateData any, optionFuncList ...define.SetOption) (int64, error)
// List 查询数据列表 // List 查询数据列表
List(dbInstance *gorm.DB, result any, optionFuncList ...define.SetOption) error List(dbInstance *gorm.DB, result any, optionFuncList ...define.SetOption) error
// ListAndTotal 查询列表并返回满足条件数据总数
ListAndTotal(dbInstance *gorm.DB, listRes any, disableTotal bool, optionFuncList ...define.SetOption) (int64, error)
// Delete 删除数据 // Delete 删除数据
Delete(dbInstance *gorm.DB, dataModel any, optionFuncList ...define.SetOption) (int64, error) Delete(dbInstance *gorm.DB, dataModel any, optionFuncList ...define.SetOption) (int64, error)
// Detail 数据详情 // Detail 数据详情