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. ]
请求入参描述
channelId
true
String
频道号
viewerId
true
String
需要删除的分组记录的参会人id,长度不超过64位
返回对象描述
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. ]
请求入参描述
channelId
true
String
频道号
返回对象描述
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. ]
请求入参描述
channelId
true
String
频道号
currentPage
false
Integer
页数,默认为1【对应api文档的pageNumber字段】
pageSize
false
Integer
每页显示的数据条数,默认每页显示20条数据
返回对象描述
pageSize
Integer
每页显示的数据条数,默认每页显示20条数据
currentPage
Integer
当前页【对应api文档的pageNumber字段】
totalItems
Integer
记录总条数
totalPage
Integer
总页数【对应api文档的totalPages字段】
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、接口调用有频率限制,详细请查看,调用常见异常,详细请查看
单元测试
@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
频道号
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、接口调用有频率限制,详细请查看,调用常见异常,详细请查看
单元测试
@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为更新失败
Last updated
Was this helpful?