From 98e83851e085cc8fa9e012186fa15a0d5c5cc4b9 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 13 May 2024 14:33:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20Volation=5FAPI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Volation_API.md | 135 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 134 insertions(+), 1 deletion(-) diff --git a/Volation_API.md b/Volation_API.md index 16b325f..b4bc466 100644 --- a/Volation_API.md +++ b/Volation_API.md @@ -1,2 +1,135 @@ # 雲科大違規車輛資料串接API -## 獲取資料 \ No newline at end of file +## 獲取資料 +### 身分驗證 + 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/Violation_car_table + Method : GET + Content-Type: application/json + Authorization : token +回傳: +``` +[ + { + "violation_location_name": "工院路口", + "license_plate_number": "AAA1111", + "car_start_img": null, + "car_end_img": null, + "create_data_time": "2024-05-13T13:44:11.864091" + }, + { + "violation_location_name": "工院路口", + "license_plate_number": "BBB2222", + "car_start_img": null, + "car_end_img": null, + "create_data_time": "2024-05-13T13:27:08.730471" + }, + { + "violation_location_name": "圖書館路口", + "license_plate_number": "CCC3333", + "car_start_img": null, + "car_end_img": null, + "create_data_time": "2024-05-13T11:48:52.834442" + }, + . + . + . +] +``` + + +| 欄位名稱 | 型態 | 說明 | +| -------- | -------- | -------- | +| violation_location_name | String | 違規位置 | +| license_plate_number | String |車牌號碼| +|car_start_img | String | 違規起始圖片 | +|car_end_img | String | 違規圖片| +|create_data_time | Date | 違規時間| + + +### 透過指定時間獲取違規資料 + 位置名稱:工院路口 + 開始時間:2024-04-01 + 結束時間:2024-04-02 +``` +URL : http://140.125.20.183:7700/api/Violation_car_table/location_name_1_位置名稱-start_time-開始時間-end_time-結束時間 +Method : GET +Content-Type: application/json +Authorization : token +``` +回傳: +``` +[ + { + "violation_location_name": "工院路口", + "license_plate_number": "AAA1111", + "create_data_time": "2024-04-01T01:06:26.879025" + }, + { + "violation_location_name": "工院路口", + "license_plate_number": "BBB1234", + "create_data_time": "2024-04-01T03:19:45.347512" + }, + { + "violation_location_name": "工院路口", + "license_plate_number": "AAA1234", + "create_data_time": "2024-04-01T07:45:18.610529" + }, + . + . + . +] +``` +### 透過指定車牌獲取違規資料 + 車牌號碼:AAA1111 +``` +URL : http://140.125.20.183:7700/api/Violation_car_table/license_plate_number-車牌號碼 +Method : GET +Content-Type: application/json +Authorization : token +``` +回傳: +``` +[ + { + "violation_location_name": "工院路口", + "license_plate_number": "AAA1111", + "create_data_time": "2024-05-13T03:22:58.171957" + }, + { + "violation_location_name": "工院路口", + "license_plate_number": "AAA1111", + "create_data_time": "2024-05-10T01:02:49.948195" + }, + { + "violation_location_name": "工院路口", + "license_plate_number": "AAA1111", + "create_data_time": "2024-05-09T02:48:28.973465" + }, + . + . + . +] +``` + + + + \ No newline at end of file