wip: user stuff

This commit is contained in:
loveuer
2025-07-11 22:12:37 +08:00
parent 99cbe8c523
commit b926a8fb80
16 changed files with 447 additions and 3 deletions

View File

@ -2,6 +2,7 @@ package cmd
import (
"context"
"loveuer/utodo/internal/api"
"loveuer/utodo/internal/model"
"loveuer/utodo/internal/opt"
g_api "loveuer/utodo/pkg/api"
@ -34,7 +35,7 @@ func svcRun(cmd *cobra.Command, args []string) error {
return err
}
if err = model.Init(cmd.Context(), db.Default.Session(tool.Timeout(60))); err != nil {
if err = model.Init(cmd.Context(), db.Default.Session(tool.Timeout(60), db.Config{Debug: opt.Cfg.Debug})); err != nil {
return err
}
@ -43,6 +44,7 @@ func svcRun(cmd *cobra.Command, args []string) error {
g_api.WithAddress(opt.Cfg.Svc.Address),
g_api.WithVersion(opt.Cfg.Version),
g_api.WithName(opt.Cfg.Name),
g_api.WithApp(api.New(cmd.Context())),
); err != nil {
return err
}