aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/api
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-08-08 20:33:40 +0900
committernsfisis <nsfisis@gmail.com>2024-08-08 20:38:08 +0900
commitd94c9eb68e65d53f09bf3dd26ec4d61d245882ad (patch)
treeb759cf59afb9e1203e4b0e1f2aa81996cd8681d1 /backend/api
parentbb62b6ff19d9f8008458d1c0ad0b8b76090f091e (diff)
downloadiosdc-japan-2025-albatross-d94c9eb68e65d53f09bf3dd26ec4d61d245882ad.tar.gz
iosdc-japan-2025-albatross-d94c9eb68e65d53f09bf3dd26ec4d61d245882ad.tar.zst
iosdc-japan-2025-albatross-d94c9eb68e65d53f09bf3dd26ec4d61d245882ad.zip
feat(backend): add `code_hash` to `submissions` table
Diffstat (limited to 'backend/api')
-rw-r--r--backend/api/handler_wrapper.go28
1 files changed, 14 insertions, 14 deletions
diff --git a/backend/api/handler_wrapper.go b/backend/api/handler_wrapper.go
index 69b9baa..9f524e9 100644
--- a/backend/api/handler_wrapper.go
+++ b/backend/api/handler_wrapper.go
@@ -11,15 +11,15 @@ import (
"github.com/nsfisis/iosdc-japan-2024-albatross/backend/db"
)
-var _ StrictServerInterface = (*ApiHandlerWrapper)(nil)
+var _ StrictServerInterface = (*HandlerWrapper)(nil)
-type ApiHandlerWrapper struct {
- innerHandler Handler
+type HandlerWrapper struct {
+ impl Handler
}
-func NewHandler(queries *db.Queries, hubs GameHubsInterface) *ApiHandlerWrapper {
- return &ApiHandlerWrapper{
- innerHandler: Handler{
+func NewHandler(queries *db.Queries, hubs GameHubsInterface) *HandlerWrapper {
+ return &HandlerWrapper{
+ impl: Handler{
q: queries,
hubs: hubs,
},
@@ -39,7 +39,7 @@ func parseJWTClaimsFromAuthorizationHeader(authorization string) (*auth.JWTClaim
return claims, nil
}
-func (h *ApiHandlerWrapper) GetGame(ctx context.Context, request GetGameRequestObject) (GetGameResponseObject, error) {
+func (h *HandlerWrapper) GetGame(ctx context.Context, request GetGameRequestObject) (GetGameResponseObject, error) {
user, err := parseJWTClaimsFromAuthorizationHeader(request.Params.Authorization)
if err != nil {
return GetGame401JSONResponse{
@@ -48,10 +48,10 @@ func (h *ApiHandlerWrapper) GetGame(ctx context.Context, request GetGameRequestO
},
}, nil
}
- return h.innerHandler.GetGame(ctx, request, user)
+ return h.impl.GetGame(ctx, request, user)
}
-func (h *ApiHandlerWrapper) GetGames(ctx context.Context, request GetGamesRequestObject) (GetGamesResponseObject, error) {
+func (h *HandlerWrapper) GetGames(ctx context.Context, request GetGamesRequestObject) (GetGamesResponseObject, error) {
user, err := parseJWTClaimsFromAuthorizationHeader(request.Params.Authorization)
if err != nil {
return GetGames401JSONResponse{
@@ -60,10 +60,10 @@ func (h *ApiHandlerWrapper) GetGames(ctx context.Context, request GetGamesReques
},
}, nil
}
- return h.innerHandler.GetGames(ctx, request, user)
+ return h.impl.GetGames(ctx, request, user)
}
-func (h *ApiHandlerWrapper) GetToken(ctx context.Context, request GetTokenRequestObject) (GetTokenResponseObject, error) {
+func (h *HandlerWrapper) GetToken(ctx context.Context, request GetTokenRequestObject) (GetTokenResponseObject, error) {
user, err := parseJWTClaimsFromAuthorizationHeader(request.Params.Authorization)
if err != nil {
return GetToken401JSONResponse{
@@ -72,9 +72,9 @@ func (h *ApiHandlerWrapper) GetToken(ctx context.Context, request GetTokenReques
},
}, nil
}
- return h.innerHandler.GetToken(ctx, request, user)
+ return h.impl.GetToken(ctx, request, user)
}
-func (h *ApiHandlerWrapper) PostLogin(ctx context.Context, request PostLoginRequestObject) (PostLoginResponseObject, error) {
- return h.innerHandler.PostLogin(ctx, request)
+func (h *HandlerWrapper) PostLogin(ctx context.Context, request PostLoginRequestObject) (PostLoginResponseObject, error) {
+ return h.impl.PostLogin(ctx, request)
}