BoardgameController
struct BoardgameController : APIRouteCollectionMethods for accessing the list of boardgames available in the onboard Games Library.
- 
                  
                  Required. Registers routes to the incoming router. DeclarationSwift func registerRoutes(_ app: Application) throws
- 
                  getBoardgames(_:Asynchronous) GET /api/v3/boardgamesReturns an array of boardgames in a structure designed to support pagination. Can be called while not logged in; if logged in favorite information is returned. URL Query Parameters - ?search=STRING- Only show boardgames whose title contains the given string.
- ?favorite=TRUE- Only return boardgames that have been favorited by current user.
- ?start=INT- Offset from start of results set
- ?limit=INT- the maximum number of games to retrieve: 1-200, default is 50.
 DeclarationSwift func getBoardgames(_ req: Request) async throws -> BoardgameResponseDataReturn Value
- 
                  getBoardgame(_:Asynchronous) `GET /api/v3/boardgames/:boardgameID Gets a single boardgame referenced by ID. Can be called while not logged in; if logged in favorite information is returned. DeclarationSwift func getBoardgame(_ req: Request) async throws -> BoardgameDataParametersboardgameIDin URL path Return Value
- 
                  getExpansions(_:Asynchronous) GET /api/v3/boardgames/expansions/:boardgameIDGiven a boardgameID for either a base game or an expansion, returns the base game and all expansions. Throws 400 error if the event was not favorited.DeclarationSwift func getExpansions(_ req: Request) async throws -> BoardgameResponseDataParametersboardgameIDin URL path Return ValueAn array of BoardgameData. First item is the base game, other items are expansions.
- 
                  addFavorite(_:Asynchronous) POST /api/v3/boardgames/:boardgameID/favoriteAdd the specified Boardgameto the user’s favorite boardgame list. Must be logged inDeclarationSwift func addFavorite(_ req: Request) async throws -> HTTPStatusParametersboardgameIDin URL path Return Value201 Created on success; 200 OK if already favorited. 
- 
                  removeFavorite(_:Asynchronous) POST /api/v3/boardgames/:boardgameID/favorite/removeDELETE /api/v3/boardgames/:boardgameID/favoriteRemove the specified Boardgamefrom the user’s boardgame favorite list.DeclarationSwift func removeFavorite(_ req: Request) async throws -> HTTPStatusParametersboardgameIDin URL path Return Value204 No Content on success; 200 OK if already not a favorite. 
- 
                  recommendGames(_:Asynchronous) POST /api/v3/boardgames/recommendReturns an array of boardgames in a structure designed to support pagination. The returned array of board games will be sorted in decreasing order of how closely each games matches the criteria in the BoardgameRecommendationDataJSON content. Can be called while not logged in; if logged in favorite information is returned.The recommendation algorithom filters out games that don’t match the given criteria, i.e. if you ask for games for 6 players, games for 1-4 players will not be returned. Then, games are assigned a score taking each games’ suggestedNumPlayers,avgPlayingTime,avgRating, andgameComplexityinto account.URL Query Parameters - ?start=INT- Offset from start of results set
- ?limit=INT- the maximum number of games to retrieve: 1-200, default is 50.
 DeclarationSwift func recommendGames(_ req: Request) async throws -> BoardgameResponseDataReturn Value
- 
                  reloadBoardGamesData(_:Asynchronous) POST /api/v3/boardgames/reloadReloads the board game data from the seed file. Removes all previous entries. Throws A 5xx response should be reported as a likely bug, please and thank you.DeclarationSwift func reloadBoardGamesData(_ req: Request) async throws -> HTTPStatusReturn ValueHTTP 200 OKif the settings were updated.
- 
                  buildBoardgameData(for:Asynchronousgames: on: ) DeclarationSwift func buildBoardgameData(for user: UserCacheData?, games: [Boardgame], on db: Database) async throws -> [BoardgameData]
 View on GitHub
            View on GitHub
          