保利威文档中心

幫助中心

groupService

更新時間:2023-07-11 15:16:47

1、刪除單一分組記錄

描述

删除研讨会分组记录
接口地址(仅做说明使用):https://api.polyv.net/live/v4/seminar/group/plan/delete

呼叫限制

1、API 呼叫有頻率限制,詳細請查看,呼叫常見異常,詳細請查看

單元測試

    @Test
    public void testDeleteGroupPlan() throws IOException, NoSuchAlgorithmException {
        SeminarDeleteGroupPlanRequest seminarDeleteGroupPlanRequest = new SeminarDeleteGroupPlanRequest();
        Boolean seminarDeleteGroupPlanResponse;
        try {
            String channelId = super.getChannelId();
            seminarDeleteGroupPlanRequest.setChannelId(channelId);
            seminarDeleteGroupPlanRequest.setViewerId("viewerId1");
            seminarDeleteGroupPlanResponse = new GroupPlanServiceImpl().deleteGroupPlan(seminarDeleteGroupPlanRequest);
            Assert.assertNotNull(seminarDeleteGroupPlanResponse);
            if (seminarDeleteGroupPlanResponse != null) {
                //to do something ......
                log.debug("测试删除单个分组记录成功 {}", JSON.toJSONString(seminarDeleteGroupPlanResponse));
            }
        } catch (PloyvSdkException e) {
            //参数校验不合格 或者 请求服务器端500错误,错误信息见PloyvSdkException.getMessage()
            log.error(e.getMessage(), e);
            // 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
            throw e;
        } catch (Exception e) {
            log.error("SDK调用异常", e);
            throw e;
        }
    }

單元測試說明

1、請求正確,回傳 Boolean 物件,B 端依據此物件處理業務邏輯;

2、請求參數驗證不合格,拋出 PloyvSdkException,錯誤訊息見 PloyvSdkException.getMessage(),如 [ 輸入參數 [xxx.chat.LivexxxRequest] 物件驗證失敗,失敗欄位 [pic 不能為空 / msg 不能為空] ]

3、伺服器處理異常,拋出 PloyvSdkException,錯誤訊息見 PloyvSdkException.getMessage(),如 [ 保利威請求回傳資料錯誤,請求流水號:66e7ad29fd04425a84c2b2b562d2025b,錯誤原因: invalid signature. ]

請求參數說明

參數名 必填 類型 說明
channelId true String 頻道號
viewerId true String 需要刪除的分組記錄的與會者 id,長度不超過 64 位元

回傳物件說明

true 為刪除成功,false 為刪除失敗




2、清空分組記錄

描述

清空研讨会分组记录
接口地址(仅做说明使用):https://api.polyv.net/live/v4/seminar/group/plan/delete-all

呼叫限制

1、API 呼叫有頻率限制,詳細請查看,呼叫常見異常,詳細請查看

單元測試

    @Test
    public void testDeleteAllGroupPlan() throws IOException, NoSuchAlgorithmException {
        SeminarDeleteAllGroupPlanRequest seminarDeleteAllGroupPlanRequest = new SeminarDeleteAllGroupPlanRequest();
        Boolean seminarDeleteAllGroupPlanResponse;
        try {
            String channelId = super.getChannelId();
            seminarDeleteAllGroupPlanRequest.setChannelId(channelId);
            seminarDeleteAllGroupPlanResponse = new GroupPlanServiceImpl().deleteAllGroupPlan(
                    seminarDeleteAllGroupPlanRequest);
            Assert.assertNotNull(seminarDeleteAllGroupPlanResponse);
            if (seminarDeleteAllGroupPlanResponse != null) {
                //to do something ......
                log.debug("测试清空分组记录成功 {}", JSON.toJSONString(seminarDeleteAllGroupPlanResponse));
            }
        } catch (PloyvSdkException e) {
            //参数校验不合格 或者 请求服务器端500错误,错误信息见PloyvSdkException.getMessage()
            log.error(e.getMessage(), e);
            // 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
            throw e;
        } catch (Exception e) {
            log.error("SDK调用异常", e);
            throw e;
        }
    }

單元測試說明

1、請求正確,回傳 Boolean 物件,B 端依據此物件處理業務邏輯;

2、請求參數驗證不合格,拋出 PloyvSdkException,錯誤訊息見 PloyvSdkException.getMessage(),如 [ 輸入參數 [xxx.chat.LivexxxRequest] 物件驗證失敗,失敗欄位 [pic 不能為空 / msg 不能為空] ]

3、伺服器處理異常,拋出 PloyvSdkException,錯誤訊息見 PloyvSdkException.getMessage(),如 [ 保利威請求回傳資料錯誤,請求流水號:66e7ad29fd04425a84c2b2b562d2025b,錯誤原因: invalid signature. ]

請求參數說明

參數名 必填 類型 說明
channelId true String 頻道號

回傳物件說明

