# 停車場管理時間範圍API ## 篩選時間範圍 紀錄排序為最新往最舊的排 善用`skip`和`limit`可以控制回應筆數 example: `http://192.168.6.6:8080/time_ranges/?skip=0&limit=10` `count`可回應總筆數 example: `http://192.168.6.6:8080/time_ranges/count` ### 根據時間限制篩選 `time_restrict_id`query欄位填入時間限制id,篩選此時間限制id的時間範圍 HTTP request GET example: `http://192.168.6.6:8080/time_ranges/?skip=0&limit=10&time_restrict_id=1` ### 篩選特定時間範圍 `id`query欄位填入id,篩選此id的時間範圍 HTTP request GET example: `http://192.168.6.6:8080/time_ranges/?skip=0&limit=10&id=1` ### 欄位說明 #### <ins>**Example**</ins> ``` { "start": "2022-11-01T07:56:46.976353", "end": "2022-12-01T07:56:46.976361", "time_restrict_id": 1, "id": 1 } ``` | 欄位 | 格式 | 說明 | | -------------------- | ---- | --- | | **start** | `string<date-time>(Start)` | 有效時間的起始時間 | | **end** | `string<date-time>(End)` | 有效時間的結束時間(不能早於起始時間) | | **time_restrict_id** | `integer` | 使用此時間範圍的時間限制id| | **id** | `integer` | 時間範圍的id | ## 新增時間範圍 HTTP request POST Content-Type: `application/json` HTTP request POST URL example: `http://192.168.6.6:8080/time_ranges/` ### 欄位說明 HTTP request POST Body example: ``` { "start": "2022-11-01T07:56:46.976353", "end": "2022-12-01T07:56:46.976361", "time_restrict_id": 1 } ``` | 欄位 | 格式 | 說明 | | -------------------- | ---- | --- | | **start** |`string<date-time>(Start)`| 有效時間的起始時間(必填) | | **end** | `string<date-time>(End)` | 有效時間的結束時間(必填)(不能早於起始時間) | | **time_restrict_id**| `integer` | 要使用此時間範圍的時間限制id(必填)| ## 更新時間範圍 HTTP request PUT Content-Type: `application/json` ### 參數說明 HTTP request PUT URL example: `http://192.168.6.6:8080/time_ranges/{id}` | 參數 | 格式 | 說明 | | -------------------- | ---- | --- | | **id** | `integer` | 要更新的時間範圍id | ### 欄位說明 HTTP request PUT Body example: ``` { "start": "2022-11-01T07:56:46.976353", "end": "2022-12-01T07:56:46.976361", } ``` | 欄位 | 格式 | 說明 | | -------------------- | ---- | --- | | **start** |`string<date-time>(Start)`| 有效時間的起始時間 | | **end** | `string<date-time>(End)` | 有效時間的結束時間(不能早於起始時間) | ## 刪除時間範圍 ### 刪除特定時間範圍 `id`query欄位填入時間範圍id,刪除id篩選後的時間範圍資料 HTTP request DELETE example: `http://192.168.6.6:8080/time_ranges?id=1` ### 根據時間限制刪除 `time_restrict_id`query欄位填入時間限制id,刪除時間限制id篩選後的時間範圍資料 HTTP request DELETE example: `http://192.168.6.6:8080/time_ranges?time_restrict_id=1`