mirror of
https://github.com/fumiama/paper-manager.git
synced 2026-06-12 12:10:25 +08:00
finish backend login
This commit is contained in:
26
backend/global/db.go
Normal file
26
backend/global/db.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package global
|
||||
|
||||
import (
|
||||
"sync"
|
||||
|
||||
sql "github.com/FloatTech/sqlite"
|
||||
)
|
||||
|
||||
const (
|
||||
userdbpath = DataFolder + "user.db"
|
||||
filedbpath = DataFolder + "file.db"
|
||||
)
|
||||
|
||||
type UserDatabase struct {
|
||||
mu sync.RWMutex
|
||||
db sql.Sqlite
|
||||
}
|
||||
type FileDatabase struct {
|
||||
mu sync.RWMutex
|
||||
db sql.Sqlite
|
||||
}
|
||||
|
||||
var (
|
||||
UserDB = UserDatabase{db: sql.Sqlite{DBPath: userdbpath}}
|
||||
FileDB = FileDatabase{db: sql.Sqlite{DBPath: filedbpath}}
|
||||
)
|
||||
Reference in New Issue
Block a user