Group Service

1、删除单个分组记录

描述

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

调用约束

1、接口调用有频率限制,详细请查看,调用常见异常,详细请查看

单元测试

	@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. ]

请求入参描述

返回对象描述

true为删除成功,false为删除失败


2、清空分组记录

描述

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

调用约束

1、接口调用有频率限制,详细请查看,调用常见异常,详细请查看

单元测试

	@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. ]

请求入参描述

返回对象描述

true为清空成功,false为清空失败


3、查询分组记录

描述

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

调用约束

1、接口调用有频率限制,详细请查看,调用常见异常,详细请查看

单元测试

	@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. ]

请求入参描述

返回对象描述

GroupPlan参数描述


4、批量新增分组记录

描述

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

调用约束

1、接口调用有频率限制,详细请查看,调用常见异常,详细请查看

单元测试

	@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. ]

请求入参描述

GroupPlan参数描述

返回对象描述

true为新增成功,false为新增失败


5、更新单个分组记录

描述

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

调用约束

1、接口调用有频率限制,详细请查看,调用常见异常,详细请查看

单元测试

	@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. ]

请求入参描述

返回对象描述

true为更新成功,false为更新失败

Last updated