# API DOC Response 共用狀態說明:每隻API response 都包含此狀態 | 欄位 | 說明 | | ------------ | ------------------------------ | | `resultCode` | "000" 正常 | | `resultCode` | "001" 传送失败 | | `resultCode` | "002" 登入異常 | | `resultCode` | "003" Token 过期 | | `resultCode` | "004" 查无权限设定 | | `resultCode` | "005" 权限未开放 | | `resultCode` | "006" 参数错误 (查無 token) | | `resultCode` | "007" 参数错误 (查無 id) | | `resultCode` | "008" 发生例外 | | `resultCode` | "009" 资料错误 | # API 列表 ## 域名檢測(CDN) ### 域名檢測(CDN) 列表 ```plaintext POST /api/Cdn/get_list ``` | 欄位 | 型態 | 必要參數 | 說明 | | ---------- | ------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tId` | string | V | token | | `pagesize` | int | V | 一頁幾筆 | | `page` | int | V | 第幾頁 | | `sort_col` | string | V | 排序欄位 <br> 'id' by 序號 <br> 'domain' by 網域 <br> 'name' by 名稱 <br> 'in_maja' by 國內外 <br> 'created_time' by 新增時間 <br> 'updated_time' by 更新時間 | | `sort_by` | string | V | 排序 = 設定值 <br> 正序 'ASC' <br>倒序 'DESC' | | `vip` | int | V | 環境 = 設定值 <br> vip1 = 1 <br> vip2 = 2 <br> vip3 = 3 | Response example: ```json { "resultCode": "000", "resultMap": { "msg": "传送成功", "data": [ { "id": "2", "domain": "AA", "area": "AAA", "name": "AAA", "in_maja": "1", "username": null, "created_time": "2020-08-05 13:20:49", "updated_time": "2020-08-05 13:20:49" }, ], "total": 49 } } ``` Response 說明: | 欄位 | 說明 | | --------------------------------- | ------------------------------------------------------ | | `resultCode` | "000" 正常 | | `resultMap.total` | 列表總筆數 | | `resultMap.data.[0].id` | cdn list 主KEY | | `resultMap.data.[0].domain` | 網域名稱 | | `resultMap.data.[0].area` | 地區 | | `resultMap.data.[0].name` | 名稱 | | `resultMap.data.[0].in_maja` | 馬甲內使用 <br> 1 國內 <br> 2 海外 <br> 3 國內與海外 | | `resultMap.data.[0].username` | 操作者名稱 | | `resultMap.data.[0].created_time` | 新增日期 | | `resultMap.data.[0].updated_time` | 更新日期 | --- ### 域名檢測(CDN) 下拉Option選單 ```plaintext POST /api/Cdn/get_option ``` | 欄位 | 型態 | 必要參數 | 說明 | | ----- | ------ | -------- | ------------------------------------------------------- | | `tId` | string | V | token | | `vip` | int | V | 環境 = 設定值 <br> vip1 = 1 <br> vip2 = 2 <br> vip3 = 3 | Response example: ```json { "resultCode": "000", "resultMap": { "msg": "传送成功", "data": [ { "id": "2", "domain": "AA", "area": "AAA", "name": "AAA", "in_maja": "1", "username": null, "created_time": "2020-08-05 13:20:49", "updated_time": "2020-08-05 13:20:49" }, ] } } ``` Response 說明: | 欄位 | 說明 | | --------------------------------- | ------------------------------------------------------ | | `resultCode` | "000" 正常 | | `resultMap.data.[0].id` | cdn list 主KEY | | `resultMap.data.[0].domain` | 網域名稱 | | `resultMap.data.[0].area` | 地區 | | `resultMap.data.[0].name` | 名稱 | | `resultMap.data.[0].in_maja` | 馬甲內使用 <br> 1 國內 <br> 2 海外 <br> 3 國內與海外 | | `resultMap.data.[0].username` | 操作者名稱 | | `resultMap.data.[0].created_time` | 新增日期 | | `resultMap.data.[0].updated_time` | 更新日期 | --- ### 域名檢測(CDN) 新增 ```plaintext POST /api/Cdn/add ``` | 欄位 | 型態 | 必要參數 | 說明 | | --------- | ------ | -------- | ------------------------------------------------------- | | `tId` | string | V | token | | `vip` | int | V | 環境 = 設定值 <br> vip1 = 1 <br> vip2 = 2 <br> vip3 = 3 | | `domain` | string | V | 網域名稱 | | `area` | string | V | 地區 | | `name` | string | V | 名稱 | | `in_maja` | int | V | 馬甲內使用 <br> 1 國內 <br> 2 海外 <br> 3 國內與海外 | Response example: ```json { "resultCode": "000", "resultMap": { "msg": "传送成功", "data": true } } ``` Response 說明: | 欄位 | 說明 | | ------------ | ---------- | | `resultCode` | "000" 正常 | --- ### 域名檢測(CDN) 刪除 ```plaintext POST /api/Cdn/del ``` | 欄位 | 型態 | 必要參數 | 說明 | | ----- | ------ | -------- | -------------- | | `tId` | string | V | token | | `id` | int | V | CDN LIST 主KEY | Response example: ``` { "resultCode": "000", "resultMap": { "msg": "传送成功", "data": true } } ``` Response 說明: | 欄位 | 說明 | | ------------ | ---------- | | `resultCode` | "000" 正常 | --- ### 域名檢測(CDN) 更新 ```plaintext POST /api/Cdn/update ``` | 欄位 | 型態 | 必要參數 | 說明 | | --------- | ------ | -------- | ------------------------------------------------------ | | `tId` | string | V | token | | `id` | int | V | cdn list 主KEY | | `domain` | string | V | 網域名稱 | | `area` | string | V | 地區 | | `name` | string | V | 名稱 | | `in_maja` | int | V | 馬甲內使用 <br> 1 國內 <br> 2 海外 <br> 3 國內與海外 | Response example: ```json { "resultCode": "000", "resultMap": { "msg": "传送成功", "data": true } } ``` Response 說明: | 欄位 | 說明 | | ------------ | ---------- | | `resultCode` | "000" 正常 | --- ## 域名檢測 ### 域名檢測 新增 from (Excel) ```plaintext POST /api/server/importData ``` | 欄位 | 型態 | 必要參數 | 說明 | | -------- | ------ | -------- | ------------------------------------ | | `tId` | string | V | token | | `myfile` | file | V | html input name="myfile" type="file" | EXCEL SAMPLE 第一行為標題, 第二行開始為資料 | VIP | 商戶名 | 商戶號 | 用途 | 域名 | 備註 | 證書購買日 (日期格式 2020/02/02 or 2020-02-02) | CDN | | --- | ------ | ------ | ---- | -------------- | ---- | ---------------------------------------------- | ------------ | | 1 | 彩晶 | cjcp | AA | www.google.com | CC | 2019/2/18 | CDN 中文名稱 | Response example: ```json { "resultCode": "000", "resultMap": { "msg": "传送成功", "data": true } } ``` Response 說明: | 欄位 | 說明 | | --------------- | ----------------------------------------------- | | `resultCode` | "000" 正常 | | `resultMap.msg` | 錯誤訊息 (resultCode 非000即前端需輸出錯誤訊息) | --- ### 域名檢測 列表 ```plaintext POST /api/server/queryData ``` | 欄位 | 型態 | 必要參數 | 說明 | | ---------- | ------ | -------- | -------------------------------- | | `tId` | string | V | token | | `page` | int | | 第幾頁 default 1 | | `pageSize` | int | | 一頁幾筆 default 30 | | `sort_col` | string | | 排序用欄位 default id | | `sort_by` | string | | 排序順序 asc 、 desc default asc | | `export` | int | V | 0=JSON 1=EXCEL | | `vip` | int | V | 讀取哪個VIP環境 | | `lobby_id` | int | | 讀取哪個廳 | Response example: ```json { "resultCode": "000", "resultMap": { "msg": "传送成功", "data": [ { "id": "2", "lobby_id": "1", "purpose": "主頁", "domain_all": "abc.com", "analyze_domain": "ubcy39.v1cchkldrlok168.com.", "area": "bbb", "in_maja": "1", "is_on": "1", "state": "1", "memo": "備註", "buy_date": "2020-06-03", "updated_time": "2020-08-13 10:32:45", "last_check_time": "2020-08-12 16:14:42", "updated_user": "charlie" } ], "total": 1 } } ``` Response 說明: | 欄位 | 說明 | | ------------------------------------ | ----------------------------------- | | `resultCode` | "000" 正常 | | `resultMap.data.[0].id` | 流水號 | | `resultMap.data.[0].lobby_id` | 廳流水號 | | `resultMap.data.[0].purpose` | 目的 | | `resultMap.data.[0].domain_all` | 域名 | | `resultMap.data.[0].analyze_domain` | 解析結果 | | `resultMap.data.[0].area` | CDN | | `resultMap.data.[0].in_maja` | 馬甲內使用 1=國內 2=海外 3=國內海外 | | `resultMap.data.[0].is_on` | 狀態 0=停用 1=啟用 | | `resultMap.data.[0].state` | 燈號 1=綠燈 2=黃燈 3=紅燈 | | `resultMap.data.[0].memo` | 備註 | | `resultMap.data.[0].buy_date` | 證書購買日期 | | `resultMap.data.[0].updated_time` | 最後更新時間 | | `resultMap.data.[0].last_check_time` | 最後檢測時間 | | `resultMap.data.[0].updated_user` | 最後更新者 | | `resultMap.total` | 總筆數 | --- ### 域名檢測 開關 ```plaintext POST /api/server/switchStatus ``` | 欄位 | 型態 | 必要參數 | 說明 | | ------- | ------ | -------- | ------------------ | | `tId` | string | V | token | | `id` | int | | 欲修改的資料流水號 | | `is_on` | int | | 0=停用 1=啟用 | Response example: ```json { "resultCode": "000", "resultMap": { "msg": "传送成功" } } ``` Response 說明: | 欄位 | 說明 | | ------------ | ---------- | | `resultCode` | "000" 正常 | --- ### 域名檢測 新增 ```plaintext POST /api/server/createData ``` | 欄位 | 型態 | 必要參數 | 說明 | | ------------ | ------ | -------- | ---------------------------------- | | `tId` | string | V | token | | `lobby_id` | int | V | 域名所屬廳流水號 | | `purpose` | string | V | 目的 | | `domain_all` | string | V | 域名 | | `buy_date` | date | V | 證書購買日期(無時間) EX:2020-06-03 | | `memo` | string | V | 備註 | | `cdn_id` | int | V | CDN 下拉選單id | Response example: ```json { "resultCode": "000", "resultMap": { "msg": "传送成功" } } ``` Response 說明: | 欄位 | 說明 | | ------------ | ---------- | | `resultCode` | "000" 正常 | --- ### 域名檢測 修改 ```plaintext POST /api/server/updateData ``` | 欄位 | 型態 | 必要參數 | 說明 | | ------------ | ------ | -------- | ---------------------------------- | | `tId` | string | V | token | | `id` | int | V | 欲修改之域名流水號 | | `lobby_id` | int | V | 域名所屬廳流水號 | | `purpose` | string | V | 目的 | | `domain_all` | string | V | 域名 | | `buy_date` | date | V | 證書購買日期(無時間) EX:2020-06-03 | | `memo` | string | V | 備註 | | `cdn_id` | int | V | CDN 下拉選單id | Response example: ```json { "resultCode": "000", "resultMap": { "msg": "传送成功" } } ``` Response 說明: | 欄位 | 說明 | | ------------ | ---------- | | `resultCode` | "000" 正常 | --- ### 域名檢測 刪除 ```plaintext POST /api/server/deleteData ``` | 欄位 | 型態 | 必要參數 | 說明 | | ----- | ------ | -------- | ------------------ | | `tId` | string | V | token | | `id` | int | V | 欲刪除之域名流水號 | Response example: ```json { "resultCode": "000", "resultMap": { "msg": "传送成功" } } ``` Response 說明: | 欄位 | 說明 | | ------------ | ---------- | | `resultCode` | "000" 正常 | --- ### 域名檢測 取得燈號詳細資訊 ```plaintext POST /api/server/getLightDetail ``` | 欄位 | 型態 | 必要參數 | 說明 | | ----- | ------ | -------- | ---------- | | `tId` | string | V | token | | `id` | int | V | 域名流水號 | Response example: ```json { "resultCode": "000", "resultMap": { "msg": "传送成功", "data": "2020-08-13 14:24:26 被牆檢測:被牆(该域名正常)<br/><br/>2020-08-13 14:24:26 被牆檢測:被牆(ok)<br/><br/>2020-08-13 14:24:26 被牆檢測:被牆(恭喜,该域名没有被墙。)<br/><br/>2020-08-13 14:24:26 網域解析:被牆(dafa1.cchkldrlok168.com.)<br/><br/>" } } ``` Response 說明: | 欄位 | 說明 | | ---------------- | ---------------------- | | `resultCode` | "000" 正常 | | `resultMap.data` | 顯示被牆跟網域檢測字串 | --- ## 廳別設定 ### 廳別設定 新增 ```plaintext POST /api/lobby/create ``` | 欄位 | 型態 | 必要參數 | 說明 | | -------------- | ------ | -------- | ------------------- | | `tId` | string | V | token | | `vip` | int | V | 廳所屬VIP | | `lobby_name` | string | V | 廳中文名稱 EX:眾樂 | | `lobby_number` | string | V | 廳英文代號 EX:zlcai | Response example: ```json { "resultCode": "000", "resultMap": { "msg": "传送成功" } } ``` Response 說明: | 欄位 | 說明 | | ------------ | ---------- | | `resultCode` | "000" 正常 | --- ### 廳別設定 刪除 ```plaintext POST /api/lobby/create ``` | 欄位 | 型態 | 必要參數 | 說明 | | ----- | ------ | -------- | -------- | | `tId` | string | V | token | | `id` | int | V | 廳流水號 | Response example: ```json { "resultCode": "000", "resultMap": { "msg": "传送成功" } } ``` Response 說明: | 欄位 | 說明 | | ------------ | ---------- | | `resultCode` | "000" 正常 | --- ### 廳別設定 列表 ```plaintext POST /api/lobby/getLobbyByVip ``` | 欄位 | 型態 | 必要參數 | 說明 | | ----- | ------ | -------- | ------- | | `tId` | string | V | token | | `vip` | int | V | VIP編號 | Response example: ```json { "resultCode": "000", "resultMap": { "msg": "传送成功", "data": [ { "id": "3", "lobby_name": "彩晶", "lobby_number": "cjcp" } ] } } ``` Response 說明: | 欄位 | 說明 | | --------------------------------- | ---------- | | `resultCode` | "000" 正常 | | `resultMap.data.[0].id` | 流水號 | | `resultMap.data.[0].lobby_name` | 中文名稱 | | `resultMap.data.[0].lobby_number` | 廳英文代號 | --- ## 排程設定 ### 排程設定 設定 ```plaintext POST /api/jobsConfig/set ``` | 欄位 | 型態 | 必要參數 | 說明 | | ------------- | ------ | -------- | ---------------------- | | `tId` | string | V | token | | `every_hour` | int | V | 排程間隔小時 | | `check_type1` | int | V | 被牆檢測 0=停用 1=啟用 | | `check_type2` | int | V | 汙染檢測 0=停用 1=啟用 | | `check_type3` | int | V | 解析檢測 0=停用 1=啟用 | | `is_on` | int | V | 排程啟用 0=停用 1=啟用 | Response example: ```json { "resultCode": "000", "resultMap": { "msg": "传送成功" } } ``` Response 說明: | 欄位 | 說明 | | ------------ | ---------- | | `resultCode` | "000" 正常 | --- ### 排程設定 讀取 ```plaintext POST /api/jobsConfig/get ``` | 欄位 | 型態 | 必要參數 | 說明 | | ----- | ------ | -------- | ----- | | `tId` | string | V | token | Response example: ```json { "resultCode": "000", "resultMap": { "msg": "传送成功", "data": { "every_hour": "3", "start_time": "2020-08-13 17:00:21", "check_type1": "1", "check_type2": "0", "check_type3": "1", "updated_time": "2020-08-13 14:00:21", "updated_user": "charlie", "last_finished_time": "2020-08-12 17:29:07" } } } ``` Response 說明: | 欄位 | 說明 | | ----------------------------------- | ---------------------- | | `resultCode` | "000" 正常 | | `resultMap.data.every_hour` | 排程間隔小時 | | `resultMap.data.start_time` | 下次檢測時間 | | `resultMap.data.check_type1` | 被牆檢測 0=停用 1=啟用 | | `resultMap.data.check_type2` | 汙染檢測 0=停用 1=啟用 | | `resultMap.data.check_type3` | 解析檢測 0=停用 1=啟用 | | `resultMap.data.updated_time` | 最後更新時間 | | `resultMap.data.updated_user` | 最後更新者 | | `resultMap.data.last_finished_time` | 最後檢測時間 | --- ### 寄信設定 設定 ```plaintext POST /api/jobsConfig/pauseEmail ``` | 欄位 | 型態 | 必要參數 | 說明 | | ------------- | ------ | -------- | ------------------------------------------------------ | | `tId` | string | V | token | | `time_server` | int | | 網域失效寄信暫停秒數 int=暫停秒數 0=永久暫停 不傳=繼續寄信 | | `time_api` | int | | API失效寄信暫停秒數 int=暫停秒數 0=永久暫停 不傳=繼續寄信 | Response example: ```json { "resultCode": "000", "resultMap": { "msg": "传送成功" } } ``` Response 說明: | 欄位 | 說明 | | ------------ | ---------- | | `resultCode` | "000" 正常 | --- ### 寄信設定 讀取 ```plaintext POST /api/jobsConfig/getEmailStatus ``` | 欄位 | 型態 | 必要參數 | 說明 | | ----- | ------ | -------- | ----- | | `tId` | string | V | token | Response example: ```json { "resultCode": "000", "resultMap": { "msg": "传送成功", "data": { "server_expire_at": false, "api_expire_at": 0 } } } ``` Response 說明: | 欄位 | 說明 | | --------------------------------- | ------------ | | `resultCode` | "000" 正常 | | `resultMap.data.server_expire_at` | 域名失效寄信暫停至 時間戳=時間 0=永久暫停 false=無暫停| | `resultMap.data.api_expire_at` | API失效寄信暫停至 時間戳=時間 0=永久暫停 false=無暫停| ---