Game-as-a-Service / Lobby-Platform-Service

The Lobby platform backend of Game as a Service.
https://api.gaas.waterballsa.tw/swagger-ui/index.html
Apache License 2.0
30 stars 7 forks source link

搜尋最新註冊的遊戲 #214

Closed ricksu978 closed 5 months ago

ricksu978 commented 7 months ago

Acceptance Criteria

Tasks

kuoche1712003 commented 6 months ago

目前查詢遊戲的 api 是以下的 api GET /games

[
    {
        "id": "6496cff366371525c35a04c5",
        "name": "明星3缺1麻將",
        "img": "https://placekitten.com/300/300",
        "minPlayers": 4,
        "maxPlayers": 4,
        "createdOn": "2024-01-01T14:00:00Z"
    }
]

預計調整為可接受 query parameter GET /games?sort_by=createdOn response body 結構不變 這樣就會以 createdOn 排序由新到舊

之後要實作其他的也可以用這個 query parameter 傳遞不同的值 決定如何排序

如果沒有傳遞 query parameter 就造目前系統行為 確保向下相容