fix(db): structs are not imported

This commit is contained in:
hexxa 2022-03-05 19:27:00 +08:00 committed by Hexxa
parent 062d697841
commit e05ef9b5fd
3 changed files with 9 additions and 7 deletions

View file

@ -6,6 +6,7 @@ import (
"path/filepath" "path/filepath"
"testing" "testing"
"github.com/ihexxa/quickshare/src/db"
"github.com/ihexxa/quickshare/src/kvstore/boltdbpvd" "github.com/ihexxa/quickshare/src/kvstore/boltdbpvd"
) )
@ -95,13 +96,13 @@ func TestUserStores(t *testing.T) {
} }
testInfoMethods := func(t *testing.T, store IFileInfoStore) { testInfoMethods := func(t *testing.T, store IFileInfoStore) {
pathInfos := map[string]*FileInfo{ pathInfos := map[string]*db.FileInfo{
"admin/item": &FileInfo{ "admin/item": &db.FileInfo{
Shared: false, Shared: false,
IsDir: false, IsDir: false,
Sha1: "file", Sha1: "file",
}, },
"admin/dir": &FileInfo{ "admin/dir": &db.FileInfo{
Shared: true, Shared: true,
IsDir: true, IsDir: true,
Sha1: "dir", Sha1: "dir",

View file

@ -7,6 +7,7 @@ import (
"strings" "strings"
"testing" "testing"
"github.com/ihexxa/quickshare/src/db"
"github.com/ihexxa/quickshare/src/kvstore/boltdbpvd" "github.com/ihexxa/quickshare/src/kvstore/boltdbpvd"
) )
@ -66,12 +67,12 @@ func TestUserStores(t *testing.T) {
spaceLimit1, upLimit1, downLimit1 := int64(17), 5, 7 spaceLimit1, upLimit1, downLimit1 := int64(17), 5, 7
spaceLimit2, upLimit2, downLimit2 := int64(19), 13, 17 spaceLimit2, upLimit2, downLimit2 := int64(19), 13, 17
err = store.AddUser(&User{ err = store.AddUser(&db.User{
ID: id, ID: id,
Name: name1, Name: name1,
Pwd: pwd1, Pwd: pwd1,
Role: role1, Role: role1,
Quota: &Quota{ Quota: &db.Quota{
SpaceLimit: spaceLimit1, SpaceLimit: spaceLimit1,
UploadSpeedLimit: upLimit1, UploadSpeedLimit: upLimit1,
DownloadSpeedLimit: downLimit1, DownloadSpeedLimit: downLimit1,
@ -128,10 +129,10 @@ func TestUserStores(t *testing.T) {
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
store.SetInfo(id, &User{ store.SetInfo(id, &db.User{
ID: id, ID: id,
Role: role2, Role: role2,
Quota: &Quota{ Quota: &db.Quota{
SpaceLimit: spaceLimit2, SpaceLimit: spaceLimit2,
UploadSpeedLimit: upLimit2, UploadSpeedLimit: upLimit2,
DownloadSpeedLimit: downLimit2, DownloadSpeedLimit: downLimit2,

Binary file not shown.