---
# System prepended metadata

title: 活動

---

# 活動

---
API 清單
- 活動管理[WEB]
  - [取得上傳網址](#取得上傳網址)
  - [活動管理列表](#活動管理列表)
  - [取得活動管理明細](#取得活動管理明細)
  - [取得活動參與人員列表](#取得活動參與人員列表)
  - [取得活動取消報名名單](#取得活動取消報名名單)
  - [新增活動](#新增活動)
  - [編輯活動](#編輯活動)
  - [編輯活動狀態](#編輯活動狀態)
  - [編輯活動是否顯示](#編輯活動是否顯示)
  - [刪除活動](#刪除活動)
  - [列印活動QRCode](#列印活動QRCode)
  - [可綁定點數任務列表](#可綁定點數任務列表)
  - [活動推播通知](#活動推播通知)
  - [活動統計](#活動統計)
- 活動[APP]
  - [活動摘要](#活動摘要)
  - [取得活動列表](#取得活動列表)
  - [取得活動明細](#取得活動明細)
  - [活動報名](#活動報名)
  - [活動報名取消](#活動報名取消)
  - [活動簽到簽退](#活動簽到簽退)
  - [活動觸及(曝光)](#活動觸及曝光)
  - [活動點擊](#活動點擊)
  
---


## 取得上傳網址

```url
POST /event-mgmt/get-upload-url
```

*  新增/編輯活動時用來上傳縮圖, 活動圖/影片, 活動檔案(PDF)

#### 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 資訊 

* part(Object)

 欄位 | 型態  | 必填 | 預設 | 說明 
 ---|---|---|---|---
 chunkSize | int | Y | | 該 chunk 的大小, bytes
 md5 | string | Y | | 該 part 的 md5
 part | int | Y | | part number, 第幾塊 chunk


```javascript
// 單檔
{
    "isMultipart": false,
    "isThumbnail": false,
    "fileName": "ad_bg_jp",
    "fileType": "png"
}
// 分塊上傳
{
    "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
* data
 
 欄位 | 型態 | 說明 
 ---  | --- | ---
 objectKey | string | storage 中的 objectKey, **unique** 
 uploadId | string | 識別該次上傳的 uploadId 
 fileName | string | 名稱 
 fileType | string | 副檔名 
 url | string | 單檔上傳的時候，才會回傳該 url, 時效 3600 秒
 parts | [...part] | multipart上傳各part的url

* part(Object)
 
 欄位 | 型態 | 說明 
 ---  | --- | ---
 chunkSize | int | 該 chunk 的大小, bytes
 md5 | string | 該 part 的 md5
 part | int | part number, 第幾塊 chunk
 url | string | 可上傳的 url, 時效 3600 秒

```javascript
// HttpStatus:422, 上傳的檔案類型不允許
{
    "errorMsg": "SERVICE_ERROR.EVENT_MGMT_UPLOAD_FILE_TYPE_NOT_ALLOWED",
    "httpCode": 422
}

// HttpStatus: 200
// 單檔
{
    "httpCode": 200,
    "result": {
        "data": {
            "objectKey": "event/9f9de11b-12b9-4964-bae8-3233e9da065b.png",
            "uploadId": "11becd09-7571-4b0d-b8ee-cb3f09f66cf0",
            "fileName": "ad_bg_jp",
            "fileType": "png",
	        // 單檔 才有 url
            "url": "http://192.168.100.239:12345/v1/AUTH_test/kmuh/event%2F9f9de11b-12b9-4964-bae8-3233e9da065b.png?temp_url_sig=e61d9e721d860294bde4d0151e111ebf8ed57ed7&temp_url_expires=1554114780"
        }
    }
}
// 分塊上傳
{
    "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 /event-mgmt/list
```

#### Request
* query(查詢條件json)
 
 欄位 | 型態  | 必填 | 預設 | 說明  
 ---|---|---|---|---
 eventTimeStart | string | | | 活動時間查詢起日, 格式為YYYY-MM-DD
 eventTimeEnd | string | | | 活動時間查詢迄日, 格式為YYYY-MM-DD
 status | string | | | 活動狀態, NONE:未上架, ON:未開始, GOING:進行中, FINISH:已結束, OFF: 已下架
 name | string | | | 關鍵字, 查詢活動標題 
 isShow | boolean | |  | 顯示控制, 未填表示全部, true:顯示, false: 隱藏
 
* pagination(分頁json)
 
 欄位 | 型態  | 必填 | 預設 | 說明
 ---|---|---|---|---
 current | int | | 1 | 當前頁數 
 pageSize | int | | 10 | 每頁結果數量，-1 為顯示所有
 
* sorter(排序json), 預設是用更新時間降序排列
 
 欄位 | 型態  | 必填 | 預設 | 說明
 ---|---|---|---|--- 
 field | string | | updateTime | 排序欄位,可排序欄位有updateTime, eventStartTime, eventEndTime, launchOnDate, status 
 order | string | | desc | 升序或降序 

```javascript
{
    "query": {
        "eventTimeStart": null,
        "eventTimeEnd": null,
        "status": null,
        "name": null
    } ,
    "pagination": {
        "current": 1,
        "pageSize": 10
    }, 
    "sorter": {
        "field": "updateTime",
        "order": "desc"
    }
}
```

#### Response
 欄位 | 型態 | 說明 
 ---  | --- | ---
 id | string | 活動id 
 tenantId | string | 租戶id
 title | string | 活動標題
 content | string | 活動內容
 isSingleDay | boolean | 是否為單日活動, true: 單日活動, false: 活動期間
 eventStartTime | timestamp | 活動開始日期時間
 eventEndTime | timestamp | 活動結束日期時間
 thumbnailObjectKey | string | storage中的縮圖objectKey
 attachType | string | 附件類型, NONE:無, URL:連結, FILE:檔案
 attachObjectKey | string | attachType為FILE時, 表示storage 中的 objectKey, attachType為URL時, 表示連結的網址
 attendeeLimit | int | 活動報名人數限制, -1:表示無限制
 isRegister | boolean | 活動是否需要報名, true:需要報名, false:不需報名
 regStartDate | date | 活動報名開始日期
 regEndDate | date | 活動報名結束日期
 isSign | boolean | 活動是否需要簽到簽退, true:需要簽到簽退, false:不需簽到簽退
 launchStatus | string | 活動發佈狀態, NONE:未上架, ON:上架, OFF:下架
 launchOnDate | date | 活動上架日期
 launchOffDate | date | 活動下架日期
 status | string | 活動狀態, NONE:未上架, ON:未開始, GOING:進行中, FINISH:已結束, OFF: 已下架
 thumbnailUrl | string | 可 download 的 縮圖url, 時效 3600 秒
 attachUrl | string | attachType為FILE時,可 download 的 url, 時效 3600 秒, attachType為URL時, 表示連結的網址
 registerCount | int | 報名人數
 signInCount | int | 簽到人數
 cancelCount | int | 取消報名人數
 cancelTimes | int | 取消報名人次
 notificationTitle | string | 活動推播標題
 isShow | boolean | 顯示控制, true:顯示, false: 隱藏
 

```javascript
{
    "httpCode": 200,
    "result": {
        "data": [
            {
                "id": "ef353072-c154-4475-b988-472e89f87a6d",
                "tenantId": "WMT",
                "title": "活動11",
                "content": "Disney+ 上線囉, 還不快訂起來~~",
                "isSingleDay": false,
                "eventStartTime": 1638288000000,
                "eventEndTime": 1639065600000,
                "thumbnailObjectKey": "event/thumbnail/98386d85-592e-4e7d-80f3-0e22a389ff65.png",
                "attachType": "URL",
                "attachObjectKey": "https://www.google.com",
                "attendeeLimit": -1,
                "isRegister": true,
                "regStartDate": 1637164800000,
                "regEndDate": 1639065600000,
                "isSign": true,
                "launchStatus": "ON",
                "launchOnDate": 1637164800000,
                "status": "ON",
                "createTime": 1637164800000,
                "updateTime": 1637164800000,
                "attachUrl": null,
                "thumbnailUrl": "http://10.31.49.126/swift/v1/AUTH_test/kmuh/event/thumbnail/98386d85-592e-4e7d-80f3-0e22a389ff65.png",
                "registerCount": 50,
                "signInCount": 40,
                "cancelCount": 2,
                "cancelTimes": 5,
                "notificationTitle":null,
                "isShow": true
            }
        ],
        "pagination": {
            "current": 1,
            "pageSize": 10,
            "total": 1
        },
        "sorter": {
            "field": "updateTime",
            "order": "desc"
        },
        "total": 1
    }
}
```


## 取得活動管理明細

```url
POST /event-mgmt/info
```

#### Request
 
 欄位 | 型態  | 必填 | 預設 | 說明  
 ---|---|---|---|---
 id | string | Y | | 活動id 
 
```javascript
{
    "id": "df2e6892-9ee2-4aab-9990-c5a62d618be2"
}
```

#### Response
 欄位 | 型態 | 說明 
 ---  | --- | ---
 id | string | 活動id 
 tenantId | string | 租戶id
 title | string | 活動標題
 content | string | 活動內容
 isSingleDay | boolean | 是否為單日活動, true: 單日活動, false: 活動期間
 eventStartTime | timestamp | 活動開始日期時間
 eventEndTime | timestamp | 活動結束日期時間
 thumbnailObjectKey | string | storage中的縮圖objectKey
 attachType | string | 附件類型, NONE:無, URL:連結, FILE:檔案
 attachObjectKey | string | attachType為FILE時, 表示storage 中的 objectKey, attachType為URL時, 表示連結的網址
 attendeeLimit | int | 活動報名人數限制, -1:表示無限制
 isRegister | boolean | 活動是否需要報名, true:需要報名, false:不需報名
 regStartDate | date | 活動報名開始日期
 regEndDate | date | 活動報名結束日期
 isSign | boolean | 活動是否需要簽到簽退, true:需要簽到簽退, false:不需簽到簽退
 launchStatus | string | 活動發佈狀態, NONE:未上架, ON:上架, OFF:下架
 launchOnDate | date | 活動上架日期
 launchOffDate | date | 活動下架日期
 status | string | 活動狀態, NONE:未上架, ON:未開始, GOING:進行中, FINISH:已結束, OFF: 已下架
 thumbnailUrl | string | 可 download 的 縮圖url, 時效 3600 秒
 attachUrl | string | attachType為FILE時,可 download 的 url, 時效 3600 秒, attachType為URL時, 表示連結的網址
 rewardTaskId | string | 綁定點數任務id
 rewardTaskName | string | 綁定點數任務名稱
 rewardPoints | int | 綁定點數任務發放點數
 notificationTitle | string | 活動推播標題
 isShow | boolean | 顯示控制, true:顯示, false: 隱藏
 historyList | json array | 狀態歷史記錄
 givePointsTiming | string | 活動贈點時機, 01:一般, 02:簽到/退, 03:註冊

##### Response-historyList(json)
 欄位 | 型態 | 說明 
 ---  | --- | ---
 eventId | string | 活動id
 launchStatus | string | 活動發佈狀態, NONE:未上架, ON:上架, OFF:下架
 status | string | 活動狀態, NONE:未上架, ON:未開始, GOING:進行中, FINISH:已結束, OFF: 已下架
 dateTime | timestamp | 異動時間
 

```javascript
// HttpStatus:400, 資料不存在
{
    "errorMsg": "API_ERROR.NOT_EXIST",
    "httpCode": 400
}

// HttpStatus:200
{
    "httpCode": 200,
    "result": {
        "data": {
            "id": "ef353072-c154-4475-b988-472e89f87a6d",
            "tenantId": "WMT",
            "title": "活動11",
            "content": "Disney+ 上線囉, 還不快訂起來~~",
            "isSingleDay": false,
            "eventStartTime": 1638288000000,
            "eventEndTime": 1639065600000,
            "thumbnailObjectKey": "event/thumbnail/98386d85-592e-4e7d-80f3-0e22a389ff65.png",
            "attachType": "URL",
            "attachObjectKey": "https://www.google.com",
            "attendeeLimit": -1,
            "isRegister": true,
            "regStartDate": 1637164800000,
            "regEndDate": 1639065600000,
            "isSign": true,
            "launchStatus": "ON",
            "launchOnDate": 1637164800000,
            "status": "ON",
            "createTime": 1637164800000,
            "updateTime": 1637164800000,
            "attachUrl": "https://www.google.com",
            "thumbnailUrl": "http://10.31.49.126/swift/v1/AUTH_test/kmuh/event/thumbnail/98386d85-592e-4e7d-80f3-0e22a389ff65.png",
            "rewardTaskId": "b3099f19-d155-4a08-a672-3e48c485e648",
            "rewardTaskName": "活動簽到贈點100點",
            "rewardPoints": 100,
            "notificationTitle":null,
            "isShow": true,
            "historyList": [
                {
                    "eventId": "ef353072-c154-4475-b988-472e89f87a6d",
                    "dateTime": 1679973590072,
                    "launchStatus": "ON",
                    "status": "GOING"
                },
                {
                    "eventId": "ef353072-c154-4475-b988-472e89f87a6d",
                    "dateTime": 1679968965118,
                    "launchStatus": "OFF",
                    "status": "OFF"
                }
            ],
            "givePointsTiming": "01"
        }
    }
}
```


## 取得活動參與人員列表

```url
POST /event-mgmt/info-attendees
```

#### Request
* query(查詢條件json)
 
 欄位 | 型態  | 必填 | 預設 | 說明  
 ---|---|---|---|---
 id | string | Y | | 活動id 
 
* pagination(分頁json)
 
 欄位 | 型態  | 必填 | 預設 | 說明
 ---|---|---|---|---
 current | int | | 1 | 當前頁數 
 pageSize | int | | 10 | 每頁結果數量，-1 為顯示所有
 
* sorter(排序json), 預設是用更新時間降序排列
 
 欄位 | 型態  | 必填 | 預設 | 說明
 ---|---|---|---|--- 
 field | string | | registerTime | 排序欄位,可排序欄位有 registerTime, signInTime, signOutTime, name 
 order | string | | asc | 升序或降序 

```javascript
{
    "query": {
        "id": "ef353072-c154-4475-b988-472e89f87a6d"
    } ,
    "pagination": {
        "current": 1,
        "pageSize": 10
    }, 
    "sorter": {
        "field": "registerTime",
        "order": "desc"
    }
}
```

#### Response
 欄位 | 型態 | 說明 
 ---  | --- | ---
 id | string | 活動參與人員記錄id 
 householdMemberId | string | 參與人員householdMemberId
 name | string | 參與人員姓名
 gender | int | 參與人員性別, 1:男, 2:女
 mobile | string | 參與人員手機號碼
 registerTime | timestamp | 活動報名時間
 signInTime | timestamp | 活動簽到時間
 signOutTime | timestamp | 活動簽退時間
 

```javascript
{
    "httpCode": 200,
    "result": {
        "data": [
            {
                "id": "b3aaf4eb-7902-443f-8b7e-fbe48e8e8146",
                "householdMemberId": "8a9e980a-c612-4f87-af07-a97a5f0fbed5",
                "name": "蘇凱文",
                "gender": 1,
                "mobile": "0925309365",
                "registerTime": 1637251200000,
                "signInTime": null,
                "signOutTime": null
            }
        ],
        "pagination": {
            "current": 1,
            "pageSize": 10,
            "total": 1
        },
        "sorter": {
            "field": "registerTime",
            "order": "desc"
        },
        "total": 1
    }
}
```


## 取得活動取消報名名單

```url
POST /event-mgmt/info-attendees-cancelled
```

#### Request
* query(查詢條件json)
 
 欄位 | 型態  | 必填 | 預設 | 說明  
 ---|---|---|---|---
 id | string | Y | | 活動id 
 
* pagination(分頁json)
 
 欄位 | 型態  | 必填 | 預設 | 說明
 ---|---|---|---|---
 current | int | | 1 | 當前頁數 
 pageSize | int | | 10 | 每頁結果數量，-1 為顯示所有
 
* sorter(排序json), 預設是用更新時間降序排列
 
 欄位 | 型態  | 必填 | 預設 | 說明
 ---|---|---|---|--- 
 field | string | | cancelTime | 排序欄位,可排序欄位有 cancelTime, name 
 order | string | | asc | 升序或降序 

```javascript
{
    "query": {
        "id": "0326c19a-51e8-4db0-9d32-a1260437b7a7"
    } ,
    "pagination": {
        "current": 1,
        "pageSize": 10
    }, 
    "sorter": {
        "field": "cancelTime",
        "order": "asc"
    }
}
```

#### Response
 欄位 | 型態 | 說明 
 ---  | --- | ---
 cancelCount | int | 取消報名人數
 cancelTime | int | 取消報名人次
 cancelList | json array | 取消報名人員json array
 
 * cancelList (json)
 
 欄位 | 型態 | 說明 
  ---  | --- | ---
 id | string | 記錄id 
 householdMemberId | string | householdMemberId
 name | string | 姓名
 gender | int | 性別, 1:男, 2:女
 mobile | string | 手機號碼
 cancelTime | timestamp | 取消報名時間
 

```javascript
{
    "httpCode": 200,
    "result": {
        "data": {
            "cancelCount": 2,
            "cancelTimes": 5,
            "cancelList": [
                {
                    "id": "8e3daa6a-1129-4deb-be80-78c436b78df9",
                    "householdMemberId": "8a9e980a-c612-4f87-af07-a97a5f0fbed5",
                    "name": "蘇凱文",
                    "gender": 1,
                    "mobile": "0925309365",
                    "cancelTime": 1637313123699
                },
                {
                    "id": "f8750ceb-490d-4ef7-b1e3-1b113861b5d4",
                    "householdMemberId": "8a9e980a-c612-4f87-af07-a97a5f0fbed5",
                    "name": "蘇凱文",
                    "gender": 1,
                    "mobile": "0925309365",
                    "cancelTime": 1637550509189
                },
                {
                    "id": "b1f555e0-e31a-409f-8291-2dc437c2ba9e",
                    "householdMemberId": "fdba6e30-ffda-47e4-b378-be7f9de7ba15",
                    "name": "啊啊啊",
                    "gender": 1,
                    "mobile": "0903100003",
                    "cancelTime": 1637568287708
                },
                {
                    "id": "eb4a6b76-87e1-4fe6-92ba-e660d70d160e",
                    "householdMemberId": "fdba6e30-ffda-47e4-b378-be7f9de7ba15",
                    "name": "啊啊啊",
                    "gender": 1,
                    "mobile": "0903100003",
                    "cancelTime": 1637568364524
                },
                {
                    "id": "cf37d936-52ef-4f9e-9d4b-b55aae9f4af3",
                    "householdMemberId": "fdba6e30-ffda-47e4-b378-be7f9de7ba15",
                    "name": "啊啊啊",
                    "gender": 1,
                    "mobile": "0903100003",
                    "cancelTime": 1637826882274
                }
            ]
        },
        "pagination": {
            "current": 1,
            "pageSize": 10,
            "total": 5
        },
        "sorter": {
            "field": "cancelTime",
            "order": "asc"
        },
        "total": 5
    }
}
```


## 新增活動

```url
POST /event-mgmt/add
```

* 目前開放活動可以綁定點數任務, 限該租戶下的點數任務
* 點數任務有2種類型, 依taskType區分, "EVENT_SIGN_IN"為簽到/退任務, "EVENT_REGISTER"為註冊任務
* 目前綁定點數任務時且活動贈點時機為02 簽到/退時, 需啟用簽到/簽退
* 有綁定簽到/退點數任務時, App User簽到時只會給予一次點數
* 活動贈點時機為01 註冊時, 該活動不會顯示在AppUser端
* 使用者掃碼新增為企業客戶會員時, 會檢查該企客是否有註冊贈點的活動任務可以贈點

#### Request
 欄位 | 型態  | 必填 | 預設 | 說明  
 ---|---|---|---|---
 title | string | Y | | 活動標題, 限制最多30字
 content | string | Y | | 活動內容, 限制最多500字
 isSingleDay | boolean | Y | | 是否為單日活動, true: 單日活動, false:活動期間
 eventStartTime | timestamp | Y | | 活動開始日期時間
 eventEndTime | timestamp | Y | | 活動結束日期時間
 thumbnailObjectKey | string | Y | | 縮圖objectKey, 先取得縮圖上傳網址並上傳成功，取其 objectKey。
 attachType | string | Y | | 附件類型, NONE:無, URL:連結, FILE:檔案
 attachObjectKey | string | **Y**(attachType= URL/FILE) | | 若attachType為FILE, 先取得上傳網址並上傳成功，取其 objectKey。若attachType為URL則直接存放URL網址 
 attendeeLimit | int | Y | | 報名人數限制, -1 表示無限制
 isRegister | boolean | Y | | 是否需要報名, true: 需要報名, false:不需報名
 regStartDate | timestamp | **Y**(isRegister=true) | | 報名開始時間
 regEndDate | timestamp | **Y**(isRegister=true) | | 報名結束時間
 isSign | boolean | Y | | 是否需要簽到簽退, true: 需要簽到簽退, false:不需簽到簽退
 launchStatus | string | Y | | 活動發佈狀態, NONE:未上架, ON:上架, OFF:下架
 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) | | 從 /event-mgmt/get-upload-url 取得的 uploadId 
 isThumbnailMultipart | boolean | N | | 縮圖上傳時是否分塊上傳，預設為 false
 thumbnailTotalPart | int | **N** (isThumbnailMultipart=false)<br>**Y** (isThumbnailMultipart=true) | | 縮圖上傳的總分塊數量，不可小於2
 thumbnailUploadId | string | **N** (isThumbnailMultipart=false)<br>**Y** (isThumbnailMultipart=true) | | 從 /event-mgmt/get-upload-url 取得的 uploadId
 rewardTaskId | string | N | | 綁定點數任務id
 notificationTitle | string | N | | 活動推播標題
 givePointsTiming | string | Y | | 活動贈點時機, 01:一般, 02:簽到/退, 03:註冊
 

```javascript
{
    "title": "活動11",
    "content": "Disney+ 上線囉, 還不快訂起來~~",
    "isSingleDay": false,
    "eventStartTime": 1638316800000,
    "eventEndTime": 1639094400000,
    "thumbnailObjectKey": "event/thumbnail/98386d85-592e-4e7d-80f3-0e22a389ff65.png",
    "attachType": "URL",
    "attachObjectKey": "https://www.google.com",
    "attendeeLimit": -1,
    "isRegister": true,
    "regStartDate": 1637193600000,
    "regEndDate": 1639094400000,
    "isSign": true,
    "rewardTaskId": "b3099f19-d155-4a08-a672-3e48c485e648",
    "launchStatus": "NONE",
    "isThumbnailMultipart": false,
    "thumbnailTotalPart": null,
    "thumbnailUploadId": null,
    "isAttachMultipart": false,
    "attachTotalPart": null,
    "attachUploadId": null,
    "notificationTitle":"現在訂閱享限時優惠!",
    "givePointsTiming": "01"
}
```

#### Response
 欄位 | 型態 | 說明 
 ---  | --- | ---
  id | string | 活動id 
  tenantId | string | 租戶id
  title | string | 活動標題
  content | string | 活動內容
  isSingleDay | boolean | 是否為單日活動, true: 單日活動, false: 活動期間
  eventStartTime | timestamp | 活動開始日期時間
  eventEndTime | timestamp | 活動結束日期時間
  thumbnailObjectKey | string | storage中的縮圖objectKey
  attachType | string | 附件類型, NONE:無, URL:連結, FILE:檔案
  attachObjectKey | string | attachType為FILE時, 表示storage 中的 objectKey, attachType為URL時, 表示連結的網址
  attendeeLimit | int | 活動報名人數限制, -1:表示無限制
  isRegister | boolean | 活動是否需要報名, true:需要報名, false:不需報名
  regStartDate | date | 活動報名開始日期
  regEndDate | date | 活動報名結束日期
  isSign | boolean | 活動是否需要簽到簽退, true:需要簽到簽退, false:不需簽到簽退
  launchStatus | string | 活動發佈狀態, NONE:未上架, ON:上架, OFF:下架
  launchOnDate | date | 活動上架日期
  launchOffDate | date | 活動下架日期
  status | string | 活動狀態, NONE:未上架, ON:未開始, GOING:進行中, FINISH:已結束, OFF: 已下架
  createTime | timestamp | 建立時間
  updateTime | timestamp | 最後更新時間
  rewardTaskId | string | 綁定點數任務id
  notificationTitle | string | 活動推播標題
  isShow | boolean | 顯示控制, true:顯示, false: 隱藏
  givePointsTiming | string | 活動贈點時機, 01:一般, 02:簽到/退, 03:註冊

```javascript
// HttpStatus:422, 活動任務不存在
{
    "errorMsg": "SERVICE_ERROR.EVENT_REWARD_TASK_NOT_EXIST",
    "httpCode": 422
}

// HttpStatus:422, 活動任務必須使用簽到
{
    "errorMsg": "SERVICE_ERROR.EVENT_REWARD_TASK_MUST_SIGN_IN",
    "httpCode": 422
}

// HttpStatus:422, 活動任務未啟用
{
    "errorMsg": "SERVICE_ERROR.EVENT_REWARD_TASK_NOT_ENABLED",
    "httpCode": 422
}

// HttpStatus:422, 活動任務非簽到/退任務
{
    "errorMsg": "SERVICE_ERROR.EVENT_REWARD_TASK_NOT_EVENT_SIGN_IN_TASK",
    "httpCode": 422
}

// HttpStatus:422, 活動任務非註冊任務
{
    "errorMsg": "SERVICE_ERROR.EVENT_REWARD_TASK_NOT_EVENT_REGISTER_TASK",
    "httpCode": 422
}

// HttpStatus:200
{
    "httpCode": 200,
    "result": {
        "data": {
            "id": "0f2d9610-ff5c-4601-82fa-5fa235266a21",
            "tenantId": "bf47bd9c-4364-4086-946d-9fd191d93dda",
            "title": "活動11",
            "content": "Disney+ 上線囉, 還不快訂起來~~",
            "isSingleDay": false,
            "eventStartTime": 1638288000000,
            "eventEndTime": 1639065600000,
            "thumbnailObjectKey": "event/thumbnail/98386d85-592e-4e7d-80f3-0e22a389ff65.png",
            "attachType": "URL",
            "attachObjectKey": "https://www.google.com",
            "attendeeLimit": -1,
            "isRegister": true,
            "regStartDate": 1637164800000,
            "regEndDate": 1639065600000,
            "isSign": true,
            "launchStatus": "NONE",
            "status": "NONE",
            "createTime": 1637269086387,
            "updateTime": 1637269086387,
            "creator": "04398e47-e702-4290-a1c1-c4931404840e",
            "rewardTaskId": "b3099f19-d155-4a08-a672-3e48c485e648",
            "notificationTitle":"現在訂閱享限時優惠!",
            "isShow": true,
            "givePointsTiming": "01"
        }
    }
}
```

## 編輯活動

```url
POST /event-mgmt/update
```

* 目前開放活動可以綁定點數任務, 限該租戶下的點數任務
* 點數任務有2種類型, 依taskType區分, "EVENT_SIGN_IN"為簽到/退任務, "EVENT_REGISTER"為註冊任務
* 目前綁定點數任務時且活動贈點時機為02 簽到/退時, 需啟用簽到/簽退
* 有綁定簽到/退點數任務時, App User簽到時只會給予一次點數
* 活動贈點時機為01 註冊時, 該活動不會顯示在AppUser端
* 使用者掃碼新增為企業客戶會員時, 會檢查該企客是否有註冊贈點的活動任務可以贈點

#### Request
 欄位 | 型態  | 必填 | 預設 | 說明  
 ---|---|---|---|---
 id | string | Y | | 活動id
 title | string | Y | | 活動標題, 限制最多30字
 content | string | Y | | 活動內容, 限制最多500字
 isSingleDay | boolean | Y | | 是否為單日活動, true: 單日活動, false:活動期間
 eventStartTime | timestamp | Y | | 活動開始日期時間
 eventEndTime | timestamp | Y | | 活動結束日期時間
 thumbnailObjectKey | string | Y | | 縮圖objectKey, 先取得縮圖上傳網址並上傳成功，取其 objectKey。
 attachType | string | Y | | 附件類型, NONE:無, URL:連結, FILE:檔案
 attachObjectKey | string | **Y**(attachType= URL/FILE) | | 若attachType為FILE, 先取得上傳網址並上傳成功，取其 objectKey。若attachType為URL則直接存放URL網址 
 attendeeLimit | int | Y | | 報名人數限制, -1 表示無限制
 isRegister | boolean | Y | | 是否需要報名, true: 需要報名, false:不需報名
 regStartDate | timestamp | **Y**(isRegister=true) | | 報名開始時間
 regEndDate | timestamp | **Y**(isRegister=true) | | 報名結束時間
 isSign | boolean | Y | | 是否需要簽到簽退, true: 需要簽到簽退, false:不需簽到簽退
 launchStatus | string | Y | | 活動發佈狀態, NONE:未上架, ON:上架, OFF:下架
 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) | | 從 /event-mgmt/get-upload-url 取得的 uploadId 
 isThumbnailMultipart | boolean | N | | 縮圖上傳時是否分塊上傳，預設為 false
 thumbnailTotalPart | int | **N** (isThumbnailMultipart=false)<br>**Y** (isThumbnailMultipart=true) | | 縮圖上傳的總分塊數量，不可小於2
 thumbnailUploadId | string | **N** (isThumbnailMultipart=false)<br>**Y** (isThumbnailMultipart=true) | | 從 /event-mgmt/get-upload-url 取得的 uploadId
 rewardTaskId | string | N | | 綁定點數任務id
 notificationTitle | string | N | | 活動推播標題
 givePointsTiming | string | Y | | 活動贈點時機, 01:一般, 02:簽到/退, 03:註冊

```javascript
{
    "id": "ef353072-c154-4475-b988-472e89f87a6d",
    "title": "活動11",
    "content": "Disney+ 上線囉, 還不快訂起來~~",
    "isSingleDay": false,
    "eventStartTime": 1638316800000,
    "eventEndTime": 1639094400000,
    "thumbnailObjectKey": "event/thumbnail/98386d85-592e-4e7d-80f3-0e22a389ff65.png",
    "attachType": "URL",
    "attachObjectKey": "https://www.google.com",
    "attendeeLimit": -1,
    "isRegister": true,
    "regStartDate": 1637193600000,
    "regEndDate": 1639094400000,
    "isSign": true,
    "rewardTaskId": "b3099f19-d155-4a08-a672-3e48c485e648",
    "launchStatus": "NONE",
    "isCoverMultipart": false,
    "coverTotalPart": null,
    "coverUploadId": null,
    "isAttachMultipart": false,
    "attachTotalPart": null,
    "attachUploadId": null,
    "notificationTitle":"現在訂閱享限時優惠!",
    "givePointsTiming": "01"
}
```

#### Response
 欄位 | 型態 | 說明 
 ---  | --- | ---
  id | string | 活動id 
  tenantId | string | 租戶id
  title | string | 活動標題
  content | string | 活動內容
  isSingleDay | boolean | 是否為單日活動, true: 單日活動, false: 活動期間
  eventStartTime | timestamp | 活動開始日期時間
  eventEndTime | timestamp | 活動結束日期時間
  thumbnailObjectKey | string | storage中的縮圖objectKey
  attachType | string | 附件類型, NONE:無, URL:連結, FILE:檔案
  attachObjectKey | string | attachType為FILE時, 表示storage 中的 objectKey, attachType為URL時, 表示連結的網址
  attendeeLimit | int | 活動報名人數限制, -1:表示無限制
  isRegister | boolean | 活動是否需要報名, true:需要報名, false:不需報名
  regStartDate | date | 活動報名開始日期
  regEndDate | date | 活動報名結束日期
  isSign | boolean | 活動是否需要簽到簽退, true:需要簽到簽退, false:不需簽到簽退
  launchStatus | string | 活動發佈狀態, NONE:未上架, ON:上架, OFF:下架
  launchOnDate | date | 活動上架日期
  launchOffDate | date | 活動下架日期
  status | string | 活動狀態, NONE:未上架, ON:未開始, GOING:進行中, FINISH:已結束, OFF: 已下架
  createTime | timestamp | 建立時間
  updateTime | timestamp | 最後更新時間
  rewardTaskId | string | 綁定點數任務id
  notificationTitle | string | 活動推播標題
  isShow | boolean | 顯示控制, true:顯示, false: 隱藏
  givePointsTiming | string | 活動贈點時機, 01:一般, 02:簽到/退, 03:註冊

```javascript
// HttpStatus:400, 資料不存在
{
    "errorMsg": "API_ERROR.NOT_EXIST",
    "httpCode": 400
}

// HttpStatus:422, 不允許編輯已結束或已下架活動
{
    "errorMsg": "SERVICE_ERROR.EVENT_MGMT_UPDATE_FINISH_OFF_EVENT_NOT_ALLOWED",
    "httpCode": 422
}

// HttpStatus:422, 活動任務不存在
{
    "errorMsg": "SERVICE_ERROR.EVENT_REWARD_TASK_NOT_EXIST",
    "httpCode": 422
}

// HttpStatus:422, 活動任務必須使用簽到
{
    "errorMsg": "SERVICE_ERROR.EVENT_REWARD_TASK_MUST_SIGN_IN",
    "httpCode": 422
}

// HttpStatus:422, 活動任務未啟用
{
    "errorMsg": "SERVICE_ERROR.EVENT_REWARD_TASK_NOT_ENABLED",
    "httpCode": 422
}

// HttpStatus:422, 活動任務非簽到/退任務
{
    "errorMsg": "SERVICE_ERROR.EVENT_REWARD_TASK_NOT_EVENT_SIGN_IN_TASK",
    "httpCode": 422
}

// HttpStatus:422, 活動任務非註冊任務
{
    "errorMsg": "SERVICE_ERROR.EVENT_REWARD_TASK_NOT_EVENT_REGISTER_TASK",
    "httpCode": 422
}

// HttpStatus:200
{
    "httpCode": 200,
    "result": {
        "data": {
            "id": "0f2d9610-ff5c-4601-82fa-5fa235266a21",
            "tenantId": "bf47bd9c-4364-4086-946d-9fd191d93dda",
            "title": "活動11",
            "content": "Disney+ 上線囉, 還不快訂起來~~",
            "isSingleDay": false,
            "eventStartTime": 1638288000000,
            "eventEndTime": 1639065600000,
            "thumbnailObjectKey": "event/thumbnail/98386d85-592e-4e7d-80f3-0e22a389ff65.png",
            "attachType": "URL",
            "attachObjectKey": "https://www.google.com",
            "attendeeLimit": -1,
            "isRegister": true,
            "regStartDate": 1637164800000,
            "regEndDate": 1639065600000,
            "isSign": true,
            "launchStatus": "NONE",
            "status": "NONE",
            "createTime": 1637269086387,
            "updateTime": 1637269086387,
            "creator": "04398e47-e702-4290-a1c1-c4931404840e",
            "rewardTaskId": "b3099f19-d155-4a08-a672-3e48c485e648",
            "notificationTitle":"現在訂閱享限時優惠!",
            "isShow": true,
            "givePointsTiming": "01"
        }
    }
}
```


## 編輯活動狀態

```url
POST /event-mgmt/update-status
```

* 只允許未上架活動變更為上架, 或已上架活動變更為下架

#### Request
 欄位 | 型態  | 必填 | 預設 | 說明  
 ---|---|---|---|---
 id | string | Y | | 活動id
 launchStatus | string | Y | | 活動發佈狀態, ON:上架, OFF:下架
 
```javascript
{
    "id": "ef353072-c154-4475-b988-472e89f87a6d",
    "launchStatus": "ON"
}
```

#### Response
 欄位 | 型態 | 說明 
 ---  | --- | ---
  id | string | 活動id 
  tenantId | string | 租戶id
  title | string | 活動標題
  content | string | 活動內容
  isSingleDay | boolean | 是否為單日活動, true: 單日活動, false: 活動期間
  eventStartTime | timestamp | 活動開始日期時間
  eventEndTime | timestamp | 活動結束日期時間
  thumbnailObjectKey | string | storage中的縮圖objectKey
  attachType | string | 附件類型, NONE:無, URL:連結, FILE:檔案
  attachObjectKey | string | attachType為FILE時, 表示storage 中的 objectKey, attachType為URL時, 表示連結的網址
  attendeeLimit | int | 活動報名人數限制, -1:表示無限制
  isRegister | boolean | 活動是否需要報名, true:需要報名, false:不需報名
  regStartDate | date | 活動報名開始日期
  regEndDate | date | 活動報名結束日期
  isSign | boolean | 活動是否需要簽到簽退, true:需要簽到簽退, false:不需簽到簽退
  launchStatus | string | 活動發佈狀態, NONE:未上架, ON:上架, OFF:下架
  launchOnDate | date | 活動上架日期
  launchOffDate | date | 活動下架日期
  status | string | 活動狀態, NONE:未上架, ON:未開始, GOING:進行中, FINISH:已結束, OFF: 已下架
  createTime | timestamp | 建立時間
  updateTime | timestamp | 最後更新時間
  rewardTaskId | string | 綁定點數任務id
  notificationTitle | string | 活動推播標題
  isShow | boolean | 顯示控制, true:顯示, false: 隱藏
  givePointsTiming | string | 活動贈點時機, 01:一般, 02:簽到/退, 03:註冊

```javascript
// HttpStatus:400, 資料不存在
{
    "errorMsg": "API_ERROR.NOT_EXIST",
    "httpCode": 400
}

// HttpStatus:422, 不允許編輯已結束或已下架活動
{
    "errorMsg": "SERVICE_ERROR.EVENT_MGMT_UPDATE_FINISH_OFF_EVENT_NOT_ALLOWED",
    "httpCode": 422
}

// HttpStatus:200
{
    "httpCode": 200,
    "result": {
        "data": {
            "id": "0f2d9610-ff5c-4601-82fa-5fa235266a21",
            "tenantId": "bf47bd9c-4364-4086-946d-9fd191d93dda",
            "title": "活動11",
            "content": "Disney+ 上線囉, 還不快訂起來~~",
            "isSingleDay": false,
            "eventStartTime": 1638288000000,
            "eventEndTime": 1639065600000,
            "thumbnailObjectKey": "event/thumbnail/98386d85-592e-4e7d-80f3-0e22a389ff65.png",
            "attachType": "URL",
            "attachObjectKey": "https://www.google.com",
            "attendeeLimit": -1,
            "isRegister": true,
            "regStartDate": 1637164800000,
            "regEndDate": 1639065600000,
            "isSign": true,
            "launchStatus": "NONE",
            "status": "NONE",
            "createTime": 1637269086387,
            "updateTime": 1637269086387,
            "creator": "04398e47-e702-4290-a1c1-c4931404840e",
            "notificationTitle":null,
            "isShow": true,
            "givePointsTiming": "01"
        }
    }
}
```

## 編輯活動是否顯示

```url
POST /event-mgmt/update-show
```

* 控制活動是否要顯示在後台管理列表

#### Request
 欄位 | 型態  | 必填 | 預設 | 說明  
 ---|---|---|---|---
 id | string | Y | | 活動id
 isShow | boolean | |  | 顯示控制, true:顯示, false: 隱藏
 
```javascript
{
    "id": "ef353072-c154-4475-b988-472e89f87a6d",
    "isShow": true
}
```

#### Response
 欄位 | 型態 | 說明 
 ---  | --- | ---
  id | string | 活動id 
  tenantId | string | 租戶id
  title | string | 活動標題
  content | string | 活動內容
  isSingleDay | boolean | 是否為單日活動, true: 單日活動, false: 活動期間
  eventStartTime | timestamp | 活動開始日期時間
  eventEndTime | timestamp | 活動結束日期時間
  thumbnailObjectKey | string | storage中的縮圖objectKey
  attachType | string | 附件類型, NONE:無, URL:連結, FILE:檔案
  attachObjectKey | string | attachType為FILE時, 表示storage 中的 objectKey, attachType為URL時, 表示連結的網址
  attendeeLimit | int | 活動報名人數限制, -1:表示無限制
  isRegister | boolean | 活動是否需要報名, true:需要報名, false:不需報名
  regStartDate | date | 活動報名開始日期
  regEndDate | date | 活動報名結束日期
  isSign | boolean | 活動是否需要簽到簽退, true:需要簽到簽退, false:不需簽到簽退
  launchStatus | string | 活動發佈狀態, NONE:未上架, ON:上架, OFF:下架
  launchOnDate | date | 活動上架日期
  launchOffDate | date | 活動下架日期
  status | string | 活動狀態, NONE:未上架, ON:未開始, GOING:進行中, FINISH:已結束, OFF: 已下架
  createTime | timestamp | 建立時間
  updateTime | timestamp | 最後更新時間
  rewardTaskId | string | 綁定點數任務id
  notificationTitle | string | 活動推播標題
  isShow | boolean | 顯示控制, true:顯示, false: 隱藏
  givePointsTiming | string | 活動贈點時機, 01:一般, 02:簽到/退, 03:註冊

```javascript
// HttpStatus:400, 資料不存在
{
    "errorMsg": "API_ERROR.NOT_EXIST",
    "httpCode": 400
}

// HttpStatus:200
{
    "httpCode": 200,
    "result": {
        "data": {
            "id": "0f2d9610-ff5c-4601-82fa-5fa235266a21",
            "tenantId": "bf47bd9c-4364-4086-946d-9fd191d93dda",
            "title": "活動11",
            "content": "Disney+ 上線囉, 還不快訂起來~~",
            "isSingleDay": false,
            "eventStartTime": 1638288000000,
            "eventEndTime": 1639065600000,
            "thumbnailObjectKey": "event/thumbnail/98386d85-592e-4e7d-80f3-0e22a389ff65.png",
            "attachType": "URL",
            "attachObjectKey": "https://www.google.com",
            "attendeeLimit": -1,
            "isRegister": true,
            "regStartDate": 1637164800000,
            "regEndDate": 1639065600000,
            "isSign": true,
            "launchStatus": "NONE",
            "status": "NONE",
            "createTime": 1637269086387,
            "updateTime": 1637269086387,
            "creator": "04398e47-e702-4290-a1c1-c4931404840e",
            "notificationTitle":null,
            "isShow": true,
            "givePointsTiming": "01"
        }
    }
}
```


## 刪除活動

```url
POST /event-mgmt/delete
```

#### Request
 欄位 | 型態  | 必填 | 預設 | 說明  
 ---|---|---|---|---
 id | string | Y | | 活動id
 
```javascript
{
    "id": "e45c15dd-60e5-4320-9974-0f8ebc8a6147"
}
```

#### Response
 欄位 | 型態 | 說明 
 ---  | --- | ---
 count | int | 刪除筆數, > 0 表示成功刪除

```javascript
// HttpStatus:400, 資料不存在
{
    "errorMsg": "API_ERROR.NOT_EXIST",
    "httpCode": 400
}

// HttpStatus:422, 不允許刪除活動(上架中, 已下架)
{
    "errorMsg": "SERVICE_ERROR.EVENT_MGMT_DELETE_NOT_ALLOWED",
    "httpCode": 422
}

// HttpStatus:200
{
    "httpCode": 200,
    "result": {
        "data": {
            "count": 1
        }
    }
}
```


## 列印活動QRCode

```url
POST /event-mgmt/qrcode
```

* 活動有啟用簽到/簽退, 並且活動狀態是"未開始"或"進行中"時, 才能執行此API
* QRCode的內容格式為
  health365://event?id=<eventId>
  
  - eventId: 活動id

#### Request
 
 欄位 | 型態  | 必填 | 預設 | 說明  
 ---|---|---|---|---
 id | string | Y | | 活動id 
 
```javascript
{
    "id": "728272a7-e440-40ec-a90b-fd3b49969311"
}
```

#### Response
 欄位 | 型態 | 說明 
 ---  | --- | ---
 id | string | 活動id 
 tenantId | string | 租戶id
 title | string | 活動標題
 eventStartTime | timestamp | 活動開始日期時間
 eventEndTime | timestamp | 活動結束日期時間
 base64QrCode | string | QRCode base64字串
 

```javascript
// HttpStatus:400, 資料不存在
{
    "errorMsg": "API_ERROR.NOT_EXIST",
    "httpCode": 400
}

// HttpStatus:422, 不需簽到/簽退
{
    "errorMsg": "SERVICE_ERROR.EVENT_NO_NEED_SIGN",
    "httpCode": 422
}

// HttpStatus:422, 不允許執行印QRCode
{
    "errorMsg": "SERVICE_ERROR.EVENT_QRCODE_NOT_ALLOWED",
    "httpCode": 422
}

// HttpStatus:200
{
    "httpCode": 200,
    "result": {
        "data": {
            "id": "728272a7-e440-40ec-a90b-fd3b49969311",
            "tenantId": "WMT",
            "tenantName": "緯創醫學",
            "title": "玩健康~送咖啡 <<台灣醫療科技展會活動>>",
            "eventStartTime": 1638374400000,
            "eventEndTime": 1638633600000,
            "attachUrl": null,
            "thumbnailUrl": null,
            "base64QrCode": "iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAIAAAAP3aGbAAALoklEQVR42u3awWHEIAxFwe2/6aSHxCue8Pw7BAtpyGE/PyIiS/JRAhEBlogIsEQEWCIiwBIRAZaIAEtEBFgiIsASEWCJiABLRARYIgIsERFgiYh8DazP5vztuyr39PR3TW44Wd7Id0W6d/V3AQtYwAIWsIAFLGABC1jAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGABC1jAAhawymCtHuzIiK4egH4NV1feVAILWMACFrCABSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsLaAdWu/RjbsN+Xj1eg/ZquPUe5eYAELWMACFrCABSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsE4N9uoBiBw+Qmq/vKYSWMACFrCABSxgAQtYwAIWsIAFLKUBFrCABSxgAQtYwAIWsIAFLGApDbCABSxgAQtYwAIWsN4zvZEBePy+bj3h44cHFrCABSxgAQtYwAIWsIAFLBwAC1jAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGABawtYkW7ot1dk5vurJmv4wue2PJXAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAELWMACFrCABawIWP3cOr1WWXXlVAJLK1sFLGAByyqrgAUsYFllFbCApZWtAhawgGWVVcACFrCssgpYwDIAVgELWMCyyipgHQfr1vTdfPDK/zMbk+WNXOVkNUwisIAFLGABC1jAAhawgAUsYAFLgAUsYAELWMACFrCABSxgAQtYAixgAQtYwAIWsIAFLGCdHYDVMx+Zjf6IRsrrF/zAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAELWMACFrCABawtYEV+LD5Z6xf++nzyx/39mY8IuPq+gAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAELWMACFrCABSxgAQtYZbD6H9lXafUA3Orm5OEjG0aaDVjAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAELWMACFrCAtRSs/tisbq/JRonMRt+X1W/q0lsGFrCABSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGBFwJq8vNUbrp75SW37Rq9+HZe2KLCABSxgAcuGwAIWsIAFLGABC1h8ARawgAUsGwILWMACFrCABSxg8QVYwAIWsGwILGABKwJW/4YmN+wfoz+HkT5cLeDqxgYWsIAFLGABC1jAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYB0Ha3WtJ/v1Voj7pGrRU24O3ZRuABawgAUsYAELWMACFrCApUWBpRuABSxgAQtYwAIWsIAFLGBpUWDpBmABC1jAAhawgAWsPFj9RrmVnlshvlWlyVv+DAZYwAIWsIAFLGABC1jAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGABC1jAAhawgAWsLQKu7tf+ezD5yZ6KXf8QAAtYwAIWsIAFLGDpeWABC1jAAhawgAUsYAHL5QELWHoeWMACFrCABSxgAQtYwHJ5wAKWni+DdV9pQHz2GKsRmdT2VX8LWMACFrCABSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAVAWtyDh8vTX/YHm+vvmWTsxGpxuohAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAELWMACFrCABSxgvQqsftUmuzyCY3+iIgL2q9F/bmdqCCxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGABC1jAioD1whvqT2/k7Yk8SxEcX2j0kzcFLGABC1jAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAELWMC6FKylBU0dfrW2j/+tfqEij3S5vMACFrCABSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFrAhYkTmMXF5kbCI1jExvvxr9R/r4MYAFLGABC1jAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAELWJNgRZoyMr2T3xWZ+dVPRYSDW0md6V5gAQtYwAIWsIAFLGABC1jAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGABC1jAAlYErIhKkcG+FceItpODjZ5T3QssYAELWMACFrCABSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAELWMACFrCABSxgAQtYwDoOVr+H+lL0e6hfjdW9MZlIeYEFLGABC1jAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAELWEvB6jfK5AlXH+NWy3Cwa2CBBSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGABC1j3gRVpr1tPCMevItJHv28ZsIAFLGABC1jAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAFrKViR71/dXrceow9WX1sbAgtYwAIWsIAFLGDxBVjAAhawbAgsYAELWMACFrCAxRdgAQtYwAIWsIAFLGABC1jAAhawUmDNnOlLiYzo5Mzf6maE1NXa9o0GFrCABSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGCVwTIAp6rxqn5NfXK/RftPO7CABSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGABaylYq29o9URFVFotReSdW91RMwMLLGABC1jAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAELWMDqgxXZ8IUTtVql1b2xWqXy/wrAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAELWMACFrCABaxJsG5NBOL+bEQ+OXLLkWfpVr6BBSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGABC1jHwfpszmrmbv2uSLNF7uvWVU82J7CABSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGABqwHWTyORy4sM2+R39a9SeU8d48ENgQUsYCkvsIAFLGABC1jAMlHAAhawgAUs5QUWsIAFLGABC1jAAhawgAUsYAELWMACFrCA1Qer30ORYYt0Xl/bFz4wtz6BwAIWsIAFLGABC1jAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGABC1jAAhawgOWEwEqB1b/X1YisrvwL357jNQQWsIAFLGABC1jAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAEr2Hn9RCof6ajJRPjuv1jAEmABC1jAAhawgAUsYAELWMAClgALWMACFrCABSxgAQtYwAIWsIAFLGABC1jAAhawloIVmcPIzPchfuEJ+yq98BjAAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAELWMACFrCABawyWP2sJnVSwNVjs7qG/fs6Pl/AAhawgAUsYAELWMACFrCABSxgAQtYwAIWsIAFLGABC1jAAhawgAUsYAELWMACFrCABaxJsERETr73SiAiwBIRAZaIAEtEBFgiIsASEWCJiABLRARYIgIsERFgiYgAS0SAJSICLBERYInIjfkF66pEKmxuWToAAAAASUVORK5CYII="
        }
    }
}
```


## 可綁定點數任務列表

```url
POST /event-mgmt/reward-task-list
```

* 目前只會列出該租戶下可綁定的點數任務
* 點數任務有2種類型, 依taskType區分, "EVENT_SIGN_IN"為簽到/退任務, "EVENT_REGISTER"為註冊任務

#### Request
 
 欄位 | 型態  | 必填 | 預設 | 說明  
 ---|---|---|---|---
  
 
```javascript

```

#### Response
 欄位 | 型態 | 說明 
 ---  | --- | ---
 id | string | 點數任務id
 taskType | string | 任務類型, EVENT_SIGN_IN: 活動簽到任務, EVENT_REGISTER: 活動註冊任務 
 name | string | 任務名稱
 description | string | 任務說明
 points | int | 任務點數 
 tenantId | string | 租戶id
 status | boolean | 任務狀態,
 

```javascript
// HttpStatus:200
{
    "httpCode": 200,
    "result": {
        "data": [
            {
                "id": "88573e0e-ac04-4a09-ae06-3e23954804ed",
                "taskType": "EVENT_SIGN_IN",
                "name": "活動簽到贈點10點",
                "description": "活動簽到贈點10點",
                "points": 10,
                "tenantId": "858b7fbb-3ba0-4d49-9882-c893a1ef07dc",
                "status": true
            },
            ...
        ]
    }
}
```
    
## 活動推播通知

```url
POST /event-mgmt/notify
```

#### Request
欄位 | 型態 | 必填 | 預設 | 說明  
 ---|---|---|---|---
 id | string | Y |  | 活動id
 notificationTitle | string | N |  |推播通知標題
     
```javascript
{
    "id":"fdf88cf9-d282-4a73-8163-dc8fc6d1bcda",
    "notificationTitle": "下雨要幹嘛?"
}
```
    
#### Response
 欄位 | 型態 | 說明 
 ---  | --- | ---
isSuccess | boolean | 推播狀態。true成功，false失敗
population | Integer | 推播數

```javascript
// HttpStatus:200 推播成功
{
    "httpCode": 200,
    "result": {
        "data": {
            "isSuccess": true,
            "population": 2
        }
    }
}
    
// HttpStatus:422 活動狀態不允許
{
    "errorMsg": "SERVICE_ERROR.EVENT_MGMT_STATUS_NOT_ALLOWED",
    "httpCode": 422
}
    
// HttpStatus:422 推播標題不能為空   
{
    "errorMsg": "SERVICE_ERROR.EVENT_MGMT_TITLE_EMPTY_NOT_ALLOWED",
    "httpCode": 422
}
```  


## 活動統計

```url
POST /event-mgmt/event/statistics
```

#### Request
 欄位 | 型態  | 必填 | 預設 | 說明  
 ---|---|---|---|---
 eventId | string | Y |  | 活動id
 

```javascript
{
    "eventId": "7d8d607c-47c7-449d-aaaa-dbdaf5a4636f"
}
```

#### Response
 欄位 | 型態 | 說明 
 ---  | --- | ---
 eventInfo | json | 活動info json
 reachInfo | json | 活動曝光分析json
 clickInfo | json | 活動點擊分析json
 registerInfo | json | 活動報名分析json, 活動若不需報名, 則為null
 signInInfo | json | 活動參與分析json, 活動若不需簽到, 則為null

* eventInfo (活動info json)

 欄位 | 型態 | 說明 
 ---  | --- | ---
 id | string | 活動id 
 tenantId | string | 租戶id
 title | string | 活動標題
 content | string | 活動內容
 isSingleDay | boolean | 是否為單日活動, true: 單日活動, false: 活動期間
 eventStartTime | timestamp | 活動開始日期時間
 eventEndTime | timestamp | 活動結束日期時間
 thumbnailObjectKey | string | storage中的縮圖objectKey
 attachType | string | 附件類型, NONE:無, URL:連結, FILE:檔案
 attachObjectKey | string | attachType為FILE時, 表示storage 中的 objectKey, attachType為URL時, 表示連結的網址
 attendeeLimit | int | 活動報名人數限制, -1:表示無限制
 isRegister | boolean | 活動是否需要報名, true:需要報名, false:不需報名
 regStartDate | date | 活動報名開始日期
 regEndDate | date | 活動報名結束日期
 isSign | boolean | 活動是否需要簽到簽退, true:需要簽到簽退, false:不需簽到簽退
 launchStatus | string | 活動發佈狀態, NONE:未上架, ON:上架, OFF:下架
 launchOnDate | date | 活動上架日期
 launchOffDate | date | 活動下架日期
 status | string | 活動狀態, NONE:未上架, ON:未開始, GOING:進行中, FINISH:已結束, OFF: 已下架
 thumbnailUrl | string | 可 download 的 縮圖url, 時效 3600 秒
 attachUrl | string | attachType為FILE時,可 download 的 url, 時效 3600 秒, attachType為URL時, 表示連結的網址
 registerCount | int | 報名人數
 signInCount | int | 簽到人數
 cancelCount | int | 取消報名人數
 cancelTimes | int | 取消報名人次
 notificationTitle | string | 活動推播標題
 
* reachInfo (活動曝光分析json)

 欄位 | 型態 | 說明 
 ---  | --- | ---
 totalCount | int | 總曝光人數
 totalTimes | int | 總曝光人次
 totalMaleCount | int | 總男性曝光人數
 totalFemaleCount | int | 總女性曝光人數
 totalMaleTimes | int | 總男性曝光人次
 totalFemaleTimes | int | 總女性曝光人次
 totalMaleCountRate | double | 總男性人數佔比
 totalFemaleCountRate | double | 總女性人數佔比
 totalMaleTimesRate | double | 總男性人次佔比
 totalFemaleTimesRate | double | 總女性人次佔比
 details | json array | 年齡統計 json array
 
* clickInfo (活動點擊分析json)

 欄位 | 型態 | 說明 
 ---  | --- | ---
 totalCount | int | 總點擊人數
 totalTimes | int | 總點擊人次
 totalMaleCount | int | 總男性點擊人數
 totalFemaleCount | int | 總女性點擊人數
 totalMaleTimes | int | 總男性點擊人次
 totalFemaleTimes | int | 總女性點擊人次
 totalMaleCountRate | double | 總男性人數佔比
 totalFemaleCountRate | double | 總女性人數佔比
 totalMaleTimesRate | double | 總男性人次佔比
 totalFemaleTimesRate | double | 總女性人次佔比
 clickRate | double | 點擊率, 點擊率 = 點擊人數/曝光人數
 details | json array | 年齡統計 json array
 
 * registerInfo (活動報名分析json)
 
  欄位 | 型態 | 說明 
  ---  | --- | ---
  totalCount | int | 總報名人數
  totalMaleCount | int | 總男性報名人數
  totalFemaleCount | int | 總女性報名人數
  totalMaleCountRate | double | 總男性人數佔比
  totalFemaleCountRate | double | 總女性人數佔比
  registerRate | double | 報名率, 報名率 = 已報名人數/活動人數, **有限制活動人數時,才會計算報名率**
  details | json array | 年齡統計 json array
  
 * signInInfo (活動參與分析json)
 
  欄位 | 型態 | 說明 
  ---  | --- | ---
  totalCount | int | 總報到人數
  totalMaleCount | int | 總男性報到人數
  totalFemaleCount | int | 總女性報到人數
  totalMaleCountRate | double | 總男性人數佔比
  totalFemaleCountRate | double | 總女性人數佔比
  signInRate | double | 報到率, 報到率 = 已報到人數/報名人數, **有限制活動人數以及需要報名及簽到時,才會計算報到率**
  details | json array | 年齡統計 json array

* details (json array of reachInfo, clickInfo, registerInfo, signInInfo)

 欄位 | 型態 | 說明 
 ---  | --- | ---
 ageLevel | string | 年齡level
 label | string | 年齡區間顯示(標X軸)
 maleCount | int | 男性人數
 femaleCount | int | 女性人數
 maleTimes | int | 男性人次
 femaleTimes | int | 女性人次


```javascript
{
    "httpCode": 200,
    "result": {
        "data": {
            "eventInfo": {
                "id": "7d8d607c-47c7-449d-aaaa-dbdaf5a4636f",
                "tenantId": "WMT",
                "title": "緯創人日行5000步",
                "content": "活動報名\n請於11/25（四）前上福利網「活動專區」報名。\n\n特別說明\n1. WIH DL同仁無法登入福利網者請與Kate Wang#31554聯繫報名參加。（派遣同仁恕無法參加本活動）\n2. 曾經報名本活動者，無須重新報名，系統將會直接加入參加名單。\n\n活動APP說明\n本活動將透過活動APP進行，自動連結個人手機內建計步功能，安裝方式8/30另行通知。\n\n手機最低版本需求：iPhone「iOS 11.2以上版本」、Android「5.0 以上版本」\n活動APP資料來源須同步手機內建計步介面：iPhone「健康」、Android「Google Fit」\n※因大陸限制Google Fit服務，使用華為、小米手機無法參與本活動※\n\n特別說明\n1. 每月達標禮「7-11商品卡」為有價證券，依規定須列入個人110年度其他所得。\n2. 依機會中獎稅規定，彩品價值20,000元以上中獎人須繳交機會中獎稅稅額。\n　（未滿20,000元之彩品金額，依規定須列入個人110年度其他所得。）\n3. 每月達標皆可獲得一組摸彩序號，達標月份越多中獎機會越高。\n\n活動洽詢\n福委會服務專線18888按4",
                "isSingleDay": false,
                "eventStartTime": 1635696000000,
                "eventEndTime": 1640880000000,
                "thumbnailObjectKey": "event/thumbnail/b4f4c568-21e1-446e-966b-76a5d8e61a36.jpg",
                "attachType": "URL",
                "attachObjectKey": "https://portal.wistron.com/weip/web/EIP_F_1001D.aspx?msg_center_pk=5140",
                "attendeeLimit": 100,
                "isRegister": true,
                "regStartDate": 1635696000000,
                "regEndDate": 1640880000000,
                "isSign": true,
                "launchStatus": "ON",
                "launchOnDate": 1637251200000,
                "status": "FINISH",
                "createTime": 1637285929402,
                "updateTime": 1641227400013,
                "attachUrl": null,
                "thumbnailUrl": "http://content-service/swift/v1/event/thumbnail/b4f4c568-21e1-446e-966b-76a5d8e61a36.jpg",
                "registerCount": 2,
                "signInCount": 2,
                "cancelCount": 1,
                "cancelTimes": 1
            },
            "reachInfo": {
                "totalCount": 0,
                "totalTimes": 0,
                "totalMaleCount": 0,
                "totalFemaleCount": 0,
                "totalMaleTimes": 0,
                "totalFemaleTimes": 0,
                "totalMaleCountRate": 0.0,
                "totalFemaleCountRate": 0.0,
                "totalMaleTimesRate": 0.0,
                "totalFemaleTimesRate": 0.0,
                "details": [
                    {
                        "ageLevel": "level1",
                        "label": "30歲以下",
                        "maleCount": 0,
                        "femaleCount": 0,
                        "maleTimes": 0,
                        "femaleTimes": 0
                    },
                    {
                        "ageLevel": "level2",
                        "label": "30-39歲",
                        "maleCount": 0,
                        "femaleCount": 0,
                        "maleTimes": 0,
                        "femaleTimes": 0
                    },
                    {
                        "ageLevel": "level3",
                        "label": "40-49歲",
                        "maleCount": 0,
                        "femaleCount": 0,
                        "maleTimes": 0,
                        "femaleTimes": 0
                    },
                    {
                        "ageLevel": "level4",
                        "label": "50-59歲",
                        "maleCount": 0,
                        "femaleCount": 0,
                        "maleTimes": 0,
                        "femaleTimes": 0
                    },
                    {
                        "ageLevel": "level5",
                        "label": "60歲以上",
                        "maleCount": 0,
                        "femaleCount": 0,
                        "maleTimes": 0,
                        "femaleTimes": 0
                    }
                ]
            },
            "clickInfo": {
                "totalCount": 0,
                "totalTimes": 0,
                "totalMaleCount": 0,
                "totalFemaleCount": 0,
                "totalMaleTimes": 0,
                "totalFemaleTimes": 0,
                "totalMaleCountRate": 0.0,
                "totalFemaleCountRate": 0.0,
                "totalMaleTimesRate": 0.0,
                "totalFemaleTimesRate": 0.0,
                "clickRate": 0.0,
                "details": [
                    {
                        "ageLevel": "level1",
                        "label": "30歲以下",
                        "maleCount": 0,
                        "femaleCount": 0,
                        "maleTimes": 0,
                        "femaleTimes": 0
                    },
                    {
                        "ageLevel": "level2",
                        "label": "30-39歲",
                        "maleCount": 0,
                        "femaleCount": 0,
                        "maleTimes": 0,
                        "femaleTimes": 0
                    },
                    {
                        "ageLevel": "level3",
                        "label": "40-49歲",
                        "maleCount": 0,
                        "femaleCount": 0,
                        "maleTimes": 0,
                        "femaleTimes": 0
                    },
                    {
                        "ageLevel": "level4",
                        "label": "50-59歲",
                        "maleCount": 0,
                        "femaleCount": 0,
                        "maleTimes": 0,
                        "femaleTimes": 0
                    },
                    {
                        "ageLevel": "level5",
                        "label": "60歲以上",
                        "maleCount": 0,
                        "femaleCount": 0,
                        "maleTimes": 0,
                        "femaleTimes": 0
                    }
                ]
            },
            "registerInfo": {
                "totalCount": 2,
                "totalMaleCount": 2,
                "totalFemaleCount": 0,
                "totalMaleCountRate": 100.0,
                "totalFemaleCountRate": 0.0,
                "details": [
                    {
                        "ageLevel": "level1",
                        "label": "30歲以下",
                        "maleCount": 1,
                        "femaleCount": 0
                    },
                    {
                        "ageLevel": "level2",
                        "label": "30-39歲",
                        "maleCount": 1,
                        "femaleCount": 0
                    },
                    {
                        "ageLevel": "level3",
                        "label": "40-49歲",
                        "maleCount": 0,
                        "femaleCount": 0
                    },
                    {
                        "ageLevel": "level4",
                        "label": "50-59歲",
                        "maleCount": 0,
                        "femaleCount": 0
                    },
                    {
                        "ageLevel": "level5",
                        "label": "60歲以上",
                        "maleCount": 0,
                        "femaleCount": 0
                    }
                ],
                "registerRate": 2.0
            },
            "signInInfo": {
                "totalCount": 2,
                "totalMaleCount": 2,
                "totalFemaleCount": 0,
                "totalMaleCountRate": 100.0,
                "totalFemaleCountRate": 0.0,
                "details": [
                    {
                        "ageLevel": "level1",
                        "label": "30歲以下",
                        "maleCount": 1,
                        "femaleCount": 0
                    },
                    {
                        "ageLevel": "level2",
                        "label": "30-39歲",
                        "maleCount": 1,
                        "femaleCount": 0
                    },
                    {
                        "ageLevel": "level3",
                        "label": "40-49歲",
                        "maleCount": 0,
                        "femaleCount": 0
                    },
                    {
                        "ageLevel": "level4",
                        "label": "50-59歲",
                        "maleCount": 0,
                        "femaleCount": 0
                    },
                    {
                        "ageLevel": "level5",
                        "label": "60歲以上",
                        "maleCount": 0,
                        "femaleCount": 0
                    }
                ],
                "signInRate": 100.0
            }
        }
    }
}
```



## 活動摘要

```url
GET /event/summary
```

#### Request


#### Response
 欄位 | 型態 | 說明 
 ---  | --- | ---
 registeredEventCount | int | 已報名活動數 
 
 
```javascript
{
    "httpCode": 200,
    "result": {
        "data": {
            "registeredEventCount": 1
        }
    }
}
```


## 取得活動列表

```url
POST /event/list
```

#### Request
* query(查詢條件json)
 
 欄位 | 型態  | 必填 | 預設 | 說明  
 ---|---|---|---|---
 listType | string | Y | | 查詢列表類別, ALL:全部, REGISTRATION:可報名, REGISTERED:已報名
 
* pagination(分頁json)
 
 欄位 | 型態  | 必填 | 預設 | 說明
 ---|---|---|---|---
 current | int | | 1 | 當前頁數 
 pageSize | int | | 10 | 每頁結果數量，-1 為顯示所有
 
* sorter(排序json), 預設是用更新時間降序排列
 
 欄位 | 型態  | 必填 | 預設 | 說明
 ---|---|---|---|--- 
 field | string | | eventStartTime | 排序欄位,可排序欄位有updateTime, eventStartTime, eventEndTime, status 
 order | string | | desc | 升序或降序

```javascript
{
    "query": {
        "listType": "ALL"
    } ,
    "pagination": {
        "current": 1,
        "pageSize": -1
    }, 
    "sorter": {
        "field": "eventStartTime",
        "order": "desc"
    }
}
```


#### Response
 欄位 | 型態 | 說明 
 ---  | --- | ---
 id | string | 活動id 
 tenantId | string | 租戶id
 tenantName | string | 租戶名稱
 title | string | 活動標題
 content | string | 活動內容
 isSingleDay | boolean | 是否為單日活動, true: 單日活動, false: 活動期間
 eventStartTime | timestamp | 活動開始日期時間
 eventEndTime | timestamp | 活動結束日期時間
 thumbnailObjectKey | string | storage中的縮圖objectKey
 attachType | string | 附件類型, NONE:無, URL:連結, FILE:檔案
 attachObjectKey | string | attachType為FILE時, 表示storage 中的 objectKey, attachType為URL時, 表示連結的網址
 attendeeLimit | int | 活動報名人數限制, -1:表示無限制
 isRegister | boolean | 活動是否需要報名, true:需要報名, false:不需報名
 regStartDate | date | 活動報名開始日期
 regEndDate | date | 活動報名結束日期
 isSign | boolean | 活動是否需要簽到簽退, true:需要簽到簽退, false:不需簽到簽退
 status | string | 活動狀態, NONE:未上架, ON:未開始, GOING:進行中, FINISH:已結束, OFF: 已下架
 thumbnailUrl | string | 可 download 的 縮圖url, 時效 3600 秒
 attachUrl | string | attachType為FILE時,可 download 的 url, 時效 3600 秒, attachType為URL時, 表示連結的網址
notificationTitle | string | 活動推播標題
 
```javascript
{
    "httpCode": 200,
    "result": {
        "data": [
            {
                "id": "ef353072-c154-4475-b988-472e89f87a6d",
                "tenantId": "WMT",
                "tenantName": "緯創醫學",
                "title": "活動11",
                "content": "Disney+ 上線囉, 還不快訂起來~~",
                "isSingleDay": false,
                "eventStartTime": 1638288000000,
                "eventEndTime": 1639065600000,
                "thumbnailObjectKey": "event/thumbnail/98386d85-592e-4e7d-80f3-0e22a389ff65.png",
                "attachType": "URL",
                "attachObjectKey": "https://www.google.com",
                "attendeeLimit": -1,
                "isRegister": true,
                "regStartDate": 1637164800000,
                "regEndDate": 1639065600000,
                "isSign": true,
                "status": "ON",
                "createTime": 1637164800000,
                "updateTime": 1637164800000,
                "attachUrl": null,
                "thumbnailUrl": "http://10.31.49.126/swift/v1/AUTH_test/kmuh/event/thumbnail/98386d85-592e-4e7d-80f3-0e22a389ff65.png",
                "notificationTitle":null
            }
        ]
    }
}
```


## 取得活動明細

```url
POST /event/info
```

#### Request
 
 欄位 | 型態  | 必填 | 預設 | 說明  
 ---|---|---|---|---
 eventId | string | Y | | 活動id 
 
```javascript
{
    "eventId": "ef353072-c154-4475-b988-472e89f87a6d"
}
```

#### Response
 欄位 | 型態 | 說明 
 ---  | --- | ---
 id | string | 活動id 
 tenantId | string | 租戶id
 tenantName | string | 租戶名稱
 title | string | 活動標題
 content | string | 活動內容
 isSingleDay | boolean | 是否為單日活動, true: 單日活動, false: 活動期間
 eventStartTime | timestamp | 活動開始日期時間
 eventEndTime | timestamp | 活動結束日期時間
 thumbnailObjectKey | string | storage中的縮圖objectKey
 attachType | string | 附件類型, NONE:無, URL:連結, FILE:檔案
 attachObjectKey | string | attachType為FILE時, 表示storage 中的 objectKey, attachType為URL時, 表示連結的網址
 attendeeLimit | int | 活動報名人數限制, -1:表示無限制
 isRegister | boolean | 活動是否需要報名, true:需要報名, false:不需報名
 regStartDate | date | 活動報名開始日期
 regEndDate | date | 活動報名結束日期
 isSign | boolean | 活動是否需要簽到簽退, true:需要簽到簽退, false:不需簽到簽退
 status | string | 活動狀態, NONE:未上架, ON:未開始, GOING:進行中, FINISH:已結束, OFF: 已下架
 thumbnailUrl | string | 可 download 的 縮圖url, 時效 3600 秒
 attachUrl | string | attachType為FILE時,可 download 的 url, 時效 3600 秒, attachType為URL時, 表示連結的網址
 eventUserLogList | json array | 活動記錄 json array
 hadRegistered | boolean | 是否已經報名, true: 已報名, false: 未報名
 hadSignIn | boolean | 是否已經簽到, true: 已簽到, false: 未簽到
 registeredCount | int | 已報名人數
 notificationTitle | string | 活動推播標題
 
* json of eventUserLogList
 
 欄位 | 型態 | 說明 
 ---  | --- | ---
 id | string | 活動記錄id 
 householdMemberId | string | householdMemberId
 eventId | string | 活動id
 logType | string | 活動記錄類別, REGISTER:報名, CANCEL_REGISTER:取消報名, SIGN_IN:簽到, SIGN_OUT:簽退
 createTime | timestamp | 活動記錄建立時間
 

```javascript
// HttpStatus:400, 資料不存在
{
    "errorMsg": "API_ERROR.NOT_EXIST",
    "httpCode": 400
}

// HttpStatus:200
{
    "httpCode": 200,
    "result": {
        "data": {
            "id": "ef353072-c154-4475-b988-472e89f87a6d",
            "tenantId": "WMT",
            "tenantName": "緯創醫學",
            "title": "活動11",
            "content": "Disney+ 上線囉, 還不快訂起來~~",
            "isSingleDay": false,
            "eventStartTime": 1638288000000,
            "eventEndTime": 1639065600000,
            "thumbnailObjectKey": "event/thumbnail/98386d85-592e-4e7d-80f3-0e22a389ff65.png",
            "attachType": "URL",
            "attachObjectKey": "https://www.google.com",
            "attendeeLimit": -1,
            "isRegister": true,
            "regStartDate": 1637164800000,
            "regEndDate": 1639065600000,
            "isSign": true,
            "status": "ON",
            "createTime": 1637164800000,
            "updateTime": 1637164800000,
            "attachUrl": "https://www.google.com",
            "thumbnailUrl": "http://10.31.49.126/swift/v1/AUTH_test/kmuh/event/thumbnail/98386d85-592e-4e7d-80f3-0e22a389ff65.png",
            "notificationTitle":null
            "eventUserLogList": [
                {
                    "id": "f5a1f7ff-5de9-4638-b7ce-c0ef4aa9170f",
                    "householdMemberId": "8a9e980a-c612-4f87-af07-a97a5f0fbed5",
                    "eventId": "ef353072-c154-4475-b988-472e89f87a6d",
                    "logType": "REGISTER",
                    "createTime": 1637251200000
                }
            ],
            "hadRegistered": true,
            "hadSignIn": false,
            "registeredCount": 2
        }
    }
}
```


## 活動報名

```url
POST /event/register
```

#### Request
 
 欄位 | 型態  | 必填 | 預設 | 說明  
 ---|---|---|---|---
 eventId | string | Y | | 活動id 
 
```javascript
{
    "eventId": "ef353072-c154-4475-b988-472e89f87a6d"
}
```

#### Response
 欄位 | 型態 | 說明 
 ---  | --- | ---
 id | string | 活動人員參與記錄id 
 eventId | string | 活動id
 householdMemberId | string | householdMemberId
 registerTime | timestamp | 報名時間
 signInTime | timestamp | 簽到時間
 signOutTime | timestamp | 簽退時間
 

```javascript
// HttpStatus:400, 資料不存在
{
    "errorMsg": "API_ERROR.NOT_EXIST",
    "httpCode": 400
}

// HttpStatus:422, 活動已結束
{
    "errorMsg": "SERVICE_ERROR.EVENT_HAD_FINISH",
    "httpCode": 400
}

// HttpStatus:422, 活動已下架
{
    "errorMsg": "SERVICE_ERROR.EVENT_HAD_OFF",
    "httpCode": 400
}

// HttpStatus:422, 不需報名
{
    "errorMsg": "SERVICE_ERROR.EVENT_NO_NEED_REGISTER",
    "httpCode": 400
}

// HttpStatus:422, 報名日期已過
{
    "errorMsg": "SERVICE_ERROR.EVENT_REGISTER_OVER_DATE",
    "httpCode": 400
}

// HttpStatus:422, 報名人數已超過
{
    "errorMsg": "SERVICE_ERROR.EVENT_REGISTER_OVER_LIMIT",
    "httpCode": 400
}

// HttpStatus:200
{
    "httpCode": 200,
    "result": {
        "data": {
            "id": "b3aaf4eb-7902-443f-8b7e-fbe48e8e8146",
            "eventId": "ef353072-c154-4475-b988-472e89f87a6d",
            "householdMemberId": "8a9e980a-c612-4f87-af07-a97a5f0fbed5",
            "registerTime": 1637262924248,
            "createTime": 1637262924244,
            "updateTime": 1637262924244
        }
    }
}
```


## 活動報名取消

```url
POST /event/cancel-register
```

#### Request
 
 欄位 | 型態  | 必填 | 預設 | 說明  
 ---|---|---|---|---
 eventId | string | Y | | 活動id 
 
```javascript
{
    "eventId": "ef353072-c154-4475-b988-472e89f87a6d"
}
```

#### Response
 欄位 | 型態 | 說明 
 ---  | --- | ---
 id | string | 活動人員參與記錄id 
 eventId | string | 活動id
 householdMemberId | string | householdMemberId
 signInTime | timestamp | 簽到時間
 signOutTime | timestamp | 簽退時間
 

```javascript
// HttpStatus:400, 資料不存在
{
    "errorMsg": "API_ERROR.NOT_EXIST",
    "httpCode": 400
}

// HttpStatus:422, 此活動不允許參與
{
    "errorMsg": "SERVICE_ERROR.EVENT_NOT_ALLOWED",
    "httpCode": 400
}

// HttpStatus:422, 活動已結束
{
    "errorMsg": "SERVICE_ERROR.EVENT_HAD_FINISH",
    "httpCode": 400
}

// HttpStatus:422, 活動已下架
{
    "errorMsg": "SERVICE_ERROR.EVENT_HAD_OFF",
    "httpCode": 400
}

// HttpStatus:422, 不需報名
{
    "errorMsg": "SERVICE_ERROR.EVENT_NO_NEED_REGISTER",
    "httpCode": 400
}

// HttpStatus:422, 報名日期已過
{
    "errorMsg": "SERVICE_ERROR.EVENT_REGISTER_OVER_DATE",
    "httpCode": 400
}

// HttpStatus:422, 報名人數已超過
{
    "errorMsg": "SERVICE_ERROR.EVENT_REGISTER_OVER_LIMIT",
    "httpCode": 400
}

// HttpStatus:200
{
    "httpCode": 200,
    "result": {
        "data": {
            "id": "b3aaf4eb-7902-443f-8b7e-fbe48e8e8146",
            "eventId": "ef353072-c154-4475-b988-472e89f87a6d",
            "householdMemberId": "8a9e980a-c612-4f87-af07-a97a5f0fbed5",
            "createTime": 1637262924244,
            "updateTime": 1637262924244
        }
    }
}
```


## 活動簽到簽退

```url
POST /event/sign
```

* 對同一活動第一次執行為簽到, 後續執行為簽退


#### Request
 
 欄位 | 型態  | 必填 | 預設 | 說明  
 ---|---|---|---|---
 eventId | string | Y | | 活動id 
 
```javascript
{
    "eventId": "ef353072-c154-4475-b988-472e89f87a6d"
}
```

#### Response
 欄位 | 型態 | 說明 
 ---  | --- | ---
 id | string | 活動人員參與記錄id 
 eventId | string | 活動id
 householdMemberId | string | householdMemberId
 signInTime | timestamp | 簽到時間
 signOutTime | timestamp | 簽退時間
 

```javascript
// HttpStatus:400, 資料不存在
{
    "errorMsg": "API_ERROR.NOT_EXIST",
    "httpCode": 400
}

// HttpStatus:422, 此活動不允許參與
{
    "errorMsg": "SERVICE_ERROR.EVENT_NOT_ALLOWED",
    "httpCode": 400
}

// HttpStatus:422, 活動尚未開始
{
    "errorMsg": "SERVICE_ERROR.EVENT_NOT_GOING",
    "httpCode": 400
}

// HttpStatus:422, 活動時間已過
{
    "errorMsg": "SERVICE_ERROR.EVENT_TIME_OVER",
    "httpCode": 400
}

// HttpStatus:422, 活動需要先報名
{
    "errorMsg": "SERVICE_ERROR.EVENT_NEED_REGISTER_FIRST",
    "httpCode": 400
}

// HttpStatus:200
{
    "httpCode": 200,
    "result": {
        "data": {
            "id": "b3aaf4eb-7902-443f-8b7e-fbe48e8e8146",
            "eventId": "ef353072-c154-4475-b988-472e89f87a6d",
            "householdMemberId": "8a9e980a-c612-4f87-af07-a97a5f0fbed5",
            "createTime": 1637262924244,
            "updateTime": 1637262924244
        }
    }
}
```


## 活動觸及(曝光)

```url
POST /event/reach
```

* App 端控制將活動已在畫面呈現給User時, call 此API計算活動的觸及

#### Request
 
 欄位 | 型態  | 必填 | 預設 | 說明
 ---|---|---|---|---
 eventList | string array | Y | | 活動id List, 最多傳入50組活動id, 活動id不可重覆 
 
```javascript
{
    "eventList": [
        "b02d3f3a-e55f-4f50-a557-55930111a4ae",
        "f14d33c4-38b1-4611-a6d1-11a1b202305d",
        "62e120c0-a3e6-4e6c-bdc0-65b3a5fb03d1",
        "5f09ee60-4ada-4b96-afd3-78c41c005a46"
    ]
}
```

#### Response
 欄位 | 型態 | 說明 
 ---  | --- | ---
 count | int | 已計入的數量
 

```javascript
// HttpStatus:200
{
    "httpCode": 200,
    "result": {
        "data": {
            "count": 4
        }
    }
}
```


## 活動點擊

```url
POST /event/click
```

* 目前情境下, App端不需特地call 此API, 因已在 /event/info 這支API裡計算

#### Request
 
 欄位 | 型態  | 必填 | 預設 | 說明
 ---|---|---|---|---
 id | string | Y | | 活動id 
 
```javascript
{
    "id": "b02d3f3a-e55f-4f50-a557-55930111a4ae"
}
```

#### Response
 欄位 | 型態 | 說明 
 ---  | --- | ---
 count | int | 已計入的數量
 

```javascript
// HttpStatus:200
{
    "httpCode": 200,
    "result": {
        "data": {
            "count": 1
        }
    }
}
```
