From 20e399bb39b9f93ee61ab8041ccc9d0a14da5866 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sat, 14 Sep 2024 21:43:50 +0800 Subject: [PATCH] :bug: Fix userinfo insert into wrong table --- go.mod | 2 +- go.sum | 6 ++---- pkg/internal/server/server.go | 3 ++- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index d0cff38..7e02997 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.solsynth.dev/hydrogen/interactive go 1.21.6 require ( - git.solsynth.dev/hydrogen/dealer v0.0.0-20240911145828-d734d617bfc8 + git.solsynth.dev/hydrogen/dealer v0.0.0-20240914133539-4a48b980f0b3 github.com/go-playground/validator/v10 v10.17.0 github.com/gofiber/fiber/v2 v2.52.4 github.com/json-iterator/go v1.1.12 diff --git a/go.sum b/go.sum index b5eaa12..66b1c39 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,5 @@ -git.solsynth.dev/hydrogen/dealer v0.0.0-20240823113302-208da7e90fdb h1:dv4uVDMe53eBprW2Q8ocAhZuO+DKWlWyxGiJMiwE62E= -git.solsynth.dev/hydrogen/dealer v0.0.0-20240823113302-208da7e90fdb/go.mod h1:Q51JPkKnV0UoOT/IRmdBh5CyfSlp7s8BRGzgooYHqkI= -git.solsynth.dev/hydrogen/dealer v0.0.0-20240911145828-d734d617bfc8 h1:kWheneSdSySG5tz9TAXrtr546JdMpQZTyWDFk4jeGwg= -git.solsynth.dev/hydrogen/dealer v0.0.0-20240911145828-d734d617bfc8/go.mod h1:Q51JPkKnV0UoOT/IRmdBh5CyfSlp7s8BRGzgooYHqkI= +git.solsynth.dev/hydrogen/dealer v0.0.0-20240914133539-4a48b980f0b3 h1:ucko8l9rC/XD/Gfk9lcQftyqb9tvHjL5f+aW3ydf1OI= +git.solsynth.dev/hydrogen/dealer v0.0.0-20240914133539-4a48b980f0b3/go.mod h1:Q51JPkKnV0UoOT/IRmdBh5CyfSlp7s8BRGzgooYHqkI= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= diff --git a/pkg/internal/server/server.go b/pkg/internal/server/server.go index 799aefb..6145620 100644 --- a/pkg/internal/server/server.go +++ b/pkg/internal/server/server.go @@ -54,10 +54,11 @@ func NewServer() { Output: log.Logger, })) + tablePrefix := viper.GetString("database.prefix") app.Use(gap.H.AuthMiddleware) app.Use(hyper.LinkAccountMiddleware[models.Account]( database.C, - &models.Account{}, + tablePrefix+"accounts", func(u hyper.BaseUser) models.Account { return models.Account{ BaseUser: u,