# 黑白名單設定
## 新增Collection: ChatBlocklist
| params | data type | notes |
| ------------ | --------- |:----------------- |
| type | string | 1:黑名單 2:白名單 |
| ecSiteId | string | Ecsites\_key |
| ecUserId | string | Players ecUserId |
| updatedAt | timestamp | 狀態更新時間 |
| expiredAt | timestamp | 狀態到期時間 |
| updatedBy | string | Accounts\_key |
| createdAt | timestamp | data created time |
| createdBy | string | Accounts\_key |
| deletedAt | timestamp | data deleted time |
| deletedBy | string | Accounts\_key |
# 黑白名單清單
```
GET {{api_server_url}}/api/v2/admin/blocklist/
```
## Request
| 參數名稱 | 參數種類 | 參數型態 | 必填 | 參數說明 |
| --------- | -------- | -------- | ---- |:----------------- |
| page | query | string | Y | 頁數 |
| limit | query | string | Y | 一頁有幾筆 |
| ecSiteId | query | string | Y | Ecsites\_key |
| ecUserId | query | string | N | Players ecUserId |
| type | query | string | Y | 1:黑名單 2:白名單 |
| state | query | string | N | 1:封鎖中 2.已解封 |
| expiredAt | query | string | N | 狀態到期時間 |
## Response
**meta**
| 參數名稱 | 參數種類 | 參數型態 | 必填 | 參數說明 |
| ----------- | -------- | -------- | ---- | -------------- |
| currentPage | body | number | Y | 目前頁數 |
| perPage | body | number | Y | 每一頁幾筆資料 |
| totalCounts | body | number | Y | 總資料筆數 |
| totalPages | body | number | Y | 總頁數 |
**items**
#### lastLoginTime join Collection:Players
| 參數名稱 | 參數種類 | 參數型態 | 必填 | 參數說明 |
| ------------------ | -------- | -------- | ---- | ------------------ |
| \_key | body | string | Y | ChatBlocklist\_key |
| ecUserId | body | string | Y | Players ecUserId |
| updateAt | body | string | Y | 狀態更新時間 |
| expiredAt | body | string | Y | 狀態到期時間 |
| lastLoginTime | body | string | Y | 上次上線時間 |
```
{
"statusCode": "",
"meta":{
"currentPage": 1,
"perPage": 20,
"totalCounts": 1248,
"totalPages": 20
},
"items: [{
"_key": "851",
"ecUserId": "iggytest",
"updateAt": "1622678487000",
"expiredAt": "1622732487000",
"lastLoginTime": "1622732487000",
},{
"_key": "852",
"ecUserId": "iggytest1",
"updateAt": "1622678487000",
"expiredAt": "0",
"lastLoginTime": "1622732487000",
}]
}
```
# 新增黑白名單
```
POST {{api_server_url}}/api/v2/admin/blocklist/
```
## Request
| 參數名稱 | 參數種類 | 參數型態 | 必填 | 參數說明 |
| ---------------- |:-------- | -------- |:---- |:----------------- |
| ecSiteId | body | number | Y | Ecsites\_key |
| ecUserId | body | string | Y | Players ecUserId |
| type | body | number | Y | 1:黑名單 2:白名單 |
| expiredAt | body | timestamp | Y | 狀態到期時間 |
```
{
"ecSiteId": 1,
"ecUserId": "iggytest",
"type": 1,
"expiredAt": 1622732487000,
}
```
```
{
"ecSiteId": 1,
"ecUserId": "iggytest1",
"type": 1,
"expiredAt": 0,
}
```
## Response
```
{
"statusCode": "2040001"
}
```
# 刪除黑白名單
```
DELETE {{api_server_url}}/api/v2/admin/blocklist/{_key}
```
## Request
| 參數名稱 | 參數種類 | 參數型態 | 必填 | 參數說明 |
| -------- | -------- | -------- | ---- | -------------- |
| \_key | params | number | Y | Chatblocklist\_key |
## Response
```
{
"statusCode": "2040001"
}
```
# 更新黑白名單
```
PUT {{api_server_url}}/api/v2/admin/blocklist/{_key}
```
## Request
| 參數名稱 | 參數種類 | 參數型態 | 必填 | 參數說明 |
|:--------- | -------- | --------- | ---- |:------------------ |
| \_key | params | number | Y | Chatblocklist\_key |
| type | body | string | Y | 1:黑名單 2:白名單 |
| expiredAt | body | timestamp | Y | 狀態到期時間 |
```
{
"_key": 123,
"type":"1",
"expiredAt": 1622732487000,
}
```
## Response
```
{
"statusCode": "2040001"
}
```
# 下載報表
```
GET {{api_server_url}}/api/v2/admin/blocklist/{_key}
```
## Request
| 參數名稱 | 參數種類 | 參數型態 | 必填 | 參數說明 |
|:--------- | -------- | --------- | ---- |:------------------ |
| \_key | params | number | Y | Chatblocklist\_key |
| type | body | string | Y | 1:黑名單 2:白名單 |
| expiredAt | body | timestamp | Y | 狀態到期時間 |
```
{
"_key": 123,
"type":"1",
"expiredAt": 1622732487000,
}
```
## Response
```
{
"statusCode": "2040001"
}