Draft: feat login

This commit is contained in:
2025-09-05 03:59:25 +08:00
parent 6d7074198f
commit ca49efac87
43 changed files with 2023 additions and 91 deletions

View File

@@ -0,0 +1,29 @@
package api
import (
"net/http"
"gitea.konchin.com/ytshih/inp2025/game/backend/middlewares"
"github.com/uptrace/bunrouter"
)
// GetLobbyRooms
//
// @Router /api/lobby/rooms [get]
func (self *Handlers) GetLobbyRooms(
w http.ResponseWriter,
req bunrouter.Request,
) error {
ctx := req.Context()
rooms, err := self.db.GetRooms(ctx)
if err != nil {
return middlewares.HTTPError{
StatusCode: http.StatusInternalServerError,
Message: "failed to get room",
OriginError: err,
}
}
return bunrouter.JSON(w, rooms)
}