From 8d0f3b127680c2cfa622831db655f335423aa4af Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 26 Jun 2024 16:29:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20City=5FAPI=5FV2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- City_API_V2.md | 76 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 75 insertions(+), 1 deletion(-) diff --git a/City_API_V2.md b/City_API_V2.md index 2158025..a8006c7 100644 --- a/City_API_V2.md +++ b/City_API_V2.md @@ -1 +1,75 @@ -歡迎使用 Wiki! \ No newline at end of file +# 雲科大大門口資料串接API +## 獲取資料 +### 身分驗證 +``` +URL : http://140.125.20.183:7700/Users/authenticate +Method : POST +Content-Type: application/json +data:{ "username": "yuntech", + "password": "yuntech"} +``` +回傳: +``` +{ + "id": 2, + "firstName": "root", + "lastName": "manager", + "username": "yuntech", + "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjIiLCJuYmYiOjE3MTU1NzkwMzIsImV4cCI6MTcxNjE4MzgzMiwiaWF0IjoxNzE1NTc5MDMyfQ.83ipsy0s456_puo_alpAAVtav2hed8UC2fR-yFXZteQ" +} +``` +將獲得的token存放,之後呼叫API都需要攜帶, 每7天過期一次,記得重新獲取token + +### 新增進入大門口的車輛資料 +``` +URL : http://140.125.20.183:7700/api/Yuntech_in_car_table/city_parking_in_car_data +Method : POST +Content-Type: application/json +data:{ "license_plate_number": "string", + "car_img": "string", + "location": "string"} +``` +因為都是串即時的資料,時間會根據上傳進行觸發,因此內容不需包含時間 + +| 欄位名稱 | 型態 | 說明 | +| -------- | -------- | -------- | +| license_plate_number | string | 車牌號碼 | +| car_img | string | 無須填入 | +| location | string | 進入位置 | + +如以下操作 + +![](http://140.125.21.65:8418/Education/Python/raw/branch/master/pyqt5/img/%E5%9C%96%E7%89%873_1%20%281%29.png) + +輸出結果 + +![](http://140.125.21.65:8418/Education/Python/raw/branch/master/pyqt5/img/%E5%9C%96%E7%89%871_1%20%282%29.png) + +### 新增出去大門口的車輛資料 +出去車輛會根據資料庫內部比對車牌的進入名單的最新一筆進行匹配,上傳即可直接找到相關資料,並將時間一併帶入 +``` +URL : http://140.125.20.183:7700/api/Yuntech_in_car_table/city_parking_out_car_data +Method : POST +Content-Type: application/json +data:{ "license_plate_number": "string", + "car_img": "string", + "location": "string"} +``` + + +| 欄位名稱 | 型態 | 說明 | +| -------- | -------- | -------- | +| license_plate_number | string | 車牌號碼 | +| car_img | string | 無須填入 | +| location | string | 出去位置 | + +如以下操作 + +![](http://140.125.21.65:8418/Education/Python/raw/branch/master/pyqt5/img/%E5%9C%96%E7%89%871_1%20%281%29.png) + + +輸出結果 +![](http://140.125.21.65:8418/Education/Python/raw/branch/master/pyqt5/img/%E5%9C%96%E7%89%873_1%20%282%29.png) + + +