aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/main.go
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-02-21 10:46:02 +0900
committernsfisis <nsfisis@gmail.com>2026-02-21 10:46:02 +0900
commit642d3b4e1d33afd521f315b9aa99b8993d252902 (patch)
treef39e7c191033354db56675d9d3dc4c4be17d7aba /backend/main.go
parente8db174d3e464a5764a9f4bfd82172261bd50519 (diff)
downloadphperkaigi-2026-albatross-642d3b4e1d33afd521f315b9aa99b8993d252902.tar.gz
phperkaigi-2026-albatross-642d3b4e1d33afd521f315b9aa99b8993d252902.tar.zst
phperkaigi-2026-albatross-642d3b4e1d33afd521f315b9aa99b8993d252902.zip
refactor(admin): separate business logic into game and tournament services
Move transaction handling, rejudge workflow, tournament bracket creation, and data repair logic from admin handler into game.Service and tournament.Service, mirroring the earlier api package separation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'backend/main.go')
-rw-r--r--backend/main.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/backend/main.go b/backend/main.go
index 7220ca6..44d6bbe 100644
--- a/backend/main.go
+++ b/backend/main.go
@@ -107,11 +107,11 @@ func main() {
apiGroup.Use(api.SessionCookieMiddleware(queries))
apiGroup.Use(oapimiddleware.OapiRequestValidator(openAPISpec))
gameSvc := game.NewService(queries, txm, gameHub)
- tournamentSvc := tournament.NewService(queries)
+ tournamentSvc := tournament.NewService(queries, txm)
apiHandler := api.NewHandler(gameSvc, tournamentSvc, authenticator, queries, conf)
api.RegisterHandlers(apiGroup, api.NewStrictHandler(apiHandler, nil))
- adminHandler := admin.NewHandler(queries, txm, gameHub, conf)
+ adminHandler := admin.NewHandler(gameSvc, tournamentSvc, queries, conf)
adminGroup := e.Group(conf.BasePath + "admin")
adminGroup.Use(api.SessionCookieMiddleware(queries))
adminHandler.RegisterHandlers(adminGroup)