true 為清空成功,false 為清空失敗




3、查詢分組記錄

描述

查询分组记录
接口地址(仅做说明使用):https://api.polyv.net/live/v4/seminar/group/plan/get

呼叫限制

1、API 呼叫有頻率限制,詳細請查看,呼叫常見異常,詳細請查看

單元測試

    @Test
    public void testGetGroupPlan() throws IOException, NoSuchAlgorithmException {
        SeminarGetGroupPlanRequest seminarGetGroupPlanRequest = new SeminarGetGroupPlanRequest();
        SeminarGetGroupPlanResponse seminarGetGroupPlanResponse;
        try {
            String channelId = super.getChannelId();
            seminarGetGroupPlanRequest.setChannelId(channelId);
            seminarGetGroupPlanResponse = new GroupPlanServiceImpl().getGroupPlan(seminarGetGroupPlanRequest);
            Assert.assertNotNull(seminarGetGroupPlanResponse);
            if (seminarGetGroupPlanResponse != null) {
                //to do something ......
                log.debug("测试查询分组记录成功 {}", JSON.toJSONString(seminarGetGroupPlanResponse));
            }
        } catch (PloyvSdkException e) {
            //参数校验不合格 或者 请求服务器端500错误,错误信息见PloyvSdkException.getMessage()
            log.error(e.getMessage(), e);
            // 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
            throw e;
        } catch (Exception e) {
            log.error("SDK调用异常", e);
            throw e;
        }
    }

單元測試說明

1、請求正確,回傳 SeminarGetGroupPlanResponse 物件,B 端依據此物件處理業務邏輯;

2、請求參數驗證不合格,拋出 PloyvSdkException,錯誤訊息見 PloyvSdkException.getMessage(),如 [ 輸入參數 [xxx.chat.LivexxxRequest] 物件驗證失敗,失敗欄位 [pic 不能為空 / msg 不能為空] ]

3、伺服器處理異常,拋出 PloyvSdkException,錯誤訊息見 PloyvSdkException.getMessage(),如 [ 保利威請求回傳資料錯誤,請求流水號:66e7ad29fd04425a84c2b2b562d2025b,錯誤原因: invalid signature. ]

請求參數說明

參數名 必填 類型 說明
channelId true String 頻道號
currentPage false Integer 頁數,預設為 1【對應 API 文件的 pageNumber 欄位】
pageSize false Integer 每頁顯示的資料筆數,預設每頁顯示 20 筆資料

回傳物件說明

參數名 類型 說明
contents Array 查詢的結果列表【詳見GroupPlan 參數說明
pageSize Integer 每頁顯示的資料筆數,預設每頁顯示 20 筆資料
currentPage Integer 目前頁【對應 API 文件的 pageNumber 欄位】
totalItems Integer 記錄總筆數
totalPage Integer 總頁數【對應 API 文件的 totalPages 欄位】
GroupPlan 參數說明
參數名 類型 說明
channelId String 頻道號
userId String 帳號 id
viewerId String 與會者 id
nickname String 與會者暱稱(僅作為辨認依據,不改變用戶與會名稱)
groupNo Integer 分組序號
groupName String 分組名稱
groupRole String 組內身份 leader:組長 member:組員






4、批次新增分組記錄

描述

批量新增分组记录
接口地址(仅做说明使用):https://api.polyv.net/live/v4/seminar/group/plan/save-batch

呼叫限制

1、API 呼叫有頻率限制,詳細請查看,呼叫常見異常,詳細請查看

單元測試

    @Test
    public void testSaveBatchGroupPlan() throws IOException, NoSuchAlgorithmException {
        SeminarSaveBatchGroupPlanRequest seminarSaveBatchGroupPlanRequest = new SeminarSaveBatchGroupPlanRequest();
        Boolean seminarSaveBatchGroupPlanResponse;
        try {
            String channelId = super.getChannelId();
            SeminarSaveBatchGroupPlanRequest.GroupPlan groupPlan = new SeminarSaveBatchGroupPlanRequest.GroupPlan();
            groupPlan.setViewerId("viewerId1");
            groupPlan.setNickname("viewerId1_nick");
            groupPlan.setGroupNo(1);
            groupPlan.setGroupRole("leader");
            List<SeminarSaveBatchGroupPlanRequest.GroupPlan> body = new ArrayList<>();
            body.add(groupPlan);
            seminarSaveBatchGroupPlanRequest.setList(body);
            seminarSaveBatchGroupPlanRequest.setChannelId(channelId);
            seminarSaveBatchGroupPlanResponse = new GroupPlanServiceImpl().saveBatchGroupPlan(
                    seminarSaveBatchGroupPlanRequest);
            Assert.assertNotNull(seminarSaveBatchGroupPlanResponse);
            if (seminarSaveBatchGroupPlanResponse != null) {
                //to do something ......
                log.debug("测试批量新增分组记录成功 {}", JSON.toJSONString(seminarSaveBatchGroupPlanResponse));
                //TODO 此处创建完成后删除了分组,正式使用需删除该语句
                super.deleteGroupPlan(channelId, "viewerId1");
            }
        } catch (PloyvSdkException e) {
            //参数校验不合格 或者 请求服务器端500错误,错误信息见PloyvSdkException.getMessage()
            log.error(e.getMessage(), e);
            // 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
            throw e;
        } catch (Exception e) {
            log.error("SDK调用异常", e);
            throw e;
        }
    }

