# 通知記錄 API List 1. **取得通知記錄列表** [POST /notificationRecord/list](#取得通知記錄列表-post-notificationrecordlist) 2. **取得通知明細** [POST /notificationRecord/detail](#取得通知明細-post-notificationrecorddetail) 3. **取得未讀通知記錄列表** [POST /notificationRecord/unread](#取得未讀通知記錄列表-post-notificationrecordunread) 4. **通知記錄全部已讀** [POST /notificationRecord/allread](#通知記錄全部已讀-post-notificationrecordallread) --- API Require Headers: ```javascript { Content-Type: 'application/json', Authorization: accessToken, } ``` --- ### 取得通知記錄列表 POST /notificationRecord/list #### 說明: - 根據userToken的使用者資訊去取得該帳號曾經被通知的記錄, 預設排序會依照通知時間(notificationTime)降冪排序 #### 用於: * App的通知列表(RoleType支援:一般民眾/醫生/護士) #### Request Parameter: * pagination (pagination can be null. If null, it will return all data) | Parameter | Required | format | desc | | --------- | -------- | -------- |-------- | | type | N | int | 通知類別, 0:其他, 1:測量, 2:用藥, 3:訂購, 4:活動, 5:系統, 未帶值(null)表示查詢全部通知 | | subType | N | int | 通知子類別 | | current| N| String | 目前頁數| | pageSize| N| String |一頁幾筆 | #### Request Body Example: ```javascript { "type": null, "subType": null, "pagination": { "current": 1, "pageSize": 10, "total": 1 } } ``` #### Response Body: * data | Parameter | format | desc | | --------- |-------- |-------- | | id | String | uuid | | userId| String | 使用者帳號 | | title| String | 通知標題| | description| String | 通知內容描述| |notificationTime| Long | 通知時間(Server Time), 時區即為UTC+8 | | type | int | 通知類別, 0:其他, 1:測量, 2:用藥, 3:訂購, 4:活動, 5:系統 | | subType | int | 通知子類別 | | read | boolean | 已讀未讀 | ### Response Body Example: ```javascript { "httpCode": 200, "result": { "data": [ { "id": "5f643afc-f7e5-4485-9ef0-2d995a8206d5", "userId": "E226651460", "title": "KMUH吃藥提醒", "description": "再加班就真的要吃藥了", "notificationTime": 1553652506235, "type": 1, "read": true }, { "id": "ffd07dc9-0df4-475c-9b22-fa9c9d73229a", "userId": "E226651460", "title": "我只是個通知標題", "description": "通知描述會在這裡唷", "notificationTime": 1553652116156, "type": 5, "read": true } ], "pagination": { "current": 1, "pageSize": 10, "total": 2 } } } ``` --- ### 取得通知明細 POST /notificationRecord/detail #### Request Parameter: * pagination (pagination can be null. If null, it will return all data) | Parameter | Required | format | desc | | --------- | -------- | -------- |-------- | | id | Y | String | 通知id | #### Request Body Example: ```javascript { "id":"606e58c8-3358-46e1-a44a-fc8d76ac3655" } ``` #### Response Body: * data | Parameter | format | desc | | --------- |-------- |-------- | | id | String | uuid | | userId| String | 使用者帳號 | | title| String | 通知標題| | description| String | 通知內容描述| |notificationTime| Long | 通知時間(Server Time), 時區即為UTC+8 | | type | int | 通知類別, 0:其他, 1:測量, 2:用藥, 3:訂購, 4:活動, 5:系統 | | subType | int | 通知子類別 | | read | boolean | 已讀未讀 | ### Response Body Example: ```javascript { "httpCode": 200, "result": { "data": { "id": "5f643afc-f7e5-4485-9ef0-2d995a8206d5", "userId": "E226651460", "title": "KMUH吃藥提醒", "description": "再加班就真的要吃藥了", "notificationTime": 1553652506235, "type": 1, "read": true } } } ``` --- ### 取得未讀通知記錄列表 POST /notificationRecord/unread #### 用於: * App的未讀通知列表(RoleType支援:一般民眾) #### Request Parameter: * pagination (pagination can be null. If null, it will return all data) | Parameter | Required | format | desc | | --------- | -------- | -------- |-------- | | type | N | int | 通知類別, 0:其他, 1:測量, 2:用藥, 3:訂購, 4:活動, 5:系統, 未帶值(null)表示查詢全部通知 | | subType | N | int | 通知子類別 | | current| N| String | 目前頁數| | pageSize| N| String |一頁幾筆 | #### Request Body Example: ```javascript { "type": null, "subType": null, "pagination": { "current": 1, "pageSize": 10, "total": 1 } } ``` #### Response Body: * data | Parameter | format | desc | | --------- |-------- |-------- | | id | String | uuid | | userId| String | 使用者帳號 | | title| String | 通知標題| | description| String | 通知內容描述| |notificationTime| Long | 通知時間(Server Time), 時區即為UTC+8 | | type | int | 通知類別, 0:其他, 1:測量, 2:用藥, 3:訂購, 4:活動, 5:系統 | | subType | int | 通知子類別 | | read | boolean | 已讀未讀 | ### Response Body Example: ```javascript { "httpCode": 200, "result": { "data": [ { "id": "5f643afc-f7e5-4485-9ef0-2d995a8206d5", "userId": "E226651460", "title": "KMUH吃藥提醒", "description": "再加班就真的要吃藥了", "notificationTime": 1553652506235, "type": 1, "read": false }, { "id": "ffd07dc9-0df4-475c-9b22-fa9c9d73229a", "userId": "E226651460", "title": "我只是個通知標題", "description": "通知描述會在這裡唷", "notificationTime": 1553652116156, "type": 5, "read": false } ], "pagination": { "current": 1, "pageSize": 10, "total": 2 } } } ``` --- ### 通知記錄全部已讀 POST /notificationRecord/allread #### 用於: * App的未讀通知全部改成已讀(RoleType支援:一般民眾) #### Request Parameter: * pagination (pagination can be null. If null, it will return all data) | Parameter | Required | format | desc | | --------- | -------- | -------- |-------- | | type | N | int | 通知類別, 0:其他, 1:測量, 2:用藥, 3:訂購, 4:活動, 5:系統, 未帶值(null)表示全部通知 | | subType | N | int | 通知子類別 | #### Request Body Example: ```javascript { "type": null, "subType": null } ``` #### Response Body: * data | Parameter | format | desc | | --------- |-------- |-------- | | count | int | 將未讀的改成已讀的筆數 | ### Response Body Example: ```javascript { "httpCode": 200, "result": { "data": { "count": 1 } } } ``` ---