mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-07 18:50:26 +08:00
所有数据库相关的操作支持事务
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"github.com/TeaOSLab/EdgeAPI/internal/errors"
|
||||
rpcutils "github.com/TeaOSLab/EdgeAPI/internal/rpc/utils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/iwind/TeaGo/dbs"
|
||||
)
|
||||
|
||||
type BaseService struct {
|
||||
@@ -85,3 +86,8 @@ func (this *BaseService) SuccessCount(count int64) (*pb.RPCCountResponse, error)
|
||||
func (this *BaseService) PermissionError() error {
|
||||
return errors.New("Permission Denied")
|
||||
}
|
||||
|
||||
// 空的数据库事务
|
||||
func (this *BaseService) NullTx() *dbs.Tx {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user