From 642d3b4e1d33afd521f315b9aa99b8993d252902 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 21 Feb 2026 10:46:02 +0900 Subject: 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 --- backend/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'backend/main.go') 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) -- cgit v1.3.1