# Restaurant API 說明文件 ## GET /api/restaurants 1. 目的:顯示全部的餐廳 2. 參數:無 3. 請求網址:https://example.com/api/restaurants 4. 請求結果: ```json [ { "id": "1", "name": "FKD", "tel": "+886222113355", "address": "100000 臺北市中正區凱達格蘭大道 100 號", "opening_hours": "24", "description": "一間號稱能打敗 KFC 的快餐店。", "image": "https://example.com/kfd.jpg", "category": "快餐店" "create_at": "2999-01-01 12:00" }, ...... ] ``` ## GET /api/restaurants/:id 1. 目的:查看個別餐廳詳細資料 2. 參數:id = 餐廳 id 3. 請求網址:https://example.com/api/restaurants 4. 請求結果:與「GET /api/restaurants」同,但只會顯示該餐廳的資料。 ## GET /api/restaurants/top 1. 目的:查看最新上架的 10 筆餐廳 2. 參數:無 3. 請求網址:https://example.com/api/restaurants/:id 4. 請求結果:與「GET /api/restaurants」同,但只會顯示前 10 間最新加入的餐廳。 ## GET /api/restaurants/feeds 1. 目的:查看最新的 10 筆評論 2. 參數:無 3. 請求網址:https://example.com/api/restaurants/feeds 4. 請求結果: ```json [ { "id": "1", "restaurant": "KFD", "user": "KFE", "text": "我確認 KFD 可以打敗 KFC 了!" "create_at": "2999-01-01 12:00" }, // 以下共計 10 個最新餐廳評論。 ]