SiteBoardgameController
struct SiteBoardgameController : SiteControllerUtils
Pages for displaying board games in the onboard Board Game Library.
-
Declaration
Swift
func registerRoutes(_ app: Application) throws -
gamesPageHandler(_:Asynchronous) GET /boardgamesReturns a list of boardgames matching the query. Pageable.
Query Parameters:
- search=STRING Filter only games whose title that match the given string.
- favorite=TRUE Filter only favorites
- start=INT
- limit=INT
Declaration
Swift
func gamesPageHandler(_ req: Request) async throws -> View -
expansionPageHandler(_:Asynchronous) GET /boardgames/:boardgameID/expansionsDeclaration
Swift
func expansionPageHandler(_ req: Request) async throws -> View -
createFezForGame(_:Asynchronous) GET /boardgames/:boardgameID/createfezOpens the Create Fez page, prefilled with info aboutt he given board game.
Declaration
Swift
func createFezForGame(_ req: Request) async throws -> View -
boardgameGuideHandler(_:Asynchronous) GET /boardgames/guideFinds boardgames that match a set of user’s criteria. Uses a scoring system to find games that best match the criteria given in the URL query. With no query, just shows the input form.
To avoid confusion: The API has both maxAge and minAge parameters. The URL query in the UI only has maxage, but considers the value 14 to actually be a minAge parameter.
Query Parameters:
numplayers=INTThe desired number of players. Filters for games that allow this # of players, and sorts for recommendedPlayers close to this.timetoplay=INTHow much time you have to play. Filters for games with a avgPlayTime shorter than this, sorts for games with avgPlayTime close to this.maxage=INTIf nonzero, filters out games with a minAge greater than this value. Special Case: The value 14 filters out games with minAge less than 14.complexity=INTIf nonzero, sorts for games with near this complexity value.
Declaration
Swift
func boardgameGuideHandler(_ req: Request) async throws -> View -
addFavoriteGame(_:Asynchronous) GET /boardgame/:boardgameID/favoriteDeclaration
Swift
func addFavoriteGame(_ req: Request) async throws -> HTTPStatus -
removeFavoriteGame(_:Asynchronous) DELETE /boardgame/:boardgameID/favoriteDeclaration
Swift
func removeFavoriteGame(_ req: Request) async throws -> HTTPStatus
View on GitHub