# 集點卡任務 --- - 常數定義 - [集點卡任務狀態](#集點卡任務狀態) - [集點卡任務類型](#集點卡任務類型) - [集點卡附件類型](#集點卡附件類型) - [集點卡兌換方式](#集點卡兌換方式) - [集點卡掃碼規則](#集點卡掃碼規則) - [集點卡掃碼間隔單位](#集點卡掃碼間隔單位) - [使用者集點卡狀態](#使用者集點卡狀態) - API 清單 - 集點卡管理[WEB] - [集點卡管理列表](#集點卡管理列表) - [取得集點卡管理明細](#取得集點卡管理明細) - [取得上傳網址](#取得上傳網址) - [新增集點卡任務](#新增集點卡任務) - [編輯集點卡任務](#編輯集點卡任務) - [編輯集點卡任務狀態](#編輯集點卡任務狀態) - [編輯集點卡任務是否顯示](#編輯集點卡任務是否顯示) - [刪除集點卡任務](#刪除集點卡任務) - [產生集點卡任務QRCode](#產生集點卡任務QRCode) - App端 - [取得集點卡列表](#取得集點卡列表) - [取得集點卡明細](#取得集點卡明細) - [集點掃碼](#集點掃碼) - [兌換集點卡](#兌換集點卡) --- ## 常數定義 ### 集點卡任務狀態 欄位 | 型態 | 說明 ---|---|--- status | string | 集點卡任務發佈狀態, NONE: 未啟用, ON:已啟用, OFF:停用 ### 集點卡任務類型 欄位 | 型態 | 說明 ---|---|--- taskCategory | string | 集點卡任務類型, 01: 集點卡任務, 02: 定位集點任務 ### 集點卡附件類型 欄位 | 型態 | 說明 ---|---|--- attachType | string | 集點卡附件類型, NONE:無, URL:連結, FILE:檔案 ### 集點卡兌換方式 欄位 | 型態 | 說明 ---|---|--- redeemType | string | 集點卡兌換方式, 01: 線上兌換, 02: 線下兌換 ### 集點卡掃碼規則 欄位 | 型態 | 說明 ---|---|--- qrcodeType | string | 集點卡掃碼規則, 01: 使用同一個QRCode, 02: 依集點卡點數產生不同QRCode<BR>taskCategory:02時, qrType固定為02 ### 集點卡掃碼間隔單位 欄位 | 型態 | 說明 ---|---|--- scanIntervalUnit | string | 集點卡掃碼間隔單位, 01: 小時, 02: 天, 03: 分鐘, 04: 秒 ### 使用者集點卡狀態 欄位 | 型態 | 說明 ---|---|--- status | string | 使用者集點卡狀態, VALID: 有效, REDEEMED: 已兌換 ### AppUser集點卡任務列表查詢類型 欄位 | 型態 | 說明 ---|---|--- listType | string | 列表查詢類型, UN_START:未開始, ONGOING:進行中, FINISHED:已結束 --- # API 清單 ## 集點卡管理[WEB] ### 集點卡管理列表 ```url POST /loyalty-card-mgmt/list ``` #### Request-集點卡管理列表 ##### Request-集點卡管理列表-query (查詢條件json) 欄位 | 型態 | 必填 | 長度限制 | 預設 | 說明 ---|---|---|---|---|--- status | string | | 10 | | 集點卡任務狀態, 未填則表示查詢全部, 參閱 [集點卡任務狀態](#集點卡任務狀態) redeemType | string | | 10 | | 集點卡兌換方式, 未填則表示查詢全部, 參閱 [集點卡兌換方式](#集點卡兌換方式) name | string | | 50 | | 關鍵字, 查詢集點卡任務標題 isShow | boolean | | | | 顯示控制, 未填表示全部, true:顯示, false: 隱藏 ##### Request-集點卡管理列表-pagination (分頁json) 欄位 | 型態 | 必填 | 預設 | 說明 ---|---|---|---|--- current | int | | 1 | 當前頁數 pageSize | int | | 10 | 每頁結果數量,-1 為顯示所有 ##### Request-集點卡管理列表-sorter (排序json) 欄位 | 型態 | 必填 | 預設 | 說明 ---|---|---|---|--- field | string | | updateTime | 排序欄位,可排序欄位有 taskCategory, issueCardLimit, points, taskStartDate, taskEndDate, redeemType, redeemEndDate, status, updateTime order | string | | desc | 升序或降序 ```javascript { "query": { "status": null, "redeemType": null, "name": null } , "pagination": { "current": 1, "pageSize": 10 }, "sorter": { "field": "updateTime", "order": "desc" } } ``` #### Response-集點卡任務管理列表 欄位 | 型態 | 說明 --- | --- | --- id | string | 集點卡任務id tenantId | string | 租戶id taskCategory | string | 集點卡任務類型, 參閱 [集點卡任務類型](#集點卡任務類型) title | string | 集點卡任務標題 description | string | 集點卡任務說明 taskStartDate | timestamp | 集點卡任務開始日期 taskEndDate | timestamp | 集點卡任務結束日期 thumbnailObjectKey | string | 縮圖objectKey positionMapThumbnailObjectKey|string|定位集點地圖縮圖objectKey thumbnailUrl | string | 縮圖url positionMapThumbnailUrl|string|定位集點地圖縮圖url issueCardLimit | int | 發卡數量, -1表示不限發卡數 points | int | 每張集點卡的點數, 每張集點卡點數上限為30點 cardsOfAccount | int | 每一帳號最多可集幾張卡 cardsOfDayAccount | int | 每一帳號每日最多可集幾張卡 redeemType | string | 集點卡兌換方式, 參閱 [集點卡兌換方式](#集點卡兌換方式) redeemHealthPoints | int | 集點卡兌換方式為01:線上兌換時, 可兌換的Health365點數 redeemEndDate | timestamp | 兌換截止日 status | string | 集點卡任務狀態, 參閱 [集點卡任務狀態](#集點卡任務狀態) qrcodeType | string | 集點卡掃碼規則, 參閱 [集點卡掃碼規則](#集點卡掃碼規則) isInterval | boolean | 集點卡掃碼規則為01:使用同一個QRCode時, 是否需要間隔 scanIntervalFreq | int | 集點卡掃碼規則為01:使用同一個QRCode時, 所需間隔頻率 scanIntervalUnit | string | 集點卡掃碼規則為01:使用同一個QRCode時, 所需間隔單位, 參閱 [集點卡掃碼間隔單位](#集點卡掃碼間隔單位) attachType | string | 集點卡附件類型, 參閱 [集點卡附件類型](#集點卡附件類型) attachObjectKey | string | attachType為FILE時, 表示storage 中的 objectKey, attachType為URL時, 表示連結的網址 attachUrl | string | attachType為FILE時,可 download 的 url, 時效 3600 秒, attachType為URL時, 表示連結的網址 creator | string | 建立者 account id updater | string | 更新者 account id createTime | timestamp | 建立日期時間 updateTime | timestamp | 更新日期時間 mapsApiCalls | int | 地圖API呼叫次數, 如果是定位集點類型, 且有呼叫過地圖API isShow | boolean | 顯示控制, true:顯示, false: 隱藏 ```javascript { "httpCode": 200, "result": { "data": [ { "id": "9c06e179-25ba-4744-9c62-cbf1b8dedeb1", "tenantId": "858b7fbb-3ba0-4d49-9882-c893a1ef07dc", "taskCategory": "01", "title": "高雄前金健走尋寶任務-1", "description": "集滿10點即可兌換 Health 365照護平台健康點數100點,可兌換優惠票券!....", "taskStartDate": 1668528000000, "taskEndDate": 1670601600000, "thumbnailObjectKey": "loyalty_card/thumbnail/56ca1cfc-4bcb-4a0a-b079-fd08a0e75a37.png", "positionMapThumbnailObjectKey": "loyalty_card/thumbnail/44021b7a-d6bc-497f-91b8-0a4482b2f3db.png", "issueCardLimit": 20, "points": 10, "cardsOfAccount": 2, "cardsOfDayAccount": 1, "redeemType": "01", "redeemHealthPoints": 100, "redeemEndDate": 1672416000000, "status": "NONE", "qrcodeType": "01", "isInterval": true, "scanIntervalFreq": 1, "scanIntervalUnit": "01", "attachType": "FILE", "attachObjectKey": "loyalty_card/56ca1cfc-4bcb-4a0a-b079-fd08a0e75a38.png", "createTime": 1669260917092, "updateTime": 1669260917092, "creator": "98953ae4-b8f1-488c-b3ae-cb64d8caae15", "thumbnailUrl": "http://content-service/swift/v1/loyalty_card/thumbnail/56ca1cfc-4bcb-4a0a-b079-fd08a0e75a37.png", "positionMapThumbnailUrl": "http://10.31.104.23/swift/v1/AUTH_test/kmuh/loyalty_card/thumbnail/44021b7a-d6bc-497f-91b8-0a4482b2f3db.png?temp_url_sig=febcd17cfb3900550a6e867733e485729e2a3c7d&temp_url_expires=1676463927", "attachUrl": "http://content-service/swift/v1/loyalty_card/56ca1cfc-4bcb-4a0a-b079-fd08a0e75a38.png", "mapsApiCalls": 1, "isShow": true }, ... ], "pagination": { "current": 1, "pageSize": 10 }, "sorter": { "field": "updateTime", "order": "desc" } } } ``` ### 取得集點卡管理明細 ```url POST /loyalty-card-mgmt/info ``` #### Request-取得集點卡管理明細 欄位 | 型態 | 必填 | 長度限制 | 預設 | 說明 ---|---|---|---|---|--- id | string | Y | 36 | | 集點卡任務id ```javascript { "id": "9c06e179-25ba-4744-9c62-cbf1b8dedeb1" } ``` #### Response-取得集點卡管理明細 欄位 | 型態 | 說明 --- | --- | --- id | string | 集點卡任務id tenantId | string | 租戶id taskCategory | string | 集點卡任務類型, 參閱 [集點卡任務類型](#集點卡任務類型) title | string | 集點卡任務標題 description | string | 集點卡任務說明 taskStartDate | timestamp | 集點卡任務開始日期 taskEndDate | timestamp | 集點卡任務結束日期 thumbnailObjectKey | string | 縮圖objectKey positionMapThumbnailObjectKey|string|定位集點地圖縮圖objectKey thumbnailUrl | string | 縮圖url positionMapThumbnailUrl|string|定位集點地圖縮圖url loyaltyCardPointList|json array|點數的座標列表 issueCardLimit | int | 發卡數量, -1表示不限發卡數 points | int | 每張集點卡的點數, 每張集點卡點數上限為30點 cardsOfAccount | int | 每一帳號最多可集幾張卡 cardsOfDayAccount | int | 每一帳號每日最多可集幾張卡 redeemType | string | 集點卡兌換方式, 參閱 [集點卡兌換方式](#集點卡兌換方式) redeemHealthPoints | int | 集點卡兌換方式為01:線上兌換時, 可兌換的Health365點數 redeemEndDate | timestamp | 兌換截止日 status | string | 集點卡任務狀態, 參閱 [集點卡任務狀態](#集點卡任務狀態) qrcodeType | string | 集點卡掃碼規則, 參閱 [集點卡掃碼規則](#集點卡掃碼規則) isInterval | boolean | 集點卡掃碼規則為01:使用同一個QRCode時, 是否需要間隔 scanIntervalFreq | int | 集點卡掃碼規則為01:使用同一個QRCode時, 所需間隔頻率 scanIntervalUnit | string | 集點卡掃碼規則為01:使用同一個QRCode時, 所需間隔單位, 參閱 [集點卡掃碼間隔單位](#集點卡掃碼間隔單位) attachType | string | 集點卡附件類型, 參閱 [集點卡附件類型](#集點卡附件類型) attachObjectKey | string | attachType為FILE時, 表示storage 中的 objectKey, attachType為URL時, 表示連結的網址 attachUrl | string | attachType為FILE時,可 download 的 url, 時效 3600 秒, attachType為URL時, 表示連結的網址 issueCount | int | 已發出的集點卡張數 creator | string | 建立者 account id updater | string | 更新者 account id createTime | timestamp | 建立日期時間 updateTime | timestamp | 更新日期時間 isShow | boolean | 顯示控制, true:顯示, false: 隱藏 historyList | json array | 狀態歷史記錄 sport_mod | string | 集滿點後要新增的運動模式 sportDistance | float | 集滿點後要新增的運動距離. sportKcal | int | 更新者 account id集滿點後要新增的消耗熱量 ##### Response-loyaltyCardPointList 欄位 | 型態 | 說明 ---|---|--- seq| string |該點位序號 latitude | string | 緯度, 範圍-90~90, 取到小數點下五位. e.g.: 35.25422 longitude | string |經度, 範圍-180~180, 取到小數點下五位. e.g.: -135.25422 checkDistance| string |該點位達標距離, 單位:公尺 positionInfoList| json array|該點位的位置資訊 ##### Response-positionInfoList 欄位 | 型態 | 說明 ---|---|--- title | string | 位置標題 description | string |位置描述 objectKey| string |位置圖檔objectKey url|string|位置圖檔URL ##### Response-historyList(json) 欄位 | 型態 | 說明 --- | --- | --- loyaltyCardTaskId | string | 集點卡任務id status | string | 集點卡任務狀態, 參閱 [集點卡任務狀態](#集點卡任務狀態) dateTime | timestamp | 異動時間 ```javascript= // taskCategory: 01 { "httpCode": 200, "result": { "data": { "id": "04e38915-7d3a-424e-9e5a-2e9ca7a851a3", "tenantId": "858b7fbb-3ba0-4d49-9882-c893a1ef07dc", "taskCategory": "01", "title": "高雄前金健走尋寶任務-4", "description": "集滿10點即可兌換 Health 365照護平台健康點數100點,可兌換優惠票券!...", "taskStartDate": 1669824000000, "taskEndDate": 1672416000000, "thumbnailObjectKey": "loyalty_card/thumbnail/56ca1cfc-4bcb-4a0a-b079-fd08a0e75a37.png", "issueCardLimit": 10, "points": 5, "cardsOfAccount": 2, "cardsOfDayAccount": 1, "redeemType": "01", "redeemHealthPoints": 50, "redeemEndDate": 1672416000000, "status": "NONE", "qrcodeType": "01", "isInterval": true, "scanIntervalFreq": 1, "scanIntervalUnit": "01", "attachType": "FILE", "attachObjectKey": "loyalty_card/56ca1cfc-4bcb-4a0a-b079-fd08a0e75a38.png", "issueCount": 0, "createTime": 1670489589736, "updateTime": 1670489589736, "creator": "98953ae4-b8f1-488c-b3ae-cb64d8caae15", "thumbnailUrl": "http://content-service/swift/v1/loyalty_card/thumbnail/56ca1cfc-4bcb-4a0a-b079-fd08a0e75a37.png", "attachUrl": "http://content-service/swift/v1/loyalty_card/56ca1cfc-4bcb-4a0a-b079-fd08a0e75a38.png", "sportMod": "SWIMMING", "sportDistance": 1.5, "sportKcal": 342, "loyaltyCardPointList": [ { "seq": 1, "latitude": "-76.1", "longitude": "99.37777", "checkDistance": 15.2, "positionInfoList": [] }, { "seq": 2, "latitude": "-56.1", "longitude": "129.37777", "checkDistance": 50.2, "positionInfoList": [] } ], "isShow": true, "historyList": [ { "loyaltyCardTaskId": "2d2556ed-980f-4a53-ac52-f70f514f3169", "dateTime": 1679968614701, "status": "OFF" } ] } } } // taskCategory: 02 { "httpCode": 200, "result": { "data": { "id": "e458c035-0099-4839-a9ee-c7e7946fe73c", "tenantId": "5efcfd67-334e-45b3-bf49-7e52f5172891", "taskCategory": "02", "title": "123", "description": "2", "taskStartDate": 1676390400000, "taskEndDate": 1676390400000, "thumbnailObjectKey": "loyalty_card/thumbnail/44021b7a-d6bc-497f-91b8-0a4482b2f3db.png", "positionMapThumbnailObjectKey": "loyalty_card/thumbnail/44021b7a-d6bc-497f-91b8-0a4482b2f3db.png", "issueCardLimit": -1, "points": 2, "cardsOfAccount": 1, "cardsOfDayAccount": -1, "redeemType": "01", "redeemHealthPoints": 1, "redeemEndDate": 1676390400000, "status": "NONE", "qrcodeType": "02", "isInterval": false, "attachType": "NONE", "issueCount": 0, "createTime": 1678869366966, "updateTime": 1678869366966, "creator": "396bc74c-8f2a-4b0d-ba6a-c3bc2f886d26", "thumbnailUrl": "http://10.31.104.23/swift/v1/AUTH_test/kmuh/loyalty_card/thumbnail/44021b7a-d6bc-497f-91b8-0a4482b2f3db.png?temp_url_sig=67d3a2c50b1f4182920f8c718290b74915d1c4c7&temp_url_expires=1678876582", "positionMapThumbnailUrl": "http://10.31.104.23/swift/v1/AUTH_test/kmuh/loyalty_card/thumbnail/44021b7a-d6bc-497f-91b8-0a4482b2f3db.png?temp_url_sig=67d3a2c50b1f4182920f8c718290b74915d1c4c7&temp_url_expires=1678876582", "attachUrl": null, "loyaltyCardPointList": [ { "seq": 1, "latitude": "-76.1", "longitude": "99.37777", "checkDistance": 15.2, "positionInfoList": [ { "objectKey": "loyalty_card/thumbnail/44021b7a-d6bc-497f-91b8-0a4482b2f3db.png", "url": "http://10.31.104.23/swift/v1/AUTH_test/kmuh/loyalty_card/thumbnail/44021b7a-d6bc-497f-91b8-0a4482b2f3db.png?temp_url_sig=67d3a2c50b1f4182920f8c718290b74915d1c4c7&temp_url_expires=1678876582", "title": "title", "description": "des" }, { "title": "title2", "description": "des3" } ] }, { "seq": 2, "latitude": "-56.1", "longitude": "129.37777", "checkDistance": 50.2, "positionInfoList": [] } ] } } } ``` ### 取得上傳網址 ```url POST /loyalty-card-mgmt/get-upload-url ``` * 新增/編輯集點卡任務時用來上傳縮圖 #### Request-取得上傳網址 欄位 | 型態 | 必填 | 預設 | 說明 ---|---|---|---|--- isMultipart | boolean | Y | false | 是否使用分段上傳 isThumbnail | boolean | Y | false | 上傳的是否為縮圖 fileName | String | Y | | 檔名,不包含副檔名,限制最多50字 fileType | String | Y | | 副檔名, 限制最多10字 totalPart | int | **N** (isMultipart=false)<br>**Y** (isMultipart=true) | | 總分塊數量,不可小於2 parts | Array [...part] | **N** (isMultipart=false)<br>**Y** (isMultipart=true) | | part 資訊 ##### Request-取得上傳網址-part(Object) 欄位 | 型態 | 必填 | 預設 | 說明 ---|---|---|---|--- chunkSize | int | Y | | 該 chunk 的大小, bytes md5 | string | Y | | 該 part 的 md5 part | int | Y | | part number, 第幾塊 chunk ```javascript // 單檔 { "isMultipart": false, "fileName": "loyalty_card_test-2", "fileType": "png", "totalPart": null, "parts": [ ], "isThumbnail": true } // 分塊上傳 { "isMultipart": true, "isThumbnail": false, "fileName": "giphy (7)", "fileType": "mp4", "totalPart": 2, "parts": [ { "chunkSize": 5242880, "md5": "5AACA89868CD486D81192221CF9F9415", "part": 1 }, { "chunkSize": 3145728, "md5": "5AACA89868CD486D81192221CF9F9415", "part": 2 } ] } ``` #### Response-取得上傳網址 ##### Response-取得上傳網址-data 欄位 | 型態 | 說明 --- | --- | --- objectKey | string | storage 中的 objectKey, **unique** uploadId | string | 識別該次上傳的 uploadId fileName | string | 名稱 fileType | string | 副檔名 url | string | 單檔上傳的時候,才會回傳該 url, 時效 3600 秒 parts | [...part] | multipart上傳各part的url ##### Response-取得上傳網址-part 欄位 | 型態 | 說明 --- | --- | --- chunkSize | int | 該 chunk 的大小, bytes md5 | string | 該 part 的 md5 part | int | part number, 第幾塊 chunk url | string | 可上傳的 url, 時效 3600 秒 ```javascript // HttpStatus:422, 上傳的檔案類型不允許 { "errorMsg": "SERVICE_ERROR.UPLOAD_FILE_TYPE_NOT_ALLOWED", "httpCode": 422 } // HttpStatus: 200 // 單檔 { "httpCode": 200, "result": { "data": { "objectKey": "loyalty_card/thumbnail/56ca1cfc-4bcb-4a0a-b079-fd08a0e75a37.png", "uploadId": "fb483648-25d0-4137-bb49-85c17842a95b", "fileName": "loyalty_card_test-2", "fileType": "png", "url": "http://swift-storage/loyalty_card/thumbnail/56ca1cfc-4bcb-4a0a-b079-fd08a0e75a37.png" } } } // 分塊上傳 { "httpCode": 200, "result": { "data": { "objectKey": "event/f76adf26-1e22-4b18-980d-b9a68efc5171.mp4", "uploadId": "53fde368-43d9-455f-a610-62091fc30be6", "fileName": "giphy (7)", "fileType": "mp4", "parts": [ { "chunkSize": 5242880, "md5": "5AACA89868CD486D81192221CF9F9415", "part": 1, "url": "http://192.168.100.239:12345/v1/AUTH_test/kmuh_segments/event%2Ff76adf26-1e22-4b18-980d-b9a68efc5171.mp4%2F1?temp_url_sig=796c52b00f75b62be658533b2fadbc7f14381e36&temp_url_expires=1554263771" }, { "chunkSize": 3145728, "md5": "5AACA89868CD486D81192221CF9F9415", "part": 2, "url": "http://192.168.100.239:12345/v1/AUTH_test/kmuh_segments/event%2Ff76adf26-1e22-4b18-980d-b9a68efc5171.mp4%2F2?temp_url_sig=ad71de81dfbcd94bce4a091f2630c6f1373ff3cd&temp_url_expires=1554263771" } ] } } } ``` ### 新增集點卡任務 ```url POST /loyalty-card-mgmt/add ``` * 目前集點卡任務類型有 01:集點卡任務, 02:定位集點任務 * 集點卡掃碼規則選擇 01:使用同一個QRCode時, 需設定掃碼間隔頻率 #### Request-新增集點卡任務 欄位 | 型態 | 必填 | 長度限制 | 預設 | 說明 ---|---|---|---|---|--- taskCategory | string | Y | 10 | 01 | 集點卡任務類型, 參閱 [集點卡任務類型](#集點卡任務類型) title | string | Y | 30 | | 集點卡任務標題, 限制最多30字 description | string | | 1000 | | 集點卡任務說明, 限制最多1000字 taskStartDate| date | Y | | | 集點卡任務開始日期 taskEndDate | date | Y | | | 集點卡任務結束日期 thumbnailObjectKey | string | Y | 500 | | 縮圖objectKey, 先取得縮圖上傳網址並上傳成功,取其 objectKey。 positionMapThumbnailObjectKey | string | N | 500 | | taskCategory: 01時為必填, 地圖縮圖objectKey, 先取得縮圖上傳網址並上傳成功,取其 objectKey。 issueCardLimit | int | Y | | | 發卡數量, -1表示不限發卡數 points | int | Y | | | 每張集點卡的點數, 每張集點卡點數上限為30點 cardsOfAccount | int | Y | | 1 | 每一帳號最多可集幾張卡 cardsOfDayAccount | int | Y | | 1 | 每一帳號每日最多可集幾張卡 redeemType | string | Y | 10 | | 集點卡兌換方式, 參閱 [集點卡兌換方式](#集點卡兌換方式) redeemHealthPoints | int | | | | 集點卡兌換方式為01:線上兌換時, 可兌換的Health365點數 redeemEndDate | date | Y | | | 兌換截止日 status | string | Y | 10 | NONE | 集點卡任務狀態, 參閱 [集點卡任務狀態](#集點卡任務狀態) qrcodeType | string | N | 10 | | taskCategory: 01時為必填, 集點卡掃碼規則, 參閱 [集點卡掃碼規則](#集點卡掃碼規則) isInterval | boolean | **Y**(qrcodeType=01) | | | 集點卡掃碼規則為01:使用同一個QRCode時 必填, 是否需要間隔 scanIntervalFreq | int | **Y**(qrcodeType=01 && isInterval=true) | | | 集點卡掃碼規則為01:使用同一個QRCode時, 所需間隔頻率 scanIntervalUnit | string | **Y**(qrcodeType=01 && isInterval=true) | | | 集點卡掃碼規則為01:使用同一個QRCode時, 所需間隔單位, 參閱 [集點卡掃碼間隔單位](#集點卡掃碼間隔單位) loyaltyCardPointList|json array|**N** (taskCategory!=02)<br>**Y** (taskCategory==02)| 定位集點的座標點位, 點位數量必須和points相同 isThumbnailMultipart | boolean | N | | | 縮圖上傳時是否分塊上傳,預設為 false thumbnailTotalPart | int | **N** (isThumbnailMultipart=false)<br>**Y** (isThumbnailMultipart=true) | | | 縮圖上傳的總分塊數量,不可小於2 thumbnailUploadId | string | **N** (isThumbnailMultipart=false)<br>**Y** (isThumbnailMultipart=true) | | | 從 /loyalty-card-mgmt/get-upload-url 取得的 uploadId isPositionMapThumbnailMultipart | boolean | N | | | 地圖縮圖上傳時是否分塊上傳,預設為 false positionMapThumbnailTotalPart | int | **N** (isPositionMapThumbnailMultipart=false)<br>**Y** (isPositionMapThumbnailMultipart=true) | | | 縮圖上傳的總分塊數量,不可小於2 positionMapThumbnailUploadId | string | **N** (isPositionMapThumbnailMultipart=false)<br>**Y** (isPositionMapThumbnailMultipart=true) | | | 從 /loyalty-card-mgmt/get-upload-url 取得的 uploadId attachType | string | Y | 10 | | 集點卡附件類型, 參閱 [集點卡附件類型](#集點卡附件類型) attachObjectKey | string | **Y**(attachType= URL/FILE) | 500 | | 若attachType為FILE, 先取得上傳網址並上傳成功,取其 objectKey。若attachType為URL則直接存放URL網址 isAttachMultipart | boolean | N | | | attachType=FILE時, 上傳的檔案是否分塊上傳,預設為 false attachTotalPart | int | **N** (isAttachMultipart=false)<br>**Y** (isAttachMultipart=true) | | | 總分塊數量,不可小於2 attachUploadId | string | **N** (isAttachMultipart=false)<br>**Y** (isAttachMultipart=true) | | | 從 /loyal-card-mgmt/get-upload-url 取得的 uploadId sportMod | String | N | | | 集滿點後要新增的運動模式, 只有集點任務可以設定 sportDistance | float | N | | | 運動距離(m).如果有設定sportMod, 和sportKcal則一必填 sportKcal | int | N | | | 消耗熱量(千卡).如果有設定sportMod, 和sportDistance則一必填 ##### Request-loyaltyCardPointList 欄位 | 型態 | 必填 | 預設 | 說明 ---|---|---|---|--- lat | string | Y | | 緯度, 範圍-90~90, 取到小數點下五位. e.g.: 35.25422 lng | string | Y | |經度, 範圍-180~180, 取到小數點下五位. e.g.: -135.25422 checkDistance| string | Y | |該點位達標距離, 單位:公尺 positionInfoList| json array|N|該點位的位置資訊 ##### Request-positionInfoList 欄位 | 型態 | 必填 | 預設 | 說明 ---|---|---|---|--- title | string | N | | 位置標題 description | string | N | |位置描述 objectKey| string | Y | |位置圖檔objectKey ```javascript { "taskCategory": "01", "title": "高雄前金健走尋寶任務-1", "description": "集滿10點即可兌換 Health 365照護平台健康點數100點,可兌換優惠票券! ...", "taskStartDate": "2022-11-16", "taskEndDate": "2022-12-10", "thumbnailObjectKey": "loyalty_card/thumbnail/56ca1cfc-4bcb-4a0a-b079-fd08a0e75a37.png", "issueCardLimit": 20, "points": 10, "cardsOfAccount": 2, "cardsOfDayAccount": 1, "redeemEndDate": "2022-12-31", "redeemType": "01", "redeemHealthPoints": 100, "status": "NONE", "qrcodeType": "01", "isInterval": true, "scanIntervalFreq": 1, "scanIntervalUnit": "01", "isThumbnailMultipart":false, "thumbnailTotalPart": null, "thumbnailUploadId": null, "attachType": "FILE", "attachObjectKey": "loyalty_card/56ca1cfc-4bcb-4a0a-b079-fd08a0e75a38.png", "isAttachMultipart":false, "attachTotalPart": null, "attachUploadId": null, "positionMapThumbnailObjectKey": "loyalty_card/thumbnail/44021b7a-d6bc-497f-91b8-0a4482b2f3db.png", "sportMod": "SWIMMING", "sportKcal": "39", "sportDistance": "324" "positionList": [ { "lat": -76.1, "lng": "99.37777", "checkDistance": 15.2, "positionInfoList": [ { "title": "title", "description": "des", "objectKey": "loyalty_card/thumbnail/44021b7a-d6bc-497f-91b8-0a4482b2f3db.png" }, { "title": "title2", "description": "des2" } ] }, { "lat": -56.1, "lng": "129.37777", "checkDistance": 50.2 } ] } ``` #### Error-新增集點卡任務 httpCode | 錯誤碼 | 說明 --- | --- | --- 400 | API_ERROR.ARGUMENT_ERROR | 輸入參數錯誤, 可參閱 errorDesc #### Response-新增集點卡任務 欄位 | 型態 | 說明 --- | --- | --- id | string | 集點卡任務id tenantId | string | 租戶id taskCategory | string | 集點卡任務類型, 參閱 [集點卡任務類型](#集點卡任務類型) title | string | 集點卡任務標題 description | string | 集點卡任務說明 taskStartDate | timestamp | 集點卡任務開始日期 taskEndDate | timestamp | 集點卡任務結束日期 thumbnailObjectKey | string | 縮圖objectKey positionMapThumbnailObjectKey | string | 地圖縮圖objectKey thumbnailUrl | string | 縮圖url issueCardLimit | int | 發卡數量, -1表示不限發卡數 points | int | 每張集點卡的點數, 每張集點卡點數上限為30點 cardsOfAccount | int | 每一帳號最多可集幾張卡 cardsOfDayAccount | int | 每一帳號每日最多可集幾張卡 redeemType | string | 集點卡兌換方式, 參閱 [集點卡兌換方式](#集點卡兌換方式) redeemHealthPoints | int | 集點卡兌換方式為01:線上兌換時, 可兌換的Health365點數 redeemEndDate | timestamp | 兌換截止日 status | string | 集點卡任務狀態, 參閱 [集點卡任務狀態](#集點卡任務狀態) qrcodeType | string | 集點卡掃碼規則, 參閱 [集點卡掃碼規則](#集點卡掃碼規則) isInterval | boolean | 集點卡掃碼規則為01:使用同一個QRCode時, 是否需要間隔 scanIntervalFreq | int | 集點卡掃碼規則為01:使用同一個QRCode時, 所需間隔頻率 scanIntervalUnit | string | 集點卡掃碼規則為01:使用同一個QRCode時, 所需間隔單位, 參閱 [集點卡掃碼間隔單位](#集點卡掃碼間隔單位) positionList|json array|**N** (taskCategory!=02)<br>**Y** (taskCategory==02)| 定位集點的座標點位, 點位數量必須和points相同 attachType | string | 集點卡附件類型, 參閱 [集點卡附件類型](#集點卡附件類型) attachObjectKey | string | attachType為FILE時, 表示storage 中的 objectKey, attachType為URL時, 表示連結的網址 creator | string | 建立者 account id updater | string | 更新者 account id createTime | timestamp | 建立日期時間 updateTime | timestamp | 更新日期時間 ```javascript { "httpCode": 200, "result": { "data": { "id": "f9e793e5-be39-4cdd-b1e8-dede763f4ee2", "tenantId": "858b7fbb-3ba0-4d49-9882-c893a1ef07dc", "taskCategory": "01", "title": "高雄前金健走尋寶任務-1", "description": "集滿10點即可兌換 Health 365照護平台健康點數100點,可兌換優惠票券! 高雄前金健走尋寶任務活動為期二個月,參加者只需要前往指定地點打卡集點,集滿10點就可以兌換 Health365 健康幣1000點哦~ !此為限量集點活動,動作要快! 1.高雄市立大同醫院音樂樓梯2樓 2.高雄市中央公園水廣場 3.高雄市中央公園城市光廊 4.高雄市中央公園文學館 5.前金肉燥飯 6.高雄市區烏弄任一門市", "taskStartDate": 1668528000000, "taskEndDate": 1670601600000, "thumbnailObjectKey": "loyalty_card/thumbnail/56ca1cfc-4bcb-4a0a-b079-fd08a0e75a37.png", "positionMapThumbnailObjectKey": "loyalty_card/thumbnail/44021b7a-d6bc-497f-91b8-0a4482b2f3db.png", "issueCardLimit": 20, "points": 10, "cardsOfAccount": 2, "cardsOfDayAccount": 1, "redeemType": "01", "redeemHealthPoints": 100, "redeemEndDate": 1672416000000, "status": "NONE", "qrcodeType": "01", "isInterval": true, "scanIntervalFreq": 1, "scanIntervalUnit": "01", "attachType": "FILE", "attachObjectKey": "loyalty_card/56ca1cfc-4bcb-4a0a-b079-fd08a0e75a38.png", "createTime": 1669281408309, "updateTime": 1669281408309, "creator": "98953ae4-b8f1-488c-b3ae-cb64d8caae15" } } } ``` ### 編輯集點卡任務 ```url POST /loyalty-card-mgmt/update ``` * 目前集點卡任務類型有 01:集點卡任務, 02:定位集點任務 * 集點卡掃碼規則選擇 01:使用同一個QRCode時, 需設定掃碼間隔頻率 * 目前只能編輯狀態為停用, 且未超過集點卡任務結東日期的任務 * 若集點卡任務已發出集點卡(可參照issueCount已發出點集卡張數), 則只開放編輯 title, description, taskEndDate, redeemEndDate欄位 #### Request-編輯集點卡任務 欄位 | 型態 | 必填 | 長度限制 | 預設 | 說明 ---|---|---|---|---|--- id | string | Y | 36 | | 集點卡任務id taskCategory | string | Y | 10 | 01 | 集點卡任務類型, 參閱 [集點卡任務類型](#集點卡任務類型) title | string | Y | 30 | | 集點卡任務標題, 限制最多30字 description | string | | 1000 | | 集點卡任務說明, 限制最多1000字 taskStartDate| date | Y | | | 集點卡任務開始日期 taskEndDate | date | Y | | | 集點卡任務結束日期 thumbnailObjectKey | string | Y | 500 | | 縮圖objectKey, 先取得縮圖上傳網址並上傳成功,取其 objectKey。 issueCardLimit | int | Y | | | 發卡數量, -1表示不限發卡數 points | int | Y | | | 每張集點卡的點數, 每張集點卡點數上限為30點 cardsOfAccount | int | Y | | 1 | 每一帳號最多可集幾張卡 cardsOfDayAccount | int | Y | | 1 | 每一帳號每日最多可集幾張卡 redeemType | string | Y | 10 | | 集點卡兌換方式, 參閱 [集點卡兌換方式](#集點卡兌換方式) redeemHealthPoints | int | | | | 集點卡兌換方式為01:線上兌換時, 可兌換的Health365點數 redeemEndDate | date | Y | | | 兌換截止日 status | string | Y | 10 | NONE | 集點卡任務狀態, 參閱 [集點卡任務狀態](#集點卡任務狀態) qrcodeType | string | Y | 10 | | 集點卡掃碼規則, 參閱 [集點卡掃碼規則](#集點卡掃碼規則) isInterval | boolean | **Y**(qrcodeType=01) | | | 集點卡掃碼規則為01:使用同一個QRCode時, 是否需要間隔 scanIntervalFreq | int | **Y**(qrcodeType=01 && isInterval=true) | | | 集點卡掃碼規則為01:使用同一個QRCode時, 所需間隔頻率 scanIntervalUnit | string | **Y**(qrcodeType=01 && isInterval=true) | | | 集點卡掃碼規則為01:使用同一個QRCode時, 所需間隔單位, 參閱 [集點卡掃碼間隔單位](#集點卡掃碼間隔單位) isThumbnailMultipart | boolean | N | | | 縮圖上傳時是否分塊上傳,預設為 false thumbnailTotalPart | int | **N** (isThumbnailMultipart=false)<br>**Y** (isThumbnailMultipart=true) | | | 縮圖上傳的總分塊數量,不可小於2 thumbnailUploadId | string | **N** (isThumbnailMultipart=false)<br>**Y** (isThumbnailMultipart=true) | | | 從 /loyalty-card-mgmt/get-upload-url 取得的 uploadId positionMapThumbnailTotalPart | int | **N** (isPositionMapThumbnailMultipart=false)<br>**Y** (isPositionMapThumbnailMultipart=true) | | | 縮圖上傳的總分塊數量,不可小於2 positionMapThumbnailUploadId | string | **N** (isPositionMapThumbnailMultipart=false)<br>**Y** (isPositionMapThumbnailMultipart=true) | | | 從 /loyalty-card-mgmt/get-upload-url 取得的 uploadId attachType | string | Y | 10 | | 集點卡附件類型, 參閱 [集點卡附件類型](#集點卡附件類型) attachObjectKey | string | **Y**(attachType= URL/FILE) | 500 | | 若attachType為FILE, 先取得上傳網址並上傳成功,取其 objectKey。若attachType為URL則直接存放URL網址 isAttachMultipart | boolean | N | | | attachType=FILE時, 上傳的檔案是否分塊上傳,預設為 false attachTotalPart | int | **N** (isAttachMultipart=false)<br>**Y** (isAttachMultipart=true) | | | 總分塊數量,不可小於2 attachUploadId | string | **N** (isAttachMultipart=false)<br>**Y** (isAttachMultipart=true) | | | 從 /loyal-card-mgmt/get-upload-url 取得的 uploadId sportMod | String | N | | | 集滿點後要新增的運動模式, 只有集點任務可以設定 sportDistance | float | N | | | 運動距離(m).如果有設定sportMod, 和sportKcal則一必填 sportKcal | int | N | | | 消耗熱量(千卡).如果有設定sportMod, 和sportDistance則一必填 ##### Request-positionList 欄位 | 型態 | 必填 | 預設 | 說明 ---|---|---|---|--- lat | int | Y | | 緯度, 範圍-90~90, 取到小數點下五位. e.g.: 35.25422 lng | string | Y | |經度, 範圍-180~180, 取到小數點下五位. e.g.: -135.25422 checkDistance| string | Y | |該點位達標距離, 單位:公尺 positionInfoList| json array|N|該點位的位置資訊 ##### Request-positionInfoList 欄位 | 型態 | 必填 | 預設 | 說明 ---|---|---|---|--- title | string | N | | 位置標題 description | string | N | |位置描述 objectKey| string | Y | |位置圖檔objectKey ```javascript { "id": "f9e793e5-be39-4cdd-b1e8-dede763f4ee2", "title": "高雄前金健走尋寶任務-2-1", "description": "集滿10點即可兌換 Health 365照護平台健康點數100點,可兌換優惠票券!...", "taskStartDate": "2022-11-16", "taskEndDate": "2022-12-10", "thumbnailObjectKey": "loyalty_card/thumbnail/56ca1cfc-4bcb-4a0a-b079-fd08a0e75a37.png", "issueCardLimit": 20, "points": 10, "cardsOfAccount": 2, "cardsOfDayAccount": 1, "redeemEndDate": "2022-12-31", "redeemType": "01", "redeemHealthPoints": 100, "status": "NONE", "qrcodeType": "01", "isInterval": true, "scanIntervalFreq": 1, "scanIntervalUnit": "01", "isThumbnailMultipart":false, "thumbnailTotalPart": null, "thumbnailUploadId": null, "attachType": "URL", "attachObjectKey": "https://www.google.com", "isAttachMultipart":false, "attachTotalPart": null, "attachUploadId": null, "positionMapThumbnailObjectKey": "loyalty_card/thumbnail/44021b7a-d6bc-497f-91b8-0a4482b2f3db.png", "positionList": [ { "lat": -76.1, "lng": "99.37777", "checkDistance": 15.2 }, { "lat": -56.1, "lng": "129.37777", "checkDistance": 50.2 } ] } ``` #### Error-編輯集點卡任務 httpCode | 錯誤碼 | 說明 --- | --- | --- 400 | API_ERROR.NOT_EXIST | 無此筆資料 400 | API_ERROR.ARGUMENT_ERROR | 輸入參數錯誤, 可參閱 errorDesc 422 | SERVICE_ERROR.LOYALTY_CARD_MGMT_UPDATE_NOT_ALLOWED | 不允許編輯已啟用或已過期的停用集點卡任務 422 | SERVICE_ERROR.LOYALTY_CARD_MGMT_HAD_ISSUED_UPDATE_NOT_ALLOWED | 已發出集點卡不允許編輯 #### Response-編輯集點卡任務 欄位 | 型態 | 說明 --- | --- | --- id | string | 集點卡任務id tenantId | string | 租戶id taskCategory | string | 集點卡任務類型, 參閱 [集點卡任務類型](#集點卡任務類型) title | string | 集點卡任務標題 description | string | 集點卡任務說明 taskStartDate | timestamp | 集點卡任務開始日期 taskEndDate | timestamp | 集點卡任務結束日期 thumbnailObjectKey | string | 縮圖objectKey positionMapThumbnailObjectKey | string | 地圖縮圖objectKey thumbnailUrl | string | 縮圖url issueCardLimit | int | 發卡數量, -1表示不限發卡數 points | int | 每張集點卡的點數, 每張集點卡點數上限為30點 cardsOfAccount | int | 每一帳號最多可集幾張卡 cardsOfDayAccount | int | 每一帳號每日最多可集幾張卡 redeemType | string | 集點卡兌換方式, 參閱 [集點卡兌換方式](#集點卡兌換方式) redeemHealthPoints | int | 集點卡兌換方式為01:線上兌換時, 可兌換的Health365點數 redeemEndDate | timestamp | 兌換截止日 status | string | 集點卡任務狀態, 參閱 [集點卡任務狀態](#集點卡任務狀態) qrcodeType | string | 集點卡掃碼規則, 參閱 [集點卡掃碼規則](#集點卡掃碼規則) isInterval | boolean | 集點卡掃碼規則為01:使用同一個QRCode時, 是否需要間隔 scanIntervalFreq | int | 集點卡掃碼規則為01:使用同一個QRCode時, 所需間隔頻率 scanIntervalUnit | string | 集點卡掃碼規則為01:使用同一個QRCode時, 所需間隔單位, 參閱 [集點卡掃碼間隔單位](#集點卡掃碼間隔單位) attachType | string | 集點卡附件類型, 參閱 [集點卡附件類型](#集點卡附件類型) attachObjectKey | string | attachType為FILE時, 表示storage 中的 objectKey, attachType為URL時, 表示連結的網址 creator | string | 建立者 account id updater | string | 更新者 account id createTime | timestamp | 建立日期時間 updateTime | timestamp | 更新日期時間 ```javascript { "httpCode": 200, "result": { "data": { "id": "f9e793e5-be39-4cdd-b1e8-dede763f4ee2", "tenantId": "858b7fbb-3ba0-4d49-9882-c893a1ef07dc", "taskCategory": "01", "title": "高雄前金健走尋寶任務-1", "description": "集滿10點即可兌換 Health 365照護平台健康點數100點,可兌換優惠票券! ...", "taskStartDate": 1668528000000, "taskEndDate": 1670601600000, "thumbnailObjectKey": "loyalty_card/thumbnail/56ca1cfc-4bcb-4a0a-b079-fd08a0e75a37.png", "positionMapThumbnailObjectKey": "loyalty_card/thumbnail/44021b7a-d6bc-497f-91b8-0a4482b2f3db.png", "issueCardLimit": 20, "points": 10, "cardsOfAccount": 2, "cardsOfDayAccount": 1, "redeemType": "01", "redeemHealthPoints": 100, "redeemEndDate": 1672416000000, "status": "NONE", "qrcodeType": "01", "isInterval": true, "scanIntervalFreq": 1, "scanIntervalUnit": "01", "attachType": "URL", "attachObjectKey": "https://www.google.com", "createTime": 1669281408309, "updateTime": 1669281408309, "creator": "98953ae4-b8f1-488c-b3ae-cb64d8caae15" } } } ``` ### 編輯集點卡任務狀態 ```url POST /loyalty-card-mgmt/update-status ``` * 未啟用可變更為已啟用, 已啟用可變更為停用, 停用可變更為已啟用 #### Request-編輯集點卡任務狀態 欄位 | 型態 | 必填 | 長度限制 | 預設 | 說明 ---|---|---|---|---|--- id | string | Y | 36 | | 集點卡任務id status | string | Y | 10 | | 集點卡任務狀態, 參閱 [集點卡任務狀態](#集點卡任務狀態) ```javascript { "id": "f9e793e5-be39-4cdd-b1e8-dede763f4ee2", "status": "ON" } ``` #### Error-編輯集點卡任務狀態 httpCode | 錯誤碼 | 說明 --- | --- | --- 400 | API_ERROR.NOT_EXIST | 無此筆資料 400 | API_ERROR.ARGUMENT_ERROR | 輸入參數錯誤, 可參閱 errorDesc 422 | SERVICE_ERROR.LOYALTY_CARD_MGMT_UPDATE_STATUS_NOT_ALLOWED | 不允許變更狀態 #### Response-編輯集點卡任務狀態 欄位 | 型態 | 說明 --- | --- | --- id | string | 集點卡任務id tenantId | string | 租戶id taskCategory | string | 集點卡任務類型, 參閱 [集點卡任務類型](#集點卡任務類型) title | string | 集點卡任務標題 description | string | 集點卡任務說明 taskStartDate | timestamp | 集點卡任務開始日期 taskEndDate | timestamp | 集點卡任務結束日期 thumbnailObjectKey | string | 縮圖objectKey thumbnailUrl | string | 縮圖url issueCardLimit | int | 發卡數量, -1表示不限發卡數 points | int | 每張集點卡的點數, 每張集點卡點數上限為30點 cardsOfAccount | int | 每一帳號最多可集幾張卡 cardsOfDayAccount | int | 每一帳號每日最多可集幾張卡 redeemType | string | 集點卡兌換方式, 參閱 [集點卡兌換方式](#集點卡兌換方式) redeemHealthPoints | int | 集點卡兌換方式為01:線上兌換時, 可兌換的Health365點數 redeemEndDate | timestamp | 兌換截止日 status | string | 集點卡任務狀態, 參閱 [集點卡任務狀態](#集點卡任務狀態) qrcodeType | string | 集點卡掃碼規則, 參閱 [集點卡掃碼規則](#集點卡掃碼規則) isInterval | boolean | 集點卡掃碼規則為01:使用同一個QRCode時, 是否需要間隔 scanIntervalFreq | int | 集點卡掃碼規則為01:使用同一個QRCode時, 所需間隔頻率 scanIntervalUnit | string | 集點卡掃碼規則為01:使用同一個QRCode時, 所需間隔單位, 參閱 [集點卡掃碼間隔單位](#集點卡掃碼間隔單位) attachType | string | 集點卡附件類型, 參閱 [集點卡附件類型](#集點卡附件類型) attachObjectKey | string | attachType為FILE時, 表示storage 中的 objectKey, attachType為URL時, 表示連結的網址 creator | string | 建立者 account id updater | string | 更新者 account id createTime | timestamp | 建立日期時間 updateTime | timestamp | 更新日期時間 ```javascript { "httpCode": 200, "result": { "data": { "id": "f9e793e5-be39-4cdd-b1e8-dede763f4ee2", "tenantId": "858b7fbb-3ba0-4d49-9882-c893a1ef07dc", "taskCategory": "01", "title": "高雄前金健走尋寶任務-1", "description": "集滿10點即可兌換 Health 365照護平台健康點數100點,可兌換優惠票券! ...", "taskStartDate": 1668528000000, "taskEndDate": 1670601600000, "thumbnailObjectKey": "loyalty_card/thumbnail/56ca1cfc-4bcb-4a0a-b079-fd08a0e75a37.png", "issueCardLimit": 20, "points": 10, "cardsOfAccount": 2, "cardsOfDayAccount": 1, "redeemType": "01", "redeemHealthPoints": 100, "redeemEndDate": 1672416000000, "status": "ON", "qrcodeType": "01", "isInterval": true, "scanIntervalFreq": 1, "scanIntervalUnit": "01", "attachType": "URL", "attachObjectKey": "https://www.google.com", "createTime": 1669281408309, "updateTime": 1669281408309, "creator": "98953ae4-b8f1-488c-b3ae-cb64d8caae15" } } } ``` ### 編輯集點卡任務是否顯示 ```url POST /loyalty-card-mgmt/update-show ``` * 控制集點卡任務是否要顯示在後台管理列表 #### Request-編輯集點卡任務是否顯示 欄位 | 型態 | 必填 | 長度限制 | 預設 | 說明 ---|---|---|---|---|--- id | string | Y | 36 | | 集點卡任務id isShow | boolean | | | | 顯示控制, true:顯示, false: 隱藏 ```javascript { "id": "f9e793e5-be39-4cdd-b1e8-dede763f4ee2", "isShow": true } ``` #### Error-編輯集點卡任務是否顯示 httpCode | 錯誤碼 | 說明 --- | --- | --- 400 | API_ERROR.NOT_EXIST | 無此筆資料 400 | API_ERROR.ARGUMENT_ERROR | 輸入參數錯誤, 可參閱 errorDesc #### Response-編輯集點卡任務是否顯示 欄位 | 型態 | 說明 --- | --- | --- id | string | 集點卡任務id tenantId | string | 租戶id taskCategory | string | 集點卡任務類型, 參閱 [集點卡任務類型](#集點卡任務類型) title | string | 集點卡任務標題 description | string | 集點卡任務說明 taskStartDate | timestamp | 集點卡任務開始日期 taskEndDate | timestamp | 集點卡任務結束日期 thumbnailObjectKey | string | 縮圖objectKey thumbnailUrl | string | 縮圖url issueCardLimit | int | 發卡數量, -1表示不限發卡數 points | int | 每張集點卡的點數, 每張集點卡點數上限為30點 cardsOfAccount | int | 每一帳號最多可集幾張卡 cardsOfDayAccount | int | 每一帳號每日最多可集幾張卡 redeemType | string | 集點卡兌換方式, 參閱 [集點卡兌換方式](#集點卡兌換方式) redeemHealthPoints | int | 集點卡兌換方式為01:線上兌換時, 可兌換的Health365點數 redeemEndDate | timestamp | 兌換截止日 status | string | 集點卡任務狀態, 參閱 [集點卡任務狀態](#集點卡任務狀態) qrcodeType | string | 集點卡掃碼規則, 參閱 [集點卡掃碼規則](#集點卡掃碼規則) isInterval | boolean | 集點卡掃碼規則為01:使用同一個QRCode時, 是否需要間隔 scanIntervalFreq | int | 集點卡掃碼規則為01:使用同一個QRCode時, 所需間隔頻率 scanIntervalUnit | string | 集點卡掃碼規則為01:使用同一個QRCode時, 所需間隔單位, 參閱 [集點卡掃碼間隔單位](#集點卡掃碼間隔單位) attachType | string | 集點卡附件類型, 參閱 [集點卡附件類型](#集點卡附件類型) attachObjectKey | string | attachType為FILE時, 表示storage 中的 objectKey, attachType為URL時, 表示連結的網址 creator | string | 建立者 account id updater | string | 更新者 account id createTime | timestamp | 建立日期時間 updateTime | timestamp | 更新日期時間 isShow | boolean | 顯示控制, true:顯示, false: 隱藏 ```javascript { "httpCode": 200, "result": { "data": { "id": "f9e793e5-be39-4cdd-b1e8-dede763f4ee2", "tenantId": "858b7fbb-3ba0-4d49-9882-c893a1ef07dc", "taskCategory": "01", "title": "高雄前金健走尋寶任務-1", "description": "集滿10點即可兌換 Health 365照護平台健康點數100點,可兌換優惠票券! ...", "taskStartDate": 1668528000000, "taskEndDate": 1670601600000, "thumbnailObjectKey": "loyalty_card/thumbnail/56ca1cfc-4bcb-4a0a-b079-fd08a0e75a37.png", "issueCardLimit": 20, "points": 10, "cardsOfAccount": 2, "cardsOfDayAccount": 1, "redeemType": "01", "redeemHealthPoints": 100, "redeemEndDate": 1672416000000, "status": "ON", "qrcodeType": "01", "isInterval": true, "scanIntervalFreq": 1, "scanIntervalUnit": "01", "attachType": "URL", "attachObjectKey": "https://www.google.com", "createTime": 1669281408309, "updateTime": 1669281408309, "creator": "98953ae4-b8f1-488c-b3ae-cb64d8caae15", "isShow": true } } } ``` ### 刪除集點卡任務 ```url POST /loyalty-card-mgmt/delete ``` * 只允許刪除未啟用, 或已停用且未被使用者集點的集點卡任務 #### Request-刪除集點卡任務 欄位 | 型態 | 必填 | 長度限制 | 預設 | 說明 ---|---|---|---|---|--- id | string | Y | 36 | | 集點卡任務id ```javascript { "id": "b7d03fb8-5cd5-4d99-8ef0-e199d3a1e8ad" } ``` #### Error-刪除集點卡任務 httpCode | 錯誤碼 | 說明 --- | --- | --- 400 | API_ERROR.NOT_EXIST | 無此筆資料 422 | SERVICE_ERROR.LOYALTY_CARD_MGMT_DELETE_NOT_ALLOWED | 該狀態不允許刪除任務 #### Response-刪除集點卡任務 欄位 | 型態 | 說明 --- | --- | --- count | int | 刪除筆數, > 0 表示成功刪除 ```javascript { "httpCode": 200, "result": { "data": { "count": 1 } } } ``` ### 產生集點卡任務QRCode ```url POST /loyalty-card-mgmt/qrcode ``` #### Request-產生集點卡任務QRCode 欄位 | 型態 | 必填 | 長度限制 | 預設 | 說明 ---|---|---|---|---|--- id | string | Y | 36 | | 集點卡任務id ```javascript { "id": "3d39557f-52e5-4936-b9b8-d8f23b5c6ff3" } ``` #### Error-產生集點卡任務QRCode httpCode | 錯誤碼 | 說明 --- | --- | --- 400 | API_ERROR.NOT_EXIST | 無此筆資料 400 | API_ERROR.NO_DATA | 無此筆資料 400 | API_ERROR.ARGUMENT_ERROR | 輸入參數錯誤, 可參閱 errorDesc #### Response-產生集點卡任務QRCode 欄位 | 型態 | 說明 --- | --- | --- id | string | 集點卡任務id tenantId | string | 租戶id taskCategory | string | 集點卡任務類型, 參閱 [集點卡任務類型](#集點卡任務類型) title | string | 集點卡任務標題 description | string | 集點卡任務說明 taskStartDate | timestamp | 集點卡任務開始日期 taskEndDate | timestamp | 集點卡任務結束日期 thumbnailObjectKey | string | 縮圖objectKey thumbnailUrl | string | 縮圖url issueCardLimit | int | 發卡數量, -1表示不限發卡數 points | int | 每張集點卡的點數, 每張集點卡點數上限為30點 cardsOfAccount | int | 每一帳號最多可集幾張卡 cardsOfDayAccount | int | 每一帳號每日最多可集幾張卡 redeemType | string | 集點卡兌換方式, 參閱 [集點卡兌換方式](#集點卡兌換方式) redeemHealthPoints | int | 集點卡兌換方式為01:線上兌換時, 可兌換的Health365點數 redeemEndDate | timestamp | 兌換截止日 status | string | 集點卡任務狀態, 參閱 [集點卡任務狀態](#集點卡任務狀態) qrcodeType | string | 集點卡掃碼規則, 參閱 [集點卡掃碼規則](#集點卡掃碼規則) isInterval | boolean | 集點卡掃碼規則為01:使用同一個QRCode時, 是否需要間隔 scanIntervalFreq | int | 集點卡掃碼規則為01:使用同一個QRCode時, 所需間隔頻率 scanIntervalUnit | string | 集點卡掃碼規則為01:使用同一個QRCode時, 所需間隔單位, 參閱 [集點卡掃碼間隔單位](#集點卡掃碼間隔單位) attachType | string | 集點卡附件類型, 參閱 [集點卡附件類型](#集點卡附件類型) attachObjectKey | string | attachType為FILE時, 表示storage 中的 objectKey, attachType為URL時, 表示連結的網址 attachUrl | string | attachType為FILE時,可 download 的 url, 時效 3600 秒, attachType為URL時, 表示連結的網址 creator | string | 建立者 account id updater | string | 更新者 account id createTime | timestamp | 建立日期時間 updateTime | timestamp | 更新日期時間 loyaltyCardPointList | json array | 集點卡任務點數json array ##### Response-產生集點卡任務QRCode-loyaltyCardPoint(json) 欄位 | 型態 | 說明 --- | --- | --- id | string | 集點卡任務點數id loyaltyCardTaskId | string | 集點卡任務id seq | int | 集點卡任務點數序號 base64QrCode | string | QRCode base64字串 ```javascript { "httpCode": 200, "result": { "data": { "id": "3d39557f-52e5-4936-b9b8-d8f23b5c6ff3", "tenantId": "858b7fbb-3ba0-4d49-9882-c893a1ef07dc", "taskCategory": "01", "title": "高雄前金健走尋寶任務-3", "description": "集滿10點即可兌換 Health 365照護平台健康點數100點,可兌換優惠票券!...", "taskStartDate": 1668528000000, "taskEndDate": 1670601600000, "thumbnailObjectKey": "loyalty_card/thumbnail/56ca1cfc-4bcb-4a0a-b079-fd08a0e75a37.png", "issueCardLimit": 10, "points": 5, "cardsOfAccount": 1, "cardsOfDayAccount": 1, "redeemType": "01", "redeemHealthPoints": 100, "redeemEndDate": 1672416000000, "status": "NONE", "qrcodeType": "01", "isInterval": true, "scanIntervalFreq": 1, "scanIntervalUnit": "01", "attachType": "FILE", "attachObjectKey": "loyalty_card/56ca1cfc-4bcb-4a0a-b079-fd08a0e75a38.png", "createTime": 1669654908291, "updateTime": 1669654908291, "creator": "98953ae4-b8f1-488c-b3ae-cb64d8caae15", "thumbnailUrl": null, "attachUrl": null, "loyaltyCardPointList": [ { "id": "e4b6238d-224f-49cd-adc1-d1bdde2b57aa", "loyaltyCardTaskId": "3d39557f-52e5-4936-b9b8-d8f23b5c6ff3", "seq": 1, "base64QrCode": "iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAIAAAAP3aGbAAANC..." } ] } } } ``` ### 匯出任務集點報表 ```url POST /loyalty-card-mgmt/export-card-statistics ``` #### Request-匯出任務集點報表 欄位 | 型態 | 必填 | 長度限制 | 預設 | 說明 ---|---|---|---|---|--- id | string | Y | 36 | | 集點卡任務id ```javascript { "id": "3d39557f-52e5-4936-b9b8-d8f23b5c6ff3" } ``` #### Error-匯出任務集點報表 httpCode | 錯誤碼 | 說明 --- | --- | --- 400 | API_ERROR.NOT_EXIST | 無此筆資料 403 | API_ERROR.PERMISSION_DENIED | 無此操作權限 422 | SERVICE_ERROR.LOYALTY_CARD_MGMT_EXPORT_STATUS_NOT_ALLOWED | 該狀態不允許匯出 #### Response-匯出任務集點報表 * httpCode 200 -Download file ``` File name: H365_v2_匯出_任務集點報表.xlsx ``` ## App端 ### 取得集點卡列表 ```url POST /loyalty-card/list ``` * App User 查詢用 * 使用listType來查詢不同類型列表 * listType=UN_START: 未開始, 查詢已上架但尚未開始的集點卡任務 * listType=ONGOING: 進行中, 查詢進行中的集點卡任務 * listType=FINISHED: 已結束, 查詢已結束但且有集點的集點卡任務 #### Request-取得集點卡列表 ##### Request-取得集點卡列表-query (查詢條件json) 欄位 | 型態 | 必填 | 長度限制 | 預設 | 說明 ---|---|---|---|---|--- listType | string | | 10 | | 集點卡任務列表查詢類型, 參閱 [集點卡任務列表查詢類型](#AppUser集點卡任務列表查詢類型) ```javascript { "query": { "listType": "ONGOING" } } ``` #### Response-取得集點卡列表 欄位 | 型態 | 說明 --- | --- | --- id | string | 集點卡任務id tenantId | string | 租戶id tenantName | string | 租戶名稱 taskCategory | string | 集點卡任務類型, 參閱 [集點卡任務類型](#集點卡任務類型) title | string | 集點卡任務標題 description | string | 集點卡任務說明 taskStartDate | timestamp | 集點卡任務開始日期 taskEndDate | timestamp | 集點卡任務結束日期 thumbnailObjectKey | string | 縮圖objectKey thumbnailUrl | string | 縮圖url issueCardLimit | int | 發卡數量, -1表示不限發卡數 points | int | 每張集點卡的點數, 每張集點卡點數上限為30點 cardsOfAccount | int | 每一帳號最多可集幾張卡 cardsOfDayAccount | int | 每一帳號每日最多可集幾張卡 redeemType | string | 集點卡兌換方式, 參閱 [集點卡兌換方式](#集點卡兌換方式) redeemHealthPoints | int | 集點卡兌換方式為01:線上兌換時, 可兌換的Health365點數 redeemEndDate | timestamp | 兌換截止日 status | string | 集點卡任務狀態, 參閱 [集點卡任務狀態](#集點卡任務狀態) qrcodeType | string | 集點卡掃碼規則, 參閱 [集點卡掃碼規則](#集點卡掃碼規則) isInterval | boolean | 集點卡掃碼規則為01:使用同一個QRCode時, 是否需要間隔 scanIntervalFreq | int | 集點卡掃碼規則為01:使用同一個QRCode時, 所需間隔頻率 scanIntervalUnit | string | 集點卡掃碼規則為01:使用同一個QRCode時, 所需間隔單位, 參閱 [集點卡掃碼間隔單位](#集點卡掃碼間隔單位) attachType | string | 集點卡附件類型, 參閱 [集點卡附件類型](#集點卡附件類型) attachObjectKey | string | attachType為FILE時, 表示storage 中的 objectKey, attachType為URL時, 表示連結的網址 attachUrl | string | attachType為FILE時,可 download 的 url, 時效 3600 秒, attachType為URL時, 表示連結的網址 updateTime | timestamp | 更新日期時間 earnPoints | int | 此集點卡任務已集點數 ```javascript { "httpCode": 200, "result": { "data": [ { "id": "f9e793e5-be39-4cdd-b1e8-dede763f4ee2", "tenantId": "858b7fbb-3ba0-4d49-9882-c893a1ef07dc", "tenantName": "緯緯醫學", "taskCategory": "01", "title": "高雄前金健走尋寶任務-2-1", "description": "集滿10點即可兌換 Health 365照護平台健康點數100點,可兌換優惠票券!...", "taskStartDate": 1668528000000, "taskEndDate": 1670687999999, "thumbnailObjectKey": "loyalty_card/thumbnail/56ca1cfc-4bcb-4a0a-b079-fd08a0e75a37.png", "issueCardLimit": 20, "points": 10, "cardsOfAccount": 2, "cardsOfDayAccount": 1, "redeemType": "01", "redeemHealthPoints": 100, "redeemEndDate": 1672502399999, "status": "ON", "qrcodeType": "01", "isInterval": true, "scanIntervalFreq": 1, "scanIntervalUnit": "01", "attachType": "FILE", "attachObjectKey": "loyalty_card/56ca1cfc-4bcb-4a0a-b079-fd08a0e75a38.png", "updateTime": 1669282022228, "thumbnailUrl": "http://content-service/swift/v1/loyalty_card/thumbnail/56ca1cfc-4bcb-4a0a-b079-fd08a0e75a37.png", "attachUrl": "http://content-service/swift/v1/loyalty_card/56ca1cfc-4bcb-4a0a-b079-fd08a0e75a38.png", "earnPoints": 2 } ] } } ``` ### 取得集點卡明細 ```url POST /loyalty-card/info ``` #### Request-取得集點卡明細 欄位 | 型態 | 必填 | 長度限制 | 預設 | 說明 ---|---|---|---|---|--- id | string | Y | 36 | | 集點卡任務id ```javascript { "id": "f9e793e5-be39-4cdd-b1e8-dede763f4ee2" } ``` #### Response-取得集點卡明細 欄位 | 型態 | 說明 --- | --- | --- id | string | 集點卡任務id tenantId | string | 租戶id tenantName | string | 租戶名稱 taskCategory | string | 集點卡任務類型, 參閱 [集點卡任務類型](#集點卡任務類型) title | string | 集點卡任務標題 description | string | 集點卡任務說明 taskStartDate | timestamp | 集點卡任務開始日期 taskEndDate | timestamp | 集點卡任務結束日期 thumbnailObjectKey | string | 縮圖objectKey thumbnailUrl | string | 縮圖url positionMapThumbnailObjectKey | string | 地圖縮圖objectKey positionMapThumbnailUrl | string | 地圖縮圖url issueCardLimit | int | 發卡數量, -1表示不限發卡數 points | int | 每張集點卡的點數, 每張集點卡點數上限為30點 cardsOfAccount | int | 每一帳號最多可集幾張卡 cardsOfDayAccount | int | 每一帳號每日最多可集幾張卡 redeemType | string | 集點卡兌換方式, 參閱 [集點卡兌換方式](#集點卡兌換方式) redeemHealthPoints | int | 集點卡兌換方式為01:線上兌換時, 可兌換的Health365點數 redeemEndDate | timestamp | 兌換截止日 status | string | 集點卡任務狀態, 參閱 [集點卡任務狀態](#集點卡任務狀態) qrcodeType | string | 集點卡掃碼規則, 參閱 [集點卡掃碼規則](#集點卡掃碼規則) isInterval | boolean | 集點卡掃碼規則為01:使用同一個QRCode時, 是否需要間隔 scanIntervalFreq | int | 集點卡掃碼規則為01:使用同一個QRCode時, 所需間隔頻率 scanIntervalUnit | string | 集點卡掃碼規則為01:使用同一個QRCode時, 所需間隔單位, 參閱 [集點卡掃碼間隔單位](#集點卡掃碼間隔單位) attachType | string | 集點卡附件類型, 參閱 [集點卡附件類型](#集點卡附件類型) attachObjectKey | string | attachType為FILE時, 表示storage 中的 objectKey, attachType為URL時, 表示連結的網址 attachUrl | string | attachType為FILE時,可 download 的 url, 時效 3600 秒, attachType為URL時, 表示連結的網址 updateTime | timestamp | 更新日期時間 userLoyaltyCardList | json array | 使用者已集點數卡json array loyaltyCardPointList| json array | 定位集點點位清單 ##### Response-取得集點卡明細-loyaltyCardPointList(json) 欄位 | 型態 | 說明 --- | --- | --- seq | int | 座標點位序號 latitude | string | Y | | 緯度, 範圍-90~90, 取到小數點下五位. e.g.: 35.25422 longitude | string | Y | |經度, 範圍-180~180, 取到小數點下五位. e.g.: -135.25422 checkDistance| string | Y | |該點位達標距離, 單位:公尺 ##### Response-取得集點卡明細-userLoyaltyCard(json) 欄位 | 型態 | 說明 --- | --- | --- id | string | 使用者集點卡id householdMemberId | string | householdMemberId loyaltyCardTaskId | string | 集點卡任務id loyaltyCardSeq | int | 此集點卡任務所領卡數序號(所用使用者) loyaltyCardPoints | int | 集點卡任務的可集點數, 每張集點卡點數上限為30點 userCardSeq | int | 此集點卡任務該使用者已領卡數序號(該使用者) earnPoints | int | 此使用者集點卡已集點數 issueTime | timestamp | 使用者集點卡領取時間 status | string | 使用者集點卡狀態, 請參閱[使用者集點卡狀態](#使用者集點卡狀態) updateTime | timestamp | 最後更新時間 pointList | json array | 此使用者集點卡已集點數json array ##### Response-取得集點卡明細-userLoyaltyCardPoint(json) 欄位 | 型態 | 說明 --- | --- | --- id | string | 使用者集點卡點數id householdMemberId | string | householdMemberId userLoyaltyCardId | string | 使用者集點卡id seq | int | 使用者集點卡點數集點順序 loyaltyCardPointId | string | 集點卡任務點數id loyaltyCardPointSeq | int | 集點卡任務點數位置順序 updateTime | timestamp | 最後更新時間 ```javascript { "httpCode": 200, "result": { "data": { "id": "f9e793e5-be39-4cdd-b1e8-dede763f4ee2", "tenantId": "858b7fbb-3ba0-4d49-9882-c893a1ef07dc", "tenantName": "緯緯醫學", "taskCategory": "01", "title": "高雄前金健走尋寶任務-2-1", "description": "集滿10點即可兌換 Health 365照護平台健康點數100點,可兌換優惠票券!...", "taskStartDate": 1668528000000, "taskEndDate": 1670687999999, "thumbnailObjectKey": "loyalty_card/thumbnail/56ca1cfc-4bcb-4a0a-b079-fd08a0e75a37.png", "issueCardLimit": 20, "points": 10, "cardsOfAccount": 2, "cardsOfDayAccount": 1, "redeemType": "01", "redeemHealthPoints": 100, "redeemEndDate": 1672502399999, "status": "ON", "qrcodeType": "01", "isInterval": true, "scanIntervalFreq": 1, "scanIntervalUnit": "01", "attachType": "FILE", "attachObjectKey": "loyalty_card/56ca1cfc-4bcb-4a0a-b079-fd08a0e75a38.png", "updateTime": 1669282022228, "thumbnailUrl": "http://content-service/swift/v1/loyalty_card/thumbnail/56ca1cfc-4bcb-4a0a-b079-fd08a0e75a37.png", "attachUrl": "http://content-service/swift/v1/loyalty_card/56ca1cfc-4bcb-4a0a-b079-fd08a0e75a38.png", "userLoyaltyCardList": [ { "id": "23c20c52-1d50-4ac7-a096-b8781d2d6083", "householdMemberId": "150b53f5-7126-4900-9fb0-87a08b45e06b", "loyaltyCardTaskId": "f9e793e5-be39-4cdd-b1e8-dede763f4ee2", "loyaltyCardSeq": 1, "loyaltyCardPoints": 10, "userCardSeq": 1, "earnPoints": 2, "issueTime": 1669355582321, "status": "VALID", "updateTime": 1669355582321, "pointList": [ { "id": "0261a3b2-c016-4f9c-aa84-c432408759c5", "householdMemberId": "150b53f5-7126-4900-9fb0-87a08b45e06b", "userLoyaltyCardId": "23c20c52-1d50-4ac7-a096-b8781d2d6083", "seq": 1, "loyaltyCardPointId": "628d9d63-bea3-477f-be5c-1788753e43fa", "loyaltyCardPointSeq": 1, "updateTime": 1669352400000 }, { "id": "2802032c-37f3-4481-bcf8-95e32baf38e6", "householdMemberId": "150b53f5-7126-4900-9fb0-87a08b45e06b", "userLoyaltyCardId": "23c20c52-1d50-4ac7-a096-b8781d2d6083", "seq": 2, "loyaltyCardPointId": "628d9d63-bea3-477f-be5c-1788753e43fa", "loyaltyCardPointSeq": 1, "updateTime": 1669356625000 } ] } ], "loyaltyCardPointList": [ { "seq": 1, "latitude": "-76.1", "longitude": "99.37777", "checkDistance": 15.2, "positionInfoList": [] }, { "seq": 2, "latitude": "-56.1", "longitude": "129.37777", "checkDistance": 50.2, "positionInfoList": [] } ] } } } ``` ### 集點掃碼 ```url POST /loyalty-card/scan ``` * QRCode的內容格式為 health365://loyalty-card/scan?taskId=<loyaltyCardTaskId>&pointId=<LoyaltyCardPointId> - taskId: 集點卡任務id - pointId: 集點卡任務集點點數id #### Request-集點掃碼 欄位 | 型態 | 必填 | 長度限制 | 預設 | 說明 ---|---|---|---|---|--- loyaltyCardTaskId | string | Y | 36 | | 集點卡任務id loyaltyCardPointId | string | Y | 36 | | 集點卡任務集點點數id ```javascript { "loyaltyCardTaskId": "3d39557f-52e5-4936-b9b8-d8f23b5c6ff3", "loyaltyCardPointId": "e4b6238d-224f-49cd-adc1-d1bdde2b57aa" } ``` #### Error-集點掃碼 httpCode | 錯誤碼 | 說明 --- | --- | --- 400 | API_ERROR.NOT_EXIST | 無此筆資料 422 | SERVICE_ERROR.LOYALTY_CARD_SCAN_OUT_OF_ONGOING | 非集點期間不允許集點 422 | SERVICE_ERROR.LOYALTY_CARD_SCAN_POINT_INVALID | 集點點數無效 422 | SERVICE_ERROR.LOYALTY_CARD_SCAN_OVER_ISSUED_LIMIT | 已超過發卡上限 422 | SERVICE_ERROR.LOYALTY_CARD_SCAN_OVER_CARDS_OF_ACCOUNT | 已超出帳號可領卡上限 422 | SERVICE_ERROR.LOYALTY_CARD_SCAN_OVER_CARDS_OF_DAY_ACCOUNT | 已超出帳號每日可領卡上限 422 | SERVICE_ERROR.LOYALTY_CARD_SCAN_INTERVAL_NOT_ALLOWED | 重覆掃碼(未過集點間隔時間) 422 | SERVICE_ERROR.LOYALTY_CARD_SCAN_DUPLICATE_POINT | 重覆掃碼 422 | SERVICE_ERROR.LOYALTY_CARD_SCAN_RACE_CONDITION | 多人同一時間掃碼,請稍候再試 422 | SERVICE_ERROR.LOYALTY_CARD_SCAN_USER_CARD_FAIL | 掃碼時更新使用者卡片失敗 #### Response-集點掃碼 欄位 | 型態 | 說明 --- | --- | --- id | string | 使用者集點卡id householdMemberId | string | householdMemberId loyaltyCardTaskId | string | 集點卡任務id loyaltyCardSeq | int | 此集點卡任務所領卡數序號(所用使用者) loyaltyCardPoints | int | 集點卡任務的可集點數, 每張集點卡點數上限為30點 userCardSeq | int | 此集點卡任務該使用者已領卡數序號(該使用者) earnPoints | int | 此使用者集點卡已集點數 issueTime | timestamp | 使用者集點卡領取時間 status | string | 使用者集點卡狀態, 請參閱[使用者集點卡狀態](#使用者集點卡狀態) updateTime | timestamp | 最後更新時間 ```javascript { "httpCode": 200, "result": { "data": { "id": "97b8f80c-ea8b-49e1-b12f-6b8cfd967a6e", "householdMemberId": "150b53f5-7126-4900-9fb0-87a08b45e06b", "loyaltyCardTaskId": "3d39557f-52e5-4936-b9b8-d8f23b5c6ff3", "loyaltyCardSeq": 1, "loyaltyCardPoints": 5, "userCardSeq": 1, "earnPoints": 1, "issueTime": 1669659595589, "status": "VALID", "createTime": 1669659595558, "updateTime": 1669659595558 } } } ``` ### 兌換集點卡 ```url POST /loyalty-card/redeem ``` #### Request-兌換集點卡 欄位 | 型態 | 必填 | 長度限制 | 預設 | 說明 ---|---|---|---|---|--- userLoyaltyCardId | string | Y | 36 | | 使用者集點卡id ```javascript { "userLoyaltyCardId": "97b8f80c-ea8b-49e1-b12f-6b8cfd967a6e" } ``` #### Error-兌換集點卡 httpCode | 錯誤碼 | 說明 --- | --- | --- 400 | API_ERROR.NOT_EXIST | 無此筆資料 422 | SERVICE_ERROR.LOYALTY_CARD_REDEEM_HAD_REDEEMED | 集點卡已兌換過 422 | SERVICE_ERROR.LOYALTY_CARD_REDEEM_POINTS_NOT_ENOUGH | 點數不足夠兌換 422 | SERVICE_ERROR.LOYALTY_CARD_REDEEM_OVER_REDEEM_DATE | 已過兌換期限 #### Response-兌換集點卡 欄位 | 型態 | 說明 --- | --- | --- id | string | 使用者集點卡id householdMemberId | string | householdMemberId loyaltyCardTaskId | string | 集點卡任務id loyaltyCardSeq | int | 此集點卡任務所領卡數序號(所用使用者) loyaltyCardPoints | int | 集點卡任務的可集點數, 每張集點卡點數上限為30點 userCardSeq | int | 此集點卡任務該使用者已領卡數序號(該使用者) earnPoints | int | 此使用者集點卡已集點數 issueTime | timestamp | 使用者集點卡領取時間 status | string | 使用者集點卡狀態, 請參閱[使用者集點卡狀態](#使用者集點卡狀態) updateTime | timestamp | 最後更新時間 ```javascript { "httpCode": 200, "result": { "data": { "id": "97b8f80c-ea8b-49e1-b12f-6b8cfd967a6e", "householdMemberId": "150b53f5-7126-4900-9fb0-87a08b45e06b", "loyaltyCardTaskId": "3d39557f-52e5-4936-b9b8-d8f23b5c6ff3", "loyaltyCardSeq": 1, "loyaltyCardPoints": 5, "userCardSeq": 1, "earnPoints": 1, "issueTime": 1669659595589, "status": "REDEEMED", "createTime": 1669659595558, "updateTime": 1669659595558 } } } ```