單元測試說明

1、請求正確,回傳 Boolean 物件,B 端依據此物件處理業務邏輯;

2、請求參數驗證不合格,拋出 PloyvSdkException,錯誤訊息見 PloyvSdkException.getMessage(),如 [ 輸入參數 [xxx.chat.LivexxxRequest] 物件驗證失敗,失敗欄位 [pic 不能為空 / msg 不能為空] ]

3、伺服器處理異常,拋出 PloyvSdkException,錯誤訊息見 PloyvSdkException.getMessage(),如 [ 保利威請求回傳資料錯誤,請求流水號:66e7ad29fd04425a84c2b2b562d2025b,錯誤原因: invalid signature. ]

請求參數說明

參數名 必填 類型 說明
channelId true String 頻道號
list true Array 批次插入記錄【詳見GroupPlan 參數說明
GroupPlan 參數說明
參數名 必填 類型 說明
viewerId true String 與會者 id,長度不超過 64 位元(不可重複)
nickname true String 與會者暱稱,長度不超過 64 位元(僅作為辨認依據,不改變用戶與會名稱)
groupNo true Integer 分組序號,1~50 之間
groupRole true String 組內身份,一個分組內不能多於一個組長 leader:組長 member:組員

回傳物件說明

true 為新增成功,false 為新增失敗




5、更新單一分組記錄

描述

更新单个分组记录
接口地址(仅做说明使用):https://api.polyv.net/live/v4/seminar/group/plan/update

呼叫限制

1、API 呼叫有頻率限制,詳細請查看,呼叫常見異常,詳細請查看

單元測試

    @Test
    public void testUpdateGroupPlan() throws IOException, NoSuchAlgorithmException {
        SeminarUpdateGroupPlanRequest seminarUpdateGroupPlanRequest = new SeminarUpdateGroupPlanRequest();
        Boolean seminarUpdateGroupPlanResponse;
        try {
            String channelId = super.getChannelId();
            seminarUpdateGroupPlanRequest.setChannelId(channelId);
            seminarUpdateGroupPlanRequest.setOldViewerId("viewerId1");
            seminarUpdateGroupPlanRequest.setViewerId("newViewerId");
            seminarUpdateGroupPlanRequest.setNickname("nickname");
            seminarUpdateGroupPlanRequest.setGroupNo(1);
            seminarUpdateGroupPlanRequest.setGroupRole("member");
            seminarUpdateGroupPlanResponse = new GroupPlanServiceImpl().updateGroupPlan(seminarUpdateGroupPlanRequest);
            Assert.assertNotNull(seminarUpdateGroupPlanResponse);
            if (seminarUpdateGroupPlanResponse != null) {
                //to do something ......
                log.debug("测试更新单个分组记录成功 {}", JSON.toJSONString(seminarUpdateGroupPlanResponse));
            }
        } catch (PloyvSdkException e) {
            //参数校验不合格 或者 请求服务器端500错误,错误信息见PloyvSdkException.getMessage()
            log.error(e.getMessage(), e);
            // 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
            throw e;
        } catch (Exception e) {
            log.error("SDK调用异常", e);
            throw e;
        }
    }

單元測試說明

1、請求正確,回傳 Boolean 物件,B 端依據此物件處理業務邏輯;

2、請求參數驗證不合格,拋出 PloyvSdkException,錯誤訊息見 PloyvSdkException.getMessage(),如 [ 輸入參數 [xxx.chat.LivexxxRequest] 物件驗證失敗,失敗欄位 [pic 不能為空 / msg 不能為空] ]

3、伺服器處理異常,拋出 PloyvSdkException,錯誤訊息見 PloyvSdkException.getMessage(),如 [ 保利威請求回傳資料錯誤,請求流水號:66e7ad29fd04425a84c2b2b562d2025b,錯誤原因: invalid signature. ]

請求參數說明

參數名 必填 類型 說明
channelId true String 頻道號
oldViewerId true String 需要更新的分組記錄的原與會者 id,長度不超過 64 位元
viewerId false String 新的與會者 id,長度不超過 64 位元
nickname false String 新的與會者暱稱,長度不超過 64 位元(僅作為辨認依據,不改變用戶與會名稱)
groupNo false Integer 新的分組序號,1~50 之間
groupRole false String 新的組內身份 leader:組長 member:組員

回傳物件說明

true 為更新成功,false 為更新失敗

联系客服,在线咨询