groupService
Updated: 2023-07-11 15:16:47
1. Delete a Single Group Record
Description
删除研讨会分组记录
接口地址(仅做说明使用):https://api.polyv.net/live/v4/seminar/group/plan/delete
Call Constraints
- API calls are rate-limited. Click here for details. For common call exceptions, click here.
Unit Test
@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;
}
}
Unit Test Notes
- If the request is correct, a Boolean object is returned. The B-end processes business logic based on this object.
- If request parameter validation fails, a
PloyvSdkException is thrown. The error message can be found in PloyvSdkException.getMessage(), e.g., [Input parameter [xxx.chat.LivexxxRequest] object validation failed. Failed fields: [pic cannot be empty / msg cannot be empty]].
- If the server encounters an exception, a
PloyvSdkException is thrown. The error message can be found in PloyvSdkException.getMessage(), e.g., [Error returned from Polyv request. Request ID: 66e7ad29fd04425a84c2b2b562d2025b. Error reason: invalid signature.]
Request Parameter Description
Return Object Description
true indicates successful deletion, false indicates failure.
2. Clear Group Records
Description
清空研讨会分组记录
接口地址(仅做说明使用):https://api.polyv.net/live/v4/seminar/group/plan/delete-all
Call Constraints
- API calls are rate-limited. Click here for details. For common call exceptions, click here.
Unit Test
@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;
}
}
Unit Test Notes
- If the request is correct, a Boolean object is returned. The B-end processes business logic based on this object.
- If request parameter validation fails, a
PloyvSdkException is thrown. The error message can be found in PloyvSdkException.getMessage(), e.g., [Input parameter [xxx.chat.LivexxxRequest] object validation failed. Failed fields: [pic cannot be empty / msg cannot be empty]].
- If the server encounters an exception, a
PloyvSdkException is thrown. The error message can be found in PloyvSdkException.getMessage(), e.g., [Error returned from Polyv request. Request ID: 66e7ad29fd04425a84c2b2b562d2025b. Error reason: invalid signature.]
Request Parameter Description
Return Object Description
true indicates successful clearing, false indicates failure.
3. Query Group Records
Description
查询分组记录
接口地址(仅做说明使用):https://api.polyv.net/live/v4/seminar/group/plan/get
Call Constraints
- API calls are rate-limited. Click here for details. For common call exceptions, click here.
Unit Test
@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;
}
}
Unit Test Notes
- If the request is correct, a
SeminarGetGroupPlanResponse object is returned. The B-end processes business logic based on this object.
- If request parameter validation fails, a
PloyvSdkException is thrown. The error message can be found in PloyvSdkException.getMessage(), e.g., [Input parameter [xxx.chat.LivexxxRequest] object validation failed. Failed fields: [pic cannot be empty / msg cannot be empty]].
- If the server encounters an exception, a
PloyvSdkException is thrown. The error message can be found in PloyvSdkException.getMessage(), e.g., [Error returned from Polyv request. Request ID: 66e7ad29fd04425a84c2b2b562d2025b. Error reason: invalid signature.]
Request Parameter Description
Return Object Description
4. Batch Add Group Records
Description
批量新增分组记录
接口地址(仅做说明使用):https://api.polyv.net/live/v4/seminar/group/plan/save-batch
Call Constraints
- API calls are rate-limited. Click here for details. For common call exceptions, click here.
Unit Test
@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;
}
}
Unit Test Notes
- If the request is correct, a Boolean object is returned. The B-end processes business logic based on this object.
- If request parameter validation fails, a
PloyvSdkException is thrown. The error message can be found in PloyvSdkException.getMessage(), e.g., [Input parameter [xxx.chat.LivexxxRequest] object validation failed. Failed fields: [pic cannot be empty / msg cannot be empty]].
- If the server encounters an exception, a
PloyvSdkException is thrown. The error message can be found in PloyvSdkException.getMessage(), e.g., [Error returned from Polyv request. Request ID: 66e7ad29fd04425a84c2b2b562d2025b. Error reason: invalid signature.]
Request Parameter Description
Return Object Description
true indicates successful addition, false indicates failure.
5. Update a Single Group Record
Description
更新单个分组记录
接口地址(仅做说明使用):https://api.polyv.net/live/v4/seminar/group/plan/update
Call Constraints
- API calls are rate-limited. Click here for details. For common call exceptions, click here.
Unit Test
@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;
}
}
Unit Test Notes
- If the request is correct, a Boolean object is returned. The B-end processes business logic based on this object.
- If request parameter validation fails, a
PloyvSdkException is thrown. The error message can be found in PloyvSdkException.getMessage(), e.g., [Input parameter [xxx.chat.LivexxxRequest] object validation failed. Failed fields: [pic cannot be empty / msg cannot be empty]].
- If the server encounters an exception, a
PloyvSdkException is thrown. The error message can be found in PloyvSdkException.getMessage(), e.g., [Error returned from Polyv request. Request ID: 66e7ad29fd04425a84c2b2b562d2025b. Error reason: invalid signature.]
Request Parameter Description
Return Object Description
true indicates successful update, false indicates failure.