mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-18 20:00:25 +08:00
实现HTTP部分功能
This commit is contained in:
21
internal/db/models/sys_locker_dao_test.go
Normal file
21
internal/db/models/sys_locker_dao_test.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
_ "github.com/go-sql-driver/mysql"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestSysLockerDAO_Lock(t *testing.T) {
|
||||
isOk, err := SharedSysLockerDAO.Lock("test", 600)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Log(isOk)
|
||||
|
||||
if isOk {
|
||||
err = SharedSysLockerDAO.Unlock("test")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user