18 lines
254 B
Cheetah
18 lines
254 B
Cheetah
// This file generated automatic. Do not change this!
|
|
|
|
package db
|
|
|
|
import "gorm.io/gorm"
|
|
|
|
func BeginTransation() *gorm.DB {
|
|
return DB.Begin()
|
|
}
|
|
|
|
func EndTransaction(tx *gorm.DB, err error) {
|
|
if err != nil {
|
|
tx.Rollback()
|
|
} else {
|
|
tx.Commit()
|
|
}
|
|
}
|