实现URL跳转功能

This commit is contained in:
刘祥超
2021-01-10 17:34:35 +08:00
parent 7e5f2239f9
commit d0138fa736
18 changed files with 381 additions and 62 deletions

View File

@@ -2,18 +2,21 @@ package models
import (
_ "github.com/go-sql-driver/mysql"
"github.com/iwind/TeaGo/dbs"
"testing"
)
func TestSysLockerDAO_Lock(t *testing.T) {
isOk, err := SharedSysLockerDAO.Lock("test", 600)
var tx *dbs.Tx
isOk, err := SharedSysLockerDAO.Lock(tx, "test", 600)
if err != nil {
t.Fatal(err)
}
t.Log(isOk)
if isOk {
err = SharedSysLockerDAO.Unlock("test")
err = SharedSysLockerDAO.Unlock(tx, "test")
if err != nil {
t.Fatal(err)
}