feat: obj list api
This commit is contained in:
@ -1,6 +1,11 @@
|
||||
package data
|
||||
|
||||
import "github.com/alist-org/alist/v3/cmd/args"
|
||||
|
||||
func InitData() {
|
||||
initUser()
|
||||
initSettings()
|
||||
if args.Dev {
|
||||
initDevData()
|
||||
}
|
||||
}
|
||||
|
21
internal/bootstrap/data/dev.go
Normal file
21
internal/bootstrap/data/dev.go
Normal file
@ -0,0 +1,21 @@
|
||||
package data
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/alist-org/alist/v3/internal/model"
|
||||
"github.com/alist-org/alist/v3/internal/operations"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
func initDevData() {
|
||||
err := operations.CreateAccount(context.Background(), model.Account{
|
||||
VirtualPath: "/",
|
||||
Index: 0,
|
||||
Driver: "Local",
|
||||
Status: "",
|
||||
Addition: `{"root_folder":"."}`,
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatalf("failed to create account: %+v", err)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user