# 停車場管理時間限制API ## 篩選時間限制 紀錄排序為最新往最舊的排 善用`skip`和`limit`可以控制回應筆數 example: `http://192.168.6.6:8080/time_restricts/?skip=0&limit=10` `count`可回應總筆數 example: `http://192.168.6.6:8080/time_restricts/count` ### 根據名稱篩選 `name`query欄位填入名稱,篩選此名稱的時間限制 HTTP request GET example: `http://192.168.6.6:8080/time_restricts/?skip=0&limit=10&name=time` ### 篩選特定時間限制 `id`query欄位填入id,篩選此id的時間限制 HTTP request GET example: `http://192.168.6.6:8080/time_restricts/?skip=0&limit=10&id=1` ### 根據邏輯篩選 `logical`query欄位填入時間限制邏輯,篩選此邏輯類別的時間限制 HTTP request GET example: `http://192.168.6.6:8080/time_restricts/?skip=0&limit=10&logical=OR` ### 欄位說明 #### <ins>**Example**</ins> ``` { "name": "停車場開放時段123", "logical": "OR", "id": 1 } ``` | 欄位 | 格式 | 說明 | | -------------------- | ---- | --- | | **name** | `string` | 時間限制名稱 | | **logical** | `string (RestrictLogic)` | periods與time_ranges的邏輯類別, `AND`、`OR`分別為交集和聯集關係 | | **id** | `integer` | 時間限制id | ## 新增時間限制 HTTP request POST Content-Type: `application/json` HTTP request POST URL example: `http://192.168.6.6:8080/time_restricts/` ### 欄位說明 HTTP request POST Body example: ``` { "name": "停車場開放時段123", "logical": "OR", } ``` | 欄位 | 格式 | 說明 | | -------------------- | ---- | --- | | **name** | `string` | 時間限制名稱,此欄位必須填入 | | **logical** | `string (RestrictLogic)` | periods與time_ranges的邏輯類別,只能填入`AND`或`OR`其中一個 | ## 更新時間限制 HTTP request PUT Content-Type: `application/json` ### 參數說明 HTTP request PUT URL example: `http://192.168.6.6:8080/time_restricts/{time_restrict_id}` | 參數 | 格式 | 說明 | | -------------------- | ---- | --- | | **time_restrict_id** | `integer` | 要更新的時間限制id | ### 欄位說明 HTTP request PUT Body example: ``` { "name": "停車場開放時段123", "logical": "OR", } ``` | 欄位 | 格式 | 說明 | | -------------------- | ---- | --- | | **name** | `string` | 時間限制名稱 | | **logical** | `string (RestrictLogic)` | periods與time_ranges的邏輯類別,只能填入`AND`或`OR`其中一個 | ## 刪除時間限制 ### 刪除特定時間限制 `id`query欄位填入時間限制id,刪除此id的時間限制資料 HTTP request DELETE example: `http://192.168.6.6:8080/time_restricts/?id=1` ### 根據名稱刪除 `name`query欄位填入名稱,刪除此名稱的時間限制 HTTP request DELETE example: `http://192.168.6.6:8080/time_restricts/?name=time` ### 根據邏輯刪除 `logical`query欄位填入時間限制邏輯,刪除此邏輯類別的時間限制 HTTP request DELETE example: `http://192.168.6.6:8080/time_restricts/?logical=OR` ## 查詢特定時間限制下的時間範圍 ### 參數說明 HTTP request GET example: `http://192.168.6.6:8080/time_restricts/{time_restrict_id}/time_ranges?skip=0&limit=10` | 參數 | 格式 | 說明 | | -------------------- | ---- | --- | | **time_restrict_id** | `integer` | 要查詢的時間限制id | ### 特定時間限制下篩選特定時間範圍 `id`query欄位填入時間範圍id,篩選此id的時間範圍 HTTP request GET example: `http://192.168.6.6:8080/time_restricts/{time_restrict_id}/time_ranges?skip=0&limit=10&id=12` ### 欄位說明 #### <ins>**Example**</ins> ``` { "start": "2022-11-01T07:56:46.976353", "end": "2022-12-01T07:56:46.976361", "time_restrict_id": 12, "id": 12 } ``` | 欄位 | 格式 | 說明 | | -------------------- | ---- | --- | | **start** | `string<date-time>(Start)` | 有效時間的起始時間 | | **end** | `string<date-time>(End)` | 有效時間的結束時間(不能早於起始時間) | | **time_restrict_id** | `integer` | 使用此時間範圍的時間限制id| | **id** | `integer` | 時間範圍的id |
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up