# 緊急救援 --- API 清單 - 個案關懷-緊急救援[WEB] - [Dashboard列表](#Dashboard列表) - [緊急救援列表](#緊急救援列表) - [取得緊急救援明細](#取得緊急救援明細) - [撥出](#撥出) - [處理備註/編輯](#處理備註編輯) - [從Dashboard移除](#從Dashboard移除) - 緊急救援[APP] - [發送緊急救援](#發送緊急救援) --- ## Dashboard列表 ```url POST /sos-mgmt/dashboard-list ``` #### Request * query(查詢條件json) 欄位 | 型態 | 必填 | 預設 | 說明 ---|---|---|---|--- tenantId | string | | | 租戶id,會由userToken自動帶入 * pagination(分頁json) 欄位 | 型態 | 必填 | 預設 | 說明 ---|---|---|---|--- current | int | | 1 | 當前頁數 pageSize | int | | 10 | 每頁結果數量,-1 為顯示所有 * sorter(排序json), 預設是用更新時間降序排列 欄位 | 型態 | 必填 | 預設 | 說明 ---|---|---|---|--- field | string | | callTime | 排序欄位,可排序欄位有 callTime order | string | | desc | 升序或降序 ```javascript //無payload //有payload { "query": { "tenantId": null } , "pagination": { "current": 1, "pageSize": -1 }, "sorter": { "field": "callTime", "order": "desc" } } ``` #### Response 欄位 | 型態 | 說明 --- | --- | --- id | string | 緊急救援id callTime | timestamp | 呼叫時間 geolocation | string | 呼叫時的經緯度json字串, lat:緯度, lng:經度 address | string | 呼叫時的經緯度轉換地址 status | string | 狀態, 0:未處理, 1:處理中, 2:已處理 show | string | 是否顯示在dashboard, Y:顯示, N:不顯示 name | string | 呼叫者名稱 gender | int | 性別, 1:男性, 2:女性 mobile | string | 手機號碼 age | int | 年齡 ```javascript { "httpCode": 200, "result": { "data": [ { "id": "78aaed02-270e-4912-a23b-4db79aeb8fc2", "callTime": 1648636829210, "geolocation": "{\"lat\":22.6132157,\"lng\":120.2939873}", "address": "802台灣高雄市苓雅區苓南前路2號", "status": "0", "show": "Y", "name": "蘇凱文", "gender": 1, "mobile": "0925309365", "age": 33 } ], "pagination": { "current": 1, "pageSize": -1, "total": 1 }, "sorter": { "field": "updateTime", "order": "desc" }, "total": 1 } } ``` ## 緊急救援列表 ```url POST /sos-mgmt/list ``` #### Request * query(查詢條件json) 欄位 | 型態 | 必填 | 預設 | 說明 ---|---|---|---|--- tenantId | string | | | 租戶id,會由userToken自動帶入 startDate | string | | | 查詢起日, 格式為YYYY-MM-DD endDate | string | | | 查詢迄日, 格式為YYYY-MM-DD status | string | | | 狀態, 0:未處理, 1:處理中, 2:已處理 staffId | string | | | 處理人員id name | string | | | 關鍵字, 查詢呼叫者姓名 * pagination(分頁json) 欄位 | 型態 | 必填 | 預設 | 說明 ---|---|---|---|--- current | int | | 1 | 當前頁數 pageSize | int | | 10 | 每頁結果數量,-1 為顯示所有 * sorter(排序json), 預設是用更新時間降序排列 欄位 | 型態 | 必填 | 預設 | 說明 ---|---|---|---|--- field | string | | callTime | 排序欄位,可排序欄位有 callTime, name, status, staffName, updateTime order | string | | desc | 升序或降序 ```javascript { "query": { "tenantId": null, "startDate": null, "endDate": null, "status": null, "staffId": null, "name": null } , "pagination": { "current": 1, "pageSize": -1 }, "sorter": { "field": "callTime", "order": "desc" } } ``` #### Response 欄位 | 型態 | 說明 --- | --- | --- id | string | 緊急救援id callTime | timestamp | 呼叫時間 geolocation | string | 呼叫時的經緯度json字串, lat:緯度, lng:經度 address | string | 呼叫時的經緯度轉換地址 status | string | 狀態, 0:未處理, 1:處理中, 2:已處理 show | string | 是否顯示在dashboard, Y:顯示, N:不顯示 name | string | 呼叫者名稱 gender | int | 性別, 1:男性, 2:女性 mobile | string | 手機號碼 age | int | 年齡 remark | string | 處理備註 staffName | string | 處理人員 updateTime | timestamp | 處理記錄更新時間 ```javascript { "httpCode": 200, "result": { "data": [ { "id": "78aaed02-270e-4912-a23b-4db79aeb8fc2", "callTime": 1648636829210, "geolocation": "{\"lat\":22.6132157,\"lng\":120.2939873}", "address": "802台灣高雄市苓雅區苓南前路2號", "status": "0", "show": "Y", "name": "蘇凱文", "gender": 1, "mobile": "0925309365", "age": 33 } ], "pagination": { "current": 1, "pageSize": -1, "total": 1 }, "sorter": { "field": "updateTime", "order": "desc" }, "total": 1 } } ``` ## 取得緊急救援明細 ```url POST /sos-mgmt/info ``` #### Request 欄位 | 型態 | 必填 | 預設 | 說明 ---|---|---|---|--- id | string | Y | | 緊急救援id ```javascript { "id": "c4ede7cd-8602-43fe-9f72-cfe5146d8a3c" } ``` #### Response 欄位 | 型態 | 說明 --- | --- | --- id | string | 緊急救援id callTime | timestamp | 呼叫時間 geolocation | string | 呼叫時的經緯度json字串, lat:緯度, lng:經度 address | string | 呼叫時的經緯度轉換地址 status | string | 狀態, 0:未處理, 1:處理中, 2:已處理 show | string | 是否顯示在dashboard, Y:顯示, N:不顯示 name | string | 呼叫者名稱 gender | int | 性別, 1:男性, 2:女性 mobile | string | 手機號碼 age | int | 年齡 ```javascript // HttpStatus:400, 資料不存在 { "errorMsg": "API_ERROR.NOT_EXIST", "httpCode": 400 } // HttpStatus:200 { "httpCode": 200, "result": { "data": { "id": "78aaed02-270e-4912-a23b-4db79aeb8fc2", "callTime": 1648636829210, "geolocation": "{\"lat\":22.6132157,\"lng\":120.2939873}", "address": "802台灣高雄市苓雅區苓南前路2號", "status": "0", "show": "Y", "name": "蘇凱文", "gender": 1, "mobile": "0925309365", "age": 33 } } } ``` ## 撥出 ```url POST /sos-mgmt/call-out ``` #### Request 欄位 | 型態 | 必填 | 預設 | 說明 ---|---|---|---|--- id | String | Y | | 緊急救援id ```javascript { "id": "78aaed02-270e-4912-a23b-4db79aeb8fc2" } ``` #### Response 欄位 | 型態 | 說明 --- | --- | --- id | string | 緊急救援id callTime | timestamp | 呼叫時間 geolocation | string | 呼叫時的經緯度json字串, lat:緯度, lng:經度 address | string | 呼叫時的經緯度轉換地址 status | string | 狀態, 0:未處理, 1:處理中, 2:已處理 show | string | 是否顯示在dashboard, Y:顯示, N:不顯示 name | string | 呼叫者名稱 gender | int | 性別, 1:男性, 2:女性 mobile | string | 手機號碼 age | int | 年齡 meetingId | int | 會議室id staffId | string | 處理人員accountId ```javascript // HttpStatus:422, 已被其他人處理 { "errorMsg": "SERVICE_ERROR.SOS_PROCESSED_BY_OTHER_STAFF", "httpCode": 422 } // HttpStatus: 200 { "httpCode": 200, "result": { "data": { "id": "78aaed02-270e-4912-a23b-4db79aeb8fc2", "callTime": 1648636829210, "geolocation": "{\"lat\":22.6132157,\"lng\":120.2939873}", "address": "802台灣高雄市苓雅區苓南前路2號", "status": "0", "show": "Y", "name": "蘇凱文", "gender": 1, "mobile": "0925309365", "age": 33, "meetingId": 1234567890123, "staffId": "7a17be34-13ae-4687-b971-1e5f586c8e3a" } } } ``` ## 處理備註/編輯 ```url POST /sos-mgmt/update ``` #### Request 欄位 | 型態 | 必填 | 預設 | 說明 ---|---|---|---|--- id | string | Y | | 緊急救援id remark | string | N | | 備註, 最多500字 status | string | Y | | 狀態, 0:未處理, 1:處理中, 2:已處理 ```javascript { "id": "c4ede7cd-8602-43fe-9f72-cfe5146d8a3c", "remark": "Done", "status": "2" } ``` #### Response 欄位 | 型態 | 說明 --- | --- | --- id | string | 緊急救援id callTime | timestamp | 呼叫時間 geolocation | string | 呼叫時的經緯度json字串, lat:緯度, lng:經度 address | string | 呼叫時的經緯度轉換地址 status | string | 狀態, 0:未處理, 1:處理中, 2:已處理 show | string | 是否顯示在dashboard, Y:顯示, N:不顯示 name | string | 呼叫者名稱 gender | int | 性別, 1:男性, 2:女性 mobile | string | 手機號碼 age | int | 年齡 remark | string | 處理備註 staffName | string | 處理人員 updateTime | timestamp | 處理記錄更新時間 ```javascript // HttpStatus:400, 資料不存在 { "errorMsg": "API_ERROR.NOT_EXIST", "httpCode": 400 } // HttpStatus:422, 已被其他人處理 { "errorMsg": "SERVICE_ERROR.SOS_PROCESSED_BY_OTHER_STAFF", "httpCode": 422 } // HttpStatus:200 { "httpCode": 200, "result": { "data": { "id": "78aaed02-270e-4912-a23b-4db79aeb8fc2", "callTime": 1648636829210, "geolocation": "{\"lat\":22.6132157,\"lng\":120.2939873}", "address": "802台灣高雄市苓雅區苓南前路2號", "status": "0", "show": "Y", "name": "蘇凱文", "gender": 1, "mobile": "0925309365", "age": 33, "meetingId": 1234567890123, "staffId": "7a17be34-13ae-4687-b971-1e5f586c8e3a" } } } ``` ## 從Dashboard移除 ```url POST /sos-mgmt/move-out ``` #### Request 欄位 | 型態 | 必填 | 預設 | 說明 ---|---|---|---|--- id | string | Y | | 緊急救援id ```javascript { "id": "c4ede7cd-8602-43fe-9f72-cfe5146d8a3c" } ``` #### Response 欄位 | 型態 | 說明 --- | --- | --- count | int | 更新資料筆數, > 0表示更新成功 ```javascript // HttpStatus:400, 資料不存在 { "errorMsg": "API_ERROR.NOT_EXIST", "httpCode": 400 } // HttpStatus:200 { "httpCode": 200, "result": { "data": { "count": 1 } } } ``` ## 發送緊急救援 ```url POST /sos/call ``` #### Request 欄位 | 型態 | 必填 | 預設 | 說明 ---|---|---|---|--- tenantId | string | Y | | 提供救援服務的租戶id geolocation | json | | | 經緯度json * geolocation(json) 欄位 | 型態 | 必填 | 預設 | 說明 ---|---|---|---|--- lat | double | | | 緯度 lng | double | | | 經度 ```javascript { "tenantId": "858b7fbb-3ba0-4d49-9882-c893a1ef07dc", "geolocation": { "lat": 22.6132157, "lng": 120.2939873 } } ``` #### Response 欄位 | 型態 | 說明 --- | --- | --- id | string | 緊急救援id tenantId | string | 提供緊急救援服務的租戶id householdMemberId | string | householdMemberId callTime | timestamp | 呼叫時間 geolocation | string | 呼叫時的經緯度json字串, lat:緯度, lng:經度 address | string | 呼叫時的經緯度轉換地址 status | string | 狀態, 0:未處理, 1:處理中, 2:已處理 show | string | 是否顯示在dashboard, Y:顯示, N:不顯示 ```javascript // HttpStatus:400, 資料不存在 { "errorMsg": "API_ERROR.NOT_EXIST", "httpCode": 400 } // HttpStatus:422, SOS服務項目未啟用 { "errorMsg": "SERVICE_ERROR.USER_SOS_FEATURE_NOT_ENABLED", "httpCode": 422 } // HttpStatus:200 { "httpCode": 200, "result": { "data": { "id": "78aaed02-270e-4912-a23b-4db79aeb8fc2", "tenantId": "858b7fbb-3ba0-4d49-9882-c893a1ef07dc", "householdMemberId": "8a9e980a-c612-4f87-af07-a97a5f0fbed5", "callTime": 1648636829210, "geolocation": "{\"lat\":22.6132157,\"lng\":120.2939873}", "address": "802台灣高雄市苓雅區苓南前路2號", "status": "0", "show": "Y", "createTime": 1648635078170, "updateTime": 1648636829211 } } } ```