升级数据库操作的接口约束
This commit is contained in:
parent
dbd51ff475
commit
61d8a086a5
@ -12,12 +12,12 @@ import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// Base 定义base约束
|
||||
// IDatabase 定义base约束
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 15:06 2023/10/14
|
||||
type Base interface {
|
||||
type IDatabase interface {
|
||||
// Create 创建数据
|
||||
Create(dbInstance *gorm.DB, data any, optionList ...database.SetOption) error
|
||||
// Update 更新数据
|
||||
@ -42,4 +42,6 @@ type Base interface {
|
||||
Commit(db *gorm.DB) error
|
||||
// Rollback 回滚事务
|
||||
Rollback(db *gorm.DB) error
|
||||
// DetailByPrimaryID 根据主键ID, 查询任意表的数据详情
|
||||
DetailByPrimaryID(dbInstance *gorm.DB, result any, primaryID any, primaryKey ...string) error
|
||||
}
|
Loading…
Reference in New Issue
Block a user