refactor(database): 更新 Dao 接口定义
- 将 Columns 方法返回类型从 any 改为 interface{}
- 添加 Group 方法用于获取分组信息
- 添加 Ctx 方法支持上下文操作
- 添加 Transaction 方法支持事务处理
- 引入 context 包以支持上下文传递
main
v1.0.2004
parent
af0a8f4043
commit
550f82bd1b
|
|
@ -1,7 +1,14 @@
|
||||||
package database
|
package database
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
)
|
||||||
|
|
||||||
type IDao interface {
|
type IDao interface {
|
||||||
DB() DB
|
DB() DB
|
||||||
TableName() string
|
TableName() string
|
||||||
Columns() any
|
Columns() interface{}
|
||||||
|
Group() string
|
||||||
|
Ctx(ctx context.Context) *Model
|
||||||
|
Transaction(ctx context.Context, f func(ctx context.Context, tx TX) error) (err error)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue